• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-java / #16562

18 Oct 2024 07:00PM UTC coverage: 12.614% (-0.1%) from 12.74%
#16562

push

github

web-flow
Merge pull request #1897 from stripe/latest-codegen-beta

Update generated code for beta

49 of 1978 new or added lines in 47 files covered. (2.48%)

68 existing lines in 20 files now uncovered.

18798 of 149026 relevant lines covered (12.61%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

2.2
/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.net.ApiRequestParams;
6
import com.stripe.param.common.EmptyParam;
7
import java.util.ArrayList;
8
import java.util.HashMap;
9
import java.util.List;
10
import java.util.Map;
11
import lombok.Getter;
12

13
@Getter
14
public class PaymentLinkUpdateParams extends ApiRequestParams {
15
  /**
16
   * Whether the payment link's {@code url} is active. If {@code false}, customers visiting the URL
17
   * will be shown a page saying that the link has been deactivated.
18
   */
19
  @SerializedName("active")
20
  Boolean active;
21

22
  /** Behavior after the purchase is complete. */
23
  @SerializedName("after_completion")
24
  AfterCompletion afterCompletion;
25

26
  /** Enables user redeemable promotion codes. */
27
  @SerializedName("allow_promotion_codes")
28
  Boolean allowPromotionCodes;
29

30
  /** Configuration for automatic tax collection. */
31
  @SerializedName("automatic_tax")
32
  AutomaticTax automaticTax;
33

34
  /** Configuration for collecting the customer's billing address. Defaults to {@code auto}. */
35
  @SerializedName("billing_address_collection")
36
  BillingAddressCollection billingAddressCollection;
37

38
  /**
39
   * Collect additional information from your customer using custom fields. Up to 3 fields are
40
   * supported.
41
   */
42
  @SerializedName("custom_fields")
43
  Object customFields;
44

45
  /** Display additional text for your customers using custom text. */
46
  @SerializedName("custom_text")
47
  CustomText customText;
48

49
  /**
50
   * Configures whether <a href="https://stripe.com/docs/api/checkout/sessions">checkout
51
   * sessions</a> created by this payment link create a <a
52
   * href="https://stripe.com/docs/api/customers">Customer</a>.
53
   */
54
  @SerializedName("customer_creation")
55
  CustomerCreation customerCreation;
56

57
  /** Specifies which fields in the response should be expanded. */
58
  @SerializedName("expand")
59
  List<String> expand;
60

61
  /**
62
   * Map of extra parameters for custom features not available in this client library. The content
63
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
64
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
65
   * param object. Effectively, this map is flattened to its parent instance.
66
   */
67
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
68
  Map<String, Object> extraParams;
69

70
  /** The custom message to be displayed to a customer when a payment link is no longer active. */
71
  @SerializedName("inactive_message")
72
  Object inactiveMessage;
73

74
  /** Generate a post-purchase Invoice for one-time payments. */
75
  @SerializedName("invoice_creation")
76
  InvoiceCreation invoiceCreation;
77

78
  /**
79
   * The line items representing what is being sold. Each line item represents an item being sold.
80
   * Up to 20 line items are supported.
81
   */
82
  @SerializedName("line_items")
83
  List<PaymentLinkUpdateParams.LineItem> lineItems;
84

85
  /**
86
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
87
   * to an object. This can be useful for storing additional information about the object in a
88
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
89
   * be unset by posting an empty value to {@code metadata}. Metadata associated with this Payment
90
   * Link will automatically be copied to <a
91
   * href="https://stripe.com/docs/api/checkout/sessions">checkout sessions</a> created by this
92
   * payment link.
93
   */
94
  @SerializedName("metadata")
95
  Map<String, String> metadata;
96

97
  /**
98
   * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code
99
   * payment} mode.
100
   */
101
  @SerializedName("payment_intent_data")
102
  PaymentIntentData paymentIntentData;
103

104
  /**
105
   * Specify whether Checkout should collect a payment method. When set to {@code if_required},
106
   * Checkout will not collect a payment method when the total due for the session is 0.This may
107
   * occur if the Checkout Session includes a free trial or a discount.
108
   *
109
   * <p>Can only be set in {@code subscription} mode. Defaults to {@code always}.
110
   *
111
   * <p>If you'd like information on how to collect a payment method outside of Checkout, read the
112
   * guide on <a href="https://stripe.com/docs/payments/checkout/free-trials">configuring
113
   * subscriptions with a free trial</a>.
114
   */
115
  @SerializedName("payment_method_collection")
116
  PaymentMethodCollection paymentMethodCollection;
117

118
  /**
119
   * The list of payment method types that customers can use. Pass an empty string to enable dynamic
120
   * payment methods that use your <a
121
   * href="https://dashboard.stripe.com/settings/payment_methods">payment method settings</a>.
122
   */
123
  @SerializedName("payment_method_types")
124
  Object paymentMethodTypes;
125

126
  /** Settings that restrict the usage of a payment link. */
127
  @SerializedName("restrictions")
128
  Object restrictions;
129

130
  /** Configuration for collecting the customer's shipping address. */
131
  @SerializedName("shipping_address_collection")
132
  Object shippingAddressCollection;
133

134
  /**
135
   * When creating a subscription, the specified configuration data will be used. There must be at
136
   * least one line item with a recurring price to use {@code subscription_data}.
137
   */
138
  @SerializedName("subscription_data")
139
  SubscriptionData subscriptionData;
140

141
  /** Controls tax ID collection during checkout. */
142
  @SerializedName("tax_id_collection")
143
  TaxIdCollection taxIdCollection;
144

145
  private PaymentLinkUpdateParams(
146
      Boolean active,
147
      AfterCompletion afterCompletion,
148
      Boolean allowPromotionCodes,
149
      AutomaticTax automaticTax,
150
      BillingAddressCollection billingAddressCollection,
151
      Object customFields,
152
      CustomText customText,
153
      CustomerCreation customerCreation,
154
      List<String> expand,
155
      Map<String, Object> extraParams,
156
      Object inactiveMessage,
157
      InvoiceCreation invoiceCreation,
158
      List<PaymentLinkUpdateParams.LineItem> lineItems,
159
      Map<String, String> metadata,
160
      PaymentIntentData paymentIntentData,
161
      PaymentMethodCollection paymentMethodCollection,
162
      Object paymentMethodTypes,
163
      Object restrictions,
164
      Object shippingAddressCollection,
165
      SubscriptionData subscriptionData,
166
      TaxIdCollection taxIdCollection) {
1✔
167
    this.active = active;
1✔
168
    this.afterCompletion = afterCompletion;
1✔
169
    this.allowPromotionCodes = allowPromotionCodes;
1✔
170
    this.automaticTax = automaticTax;
1✔
171
    this.billingAddressCollection = billingAddressCollection;
1✔
172
    this.customFields = customFields;
1✔
173
    this.customText = customText;
1✔
174
    this.customerCreation = customerCreation;
1✔
175
    this.expand = expand;
1✔
176
    this.extraParams = extraParams;
1✔
177
    this.inactiveMessage = inactiveMessage;
1✔
178
    this.invoiceCreation = invoiceCreation;
1✔
179
    this.lineItems = lineItems;
1✔
180
    this.metadata = metadata;
1✔
181
    this.paymentIntentData = paymentIntentData;
1✔
182
    this.paymentMethodCollection = paymentMethodCollection;
1✔
183
    this.paymentMethodTypes = paymentMethodTypes;
1✔
184
    this.restrictions = restrictions;
1✔
185
    this.shippingAddressCollection = shippingAddressCollection;
1✔
186
    this.subscriptionData = subscriptionData;
1✔
187
    this.taxIdCollection = taxIdCollection;
1✔
188
  }
1✔
189

190
  public static Builder builder() {
191
    return new Builder();
1✔
192
  }
193

194
  public static class Builder {
1✔
195
    private Boolean active;
196

197
    private AfterCompletion afterCompletion;
198

199
    private Boolean allowPromotionCodes;
200

201
    private AutomaticTax automaticTax;
202

203
    private BillingAddressCollection billingAddressCollection;
204

205
    private Object customFields;
206

207
    private CustomText customText;
208

209
    private CustomerCreation customerCreation;
210

211
    private List<String> expand;
212

213
    private Map<String, Object> extraParams;
214

215
    private Object inactiveMessage;
216

217
    private InvoiceCreation invoiceCreation;
218

219
    private List<PaymentLinkUpdateParams.LineItem> lineItems;
220

221
    private Map<String, String> metadata;
222

223
    private PaymentIntentData paymentIntentData;
224

225
    private PaymentMethodCollection paymentMethodCollection;
226

227
    private Object paymentMethodTypes;
228

229
    private Object restrictions;
230

231
    private Object shippingAddressCollection;
232

233
    private SubscriptionData subscriptionData;
234

235
    private TaxIdCollection taxIdCollection;
236

237
    /** Finalize and obtain parameter instance from this builder. */
238
    public PaymentLinkUpdateParams build() {
239
      return new PaymentLinkUpdateParams(
1✔
240
          this.active,
241
          this.afterCompletion,
242
          this.allowPromotionCodes,
243
          this.automaticTax,
244
          this.billingAddressCollection,
245
          this.customFields,
246
          this.customText,
247
          this.customerCreation,
248
          this.expand,
249
          this.extraParams,
250
          this.inactiveMessage,
251
          this.invoiceCreation,
252
          this.lineItems,
253
          this.metadata,
254
          this.paymentIntentData,
255
          this.paymentMethodCollection,
256
          this.paymentMethodTypes,
257
          this.restrictions,
258
          this.shippingAddressCollection,
259
          this.subscriptionData,
260
          this.taxIdCollection);
261
    }
262

263
    /**
264
     * Whether the payment link's {@code url} is active. If {@code false}, customers visiting the
265
     * URL will be shown a page saying that the link has been deactivated.
266
     */
267
    public Builder setActive(Boolean active) {
268
      this.active = active;
1✔
269
      return this;
1✔
270
    }
271

272
    /** Behavior after the purchase is complete. */
273
    public Builder setAfterCompletion(PaymentLinkUpdateParams.AfterCompletion afterCompletion) {
274
      this.afterCompletion = afterCompletion;
×
275
      return this;
×
276
    }
277

278
    /** Enables user redeemable promotion codes. */
279
    public Builder setAllowPromotionCodes(Boolean allowPromotionCodes) {
280
      this.allowPromotionCodes = allowPromotionCodes;
×
281
      return this;
×
282
    }
283

284
    /** Configuration for automatic tax collection. */
285
    public Builder setAutomaticTax(PaymentLinkUpdateParams.AutomaticTax automaticTax) {
286
      this.automaticTax = automaticTax;
×
287
      return this;
×
288
    }
289

290
    /** Configuration for collecting the customer's billing address. Defaults to {@code auto}. */
291
    public Builder setBillingAddressCollection(
292
        PaymentLinkUpdateParams.BillingAddressCollection billingAddressCollection) {
293
      this.billingAddressCollection = billingAddressCollection;
×
294
      return this;
×
295
    }
296

297
    /**
298
     * Add an element to `customFields` list. A list is initialized for the first `add/addAll` call,
299
     * and subsequent calls adds additional elements to the original list. See {@link
300
     * PaymentLinkUpdateParams#customFields} for the field documentation.
301
     */
302
    @SuppressWarnings("unchecked")
303
    public Builder addCustomField(PaymentLinkUpdateParams.CustomField element) {
304
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
305
        this.customFields = new ArrayList<PaymentLinkUpdateParams.CustomField>();
×
306
      }
307
      ((List<PaymentLinkUpdateParams.CustomField>) this.customFields).add(element);
×
308
      return this;
×
309
    }
310

311
    /**
312
     * Add all elements to `customFields` list. A list is initialized for the first `add/addAll`
313
     * call, and subsequent calls adds additional elements to the original list. See {@link
314
     * PaymentLinkUpdateParams#customFields} for the field documentation.
315
     */
316
    @SuppressWarnings("unchecked")
317
    public Builder addAllCustomField(List<PaymentLinkUpdateParams.CustomField> elements) {
318
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
319
        this.customFields = new ArrayList<PaymentLinkUpdateParams.CustomField>();
×
320
      }
321
      ((List<PaymentLinkUpdateParams.CustomField>) this.customFields).addAll(elements);
×
322
      return this;
×
323
    }
324

325
    /**
326
     * Collect additional information from your customer using custom fields. Up to 3 fields are
327
     * supported.
328
     */
329
    public Builder setCustomFields(EmptyParam customFields) {
330
      this.customFields = customFields;
×
331
      return this;
×
332
    }
333

334
    /**
335
     * Collect additional information from your customer using custom fields. Up to 3 fields are
336
     * supported.
337
     */
338
    public Builder setCustomFields(List<PaymentLinkUpdateParams.CustomField> customFields) {
339
      this.customFields = customFields;
×
340
      return this;
×
341
    }
342

343
    /** Display additional text for your customers using custom text. */
344
    public Builder setCustomText(PaymentLinkUpdateParams.CustomText customText) {
345
      this.customText = customText;
×
346
      return this;
×
347
    }
348

349
    /**
350
     * Configures whether <a href="https://stripe.com/docs/api/checkout/sessions">checkout
351
     * sessions</a> created by this payment link create a <a
352
     * href="https://stripe.com/docs/api/customers">Customer</a>.
353
     */
354
    public Builder setCustomerCreation(PaymentLinkUpdateParams.CustomerCreation customerCreation) {
355
      this.customerCreation = customerCreation;
×
356
      return this;
×
357
    }
358

359
    /**
360
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
361
     * subsequent calls adds additional elements to the original list. See {@link
362
     * PaymentLinkUpdateParams#expand} for the field documentation.
363
     */
364
    public Builder addExpand(String element) {
365
      if (this.expand == null) {
×
366
        this.expand = new ArrayList<>();
×
367
      }
368
      this.expand.add(element);
×
369
      return this;
×
370
    }
371

372
    /**
373
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
374
     * subsequent calls adds additional elements to the original list. See {@link
375
     * PaymentLinkUpdateParams#expand} for the field documentation.
376
     */
377
    public Builder addAllExpand(List<String> elements) {
378
      if (this.expand == null) {
×
379
        this.expand = new ArrayList<>();
×
380
      }
381
      this.expand.addAll(elements);
×
382
      return this;
×
383
    }
384

385
    /**
386
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
387
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
388
     * PaymentLinkUpdateParams#extraParams} for the field documentation.
389
     */
390
    public Builder putExtraParam(String key, Object value) {
391
      if (this.extraParams == null) {
×
392
        this.extraParams = new HashMap<>();
×
393
      }
394
      this.extraParams.put(key, value);
×
395
      return this;
×
396
    }
397

398
    /**
399
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
400
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
401
     * See {@link PaymentLinkUpdateParams#extraParams} for the field documentation.
402
     */
403
    public Builder putAllExtraParam(Map<String, Object> map) {
404
      if (this.extraParams == null) {
×
405
        this.extraParams = new HashMap<>();
×
406
      }
407
      this.extraParams.putAll(map);
×
408
      return this;
×
409
    }
410

411
    /** The custom message to be displayed to a customer when a payment link is no longer active. */
412
    public Builder setInactiveMessage(String inactiveMessage) {
413
      this.inactiveMessage = inactiveMessage;
×
414
      return this;
×
415
    }
416

417
    /** The custom message to be displayed to a customer when a payment link is no longer active. */
418
    public Builder setInactiveMessage(EmptyParam inactiveMessage) {
419
      this.inactiveMessage = inactiveMessage;
×
420
      return this;
×
421
    }
422

423
    /** Generate a post-purchase Invoice for one-time payments. */
424
    public Builder setInvoiceCreation(PaymentLinkUpdateParams.InvoiceCreation invoiceCreation) {
425
      this.invoiceCreation = invoiceCreation;
×
426
      return this;
×
427
    }
428

429
    /**
430
     * Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call,
431
     * and subsequent calls adds additional elements to the original list. See {@link
432
     * PaymentLinkUpdateParams#lineItems} for the field documentation.
433
     */
434
    public Builder addLineItem(PaymentLinkUpdateParams.LineItem element) {
435
      if (this.lineItems == null) {
×
436
        this.lineItems = new ArrayList<>();
×
437
      }
438
      this.lineItems.add(element);
×
439
      return this;
×
440
    }
441

442
    /**
443
     * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` call,
444
     * and subsequent calls adds additional elements to the original list. See {@link
445
     * PaymentLinkUpdateParams#lineItems} for the field documentation.
446
     */
447
    public Builder addAllLineItem(List<PaymentLinkUpdateParams.LineItem> elements) {
448
      if (this.lineItems == null) {
×
449
        this.lineItems = new ArrayList<>();
×
450
      }
451
      this.lineItems.addAll(elements);
×
452
      return this;
×
453
    }
454

455
    /**
456
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
457
     * and subsequent calls add additional key/value pairs to the original map. See {@link
458
     * PaymentLinkUpdateParams#metadata} for the field documentation.
459
     */
460
    public Builder putMetadata(String key, String value) {
461
      if (this.metadata == null) {
×
462
        this.metadata = new HashMap<>();
×
463
      }
464
      this.metadata.put(key, value);
×
465
      return this;
×
466
    }
467

468
    /**
469
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
470
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
471
     * See {@link PaymentLinkUpdateParams#metadata} for the field documentation.
472
     */
473
    public Builder putAllMetadata(Map<String, String> map) {
474
      if (this.metadata == null) {
×
475
        this.metadata = new HashMap<>();
×
476
      }
477
      this.metadata.putAll(map);
×
478
      return this;
×
479
    }
480

481
    /**
482
     * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code
483
     * payment} mode.
484
     */
485
    public Builder setPaymentIntentData(
486
        PaymentLinkUpdateParams.PaymentIntentData paymentIntentData) {
487
      this.paymentIntentData = paymentIntentData;
×
488
      return this;
×
489
    }
490

491
    /**
492
     * Specify whether Checkout should collect a payment method. When set to {@code if_required},
493
     * Checkout will not collect a payment method when the total due for the session is 0.This may
494
     * occur if the Checkout Session includes a free trial or a discount.
495
     *
496
     * <p>Can only be set in {@code subscription} mode. Defaults to {@code always}.
497
     *
498
     * <p>If you'd like information on how to collect a payment method outside of Checkout, read the
499
     * guide on <a href="https://stripe.com/docs/payments/checkout/free-trials">configuring
500
     * subscriptions with a free trial</a>.
501
     */
502
    public Builder setPaymentMethodCollection(
503
        PaymentLinkUpdateParams.PaymentMethodCollection paymentMethodCollection) {
504
      this.paymentMethodCollection = paymentMethodCollection;
×
505
      return this;
×
506
    }
507

508
    /**
509
     * Add an element to `paymentMethodTypes` list. A list is initialized for the first `add/addAll`
510
     * call, and subsequent calls adds additional elements to the original list. See {@link
511
     * PaymentLinkUpdateParams#paymentMethodTypes} for the field documentation.
512
     */
513
    @SuppressWarnings("unchecked")
514
    public Builder addPaymentMethodType(PaymentLinkUpdateParams.PaymentMethodType element) {
515
      if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) {
×
516
        this.paymentMethodTypes = new ArrayList<PaymentLinkUpdateParams.PaymentMethodType>();
×
517
      }
518
      ((List<PaymentLinkUpdateParams.PaymentMethodType>) this.paymentMethodTypes).add(element);
×
519
      return this;
×
520
    }
521

522
    /**
523
     * Add all elements to `paymentMethodTypes` list. A list is initialized for the first
524
     * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
525
     * {@link PaymentLinkUpdateParams#paymentMethodTypes} for the field documentation.
526
     */
527
    @SuppressWarnings("unchecked")
528
    public Builder addAllPaymentMethodType(
529
        List<PaymentLinkUpdateParams.PaymentMethodType> elements) {
530
      if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) {
×
531
        this.paymentMethodTypes = new ArrayList<PaymentLinkUpdateParams.PaymentMethodType>();
×
532
      }
533
      ((List<PaymentLinkUpdateParams.PaymentMethodType>) this.paymentMethodTypes).addAll(elements);
×
534
      return this;
×
535
    }
536

537
    /**
538
     * The list of payment method types that customers can use. Pass an empty string to enable
539
     * dynamic payment methods that use your <a
540
     * href="https://dashboard.stripe.com/settings/payment_methods">payment method settings</a>.
541
     */
542
    public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) {
543
      this.paymentMethodTypes = paymentMethodTypes;
×
544
      return this;
×
545
    }
546

547
    /**
548
     * The list of payment method types that customers can use. Pass an empty string to enable
549
     * dynamic payment methods that use your <a
550
     * href="https://dashboard.stripe.com/settings/payment_methods">payment method settings</a>.
551
     */
552
    public Builder setPaymentMethodTypes(
553
        List<PaymentLinkUpdateParams.PaymentMethodType> paymentMethodTypes) {
554
      this.paymentMethodTypes = paymentMethodTypes;
×
555
      return this;
×
556
    }
557

558
    /** Settings that restrict the usage of a payment link. */
559
    public Builder setRestrictions(PaymentLinkUpdateParams.Restrictions restrictions) {
560
      this.restrictions = restrictions;
×
561
      return this;
×
562
    }
563

564
    /** Settings that restrict the usage of a payment link. */
565
    public Builder setRestrictions(EmptyParam restrictions) {
566
      this.restrictions = restrictions;
×
567
      return this;
×
568
    }
569

570
    /** Configuration for collecting the customer's shipping address. */
571
    public Builder setShippingAddressCollection(
572
        PaymentLinkUpdateParams.ShippingAddressCollection shippingAddressCollection) {
573
      this.shippingAddressCollection = shippingAddressCollection;
×
574
      return this;
×
575
    }
576

577
    /** Configuration for collecting the customer's shipping address. */
578
    public Builder setShippingAddressCollection(EmptyParam shippingAddressCollection) {
579
      this.shippingAddressCollection = shippingAddressCollection;
×
580
      return this;
×
581
    }
582

583
    /**
584
     * When creating a subscription, the specified configuration data will be used. There must be at
585
     * least one line item with a recurring price to use {@code subscription_data}.
586
     */
587
    public Builder setSubscriptionData(PaymentLinkUpdateParams.SubscriptionData subscriptionData) {
588
      this.subscriptionData = subscriptionData;
×
589
      return this;
×
590
    }
591

592
    /** Controls tax ID collection during checkout. */
593
    public Builder setTaxIdCollection(PaymentLinkUpdateParams.TaxIdCollection taxIdCollection) {
594
      this.taxIdCollection = taxIdCollection;
×
595
      return this;
×
596
    }
597
  }
598

599
  @Getter
600
  public static class AfterCompletion {
601
    /**
602
     * Map of extra parameters for custom features not available in this client library. The content
603
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
604
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
605
     * param object. Effectively, this map is flattened to its parent instance.
606
     */
607
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
608
    Map<String, Object> extraParams;
609

610
    /** Configuration when {@code type=hosted_confirmation}. */
611
    @SerializedName("hosted_confirmation")
612
    HostedConfirmation hostedConfirmation;
613

614
    /** Configuration when {@code type=redirect}. */
615
    @SerializedName("redirect")
616
    Redirect redirect;
617

618
    /**
619
     * <strong>Required.</strong> The specified behavior after the purchase is complete. Either
620
     * {@code redirect} or {@code hosted_confirmation}.
621
     */
622
    @SerializedName("type")
623
    Type type;
624

625
    private AfterCompletion(
626
        Map<String, Object> extraParams,
627
        HostedConfirmation hostedConfirmation,
628
        Redirect redirect,
629
        Type type) {
×
630
      this.extraParams = extraParams;
×
631
      this.hostedConfirmation = hostedConfirmation;
×
632
      this.redirect = redirect;
×
633
      this.type = type;
×
634
    }
×
635

636
    public static Builder builder() {
637
      return new Builder();
×
638
    }
639

640
    public static class Builder {
×
641
      private Map<String, Object> extraParams;
642

643
      private HostedConfirmation hostedConfirmation;
644

645
      private Redirect redirect;
646

647
      private Type type;
648

649
      /** Finalize and obtain parameter instance from this builder. */
650
      public PaymentLinkUpdateParams.AfterCompletion build() {
651
        return new PaymentLinkUpdateParams.AfterCompletion(
×
652
            this.extraParams, this.hostedConfirmation, this.redirect, this.type);
653
      }
654

655
      /**
656
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
657
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
658
       * PaymentLinkUpdateParams.AfterCompletion#extraParams} for the field documentation.
659
       */
660
      public Builder putExtraParam(String key, Object value) {
661
        if (this.extraParams == null) {
×
662
          this.extraParams = new HashMap<>();
×
663
        }
664
        this.extraParams.put(key, value);
×
665
        return this;
×
666
      }
667

668
      /**
669
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
670
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
671
       * See {@link PaymentLinkUpdateParams.AfterCompletion#extraParams} for the field
672
       * documentation.
673
       */
674
      public Builder putAllExtraParam(Map<String, Object> map) {
675
        if (this.extraParams == null) {
×
676
          this.extraParams = new HashMap<>();
×
677
        }
678
        this.extraParams.putAll(map);
×
679
        return this;
×
680
      }
681

682
      /** Configuration when {@code type=hosted_confirmation}. */
683
      public Builder setHostedConfirmation(
684
          PaymentLinkUpdateParams.AfterCompletion.HostedConfirmation hostedConfirmation) {
685
        this.hostedConfirmation = hostedConfirmation;
×
686
        return this;
×
687
      }
688

689
      /** Configuration when {@code type=redirect}. */
690
      public Builder setRedirect(PaymentLinkUpdateParams.AfterCompletion.Redirect redirect) {
691
        this.redirect = redirect;
×
692
        return this;
×
693
      }
694

695
      /**
696
       * <strong>Required.</strong> The specified behavior after the purchase is complete. Either
697
       * {@code redirect} or {@code hosted_confirmation}.
698
       */
699
      public Builder setType(PaymentLinkUpdateParams.AfterCompletion.Type type) {
700
        this.type = type;
×
701
        return this;
×
702
      }
703
    }
704

705
    @Getter
706
    public static class HostedConfirmation {
707
      /** A custom message to display to the customer after the purchase is complete. */
708
      @SerializedName("custom_message")
709
      Object customMessage;
710

711
      /**
712
       * Map of extra parameters for custom features not available in this client library. The
713
       * content in this map is not serialized under this field's {@code @SerializedName} value.
714
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
715
       * name in this param object. Effectively, this map is flattened to its parent instance.
716
       */
717
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
718
      Map<String, Object> extraParams;
719

720
      private HostedConfirmation(Object customMessage, Map<String, Object> extraParams) {
×
721
        this.customMessage = customMessage;
×
722
        this.extraParams = extraParams;
×
723
      }
×
724

725
      public static Builder builder() {
726
        return new Builder();
×
727
      }
728

729
      public static class Builder {
×
730
        private Object customMessage;
731

732
        private Map<String, Object> extraParams;
733

734
        /** Finalize and obtain parameter instance from this builder. */
735
        public PaymentLinkUpdateParams.AfterCompletion.HostedConfirmation build() {
736
          return new PaymentLinkUpdateParams.AfterCompletion.HostedConfirmation(
×
737
              this.customMessage, this.extraParams);
738
        }
739

740
        /** A custom message to display to the customer after the purchase is complete. */
741
        public Builder setCustomMessage(String customMessage) {
742
          this.customMessage = customMessage;
×
743
          return this;
×
744
        }
745

746
        /** A custom message to display to the customer after the purchase is complete. */
747
        public Builder setCustomMessage(EmptyParam customMessage) {
748
          this.customMessage = customMessage;
×
749
          return this;
×
750
        }
751

752
        /**
753
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
754
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
755
         * map. See {@link PaymentLinkUpdateParams.AfterCompletion.HostedConfirmation#extraParams}
756
         * for the field documentation.
757
         */
758
        public Builder putExtraParam(String key, Object value) {
759
          if (this.extraParams == null) {
×
760
            this.extraParams = new HashMap<>();
×
761
          }
762
          this.extraParams.put(key, value);
×
763
          return this;
×
764
        }
765

766
        /**
767
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
768
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
769
         * map. See {@link PaymentLinkUpdateParams.AfterCompletion.HostedConfirmation#extraParams}
770
         * for the field documentation.
771
         */
772
        public Builder putAllExtraParam(Map<String, Object> map) {
773
          if (this.extraParams == null) {
×
774
            this.extraParams = new HashMap<>();
×
775
          }
776
          this.extraParams.putAll(map);
×
777
          return this;
×
778
        }
779
      }
780
    }
781

782
    @Getter
783
    public static class Redirect {
784
      /**
785
       * Map of extra parameters for custom features not available in this client library. The
786
       * content in this map is not serialized under this field's {@code @SerializedName} value.
787
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
788
       * name in this param object. Effectively, this map is flattened to its parent instance.
789
       */
790
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
791
      Map<String, Object> extraParams;
792

793
      /**
794
       * <strong>Required.</strong> The URL the customer will be redirected to after the purchase is
795
       * complete. You can embed {@code {CHECKOUT_SESSION_ID}} into the URL to have the {@code id}
796
       * of the completed <a
797
       * href="https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id">checkout
798
       * session</a> included.
799
       */
800
      @SerializedName("url")
801
      Object url;
802

803
      private Redirect(Map<String, Object> extraParams, Object url) {
×
804
        this.extraParams = extraParams;
×
805
        this.url = url;
×
806
      }
×
807

808
      public static Builder builder() {
809
        return new Builder();
×
810
      }
811

812
      public static class Builder {
×
813
        private Map<String, Object> extraParams;
814

815
        private Object url;
816

817
        /** Finalize and obtain parameter instance from this builder. */
818
        public PaymentLinkUpdateParams.AfterCompletion.Redirect build() {
819
          return new PaymentLinkUpdateParams.AfterCompletion.Redirect(this.extraParams, this.url);
×
820
        }
821

822
        /**
823
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
824
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
825
         * map. See {@link PaymentLinkUpdateParams.AfterCompletion.Redirect#extraParams} for the
826
         * field documentation.
827
         */
828
        public Builder putExtraParam(String key, Object value) {
829
          if (this.extraParams == null) {
×
830
            this.extraParams = new HashMap<>();
×
831
          }
832
          this.extraParams.put(key, value);
×
833
          return this;
×
834
        }
835

836
        /**
837
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
838
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
839
         * map. See {@link PaymentLinkUpdateParams.AfterCompletion.Redirect#extraParams} for the
840
         * field documentation.
841
         */
842
        public Builder putAllExtraParam(Map<String, Object> map) {
843
          if (this.extraParams == null) {
×
844
            this.extraParams = new HashMap<>();
×
845
          }
846
          this.extraParams.putAll(map);
×
847
          return this;
×
848
        }
849

850
        /**
851
         * <strong>Required.</strong> The URL the customer will be redirected to after the purchase
852
         * is complete. You can embed {@code {CHECKOUT_SESSION_ID}} into the URL to have the {@code
853
         * id} of the completed <a
854
         * href="https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id">checkout
855
         * session</a> included.
856
         */
857
        public Builder setUrl(String url) {
858
          this.url = url;
×
859
          return this;
×
860
        }
861

862
        /**
863
         * <strong>Required.</strong> The URL the customer will be redirected to after the purchase
864
         * is complete. You can embed {@code {CHECKOUT_SESSION_ID}} into the URL to have the {@code
865
         * id} of the completed <a
866
         * href="https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id">checkout
867
         * session</a> included.
868
         */
869
        public Builder setUrl(EmptyParam url) {
870
          this.url = url;
×
871
          return this;
×
872
        }
873
      }
874
    }
875

876
    public enum Type implements ApiRequestParams.EnumParam {
×
877
      @SerializedName("hosted_confirmation")
×
878
      HOSTED_CONFIRMATION("hosted_confirmation"),
879

880
      @SerializedName("redirect")
×
881
      REDIRECT("redirect");
882

883
      @Getter(onMethod_ = {@Override})
884
      private final String value;
885

886
      Type(String value) {
×
887
        this.value = value;
×
888
      }
×
889
    }
890
  }
891

892
  @Getter
893
  public static class AutomaticTax {
894
    /**
895
     * <strong>Required.</strong> If {@code true}, tax will be calculated automatically using the
896
     * customer's location.
897
     */
898
    @SerializedName("enabled")
899
    Boolean enabled;
900

901
    /**
902
     * Map of extra parameters for custom features not available in this client library. The content
903
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
904
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
905
     * param object. Effectively, this map is flattened to its parent instance.
906
     */
907
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
908
    Map<String, Object> extraParams;
909

910
    /**
911
     * The account that's liable for tax. If set, the business address and tax registrations
912
     * required to perform the tax calculation are loaded from this account. The tax transaction is
913
     * returned in the report of the connected account.
914
     */
915
    @SerializedName("liability")
916
    Liability liability;
917

918
    private AutomaticTax(Boolean enabled, Map<String, Object> extraParams, Liability liability) {
×
919
      this.enabled = enabled;
×
920
      this.extraParams = extraParams;
×
921
      this.liability = liability;
×
922
    }
×
923

924
    public static Builder builder() {
925
      return new Builder();
×
926
    }
927

928
    public static class Builder {
×
929
      private Boolean enabled;
930

931
      private Map<String, Object> extraParams;
932

933
      private Liability liability;
934

935
      /** Finalize and obtain parameter instance from this builder. */
936
      public PaymentLinkUpdateParams.AutomaticTax build() {
937
        return new PaymentLinkUpdateParams.AutomaticTax(
×
938
            this.enabled, this.extraParams, this.liability);
939
      }
940

941
      /**
942
       * <strong>Required.</strong> If {@code true}, tax will be calculated automatically using the
943
       * customer's location.
944
       */
945
      public Builder setEnabled(Boolean enabled) {
946
        this.enabled = enabled;
×
947
        return this;
×
948
      }
949

950
      /**
951
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
952
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
953
       * PaymentLinkUpdateParams.AutomaticTax#extraParams} for the field documentation.
954
       */
955
      public Builder putExtraParam(String key, Object value) {
956
        if (this.extraParams == null) {
×
957
          this.extraParams = new HashMap<>();
×
958
        }
959
        this.extraParams.put(key, value);
×
960
        return this;
×
961
      }
962

963
      /**
964
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
965
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
966
       * See {@link PaymentLinkUpdateParams.AutomaticTax#extraParams} for the field documentation.
967
       */
968
      public Builder putAllExtraParam(Map<String, Object> map) {
969
        if (this.extraParams == null) {
×
970
          this.extraParams = new HashMap<>();
×
971
        }
972
        this.extraParams.putAll(map);
×
973
        return this;
×
974
      }
975

976
      /**
977
       * The account that's liable for tax. If set, the business address and tax registrations
978
       * required to perform the tax calculation are loaded from this account. The tax transaction
979
       * is returned in the report of the connected account.
980
       */
981
      public Builder setLiability(PaymentLinkUpdateParams.AutomaticTax.Liability liability) {
982
        this.liability = liability;
×
983
        return this;
×
984
      }
985
    }
986

987
    @Getter
988
    public static class Liability {
989
      /** The connected account being referenced when {@code type} is {@code account}. */
990
      @SerializedName("account")
991
      Object account;
992

993
      /**
994
       * Map of extra parameters for custom features not available in this client library. The
995
       * content in this map is not serialized under this field's {@code @SerializedName} value.
996
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
997
       * name in this param object. Effectively, this map is flattened to its parent instance.
998
       */
999
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1000
      Map<String, Object> extraParams;
1001

1002
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1003
      @SerializedName("type")
1004
      Type type;
1005

1006
      private Liability(Object account, Map<String, Object> extraParams, Type type) {
×
1007
        this.account = account;
×
1008
        this.extraParams = extraParams;
×
1009
        this.type = type;
×
1010
      }
×
1011

1012
      public static Builder builder() {
1013
        return new Builder();
×
1014
      }
1015

1016
      public static class Builder {
×
1017
        private Object account;
1018

1019
        private Map<String, Object> extraParams;
1020

1021
        private Type type;
1022

1023
        /** Finalize and obtain parameter instance from this builder. */
1024
        public PaymentLinkUpdateParams.AutomaticTax.Liability build() {
1025
          return new PaymentLinkUpdateParams.AutomaticTax.Liability(
×
1026
              this.account, this.extraParams, this.type);
1027
        }
1028

1029
        /** The connected account being referenced when {@code type} is {@code account}. */
1030
        public Builder setAccount(String account) {
1031
          this.account = account;
×
1032
          return this;
×
1033
        }
1034

1035
        /** The connected account being referenced when {@code type} is {@code account}. */
1036
        public Builder setAccount(EmptyParam account) {
1037
          this.account = account;
×
1038
          return this;
×
1039
        }
1040

1041
        /**
1042
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1043
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1044
         * map. See {@link PaymentLinkUpdateParams.AutomaticTax.Liability#extraParams} for the field
1045
         * documentation.
1046
         */
1047
        public Builder putExtraParam(String key, Object value) {
1048
          if (this.extraParams == null) {
×
1049
            this.extraParams = new HashMap<>();
×
1050
          }
1051
          this.extraParams.put(key, value);
×
1052
          return this;
×
1053
        }
1054

1055
        /**
1056
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1057
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1058
         * map. See {@link PaymentLinkUpdateParams.AutomaticTax.Liability#extraParams} for the field
1059
         * documentation.
1060
         */
1061
        public Builder putAllExtraParam(Map<String, Object> map) {
1062
          if (this.extraParams == null) {
×
1063
            this.extraParams = new HashMap<>();
×
1064
          }
1065
          this.extraParams.putAll(map);
×
1066
          return this;
×
1067
        }
1068

1069
        /** <strong>Required.</strong> Type of the account referenced in the request. */
1070
        public Builder setType(PaymentLinkUpdateParams.AutomaticTax.Liability.Type type) {
1071
          this.type = type;
×
1072
          return this;
×
1073
        }
1074
      }
1075

1076
      public enum Type implements ApiRequestParams.EnumParam {
×
1077
        @SerializedName("account")
×
1078
        ACCOUNT("account"),
1079

1080
        @SerializedName("self")
×
1081
        SELF("self");
1082

1083
        @Getter(onMethod_ = {@Override})
1084
        private final String value;
1085

1086
        Type(String value) {
×
1087
          this.value = value;
×
1088
        }
×
1089
      }
1090
    }
1091
  }
1092

1093
  @Getter
1094
  public static class CustomField {
1095
    /** Configuration for {@code type=dropdown} fields. */
1096
    @SerializedName("dropdown")
1097
    Dropdown dropdown;
1098

1099
    /**
1100
     * Map of extra parameters for custom features not available in this client library. The content
1101
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1102
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1103
     * param object. Effectively, this map is flattened to its parent instance.
1104
     */
1105
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1106
    Map<String, Object> extraParams;
1107

1108
    /**
1109
     * <strong>Required.</strong> String of your choice that your integration can use to reconcile
1110
     * this field. Must be unique to this field, alphanumeric, and up to 200 characters.
1111
     */
1112
    @SerializedName("key")
1113
    Object key;
1114

1115
    /** <strong>Required.</strong> The label for the field, displayed to the customer. */
1116
    @SerializedName("label")
1117
    Label label;
1118

1119
    /** Configuration for {@code type=numeric} fields. */
1120
    @SerializedName("numeric")
1121
    Numeric numeric;
1122

1123
    /**
1124
     * Whether the customer is required to complete the field before completing the Checkout
1125
     * Session. Defaults to {@code false}.
1126
     */
1127
    @SerializedName("optional")
1128
    Boolean optional;
1129

1130
    /** Configuration for {@code type=text} fields. */
1131
    @SerializedName("text")
1132
    Text text;
1133

1134
    /** <strong>Required.</strong> The type of the field. */
1135
    @SerializedName("type")
1136
    Type type;
1137

1138
    private CustomField(
1139
        Dropdown dropdown,
1140
        Map<String, Object> extraParams,
1141
        Object key,
1142
        Label label,
1143
        Numeric numeric,
1144
        Boolean optional,
1145
        Text text,
1146
        Type type) {
×
1147
      this.dropdown = dropdown;
×
1148
      this.extraParams = extraParams;
×
1149
      this.key = key;
×
1150
      this.label = label;
×
1151
      this.numeric = numeric;
×
1152
      this.optional = optional;
×
1153
      this.text = text;
×
1154
      this.type = type;
×
1155
    }
×
1156

1157
    public static Builder builder() {
1158
      return new Builder();
×
1159
    }
1160

1161
    public static class Builder {
×
1162
      private Dropdown dropdown;
1163

1164
      private Map<String, Object> extraParams;
1165

1166
      private Object key;
1167

1168
      private Label label;
1169

1170
      private Numeric numeric;
1171

1172
      private Boolean optional;
1173

1174
      private Text text;
1175

1176
      private Type type;
1177

1178
      /** Finalize and obtain parameter instance from this builder. */
1179
      public PaymentLinkUpdateParams.CustomField build() {
1180
        return new PaymentLinkUpdateParams.CustomField(
×
1181
            this.dropdown,
1182
            this.extraParams,
1183
            this.key,
1184
            this.label,
1185
            this.numeric,
1186
            this.optional,
1187
            this.text,
1188
            this.type);
1189
      }
1190

1191
      /** Configuration for {@code type=dropdown} fields. */
1192
      public Builder setDropdown(PaymentLinkUpdateParams.CustomField.Dropdown dropdown) {
1193
        this.dropdown = dropdown;
×
1194
        return this;
×
1195
      }
1196

1197
      /**
1198
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1199
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1200
       * PaymentLinkUpdateParams.CustomField#extraParams} for the field documentation.
1201
       */
1202
      public Builder putExtraParam(String key, Object value) {
1203
        if (this.extraParams == null) {
×
1204
          this.extraParams = new HashMap<>();
×
1205
        }
1206
        this.extraParams.put(key, value);
×
1207
        return this;
×
1208
      }
1209

1210
      /**
1211
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1212
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1213
       * See {@link PaymentLinkUpdateParams.CustomField#extraParams} for the field documentation.
1214
       */
1215
      public Builder putAllExtraParam(Map<String, Object> map) {
1216
        if (this.extraParams == null) {
×
1217
          this.extraParams = new HashMap<>();
×
1218
        }
1219
        this.extraParams.putAll(map);
×
1220
        return this;
×
1221
      }
1222

1223
      /**
1224
       * <strong>Required.</strong> String of your choice that your integration can use to reconcile
1225
       * this field. Must be unique to this field, alphanumeric, and up to 200 characters.
1226
       */
1227
      public Builder setKey(String key) {
1228
        this.key = key;
×
1229
        return this;
×
1230
      }
1231

1232
      /**
1233
       * <strong>Required.</strong> String of your choice that your integration can use to reconcile
1234
       * this field. Must be unique to this field, alphanumeric, and up to 200 characters.
1235
       */
1236
      public Builder setKey(EmptyParam key) {
1237
        this.key = key;
×
1238
        return this;
×
1239
      }
1240

1241
      /** <strong>Required.</strong> The label for the field, displayed to the customer. */
1242
      public Builder setLabel(PaymentLinkUpdateParams.CustomField.Label label) {
1243
        this.label = label;
×
1244
        return this;
×
1245
      }
1246

1247
      /** Configuration for {@code type=numeric} fields. */
1248
      public Builder setNumeric(PaymentLinkUpdateParams.CustomField.Numeric numeric) {
1249
        this.numeric = numeric;
×
1250
        return this;
×
1251
      }
1252

1253
      /**
1254
       * Whether the customer is required to complete the field before completing the Checkout
1255
       * Session. Defaults to {@code false}.
1256
       */
1257
      public Builder setOptional(Boolean optional) {
1258
        this.optional = optional;
×
1259
        return this;
×
1260
      }
1261

1262
      /** Configuration for {@code type=text} fields. */
1263
      public Builder setText(PaymentLinkUpdateParams.CustomField.Text text) {
1264
        this.text = text;
×
1265
        return this;
×
1266
      }
1267

1268
      /** <strong>Required.</strong> The type of the field. */
1269
      public Builder setType(PaymentLinkUpdateParams.CustomField.Type type) {
1270
        this.type = type;
×
1271
        return this;
×
1272
      }
1273
    }
1274

1275
    @Getter
1276
    public static class Dropdown {
1277
      /**
1278
       * Map of extra parameters for custom features not available in this client library. The
1279
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1280
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1281
       * name in this param object. Effectively, this map is flattened to its parent instance.
1282
       */
1283
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1284
      Map<String, Object> extraParams;
1285

1286
      /**
1287
       * <strong>Required.</strong> The options available for the customer to select. Up to 200
1288
       * options allowed.
1289
       */
1290
      @SerializedName("options")
1291
      List<PaymentLinkUpdateParams.CustomField.Dropdown.Option> options;
1292

1293
      private Dropdown(
1294
          Map<String, Object> extraParams,
1295
          List<PaymentLinkUpdateParams.CustomField.Dropdown.Option> options) {
×
1296
        this.extraParams = extraParams;
×
1297
        this.options = options;
×
1298
      }
×
1299

1300
      public static Builder builder() {
1301
        return new Builder();
×
1302
      }
1303

1304
      public static class Builder {
×
1305
        private Map<String, Object> extraParams;
1306

1307
        private List<PaymentLinkUpdateParams.CustomField.Dropdown.Option> options;
1308

1309
        /** Finalize and obtain parameter instance from this builder. */
1310
        public PaymentLinkUpdateParams.CustomField.Dropdown build() {
1311
          return new PaymentLinkUpdateParams.CustomField.Dropdown(this.extraParams, this.options);
×
1312
        }
1313

1314
        /**
1315
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1316
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1317
         * map. See {@link PaymentLinkUpdateParams.CustomField.Dropdown#extraParams} for the field
1318
         * documentation.
1319
         */
1320
        public Builder putExtraParam(String key, Object value) {
1321
          if (this.extraParams == null) {
×
1322
            this.extraParams = new HashMap<>();
×
1323
          }
1324
          this.extraParams.put(key, value);
×
1325
          return this;
×
1326
        }
1327

1328
        /**
1329
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1330
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1331
         * map. See {@link PaymentLinkUpdateParams.CustomField.Dropdown#extraParams} for the field
1332
         * documentation.
1333
         */
1334
        public Builder putAllExtraParam(Map<String, Object> map) {
1335
          if (this.extraParams == null) {
×
1336
            this.extraParams = new HashMap<>();
×
1337
          }
1338
          this.extraParams.putAll(map);
×
1339
          return this;
×
1340
        }
1341

1342
        /**
1343
         * Add an element to `options` list. A list is initialized for the first `add/addAll` call,
1344
         * and subsequent calls adds additional elements to the original list. See {@link
1345
         * PaymentLinkUpdateParams.CustomField.Dropdown#options} for the field documentation.
1346
         */
1347
        public Builder addOption(PaymentLinkUpdateParams.CustomField.Dropdown.Option element) {
1348
          if (this.options == null) {
×
1349
            this.options = new ArrayList<>();
×
1350
          }
1351
          this.options.add(element);
×
1352
          return this;
×
1353
        }
1354

1355
        /**
1356
         * Add all elements to `options` list. A list is initialized for the first `add/addAll`
1357
         * call, and subsequent calls adds additional elements to the original list. See {@link
1358
         * PaymentLinkUpdateParams.CustomField.Dropdown#options} for the field documentation.
1359
         */
1360
        public Builder addAllOption(
1361
            List<PaymentLinkUpdateParams.CustomField.Dropdown.Option> elements) {
1362
          if (this.options == null) {
×
1363
            this.options = new ArrayList<>();
×
1364
          }
1365
          this.options.addAll(elements);
×
1366
          return this;
×
1367
        }
1368
      }
1369

1370
      @Getter
1371
      public static class Option {
1372
        /**
1373
         * Map of extra parameters for custom features not available in this client library. The
1374
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1375
         * Instead, each key/value pair is serialized as if the key is a root-level field
1376
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1377
         * instance.
1378
         */
1379
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1380
        Map<String, Object> extraParams;
1381

1382
        /**
1383
         * <strong>Required.</strong> The label for the option, displayed to the customer. Up to 100
1384
         * characters.
1385
         */
1386
        @SerializedName("label")
1387
        Object label;
1388

1389
        /**
1390
         * <strong>Required.</strong> The value for this option, not displayed to the customer, used
1391
         * by your integration to reconcile the option selected by the customer. Must be unique to
1392
         * this option, alphanumeric, and up to 100 characters.
1393
         */
1394
        @SerializedName("value")
1395
        Object value;
1396

1397
        private Option(Map<String, Object> extraParams, Object label, Object value) {
×
1398
          this.extraParams = extraParams;
×
1399
          this.label = label;
×
1400
          this.value = value;
×
1401
        }
×
1402

1403
        public static Builder builder() {
1404
          return new Builder();
×
1405
        }
1406

1407
        public static class Builder {
×
1408
          private Map<String, Object> extraParams;
1409

1410
          private Object label;
1411

1412
          private Object value;
1413

1414
          /** Finalize and obtain parameter instance from this builder. */
1415
          public PaymentLinkUpdateParams.CustomField.Dropdown.Option build() {
1416
            return new PaymentLinkUpdateParams.CustomField.Dropdown.Option(
×
1417
                this.extraParams, this.label, this.value);
1418
          }
1419

1420
          /**
1421
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1422
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1423
           * map. See {@link PaymentLinkUpdateParams.CustomField.Dropdown.Option#extraParams} for
1424
           * the field documentation.
1425
           */
1426
          public Builder putExtraParam(String key, Object value) {
1427
            if (this.extraParams == null) {
×
1428
              this.extraParams = new HashMap<>();
×
1429
            }
1430
            this.extraParams.put(key, value);
×
1431
            return this;
×
1432
          }
1433

1434
          /**
1435
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1436
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1437
           * map. See {@link PaymentLinkUpdateParams.CustomField.Dropdown.Option#extraParams} for
1438
           * the field documentation.
1439
           */
1440
          public Builder putAllExtraParam(Map<String, Object> map) {
1441
            if (this.extraParams == null) {
×
1442
              this.extraParams = new HashMap<>();
×
1443
            }
1444
            this.extraParams.putAll(map);
×
1445
            return this;
×
1446
          }
1447

1448
          /**
1449
           * <strong>Required.</strong> The label for the option, displayed to the customer. Up to
1450
           * 100 characters.
1451
           */
1452
          public Builder setLabel(String label) {
1453
            this.label = label;
×
1454
            return this;
×
1455
          }
1456

1457
          /**
1458
           * <strong>Required.</strong> The label for the option, displayed to the customer. Up to
1459
           * 100 characters.
1460
           */
1461
          public Builder setLabel(EmptyParam label) {
1462
            this.label = label;
×
1463
            return this;
×
1464
          }
1465

1466
          /**
1467
           * <strong>Required.</strong> The value for this option, not displayed to the customer,
1468
           * used by your integration to reconcile the option selected by the customer. Must be
1469
           * unique to this option, alphanumeric, and up to 100 characters.
1470
           */
1471
          public Builder setValue(String value) {
1472
            this.value = value;
×
1473
            return this;
×
1474
          }
1475

1476
          /**
1477
           * <strong>Required.</strong> The value for this option, not displayed to the customer,
1478
           * used by your integration to reconcile the option selected by the customer. Must be
1479
           * unique to this option, alphanumeric, and up to 100 characters.
1480
           */
1481
          public Builder setValue(EmptyParam value) {
1482
            this.value = value;
×
1483
            return this;
×
1484
          }
1485
        }
1486
      }
1487
    }
1488

1489
    @Getter
1490
    public static class Label {
1491
      /**
1492
       * <strong>Required.</strong> Custom text for the label, displayed to the customer. Up to 50
1493
       * characters.
1494
       */
1495
      @SerializedName("custom")
1496
      Object custom;
1497

1498
      /**
1499
       * Map of extra parameters for custom features not available in this client library. The
1500
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1501
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1502
       * name in this param object. Effectively, this map is flattened to its parent instance.
1503
       */
1504
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1505
      Map<String, Object> extraParams;
1506

1507
      /** <strong>Required.</strong> The type of the label. */
1508
      @SerializedName("type")
1509
      Type type;
1510

1511
      private Label(Object custom, Map<String, Object> extraParams, Type type) {
×
1512
        this.custom = custom;
×
1513
        this.extraParams = extraParams;
×
1514
        this.type = type;
×
1515
      }
×
1516

1517
      public static Builder builder() {
1518
        return new Builder();
×
1519
      }
1520

1521
      public static class Builder {
×
1522
        private Object custom;
1523

1524
        private Map<String, Object> extraParams;
1525

1526
        private Type type;
1527

1528
        /** Finalize and obtain parameter instance from this builder. */
1529
        public PaymentLinkUpdateParams.CustomField.Label build() {
1530
          return new PaymentLinkUpdateParams.CustomField.Label(
×
1531
              this.custom, this.extraParams, this.type);
1532
        }
1533

1534
        /**
1535
         * <strong>Required.</strong> Custom text for the label, displayed to the customer. Up to 50
1536
         * characters.
1537
         */
1538
        public Builder setCustom(String custom) {
1539
          this.custom = custom;
×
1540
          return this;
×
1541
        }
1542

1543
        /**
1544
         * <strong>Required.</strong> Custom text for the label, displayed to the customer. Up to 50
1545
         * characters.
1546
         */
1547
        public Builder setCustom(EmptyParam custom) {
1548
          this.custom = custom;
×
1549
          return this;
×
1550
        }
1551

1552
        /**
1553
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1554
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1555
         * map. See {@link PaymentLinkUpdateParams.CustomField.Label#extraParams} for the field
1556
         * documentation.
1557
         */
1558
        public Builder putExtraParam(String key, Object value) {
1559
          if (this.extraParams == null) {
×
1560
            this.extraParams = new HashMap<>();
×
1561
          }
1562
          this.extraParams.put(key, value);
×
1563
          return this;
×
1564
        }
1565

1566
        /**
1567
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1568
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1569
         * map. See {@link PaymentLinkUpdateParams.CustomField.Label#extraParams} for the field
1570
         * documentation.
1571
         */
1572
        public Builder putAllExtraParam(Map<String, Object> map) {
1573
          if (this.extraParams == null) {
×
1574
            this.extraParams = new HashMap<>();
×
1575
          }
1576
          this.extraParams.putAll(map);
×
1577
          return this;
×
1578
        }
1579

1580
        /** <strong>Required.</strong> The type of the label. */
1581
        public Builder setType(PaymentLinkUpdateParams.CustomField.Label.Type type) {
1582
          this.type = type;
×
1583
          return this;
×
1584
        }
1585
      }
1586

1587
      public enum Type implements ApiRequestParams.EnumParam {
×
1588
        @SerializedName("custom")
×
1589
        CUSTOM("custom");
1590

1591
        @Getter(onMethod_ = {@Override})
1592
        private final String value;
1593

1594
        Type(String value) {
×
1595
          this.value = value;
×
1596
        }
×
1597
      }
1598
    }
1599

1600
    @Getter
1601
    public static class Numeric {
1602
      /**
1603
       * Map of extra parameters for custom features not available in this client library. The
1604
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1605
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1606
       * name in this param object. Effectively, this map is flattened to its parent instance.
1607
       */
1608
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1609
      Map<String, Object> extraParams;
1610

1611
      /** The maximum character length constraint for the customer's input. */
1612
      @SerializedName("maximum_length")
1613
      Long maximumLength;
1614

1615
      /** The minimum character length requirement for the customer's input. */
1616
      @SerializedName("minimum_length")
1617
      Long minimumLength;
1618

1619
      private Numeric(Map<String, Object> extraParams, Long maximumLength, Long minimumLength) {
×
1620
        this.extraParams = extraParams;
×
1621
        this.maximumLength = maximumLength;
×
1622
        this.minimumLength = minimumLength;
×
1623
      }
×
1624

1625
      public static Builder builder() {
1626
        return new Builder();
×
1627
      }
1628

1629
      public static class Builder {
×
1630
        private Map<String, Object> extraParams;
1631

1632
        private Long maximumLength;
1633

1634
        private Long minimumLength;
1635

1636
        /** Finalize and obtain parameter instance from this builder. */
1637
        public PaymentLinkUpdateParams.CustomField.Numeric build() {
1638
          return new PaymentLinkUpdateParams.CustomField.Numeric(
×
1639
              this.extraParams, this.maximumLength, this.minimumLength);
1640
        }
1641

1642
        /**
1643
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1644
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1645
         * map. See {@link PaymentLinkUpdateParams.CustomField.Numeric#extraParams} for the field
1646
         * documentation.
1647
         */
1648
        public Builder putExtraParam(String key, Object value) {
1649
          if (this.extraParams == null) {
×
1650
            this.extraParams = new HashMap<>();
×
1651
          }
1652
          this.extraParams.put(key, value);
×
1653
          return this;
×
1654
        }
1655

1656
        /**
1657
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1658
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1659
         * map. See {@link PaymentLinkUpdateParams.CustomField.Numeric#extraParams} for the field
1660
         * documentation.
1661
         */
1662
        public Builder putAllExtraParam(Map<String, Object> map) {
1663
          if (this.extraParams == null) {
×
1664
            this.extraParams = new HashMap<>();
×
1665
          }
1666
          this.extraParams.putAll(map);
×
1667
          return this;
×
1668
        }
1669

1670
        /** The maximum character length constraint for the customer's input. */
1671
        public Builder setMaximumLength(Long maximumLength) {
1672
          this.maximumLength = maximumLength;
×
1673
          return this;
×
1674
        }
1675

1676
        /** The minimum character length requirement for the customer's input. */
1677
        public Builder setMinimumLength(Long minimumLength) {
1678
          this.minimumLength = minimumLength;
×
1679
          return this;
×
1680
        }
1681
      }
1682
    }
1683

1684
    @Getter
1685
    public static class Text {
1686
      /**
1687
       * Map of extra parameters for custom features not available in this client library. The
1688
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1689
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1690
       * name in this param object. Effectively, this map is flattened to its parent instance.
1691
       */
1692
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1693
      Map<String, Object> extraParams;
1694

1695
      /** The maximum character length constraint for the customer's input. */
1696
      @SerializedName("maximum_length")
1697
      Long maximumLength;
1698

1699
      /** The minimum character length requirement for the customer's input. */
1700
      @SerializedName("minimum_length")
1701
      Long minimumLength;
1702

1703
      private Text(Map<String, Object> extraParams, Long maximumLength, Long minimumLength) {
×
1704
        this.extraParams = extraParams;
×
1705
        this.maximumLength = maximumLength;
×
1706
        this.minimumLength = minimumLength;
×
1707
      }
×
1708

1709
      public static Builder builder() {
1710
        return new Builder();
×
1711
      }
1712

1713
      public static class Builder {
×
1714
        private Map<String, Object> extraParams;
1715

1716
        private Long maximumLength;
1717

1718
        private Long minimumLength;
1719

1720
        /** Finalize and obtain parameter instance from this builder. */
1721
        public PaymentLinkUpdateParams.CustomField.Text build() {
1722
          return new PaymentLinkUpdateParams.CustomField.Text(
×
1723
              this.extraParams, this.maximumLength, this.minimumLength);
1724
        }
1725

1726
        /**
1727
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1728
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1729
         * map. See {@link PaymentLinkUpdateParams.CustomField.Text#extraParams} for the field
1730
         * documentation.
1731
         */
1732
        public Builder putExtraParam(String key, Object value) {
1733
          if (this.extraParams == null) {
×
1734
            this.extraParams = new HashMap<>();
×
1735
          }
1736
          this.extraParams.put(key, value);
×
1737
          return this;
×
1738
        }
1739

1740
        /**
1741
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1742
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1743
         * map. See {@link PaymentLinkUpdateParams.CustomField.Text#extraParams} for the field
1744
         * documentation.
1745
         */
1746
        public Builder putAllExtraParam(Map<String, Object> map) {
1747
          if (this.extraParams == null) {
×
1748
            this.extraParams = new HashMap<>();
×
1749
          }
1750
          this.extraParams.putAll(map);
×
1751
          return this;
×
1752
        }
1753

1754
        /** The maximum character length constraint for the customer's input. */
1755
        public Builder setMaximumLength(Long maximumLength) {
1756
          this.maximumLength = maximumLength;
×
1757
          return this;
×
1758
        }
1759

1760
        /** The minimum character length requirement for the customer's input. */
1761
        public Builder setMinimumLength(Long minimumLength) {
1762
          this.minimumLength = minimumLength;
×
1763
          return this;
×
1764
        }
1765
      }
1766
    }
1767

1768
    public enum Type implements ApiRequestParams.EnumParam {
×
1769
      @SerializedName("dropdown")
×
1770
      DROPDOWN("dropdown"),
1771

1772
      @SerializedName("numeric")
×
1773
      NUMERIC("numeric"),
1774

1775
      @SerializedName("text")
×
1776
      TEXT("text");
1777

1778
      @Getter(onMethod_ = {@Override})
1779
      private final String value;
1780

1781
      Type(String value) {
×
1782
        this.value = value;
×
1783
      }
×
1784
    }
1785
  }
1786

1787
  @Getter
1788
  public static class CustomText {
1789
    /** Custom text that should be displayed after the payment confirmation button. */
1790
    @SerializedName("after_submit")
1791
    Object afterSubmit;
1792

1793
    /**
1794
     * Map of extra parameters for custom features not available in this client library. The content
1795
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1796
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1797
     * param object. Effectively, this map is flattened to its parent instance.
1798
     */
1799
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1800
    Map<String, Object> extraParams;
1801

1802
    /** Custom text that should be displayed alongside shipping address collection. */
1803
    @SerializedName("shipping_address")
1804
    Object shippingAddress;
1805

1806
    /** Custom text that should be displayed alongside the payment confirmation button. */
1807
    @SerializedName("submit")
1808
    Object submit;
1809

1810
    /**
1811
     * Custom text that should be displayed in place of the default terms of service agreement text.
1812
     */
1813
    @SerializedName("terms_of_service_acceptance")
1814
    Object termsOfServiceAcceptance;
1815

1816
    private CustomText(
1817
        Object afterSubmit,
1818
        Map<String, Object> extraParams,
1819
        Object shippingAddress,
1820
        Object submit,
1821
        Object termsOfServiceAcceptance) {
×
1822
      this.afterSubmit = afterSubmit;
×
1823
      this.extraParams = extraParams;
×
1824
      this.shippingAddress = shippingAddress;
×
1825
      this.submit = submit;
×
1826
      this.termsOfServiceAcceptance = termsOfServiceAcceptance;
×
1827
    }
×
1828

1829
    public static Builder builder() {
1830
      return new Builder();
×
1831
    }
1832

1833
    public static class Builder {
×
1834
      private Object afterSubmit;
1835

1836
      private Map<String, Object> extraParams;
1837

1838
      private Object shippingAddress;
1839

1840
      private Object submit;
1841

1842
      private Object termsOfServiceAcceptance;
1843

1844
      /** Finalize and obtain parameter instance from this builder. */
1845
      public PaymentLinkUpdateParams.CustomText build() {
1846
        return new PaymentLinkUpdateParams.CustomText(
×
1847
            this.afterSubmit,
1848
            this.extraParams,
1849
            this.shippingAddress,
1850
            this.submit,
1851
            this.termsOfServiceAcceptance);
1852
      }
1853

1854
      /** Custom text that should be displayed after the payment confirmation button. */
1855
      public Builder setAfterSubmit(PaymentLinkUpdateParams.CustomText.AfterSubmit afterSubmit) {
1856
        this.afterSubmit = afterSubmit;
×
1857
        return this;
×
1858
      }
1859

1860
      /** Custom text that should be displayed after the payment confirmation button. */
1861
      public Builder setAfterSubmit(EmptyParam afterSubmit) {
1862
        this.afterSubmit = afterSubmit;
×
1863
        return this;
×
1864
      }
1865

1866
      /**
1867
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1868
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1869
       * PaymentLinkUpdateParams.CustomText#extraParams} for the field documentation.
1870
       */
1871
      public Builder putExtraParam(String key, Object value) {
1872
        if (this.extraParams == null) {
×
1873
          this.extraParams = new HashMap<>();
×
1874
        }
1875
        this.extraParams.put(key, value);
×
1876
        return this;
×
1877
      }
1878

1879
      /**
1880
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1881
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1882
       * See {@link PaymentLinkUpdateParams.CustomText#extraParams} for the field documentation.
1883
       */
1884
      public Builder putAllExtraParam(Map<String, Object> map) {
1885
        if (this.extraParams == null) {
×
1886
          this.extraParams = new HashMap<>();
×
1887
        }
1888
        this.extraParams.putAll(map);
×
1889
        return this;
×
1890
      }
1891

1892
      /** Custom text that should be displayed alongside shipping address collection. */
1893
      public Builder setShippingAddress(
1894
          PaymentLinkUpdateParams.CustomText.ShippingAddress shippingAddress) {
1895
        this.shippingAddress = shippingAddress;
×
1896
        return this;
×
1897
      }
1898

1899
      /** Custom text that should be displayed alongside shipping address collection. */
1900
      public Builder setShippingAddress(EmptyParam shippingAddress) {
1901
        this.shippingAddress = shippingAddress;
×
1902
        return this;
×
1903
      }
1904

1905
      /** Custom text that should be displayed alongside the payment confirmation button. */
1906
      public Builder setSubmit(PaymentLinkUpdateParams.CustomText.Submit submit) {
1907
        this.submit = submit;
×
1908
        return this;
×
1909
      }
1910

1911
      /** Custom text that should be displayed alongside the payment confirmation button. */
1912
      public Builder setSubmit(EmptyParam submit) {
1913
        this.submit = submit;
×
1914
        return this;
×
1915
      }
1916

1917
      /**
1918
       * Custom text that should be displayed in place of the default terms of service agreement
1919
       * text.
1920
       */
1921
      public Builder setTermsOfServiceAcceptance(
1922
          PaymentLinkUpdateParams.CustomText.TermsOfServiceAcceptance termsOfServiceAcceptance) {
1923
        this.termsOfServiceAcceptance = termsOfServiceAcceptance;
×
1924
        return this;
×
1925
      }
1926

1927
      /**
1928
       * Custom text that should be displayed in place of the default terms of service agreement
1929
       * text.
1930
       */
1931
      public Builder setTermsOfServiceAcceptance(EmptyParam termsOfServiceAcceptance) {
1932
        this.termsOfServiceAcceptance = termsOfServiceAcceptance;
×
1933
        return this;
×
1934
      }
1935
    }
1936

1937
    @Getter
1938
    public static class AfterSubmit {
1939
      /**
1940
       * Map of extra parameters for custom features not available in this client library. The
1941
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1942
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1943
       * name in this param object. Effectively, this map is flattened to its parent instance.
1944
       */
1945
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1946
      Map<String, Object> extraParams;
1947

1948
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
1949
      @SerializedName("message")
1950
      Object message;
1951

1952
      private AfterSubmit(Map<String, Object> extraParams, Object message) {
×
1953
        this.extraParams = extraParams;
×
1954
        this.message = message;
×
1955
      }
×
1956

1957
      public static Builder builder() {
1958
        return new Builder();
×
1959
      }
1960

1961
      public static class Builder {
×
1962
        private Map<String, Object> extraParams;
1963

1964
        private Object message;
1965

1966
        /** Finalize and obtain parameter instance from this builder. */
1967
        public PaymentLinkUpdateParams.CustomText.AfterSubmit build() {
1968
          return new PaymentLinkUpdateParams.CustomText.AfterSubmit(this.extraParams, this.message);
×
1969
        }
1970

1971
        /**
1972
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1973
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1974
         * map. See {@link PaymentLinkUpdateParams.CustomText.AfterSubmit#extraParams} for the field
1975
         * documentation.
1976
         */
1977
        public Builder putExtraParam(String key, Object value) {
1978
          if (this.extraParams == null) {
×
1979
            this.extraParams = new HashMap<>();
×
1980
          }
1981
          this.extraParams.put(key, value);
×
1982
          return this;
×
1983
        }
1984

1985
        /**
1986
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1987
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1988
         * map. See {@link PaymentLinkUpdateParams.CustomText.AfterSubmit#extraParams} for the field
1989
         * documentation.
1990
         */
1991
        public Builder putAllExtraParam(Map<String, Object> map) {
1992
          if (this.extraParams == null) {
×
1993
            this.extraParams = new HashMap<>();
×
1994
          }
1995
          this.extraParams.putAll(map);
×
1996
          return this;
×
1997
        }
1998

1999
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2000
        public Builder setMessage(String message) {
2001
          this.message = message;
×
2002
          return this;
×
2003
        }
2004

2005
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2006
        public Builder setMessage(EmptyParam message) {
2007
          this.message = message;
×
2008
          return this;
×
2009
        }
2010
      }
2011
    }
2012

2013
    @Getter
2014
    public static class ShippingAddress {
2015
      /**
2016
       * Map of extra parameters for custom features not available in this client library. The
2017
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2018
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2019
       * name in this param object. Effectively, this map is flattened to its parent instance.
2020
       */
2021
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2022
      Map<String, Object> extraParams;
2023

2024
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2025
      @SerializedName("message")
2026
      Object message;
2027

2028
      private ShippingAddress(Map<String, Object> extraParams, Object message) {
×
2029
        this.extraParams = extraParams;
×
2030
        this.message = message;
×
2031
      }
×
2032

2033
      public static Builder builder() {
2034
        return new Builder();
×
2035
      }
2036

2037
      public static class Builder {
×
2038
        private Map<String, Object> extraParams;
2039

2040
        private Object message;
2041

2042
        /** Finalize and obtain parameter instance from this builder. */
2043
        public PaymentLinkUpdateParams.CustomText.ShippingAddress build() {
2044
          return new PaymentLinkUpdateParams.CustomText.ShippingAddress(
×
2045
              this.extraParams, this.message);
2046
        }
2047

2048
        /**
2049
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2050
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2051
         * map. See {@link PaymentLinkUpdateParams.CustomText.ShippingAddress#extraParams} for the
2052
         * field documentation.
2053
         */
2054
        public Builder putExtraParam(String key, Object value) {
2055
          if (this.extraParams == null) {
×
2056
            this.extraParams = new HashMap<>();
×
2057
          }
2058
          this.extraParams.put(key, value);
×
2059
          return this;
×
2060
        }
2061

2062
        /**
2063
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2064
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2065
         * map. See {@link PaymentLinkUpdateParams.CustomText.ShippingAddress#extraParams} for the
2066
         * field documentation.
2067
         */
2068
        public Builder putAllExtraParam(Map<String, Object> map) {
2069
          if (this.extraParams == null) {
×
2070
            this.extraParams = new HashMap<>();
×
2071
          }
2072
          this.extraParams.putAll(map);
×
2073
          return this;
×
2074
        }
2075

2076
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2077
        public Builder setMessage(String message) {
2078
          this.message = message;
×
2079
          return this;
×
2080
        }
2081

2082
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2083
        public Builder setMessage(EmptyParam message) {
2084
          this.message = message;
×
2085
          return this;
×
2086
        }
2087
      }
2088
    }
2089

2090
    @Getter
2091
    public static class Submit {
2092
      /**
2093
       * Map of extra parameters for custom features not available in this client library. The
2094
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2095
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2096
       * name in this param object. Effectively, this map is flattened to its parent instance.
2097
       */
2098
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2099
      Map<String, Object> extraParams;
2100

2101
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2102
      @SerializedName("message")
2103
      Object message;
2104

2105
      private Submit(Map<String, Object> extraParams, Object message) {
×
2106
        this.extraParams = extraParams;
×
2107
        this.message = message;
×
2108
      }
×
2109

2110
      public static Builder builder() {
2111
        return new Builder();
×
2112
      }
2113

2114
      public static class Builder {
×
2115
        private Map<String, Object> extraParams;
2116

2117
        private Object message;
2118

2119
        /** Finalize and obtain parameter instance from this builder. */
2120
        public PaymentLinkUpdateParams.CustomText.Submit build() {
2121
          return new PaymentLinkUpdateParams.CustomText.Submit(this.extraParams, this.message);
×
2122
        }
2123

2124
        /**
2125
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2126
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2127
         * map. See {@link PaymentLinkUpdateParams.CustomText.Submit#extraParams} for the field
2128
         * documentation.
2129
         */
2130
        public Builder putExtraParam(String key, Object value) {
2131
          if (this.extraParams == null) {
×
2132
            this.extraParams = new HashMap<>();
×
2133
          }
2134
          this.extraParams.put(key, value);
×
2135
          return this;
×
2136
        }
2137

2138
        /**
2139
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2140
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2141
         * map. See {@link PaymentLinkUpdateParams.CustomText.Submit#extraParams} for the field
2142
         * documentation.
2143
         */
2144
        public Builder putAllExtraParam(Map<String, Object> map) {
2145
          if (this.extraParams == null) {
×
2146
            this.extraParams = new HashMap<>();
×
2147
          }
2148
          this.extraParams.putAll(map);
×
2149
          return this;
×
2150
        }
2151

2152
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2153
        public Builder setMessage(String message) {
2154
          this.message = message;
×
2155
          return this;
×
2156
        }
2157

2158
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2159
        public Builder setMessage(EmptyParam message) {
2160
          this.message = message;
×
2161
          return this;
×
2162
        }
2163
      }
2164
    }
2165

2166
    @Getter
2167
    public static class TermsOfServiceAcceptance {
2168
      /**
2169
       * Map of extra parameters for custom features not available in this client library. The
2170
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2171
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2172
       * name in this param object. Effectively, this map is flattened to its parent instance.
2173
       */
2174
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2175
      Map<String, Object> extraParams;
2176

2177
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2178
      @SerializedName("message")
2179
      Object message;
2180

2181
      private TermsOfServiceAcceptance(Map<String, Object> extraParams, Object message) {
×
2182
        this.extraParams = extraParams;
×
2183
        this.message = message;
×
2184
      }
×
2185

2186
      public static Builder builder() {
2187
        return new Builder();
×
2188
      }
2189

2190
      public static class Builder {
×
2191
        private Map<String, Object> extraParams;
2192

2193
        private Object message;
2194

2195
        /** Finalize and obtain parameter instance from this builder. */
2196
        public PaymentLinkUpdateParams.CustomText.TermsOfServiceAcceptance build() {
2197
          return new PaymentLinkUpdateParams.CustomText.TermsOfServiceAcceptance(
×
2198
              this.extraParams, this.message);
2199
        }
2200

2201
        /**
2202
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2203
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2204
         * map. See {@link PaymentLinkUpdateParams.CustomText.TermsOfServiceAcceptance#extraParams}
2205
         * for the field documentation.
2206
         */
2207
        public Builder putExtraParam(String key, Object value) {
2208
          if (this.extraParams == null) {
×
2209
            this.extraParams = new HashMap<>();
×
2210
          }
2211
          this.extraParams.put(key, value);
×
2212
          return this;
×
2213
        }
2214

2215
        /**
2216
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2217
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2218
         * map. See {@link PaymentLinkUpdateParams.CustomText.TermsOfServiceAcceptance#extraParams}
2219
         * for the field documentation.
2220
         */
2221
        public Builder putAllExtraParam(Map<String, Object> map) {
2222
          if (this.extraParams == null) {
×
2223
            this.extraParams = new HashMap<>();
×
2224
          }
2225
          this.extraParams.putAll(map);
×
2226
          return this;
×
2227
        }
2228

2229
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2230
        public Builder setMessage(String message) {
2231
          this.message = message;
×
2232
          return this;
×
2233
        }
2234

2235
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2236
        public Builder setMessage(EmptyParam message) {
2237
          this.message = message;
×
2238
          return this;
×
2239
        }
2240
      }
2241
    }
2242
  }
2243

2244
  @Getter
2245
  public static class InvoiceCreation {
2246
    /** <strong>Required.</strong> Whether the feature is enabled */
2247
    @SerializedName("enabled")
2248
    Boolean enabled;
2249

2250
    /**
2251
     * Map of extra parameters for custom features not available in this client library. The content
2252
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
2253
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
2254
     * param object. Effectively, this map is flattened to its parent instance.
2255
     */
2256
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2257
    Map<String, Object> extraParams;
2258

2259
    /** Invoice PDF configuration. */
2260
    @SerializedName("invoice_data")
2261
    InvoiceData invoiceData;
2262

2263
    private InvoiceCreation(
2264
        Boolean enabled, Map<String, Object> extraParams, InvoiceData invoiceData) {
×
2265
      this.enabled = enabled;
×
2266
      this.extraParams = extraParams;
×
2267
      this.invoiceData = invoiceData;
×
2268
    }
×
2269

2270
    public static Builder builder() {
2271
      return new Builder();
×
2272
    }
2273

2274
    public static class Builder {
×
2275
      private Boolean enabled;
2276

2277
      private Map<String, Object> extraParams;
2278

2279
      private InvoiceData invoiceData;
2280

2281
      /** Finalize and obtain parameter instance from this builder. */
2282
      public PaymentLinkUpdateParams.InvoiceCreation build() {
2283
        return new PaymentLinkUpdateParams.InvoiceCreation(
×
2284
            this.enabled, this.extraParams, this.invoiceData);
2285
      }
2286

2287
      /** <strong>Required.</strong> Whether the feature is enabled */
2288
      public Builder setEnabled(Boolean enabled) {
2289
        this.enabled = enabled;
×
2290
        return this;
×
2291
      }
2292

2293
      /**
2294
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
2295
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
2296
       * PaymentLinkUpdateParams.InvoiceCreation#extraParams} for the field documentation.
2297
       */
2298
      public Builder putExtraParam(String key, Object value) {
2299
        if (this.extraParams == null) {
×
2300
          this.extraParams = new HashMap<>();
×
2301
        }
2302
        this.extraParams.put(key, value);
×
2303
        return this;
×
2304
      }
2305

2306
      /**
2307
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2308
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
2309
       * See {@link PaymentLinkUpdateParams.InvoiceCreation#extraParams} for the field
2310
       * documentation.
2311
       */
2312
      public Builder putAllExtraParam(Map<String, Object> map) {
2313
        if (this.extraParams == null) {
×
2314
          this.extraParams = new HashMap<>();
×
2315
        }
2316
        this.extraParams.putAll(map);
×
2317
        return this;
×
2318
      }
2319

2320
      /** Invoice PDF configuration. */
2321
      public Builder setInvoiceData(
2322
          PaymentLinkUpdateParams.InvoiceCreation.InvoiceData invoiceData) {
2323
        this.invoiceData = invoiceData;
×
2324
        return this;
×
2325
      }
2326
    }
2327

2328
    @Getter
2329
    public static class InvoiceData {
2330
      /** The account tax IDs associated with the invoice. */
2331
      @SerializedName("account_tax_ids")
2332
      Object accountTaxIds;
2333

2334
      /** Default custom fields to be displayed on invoices for this customer. */
2335
      @SerializedName("custom_fields")
2336
      Object customFields;
2337

2338
      /** An arbitrary string attached to the object. Often useful for displaying to users. */
2339
      @SerializedName("description")
2340
      Object description;
2341

2342
      /**
2343
       * Map of extra parameters for custom features not available in this client library. The
2344
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2345
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2346
       * name in this param object. Effectively, this map is flattened to its parent instance.
2347
       */
2348
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2349
      Map<String, Object> extraParams;
2350

2351
      /** Default footer to be displayed on invoices for this customer. */
2352
      @SerializedName("footer")
2353
      Object footer;
2354

2355
      /**
2356
       * The connected account that issues the invoice. The invoice is presented with the branding
2357
       * and support information of the specified account.
2358
       */
2359
      @SerializedName("issuer")
2360
      Issuer issuer;
2361

2362
      /**
2363
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
2364
       * attach to an object. This can be useful for storing additional information about the object
2365
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
2366
       * keys can be unset by posting an empty value to {@code metadata}.
2367
       */
2368
      @SerializedName("metadata")
2369
      Object metadata;
2370

2371
      /** Default options for invoice PDF rendering for this customer. */
2372
      @SerializedName("rendering_options")
2373
      Object renderingOptions;
2374

2375
      private InvoiceData(
2376
          Object accountTaxIds,
2377
          Object customFields,
2378
          Object description,
2379
          Map<String, Object> extraParams,
2380
          Object footer,
2381
          Issuer issuer,
2382
          Object metadata,
2383
          Object renderingOptions) {
×
2384
        this.accountTaxIds = accountTaxIds;
×
2385
        this.customFields = customFields;
×
2386
        this.description = description;
×
2387
        this.extraParams = extraParams;
×
2388
        this.footer = footer;
×
2389
        this.issuer = issuer;
×
2390
        this.metadata = metadata;
×
2391
        this.renderingOptions = renderingOptions;
×
2392
      }
×
2393

2394
      public static Builder builder() {
2395
        return new Builder();
×
2396
      }
2397

2398
      public static class Builder {
×
2399
        private Object accountTaxIds;
2400

2401
        private Object customFields;
2402

2403
        private Object description;
2404

2405
        private Map<String, Object> extraParams;
2406

2407
        private Object footer;
2408

2409
        private Issuer issuer;
2410

2411
        private Object metadata;
2412

2413
        private Object renderingOptions;
2414

2415
        /** Finalize and obtain parameter instance from this builder. */
2416
        public PaymentLinkUpdateParams.InvoiceCreation.InvoiceData build() {
2417
          return new PaymentLinkUpdateParams.InvoiceCreation.InvoiceData(
×
2418
              this.accountTaxIds,
2419
              this.customFields,
2420
              this.description,
2421
              this.extraParams,
2422
              this.footer,
2423
              this.issuer,
2424
              this.metadata,
2425
              this.renderingOptions);
2426
        }
2427

2428
        /**
2429
         * Add an element to `accountTaxIds` list. A list is initialized for the first `add/addAll`
2430
         * call, and subsequent calls adds additional elements to the original list. See {@link
2431
         * PaymentLinkUpdateParams.InvoiceCreation.InvoiceData#accountTaxIds} for the field
2432
         * documentation.
2433
         */
2434
        @SuppressWarnings("unchecked")
2435
        public Builder addAccountTaxId(String element) {
2436
          if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
2437
            this.accountTaxIds = new ArrayList<String>();
×
2438
          }
2439
          ((List<String>) this.accountTaxIds).add(element);
×
2440
          return this;
×
2441
        }
2442

2443
        /**
2444
         * Add all elements to `accountTaxIds` list. A list is initialized for the first
2445
         * `add/addAll` call, and subsequent calls adds additional elements to the original list.
2446
         * See {@link PaymentLinkUpdateParams.InvoiceCreation.InvoiceData#accountTaxIds} for the
2447
         * field documentation.
2448
         */
2449
        @SuppressWarnings("unchecked")
2450
        public Builder addAllAccountTaxId(List<String> elements) {
2451
          if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
2452
            this.accountTaxIds = new ArrayList<String>();
×
2453
          }
2454
          ((List<String>) this.accountTaxIds).addAll(elements);
×
2455
          return this;
×
2456
        }
2457

2458
        /** The account tax IDs associated with the invoice. */
2459
        public Builder setAccountTaxIds(EmptyParam accountTaxIds) {
2460
          this.accountTaxIds = accountTaxIds;
×
2461
          return this;
×
2462
        }
2463

2464
        /** The account tax IDs associated with the invoice. */
2465
        public Builder setAccountTaxIds(List<String> accountTaxIds) {
2466
          this.accountTaxIds = accountTaxIds;
×
2467
          return this;
×
2468
        }
2469

2470
        /**
2471
         * Add an element to `customFields` list. A list is initialized for the first `add/addAll`
2472
         * call, and subsequent calls adds additional elements to the original list. See {@link
2473
         * PaymentLinkUpdateParams.InvoiceCreation.InvoiceData#customFields} for the field
2474
         * documentation.
2475
         */
2476
        @SuppressWarnings("unchecked")
2477
        public Builder addCustomField(
2478
            PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField element) {
2479
          if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
2480
            this.customFields =
×
2481
                new ArrayList<PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField>();
2482
          }
2483
          ((List<PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField>)
×
2484
                  this.customFields)
2485
              .add(element);
×
2486
          return this;
×
2487
        }
2488

2489
        /**
2490
         * Add all elements to `customFields` list. A list is initialized for the first `add/addAll`
2491
         * call, and subsequent calls adds additional elements to the original list. See {@link
2492
         * PaymentLinkUpdateParams.InvoiceCreation.InvoiceData#customFields} for the field
2493
         * documentation.
2494
         */
2495
        @SuppressWarnings("unchecked")
2496
        public Builder addAllCustomField(
2497
            List<PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField> elements) {
2498
          if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
2499
            this.customFields =
×
2500
                new ArrayList<PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField>();
2501
          }
2502
          ((List<PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField>)
×
2503
                  this.customFields)
2504
              .addAll(elements);
×
2505
          return this;
×
2506
        }
2507

2508
        /** Default custom fields to be displayed on invoices for this customer. */
2509
        public Builder setCustomFields(EmptyParam customFields) {
2510
          this.customFields = customFields;
×
2511
          return this;
×
2512
        }
2513

2514
        /** Default custom fields to be displayed on invoices for this customer. */
2515
        public Builder setCustomFields(
2516
            List<PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField> customFields) {
2517
          this.customFields = customFields;
×
2518
          return this;
×
2519
        }
2520

2521
        /** An arbitrary string attached to the object. Often useful for displaying to users. */
2522
        public Builder setDescription(String description) {
2523
          this.description = description;
×
2524
          return this;
×
2525
        }
2526

2527
        /** An arbitrary string attached to the object. Often useful for displaying to users. */
2528
        public Builder setDescription(EmptyParam description) {
2529
          this.description = description;
×
2530
          return this;
×
2531
        }
2532

2533
        /**
2534
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2535
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2536
         * map. See {@link PaymentLinkUpdateParams.InvoiceCreation.InvoiceData#extraParams} for the
2537
         * field documentation.
2538
         */
2539
        public Builder putExtraParam(String key, Object value) {
2540
          if (this.extraParams == null) {
×
2541
            this.extraParams = new HashMap<>();
×
2542
          }
2543
          this.extraParams.put(key, value);
×
2544
          return this;
×
2545
        }
2546

2547
        /**
2548
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2549
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2550
         * map. See {@link PaymentLinkUpdateParams.InvoiceCreation.InvoiceData#extraParams} for the
2551
         * field documentation.
2552
         */
2553
        public Builder putAllExtraParam(Map<String, Object> map) {
2554
          if (this.extraParams == null) {
×
2555
            this.extraParams = new HashMap<>();
×
2556
          }
2557
          this.extraParams.putAll(map);
×
2558
          return this;
×
2559
        }
2560

2561
        /** Default footer to be displayed on invoices for this customer. */
2562
        public Builder setFooter(String footer) {
2563
          this.footer = footer;
×
2564
          return this;
×
2565
        }
2566

2567
        /** Default footer to be displayed on invoices for this customer. */
2568
        public Builder setFooter(EmptyParam footer) {
2569
          this.footer = footer;
×
2570
          return this;
×
2571
        }
2572

2573
        /**
2574
         * The connected account that issues the invoice. The invoice is presented with the branding
2575
         * and support information of the specified account.
2576
         */
2577
        public Builder setIssuer(
2578
            PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.Issuer issuer) {
2579
          this.issuer = issuer;
×
2580
          return this;
×
2581
        }
2582

2583
        /**
2584
         * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
2585
         * call, and subsequent calls add additional key/value pairs to the original map. See {@link
2586
         * PaymentLinkUpdateParams.InvoiceCreation.InvoiceData#metadata} for the field
2587
         * documentation.
2588
         */
2589
        @SuppressWarnings("unchecked")
2590
        public Builder putMetadata(String key, String value) {
2591
          if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
2592
            this.metadata = new HashMap<String, String>();
×
2593
          }
2594
          ((Map<String, String>) this.metadata).put(key, value);
×
2595
          return this;
×
2596
        }
2597

2598
        /**
2599
         * Add all map key/value pairs to `metadata` map. A map is initialized for the first
2600
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2601
         * map. See {@link PaymentLinkUpdateParams.InvoiceCreation.InvoiceData#metadata} for the
2602
         * field documentation.
2603
         */
2604
        @SuppressWarnings("unchecked")
2605
        public Builder putAllMetadata(Map<String, String> map) {
2606
          if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
2607
            this.metadata = new HashMap<String, String>();
×
2608
          }
2609
          ((Map<String, String>) this.metadata).putAll(map);
×
2610
          return this;
×
2611
        }
2612

2613
        /**
2614
         * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
2615
         * attach to an object. This can be useful for storing additional information about the
2616
         * object in a structured format. Individual keys can be unset by posting an empty value to
2617
         * them. All keys can be unset by posting an empty value to {@code metadata}.
2618
         */
2619
        public Builder setMetadata(EmptyParam metadata) {
2620
          this.metadata = metadata;
×
2621
          return this;
×
2622
        }
2623

2624
        /**
2625
         * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
2626
         * attach to an object. This can be useful for storing additional information about the
2627
         * object in a structured format. Individual keys can be unset by posting an empty value to
2628
         * them. All keys can be unset by posting an empty value to {@code metadata}.
2629
         */
2630
        public Builder setMetadata(Map<String, String> metadata) {
2631
          this.metadata = metadata;
×
2632
          return this;
×
2633
        }
2634

2635
        /** Default options for invoice PDF rendering for this customer. */
2636
        public Builder setRenderingOptions(
2637
            PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.RenderingOptions renderingOptions) {
2638
          this.renderingOptions = renderingOptions;
×
2639
          return this;
×
2640
        }
2641

2642
        /** Default options for invoice PDF rendering for this customer. */
2643
        public Builder setRenderingOptions(EmptyParam renderingOptions) {
2644
          this.renderingOptions = renderingOptions;
×
2645
          return this;
×
2646
        }
2647
      }
2648

2649
      @Getter
2650
      public static class CustomField {
2651
        /**
2652
         * Map of extra parameters for custom features not available in this client library. The
2653
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2654
         * Instead, each key/value pair is serialized as if the key is a root-level field
2655
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2656
         * instance.
2657
         */
2658
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2659
        Map<String, Object> extraParams;
2660

2661
        /**
2662
         * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
2663
         */
2664
        @SerializedName("name")
2665
        Object name;
2666

2667
        /**
2668
         * <strong>Required.</strong> The value of the custom field. This may be up to 140
2669
         * characters.
2670
         */
2671
        @SerializedName("value")
2672
        Object value;
2673

2674
        private CustomField(Map<String, Object> extraParams, Object name, Object value) {
×
2675
          this.extraParams = extraParams;
×
2676
          this.name = name;
×
2677
          this.value = value;
×
2678
        }
×
2679

2680
        public static Builder builder() {
2681
          return new Builder();
×
2682
        }
2683

2684
        public static class Builder {
×
2685
          private Map<String, Object> extraParams;
2686

2687
          private Object name;
2688

2689
          private Object value;
2690

2691
          /** Finalize and obtain parameter instance from this builder. */
2692
          public PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField build() {
2693
            return new PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField(
×
2694
                this.extraParams, this.name, this.value);
2695
          }
2696

2697
          /**
2698
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2699
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2700
           * map. See {@link
2701
           * PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField#extraParams} for the
2702
           * field documentation.
2703
           */
2704
          public Builder putExtraParam(String key, Object value) {
2705
            if (this.extraParams == null) {
×
2706
              this.extraParams = new HashMap<>();
×
2707
            }
2708
            this.extraParams.put(key, value);
×
2709
            return this;
×
2710
          }
2711

2712
          /**
2713
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2714
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2715
           * map. See {@link
2716
           * PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.CustomField#extraParams} for the
2717
           * field documentation.
2718
           */
2719
          public Builder putAllExtraParam(Map<String, Object> map) {
2720
            if (this.extraParams == null) {
×
2721
              this.extraParams = new HashMap<>();
×
2722
            }
2723
            this.extraParams.putAll(map);
×
2724
            return this;
×
2725
          }
2726

2727
          /**
2728
           * <strong>Required.</strong> The name of the custom field. This may be up to 40
2729
           * characters.
2730
           */
2731
          public Builder setName(String name) {
2732
            this.name = name;
×
2733
            return this;
×
2734
          }
2735

2736
          /**
2737
           * <strong>Required.</strong> The name of the custom field. This may be up to 40
2738
           * characters.
2739
           */
2740
          public Builder setName(EmptyParam name) {
2741
            this.name = name;
×
2742
            return this;
×
2743
          }
2744

2745
          /**
2746
           * <strong>Required.</strong> The value of the custom field. This may be up to 140
2747
           * characters.
2748
           */
2749
          public Builder setValue(String value) {
2750
            this.value = value;
×
2751
            return this;
×
2752
          }
2753

2754
          /**
2755
           * <strong>Required.</strong> The value of the custom field. This may be up to 140
2756
           * characters.
2757
           */
2758
          public Builder setValue(EmptyParam value) {
2759
            this.value = value;
×
2760
            return this;
×
2761
          }
2762
        }
2763
      }
2764

2765
      @Getter
2766
      public static class Issuer {
2767
        /** The connected account being referenced when {@code type} is {@code account}. */
2768
        @SerializedName("account")
2769
        Object account;
2770

2771
        /**
2772
         * Map of extra parameters for custom features not available in this client library. The
2773
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2774
         * Instead, each key/value pair is serialized as if the key is a root-level field
2775
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2776
         * instance.
2777
         */
2778
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2779
        Map<String, Object> extraParams;
2780

2781
        /** <strong>Required.</strong> Type of the account referenced in the request. */
2782
        @SerializedName("type")
2783
        Type type;
2784

2785
        private Issuer(Object account, Map<String, Object> extraParams, Type type) {
×
2786
          this.account = account;
×
2787
          this.extraParams = extraParams;
×
2788
          this.type = type;
×
2789
        }
×
2790

2791
        public static Builder builder() {
2792
          return new Builder();
×
2793
        }
2794

2795
        public static class Builder {
×
2796
          private Object account;
2797

2798
          private Map<String, Object> extraParams;
2799

2800
          private Type type;
2801

2802
          /** Finalize and obtain parameter instance from this builder. */
2803
          public PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.Issuer build() {
2804
            return new PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.Issuer(
×
2805
                this.account, this.extraParams, this.type);
2806
          }
2807

2808
          /** The connected account being referenced when {@code type} is {@code account}. */
2809
          public Builder setAccount(String account) {
2810
            this.account = account;
×
2811
            return this;
×
2812
          }
2813

2814
          /** The connected account being referenced when {@code type} is {@code account}. */
2815
          public Builder setAccount(EmptyParam account) {
2816
            this.account = account;
×
2817
            return this;
×
2818
          }
2819

2820
          /**
2821
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2822
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2823
           * map. See {@link PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.Issuer#extraParams}
2824
           * for the field documentation.
2825
           */
2826
          public Builder putExtraParam(String key, Object value) {
2827
            if (this.extraParams == null) {
×
2828
              this.extraParams = new HashMap<>();
×
2829
            }
2830
            this.extraParams.put(key, value);
×
2831
            return this;
×
2832
          }
2833

2834
          /**
2835
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2836
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2837
           * map. See {@link PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.Issuer#extraParams}
2838
           * for the field documentation.
2839
           */
2840
          public Builder putAllExtraParam(Map<String, Object> map) {
2841
            if (this.extraParams == null) {
×
2842
              this.extraParams = new HashMap<>();
×
2843
            }
2844
            this.extraParams.putAll(map);
×
2845
            return this;
×
2846
          }
2847

2848
          /** <strong>Required.</strong> Type of the account referenced in the request. */
2849
          public Builder setType(
2850
              PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.Issuer.Type type) {
2851
            this.type = type;
×
2852
            return this;
×
2853
          }
2854
        }
2855

2856
        public enum Type implements ApiRequestParams.EnumParam {
×
2857
          @SerializedName("account")
×
2858
          ACCOUNT("account"),
2859

2860
          @SerializedName("self")
×
2861
          SELF("self");
2862

2863
          @Getter(onMethod_ = {@Override})
2864
          private final String value;
2865

2866
          Type(String value) {
×
2867
            this.value = value;
×
2868
          }
×
2869
        }
2870
      }
2871

2872
      @Getter
2873
      public static class RenderingOptions {
2874
        /**
2875
         * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
2876
         * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
2877
         * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in invoice
2878
         * PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive alike)
2879
         * from invoice PDF amounts.
2880
         */
2881
        @SerializedName("amount_tax_display")
2882
        ApiRequestParams.EnumParam amountTaxDisplay;
2883

2884
        /**
2885
         * Map of extra parameters for custom features not available in this client library. The
2886
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2887
         * Instead, each key/value pair is serialized as if the key is a root-level field
2888
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2889
         * instance.
2890
         */
2891
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2892
        Map<String, Object> extraParams;
2893

2894
        private RenderingOptions(
2895
            ApiRequestParams.EnumParam amountTaxDisplay, Map<String, Object> extraParams) {
×
2896
          this.amountTaxDisplay = amountTaxDisplay;
×
2897
          this.extraParams = extraParams;
×
2898
        }
×
2899

2900
        public static Builder builder() {
2901
          return new Builder();
×
2902
        }
2903

2904
        public static class Builder {
×
2905
          private ApiRequestParams.EnumParam amountTaxDisplay;
2906

2907
          private Map<String, Object> extraParams;
2908

2909
          /** Finalize and obtain parameter instance from this builder. */
2910
          public PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.RenderingOptions build() {
2911
            return new PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.RenderingOptions(
×
2912
                this.amountTaxDisplay, this.extraParams);
2913
          }
2914

2915
          /**
2916
           * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
2917
           * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
2918
           * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in
2919
           * invoice PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive
2920
           * alike) from invoice PDF amounts.
2921
           */
2922
          public Builder setAmountTaxDisplay(
2923
              PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.RenderingOptions.AmountTaxDisplay
2924
                  amountTaxDisplay) {
2925
            this.amountTaxDisplay = amountTaxDisplay;
×
2926
            return this;
×
2927
          }
2928

2929
          /**
2930
           * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
2931
           * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
2932
           * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in
2933
           * invoice PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive
2934
           * alike) from invoice PDF amounts.
2935
           */
2936
          public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
2937
            this.amountTaxDisplay = amountTaxDisplay;
×
2938
            return this;
×
2939
          }
2940

2941
          /**
2942
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2943
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2944
           * map. See {@link
2945
           * PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.RenderingOptions#extraParams} for
2946
           * the field documentation.
2947
           */
2948
          public Builder putExtraParam(String key, Object value) {
2949
            if (this.extraParams == null) {
×
2950
              this.extraParams = new HashMap<>();
×
2951
            }
2952
            this.extraParams.put(key, value);
×
2953
            return this;
×
2954
          }
2955

2956
          /**
2957
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2958
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2959
           * map. See {@link
2960
           * PaymentLinkUpdateParams.InvoiceCreation.InvoiceData.RenderingOptions#extraParams} for
2961
           * the field documentation.
2962
           */
2963
          public Builder putAllExtraParam(Map<String, Object> map) {
2964
            if (this.extraParams == null) {
×
2965
              this.extraParams = new HashMap<>();
×
2966
            }
2967
            this.extraParams.putAll(map);
×
2968
            return this;
×
2969
          }
2970
        }
2971

2972
        public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
2973
          @SerializedName("exclude_tax")
×
2974
          EXCLUDE_TAX("exclude_tax"),
2975

2976
          @SerializedName("include_inclusive_tax")
×
2977
          INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
2978

2979
          @Getter(onMethod_ = {@Override})
2980
          private final String value;
2981

2982
          AmountTaxDisplay(String value) {
×
2983
            this.value = value;
×
2984
          }
×
2985
        }
2986
      }
2987
    }
2988
  }
2989

2990
  @Getter
2991
  public static class LineItem {
2992
    /**
2993
     * When set, provides configuration for this item’s quantity to be adjusted by the customer
2994
     * during checkout.
2995
     */
2996
    @SerializedName("adjustable_quantity")
2997
    AdjustableQuantity adjustableQuantity;
2998

2999
    /**
3000
     * Map of extra parameters for custom features not available in this client library. The content
3001
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3002
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3003
     * param object. Effectively, this map is flattened to its parent instance.
3004
     */
3005
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3006
    Map<String, Object> extraParams;
3007

3008
    /** <strong>Required.</strong> The ID of an existing line item on the payment link. */
3009
    @SerializedName("id")
3010
    Object id;
3011

3012
    /** The quantity of the line item being purchased. */
3013
    @SerializedName("quantity")
3014
    Long quantity;
3015

3016
    private LineItem(
3017
        AdjustableQuantity adjustableQuantity,
3018
        Map<String, Object> extraParams,
3019
        Object id,
3020
        Long quantity) {
×
3021
      this.adjustableQuantity = adjustableQuantity;
×
3022
      this.extraParams = extraParams;
×
3023
      this.id = id;
×
3024
      this.quantity = quantity;
×
3025
    }
×
3026

3027
    public static Builder builder() {
3028
      return new Builder();
×
3029
    }
3030

3031
    public static class Builder {
×
3032
      private AdjustableQuantity adjustableQuantity;
3033

3034
      private Map<String, Object> extraParams;
3035

3036
      private Object id;
3037

3038
      private Long quantity;
3039

3040
      /** Finalize and obtain parameter instance from this builder. */
3041
      public PaymentLinkUpdateParams.LineItem build() {
3042
        return new PaymentLinkUpdateParams.LineItem(
×
3043
            this.adjustableQuantity, this.extraParams, this.id, this.quantity);
3044
      }
3045

3046
      /**
3047
       * When set, provides configuration for this item’s quantity to be adjusted by the customer
3048
       * during checkout.
3049
       */
3050
      public Builder setAdjustableQuantity(
3051
          PaymentLinkUpdateParams.LineItem.AdjustableQuantity adjustableQuantity) {
3052
        this.adjustableQuantity = adjustableQuantity;
×
3053
        return this;
×
3054
      }
3055

3056
      /**
3057
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3058
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3059
       * PaymentLinkUpdateParams.LineItem#extraParams} for the field documentation.
3060
       */
3061
      public Builder putExtraParam(String key, Object value) {
3062
        if (this.extraParams == null) {
×
3063
          this.extraParams = new HashMap<>();
×
3064
        }
3065
        this.extraParams.put(key, value);
×
3066
        return this;
×
3067
      }
3068

3069
      /**
3070
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3071
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3072
       * See {@link PaymentLinkUpdateParams.LineItem#extraParams} for the field documentation.
3073
       */
3074
      public Builder putAllExtraParam(Map<String, Object> map) {
3075
        if (this.extraParams == null) {
×
3076
          this.extraParams = new HashMap<>();
×
3077
        }
3078
        this.extraParams.putAll(map);
×
3079
        return this;
×
3080
      }
3081

3082
      /** <strong>Required.</strong> The ID of an existing line item on the payment link. */
3083
      public Builder setId(String id) {
3084
        this.id = id;
×
3085
        return this;
×
3086
      }
3087

3088
      /** <strong>Required.</strong> The ID of an existing line item on the payment link. */
3089
      public Builder setId(EmptyParam id) {
3090
        this.id = id;
×
3091
        return this;
×
3092
      }
3093

3094
      /** The quantity of the line item being purchased. */
3095
      public Builder setQuantity(Long quantity) {
3096
        this.quantity = quantity;
×
3097
        return this;
×
3098
      }
3099
    }
3100

3101
    @Getter
3102
    public static class AdjustableQuantity {
3103
      /**
3104
       * <strong>Required.</strong> Set to true if the quantity can be adjusted to any non-negative
3105
       * Integer.
3106
       */
3107
      @SerializedName("enabled")
3108
      Boolean enabled;
3109

3110
      /**
3111
       * Map of extra parameters for custom features not available in this client library. The
3112
       * content in this map is not serialized under this field's {@code @SerializedName} value.
3113
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
3114
       * name in this param object. Effectively, this map is flattened to its parent instance.
3115
       */
3116
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3117
      Map<String, Object> extraParams;
3118

3119
      /**
3120
       * The maximum quantity the customer can purchase. By default this value is 99. You can
3121
       * specify a value up to 999.
3122
       */
3123
      @SerializedName("maximum")
3124
      Long maximum;
3125

3126
      /**
3127
       * The minimum quantity the customer can purchase. By default this value is 0. If there is
3128
       * only one item in the cart then that item's quantity cannot go down to 0.
3129
       */
3130
      @SerializedName("minimum")
3131
      Long minimum;
3132

3133
      private AdjustableQuantity(
3134
          Boolean enabled, Map<String, Object> extraParams, Long maximum, Long minimum) {
×
3135
        this.enabled = enabled;
×
3136
        this.extraParams = extraParams;
×
3137
        this.maximum = maximum;
×
3138
        this.minimum = minimum;
×
3139
      }
×
3140

3141
      public static Builder builder() {
3142
        return new Builder();
×
3143
      }
3144

3145
      public static class Builder {
×
3146
        private Boolean enabled;
3147

3148
        private Map<String, Object> extraParams;
3149

3150
        private Long maximum;
3151

3152
        private Long minimum;
3153

3154
        /** Finalize and obtain parameter instance from this builder. */
3155
        public PaymentLinkUpdateParams.LineItem.AdjustableQuantity build() {
3156
          return new PaymentLinkUpdateParams.LineItem.AdjustableQuantity(
×
3157
              this.enabled, this.extraParams, this.maximum, this.minimum);
3158
        }
3159

3160
        /**
3161
         * <strong>Required.</strong> Set to true if the quantity can be adjusted to any
3162
         * non-negative Integer.
3163
         */
3164
        public Builder setEnabled(Boolean enabled) {
3165
          this.enabled = enabled;
×
3166
          return this;
×
3167
        }
3168

3169
        /**
3170
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
3171
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3172
         * map. See {@link PaymentLinkUpdateParams.LineItem.AdjustableQuantity#extraParams} for the
3173
         * field documentation.
3174
         */
3175
        public Builder putExtraParam(String key, Object value) {
3176
          if (this.extraParams == null) {
×
3177
            this.extraParams = new HashMap<>();
×
3178
          }
3179
          this.extraParams.put(key, value);
×
3180
          return this;
×
3181
        }
3182

3183
        /**
3184
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3185
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3186
         * map. See {@link PaymentLinkUpdateParams.LineItem.AdjustableQuantity#extraParams} for the
3187
         * field documentation.
3188
         */
3189
        public Builder putAllExtraParam(Map<String, Object> map) {
3190
          if (this.extraParams == null) {
×
3191
            this.extraParams = new HashMap<>();
×
3192
          }
3193
          this.extraParams.putAll(map);
×
3194
          return this;
×
3195
        }
3196

3197
        /**
3198
         * The maximum quantity the customer can purchase. By default this value is 99. You can
3199
         * specify a value up to 999.
3200
         */
3201
        public Builder setMaximum(Long maximum) {
3202
          this.maximum = maximum;
×
3203
          return this;
×
3204
        }
3205

3206
        /**
3207
         * The minimum quantity the customer can purchase. By default this value is 0. If there is
3208
         * only one item in the cart then that item's quantity cannot go down to 0.
3209
         */
3210
        public Builder setMinimum(Long minimum) {
3211
          this.minimum = minimum;
×
3212
          return this;
×
3213
        }
3214
      }
3215
    }
3216
  }
3217

3218
  @Getter
3219
  public static class PaymentIntentData {
3220
    /** An arbitrary string attached to the object. Often useful for displaying to users. */
3221
    @SerializedName("description")
3222
    Object description;
3223

3224
    /**
3225
     * Map of extra parameters for custom features not available in this client library. The content
3226
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3227
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3228
     * param object. Effectively, this map is flattened to its parent instance.
3229
     */
3230
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3231
    Map<String, Object> extraParams;
3232

3233
    /**
3234
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
3235
     * declaratively set metadata on <a href="https://stripe.com/docs/api/payment_intents">Payment
3236
     * Intents</a> generated from this payment link. Unlike object-level metadata, this field is
3237
     * declarative. Updates will clear prior values.
3238
     */
3239
    @SerializedName("metadata")
3240
    Object metadata;
3241

3242
    /**
3243
     * Text that appears on the customer's statement as the statement descriptor for a non-card
3244
     * charge. This value overrides the account's default statement descriptor. For information
3245
     * about requirements, including the 22-character limit, see <a
3246
     * href="https://docs.stripe.com/get-started/account/statement-descriptors">the Statement
3247
     * Descriptor docs</a>.
3248
     *
3249
     * <p>Setting this value for a card charge returns an error. For card charges, set the <a
3250
     * href="https://docs.stripe.com/get-started/account/statement-descriptors#dynamic">statement_descriptor_suffix</a>
3251
     * instead.
3252
     */
3253
    @SerializedName("statement_descriptor")
3254
    Object statementDescriptor;
3255

3256
    /**
3257
     * Provides information about a card charge. Concatenated to the account's <a
3258
     * href="https://docs.stripe.com/get-started/account/statement-descriptors#static">statement
3259
     * descriptor prefix</a> to form the complete statement descriptor that appears on the
3260
     * customer's statement.
3261
     */
3262
    @SerializedName("statement_descriptor_suffix")
3263
    Object statementDescriptorSuffix;
3264

3265
    /**
3266
     * A string that identifies the resulting payment as part of a group. See the PaymentIntents <a
3267
     * href="https://stripe.com/docs/connect/separate-charges-and-transfers">use case for connected
3268
     * accounts</a> for details.
3269
     */
3270
    @SerializedName("transfer_group")
3271
    Object transferGroup;
3272

3273
    private PaymentIntentData(
3274
        Object description,
3275
        Map<String, Object> extraParams,
3276
        Object metadata,
3277
        Object statementDescriptor,
3278
        Object statementDescriptorSuffix,
3279
        Object transferGroup) {
×
3280
      this.description = description;
×
3281
      this.extraParams = extraParams;
×
3282
      this.metadata = metadata;
×
3283
      this.statementDescriptor = statementDescriptor;
×
3284
      this.statementDescriptorSuffix = statementDescriptorSuffix;
×
3285
      this.transferGroup = transferGroup;
×
3286
    }
×
3287

3288
    public static Builder builder() {
3289
      return new Builder();
×
3290
    }
3291

3292
    public static class Builder {
×
3293
      private Object description;
3294

3295
      private Map<String, Object> extraParams;
3296

3297
      private Object metadata;
3298

3299
      private Object statementDescriptor;
3300

3301
      private Object statementDescriptorSuffix;
3302

3303
      private Object transferGroup;
3304

3305
      /** Finalize and obtain parameter instance from this builder. */
3306
      public PaymentLinkUpdateParams.PaymentIntentData build() {
3307
        return new PaymentLinkUpdateParams.PaymentIntentData(
×
3308
            this.description,
3309
            this.extraParams,
3310
            this.metadata,
3311
            this.statementDescriptor,
3312
            this.statementDescriptorSuffix,
3313
            this.transferGroup);
3314
      }
3315

3316
      /** An arbitrary string attached to the object. Often useful for displaying to users. */
3317
      public Builder setDescription(String description) {
3318
        this.description = description;
×
3319
        return this;
×
3320
      }
3321

3322
      /** An arbitrary string attached to the object. Often useful for displaying to users. */
3323
      public Builder setDescription(EmptyParam description) {
3324
        this.description = description;
×
3325
        return this;
×
3326
      }
3327

3328
      /**
3329
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3330
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3331
       * PaymentLinkUpdateParams.PaymentIntentData#extraParams} for the field documentation.
3332
       */
3333
      public Builder putExtraParam(String key, Object value) {
3334
        if (this.extraParams == null) {
×
3335
          this.extraParams = new HashMap<>();
×
3336
        }
3337
        this.extraParams.put(key, value);
×
3338
        return this;
×
3339
      }
3340

3341
      /**
3342
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3343
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3344
       * See {@link PaymentLinkUpdateParams.PaymentIntentData#extraParams} for the field
3345
       * documentation.
3346
       */
3347
      public Builder putAllExtraParam(Map<String, Object> map) {
3348
        if (this.extraParams == null) {
×
3349
          this.extraParams = new HashMap<>();
×
3350
        }
3351
        this.extraParams.putAll(map);
×
3352
        return this;
×
3353
      }
3354

3355
      /**
3356
       * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
3357
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3358
       * PaymentLinkUpdateParams.PaymentIntentData#metadata} for the field documentation.
3359
       */
3360
      @SuppressWarnings("unchecked")
3361
      public Builder putMetadata(String key, String value) {
3362
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
3363
          this.metadata = new HashMap<String, String>();
×
3364
        }
3365
        ((Map<String, String>) this.metadata).put(key, value);
×
3366
        return this;
×
3367
      }
3368

3369
      /**
3370
       * Add all map key/value pairs to `metadata` map. A map is initialized for the first
3371
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3372
       * See {@link PaymentLinkUpdateParams.PaymentIntentData#metadata} for the field documentation.
3373
       */
3374
      @SuppressWarnings("unchecked")
3375
      public Builder putAllMetadata(Map<String, String> map) {
3376
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
3377
          this.metadata = new HashMap<String, String>();
×
3378
        }
3379
        ((Map<String, String>) this.metadata).putAll(map);
×
3380
        return this;
×
3381
      }
3382

3383
      /**
3384
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
3385
       * declaratively set metadata on <a href="https://stripe.com/docs/api/payment_intents">Payment
3386
       * Intents</a> generated from this payment link. Unlike object-level metadata, this field is
3387
       * declarative. Updates will clear prior values.
3388
       */
3389
      public Builder setMetadata(EmptyParam metadata) {
3390
        this.metadata = metadata;
×
3391
        return this;
×
3392
      }
3393

3394
      /**
3395
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
3396
       * declaratively set metadata on <a href="https://stripe.com/docs/api/payment_intents">Payment
3397
       * Intents</a> generated from this payment link. Unlike object-level metadata, this field is
3398
       * declarative. Updates will clear prior values.
3399
       */
3400
      public Builder setMetadata(Map<String, String> metadata) {
3401
        this.metadata = metadata;
×
3402
        return this;
×
3403
      }
3404

3405
      /**
3406
       * Text that appears on the customer's statement as the statement descriptor for a non-card
3407
       * charge. This value overrides the account's default statement descriptor. For information
3408
       * about requirements, including the 22-character limit, see <a
3409
       * href="https://docs.stripe.com/get-started/account/statement-descriptors">the Statement
3410
       * Descriptor docs</a>.
3411
       *
3412
       * <p>Setting this value for a card charge returns an error. For card charges, set the <a
3413
       * href="https://docs.stripe.com/get-started/account/statement-descriptors#dynamic">statement_descriptor_suffix</a>
3414
       * instead.
3415
       */
3416
      public Builder setStatementDescriptor(String statementDescriptor) {
3417
        this.statementDescriptor = statementDescriptor;
×
3418
        return this;
×
3419
      }
3420

3421
      /**
3422
       * Text that appears on the customer's statement as the statement descriptor for a non-card
3423
       * charge. This value overrides the account's default statement descriptor. For information
3424
       * about requirements, including the 22-character limit, see <a
3425
       * href="https://docs.stripe.com/get-started/account/statement-descriptors">the Statement
3426
       * Descriptor docs</a>.
3427
       *
3428
       * <p>Setting this value for a card charge returns an error. For card charges, set the <a
3429
       * href="https://docs.stripe.com/get-started/account/statement-descriptors#dynamic">statement_descriptor_suffix</a>
3430
       * instead.
3431
       */
3432
      public Builder setStatementDescriptor(EmptyParam statementDescriptor) {
3433
        this.statementDescriptor = statementDescriptor;
×
3434
        return this;
×
3435
      }
3436

3437
      /**
3438
       * Provides information about a card charge. Concatenated to the account's <a
3439
       * href="https://docs.stripe.com/get-started/account/statement-descriptors#static">statement
3440
       * descriptor prefix</a> to form the complete statement descriptor that appears on the
3441
       * customer's statement.
3442
       */
3443
      public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) {
3444
        this.statementDescriptorSuffix = statementDescriptorSuffix;
×
3445
        return this;
×
3446
      }
3447

3448
      /**
3449
       * Provides information about a card charge. Concatenated to the account's <a
3450
       * href="https://docs.stripe.com/get-started/account/statement-descriptors#static">statement
3451
       * descriptor prefix</a> to form the complete statement descriptor that appears on the
3452
       * customer's statement.
3453
       */
3454
      public Builder setStatementDescriptorSuffix(EmptyParam statementDescriptorSuffix) {
3455
        this.statementDescriptorSuffix = statementDescriptorSuffix;
×
3456
        return this;
×
3457
      }
3458

3459
      /**
3460
       * A string that identifies the resulting payment as part of a group. See the PaymentIntents
3461
       * <a href="https://stripe.com/docs/connect/separate-charges-and-transfers">use case for
3462
       * connected accounts</a> for details.
3463
       */
3464
      public Builder setTransferGroup(String transferGroup) {
3465
        this.transferGroup = transferGroup;
×
3466
        return this;
×
3467
      }
3468

3469
      /**
3470
       * A string that identifies the resulting payment as part of a group. See the PaymentIntents
3471
       * <a href="https://stripe.com/docs/connect/separate-charges-and-transfers">use case for
3472
       * connected accounts</a> for details.
3473
       */
3474
      public Builder setTransferGroup(EmptyParam transferGroup) {
3475
        this.transferGroup = transferGroup;
×
3476
        return this;
×
3477
      }
3478
    }
3479
  }
3480

3481
  @Getter
3482
  public static class Restrictions {
3483
    /**
3484
     * <strong>Required.</strong> Configuration for the {@code completed_sessions} restriction type.
3485
     */
3486
    @SerializedName("completed_sessions")
3487
    CompletedSessions completedSessions;
3488

3489
    /**
3490
     * Map of extra parameters for custom features not available in this client library. The content
3491
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3492
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3493
     * param object. Effectively, this map is flattened to its parent instance.
3494
     */
3495
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3496
    Map<String, Object> extraParams;
3497

3498
    private Restrictions(CompletedSessions completedSessions, Map<String, Object> extraParams) {
×
3499
      this.completedSessions = completedSessions;
×
3500
      this.extraParams = extraParams;
×
3501
    }
×
3502

3503
    public static Builder builder() {
3504
      return new Builder();
×
3505
    }
3506

3507
    public static class Builder {
×
3508
      private CompletedSessions completedSessions;
3509

3510
      private Map<String, Object> extraParams;
3511

3512
      /** Finalize and obtain parameter instance from this builder. */
3513
      public PaymentLinkUpdateParams.Restrictions build() {
3514
        return new PaymentLinkUpdateParams.Restrictions(this.completedSessions, this.extraParams);
×
3515
      }
3516

3517
      /**
3518
       * <strong>Required.</strong> Configuration for the {@code completed_sessions} restriction
3519
       * type.
3520
       */
3521
      public Builder setCompletedSessions(
3522
          PaymentLinkUpdateParams.Restrictions.CompletedSessions completedSessions) {
3523
        this.completedSessions = completedSessions;
×
3524
        return this;
×
3525
      }
3526

3527
      /**
3528
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3529
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3530
       * PaymentLinkUpdateParams.Restrictions#extraParams} for the field documentation.
3531
       */
3532
      public Builder putExtraParam(String key, Object value) {
3533
        if (this.extraParams == null) {
×
3534
          this.extraParams = new HashMap<>();
×
3535
        }
3536
        this.extraParams.put(key, value);
×
3537
        return this;
×
3538
      }
3539

3540
      /**
3541
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3542
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3543
       * See {@link PaymentLinkUpdateParams.Restrictions#extraParams} for the field documentation.
3544
       */
3545
      public Builder putAllExtraParam(Map<String, Object> map) {
3546
        if (this.extraParams == null) {
×
3547
          this.extraParams = new HashMap<>();
×
3548
        }
3549
        this.extraParams.putAll(map);
×
3550
        return this;
×
3551
      }
3552
    }
3553

3554
    @Getter
3555
    public static class CompletedSessions {
3556
      /**
3557
       * Map of extra parameters for custom features not available in this client library. The
3558
       * content in this map is not serialized under this field's {@code @SerializedName} value.
3559
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
3560
       * name in this param object. Effectively, this map is flattened to its parent instance.
3561
       */
3562
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3563
      Map<String, Object> extraParams;
3564

3565
      /**
3566
       * <strong>Required.</strong> The maximum number of checkout sessions that can be completed
3567
       * for the {@code completed_sessions} restriction to be met.
3568
       */
3569
      @SerializedName("limit")
3570
      Long limit;
3571

3572
      private CompletedSessions(Map<String, Object> extraParams, Long limit) {
×
3573
        this.extraParams = extraParams;
×
3574
        this.limit = limit;
×
3575
      }
×
3576

3577
      public static Builder builder() {
3578
        return new Builder();
×
3579
      }
3580

3581
      public static class Builder {
×
3582
        private Map<String, Object> extraParams;
3583

3584
        private Long limit;
3585

3586
        /** Finalize and obtain parameter instance from this builder. */
3587
        public PaymentLinkUpdateParams.Restrictions.CompletedSessions build() {
3588
          return new PaymentLinkUpdateParams.Restrictions.CompletedSessions(
×
3589
              this.extraParams, this.limit);
3590
        }
3591

3592
        /**
3593
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
3594
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3595
         * map. See {@link PaymentLinkUpdateParams.Restrictions.CompletedSessions#extraParams} for
3596
         * the field documentation.
3597
         */
3598
        public Builder putExtraParam(String key, Object value) {
3599
          if (this.extraParams == null) {
×
3600
            this.extraParams = new HashMap<>();
×
3601
          }
3602
          this.extraParams.put(key, value);
×
3603
          return this;
×
3604
        }
3605

3606
        /**
3607
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3608
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3609
         * map. See {@link PaymentLinkUpdateParams.Restrictions.CompletedSessions#extraParams} for
3610
         * the field documentation.
3611
         */
3612
        public Builder putAllExtraParam(Map<String, Object> map) {
3613
          if (this.extraParams == null) {
×
3614
            this.extraParams = new HashMap<>();
×
3615
          }
3616
          this.extraParams.putAll(map);
×
3617
          return this;
×
3618
        }
3619

3620
        /**
3621
         * <strong>Required.</strong> The maximum number of checkout sessions that can be completed
3622
         * for the {@code completed_sessions} restriction to be met.
3623
         */
3624
        public Builder setLimit(Long limit) {
3625
          this.limit = limit;
×
3626
          return this;
×
3627
        }
3628
      }
3629
    }
3630
  }
3631

3632
  @Getter
3633
  public static class ShippingAddressCollection {
3634
    /**
3635
     * <strong>Required.</strong> An array of two-letter ISO country codes representing which
3636
     * countries Checkout should provide as options for shipping locations. Unsupported country
3637
     * codes: {@code AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}.
3638
     */
3639
    @SerializedName("allowed_countries")
3640
    List<PaymentLinkUpdateParams.ShippingAddressCollection.AllowedCountry> allowedCountries;
3641

3642
    /**
3643
     * Map of extra parameters for custom features not available in this client library. The content
3644
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3645
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3646
     * param object. Effectively, this map is flattened to its parent instance.
3647
     */
3648
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3649
    Map<String, Object> extraParams;
3650

3651
    private ShippingAddressCollection(
3652
        List<PaymentLinkUpdateParams.ShippingAddressCollection.AllowedCountry> allowedCountries,
3653
        Map<String, Object> extraParams) {
×
3654
      this.allowedCountries = allowedCountries;
×
3655
      this.extraParams = extraParams;
×
3656
    }
×
3657

3658
    public static Builder builder() {
3659
      return new Builder();
×
3660
    }
3661

3662
    public static class Builder {
×
3663
      private List<PaymentLinkUpdateParams.ShippingAddressCollection.AllowedCountry>
3664
          allowedCountries;
3665

3666
      private Map<String, Object> extraParams;
3667

3668
      /** Finalize and obtain parameter instance from this builder. */
3669
      public PaymentLinkUpdateParams.ShippingAddressCollection build() {
3670
        return new PaymentLinkUpdateParams.ShippingAddressCollection(
×
3671
            this.allowedCountries, this.extraParams);
3672
      }
3673

3674
      /**
3675
       * Add an element to `allowedCountries` list. A list is initialized for the first `add/addAll`
3676
       * call, and subsequent calls adds additional elements to the original list. See {@link
3677
       * PaymentLinkUpdateParams.ShippingAddressCollection#allowedCountries} for the field
3678
       * documentation.
3679
       */
3680
      public Builder addAllowedCountry(
3681
          PaymentLinkUpdateParams.ShippingAddressCollection.AllowedCountry element) {
3682
        if (this.allowedCountries == null) {
×
3683
          this.allowedCountries = new ArrayList<>();
×
3684
        }
3685
        this.allowedCountries.add(element);
×
3686
        return this;
×
3687
      }
3688

3689
      /**
3690
       * Add all elements to `allowedCountries` list. A list is initialized for the first
3691
       * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
3692
       * {@link PaymentLinkUpdateParams.ShippingAddressCollection#allowedCountries} for the field
3693
       * documentation.
3694
       */
3695
      public Builder addAllAllowedCountry(
3696
          List<PaymentLinkUpdateParams.ShippingAddressCollection.AllowedCountry> elements) {
3697
        if (this.allowedCountries == null) {
×
3698
          this.allowedCountries = new ArrayList<>();
×
3699
        }
3700
        this.allowedCountries.addAll(elements);
×
3701
        return this;
×
3702
      }
3703

3704
      /**
3705
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3706
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3707
       * PaymentLinkUpdateParams.ShippingAddressCollection#extraParams} for the field documentation.
3708
       */
3709
      public Builder putExtraParam(String key, Object value) {
3710
        if (this.extraParams == null) {
×
3711
          this.extraParams = new HashMap<>();
×
3712
        }
3713
        this.extraParams.put(key, value);
×
3714
        return this;
×
3715
      }
3716

3717
      /**
3718
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3719
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3720
       * See {@link PaymentLinkUpdateParams.ShippingAddressCollection#extraParams} for the field
3721
       * documentation.
3722
       */
3723
      public Builder putAllExtraParam(Map<String, Object> map) {
3724
        if (this.extraParams == null) {
×
3725
          this.extraParams = new HashMap<>();
×
3726
        }
3727
        this.extraParams.putAll(map);
×
3728
        return this;
×
3729
      }
3730
    }
3731

3732
    public enum AllowedCountry implements ApiRequestParams.EnumParam {
×
3733
      @SerializedName("AC")
×
3734
      AC("AC"),
3735

3736
      @SerializedName("AD")
×
3737
      AD("AD"),
3738

3739
      @SerializedName("AE")
×
3740
      AE("AE"),
3741

3742
      @SerializedName("AF")
×
3743
      AF("AF"),
3744

3745
      @SerializedName("AG")
×
3746
      AG("AG"),
3747

3748
      @SerializedName("AI")
×
3749
      AI("AI"),
3750

3751
      @SerializedName("AL")
×
3752
      AL("AL"),
3753

3754
      @SerializedName("AM")
×
3755
      AM("AM"),
3756

3757
      @SerializedName("AO")
×
3758
      AO("AO"),
3759

3760
      @SerializedName("AQ")
×
3761
      AQ("AQ"),
3762

3763
      @SerializedName("AR")
×
3764
      AR("AR"),
3765

3766
      @SerializedName("AT")
×
3767
      AT("AT"),
3768

3769
      @SerializedName("AU")
×
3770
      AU("AU"),
3771

3772
      @SerializedName("AW")
×
3773
      AW("AW"),
3774

3775
      @SerializedName("AX")
×
3776
      AX("AX"),
3777

3778
      @SerializedName("AZ")
×
3779
      AZ("AZ"),
3780

3781
      @SerializedName("BA")
×
3782
      BA("BA"),
3783

3784
      @SerializedName("BB")
×
3785
      BB("BB"),
3786

3787
      @SerializedName("BD")
×
3788
      BD("BD"),
3789

3790
      @SerializedName("BE")
×
3791
      BE("BE"),
3792

3793
      @SerializedName("BF")
×
3794
      BF("BF"),
3795

3796
      @SerializedName("BG")
×
3797
      BG("BG"),
3798

3799
      @SerializedName("BH")
×
3800
      BH("BH"),
3801

3802
      @SerializedName("BI")
×
3803
      BI("BI"),
3804

3805
      @SerializedName("BJ")
×
3806
      BJ("BJ"),
3807

3808
      @SerializedName("BL")
×
3809
      BL("BL"),
3810

3811
      @SerializedName("BM")
×
3812
      BM("BM"),
3813

3814
      @SerializedName("BN")
×
3815
      BN("BN"),
3816

3817
      @SerializedName("BO")
×
3818
      BO("BO"),
3819

3820
      @SerializedName("BQ")
×
3821
      BQ("BQ"),
3822

3823
      @SerializedName("BR")
×
3824
      BR("BR"),
3825

3826
      @SerializedName("BS")
×
3827
      BS("BS"),
3828

3829
      @SerializedName("BT")
×
3830
      BT("BT"),
3831

3832
      @SerializedName("BV")
×
3833
      BV("BV"),
3834

3835
      @SerializedName("BW")
×
3836
      BW("BW"),
3837

3838
      @SerializedName("BY")
×
3839
      BY("BY"),
3840

3841
      @SerializedName("BZ")
×
3842
      BZ("BZ"),
3843

3844
      @SerializedName("CA")
×
3845
      CA("CA"),
3846

3847
      @SerializedName("CD")
×
3848
      CD("CD"),
3849

3850
      @SerializedName("CF")
×
3851
      CF("CF"),
3852

3853
      @SerializedName("CG")
×
3854
      CG("CG"),
3855

3856
      @SerializedName("CH")
×
3857
      CH("CH"),
3858

3859
      @SerializedName("CI")
×
3860
      CI("CI"),
3861

3862
      @SerializedName("CK")
×
3863
      CK("CK"),
3864

3865
      @SerializedName("CL")
×
3866
      CL("CL"),
3867

3868
      @SerializedName("CM")
×
3869
      CM("CM"),
3870

3871
      @SerializedName("CN")
×
3872
      CN("CN"),
3873

3874
      @SerializedName("CO")
×
3875
      CO("CO"),
3876

3877
      @SerializedName("CR")
×
3878
      CR("CR"),
3879

3880
      @SerializedName("CV")
×
3881
      CV("CV"),
3882

3883
      @SerializedName("CW")
×
3884
      CW("CW"),
3885

3886
      @SerializedName("CY")
×
3887
      CY("CY"),
3888

3889
      @SerializedName("CZ")
×
3890
      CZ("CZ"),
3891

3892
      @SerializedName("DE")
×
3893
      DE("DE"),
3894

3895
      @SerializedName("DJ")
×
3896
      DJ("DJ"),
3897

3898
      @SerializedName("DK")
×
3899
      DK("DK"),
3900

3901
      @SerializedName("DM")
×
3902
      DM("DM"),
3903

3904
      @SerializedName("DO")
×
3905
      DO("DO"),
3906

3907
      @SerializedName("DZ")
×
3908
      DZ("DZ"),
3909

3910
      @SerializedName("EC")
×
3911
      EC("EC"),
3912

3913
      @SerializedName("EE")
×
3914
      EE("EE"),
3915

3916
      @SerializedName("EG")
×
3917
      EG("EG"),
3918

3919
      @SerializedName("EH")
×
3920
      EH("EH"),
3921

3922
      @SerializedName("ER")
×
3923
      ER("ER"),
3924

3925
      @SerializedName("ES")
×
3926
      ES("ES"),
3927

3928
      @SerializedName("ET")
×
3929
      ET("ET"),
3930

3931
      @SerializedName("FI")
×
3932
      FI("FI"),
3933

3934
      @SerializedName("FJ")
×
3935
      FJ("FJ"),
3936

3937
      @SerializedName("FK")
×
3938
      FK("FK"),
3939

3940
      @SerializedName("FO")
×
3941
      FO("FO"),
3942

3943
      @SerializedName("FR")
×
3944
      FR("FR"),
3945

3946
      @SerializedName("GA")
×
3947
      GA("GA"),
3948

3949
      @SerializedName("GB")
×
3950
      GB("GB"),
3951

3952
      @SerializedName("GD")
×
3953
      GD("GD"),
3954

3955
      @SerializedName("GE")
×
3956
      GE("GE"),
3957

3958
      @SerializedName("GF")
×
3959
      GF("GF"),
3960

3961
      @SerializedName("GG")
×
3962
      GG("GG"),
3963

3964
      @SerializedName("GH")
×
3965
      GH("GH"),
3966

3967
      @SerializedName("GI")
×
3968
      GI("GI"),
3969

3970
      @SerializedName("GL")
×
3971
      GL("GL"),
3972

3973
      @SerializedName("GM")
×
3974
      GM("GM"),
3975

3976
      @SerializedName("GN")
×
3977
      GN("GN"),
3978

3979
      @SerializedName("GP")
×
3980
      GP("GP"),
3981

3982
      @SerializedName("GQ")
×
3983
      GQ("GQ"),
3984

3985
      @SerializedName("GR")
×
3986
      GR("GR"),
3987

3988
      @SerializedName("GS")
×
3989
      GS("GS"),
3990

3991
      @SerializedName("GT")
×
3992
      GT("GT"),
3993

3994
      @SerializedName("GU")
×
3995
      GU("GU"),
3996

3997
      @SerializedName("GW")
×
3998
      GW("GW"),
3999

4000
      @SerializedName("GY")
×
4001
      GY("GY"),
4002

4003
      @SerializedName("HK")
×
4004
      HK("HK"),
4005

4006
      @SerializedName("HN")
×
4007
      HN("HN"),
4008

4009
      @SerializedName("HR")
×
4010
      HR("HR"),
4011

4012
      @SerializedName("HT")
×
4013
      HT("HT"),
4014

4015
      @SerializedName("HU")
×
4016
      HU("HU"),
4017

4018
      @SerializedName("ID")
×
4019
      ID("ID"),
4020

4021
      @SerializedName("IE")
×
4022
      IE("IE"),
4023

4024
      @SerializedName("IL")
×
4025
      IL("IL"),
4026

4027
      @SerializedName("IM")
×
4028
      IM("IM"),
4029

4030
      @SerializedName("IN")
×
4031
      IN("IN"),
4032

4033
      @SerializedName("IO")
×
4034
      IO("IO"),
4035

4036
      @SerializedName("IQ")
×
4037
      IQ("IQ"),
4038

4039
      @SerializedName("IS")
×
4040
      IS("IS"),
4041

4042
      @SerializedName("IT")
×
4043
      IT("IT"),
4044

4045
      @SerializedName("JE")
×
4046
      JE("JE"),
4047

4048
      @SerializedName("JM")
×
4049
      JM("JM"),
4050

4051
      @SerializedName("JO")
×
4052
      JO("JO"),
4053

4054
      @SerializedName("JP")
×
4055
      JP("JP"),
4056

4057
      @SerializedName("KE")
×
4058
      KE("KE"),
4059

4060
      @SerializedName("KG")
×
4061
      KG("KG"),
4062

4063
      @SerializedName("KH")
×
4064
      KH("KH"),
4065

4066
      @SerializedName("KI")
×
4067
      KI("KI"),
4068

4069
      @SerializedName("KM")
×
4070
      KM("KM"),
4071

4072
      @SerializedName("KN")
×
4073
      KN("KN"),
4074

4075
      @SerializedName("KR")
×
4076
      KR("KR"),
4077

4078
      @SerializedName("KW")
×
4079
      KW("KW"),
4080

4081
      @SerializedName("KY")
×
4082
      KY("KY"),
4083

4084
      @SerializedName("KZ")
×
4085
      KZ("KZ"),
4086

4087
      @SerializedName("LA")
×
4088
      LA("LA"),
4089

4090
      @SerializedName("LB")
×
4091
      LB("LB"),
4092

4093
      @SerializedName("LC")
×
4094
      LC("LC"),
4095

4096
      @SerializedName("LI")
×
4097
      LI("LI"),
4098

4099
      @SerializedName("LK")
×
4100
      LK("LK"),
4101

4102
      @SerializedName("LR")
×
4103
      LR("LR"),
4104

4105
      @SerializedName("LS")
×
4106
      LS("LS"),
4107

4108
      @SerializedName("LT")
×
4109
      LT("LT"),
4110

4111
      @SerializedName("LU")
×
4112
      LU("LU"),
4113

4114
      @SerializedName("LV")
×
4115
      LV("LV"),
4116

4117
      @SerializedName("LY")
×
4118
      LY("LY"),
4119

4120
      @SerializedName("MA")
×
4121
      MA("MA"),
4122

4123
      @SerializedName("MC")
×
4124
      MC("MC"),
4125

4126
      @SerializedName("MD")
×
4127
      MD("MD"),
4128

4129
      @SerializedName("ME")
×
4130
      ME("ME"),
4131

4132
      @SerializedName("MF")
×
4133
      MF("MF"),
4134

4135
      @SerializedName("MG")
×
4136
      MG("MG"),
4137

4138
      @SerializedName("MK")
×
4139
      MK("MK"),
4140

4141
      @SerializedName("ML")
×
4142
      ML("ML"),
4143

4144
      @SerializedName("MM")
×
4145
      MM("MM"),
4146

4147
      @SerializedName("MN")
×
4148
      MN("MN"),
4149

4150
      @SerializedName("MO")
×
4151
      MO("MO"),
4152

4153
      @SerializedName("MQ")
×
4154
      MQ("MQ"),
4155

4156
      @SerializedName("MR")
×
4157
      MR("MR"),
4158

4159
      @SerializedName("MS")
×
4160
      MS("MS"),
4161

4162
      @SerializedName("MT")
×
4163
      MT("MT"),
4164

4165
      @SerializedName("MU")
×
4166
      MU("MU"),
4167

4168
      @SerializedName("MV")
×
4169
      MV("MV"),
4170

4171
      @SerializedName("MW")
×
4172
      MW("MW"),
4173

4174
      @SerializedName("MX")
×
4175
      MX("MX"),
4176

4177
      @SerializedName("MY")
×
4178
      MY("MY"),
4179

4180
      @SerializedName("MZ")
×
4181
      MZ("MZ"),
4182

4183
      @SerializedName("NA")
×
4184
      NA("NA"),
4185

4186
      @SerializedName("NC")
×
4187
      NC("NC"),
4188

4189
      @SerializedName("NE")
×
4190
      NE("NE"),
4191

4192
      @SerializedName("NG")
×
4193
      NG("NG"),
4194

4195
      @SerializedName("NI")
×
4196
      NI("NI"),
4197

4198
      @SerializedName("NL")
×
4199
      NL("NL"),
4200

4201
      @SerializedName("NO")
×
4202
      NO("NO"),
4203

4204
      @SerializedName("NP")
×
4205
      NP("NP"),
4206

4207
      @SerializedName("NR")
×
4208
      NR("NR"),
4209

4210
      @SerializedName("NU")
×
4211
      NU("NU"),
4212

4213
      @SerializedName("NZ")
×
4214
      NZ("NZ"),
4215

4216
      @SerializedName("OM")
×
4217
      OM("OM"),
4218

4219
      @SerializedName("PA")
×
4220
      PA("PA"),
4221

4222
      @SerializedName("PE")
×
4223
      PE("PE"),
4224

4225
      @SerializedName("PF")
×
4226
      PF("PF"),
4227

4228
      @SerializedName("PG")
×
4229
      PG("PG"),
4230

4231
      @SerializedName("PH")
×
4232
      PH("PH"),
4233

4234
      @SerializedName("PK")
×
4235
      PK("PK"),
4236

4237
      @SerializedName("PL")
×
4238
      PL("PL"),
4239

4240
      @SerializedName("PM")
×
4241
      PM("PM"),
4242

4243
      @SerializedName("PN")
×
4244
      PN("PN"),
4245

4246
      @SerializedName("PR")
×
4247
      PR("PR"),
4248

4249
      @SerializedName("PS")
×
4250
      PS("PS"),
4251

4252
      @SerializedName("PT")
×
4253
      PT("PT"),
4254

4255
      @SerializedName("PY")
×
4256
      PY("PY"),
4257

4258
      @SerializedName("QA")
×
4259
      QA("QA"),
4260

4261
      @SerializedName("RE")
×
4262
      RE("RE"),
4263

4264
      @SerializedName("RO")
×
4265
      RO("RO"),
4266

4267
      @SerializedName("RS")
×
4268
      RS("RS"),
4269

4270
      @SerializedName("RU")
×
4271
      RU("RU"),
4272

4273
      @SerializedName("RW")
×
4274
      RW("RW"),
4275

4276
      @SerializedName("SA")
×
4277
      SA("SA"),
4278

4279
      @SerializedName("SB")
×
4280
      SB("SB"),
4281

4282
      @SerializedName("SC")
×
4283
      SC("SC"),
4284

4285
      @SerializedName("SE")
×
4286
      SE("SE"),
4287

4288
      @SerializedName("SG")
×
4289
      SG("SG"),
4290

4291
      @SerializedName("SH")
×
4292
      SH("SH"),
4293

4294
      @SerializedName("SI")
×
4295
      SI("SI"),
4296

4297
      @SerializedName("SJ")
×
4298
      SJ("SJ"),
4299

4300
      @SerializedName("SK")
×
4301
      SK("SK"),
4302

4303
      @SerializedName("SL")
×
4304
      SL("SL"),
4305

4306
      @SerializedName("SM")
×
4307
      SM("SM"),
4308

4309
      @SerializedName("SN")
×
4310
      SN("SN"),
4311

4312
      @SerializedName("SO")
×
4313
      SO("SO"),
4314

4315
      @SerializedName("SR")
×
4316
      SR("SR"),
4317

4318
      @SerializedName("SS")
×
4319
      SS("SS"),
4320

4321
      @SerializedName("ST")
×
4322
      ST("ST"),
4323

4324
      @SerializedName("SV")
×
4325
      SV("SV"),
4326

4327
      @SerializedName("SX")
×
4328
      SX("SX"),
4329

4330
      @SerializedName("SZ")
×
4331
      SZ("SZ"),
4332

4333
      @SerializedName("TA")
×
4334
      TA("TA"),
4335

4336
      @SerializedName("TC")
×
4337
      TC("TC"),
4338

4339
      @SerializedName("TD")
×
4340
      TD("TD"),
4341

4342
      @SerializedName("TF")
×
4343
      TF("TF"),
4344

4345
      @SerializedName("TG")
×
4346
      TG("TG"),
4347

4348
      @SerializedName("TH")
×
4349
      TH("TH"),
4350

4351
      @SerializedName("TJ")
×
4352
      TJ("TJ"),
4353

4354
      @SerializedName("TK")
×
4355
      TK("TK"),
4356

4357
      @SerializedName("TL")
×
4358
      TL("TL"),
4359

4360
      @SerializedName("TM")
×
4361
      TM("TM"),
4362

4363
      @SerializedName("TN")
×
4364
      TN("TN"),
4365

4366
      @SerializedName("TO")
×
4367
      TO("TO"),
4368

4369
      @SerializedName("TR")
×
4370
      TR("TR"),
4371

4372
      @SerializedName("TT")
×
4373
      TT("TT"),
4374

4375
      @SerializedName("TV")
×
4376
      TV("TV"),
4377

4378
      @SerializedName("TW")
×
4379
      TW("TW"),
4380

4381
      @SerializedName("TZ")
×
4382
      TZ("TZ"),
4383

4384
      @SerializedName("UA")
×
4385
      UA("UA"),
4386

4387
      @SerializedName("UG")
×
4388
      UG("UG"),
4389

4390
      @SerializedName("US")
×
4391
      US("US"),
4392

4393
      @SerializedName("UY")
×
4394
      UY("UY"),
4395

4396
      @SerializedName("UZ")
×
4397
      UZ("UZ"),
4398

4399
      @SerializedName("VA")
×
4400
      VA("VA"),
4401

4402
      @SerializedName("VC")
×
4403
      VC("VC"),
4404

4405
      @SerializedName("VE")
×
4406
      VE("VE"),
4407

4408
      @SerializedName("VG")
×
4409
      VG("VG"),
4410

4411
      @SerializedName("VN")
×
4412
      VN("VN"),
4413

4414
      @SerializedName("VU")
×
4415
      VU("VU"),
4416

4417
      @SerializedName("WF")
×
4418
      WF("WF"),
4419

4420
      @SerializedName("WS")
×
4421
      WS("WS"),
4422

4423
      @SerializedName("XK")
×
4424
      XK("XK"),
4425

4426
      @SerializedName("YE")
×
4427
      YE("YE"),
4428

4429
      @SerializedName("YT")
×
4430
      YT("YT"),
4431

4432
      @SerializedName("ZA")
×
4433
      ZA("ZA"),
4434

4435
      @SerializedName("ZM")
×
4436
      ZM("ZM"),
4437

4438
      @SerializedName("ZW")
×
4439
      ZW("ZW"),
4440

4441
      @SerializedName("ZZ")
×
4442
      ZZ("ZZ");
4443

4444
      @Getter(onMethod_ = {@Override})
4445
      private final String value;
4446

4447
      AllowedCountry(String value) {
×
4448
        this.value = value;
×
4449
      }
×
4450
    }
4451
  }
4452

4453
  @Getter
4454
  public static class SubscriptionData {
4455
    /**
4456
     * Map of extra parameters for custom features not available in this client library. The content
4457
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4458
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4459
     * param object. Effectively, this map is flattened to its parent instance.
4460
     */
4461
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4462
    Map<String, Object> extraParams;
4463

4464
    /** All invoices will be billed using the specified settings. */
4465
    @SerializedName("invoice_settings")
4466
    InvoiceSettings invoiceSettings;
4467

4468
    /**
4469
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
4470
     * declaratively set metadata on <a
4471
     * href="https://stripe.com/docs/api/subscriptions">Subscriptions</a> generated from this
4472
     * payment link. Unlike object-level metadata, this field is declarative. Updates will clear
4473
     * prior values.
4474
     */
4475
    @SerializedName("metadata")
4476
    Object metadata;
4477

4478
    /** Settings related to subscription trials. */
4479
    @SerializedName("trial_settings")
4480
    Object trialSettings;
4481

4482
    private SubscriptionData(
4483
        Map<String, Object> extraParams,
4484
        InvoiceSettings invoiceSettings,
4485
        Object metadata,
4486
        Object trialSettings) {
×
4487
      this.extraParams = extraParams;
×
4488
      this.invoiceSettings = invoiceSettings;
×
4489
      this.metadata = metadata;
×
4490
      this.trialSettings = trialSettings;
×
4491
    }
×
4492

4493
    public static Builder builder() {
4494
      return new Builder();
×
4495
    }
4496

4497
    public static class Builder {
×
4498
      private Map<String, Object> extraParams;
4499

4500
      private InvoiceSettings invoiceSettings;
4501

4502
      private Object metadata;
4503

4504
      private Object trialSettings;
4505

4506
      /** Finalize and obtain parameter instance from this builder. */
4507
      public PaymentLinkUpdateParams.SubscriptionData build() {
4508
        return new PaymentLinkUpdateParams.SubscriptionData(
×
4509
            this.extraParams, this.invoiceSettings, this.metadata, this.trialSettings);
4510
      }
4511

4512
      /**
4513
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4514
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4515
       * PaymentLinkUpdateParams.SubscriptionData#extraParams} for the field documentation.
4516
       */
4517
      public Builder putExtraParam(String key, Object value) {
4518
        if (this.extraParams == null) {
×
4519
          this.extraParams = new HashMap<>();
×
4520
        }
4521
        this.extraParams.put(key, value);
×
4522
        return this;
×
4523
      }
4524

4525
      /**
4526
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4527
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4528
       * See {@link PaymentLinkUpdateParams.SubscriptionData#extraParams} for the field
4529
       * documentation.
4530
       */
4531
      public Builder putAllExtraParam(Map<String, Object> map) {
4532
        if (this.extraParams == null) {
×
4533
          this.extraParams = new HashMap<>();
×
4534
        }
4535
        this.extraParams.putAll(map);
×
4536
        return this;
×
4537
      }
4538

4539
      /** All invoices will be billed using the specified settings. */
4540
      public Builder setInvoiceSettings(
4541
          PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings invoiceSettings) {
4542
        this.invoiceSettings = invoiceSettings;
×
4543
        return this;
×
4544
      }
4545

4546
      /**
4547
       * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
4548
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4549
       * PaymentLinkUpdateParams.SubscriptionData#metadata} for the field documentation.
4550
       */
4551
      @SuppressWarnings("unchecked")
4552
      public Builder putMetadata(String key, String value) {
4553
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
4554
          this.metadata = new HashMap<String, String>();
×
4555
        }
4556
        ((Map<String, String>) this.metadata).put(key, value);
×
4557
        return this;
×
4558
      }
4559

4560
      /**
4561
       * Add all map key/value pairs to `metadata` map. A map is initialized for the first
4562
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4563
       * See {@link PaymentLinkUpdateParams.SubscriptionData#metadata} for the field documentation.
4564
       */
4565
      @SuppressWarnings("unchecked")
4566
      public Builder putAllMetadata(Map<String, String> map) {
4567
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
4568
          this.metadata = new HashMap<String, String>();
×
4569
        }
4570
        ((Map<String, String>) this.metadata).putAll(map);
×
4571
        return this;
×
4572
      }
4573

4574
      /**
4575
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
4576
       * declaratively set metadata on <a
4577
       * href="https://stripe.com/docs/api/subscriptions">Subscriptions</a> generated from this
4578
       * payment link. Unlike object-level metadata, this field is declarative. Updates will clear
4579
       * prior values.
4580
       */
4581
      public Builder setMetadata(EmptyParam metadata) {
4582
        this.metadata = metadata;
×
4583
        return this;
×
4584
      }
4585

4586
      /**
4587
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
4588
       * declaratively set metadata on <a
4589
       * href="https://stripe.com/docs/api/subscriptions">Subscriptions</a> generated from this
4590
       * payment link. Unlike object-level metadata, this field is declarative. Updates will clear
4591
       * prior values.
4592
       */
4593
      public Builder setMetadata(Map<String, String> metadata) {
4594
        this.metadata = metadata;
×
4595
        return this;
×
4596
      }
4597

4598
      /** Settings related to subscription trials. */
4599
      public Builder setTrialSettings(
4600
          PaymentLinkUpdateParams.SubscriptionData.TrialSettings trialSettings) {
4601
        this.trialSettings = trialSettings;
×
4602
        return this;
×
4603
      }
4604

4605
      /** Settings related to subscription trials. */
4606
      public Builder setTrialSettings(EmptyParam trialSettings) {
4607
        this.trialSettings = trialSettings;
×
4608
        return this;
×
4609
      }
4610
    }
4611

4612
    @Getter
4613
    public static class InvoiceSettings {
4614
      /**
4615
       * Map of extra parameters for custom features not available in this client library. The
4616
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4617
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4618
       * name in this param object. Effectively, this map is flattened to its parent instance.
4619
       */
4620
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4621
      Map<String, Object> extraParams;
4622

4623
      /**
4624
       * The connected account that issues the invoice. The invoice is presented with the branding
4625
       * and support information of the specified account.
4626
       */
4627
      @SerializedName("issuer")
4628
      Issuer issuer;
4629

4630
      private InvoiceSettings(Map<String, Object> extraParams, Issuer issuer) {
×
4631
        this.extraParams = extraParams;
×
4632
        this.issuer = issuer;
×
4633
      }
×
4634

4635
      public static Builder builder() {
4636
        return new Builder();
×
4637
      }
4638

4639
      public static class Builder {
×
4640
        private Map<String, Object> extraParams;
4641

4642
        private Issuer issuer;
4643

4644
        /** Finalize and obtain parameter instance from this builder. */
4645
        public PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings build() {
4646
          return new PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings(
×
4647
              this.extraParams, this.issuer);
4648
        }
4649

4650
        /**
4651
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
4652
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4653
         * map. See {@link PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings#extraParams} for
4654
         * the field documentation.
4655
         */
4656
        public Builder putExtraParam(String key, Object value) {
4657
          if (this.extraParams == null) {
×
4658
            this.extraParams = new HashMap<>();
×
4659
          }
4660
          this.extraParams.put(key, value);
×
4661
          return this;
×
4662
        }
4663

4664
        /**
4665
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4666
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4667
         * map. See {@link PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings#extraParams} for
4668
         * the field documentation.
4669
         */
4670
        public Builder putAllExtraParam(Map<String, Object> map) {
4671
          if (this.extraParams == null) {
×
4672
            this.extraParams = new HashMap<>();
×
4673
          }
4674
          this.extraParams.putAll(map);
×
4675
          return this;
×
4676
        }
4677

4678
        /**
4679
         * The connected account that issues the invoice. The invoice is presented with the branding
4680
         * and support information of the specified account.
4681
         */
4682
        public Builder setIssuer(
4683
            PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings.Issuer issuer) {
4684
          this.issuer = issuer;
×
4685
          return this;
×
4686
        }
4687
      }
4688

4689
      @Getter
4690
      public static class Issuer {
4691
        /** The connected account being referenced when {@code type} is {@code account}. */
4692
        @SerializedName("account")
4693
        Object account;
4694

4695
        /**
4696
         * Map of extra parameters for custom features not available in this client library. The
4697
         * content in this map is not serialized under this field's {@code @SerializedName} value.
4698
         * Instead, each key/value pair is serialized as if the key is a root-level field
4699
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
4700
         * instance.
4701
         */
4702
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4703
        Map<String, Object> extraParams;
4704

4705
        /** <strong>Required.</strong> Type of the account referenced in the request. */
4706
        @SerializedName("type")
4707
        Type type;
4708

4709
        private Issuer(Object account, Map<String, Object> extraParams, Type type) {
×
4710
          this.account = account;
×
4711
          this.extraParams = extraParams;
×
4712
          this.type = type;
×
4713
        }
×
4714

4715
        public static Builder builder() {
4716
          return new Builder();
×
4717
        }
4718

4719
        public static class Builder {
×
4720
          private Object account;
4721

4722
          private Map<String, Object> extraParams;
4723

4724
          private Type type;
4725

4726
          /** Finalize and obtain parameter instance from this builder. */
4727
          public PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings.Issuer build() {
4728
            return new PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings.Issuer(
×
4729
                this.account, this.extraParams, this.type);
4730
          }
4731

4732
          /** The connected account being referenced when {@code type} is {@code account}. */
4733
          public Builder setAccount(String account) {
4734
            this.account = account;
×
4735
            return this;
×
4736
          }
4737

4738
          /** The connected account being referenced when {@code type} is {@code account}. */
4739
          public Builder setAccount(EmptyParam account) {
4740
            this.account = account;
×
4741
            return this;
×
4742
          }
4743

4744
          /**
4745
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
4746
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4747
           * map. See {@link
4748
           * PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings.Issuer#extraParams} for the
4749
           * field documentation.
4750
           */
4751
          public Builder putExtraParam(String key, Object value) {
4752
            if (this.extraParams == null) {
×
4753
              this.extraParams = new HashMap<>();
×
4754
            }
4755
            this.extraParams.put(key, value);
×
4756
            return this;
×
4757
          }
4758

4759
          /**
4760
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4761
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4762
           * map. See {@link
4763
           * PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings.Issuer#extraParams} for the
4764
           * field documentation.
4765
           */
4766
          public Builder putAllExtraParam(Map<String, Object> map) {
4767
            if (this.extraParams == null) {
×
4768
              this.extraParams = new HashMap<>();
×
4769
            }
4770
            this.extraParams.putAll(map);
×
4771
            return this;
×
4772
          }
4773

4774
          /** <strong>Required.</strong> Type of the account referenced in the request. */
4775
          public Builder setType(
4776
              PaymentLinkUpdateParams.SubscriptionData.InvoiceSettings.Issuer.Type type) {
4777
            this.type = type;
×
4778
            return this;
×
4779
          }
4780
        }
4781

4782
        public enum Type implements ApiRequestParams.EnumParam {
×
4783
          @SerializedName("account")
×
4784
          ACCOUNT("account"),
4785

4786
          @SerializedName("self")
×
4787
          SELF("self");
4788

4789
          @Getter(onMethod_ = {@Override})
4790
          private final String value;
4791

4792
          Type(String value) {
×
4793
            this.value = value;
×
4794
          }
×
4795
        }
4796
      }
4797
    }
4798

4799
    @Getter
4800
    public static class TrialSettings {
4801
      /**
4802
       * <strong>Required.</strong> Defines how the subscription should behave when the user's free
4803
       * trial ends.
4804
       */
4805
      @SerializedName("end_behavior")
4806
      EndBehavior endBehavior;
4807

4808
      /**
4809
       * Map of extra parameters for custom features not available in this client library. The
4810
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4811
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4812
       * name in this param object. Effectively, this map is flattened to its parent instance.
4813
       */
4814
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4815
      Map<String, Object> extraParams;
4816

4817
      private TrialSettings(EndBehavior endBehavior, Map<String, Object> extraParams) {
×
4818
        this.endBehavior = endBehavior;
×
4819
        this.extraParams = extraParams;
×
4820
      }
×
4821

4822
      public static Builder builder() {
4823
        return new Builder();
×
4824
      }
4825

4826
      public static class Builder {
×
4827
        private EndBehavior endBehavior;
4828

4829
        private Map<String, Object> extraParams;
4830

4831
        /** Finalize and obtain parameter instance from this builder. */
4832
        public PaymentLinkUpdateParams.SubscriptionData.TrialSettings build() {
4833
          return new PaymentLinkUpdateParams.SubscriptionData.TrialSettings(
×
4834
              this.endBehavior, this.extraParams);
4835
        }
4836

4837
        /**
4838
         * <strong>Required.</strong> Defines how the subscription should behave when the user's
4839
         * free trial ends.
4840
         */
4841
        public Builder setEndBehavior(
4842
            PaymentLinkUpdateParams.SubscriptionData.TrialSettings.EndBehavior endBehavior) {
4843
          this.endBehavior = endBehavior;
×
4844
          return this;
×
4845
        }
4846

4847
        /**
4848
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
4849
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4850
         * map. See {@link PaymentLinkUpdateParams.SubscriptionData.TrialSettings#extraParams} for
4851
         * the field documentation.
4852
         */
4853
        public Builder putExtraParam(String key, Object value) {
4854
          if (this.extraParams == null) {
×
4855
            this.extraParams = new HashMap<>();
×
4856
          }
4857
          this.extraParams.put(key, value);
×
4858
          return this;
×
4859
        }
4860

4861
        /**
4862
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4863
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4864
         * map. See {@link PaymentLinkUpdateParams.SubscriptionData.TrialSettings#extraParams} for
4865
         * the field documentation.
4866
         */
4867
        public Builder putAllExtraParam(Map<String, Object> map) {
4868
          if (this.extraParams == null) {
×
4869
            this.extraParams = new HashMap<>();
×
4870
          }
4871
          this.extraParams.putAll(map);
×
4872
          return this;
×
4873
        }
4874
      }
4875

4876
      @Getter
4877
      public static class EndBehavior {
4878
        /**
4879
         * Map of extra parameters for custom features not available in this client library. The
4880
         * content in this map is not serialized under this field's {@code @SerializedName} value.
4881
         * Instead, each key/value pair is serialized as if the key is a root-level field
4882
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
4883
         * instance.
4884
         */
4885
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4886
        Map<String, Object> extraParams;
4887

4888
        /**
4889
         * <strong>Required.</strong> Indicates how the subscription should change when the trial
4890
         * ends if the user did not provide a payment method.
4891
         */
4892
        @SerializedName("missing_payment_method")
4893
        MissingPaymentMethod missingPaymentMethod;
4894

4895
        private EndBehavior(
4896
            Map<String, Object> extraParams, MissingPaymentMethod missingPaymentMethod) {
×
4897
          this.extraParams = extraParams;
×
4898
          this.missingPaymentMethod = missingPaymentMethod;
×
4899
        }
×
4900

4901
        public static Builder builder() {
4902
          return new Builder();
×
4903
        }
4904

4905
        public static class Builder {
×
4906
          private Map<String, Object> extraParams;
4907

4908
          private MissingPaymentMethod missingPaymentMethod;
4909

4910
          /** Finalize and obtain parameter instance from this builder. */
4911
          public PaymentLinkUpdateParams.SubscriptionData.TrialSettings.EndBehavior build() {
4912
            return new PaymentLinkUpdateParams.SubscriptionData.TrialSettings.EndBehavior(
×
4913
                this.extraParams, this.missingPaymentMethod);
4914
          }
4915

4916
          /**
4917
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
4918
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4919
           * map. See {@link
4920
           * PaymentLinkUpdateParams.SubscriptionData.TrialSettings.EndBehavior#extraParams} for the
4921
           * field documentation.
4922
           */
4923
          public Builder putExtraParam(String key, Object value) {
4924
            if (this.extraParams == null) {
×
4925
              this.extraParams = new HashMap<>();
×
4926
            }
4927
            this.extraParams.put(key, value);
×
4928
            return this;
×
4929
          }
4930

4931
          /**
4932
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4933
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4934
           * map. See {@link
4935
           * PaymentLinkUpdateParams.SubscriptionData.TrialSettings.EndBehavior#extraParams} for the
4936
           * field documentation.
4937
           */
4938
          public Builder putAllExtraParam(Map<String, Object> map) {
4939
            if (this.extraParams == null) {
×
4940
              this.extraParams = new HashMap<>();
×
4941
            }
4942
            this.extraParams.putAll(map);
×
4943
            return this;
×
4944
          }
4945

4946
          /**
4947
           * <strong>Required.</strong> Indicates how the subscription should change when the trial
4948
           * ends if the user did not provide a payment method.
4949
           */
4950
          public Builder setMissingPaymentMethod(
4951
              PaymentLinkUpdateParams.SubscriptionData.TrialSettings.EndBehavior
4952
                      .MissingPaymentMethod
4953
                  missingPaymentMethod) {
4954
            this.missingPaymentMethod = missingPaymentMethod;
×
4955
            return this;
×
4956
          }
4957
        }
4958

4959
        public enum MissingPaymentMethod implements ApiRequestParams.EnumParam {
×
4960
          @SerializedName("cancel")
×
4961
          CANCEL("cancel"),
4962

4963
          @SerializedName("create_invoice")
×
4964
          CREATE_INVOICE("create_invoice"),
4965

4966
          @SerializedName("pause")
×
4967
          PAUSE("pause");
4968

4969
          @Getter(onMethod_ = {@Override})
4970
          private final String value;
4971

4972
          MissingPaymentMethod(String value) {
×
4973
            this.value = value;
×
4974
          }
×
4975
        }
4976
      }
4977
    }
4978
  }
4979

4980
  @Getter
4981
  public static class TaxIdCollection {
4982
    /**
4983
     * <strong>Required.</strong> Enable tax ID collection during checkout. Defaults to {@code
4984
     * false}.
4985
     */
4986
    @SerializedName("enabled")
4987
    Boolean enabled;
4988

4989
    /**
4990
     * Map of extra parameters for custom features not available in this client library. The content
4991
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4992
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4993
     * param object. Effectively, this map is flattened to its parent instance.
4994
     */
4995
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4996
    Map<String, Object> extraParams;
4997

4998
    /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */
4999
    @SerializedName("required")
5000
    Required required;
5001

5002
    private TaxIdCollection(Boolean enabled, Map<String, Object> extraParams, Required required) {
×
5003
      this.enabled = enabled;
×
5004
      this.extraParams = extraParams;
×
5005
      this.required = required;
×
5006
    }
×
5007

5008
    public static Builder builder() {
5009
      return new Builder();
×
5010
    }
5011

5012
    public static class Builder {
×
5013
      private Boolean enabled;
5014

5015
      private Map<String, Object> extraParams;
5016

5017
      private Required required;
5018

5019
      /** Finalize and obtain parameter instance from this builder. */
5020
      public PaymentLinkUpdateParams.TaxIdCollection build() {
5021
        return new PaymentLinkUpdateParams.TaxIdCollection(
×
5022
            this.enabled, this.extraParams, this.required);
5023
      }
5024

5025
      /**
5026
       * <strong>Required.</strong> Enable tax ID collection during checkout. Defaults to {@code
5027
       * false}.
5028
       */
5029
      public Builder setEnabled(Boolean enabled) {
5030
        this.enabled = enabled;
×
5031
        return this;
×
5032
      }
5033

5034
      /**
5035
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5036
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5037
       * PaymentLinkUpdateParams.TaxIdCollection#extraParams} for the field documentation.
5038
       */
5039
      public Builder putExtraParam(String key, Object value) {
5040
        if (this.extraParams == null) {
×
5041
          this.extraParams = new HashMap<>();
×
5042
        }
5043
        this.extraParams.put(key, value);
×
5044
        return this;
×
5045
      }
5046

5047
      /**
5048
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5049
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5050
       * See {@link PaymentLinkUpdateParams.TaxIdCollection#extraParams} for the field
5051
       * documentation.
5052
       */
5053
      public Builder putAllExtraParam(Map<String, Object> map) {
5054
        if (this.extraParams == null) {
×
5055
          this.extraParams = new HashMap<>();
×
5056
        }
5057
        this.extraParams.putAll(map);
×
5058
        return this;
×
5059
      }
5060

5061
      /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */
5062
      public Builder setRequired(PaymentLinkUpdateParams.TaxIdCollection.Required required) {
5063
        this.required = required;
×
5064
        return this;
×
5065
      }
5066
    }
5067

5068
    public enum Required implements ApiRequestParams.EnumParam {
×
5069
      @SerializedName("if_supported")
×
5070
      IF_SUPPORTED("if_supported"),
5071

5072
      @SerializedName("never")
×
5073
      NEVER("never");
5074

5075
      @Getter(onMethod_ = {@Override})
5076
      private final String value;
5077

5078
      Required(String value) {
×
5079
        this.value = value;
×
5080
      }
×
5081
    }
5082
  }
5083

5084
  public enum BillingAddressCollection implements ApiRequestParams.EnumParam {
×
5085
    @SerializedName("auto")
×
5086
    AUTO("auto"),
5087

5088
    @SerializedName("required")
×
5089
    REQUIRED("required");
5090

5091
    @Getter(onMethod_ = {@Override})
5092
    private final String value;
5093

5094
    BillingAddressCollection(String value) {
×
5095
      this.value = value;
×
5096
    }
×
5097
  }
5098

5099
  public enum CustomerCreation implements ApiRequestParams.EnumParam {
×
5100
    @SerializedName("always")
×
5101
    ALWAYS("always"),
5102

5103
    @SerializedName("if_required")
×
5104
    IF_REQUIRED("if_required");
5105

5106
    @Getter(onMethod_ = {@Override})
5107
    private final String value;
5108

5109
    CustomerCreation(String value) {
×
5110
      this.value = value;
×
5111
    }
×
5112
  }
5113

5114
  public enum PaymentMethodCollection implements ApiRequestParams.EnumParam {
×
5115
    @SerializedName("always")
×
5116
    ALWAYS("always"),
5117

5118
    @SerializedName("if_required")
×
5119
    IF_REQUIRED("if_required");
5120

5121
    @Getter(onMethod_ = {@Override})
5122
    private final String value;
5123

5124
    PaymentMethodCollection(String value) {
×
5125
      this.value = value;
×
5126
    }
×
5127
  }
5128

5129
  public enum PaymentMethodType implements ApiRequestParams.EnumParam {
×
5130
    @SerializedName("affirm")
×
5131
    AFFIRM("affirm"),
5132

5133
    @SerializedName("afterpay_clearpay")
×
5134
    AFTERPAY_CLEARPAY("afterpay_clearpay"),
5135

5136
    @SerializedName("alipay")
×
5137
    ALIPAY("alipay"),
5138

NEW
5139
    @SerializedName("alma")
×
5140
    ALMA("alma"),
5141

UNCOV
5142
    @SerializedName("au_becs_debit")
×
5143
    AU_BECS_DEBIT("au_becs_debit"),
5144

5145
    @SerializedName("bacs_debit")
×
5146
    BACS_DEBIT("bacs_debit"),
5147

5148
    @SerializedName("bancontact")
×
5149
    BANCONTACT("bancontact"),
5150

5151
    @SerializedName("blik")
×
5152
    BLIK("blik"),
5153

5154
    @SerializedName("boleto")
×
5155
    BOLETO("boleto"),
5156

5157
    @SerializedName("card")
×
5158
    CARD("card"),
5159

5160
    @SerializedName("cashapp")
×
5161
    CASHAPP("cashapp"),
5162

5163
    @SerializedName("eps")
×
5164
    EPS("eps"),
5165

5166
    @SerializedName("fpx")
×
5167
    FPX("fpx"),
5168

5169
    @SerializedName("giropay")
×
5170
    GIROPAY("giropay"),
5171

NEW
5172
    @SerializedName("gopay")
×
5173
    GOPAY("gopay"),
5174

UNCOV
5175
    @SerializedName("grabpay")
×
5176
    GRABPAY("grabpay"),
5177

5178
    @SerializedName("ideal")
×
5179
    IDEAL("ideal"),
5180

5181
    @SerializedName("klarna")
×
5182
    KLARNA("klarna"),
5183

5184
    @SerializedName("konbini")
×
5185
    KONBINI("konbini"),
5186

5187
    @SerializedName("link")
×
5188
    LINK("link"),
5189

5190
    @SerializedName("mb_way")
×
5191
    MB_WAY("mb_way"),
5192

5193
    @SerializedName("mobilepay")
×
5194
    MOBILEPAY("mobilepay"),
5195

5196
    @SerializedName("multibanco")
×
5197
    MULTIBANCO("multibanco"),
5198

5199
    @SerializedName("oxxo")
×
5200
    OXXO("oxxo"),
5201

5202
    @SerializedName("p24")
×
5203
    P24("p24"),
5204

5205
    @SerializedName("paynow")
×
5206
    PAYNOW("paynow"),
5207

5208
    @SerializedName("paypal")
×
5209
    PAYPAL("paypal"),
5210

5211
    @SerializedName("payto")
×
5212
    PAYTO("payto"),
5213

5214
    @SerializedName("pix")
×
5215
    PIX("pix"),
5216

5217
    @SerializedName("promptpay")
×
5218
    PROMPTPAY("promptpay"),
5219

NEW
5220
    @SerializedName("qris")
×
5221
    QRIS("qris"),
5222

UNCOV
5223
    @SerializedName("rechnung")
×
5224
    RECHNUNG("rechnung"),
5225

5226
    @SerializedName("sepa_debit")
×
5227
    SEPA_DEBIT("sepa_debit"),
5228

NEW
5229
    @SerializedName("shopeepay")
×
5230
    SHOPEEPAY("shopeepay"),
5231

UNCOV
5232
    @SerializedName("sofort")
×
5233
    SOFORT("sofort"),
5234

5235
    @SerializedName("swish")
×
5236
    SWISH("swish"),
5237

5238
    @SerializedName("twint")
×
5239
    TWINT("twint"),
5240

5241
    @SerializedName("us_bank_account")
×
5242
    US_BANK_ACCOUNT("us_bank_account"),
5243

5244
    @SerializedName("wechat_pay")
×
5245
    WECHAT_PAY("wechat_pay"),
5246

5247
    @SerializedName("zip")
×
5248
    ZIP("zip");
5249

5250
    @Getter(onMethod_ = {@Override})
5251
    private final String value;
5252

5253
    PaymentMethodType(String value) {
×
5254
      this.value = value;
×
5255
    }
×
5256
  }
5257
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc