• 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

3.7
/src/main/java/com/stripe/param/PaymentLinkCreateParams.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.math.BigDecimal;
8
import java.util.ArrayList;
9
import java.util.HashMap;
10
import java.util.List;
11
import java.util.Map;
12
import lombok.Getter;
13

14
@Getter
15
public class PaymentLinkCreateParams extends ApiRequestParams {
16
  /** Behavior after the purchase is complete. */
17
  @SerializedName("after_completion")
18
  AfterCompletion afterCompletion;
19

20
  /** Enables user redeemable promotion codes. */
21
  @SerializedName("allow_promotion_codes")
22
  Boolean allowPromotionCodes;
23

24
  /**
25
   * The amount of the application fee (if any) that will be requested to be applied to the payment
26
   * and transferred to the application owner's Stripe account. Can only be applied when there are
27
   * no line items with recurring prices.
28
   */
29
  @SerializedName("application_fee_amount")
30
  Long applicationFeeAmount;
31

32
  /**
33
   * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the
34
   * percentage of the subscription invoice total that will be transferred to the application
35
   * owner's Stripe account. There must be at least 1 line item with a recurring price to use this
36
   * field.
37
   */
38
  @SerializedName("application_fee_percent")
39
  BigDecimal applicationFeePercent;
40

41
  /** Configuration for automatic tax collection. */
42
  @SerializedName("automatic_tax")
43
  AutomaticTax automaticTax;
44

45
  /** Configuration for collecting the customer's billing address. Defaults to {@code auto}. */
46
  @SerializedName("billing_address_collection")
47
  BillingAddressCollection billingAddressCollection;
48

49
  /** Configure fields to gather active consent from customers. */
50
  @SerializedName("consent_collection")
51
  ConsentCollection consentCollection;
52

53
  /**
54
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
55
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a> and
56
   * supported by each line item's price.
57
   */
58
  @SerializedName("currency")
59
  String currency;
60

61
  /**
62
   * Collect additional information from your customer using custom fields. Up to 3 fields are
63
   * supported.
64
   */
65
  @SerializedName("custom_fields")
66
  List<PaymentLinkCreateParams.CustomField> customFields;
67

68
  /** Display additional text for your customers using custom text. */
69
  @SerializedName("custom_text")
70
  CustomText customText;
71

72
  /**
73
   * Configures whether <a href="https://stripe.com/docs/api/checkout/sessions">checkout
74
   * sessions</a> created by this payment link create a <a
75
   * href="https://stripe.com/docs/api/customers">Customer</a>.
76
   */
77
  @SerializedName("customer_creation")
78
  CustomerCreation customerCreation;
79

80
  /** Specifies which fields in the response should be expanded. */
81
  @SerializedName("expand")
82
  List<String> expand;
83

84
  /**
85
   * Map of extra parameters for custom features not available in this client library. The content
86
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
87
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
88
   * param object. Effectively, this map is flattened to its parent instance.
89
   */
90
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
91
  Map<String, Object> extraParams;
92

93
  /** The custom message to be displayed to a customer when a payment link is no longer active. */
94
  @SerializedName("inactive_message")
95
  String inactiveMessage;
96

97
  /** Generate a post-purchase Invoice for one-time payments. */
98
  @SerializedName("invoice_creation")
99
  InvoiceCreation invoiceCreation;
100

101
  /**
102
   * <strong>Required.</strong> The line items representing what is being sold. Each line item
103
   * represents an item being sold. Up to 20 line items are supported.
104
   */
105
  @SerializedName("line_items")
106
  List<PaymentLinkCreateParams.LineItem> lineItems;
107

108
  /**
109
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
110
   * to an object. This can be useful for storing additional information about the object in a
111
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
112
   * be unset by posting an empty value to {@code metadata}. Metadata associated with this Payment
113
   * Link will automatically be copied to <a
114
   * href="https://stripe.com/docs/api/checkout/sessions">checkout sessions</a> created by this
115
   * payment link.
116
   */
117
  @SerializedName("metadata")
118
  Map<String, String> metadata;
119

120
  /** The account on behalf of which to charge. */
121
  @SerializedName("on_behalf_of")
122
  String onBehalfOf;
123

124
  /**
125
   * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code
126
   * payment} mode.
127
   */
128
  @SerializedName("payment_intent_data")
129
  PaymentIntentData paymentIntentData;
130

131
  /**
132
   * Specify whether Checkout should collect a payment method. When set to {@code if_required},
133
   * Checkout will not collect a payment method when the total due for the session is 0.This may
134
   * occur if the Checkout Session includes a free trial or a discount.
135
   *
136
   * <p>Can only be set in {@code subscription} mode. Defaults to {@code always}.
137
   *
138
   * <p>If you'd like information on how to collect a payment method outside of Checkout, read the
139
   * guide on <a href="https://stripe.com/docs/payments/checkout/free-trials">configuring
140
   * subscriptions with a free trial</a>.
141
   */
142
  @SerializedName("payment_method_collection")
143
  PaymentMethodCollection paymentMethodCollection;
144

145
  /**
146
   * The list of payment method types that customers can use. If no value is passed, Stripe will
147
   * dynamically show relevant payment methods from your <a
148
   * href="https://dashboard.stripe.com/settings/payment_methods">payment method settings</a> (20+
149
   * payment methods <a
150
   * href="https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support">supported</a>).
151
   */
152
  @SerializedName("payment_method_types")
153
  List<PaymentLinkCreateParams.PaymentMethodType> paymentMethodTypes;
154

155
  /**
156
   * Controls phone number collection settings during checkout.
157
   *
158
   * <p>We recommend that you review your privacy policy and check with your legal contacts.
159
   */
160
  @SerializedName("phone_number_collection")
161
  PhoneNumberCollection phoneNumberCollection;
162

163
  /** Settings that restrict the usage of a payment link. */
164
  @SerializedName("restrictions")
165
  Restrictions restrictions;
166

167
  /** Configuration for collecting the customer's shipping address. */
168
  @SerializedName("shipping_address_collection")
169
  ShippingAddressCollection shippingAddressCollection;
170

171
  /**
172
   * The shipping rate options to apply to <a
173
   * href="https://stripe.com/docs/api/checkout/sessions">checkout sessions</a> created by this
174
   * payment link.
175
   */
176
  @SerializedName("shipping_options")
177
  List<PaymentLinkCreateParams.ShippingOption> shippingOptions;
178

179
  /**
180
   * Describes the type of transaction being performed in order to customize relevant text on the
181
   * page, such as the submit button. Changing this value will also affect the hostname in the <a
182
   * href="https://stripe.com/docs/api/payment_links/payment_links/object#url">url</a> property
183
   * (example: {@code donate.stripe.com}).
184
   */
185
  @SerializedName("submit_type")
186
  SubmitType submitType;
187

188
  /**
189
   * When creating a subscription, the specified configuration data will be used. There must be at
190
   * least one line item with a recurring price to use {@code subscription_data}.
191
   */
192
  @SerializedName("subscription_data")
193
  SubscriptionData subscriptionData;
194

195
  /** Controls tax ID collection during checkout. */
196
  @SerializedName("tax_id_collection")
197
  TaxIdCollection taxIdCollection;
198

199
  /**
200
   * The account (if any) the payments will be attributed to for tax reporting, and where funds from
201
   * each payment will be transferred to.
202
   */
203
  @SerializedName("transfer_data")
204
  TransferData transferData;
205

206
  private PaymentLinkCreateParams(
207
      AfterCompletion afterCompletion,
208
      Boolean allowPromotionCodes,
209
      Long applicationFeeAmount,
210
      BigDecimal applicationFeePercent,
211
      AutomaticTax automaticTax,
212
      BillingAddressCollection billingAddressCollection,
213
      ConsentCollection consentCollection,
214
      String currency,
215
      List<PaymentLinkCreateParams.CustomField> customFields,
216
      CustomText customText,
217
      CustomerCreation customerCreation,
218
      List<String> expand,
219
      Map<String, Object> extraParams,
220
      String inactiveMessage,
221
      InvoiceCreation invoiceCreation,
222
      List<PaymentLinkCreateParams.LineItem> lineItems,
223
      Map<String, String> metadata,
224
      String onBehalfOf,
225
      PaymentIntentData paymentIntentData,
226
      PaymentMethodCollection paymentMethodCollection,
227
      List<PaymentLinkCreateParams.PaymentMethodType> paymentMethodTypes,
228
      PhoneNumberCollection phoneNumberCollection,
229
      Restrictions restrictions,
230
      ShippingAddressCollection shippingAddressCollection,
231
      List<PaymentLinkCreateParams.ShippingOption> shippingOptions,
232
      SubmitType submitType,
233
      SubscriptionData subscriptionData,
234
      TaxIdCollection taxIdCollection,
235
      TransferData transferData) {
1✔
236
    this.afterCompletion = afterCompletion;
1✔
237
    this.allowPromotionCodes = allowPromotionCodes;
1✔
238
    this.applicationFeeAmount = applicationFeeAmount;
1✔
239
    this.applicationFeePercent = applicationFeePercent;
1✔
240
    this.automaticTax = automaticTax;
1✔
241
    this.billingAddressCollection = billingAddressCollection;
1✔
242
    this.consentCollection = consentCollection;
1✔
243
    this.currency = currency;
1✔
244
    this.customFields = customFields;
1✔
245
    this.customText = customText;
1✔
246
    this.customerCreation = customerCreation;
1✔
247
    this.expand = expand;
1✔
248
    this.extraParams = extraParams;
1✔
249
    this.inactiveMessage = inactiveMessage;
1✔
250
    this.invoiceCreation = invoiceCreation;
1✔
251
    this.lineItems = lineItems;
1✔
252
    this.metadata = metadata;
1✔
253
    this.onBehalfOf = onBehalfOf;
1✔
254
    this.paymentIntentData = paymentIntentData;
1✔
255
    this.paymentMethodCollection = paymentMethodCollection;
1✔
256
    this.paymentMethodTypes = paymentMethodTypes;
1✔
257
    this.phoneNumberCollection = phoneNumberCollection;
1✔
258
    this.restrictions = restrictions;
1✔
259
    this.shippingAddressCollection = shippingAddressCollection;
1✔
260
    this.shippingOptions = shippingOptions;
1✔
261
    this.submitType = submitType;
1✔
262
    this.subscriptionData = subscriptionData;
1✔
263
    this.taxIdCollection = taxIdCollection;
1✔
264
    this.transferData = transferData;
1✔
265
  }
1✔
266

267
  public static Builder builder() {
268
    return new Builder();
1✔
269
  }
270

271
  public static class Builder {
1✔
272
    private AfterCompletion afterCompletion;
273

274
    private Boolean allowPromotionCodes;
275

276
    private Long applicationFeeAmount;
277

278
    private BigDecimal applicationFeePercent;
279

280
    private AutomaticTax automaticTax;
281

282
    private BillingAddressCollection billingAddressCollection;
283

284
    private ConsentCollection consentCollection;
285

286
    private String currency;
287

288
    private List<PaymentLinkCreateParams.CustomField> customFields;
289

290
    private CustomText customText;
291

292
    private CustomerCreation customerCreation;
293

294
    private List<String> expand;
295

296
    private Map<String, Object> extraParams;
297

298
    private String inactiveMessage;
299

300
    private InvoiceCreation invoiceCreation;
301

302
    private List<PaymentLinkCreateParams.LineItem> lineItems;
303

304
    private Map<String, String> metadata;
305

306
    private String onBehalfOf;
307

308
    private PaymentIntentData paymentIntentData;
309

310
    private PaymentMethodCollection paymentMethodCollection;
311

312
    private List<PaymentLinkCreateParams.PaymentMethodType> paymentMethodTypes;
313

314
    private PhoneNumberCollection phoneNumberCollection;
315

316
    private Restrictions restrictions;
317

318
    private ShippingAddressCollection shippingAddressCollection;
319

320
    private List<PaymentLinkCreateParams.ShippingOption> shippingOptions;
321

322
    private SubmitType submitType;
323

324
    private SubscriptionData subscriptionData;
325

326
    private TaxIdCollection taxIdCollection;
327

328
    private TransferData transferData;
329

330
    /** Finalize and obtain parameter instance from this builder. */
331
    public PaymentLinkCreateParams build() {
332
      return new PaymentLinkCreateParams(
1✔
333
          this.afterCompletion,
334
          this.allowPromotionCodes,
335
          this.applicationFeeAmount,
336
          this.applicationFeePercent,
337
          this.automaticTax,
338
          this.billingAddressCollection,
339
          this.consentCollection,
340
          this.currency,
341
          this.customFields,
342
          this.customText,
343
          this.customerCreation,
344
          this.expand,
345
          this.extraParams,
346
          this.inactiveMessage,
347
          this.invoiceCreation,
348
          this.lineItems,
349
          this.metadata,
350
          this.onBehalfOf,
351
          this.paymentIntentData,
352
          this.paymentMethodCollection,
353
          this.paymentMethodTypes,
354
          this.phoneNumberCollection,
355
          this.restrictions,
356
          this.shippingAddressCollection,
357
          this.shippingOptions,
358
          this.submitType,
359
          this.subscriptionData,
360
          this.taxIdCollection,
361
          this.transferData);
362
    }
363

364
    /** Behavior after the purchase is complete. */
365
    public Builder setAfterCompletion(PaymentLinkCreateParams.AfterCompletion afterCompletion) {
366
      this.afterCompletion = afterCompletion;
×
367
      return this;
×
368
    }
369

370
    /** Enables user redeemable promotion codes. */
371
    public Builder setAllowPromotionCodes(Boolean allowPromotionCodes) {
372
      this.allowPromotionCodes = allowPromotionCodes;
×
373
      return this;
×
374
    }
375

376
    /**
377
     * The amount of the application fee (if any) that will be requested to be applied to the
378
     * payment and transferred to the application owner's Stripe account. Can only be applied when
379
     * there are no line items with recurring prices.
380
     */
381
    public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
382
      this.applicationFeeAmount = applicationFeeAmount;
×
383
      return this;
×
384
    }
385

386
    /**
387
     * A non-negative decimal between 0 and 100, with at most two decimal places. This represents
388
     * the percentage of the subscription invoice total that will be transferred to the application
389
     * owner's Stripe account. There must be at least 1 line item with a recurring price to use this
390
     * field.
391
     */
392
    public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) {
393
      this.applicationFeePercent = applicationFeePercent;
×
394
      return this;
×
395
    }
396

397
    /** Configuration for automatic tax collection. */
398
    public Builder setAutomaticTax(PaymentLinkCreateParams.AutomaticTax automaticTax) {
399
      this.automaticTax = automaticTax;
×
400
      return this;
×
401
    }
402

403
    /** Configuration for collecting the customer's billing address. Defaults to {@code auto}. */
404
    public Builder setBillingAddressCollection(
405
        PaymentLinkCreateParams.BillingAddressCollection billingAddressCollection) {
406
      this.billingAddressCollection = billingAddressCollection;
×
407
      return this;
×
408
    }
409

410
    /** Configure fields to gather active consent from customers. */
411
    public Builder setConsentCollection(
412
        PaymentLinkCreateParams.ConsentCollection consentCollection) {
413
      this.consentCollection = consentCollection;
×
414
      return this;
×
415
    }
416

417
    /**
418
     * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
419
     * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
420
     * currency</a> and supported by each line item's price.
421
     */
422
    public Builder setCurrency(String currency) {
423
      this.currency = currency;
×
424
      return this;
×
425
    }
426

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

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

453
    /** Display additional text for your customers using custom text. */
454
    public Builder setCustomText(PaymentLinkCreateParams.CustomText customText) {
455
      this.customText = customText;
×
456
      return this;
×
457
    }
458

459
    /**
460
     * Configures whether <a href="https://stripe.com/docs/api/checkout/sessions">checkout
461
     * sessions</a> created by this payment link create a <a
462
     * href="https://stripe.com/docs/api/customers">Customer</a>.
463
     */
464
    public Builder setCustomerCreation(PaymentLinkCreateParams.CustomerCreation customerCreation) {
465
      this.customerCreation = customerCreation;
×
466
      return this;
×
467
    }
468

469
    /**
470
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
471
     * subsequent calls adds additional elements to the original list. See {@link
472
     * PaymentLinkCreateParams#expand} for the field documentation.
473
     */
474
    public Builder addExpand(String element) {
475
      if (this.expand == null) {
×
476
        this.expand = new ArrayList<>();
×
477
      }
478
      this.expand.add(element);
×
479
      return this;
×
480
    }
481

482
    /**
483
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
484
     * subsequent calls adds additional elements to the original list. See {@link
485
     * PaymentLinkCreateParams#expand} for the field documentation.
486
     */
487
    public Builder addAllExpand(List<String> elements) {
488
      if (this.expand == null) {
×
489
        this.expand = new ArrayList<>();
×
490
      }
491
      this.expand.addAll(elements);
×
492
      return this;
×
493
    }
494

495
    /**
496
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
497
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
498
     * PaymentLinkCreateParams#extraParams} for the field documentation.
499
     */
500
    public Builder putExtraParam(String key, Object value) {
501
      if (this.extraParams == null) {
×
502
        this.extraParams = new HashMap<>();
×
503
      }
504
      this.extraParams.put(key, value);
×
505
      return this;
×
506
    }
507

508
    /**
509
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
510
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
511
     * See {@link PaymentLinkCreateParams#extraParams} for the field documentation.
512
     */
513
    public Builder putAllExtraParam(Map<String, Object> map) {
514
      if (this.extraParams == null) {
×
515
        this.extraParams = new HashMap<>();
×
516
      }
517
      this.extraParams.putAll(map);
×
518
      return this;
×
519
    }
520

521
    /** The custom message to be displayed to a customer when a payment link is no longer active. */
522
    public Builder setInactiveMessage(String inactiveMessage) {
523
      this.inactiveMessage = inactiveMessage;
×
524
      return this;
×
525
    }
526

527
    /** Generate a post-purchase Invoice for one-time payments. */
528
    public Builder setInvoiceCreation(PaymentLinkCreateParams.InvoiceCreation invoiceCreation) {
529
      this.invoiceCreation = invoiceCreation;
×
530
      return this;
×
531
    }
532

533
    /**
534
     * Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call,
535
     * and subsequent calls adds additional elements to the original list. See {@link
536
     * PaymentLinkCreateParams#lineItems} for the field documentation.
537
     */
538
    public Builder addLineItem(PaymentLinkCreateParams.LineItem element) {
539
      if (this.lineItems == null) {
1✔
540
        this.lineItems = new ArrayList<>();
1✔
541
      }
542
      this.lineItems.add(element);
1✔
543
      return this;
1✔
544
    }
545

546
    /**
547
     * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` call,
548
     * and subsequent calls adds additional elements to the original list. See {@link
549
     * PaymentLinkCreateParams#lineItems} for the field documentation.
550
     */
551
    public Builder addAllLineItem(List<PaymentLinkCreateParams.LineItem> elements) {
552
      if (this.lineItems == null) {
×
553
        this.lineItems = new ArrayList<>();
×
554
      }
555
      this.lineItems.addAll(elements);
×
556
      return this;
×
557
    }
558

559
    /**
560
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
561
     * and subsequent calls add additional key/value pairs to the original map. See {@link
562
     * PaymentLinkCreateParams#metadata} for the field documentation.
563
     */
564
    public Builder putMetadata(String key, String value) {
565
      if (this.metadata == null) {
×
566
        this.metadata = new HashMap<>();
×
567
      }
568
      this.metadata.put(key, value);
×
569
      return this;
×
570
    }
571

572
    /**
573
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
574
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
575
     * See {@link PaymentLinkCreateParams#metadata} for the field documentation.
576
     */
577
    public Builder putAllMetadata(Map<String, String> map) {
578
      if (this.metadata == null) {
×
579
        this.metadata = new HashMap<>();
×
580
      }
581
      this.metadata.putAll(map);
×
582
      return this;
×
583
    }
584

585
    /** The account on behalf of which to charge. */
586
    public Builder setOnBehalfOf(String onBehalfOf) {
587
      this.onBehalfOf = onBehalfOf;
×
588
      return this;
×
589
    }
590

591
    /**
592
     * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code
593
     * payment} mode.
594
     */
595
    public Builder setPaymentIntentData(
596
        PaymentLinkCreateParams.PaymentIntentData paymentIntentData) {
597
      this.paymentIntentData = paymentIntentData;
×
598
      return this;
×
599
    }
600

601
    /**
602
     * Specify whether Checkout should collect a payment method. When set to {@code if_required},
603
     * Checkout will not collect a payment method when the total due for the session is 0.This may
604
     * occur if the Checkout Session includes a free trial or a discount.
605
     *
606
     * <p>Can only be set in {@code subscription} mode. Defaults to {@code always}.
607
     *
608
     * <p>If you'd like information on how to collect a payment method outside of Checkout, read the
609
     * guide on <a href="https://stripe.com/docs/payments/checkout/free-trials">configuring
610
     * subscriptions with a free trial</a>.
611
     */
612
    public Builder setPaymentMethodCollection(
613
        PaymentLinkCreateParams.PaymentMethodCollection paymentMethodCollection) {
614
      this.paymentMethodCollection = paymentMethodCollection;
×
615
      return this;
×
616
    }
617

618
    /**
619
     * Add an element to `paymentMethodTypes` list. A list is initialized for the first `add/addAll`
620
     * call, and subsequent calls adds additional elements to the original list. See {@link
621
     * PaymentLinkCreateParams#paymentMethodTypes} for the field documentation.
622
     */
623
    public Builder addPaymentMethodType(PaymentLinkCreateParams.PaymentMethodType element) {
624
      if (this.paymentMethodTypes == null) {
×
625
        this.paymentMethodTypes = new ArrayList<>();
×
626
      }
627
      this.paymentMethodTypes.add(element);
×
628
      return this;
×
629
    }
630

631
    /**
632
     * Add all elements to `paymentMethodTypes` list. A list is initialized for the first
633
     * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
634
     * {@link PaymentLinkCreateParams#paymentMethodTypes} for the field documentation.
635
     */
636
    public Builder addAllPaymentMethodType(
637
        List<PaymentLinkCreateParams.PaymentMethodType> elements) {
638
      if (this.paymentMethodTypes == null) {
×
639
        this.paymentMethodTypes = new ArrayList<>();
×
640
      }
641
      this.paymentMethodTypes.addAll(elements);
×
642
      return this;
×
643
    }
644

645
    /**
646
     * Controls phone number collection settings during checkout.
647
     *
648
     * <p>We recommend that you review your privacy policy and check with your legal contacts.
649
     */
650
    public Builder setPhoneNumberCollection(
651
        PaymentLinkCreateParams.PhoneNumberCollection phoneNumberCollection) {
652
      this.phoneNumberCollection = phoneNumberCollection;
×
653
      return this;
×
654
    }
655

656
    /** Settings that restrict the usage of a payment link. */
657
    public Builder setRestrictions(PaymentLinkCreateParams.Restrictions restrictions) {
658
      this.restrictions = restrictions;
×
659
      return this;
×
660
    }
661

662
    /** Configuration for collecting the customer's shipping address. */
663
    public Builder setShippingAddressCollection(
664
        PaymentLinkCreateParams.ShippingAddressCollection shippingAddressCollection) {
665
      this.shippingAddressCollection = shippingAddressCollection;
×
666
      return this;
×
667
    }
668

669
    /**
670
     * Add an element to `shippingOptions` list. A list is initialized for the first `add/addAll`
671
     * call, and subsequent calls adds additional elements to the original list. See {@link
672
     * PaymentLinkCreateParams#shippingOptions} for the field documentation.
673
     */
674
    public Builder addShippingOption(PaymentLinkCreateParams.ShippingOption element) {
675
      if (this.shippingOptions == null) {
×
676
        this.shippingOptions = new ArrayList<>();
×
677
      }
678
      this.shippingOptions.add(element);
×
679
      return this;
×
680
    }
681

682
    /**
683
     * Add all elements to `shippingOptions` list. A list is initialized for the first `add/addAll`
684
     * call, and subsequent calls adds additional elements to the original list. See {@link
685
     * PaymentLinkCreateParams#shippingOptions} for the field documentation.
686
     */
687
    public Builder addAllShippingOption(List<PaymentLinkCreateParams.ShippingOption> elements) {
688
      if (this.shippingOptions == null) {
×
689
        this.shippingOptions = new ArrayList<>();
×
690
      }
691
      this.shippingOptions.addAll(elements);
×
692
      return this;
×
693
    }
694

695
    /**
696
     * Describes the type of transaction being performed in order to customize relevant text on the
697
     * page, such as the submit button. Changing this value will also affect the hostname in the <a
698
     * href="https://stripe.com/docs/api/payment_links/payment_links/object#url">url</a> property
699
     * (example: {@code donate.stripe.com}).
700
     */
701
    public Builder setSubmitType(PaymentLinkCreateParams.SubmitType submitType) {
702
      this.submitType = submitType;
×
703
      return this;
×
704
    }
705

706
    /**
707
     * When creating a subscription, the specified configuration data will be used. There must be at
708
     * least one line item with a recurring price to use {@code subscription_data}.
709
     */
710
    public Builder setSubscriptionData(PaymentLinkCreateParams.SubscriptionData subscriptionData) {
711
      this.subscriptionData = subscriptionData;
×
712
      return this;
×
713
    }
714

715
    /** Controls tax ID collection during checkout. */
716
    public Builder setTaxIdCollection(PaymentLinkCreateParams.TaxIdCollection taxIdCollection) {
717
      this.taxIdCollection = taxIdCollection;
×
718
      return this;
×
719
    }
720

721
    /**
722
     * The account (if any) the payments will be attributed to for tax reporting, and where funds
723
     * from each payment will be transferred to.
724
     */
725
    public Builder setTransferData(PaymentLinkCreateParams.TransferData transferData) {
726
      this.transferData = transferData;
×
727
      return this;
×
728
    }
729
  }
730

731
  @Getter
732
  public static class AfterCompletion {
733
    /**
734
     * Map of extra parameters for custom features not available in this client library. The content
735
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
736
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
737
     * param object. Effectively, this map is flattened to its parent instance.
738
     */
739
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
740
    Map<String, Object> extraParams;
741

742
    /** Configuration when {@code type=hosted_confirmation}. */
743
    @SerializedName("hosted_confirmation")
744
    HostedConfirmation hostedConfirmation;
745

746
    /** Configuration when {@code type=redirect}. */
747
    @SerializedName("redirect")
748
    Redirect redirect;
749

750
    /**
751
     * <strong>Required.</strong> The specified behavior after the purchase is complete. Either
752
     * {@code redirect} or {@code hosted_confirmation}.
753
     */
754
    @SerializedName("type")
755
    Type type;
756

757
    private AfterCompletion(
758
        Map<String, Object> extraParams,
759
        HostedConfirmation hostedConfirmation,
760
        Redirect redirect,
761
        Type type) {
×
762
      this.extraParams = extraParams;
×
763
      this.hostedConfirmation = hostedConfirmation;
×
764
      this.redirect = redirect;
×
765
      this.type = type;
×
766
    }
×
767

768
    public static Builder builder() {
769
      return new Builder();
×
770
    }
771

772
    public static class Builder {
×
773
      private Map<String, Object> extraParams;
774

775
      private HostedConfirmation hostedConfirmation;
776

777
      private Redirect redirect;
778

779
      private Type type;
780

781
      /** Finalize and obtain parameter instance from this builder. */
782
      public PaymentLinkCreateParams.AfterCompletion build() {
783
        return new PaymentLinkCreateParams.AfterCompletion(
×
784
            this.extraParams, this.hostedConfirmation, this.redirect, this.type);
785
      }
786

787
      /**
788
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
789
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
790
       * PaymentLinkCreateParams.AfterCompletion#extraParams} for the field documentation.
791
       */
792
      public Builder putExtraParam(String key, Object value) {
793
        if (this.extraParams == null) {
×
794
          this.extraParams = new HashMap<>();
×
795
        }
796
        this.extraParams.put(key, value);
×
797
        return this;
×
798
      }
799

800
      /**
801
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
802
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
803
       * See {@link PaymentLinkCreateParams.AfterCompletion#extraParams} for the field
804
       * documentation.
805
       */
806
      public Builder putAllExtraParam(Map<String, Object> map) {
807
        if (this.extraParams == null) {
×
808
          this.extraParams = new HashMap<>();
×
809
        }
810
        this.extraParams.putAll(map);
×
811
        return this;
×
812
      }
813

814
      /** Configuration when {@code type=hosted_confirmation}. */
815
      public Builder setHostedConfirmation(
816
          PaymentLinkCreateParams.AfterCompletion.HostedConfirmation hostedConfirmation) {
817
        this.hostedConfirmation = hostedConfirmation;
×
818
        return this;
×
819
      }
820

821
      /** Configuration when {@code type=redirect}. */
822
      public Builder setRedirect(PaymentLinkCreateParams.AfterCompletion.Redirect redirect) {
823
        this.redirect = redirect;
×
824
        return this;
×
825
      }
826

827
      /**
828
       * <strong>Required.</strong> The specified behavior after the purchase is complete. Either
829
       * {@code redirect} or {@code hosted_confirmation}.
830
       */
831
      public Builder setType(PaymentLinkCreateParams.AfterCompletion.Type type) {
832
        this.type = type;
×
833
        return this;
×
834
      }
835
    }
836

837
    @Getter
838
    public static class HostedConfirmation {
839
      /** A custom message to display to the customer after the purchase is complete. */
840
      @SerializedName("custom_message")
841
      String customMessage;
842

843
      /**
844
       * Map of extra parameters for custom features not available in this client library. The
845
       * content in this map is not serialized under this field's {@code @SerializedName} value.
846
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
847
       * name in this param object. Effectively, this map is flattened to its parent instance.
848
       */
849
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
850
      Map<String, Object> extraParams;
851

852
      private HostedConfirmation(String customMessage, Map<String, Object> extraParams) {
×
853
        this.customMessage = customMessage;
×
854
        this.extraParams = extraParams;
×
855
      }
×
856

857
      public static Builder builder() {
858
        return new Builder();
×
859
      }
860

861
      public static class Builder {
×
862
        private String customMessage;
863

864
        private Map<String, Object> extraParams;
865

866
        /** Finalize and obtain parameter instance from this builder. */
867
        public PaymentLinkCreateParams.AfterCompletion.HostedConfirmation build() {
868
          return new PaymentLinkCreateParams.AfterCompletion.HostedConfirmation(
×
869
              this.customMessage, this.extraParams);
870
        }
871

872
        /** A custom message to display to the customer after the purchase is complete. */
873
        public Builder setCustomMessage(String customMessage) {
874
          this.customMessage = customMessage;
×
875
          return this;
×
876
        }
877

878
        /**
879
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
880
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
881
         * map. See {@link PaymentLinkCreateParams.AfterCompletion.HostedConfirmation#extraParams}
882
         * for the field documentation.
883
         */
884
        public Builder putExtraParam(String key, Object value) {
885
          if (this.extraParams == null) {
×
886
            this.extraParams = new HashMap<>();
×
887
          }
888
          this.extraParams.put(key, value);
×
889
          return this;
×
890
        }
891

892
        /**
893
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
894
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
895
         * map. See {@link PaymentLinkCreateParams.AfterCompletion.HostedConfirmation#extraParams}
896
         * for the field documentation.
897
         */
898
        public Builder putAllExtraParam(Map<String, Object> map) {
899
          if (this.extraParams == null) {
×
900
            this.extraParams = new HashMap<>();
×
901
          }
902
          this.extraParams.putAll(map);
×
903
          return this;
×
904
        }
905
      }
906
    }
907

908
    @Getter
909
    public static class Redirect {
910
      /**
911
       * Map of extra parameters for custom features not available in this client library. The
912
       * content in this map is not serialized under this field's {@code @SerializedName} value.
913
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
914
       * name in this param object. Effectively, this map is flattened to its parent instance.
915
       */
916
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
917
      Map<String, Object> extraParams;
918

919
      /**
920
       * <strong>Required.</strong> The URL the customer will be redirected to after the purchase is
921
       * complete. You can embed {@code {CHECKOUT_SESSION_ID}} into the URL to have the {@code id}
922
       * of the completed <a
923
       * href="https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id">checkout
924
       * session</a> included.
925
       */
926
      @SerializedName("url")
927
      String url;
928

929
      private Redirect(Map<String, Object> extraParams, String url) {
×
930
        this.extraParams = extraParams;
×
931
        this.url = url;
×
932
      }
×
933

934
      public static Builder builder() {
935
        return new Builder();
×
936
      }
937

938
      public static class Builder {
×
939
        private Map<String, Object> extraParams;
940

941
        private String url;
942

943
        /** Finalize and obtain parameter instance from this builder. */
944
        public PaymentLinkCreateParams.AfterCompletion.Redirect build() {
945
          return new PaymentLinkCreateParams.AfterCompletion.Redirect(this.extraParams, this.url);
×
946
        }
947

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

962
        /**
963
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
964
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
965
         * map. See {@link PaymentLinkCreateParams.AfterCompletion.Redirect#extraParams} for the
966
         * 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
         * <strong>Required.</strong> The URL the customer will be redirected to after the purchase
978
         * is complete. You can embed {@code {CHECKOUT_SESSION_ID}} into the URL to have the {@code
979
         * id} of the completed <a
980
         * href="https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id">checkout
981
         * session</a> included.
982
         */
983
        public Builder setUrl(String url) {
984
          this.url = url;
×
985
          return this;
×
986
        }
987
      }
988
    }
989

990
    public enum Type implements ApiRequestParams.EnumParam {
×
991
      @SerializedName("hosted_confirmation")
×
992
      HOSTED_CONFIRMATION("hosted_confirmation"),
993

994
      @SerializedName("redirect")
×
995
      REDIRECT("redirect");
996

997
      @Getter(onMethod_ = {@Override})
998
      private final String value;
999

1000
      Type(String value) {
×
1001
        this.value = value;
×
1002
      }
×
1003
    }
1004
  }
1005

1006
  @Getter
1007
  public static class AutomaticTax {
1008
    /**
1009
     * <strong>Required.</strong> If {@code true}, tax will be calculated automatically using the
1010
     * customer's location.
1011
     */
1012
    @SerializedName("enabled")
1013
    Boolean enabled;
1014

1015
    /**
1016
     * Map of extra parameters for custom features not available in this client library. The content
1017
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1018
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1019
     * param object. Effectively, this map is flattened to its parent instance.
1020
     */
1021
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1022
    Map<String, Object> extraParams;
1023

1024
    /**
1025
     * The account that's liable for tax. If set, the business address and tax registrations
1026
     * required to perform the tax calculation are loaded from this account. The tax transaction is
1027
     * returned in the report of the connected account.
1028
     */
1029
    @SerializedName("liability")
1030
    Liability liability;
1031

1032
    private AutomaticTax(Boolean enabled, Map<String, Object> extraParams, Liability liability) {
×
1033
      this.enabled = enabled;
×
1034
      this.extraParams = extraParams;
×
1035
      this.liability = liability;
×
1036
    }
×
1037

1038
    public static Builder builder() {
1039
      return new Builder();
×
1040
    }
1041

1042
    public static class Builder {
×
1043
      private Boolean enabled;
1044

1045
      private Map<String, Object> extraParams;
1046

1047
      private Liability liability;
1048

1049
      /** Finalize and obtain parameter instance from this builder. */
1050
      public PaymentLinkCreateParams.AutomaticTax build() {
1051
        return new PaymentLinkCreateParams.AutomaticTax(
×
1052
            this.enabled, this.extraParams, this.liability);
1053
      }
1054

1055
      /**
1056
       * <strong>Required.</strong> If {@code true}, tax will be calculated automatically using the
1057
       * customer's location.
1058
       */
1059
      public Builder setEnabled(Boolean enabled) {
1060
        this.enabled = enabled;
×
1061
        return this;
×
1062
      }
1063

1064
      /**
1065
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1066
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1067
       * PaymentLinkCreateParams.AutomaticTax#extraParams} for the field documentation.
1068
       */
1069
      public Builder putExtraParam(String key, Object value) {
1070
        if (this.extraParams == null) {
×
1071
          this.extraParams = new HashMap<>();
×
1072
        }
1073
        this.extraParams.put(key, value);
×
1074
        return this;
×
1075
      }
1076

1077
      /**
1078
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1079
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1080
       * See {@link PaymentLinkCreateParams.AutomaticTax#extraParams} for the field documentation.
1081
       */
1082
      public Builder putAllExtraParam(Map<String, Object> map) {
1083
        if (this.extraParams == null) {
×
1084
          this.extraParams = new HashMap<>();
×
1085
        }
1086
        this.extraParams.putAll(map);
×
1087
        return this;
×
1088
      }
1089

1090
      /**
1091
       * The account that's liable for tax. If set, the business address and tax registrations
1092
       * required to perform the tax calculation are loaded from this account. The tax transaction
1093
       * is returned in the report of the connected account.
1094
       */
1095
      public Builder setLiability(PaymentLinkCreateParams.AutomaticTax.Liability liability) {
1096
        this.liability = liability;
×
1097
        return this;
×
1098
      }
1099
    }
1100

1101
    @Getter
1102
    public static class Liability {
1103
      /** The connected account being referenced when {@code type} is {@code account}. */
1104
      @SerializedName("account")
1105
      String account;
1106

1107
      /**
1108
       * Map of extra parameters for custom features not available in this client library. The
1109
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1110
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1111
       * name in this param object. Effectively, this map is flattened to its parent instance.
1112
       */
1113
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1114
      Map<String, Object> extraParams;
1115

1116
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1117
      @SerializedName("type")
1118
      Type type;
1119

1120
      private Liability(String account, Map<String, Object> extraParams, Type type) {
×
1121
        this.account = account;
×
1122
        this.extraParams = extraParams;
×
1123
        this.type = type;
×
1124
      }
×
1125

1126
      public static Builder builder() {
1127
        return new Builder();
×
1128
      }
1129

1130
      public static class Builder {
×
1131
        private String account;
1132

1133
        private Map<String, Object> extraParams;
1134

1135
        private Type type;
1136

1137
        /** Finalize and obtain parameter instance from this builder. */
1138
        public PaymentLinkCreateParams.AutomaticTax.Liability build() {
1139
          return new PaymentLinkCreateParams.AutomaticTax.Liability(
×
1140
              this.account, this.extraParams, this.type);
1141
        }
1142

1143
        /** The connected account being referenced when {@code type} is {@code account}. */
1144
        public Builder setAccount(String account) {
1145
          this.account = account;
×
1146
          return this;
×
1147
        }
1148

1149
        /**
1150
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1151
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1152
         * map. See {@link PaymentLinkCreateParams.AutomaticTax.Liability#extraParams} for the field
1153
         * documentation.
1154
         */
1155
        public Builder putExtraParam(String key, Object value) {
1156
          if (this.extraParams == null) {
×
1157
            this.extraParams = new HashMap<>();
×
1158
          }
1159
          this.extraParams.put(key, value);
×
1160
          return this;
×
1161
        }
1162

1163
        /**
1164
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1165
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1166
         * map. See {@link PaymentLinkCreateParams.AutomaticTax.Liability#extraParams} for the field
1167
         * documentation.
1168
         */
1169
        public Builder putAllExtraParam(Map<String, Object> map) {
1170
          if (this.extraParams == null) {
×
1171
            this.extraParams = new HashMap<>();
×
1172
          }
1173
          this.extraParams.putAll(map);
×
1174
          return this;
×
1175
        }
1176

1177
        /** <strong>Required.</strong> Type of the account referenced in the request. */
1178
        public Builder setType(PaymentLinkCreateParams.AutomaticTax.Liability.Type type) {
1179
          this.type = type;
×
1180
          return this;
×
1181
        }
1182
      }
1183

1184
      public enum Type implements ApiRequestParams.EnumParam {
×
1185
        @SerializedName("account")
×
1186
        ACCOUNT("account"),
1187

1188
        @SerializedName("self")
×
1189
        SELF("self");
1190

1191
        @Getter(onMethod_ = {@Override})
1192
        private final String value;
1193

1194
        Type(String value) {
×
1195
          this.value = value;
×
1196
        }
×
1197
      }
1198
    }
1199
  }
1200

1201
  @Getter
1202
  public static class ConsentCollection {
1203
    /**
1204
     * Map of extra parameters for custom features not available in this client library. The content
1205
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1206
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1207
     * param object. Effectively, this map is flattened to its parent instance.
1208
     */
1209
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1210
    Map<String, Object> extraParams;
1211

1212
    /**
1213
     * Determines the display of payment method reuse agreement text in the UI. If set to {@code
1214
     * hidden}, it will hide legal text related to the reuse of a payment method.
1215
     */
1216
    @SerializedName("payment_method_reuse_agreement")
1217
    PaymentMethodReuseAgreement paymentMethodReuseAgreement;
1218

1219
    /**
1220
     * If set to {@code auto}, enables the collection of customer consent for promotional
1221
     * communications. The Checkout Session will determine whether to display an option to opt into
1222
     * promotional communication from the merchant depending on the customer's locale. Only
1223
     * available to US merchants.
1224
     */
1225
    @SerializedName("promotions")
1226
    Promotions promotions;
1227

1228
    /**
1229
     * If set to {@code required}, it requires customers to check a terms of service checkbox before
1230
     * being able to pay. There must be a valid terms of service URL set in your <a
1231
     * href="https://dashboard.stripe.com/settings/public">Dashboard settings</a>.
1232
     */
1233
    @SerializedName("terms_of_service")
1234
    TermsOfService termsOfService;
1235

1236
    private ConsentCollection(
1237
        Map<String, Object> extraParams,
1238
        PaymentMethodReuseAgreement paymentMethodReuseAgreement,
1239
        Promotions promotions,
1240
        TermsOfService termsOfService) {
×
1241
      this.extraParams = extraParams;
×
1242
      this.paymentMethodReuseAgreement = paymentMethodReuseAgreement;
×
1243
      this.promotions = promotions;
×
1244
      this.termsOfService = termsOfService;
×
1245
    }
×
1246

1247
    public static Builder builder() {
1248
      return new Builder();
×
1249
    }
1250

1251
    public static class Builder {
×
1252
      private Map<String, Object> extraParams;
1253

1254
      private PaymentMethodReuseAgreement paymentMethodReuseAgreement;
1255

1256
      private Promotions promotions;
1257

1258
      private TermsOfService termsOfService;
1259

1260
      /** Finalize and obtain parameter instance from this builder. */
1261
      public PaymentLinkCreateParams.ConsentCollection build() {
1262
        return new PaymentLinkCreateParams.ConsentCollection(
×
1263
            this.extraParams,
1264
            this.paymentMethodReuseAgreement,
1265
            this.promotions,
1266
            this.termsOfService);
1267
      }
1268

1269
      /**
1270
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1271
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1272
       * PaymentLinkCreateParams.ConsentCollection#extraParams} for the field documentation.
1273
       */
1274
      public Builder putExtraParam(String key, Object value) {
1275
        if (this.extraParams == null) {
×
1276
          this.extraParams = new HashMap<>();
×
1277
        }
1278
        this.extraParams.put(key, value);
×
1279
        return this;
×
1280
      }
1281

1282
      /**
1283
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1284
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1285
       * See {@link PaymentLinkCreateParams.ConsentCollection#extraParams} for the field
1286
       * documentation.
1287
       */
1288
      public Builder putAllExtraParam(Map<String, Object> map) {
1289
        if (this.extraParams == null) {
×
1290
          this.extraParams = new HashMap<>();
×
1291
        }
1292
        this.extraParams.putAll(map);
×
1293
        return this;
×
1294
      }
1295

1296
      /**
1297
       * Determines the display of payment method reuse agreement text in the UI. If set to {@code
1298
       * hidden}, it will hide legal text related to the reuse of a payment method.
1299
       */
1300
      public Builder setPaymentMethodReuseAgreement(
1301
          PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement
1302
              paymentMethodReuseAgreement) {
1303
        this.paymentMethodReuseAgreement = paymentMethodReuseAgreement;
×
1304
        return this;
×
1305
      }
1306

1307
      /**
1308
       * If set to {@code auto}, enables the collection of customer consent for promotional
1309
       * communications. The Checkout Session will determine whether to display an option to opt
1310
       * into promotional communication from the merchant depending on the customer's locale. Only
1311
       * available to US merchants.
1312
       */
1313
      public Builder setPromotions(
1314
          PaymentLinkCreateParams.ConsentCollection.Promotions promotions) {
1315
        this.promotions = promotions;
×
1316
        return this;
×
1317
      }
1318

1319
      /**
1320
       * If set to {@code required}, it requires customers to check a terms of service checkbox
1321
       * before being able to pay. There must be a valid terms of service URL set in your <a
1322
       * href="https://dashboard.stripe.com/settings/public">Dashboard settings</a>.
1323
       */
1324
      public Builder setTermsOfService(
1325
          PaymentLinkCreateParams.ConsentCollection.TermsOfService termsOfService) {
1326
        this.termsOfService = termsOfService;
×
1327
        return this;
×
1328
      }
1329
    }
1330

1331
    @Getter
1332
    public static class PaymentMethodReuseAgreement {
1333
      /**
1334
       * Map of extra parameters for custom features not available in this client library. The
1335
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1336
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1337
       * name in this param object. Effectively, this map is flattened to its parent instance.
1338
       */
1339
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1340
      Map<String, Object> extraParams;
1341

1342
      /**
1343
       * <strong>Required.</strong> Determines the position and visibility of the payment method
1344
       * reuse agreement in the UI. When set to {@code auto}, Stripe's defaults will be used. When
1345
       * set to {@code hidden}, the payment method reuse agreement text will always be hidden in the
1346
       * UI.
1347
       */
1348
      @SerializedName("position")
1349
      Position position;
1350

1351
      private PaymentMethodReuseAgreement(Map<String, Object> extraParams, Position position) {
×
1352
        this.extraParams = extraParams;
×
1353
        this.position = position;
×
1354
      }
×
1355

1356
      public static Builder builder() {
1357
        return new Builder();
×
1358
      }
1359

1360
      public static class Builder {
×
1361
        private Map<String, Object> extraParams;
1362

1363
        private Position position;
1364

1365
        /** Finalize and obtain parameter instance from this builder. */
1366
        public PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement build() {
1367
          return new PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement(
×
1368
              this.extraParams, this.position);
1369
        }
1370

1371
        /**
1372
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1373
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1374
         * map. See {@link
1375
         * PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement#extraParams} for
1376
         * the field documentation.
1377
         */
1378
        public Builder putExtraParam(String key, Object value) {
1379
          if (this.extraParams == null) {
×
1380
            this.extraParams = new HashMap<>();
×
1381
          }
1382
          this.extraParams.put(key, value);
×
1383
          return this;
×
1384
        }
1385

1386
        /**
1387
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1388
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1389
         * map. See {@link
1390
         * PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement#extraParams} for
1391
         * the field documentation.
1392
         */
1393
        public Builder putAllExtraParam(Map<String, Object> map) {
1394
          if (this.extraParams == null) {
×
1395
            this.extraParams = new HashMap<>();
×
1396
          }
1397
          this.extraParams.putAll(map);
×
1398
          return this;
×
1399
        }
1400

1401
        /**
1402
         * <strong>Required.</strong> Determines the position and visibility of the payment method
1403
         * reuse agreement in the UI. When set to {@code auto}, Stripe's defaults will be used. When
1404
         * set to {@code hidden}, the payment method reuse agreement text will always be hidden in
1405
         * the UI.
1406
         */
1407
        public Builder setPosition(
1408
            PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement.Position
1409
                position) {
1410
          this.position = position;
×
1411
          return this;
×
1412
        }
1413
      }
1414

1415
      public enum Position implements ApiRequestParams.EnumParam {
×
1416
        @SerializedName("auto")
×
1417
        AUTO("auto"),
1418

1419
        @SerializedName("hidden")
×
1420
        HIDDEN("hidden");
1421

1422
        @Getter(onMethod_ = {@Override})
1423
        private final String value;
1424

1425
        Position(String value) {
×
1426
          this.value = value;
×
1427
        }
×
1428
      }
1429
    }
1430

1431
    public enum Promotions implements ApiRequestParams.EnumParam {
×
1432
      @SerializedName("auto")
×
1433
      AUTO("auto"),
1434

1435
      @SerializedName("none")
×
1436
      NONE("none");
1437

1438
      @Getter(onMethod_ = {@Override})
1439
      private final String value;
1440

1441
      Promotions(String value) {
×
1442
        this.value = value;
×
1443
      }
×
1444
    }
1445

1446
    public enum TermsOfService implements ApiRequestParams.EnumParam {
×
1447
      @SerializedName("none")
×
1448
      NONE("none"),
1449

1450
      @SerializedName("required")
×
1451
      REQUIRED("required");
1452

1453
      @Getter(onMethod_ = {@Override})
1454
      private final String value;
1455

1456
      TermsOfService(String value) {
×
1457
        this.value = value;
×
1458
      }
×
1459
    }
1460
  }
1461

1462
  @Getter
1463
  public static class CustomField {
1464
    /** Configuration for {@code type=dropdown} fields. */
1465
    @SerializedName("dropdown")
1466
    Dropdown dropdown;
1467

1468
    /**
1469
     * Map of extra parameters for custom features not available in this client library. The content
1470
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1471
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1472
     * param object. Effectively, this map is flattened to its parent instance.
1473
     */
1474
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1475
    Map<String, Object> extraParams;
1476

1477
    /**
1478
     * <strong>Required.</strong> String of your choice that your integration can use to reconcile
1479
     * this field. Must be unique to this field, alphanumeric, and up to 200 characters.
1480
     */
1481
    @SerializedName("key")
1482
    String key;
1483

1484
    /** <strong>Required.</strong> The label for the field, displayed to the customer. */
1485
    @SerializedName("label")
1486
    Label label;
1487

1488
    /** Configuration for {@code type=numeric} fields. */
1489
    @SerializedName("numeric")
1490
    Numeric numeric;
1491

1492
    /**
1493
     * Whether the customer is required to complete the field before completing the Checkout
1494
     * Session. Defaults to {@code false}.
1495
     */
1496
    @SerializedName("optional")
1497
    Boolean optional;
1498

1499
    /** Configuration for {@code type=text} fields. */
1500
    @SerializedName("text")
1501
    Text text;
1502

1503
    /** <strong>Required.</strong> The type of the field. */
1504
    @SerializedName("type")
1505
    Type type;
1506

1507
    private CustomField(
1508
        Dropdown dropdown,
1509
        Map<String, Object> extraParams,
1510
        String key,
1511
        Label label,
1512
        Numeric numeric,
1513
        Boolean optional,
1514
        Text text,
1515
        Type type) {
×
1516
      this.dropdown = dropdown;
×
1517
      this.extraParams = extraParams;
×
1518
      this.key = key;
×
1519
      this.label = label;
×
1520
      this.numeric = numeric;
×
1521
      this.optional = optional;
×
1522
      this.text = text;
×
1523
      this.type = type;
×
1524
    }
×
1525

1526
    public static Builder builder() {
1527
      return new Builder();
×
1528
    }
1529

1530
    public static class Builder {
×
1531
      private Dropdown dropdown;
1532

1533
      private Map<String, Object> extraParams;
1534

1535
      private String key;
1536

1537
      private Label label;
1538

1539
      private Numeric numeric;
1540

1541
      private Boolean optional;
1542

1543
      private Text text;
1544

1545
      private Type type;
1546

1547
      /** Finalize and obtain parameter instance from this builder. */
1548
      public PaymentLinkCreateParams.CustomField build() {
1549
        return new PaymentLinkCreateParams.CustomField(
×
1550
            this.dropdown,
1551
            this.extraParams,
1552
            this.key,
1553
            this.label,
1554
            this.numeric,
1555
            this.optional,
1556
            this.text,
1557
            this.type);
1558
      }
1559

1560
      /** Configuration for {@code type=dropdown} fields. */
1561
      public Builder setDropdown(PaymentLinkCreateParams.CustomField.Dropdown dropdown) {
1562
        this.dropdown = dropdown;
×
1563
        return this;
×
1564
      }
1565

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

1579
      /**
1580
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1581
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1582
       * See {@link PaymentLinkCreateParams.CustomField#extraParams} for the field documentation.
1583
       */
1584
      public Builder putAllExtraParam(Map<String, Object> map) {
1585
        if (this.extraParams == null) {
×
1586
          this.extraParams = new HashMap<>();
×
1587
        }
1588
        this.extraParams.putAll(map);
×
1589
        return this;
×
1590
      }
1591

1592
      /**
1593
       * <strong>Required.</strong> String of your choice that your integration can use to reconcile
1594
       * this field. Must be unique to this field, alphanumeric, and up to 200 characters.
1595
       */
1596
      public Builder setKey(String key) {
1597
        this.key = key;
×
1598
        return this;
×
1599
      }
1600

1601
      /** <strong>Required.</strong> The label for the field, displayed to the customer. */
1602
      public Builder setLabel(PaymentLinkCreateParams.CustomField.Label label) {
1603
        this.label = label;
×
1604
        return this;
×
1605
      }
1606

1607
      /** Configuration for {@code type=numeric} fields. */
1608
      public Builder setNumeric(PaymentLinkCreateParams.CustomField.Numeric numeric) {
1609
        this.numeric = numeric;
×
1610
        return this;
×
1611
      }
1612

1613
      /**
1614
       * Whether the customer is required to complete the field before completing the Checkout
1615
       * Session. Defaults to {@code false}.
1616
       */
1617
      public Builder setOptional(Boolean optional) {
1618
        this.optional = optional;
×
1619
        return this;
×
1620
      }
1621

1622
      /** Configuration for {@code type=text} fields. */
1623
      public Builder setText(PaymentLinkCreateParams.CustomField.Text text) {
1624
        this.text = text;
×
1625
        return this;
×
1626
      }
1627

1628
      /** <strong>Required.</strong> The type of the field. */
1629
      public Builder setType(PaymentLinkCreateParams.CustomField.Type type) {
1630
        this.type = type;
×
1631
        return this;
×
1632
      }
1633
    }
1634

1635
    @Getter
1636
    public static class Dropdown {
1637
      /**
1638
       * Map of extra parameters for custom features not available in this client library. The
1639
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1640
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1641
       * name in this param object. Effectively, this map is flattened to its parent instance.
1642
       */
1643
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1644
      Map<String, Object> extraParams;
1645

1646
      /**
1647
       * <strong>Required.</strong> The options available for the customer to select. Up to 200
1648
       * options allowed.
1649
       */
1650
      @SerializedName("options")
1651
      List<PaymentLinkCreateParams.CustomField.Dropdown.Option> options;
1652

1653
      private Dropdown(
1654
          Map<String, Object> extraParams,
1655
          List<PaymentLinkCreateParams.CustomField.Dropdown.Option> options) {
×
1656
        this.extraParams = extraParams;
×
1657
        this.options = options;
×
1658
      }
×
1659

1660
      public static Builder builder() {
1661
        return new Builder();
×
1662
      }
1663

1664
      public static class Builder {
×
1665
        private Map<String, Object> extraParams;
1666

1667
        private List<PaymentLinkCreateParams.CustomField.Dropdown.Option> options;
1668

1669
        /** Finalize and obtain parameter instance from this builder. */
1670
        public PaymentLinkCreateParams.CustomField.Dropdown build() {
1671
          return new PaymentLinkCreateParams.CustomField.Dropdown(this.extraParams, this.options);
×
1672
        }
1673

1674
        /**
1675
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1676
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1677
         * map. See {@link PaymentLinkCreateParams.CustomField.Dropdown#extraParams} for the field
1678
         * documentation.
1679
         */
1680
        public Builder putExtraParam(String key, Object value) {
1681
          if (this.extraParams == null) {
×
1682
            this.extraParams = new HashMap<>();
×
1683
          }
1684
          this.extraParams.put(key, value);
×
1685
          return this;
×
1686
        }
1687

1688
        /**
1689
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1690
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1691
         * map. See {@link PaymentLinkCreateParams.CustomField.Dropdown#extraParams} for the field
1692
         * documentation.
1693
         */
1694
        public Builder putAllExtraParam(Map<String, Object> map) {
1695
          if (this.extraParams == null) {
×
1696
            this.extraParams = new HashMap<>();
×
1697
          }
1698
          this.extraParams.putAll(map);
×
1699
          return this;
×
1700
        }
1701

1702
        /**
1703
         * Add an element to `options` list. A list is initialized for the first `add/addAll` call,
1704
         * and subsequent calls adds additional elements to the original list. See {@link
1705
         * PaymentLinkCreateParams.CustomField.Dropdown#options} for the field documentation.
1706
         */
1707
        public Builder addOption(PaymentLinkCreateParams.CustomField.Dropdown.Option element) {
1708
          if (this.options == null) {
×
1709
            this.options = new ArrayList<>();
×
1710
          }
1711
          this.options.add(element);
×
1712
          return this;
×
1713
        }
1714

1715
        /**
1716
         * Add all elements to `options` list. A list is initialized for the first `add/addAll`
1717
         * call, and subsequent calls adds additional elements to the original list. See {@link
1718
         * PaymentLinkCreateParams.CustomField.Dropdown#options} for the field documentation.
1719
         */
1720
        public Builder addAllOption(
1721
            List<PaymentLinkCreateParams.CustomField.Dropdown.Option> elements) {
1722
          if (this.options == null) {
×
1723
            this.options = new ArrayList<>();
×
1724
          }
1725
          this.options.addAll(elements);
×
1726
          return this;
×
1727
        }
1728
      }
1729

1730
      @Getter
1731
      public static class Option {
1732
        /**
1733
         * Map of extra parameters for custom features not available in this client library. The
1734
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1735
         * Instead, each key/value pair is serialized as if the key is a root-level field
1736
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1737
         * instance.
1738
         */
1739
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1740
        Map<String, Object> extraParams;
1741

1742
        /**
1743
         * <strong>Required.</strong> The label for the option, displayed to the customer. Up to 100
1744
         * characters.
1745
         */
1746
        @SerializedName("label")
1747
        String label;
1748

1749
        /**
1750
         * <strong>Required.</strong> The value for this option, not displayed to the customer, used
1751
         * by your integration to reconcile the option selected by the customer. Must be unique to
1752
         * this option, alphanumeric, and up to 100 characters.
1753
         */
1754
        @SerializedName("value")
1755
        String value;
1756

1757
        private Option(Map<String, Object> extraParams, String label, String value) {
×
1758
          this.extraParams = extraParams;
×
1759
          this.label = label;
×
1760
          this.value = value;
×
1761
        }
×
1762

1763
        public static Builder builder() {
1764
          return new Builder();
×
1765
        }
1766

1767
        public static class Builder {
×
1768
          private Map<String, Object> extraParams;
1769

1770
          private String label;
1771

1772
          private String value;
1773

1774
          /** Finalize and obtain parameter instance from this builder. */
1775
          public PaymentLinkCreateParams.CustomField.Dropdown.Option build() {
1776
            return new PaymentLinkCreateParams.CustomField.Dropdown.Option(
×
1777
                this.extraParams, this.label, this.value);
1778
          }
1779

1780
          /**
1781
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1782
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1783
           * map. See {@link PaymentLinkCreateParams.CustomField.Dropdown.Option#extraParams} for
1784
           * the field documentation.
1785
           */
1786
          public Builder putExtraParam(String key, Object value) {
1787
            if (this.extraParams == null) {
×
1788
              this.extraParams = new HashMap<>();
×
1789
            }
1790
            this.extraParams.put(key, value);
×
1791
            return this;
×
1792
          }
1793

1794
          /**
1795
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1796
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1797
           * map. See {@link PaymentLinkCreateParams.CustomField.Dropdown.Option#extraParams} for
1798
           * the field documentation.
1799
           */
1800
          public Builder putAllExtraParam(Map<String, Object> map) {
1801
            if (this.extraParams == null) {
×
1802
              this.extraParams = new HashMap<>();
×
1803
            }
1804
            this.extraParams.putAll(map);
×
1805
            return this;
×
1806
          }
1807

1808
          /**
1809
           * <strong>Required.</strong> The label for the option, displayed to the customer. Up to
1810
           * 100 characters.
1811
           */
1812
          public Builder setLabel(String label) {
1813
            this.label = label;
×
1814
            return this;
×
1815
          }
1816

1817
          /**
1818
           * <strong>Required.</strong> The value for this option, not displayed to the customer,
1819
           * used by your integration to reconcile the option selected by the customer. Must be
1820
           * unique to this option, alphanumeric, and up to 100 characters.
1821
           */
1822
          public Builder setValue(String value) {
1823
            this.value = value;
×
1824
            return this;
×
1825
          }
1826
        }
1827
      }
1828
    }
1829

1830
    @Getter
1831
    public static class Label {
1832
      /**
1833
       * <strong>Required.</strong> Custom text for the label, displayed to the customer. Up to 50
1834
       * characters.
1835
       */
1836
      @SerializedName("custom")
1837
      String custom;
1838

1839
      /**
1840
       * Map of extra parameters for custom features not available in this client library. The
1841
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1842
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1843
       * name in this param object. Effectively, this map is flattened to its parent instance.
1844
       */
1845
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1846
      Map<String, Object> extraParams;
1847

1848
      /** <strong>Required.</strong> The type of the label. */
1849
      @SerializedName("type")
1850
      Type type;
1851

1852
      private Label(String custom, Map<String, Object> extraParams, Type type) {
×
1853
        this.custom = custom;
×
1854
        this.extraParams = extraParams;
×
1855
        this.type = type;
×
1856
      }
×
1857

1858
      public static Builder builder() {
1859
        return new Builder();
×
1860
      }
1861

1862
      public static class Builder {
×
1863
        private String custom;
1864

1865
        private Map<String, Object> extraParams;
1866

1867
        private Type type;
1868

1869
        /** Finalize and obtain parameter instance from this builder. */
1870
        public PaymentLinkCreateParams.CustomField.Label build() {
1871
          return new PaymentLinkCreateParams.CustomField.Label(
×
1872
              this.custom, this.extraParams, this.type);
1873
        }
1874

1875
        /**
1876
         * <strong>Required.</strong> Custom text for the label, displayed to the customer. Up to 50
1877
         * characters.
1878
         */
1879
        public Builder setCustom(String custom) {
1880
          this.custom = custom;
×
1881
          return this;
×
1882
        }
1883

1884
        /**
1885
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1886
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1887
         * map. See {@link PaymentLinkCreateParams.CustomField.Label#extraParams} for the field
1888
         * documentation.
1889
         */
1890
        public Builder putExtraParam(String key, Object value) {
1891
          if (this.extraParams == null) {
×
1892
            this.extraParams = new HashMap<>();
×
1893
          }
1894
          this.extraParams.put(key, value);
×
1895
          return this;
×
1896
        }
1897

1898
        /**
1899
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1900
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1901
         * map. See {@link PaymentLinkCreateParams.CustomField.Label#extraParams} for the field
1902
         * documentation.
1903
         */
1904
        public Builder putAllExtraParam(Map<String, Object> map) {
1905
          if (this.extraParams == null) {
×
1906
            this.extraParams = new HashMap<>();
×
1907
          }
1908
          this.extraParams.putAll(map);
×
1909
          return this;
×
1910
        }
1911

1912
        /** <strong>Required.</strong> The type of the label. */
1913
        public Builder setType(PaymentLinkCreateParams.CustomField.Label.Type type) {
1914
          this.type = type;
×
1915
          return this;
×
1916
        }
1917
      }
1918

1919
      public enum Type implements ApiRequestParams.EnumParam {
×
1920
        @SerializedName("custom")
×
1921
        CUSTOM("custom");
1922

1923
        @Getter(onMethod_ = {@Override})
1924
        private final String value;
1925

1926
        Type(String value) {
×
1927
          this.value = value;
×
1928
        }
×
1929
      }
1930
    }
1931

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

1943
      /** The maximum character length constraint for the customer's input. */
1944
      @SerializedName("maximum_length")
1945
      Long maximumLength;
1946

1947
      /** The minimum character length requirement for the customer's input. */
1948
      @SerializedName("minimum_length")
1949
      Long minimumLength;
1950

1951
      private Numeric(Map<String, Object> extraParams, Long maximumLength, Long minimumLength) {
×
1952
        this.extraParams = extraParams;
×
1953
        this.maximumLength = maximumLength;
×
1954
        this.minimumLength = minimumLength;
×
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 Long maximumLength;
1965

1966
        private Long minimumLength;
1967

1968
        /** Finalize and obtain parameter instance from this builder. */
1969
        public PaymentLinkCreateParams.CustomField.Numeric build() {
1970
          return new PaymentLinkCreateParams.CustomField.Numeric(
×
1971
              this.extraParams, this.maximumLength, this.minimumLength);
1972
        }
1973

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

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

2002
        /** The maximum character length constraint for the customer's input. */
2003
        public Builder setMaximumLength(Long maximumLength) {
2004
          this.maximumLength = maximumLength;
×
2005
          return this;
×
2006
        }
2007

2008
        /** The minimum character length requirement for the customer's input. */
2009
        public Builder setMinimumLength(Long minimumLength) {
2010
          this.minimumLength = minimumLength;
×
2011
          return this;
×
2012
        }
2013
      }
2014
    }
2015

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

2027
      /** The maximum character length constraint for the customer's input. */
2028
      @SerializedName("maximum_length")
2029
      Long maximumLength;
2030

2031
      /** The minimum character length requirement for the customer's input. */
2032
      @SerializedName("minimum_length")
2033
      Long minimumLength;
2034

2035
      private Text(Map<String, Object> extraParams, Long maximumLength, Long minimumLength) {
×
2036
        this.extraParams = extraParams;
×
2037
        this.maximumLength = maximumLength;
×
2038
        this.minimumLength = minimumLength;
×
2039
      }
×
2040

2041
      public static Builder builder() {
2042
        return new Builder();
×
2043
      }
2044

2045
      public static class Builder {
×
2046
        private Map<String, Object> extraParams;
2047

2048
        private Long maximumLength;
2049

2050
        private Long minimumLength;
2051

2052
        /** Finalize and obtain parameter instance from this builder. */
2053
        public PaymentLinkCreateParams.CustomField.Text build() {
2054
          return new PaymentLinkCreateParams.CustomField.Text(
×
2055
              this.extraParams, this.maximumLength, this.minimumLength);
2056
        }
2057

2058
        /**
2059
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2060
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2061
         * map. See {@link PaymentLinkCreateParams.CustomField.Text#extraParams} for the field
2062
         * documentation.
2063
         */
2064
        public Builder putExtraParam(String key, Object value) {
2065
          if (this.extraParams == null) {
×
2066
            this.extraParams = new HashMap<>();
×
2067
          }
2068
          this.extraParams.put(key, value);
×
2069
          return this;
×
2070
        }
2071

2072
        /**
2073
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2074
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2075
         * map. See {@link PaymentLinkCreateParams.CustomField.Text#extraParams} for the field
2076
         * documentation.
2077
         */
2078
        public Builder putAllExtraParam(Map<String, Object> map) {
2079
          if (this.extraParams == null) {
×
2080
            this.extraParams = new HashMap<>();
×
2081
          }
2082
          this.extraParams.putAll(map);
×
2083
          return this;
×
2084
        }
2085

2086
        /** The maximum character length constraint for the customer's input. */
2087
        public Builder setMaximumLength(Long maximumLength) {
2088
          this.maximumLength = maximumLength;
×
2089
          return this;
×
2090
        }
2091

2092
        /** The minimum character length requirement for the customer's input. */
2093
        public Builder setMinimumLength(Long minimumLength) {
2094
          this.minimumLength = minimumLength;
×
2095
          return this;
×
2096
        }
2097
      }
2098
    }
2099

2100
    public enum Type implements ApiRequestParams.EnumParam {
×
2101
      @SerializedName("dropdown")
×
2102
      DROPDOWN("dropdown"),
2103

2104
      @SerializedName("numeric")
×
2105
      NUMERIC("numeric"),
2106

2107
      @SerializedName("text")
×
2108
      TEXT("text");
2109

2110
      @Getter(onMethod_ = {@Override})
2111
      private final String value;
2112

2113
      Type(String value) {
×
2114
        this.value = value;
×
2115
      }
×
2116
    }
2117
  }
2118

2119
  @Getter
2120
  public static class CustomText {
2121
    /** Custom text that should be displayed after the payment confirmation button. */
2122
    @SerializedName("after_submit")
2123
    Object afterSubmit;
2124

2125
    /**
2126
     * Map of extra parameters for custom features not available in this client library. The content
2127
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
2128
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
2129
     * param object. Effectively, this map is flattened to its parent instance.
2130
     */
2131
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2132
    Map<String, Object> extraParams;
2133

2134
    /** Custom text that should be displayed alongside shipping address collection. */
2135
    @SerializedName("shipping_address")
2136
    Object shippingAddress;
2137

2138
    /** Custom text that should be displayed alongside the payment confirmation button. */
2139
    @SerializedName("submit")
2140
    Object submit;
2141

2142
    /**
2143
     * Custom text that should be displayed in place of the default terms of service agreement text.
2144
     */
2145
    @SerializedName("terms_of_service_acceptance")
2146
    Object termsOfServiceAcceptance;
2147

2148
    private CustomText(
2149
        Object afterSubmit,
2150
        Map<String, Object> extraParams,
2151
        Object shippingAddress,
2152
        Object submit,
2153
        Object termsOfServiceAcceptance) {
×
2154
      this.afterSubmit = afterSubmit;
×
2155
      this.extraParams = extraParams;
×
2156
      this.shippingAddress = shippingAddress;
×
2157
      this.submit = submit;
×
2158
      this.termsOfServiceAcceptance = termsOfServiceAcceptance;
×
2159
    }
×
2160

2161
    public static Builder builder() {
2162
      return new Builder();
×
2163
    }
2164

2165
    public static class Builder {
×
2166
      private Object afterSubmit;
2167

2168
      private Map<String, Object> extraParams;
2169

2170
      private Object shippingAddress;
2171

2172
      private Object submit;
2173

2174
      private Object termsOfServiceAcceptance;
2175

2176
      /** Finalize and obtain parameter instance from this builder. */
2177
      public PaymentLinkCreateParams.CustomText build() {
2178
        return new PaymentLinkCreateParams.CustomText(
×
2179
            this.afterSubmit,
2180
            this.extraParams,
2181
            this.shippingAddress,
2182
            this.submit,
2183
            this.termsOfServiceAcceptance);
2184
      }
2185

2186
      /** Custom text that should be displayed after the payment confirmation button. */
2187
      public Builder setAfterSubmit(PaymentLinkCreateParams.CustomText.AfterSubmit afterSubmit) {
2188
        this.afterSubmit = afterSubmit;
×
2189
        return this;
×
2190
      }
2191

2192
      /** Custom text that should be displayed after the payment confirmation button. */
2193
      public Builder setAfterSubmit(EmptyParam afterSubmit) {
2194
        this.afterSubmit = afterSubmit;
×
2195
        return this;
×
2196
      }
2197

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

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

2224
      /** Custom text that should be displayed alongside shipping address collection. */
2225
      public Builder setShippingAddress(
2226
          PaymentLinkCreateParams.CustomText.ShippingAddress shippingAddress) {
2227
        this.shippingAddress = shippingAddress;
×
2228
        return this;
×
2229
      }
2230

2231
      /** Custom text that should be displayed alongside shipping address collection. */
2232
      public Builder setShippingAddress(EmptyParam shippingAddress) {
2233
        this.shippingAddress = shippingAddress;
×
2234
        return this;
×
2235
      }
2236

2237
      /** Custom text that should be displayed alongside the payment confirmation button. */
2238
      public Builder setSubmit(PaymentLinkCreateParams.CustomText.Submit submit) {
2239
        this.submit = submit;
×
2240
        return this;
×
2241
      }
2242

2243
      /** Custom text that should be displayed alongside the payment confirmation button. */
2244
      public Builder setSubmit(EmptyParam submit) {
2245
        this.submit = submit;
×
2246
        return this;
×
2247
      }
2248

2249
      /**
2250
       * Custom text that should be displayed in place of the default terms of service agreement
2251
       * text.
2252
       */
2253
      public Builder setTermsOfServiceAcceptance(
2254
          PaymentLinkCreateParams.CustomText.TermsOfServiceAcceptance termsOfServiceAcceptance) {
2255
        this.termsOfServiceAcceptance = termsOfServiceAcceptance;
×
2256
        return this;
×
2257
      }
2258

2259
      /**
2260
       * Custom text that should be displayed in place of the default terms of service agreement
2261
       * text.
2262
       */
2263
      public Builder setTermsOfServiceAcceptance(EmptyParam termsOfServiceAcceptance) {
2264
        this.termsOfServiceAcceptance = termsOfServiceAcceptance;
×
2265
        return this;
×
2266
      }
2267
    }
2268

2269
    @Getter
2270
    public static class AfterSubmit {
2271
      /**
2272
       * Map of extra parameters for custom features not available in this client library. The
2273
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2274
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2275
       * name in this param object. Effectively, this map is flattened to its parent instance.
2276
       */
2277
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2278
      Map<String, Object> extraParams;
2279

2280
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2281
      @SerializedName("message")
2282
      String message;
2283

2284
      private AfterSubmit(Map<String, Object> extraParams, String message) {
×
2285
        this.extraParams = extraParams;
×
2286
        this.message = message;
×
2287
      }
×
2288

2289
      public static Builder builder() {
2290
        return new Builder();
×
2291
      }
2292

2293
      public static class Builder {
×
2294
        private Map<String, Object> extraParams;
2295

2296
        private String message;
2297

2298
        /** Finalize and obtain parameter instance from this builder. */
2299
        public PaymentLinkCreateParams.CustomText.AfterSubmit build() {
2300
          return new PaymentLinkCreateParams.CustomText.AfterSubmit(this.extraParams, this.message);
×
2301
        }
2302

2303
        /**
2304
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2305
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2306
         * map. See {@link PaymentLinkCreateParams.CustomText.AfterSubmit#extraParams} for the field
2307
         * documentation.
2308
         */
2309
        public Builder putExtraParam(String key, Object value) {
2310
          if (this.extraParams == null) {
×
2311
            this.extraParams = new HashMap<>();
×
2312
          }
2313
          this.extraParams.put(key, value);
×
2314
          return this;
×
2315
        }
2316

2317
        /**
2318
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2319
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2320
         * map. See {@link PaymentLinkCreateParams.CustomText.AfterSubmit#extraParams} for the field
2321
         * documentation.
2322
         */
2323
        public Builder putAllExtraParam(Map<String, Object> map) {
2324
          if (this.extraParams == null) {
×
2325
            this.extraParams = new HashMap<>();
×
2326
          }
2327
          this.extraParams.putAll(map);
×
2328
          return this;
×
2329
        }
2330

2331
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2332
        public Builder setMessage(String message) {
2333
          this.message = message;
×
2334
          return this;
×
2335
        }
2336
      }
2337
    }
2338

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

2350
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2351
      @SerializedName("message")
2352
      String message;
2353

2354
      private ShippingAddress(Map<String, Object> extraParams, String message) {
×
2355
        this.extraParams = extraParams;
×
2356
        this.message = message;
×
2357
      }
×
2358

2359
      public static Builder builder() {
2360
        return new Builder();
×
2361
      }
2362

2363
      public static class Builder {
×
2364
        private Map<String, Object> extraParams;
2365

2366
        private String message;
2367

2368
        /** Finalize and obtain parameter instance from this builder. */
2369
        public PaymentLinkCreateParams.CustomText.ShippingAddress build() {
2370
          return new PaymentLinkCreateParams.CustomText.ShippingAddress(
×
2371
              this.extraParams, this.message);
2372
        }
2373

2374
        /**
2375
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2376
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2377
         * map. See {@link PaymentLinkCreateParams.CustomText.ShippingAddress#extraParams} for the
2378
         * field documentation.
2379
         */
2380
        public Builder putExtraParam(String key, Object value) {
2381
          if (this.extraParams == null) {
×
2382
            this.extraParams = new HashMap<>();
×
2383
          }
2384
          this.extraParams.put(key, value);
×
2385
          return this;
×
2386
        }
2387

2388
        /**
2389
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2390
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2391
         * map. See {@link PaymentLinkCreateParams.CustomText.ShippingAddress#extraParams} for the
2392
         * field documentation.
2393
         */
2394
        public Builder putAllExtraParam(Map<String, Object> map) {
2395
          if (this.extraParams == null) {
×
2396
            this.extraParams = new HashMap<>();
×
2397
          }
2398
          this.extraParams.putAll(map);
×
2399
          return this;
×
2400
        }
2401

2402
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2403
        public Builder setMessage(String message) {
2404
          this.message = message;
×
2405
          return this;
×
2406
        }
2407
      }
2408
    }
2409

2410
    @Getter
2411
    public static class Submit {
2412
      /**
2413
       * Map of extra parameters for custom features not available in this client library. The
2414
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2415
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2416
       * name in this param object. Effectively, this map is flattened to its parent instance.
2417
       */
2418
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2419
      Map<String, Object> extraParams;
2420

2421
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2422
      @SerializedName("message")
2423
      String message;
2424

2425
      private Submit(Map<String, Object> extraParams, String message) {
×
2426
        this.extraParams = extraParams;
×
2427
        this.message = message;
×
2428
      }
×
2429

2430
      public static Builder builder() {
2431
        return new Builder();
×
2432
      }
2433

2434
      public static class Builder {
×
2435
        private Map<String, Object> extraParams;
2436

2437
        private String message;
2438

2439
        /** Finalize and obtain parameter instance from this builder. */
2440
        public PaymentLinkCreateParams.CustomText.Submit build() {
2441
          return new PaymentLinkCreateParams.CustomText.Submit(this.extraParams, this.message);
×
2442
        }
2443

2444
        /**
2445
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2446
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2447
         * map. See {@link PaymentLinkCreateParams.CustomText.Submit#extraParams} for the field
2448
         * documentation.
2449
         */
2450
        public Builder putExtraParam(String key, Object value) {
2451
          if (this.extraParams == null) {
×
2452
            this.extraParams = new HashMap<>();
×
2453
          }
2454
          this.extraParams.put(key, value);
×
2455
          return this;
×
2456
        }
2457

2458
        /**
2459
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2460
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2461
         * map. See {@link PaymentLinkCreateParams.CustomText.Submit#extraParams} for the field
2462
         * documentation.
2463
         */
2464
        public Builder putAllExtraParam(Map<String, Object> map) {
2465
          if (this.extraParams == null) {
×
2466
            this.extraParams = new HashMap<>();
×
2467
          }
2468
          this.extraParams.putAll(map);
×
2469
          return this;
×
2470
        }
2471

2472
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2473
        public Builder setMessage(String message) {
2474
          this.message = message;
×
2475
          return this;
×
2476
        }
2477
      }
2478
    }
2479

2480
    @Getter
2481
    public static class TermsOfServiceAcceptance {
2482
      /**
2483
       * Map of extra parameters for custom features not available in this client library. The
2484
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2485
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2486
       * name in this param object. Effectively, this map is flattened to its parent instance.
2487
       */
2488
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2489
      Map<String, Object> extraParams;
2490

2491
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2492
      @SerializedName("message")
2493
      String message;
2494

2495
      private TermsOfServiceAcceptance(Map<String, Object> extraParams, String message) {
×
2496
        this.extraParams = extraParams;
×
2497
        this.message = message;
×
2498
      }
×
2499

2500
      public static Builder builder() {
2501
        return new Builder();
×
2502
      }
2503

2504
      public static class Builder {
×
2505
        private Map<String, Object> extraParams;
2506

2507
        private String message;
2508

2509
        /** Finalize and obtain parameter instance from this builder. */
2510
        public PaymentLinkCreateParams.CustomText.TermsOfServiceAcceptance build() {
2511
          return new PaymentLinkCreateParams.CustomText.TermsOfServiceAcceptance(
×
2512
              this.extraParams, this.message);
2513
        }
2514

2515
        /**
2516
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2517
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2518
         * map. See {@link PaymentLinkCreateParams.CustomText.TermsOfServiceAcceptance#extraParams}
2519
         * for the field documentation.
2520
         */
2521
        public Builder putExtraParam(String key, Object value) {
2522
          if (this.extraParams == null) {
×
2523
            this.extraParams = new HashMap<>();
×
2524
          }
2525
          this.extraParams.put(key, value);
×
2526
          return this;
×
2527
        }
2528

2529
        /**
2530
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2531
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2532
         * map. See {@link PaymentLinkCreateParams.CustomText.TermsOfServiceAcceptance#extraParams}
2533
         * for the field documentation.
2534
         */
2535
        public Builder putAllExtraParam(Map<String, Object> map) {
2536
          if (this.extraParams == null) {
×
2537
            this.extraParams = new HashMap<>();
×
2538
          }
2539
          this.extraParams.putAll(map);
×
2540
          return this;
×
2541
        }
2542

2543
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2544
        public Builder setMessage(String message) {
2545
          this.message = message;
×
2546
          return this;
×
2547
        }
2548
      }
2549
    }
2550
  }
2551

2552
  @Getter
2553
  public static class InvoiceCreation {
2554
    /** <strong>Required.</strong> Whether the feature is enabled */
2555
    @SerializedName("enabled")
2556
    Boolean enabled;
2557

2558
    /**
2559
     * Map of extra parameters for custom features not available in this client library. The content
2560
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
2561
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
2562
     * param object. Effectively, this map is flattened to its parent instance.
2563
     */
2564
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2565
    Map<String, Object> extraParams;
2566

2567
    /** Invoice PDF configuration. */
2568
    @SerializedName("invoice_data")
2569
    InvoiceData invoiceData;
2570

2571
    private InvoiceCreation(
2572
        Boolean enabled, Map<String, Object> extraParams, InvoiceData invoiceData) {
×
2573
      this.enabled = enabled;
×
2574
      this.extraParams = extraParams;
×
2575
      this.invoiceData = invoiceData;
×
2576
    }
×
2577

2578
    public static Builder builder() {
2579
      return new Builder();
×
2580
    }
2581

2582
    public static class Builder {
×
2583
      private Boolean enabled;
2584

2585
      private Map<String, Object> extraParams;
2586

2587
      private InvoiceData invoiceData;
2588

2589
      /** Finalize and obtain parameter instance from this builder. */
2590
      public PaymentLinkCreateParams.InvoiceCreation build() {
2591
        return new PaymentLinkCreateParams.InvoiceCreation(
×
2592
            this.enabled, this.extraParams, this.invoiceData);
2593
      }
2594

2595
      /** <strong>Required.</strong> Whether the feature is enabled */
2596
      public Builder setEnabled(Boolean enabled) {
2597
        this.enabled = enabled;
×
2598
        return this;
×
2599
      }
2600

2601
      /**
2602
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
2603
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
2604
       * PaymentLinkCreateParams.InvoiceCreation#extraParams} for the field documentation.
2605
       */
2606
      public Builder putExtraParam(String key, Object value) {
2607
        if (this.extraParams == null) {
×
2608
          this.extraParams = new HashMap<>();
×
2609
        }
2610
        this.extraParams.put(key, value);
×
2611
        return this;
×
2612
      }
2613

2614
      /**
2615
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2616
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
2617
       * See {@link PaymentLinkCreateParams.InvoiceCreation#extraParams} for the field
2618
       * documentation.
2619
       */
2620
      public Builder putAllExtraParam(Map<String, Object> map) {
2621
        if (this.extraParams == null) {
×
2622
          this.extraParams = new HashMap<>();
×
2623
        }
2624
        this.extraParams.putAll(map);
×
2625
        return this;
×
2626
      }
2627

2628
      /** Invoice PDF configuration. */
2629
      public Builder setInvoiceData(
2630
          PaymentLinkCreateParams.InvoiceCreation.InvoiceData invoiceData) {
2631
        this.invoiceData = invoiceData;
×
2632
        return this;
×
2633
      }
2634
    }
2635

2636
    @Getter
2637
    public static class InvoiceData {
2638
      /** The account tax IDs associated with the invoice. */
2639
      @SerializedName("account_tax_ids")
2640
      Object accountTaxIds;
2641

2642
      /** Default custom fields to be displayed on invoices for this customer. */
2643
      @SerializedName("custom_fields")
2644
      Object customFields;
2645

2646
      /** An arbitrary string attached to the object. Often useful for displaying to users. */
2647
      @SerializedName("description")
2648
      String description;
2649

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

2659
      /** Default footer to be displayed on invoices for this customer. */
2660
      @SerializedName("footer")
2661
      String footer;
2662

2663
      /**
2664
       * The connected account that issues the invoice. The invoice is presented with the branding
2665
       * and support information of the specified account.
2666
       */
2667
      @SerializedName("issuer")
2668
      Issuer issuer;
2669

2670
      /**
2671
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
2672
       * attach to an object. This can be useful for storing additional information about the object
2673
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
2674
       * keys can be unset by posting an empty value to {@code metadata}.
2675
       */
2676
      @SerializedName("metadata")
2677
      Object metadata;
2678

2679
      /** Default options for invoice PDF rendering for this customer. */
2680
      @SerializedName("rendering_options")
2681
      Object renderingOptions;
2682

2683
      private InvoiceData(
2684
          Object accountTaxIds,
2685
          Object customFields,
2686
          String description,
2687
          Map<String, Object> extraParams,
2688
          String footer,
2689
          Issuer issuer,
2690
          Object metadata,
2691
          Object renderingOptions) {
×
2692
        this.accountTaxIds = accountTaxIds;
×
2693
        this.customFields = customFields;
×
2694
        this.description = description;
×
2695
        this.extraParams = extraParams;
×
2696
        this.footer = footer;
×
2697
        this.issuer = issuer;
×
2698
        this.metadata = metadata;
×
2699
        this.renderingOptions = renderingOptions;
×
2700
      }
×
2701

2702
      public static Builder builder() {
2703
        return new Builder();
×
2704
      }
2705

2706
      public static class Builder {
×
2707
        private Object accountTaxIds;
2708

2709
        private Object customFields;
2710

2711
        private String description;
2712

2713
        private Map<String, Object> extraParams;
2714

2715
        private String footer;
2716

2717
        private Issuer issuer;
2718

2719
        private Object metadata;
2720

2721
        private Object renderingOptions;
2722

2723
        /** Finalize and obtain parameter instance from this builder. */
2724
        public PaymentLinkCreateParams.InvoiceCreation.InvoiceData build() {
2725
          return new PaymentLinkCreateParams.InvoiceCreation.InvoiceData(
×
2726
              this.accountTaxIds,
2727
              this.customFields,
2728
              this.description,
2729
              this.extraParams,
2730
              this.footer,
2731
              this.issuer,
2732
              this.metadata,
2733
              this.renderingOptions);
2734
        }
2735

2736
        /**
2737
         * Add an element to `accountTaxIds` list. A list is initialized for the first `add/addAll`
2738
         * call, and subsequent calls adds additional elements to the original list. See {@link
2739
         * PaymentLinkCreateParams.InvoiceCreation.InvoiceData#accountTaxIds} for the field
2740
         * documentation.
2741
         */
2742
        @SuppressWarnings("unchecked")
2743
        public Builder addAccountTaxId(String element) {
2744
          if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
2745
            this.accountTaxIds = new ArrayList<String>();
×
2746
          }
2747
          ((List<String>) this.accountTaxIds).add(element);
×
2748
          return this;
×
2749
        }
2750

2751
        /**
2752
         * Add all elements to `accountTaxIds` list. A list is initialized for the first
2753
         * `add/addAll` call, and subsequent calls adds additional elements to the original list.
2754
         * See {@link PaymentLinkCreateParams.InvoiceCreation.InvoiceData#accountTaxIds} for the
2755
         * field documentation.
2756
         */
2757
        @SuppressWarnings("unchecked")
2758
        public Builder addAllAccountTaxId(List<String> elements) {
2759
          if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
2760
            this.accountTaxIds = new ArrayList<String>();
×
2761
          }
2762
          ((List<String>) this.accountTaxIds).addAll(elements);
×
2763
          return this;
×
2764
        }
2765

2766
        /** The account tax IDs associated with the invoice. */
2767
        public Builder setAccountTaxIds(EmptyParam accountTaxIds) {
2768
          this.accountTaxIds = accountTaxIds;
×
2769
          return this;
×
2770
        }
2771

2772
        /** The account tax IDs associated with the invoice. */
2773
        public Builder setAccountTaxIds(List<String> accountTaxIds) {
2774
          this.accountTaxIds = accountTaxIds;
×
2775
          return this;
×
2776
        }
2777

2778
        /**
2779
         * Add an element to `customFields` list. A list is initialized for the first `add/addAll`
2780
         * call, and subsequent calls adds additional elements to the original list. See {@link
2781
         * PaymentLinkCreateParams.InvoiceCreation.InvoiceData#customFields} for the field
2782
         * documentation.
2783
         */
2784
        @SuppressWarnings("unchecked")
2785
        public Builder addCustomField(
2786
            PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField element) {
2787
          if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
2788
            this.customFields =
×
2789
                new ArrayList<PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField>();
2790
          }
2791
          ((List<PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField>)
×
2792
                  this.customFields)
2793
              .add(element);
×
2794
          return this;
×
2795
        }
2796

2797
        /**
2798
         * Add all elements to `customFields` list. A list is initialized for the first `add/addAll`
2799
         * call, and subsequent calls adds additional elements to the original list. See {@link
2800
         * PaymentLinkCreateParams.InvoiceCreation.InvoiceData#customFields} for the field
2801
         * documentation.
2802
         */
2803
        @SuppressWarnings("unchecked")
2804
        public Builder addAllCustomField(
2805
            List<PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField> elements) {
2806
          if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
2807
            this.customFields =
×
2808
                new ArrayList<PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField>();
2809
          }
2810
          ((List<PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField>)
×
2811
                  this.customFields)
2812
              .addAll(elements);
×
2813
          return this;
×
2814
        }
2815

2816
        /** Default custom fields to be displayed on invoices for this customer. */
2817
        public Builder setCustomFields(EmptyParam customFields) {
2818
          this.customFields = customFields;
×
2819
          return this;
×
2820
        }
2821

2822
        /** Default custom fields to be displayed on invoices for this customer. */
2823
        public Builder setCustomFields(
2824
            List<PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField> customFields) {
2825
          this.customFields = customFields;
×
2826
          return this;
×
2827
        }
2828

2829
        /** An arbitrary string attached to the object. Often useful for displaying to users. */
2830
        public Builder setDescription(String description) {
2831
          this.description = description;
×
2832
          return this;
×
2833
        }
2834

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

2849
        /**
2850
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2851
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2852
         * map. See {@link PaymentLinkCreateParams.InvoiceCreation.InvoiceData#extraParams} for the
2853
         * field documentation.
2854
         */
2855
        public Builder putAllExtraParam(Map<String, Object> map) {
2856
          if (this.extraParams == null) {
×
2857
            this.extraParams = new HashMap<>();
×
2858
          }
2859
          this.extraParams.putAll(map);
×
2860
          return this;
×
2861
        }
2862

2863
        /** Default footer to be displayed on invoices for this customer. */
2864
        public Builder setFooter(String footer) {
2865
          this.footer = footer;
×
2866
          return this;
×
2867
        }
2868

2869
        /**
2870
         * The connected account that issues the invoice. The invoice is presented with the branding
2871
         * and support information of the specified account.
2872
         */
2873
        public Builder setIssuer(
2874
            PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer issuer) {
2875
          this.issuer = issuer;
×
2876
          return this;
×
2877
        }
2878

2879
        /**
2880
         * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
2881
         * call, and subsequent calls add additional key/value pairs to the original map. See {@link
2882
         * PaymentLinkCreateParams.InvoiceCreation.InvoiceData#metadata} for the field
2883
         * documentation.
2884
         */
2885
        @SuppressWarnings("unchecked")
2886
        public Builder putMetadata(String key, String value) {
2887
          if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
2888
            this.metadata = new HashMap<String, String>();
×
2889
          }
2890
          ((Map<String, String>) this.metadata).put(key, value);
×
2891
          return this;
×
2892
        }
2893

2894
        /**
2895
         * Add all map key/value pairs to `metadata` map. A map is initialized for the first
2896
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2897
         * map. See {@link PaymentLinkCreateParams.InvoiceCreation.InvoiceData#metadata} for the
2898
         * field documentation.
2899
         */
2900
        @SuppressWarnings("unchecked")
2901
        public Builder putAllMetadata(Map<String, String> map) {
2902
          if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
2903
            this.metadata = new HashMap<String, String>();
×
2904
          }
2905
          ((Map<String, String>) this.metadata).putAll(map);
×
2906
          return this;
×
2907
        }
2908

2909
        /**
2910
         * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
2911
         * attach to an object. This can be useful for storing additional information about the
2912
         * object in a structured format. Individual keys can be unset by posting an empty value to
2913
         * them. All keys can be unset by posting an empty value to {@code metadata}.
2914
         */
2915
        public Builder setMetadata(EmptyParam metadata) {
2916
          this.metadata = metadata;
×
2917
          return this;
×
2918
        }
2919

2920
        /**
2921
         * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
2922
         * attach to an object. This can be useful for storing additional information about the
2923
         * object in a structured format. Individual keys can be unset by posting an empty value to
2924
         * them. All keys can be unset by posting an empty value to {@code metadata}.
2925
         */
2926
        public Builder setMetadata(Map<String, String> metadata) {
2927
          this.metadata = metadata;
×
2928
          return this;
×
2929
        }
2930

2931
        /** Default options for invoice PDF rendering for this customer. */
2932
        public Builder setRenderingOptions(
2933
            PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions renderingOptions) {
2934
          this.renderingOptions = renderingOptions;
×
2935
          return this;
×
2936
        }
2937

2938
        /** Default options for invoice PDF rendering for this customer. */
2939
        public Builder setRenderingOptions(EmptyParam renderingOptions) {
2940
          this.renderingOptions = renderingOptions;
×
2941
          return this;
×
2942
        }
2943
      }
2944

2945
      @Getter
2946
      public static class CustomField {
2947
        /**
2948
         * Map of extra parameters for custom features not available in this client library. The
2949
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2950
         * Instead, each key/value pair is serialized as if the key is a root-level field
2951
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2952
         * instance.
2953
         */
2954
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2955
        Map<String, Object> extraParams;
2956

2957
        /**
2958
         * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
2959
         */
2960
        @SerializedName("name")
2961
        String name;
2962

2963
        /**
2964
         * <strong>Required.</strong> The value of the custom field. This may be up to 140
2965
         * characters.
2966
         */
2967
        @SerializedName("value")
2968
        String value;
2969

2970
        private CustomField(Map<String, Object> extraParams, String name, String value) {
×
2971
          this.extraParams = extraParams;
×
2972
          this.name = name;
×
2973
          this.value = value;
×
2974
        }
×
2975

2976
        public static Builder builder() {
2977
          return new Builder();
×
2978
        }
2979

2980
        public static class Builder {
×
2981
          private Map<String, Object> extraParams;
2982

2983
          private String name;
2984

2985
          private String value;
2986

2987
          /** Finalize and obtain parameter instance from this builder. */
2988
          public PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField build() {
2989
            return new PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField(
×
2990
                this.extraParams, this.name, this.value);
2991
          }
2992

2993
          /**
2994
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2995
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2996
           * map. See {@link
2997
           * PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField#extraParams} for the
2998
           * field documentation.
2999
           */
3000
          public Builder putExtraParam(String key, Object value) {
3001
            if (this.extraParams == null) {
×
3002
              this.extraParams = new HashMap<>();
×
3003
            }
3004
            this.extraParams.put(key, value);
×
3005
            return this;
×
3006
          }
3007

3008
          /**
3009
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3010
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3011
           * map. See {@link
3012
           * PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField#extraParams} for the
3013
           * field documentation.
3014
           */
3015
          public Builder putAllExtraParam(Map<String, Object> map) {
3016
            if (this.extraParams == null) {
×
3017
              this.extraParams = new HashMap<>();
×
3018
            }
3019
            this.extraParams.putAll(map);
×
3020
            return this;
×
3021
          }
3022

3023
          /**
3024
           * <strong>Required.</strong> The name of the custom field. This may be up to 40
3025
           * characters.
3026
           */
3027
          public Builder setName(String name) {
3028
            this.name = name;
×
3029
            return this;
×
3030
          }
3031

3032
          /**
3033
           * <strong>Required.</strong> The value of the custom field. This may be up to 140
3034
           * characters.
3035
           */
3036
          public Builder setValue(String value) {
3037
            this.value = value;
×
3038
            return this;
×
3039
          }
3040
        }
3041
      }
3042

3043
      @Getter
3044
      public static class Issuer {
3045
        /** The connected account being referenced when {@code type} is {@code account}. */
3046
        @SerializedName("account")
3047
        String account;
3048

3049
        /**
3050
         * Map of extra parameters for custom features not available in this client library. The
3051
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3052
         * Instead, each key/value pair is serialized as if the key is a root-level field
3053
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3054
         * instance.
3055
         */
3056
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3057
        Map<String, Object> extraParams;
3058

3059
        /** <strong>Required.</strong> Type of the account referenced in the request. */
3060
        @SerializedName("type")
3061
        Type type;
3062

3063
        private Issuer(String account, Map<String, Object> extraParams, Type type) {
×
3064
          this.account = account;
×
3065
          this.extraParams = extraParams;
×
3066
          this.type = type;
×
3067
        }
×
3068

3069
        public static Builder builder() {
3070
          return new Builder();
×
3071
        }
3072

3073
        public static class Builder {
×
3074
          private String account;
3075

3076
          private Map<String, Object> extraParams;
3077

3078
          private Type type;
3079

3080
          /** Finalize and obtain parameter instance from this builder. */
3081
          public PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer build() {
3082
            return new PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer(
×
3083
                this.account, this.extraParams, this.type);
3084
          }
3085

3086
          /** The connected account being referenced when {@code type} is {@code account}. */
3087
          public Builder setAccount(String account) {
3088
            this.account = account;
×
3089
            return this;
×
3090
          }
3091

3092
          /**
3093
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3094
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3095
           * map. See {@link PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer#extraParams}
3096
           * for the field documentation.
3097
           */
3098
          public Builder putExtraParam(String key, Object value) {
3099
            if (this.extraParams == null) {
×
3100
              this.extraParams = new HashMap<>();
×
3101
            }
3102
            this.extraParams.put(key, value);
×
3103
            return this;
×
3104
          }
3105

3106
          /**
3107
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3108
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3109
           * map. See {@link PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer#extraParams}
3110
           * for the field documentation.
3111
           */
3112
          public Builder putAllExtraParam(Map<String, Object> map) {
3113
            if (this.extraParams == null) {
×
3114
              this.extraParams = new HashMap<>();
×
3115
            }
3116
            this.extraParams.putAll(map);
×
3117
            return this;
×
3118
          }
3119

3120
          /** <strong>Required.</strong> Type of the account referenced in the request. */
3121
          public Builder setType(
3122
              PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer.Type type) {
3123
            this.type = type;
×
3124
            return this;
×
3125
          }
3126
        }
3127

3128
        public enum Type implements ApiRequestParams.EnumParam {
×
3129
          @SerializedName("account")
×
3130
          ACCOUNT("account"),
3131

3132
          @SerializedName("self")
×
3133
          SELF("self");
3134

3135
          @Getter(onMethod_ = {@Override})
3136
          private final String value;
3137

3138
          Type(String value) {
×
3139
            this.value = value;
×
3140
          }
×
3141
        }
3142
      }
3143

3144
      @Getter
3145
      public static class RenderingOptions {
3146
        /**
3147
         * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
3148
         * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
3149
         * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in invoice
3150
         * PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive alike)
3151
         * from invoice PDF amounts.
3152
         */
3153
        @SerializedName("amount_tax_display")
3154
        ApiRequestParams.EnumParam amountTaxDisplay;
3155

3156
        /**
3157
         * Map of extra parameters for custom features not available in this client library. The
3158
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3159
         * Instead, each key/value pair is serialized as if the key is a root-level field
3160
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3161
         * instance.
3162
         */
3163
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3164
        Map<String, Object> extraParams;
3165

3166
        private RenderingOptions(
3167
            ApiRequestParams.EnumParam amountTaxDisplay, Map<String, Object> extraParams) {
×
3168
          this.amountTaxDisplay = amountTaxDisplay;
×
3169
          this.extraParams = extraParams;
×
3170
        }
×
3171

3172
        public static Builder builder() {
3173
          return new Builder();
×
3174
        }
3175

3176
        public static class Builder {
×
3177
          private ApiRequestParams.EnumParam amountTaxDisplay;
3178

3179
          private Map<String, Object> extraParams;
3180

3181
          /** Finalize and obtain parameter instance from this builder. */
3182
          public PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions build() {
3183
            return new PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions(
×
3184
                this.amountTaxDisplay, this.extraParams);
3185
          }
3186

3187
          /**
3188
           * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
3189
           * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
3190
           * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in
3191
           * invoice PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive
3192
           * alike) from invoice PDF amounts.
3193
           */
3194
          public Builder setAmountTaxDisplay(
3195
              PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions.AmountTaxDisplay
3196
                  amountTaxDisplay) {
3197
            this.amountTaxDisplay = amountTaxDisplay;
×
3198
            return this;
×
3199
          }
3200

3201
          /**
3202
           * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
3203
           * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
3204
           * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in
3205
           * invoice PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive
3206
           * alike) from invoice PDF amounts.
3207
           */
3208
          public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
3209
            this.amountTaxDisplay = amountTaxDisplay;
×
3210
            return this;
×
3211
          }
3212

3213
          /**
3214
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3215
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3216
           * map. See {@link
3217
           * PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions#extraParams} for
3218
           * the field documentation.
3219
           */
3220
          public Builder putExtraParam(String key, Object value) {
3221
            if (this.extraParams == null) {
×
3222
              this.extraParams = new HashMap<>();
×
3223
            }
3224
            this.extraParams.put(key, value);
×
3225
            return this;
×
3226
          }
3227

3228
          /**
3229
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3230
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3231
           * map. See {@link
3232
           * PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions#extraParams} for
3233
           * the field documentation.
3234
           */
3235
          public Builder putAllExtraParam(Map<String, Object> map) {
3236
            if (this.extraParams == null) {
×
3237
              this.extraParams = new HashMap<>();
×
3238
            }
3239
            this.extraParams.putAll(map);
×
3240
            return this;
×
3241
          }
3242
        }
3243

3244
        public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
3245
          @SerializedName("exclude_tax")
×
3246
          EXCLUDE_TAX("exclude_tax"),
3247

3248
          @SerializedName("include_inclusive_tax")
×
3249
          INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
3250

3251
          @Getter(onMethod_ = {@Override})
3252
          private final String value;
3253

3254
          AmountTaxDisplay(String value) {
×
3255
            this.value = value;
×
3256
          }
×
3257
        }
3258
      }
3259
    }
3260
  }
3261

3262
  @Getter
3263
  public static class LineItem {
3264
    /**
3265
     * When set, provides configuration for this item’s quantity to be adjusted by the customer
3266
     * during checkout.
3267
     */
3268
    @SerializedName("adjustable_quantity")
3269
    AdjustableQuantity adjustableQuantity;
3270

3271
    /**
3272
     * Map of extra parameters for custom features not available in this client library. The content
3273
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3274
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3275
     * param object. Effectively, this map is flattened to its parent instance.
3276
     */
3277
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3278
    Map<String, Object> extraParams;
3279

3280
    /**
3281
     * <strong>Required.</strong> The ID of the <a
3282
     * href="https://stripe.com/docs/api/prices">Price</a> or <a
3283
     * href="https://stripe.com/docs/api/plans">Plan</a> object.
3284
     */
3285
    @SerializedName("price")
3286
    String price;
3287

3288
    /** <strong>Required.</strong> The quantity of the line item being purchased. */
3289
    @SerializedName("quantity")
3290
    Long quantity;
3291

3292
    private LineItem(
3293
        AdjustableQuantity adjustableQuantity,
3294
        Map<String, Object> extraParams,
3295
        String price,
3296
        Long quantity) {
1✔
3297
      this.adjustableQuantity = adjustableQuantity;
1✔
3298
      this.extraParams = extraParams;
1✔
3299
      this.price = price;
1✔
3300
      this.quantity = quantity;
1✔
3301
    }
1✔
3302

3303
    public static Builder builder() {
3304
      return new Builder();
1✔
3305
    }
3306

3307
    public static class Builder {
1✔
3308
      private AdjustableQuantity adjustableQuantity;
3309

3310
      private Map<String, Object> extraParams;
3311

3312
      private String price;
3313

3314
      private Long quantity;
3315

3316
      /** Finalize and obtain parameter instance from this builder. */
3317
      public PaymentLinkCreateParams.LineItem build() {
3318
        return new PaymentLinkCreateParams.LineItem(
1✔
3319
            this.adjustableQuantity, this.extraParams, this.price, this.quantity);
3320
      }
3321

3322
      /**
3323
       * When set, provides configuration for this item’s quantity to be adjusted by the customer
3324
       * during checkout.
3325
       */
3326
      public Builder setAdjustableQuantity(
3327
          PaymentLinkCreateParams.LineItem.AdjustableQuantity adjustableQuantity) {
3328
        this.adjustableQuantity = adjustableQuantity;
×
3329
        return this;
×
3330
      }
3331

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

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

3358
      /**
3359
       * <strong>Required.</strong> The ID of the <a
3360
       * href="https://stripe.com/docs/api/prices">Price</a> or <a
3361
       * href="https://stripe.com/docs/api/plans">Plan</a> object.
3362
       */
3363
      public Builder setPrice(String price) {
3364
        this.price = price;
1✔
3365
        return this;
1✔
3366
      }
3367

3368
      /** <strong>Required.</strong> The quantity of the line item being purchased. */
3369
      public Builder setQuantity(Long quantity) {
3370
        this.quantity = quantity;
1✔
3371
        return this;
1✔
3372
      }
3373
    }
3374

3375
    @Getter
3376
    public static class AdjustableQuantity {
3377
      /**
3378
       * <strong>Required.</strong> Set to true if the quantity can be adjusted to any non-negative
3379
       * Integer.
3380
       */
3381
      @SerializedName("enabled")
3382
      Boolean enabled;
3383

3384
      /**
3385
       * Map of extra parameters for custom features not available in this client library. The
3386
       * content in this map is not serialized under this field's {@code @SerializedName} value.
3387
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
3388
       * name in this param object. Effectively, this map is flattened to its parent instance.
3389
       */
3390
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3391
      Map<String, Object> extraParams;
3392

3393
      /**
3394
       * The maximum quantity the customer can purchase. By default this value is 99. You can
3395
       * specify a value up to 999.
3396
       */
3397
      @SerializedName("maximum")
3398
      Long maximum;
3399

3400
      /**
3401
       * The minimum quantity the customer can purchase. By default this value is 0. If there is
3402
       * only one item in the cart then that item's quantity cannot go down to 0.
3403
       */
3404
      @SerializedName("minimum")
3405
      Long minimum;
3406

3407
      private AdjustableQuantity(
3408
          Boolean enabled, Map<String, Object> extraParams, Long maximum, Long minimum) {
×
3409
        this.enabled = enabled;
×
3410
        this.extraParams = extraParams;
×
3411
        this.maximum = maximum;
×
3412
        this.minimum = minimum;
×
3413
      }
×
3414

3415
      public static Builder builder() {
3416
        return new Builder();
×
3417
      }
3418

3419
      public static class Builder {
×
3420
        private Boolean enabled;
3421

3422
        private Map<String, Object> extraParams;
3423

3424
        private Long maximum;
3425

3426
        private Long minimum;
3427

3428
        /** Finalize and obtain parameter instance from this builder. */
3429
        public PaymentLinkCreateParams.LineItem.AdjustableQuantity build() {
3430
          return new PaymentLinkCreateParams.LineItem.AdjustableQuantity(
×
3431
              this.enabled, this.extraParams, this.maximum, this.minimum);
3432
        }
3433

3434
        /**
3435
         * <strong>Required.</strong> Set to true if the quantity can be adjusted to any
3436
         * non-negative Integer.
3437
         */
3438
        public Builder setEnabled(Boolean enabled) {
3439
          this.enabled = enabled;
×
3440
          return this;
×
3441
        }
3442

3443
        /**
3444
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
3445
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3446
         * map. See {@link PaymentLinkCreateParams.LineItem.AdjustableQuantity#extraParams} for the
3447
         * field documentation.
3448
         */
3449
        public Builder putExtraParam(String key, Object value) {
3450
          if (this.extraParams == null) {
×
3451
            this.extraParams = new HashMap<>();
×
3452
          }
3453
          this.extraParams.put(key, value);
×
3454
          return this;
×
3455
        }
3456

3457
        /**
3458
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3459
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3460
         * map. See {@link PaymentLinkCreateParams.LineItem.AdjustableQuantity#extraParams} for the
3461
         * field documentation.
3462
         */
3463
        public Builder putAllExtraParam(Map<String, Object> map) {
3464
          if (this.extraParams == null) {
×
3465
            this.extraParams = new HashMap<>();
×
3466
          }
3467
          this.extraParams.putAll(map);
×
3468
          return this;
×
3469
        }
3470

3471
        /**
3472
         * The maximum quantity the customer can purchase. By default this value is 99. You can
3473
         * specify a value up to 999.
3474
         */
3475
        public Builder setMaximum(Long maximum) {
3476
          this.maximum = maximum;
×
3477
          return this;
×
3478
        }
3479

3480
        /**
3481
         * The minimum quantity the customer can purchase. By default this value is 0. If there is
3482
         * only one item in the cart then that item's quantity cannot go down to 0.
3483
         */
3484
        public Builder setMinimum(Long minimum) {
3485
          this.minimum = minimum;
×
3486
          return this;
×
3487
        }
3488
      }
3489
    }
3490
  }
3491

3492
  @Getter
3493
  public static class PaymentIntentData {
3494
    /** Controls when the funds will be captured from the customer's account. */
3495
    @SerializedName("capture_method")
3496
    CaptureMethod captureMethod;
3497

3498
    /** An arbitrary string attached to the object. Often useful for displaying to users. */
3499
    @SerializedName("description")
3500
    String description;
3501

3502
    /**
3503
     * Map of extra parameters for custom features not available in this client library. The content
3504
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3505
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3506
     * param object. Effectively, this map is flattened to its parent instance.
3507
     */
3508
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3509
    Map<String, Object> extraParams;
3510

3511
    /**
3512
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
3513
     * declaratively set metadata on <a href="https://stripe.com/docs/api/payment_intents">Payment
3514
     * Intents</a> generated from this payment link. Unlike object-level metadata, this field is
3515
     * declarative. Updates will clear prior values.
3516
     */
3517
    @SerializedName("metadata")
3518
    Map<String, String> metadata;
3519

3520
    /**
3521
     * Indicates that you intend to <a
3522
     * href="https://stripe.com/docs/payments/payment-intents#future-usage">make future payments</a>
3523
     * with the payment method collected by this Checkout Session.
3524
     *
3525
     * <p>When setting this to {@code on_session}, Checkout will show a notice to the customer that
3526
     * their payment details will be saved.
3527
     *
3528
     * <p>When setting this to {@code off_session}, Checkout will show a notice to the customer that
3529
     * their payment details will be saved and used for future payments.
3530
     *
3531
     * <p>If a Customer has been provided or Checkout creates a new Customer,Checkout will attach
3532
     * the payment method to the Customer.
3533
     *
3534
     * <p>If Checkout does not create a Customer, the payment method is not attached to a Customer.
3535
     * To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent.
3536
     *
3537
     * <p>When processing card payments, Checkout also uses {@code setup_future_usage} to
3538
     * dynamically optimize your payment flow and comply with regional legislation and network
3539
     * rules, such as SCA.
3540
     */
3541
    @SerializedName("setup_future_usage")
3542
    SetupFutureUsage setupFutureUsage;
3543

3544
    /**
3545
     * Text that appears on the customer's statement as the statement descriptor for a non-card
3546
     * charge. This value overrides the account's default statement descriptor. For information
3547
     * about requirements, including the 22-character limit, see <a
3548
     * href="https://docs.stripe.com/get-started/account/statement-descriptors">the Statement
3549
     * Descriptor docs</a>.
3550
     *
3551
     * <p>Setting this value for a card charge returns an error. For card charges, set the <a
3552
     * href="https://docs.stripe.com/get-started/account/statement-descriptors#dynamic">statement_descriptor_suffix</a>
3553
     * instead.
3554
     */
3555
    @SerializedName("statement_descriptor")
3556
    String statementDescriptor;
3557

3558
    /**
3559
     * Provides information about a card charge. Concatenated to the account's <a
3560
     * href="https://docs.stripe.com/get-started/account/statement-descriptors#static">statement
3561
     * descriptor prefix</a> to form the complete statement descriptor that appears on the
3562
     * customer's statement.
3563
     */
3564
    @SerializedName("statement_descriptor_suffix")
3565
    String statementDescriptorSuffix;
3566

3567
    /**
3568
     * A string that identifies the resulting payment as part of a group. See the PaymentIntents <a
3569
     * href="https://stripe.com/docs/connect/separate-charges-and-transfers">use case for connected
3570
     * accounts</a> for details.
3571
     */
3572
    @SerializedName("transfer_group")
3573
    String transferGroup;
3574

3575
    private PaymentIntentData(
3576
        CaptureMethod captureMethod,
3577
        String description,
3578
        Map<String, Object> extraParams,
3579
        Map<String, String> metadata,
3580
        SetupFutureUsage setupFutureUsage,
3581
        String statementDescriptor,
3582
        String statementDescriptorSuffix,
3583
        String transferGroup) {
×
3584
      this.captureMethod = captureMethod;
×
3585
      this.description = description;
×
3586
      this.extraParams = extraParams;
×
3587
      this.metadata = metadata;
×
3588
      this.setupFutureUsage = setupFutureUsage;
×
3589
      this.statementDescriptor = statementDescriptor;
×
3590
      this.statementDescriptorSuffix = statementDescriptorSuffix;
×
3591
      this.transferGroup = transferGroup;
×
3592
    }
×
3593

3594
    public static Builder builder() {
3595
      return new Builder();
×
3596
    }
3597

3598
    public static class Builder {
×
3599
      private CaptureMethod captureMethod;
3600

3601
      private String description;
3602

3603
      private Map<String, Object> extraParams;
3604

3605
      private Map<String, String> metadata;
3606

3607
      private SetupFutureUsage setupFutureUsage;
3608

3609
      private String statementDescriptor;
3610

3611
      private String statementDescriptorSuffix;
3612

3613
      private String transferGroup;
3614

3615
      /** Finalize and obtain parameter instance from this builder. */
3616
      public PaymentLinkCreateParams.PaymentIntentData build() {
3617
        return new PaymentLinkCreateParams.PaymentIntentData(
×
3618
            this.captureMethod,
3619
            this.description,
3620
            this.extraParams,
3621
            this.metadata,
3622
            this.setupFutureUsage,
3623
            this.statementDescriptor,
3624
            this.statementDescriptorSuffix,
3625
            this.transferGroup);
3626
      }
3627

3628
      /** Controls when the funds will be captured from the customer's account. */
3629
      public Builder setCaptureMethod(
3630
          PaymentLinkCreateParams.PaymentIntentData.CaptureMethod captureMethod) {
3631
        this.captureMethod = captureMethod;
×
3632
        return this;
×
3633
      }
3634

3635
      /** An arbitrary string attached to the object. Often useful for displaying to users. */
3636
      public Builder setDescription(String description) {
3637
        this.description = description;
×
3638
        return this;
×
3639
      }
3640

3641
      /**
3642
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3643
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3644
       * PaymentLinkCreateParams.PaymentIntentData#extraParams} for the field documentation.
3645
       */
3646
      public Builder putExtraParam(String key, Object value) {
3647
        if (this.extraParams == null) {
×
3648
          this.extraParams = new HashMap<>();
×
3649
        }
3650
        this.extraParams.put(key, value);
×
3651
        return this;
×
3652
      }
3653

3654
      /**
3655
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3656
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3657
       * See {@link PaymentLinkCreateParams.PaymentIntentData#extraParams} for the field
3658
       * documentation.
3659
       */
3660
      public Builder putAllExtraParam(Map<String, Object> map) {
3661
        if (this.extraParams == null) {
×
3662
          this.extraParams = new HashMap<>();
×
3663
        }
3664
        this.extraParams.putAll(map);
×
3665
        return this;
×
3666
      }
3667

3668
      /**
3669
       * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
3670
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3671
       * PaymentLinkCreateParams.PaymentIntentData#metadata} for the field documentation.
3672
       */
3673
      public Builder putMetadata(String key, String value) {
3674
        if (this.metadata == null) {
×
3675
          this.metadata = new HashMap<>();
×
3676
        }
3677
        this.metadata.put(key, value);
×
3678
        return this;
×
3679
      }
3680

3681
      /**
3682
       * Add all map key/value pairs to `metadata` map. A map is initialized for the first
3683
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3684
       * See {@link PaymentLinkCreateParams.PaymentIntentData#metadata} for the field documentation.
3685
       */
3686
      public Builder putAllMetadata(Map<String, String> map) {
3687
        if (this.metadata == null) {
×
3688
          this.metadata = new HashMap<>();
×
3689
        }
3690
        this.metadata.putAll(map);
×
3691
        return this;
×
3692
      }
3693

3694
      /**
3695
       * Indicates that you intend to <a
3696
       * href="https://stripe.com/docs/payments/payment-intents#future-usage">make future
3697
       * payments</a> with the payment method collected by this Checkout Session.
3698
       *
3699
       * <p>When setting this to {@code on_session}, Checkout will show a notice to the customer
3700
       * that their payment details will be saved.
3701
       *
3702
       * <p>When setting this to {@code off_session}, Checkout will show a notice to the customer
3703
       * that their payment details will be saved and used for future payments.
3704
       *
3705
       * <p>If a Customer has been provided or Checkout creates a new Customer,Checkout will attach
3706
       * the payment method to the Customer.
3707
       *
3708
       * <p>If Checkout does not create a Customer, the payment method is not attached to a
3709
       * Customer. To reuse the payment method, you can retrieve it from the Checkout Session's
3710
       * PaymentIntent.
3711
       *
3712
       * <p>When processing card payments, Checkout also uses {@code setup_future_usage} to
3713
       * dynamically optimize your payment flow and comply with regional legislation and network
3714
       * rules, such as SCA.
3715
       */
3716
      public Builder setSetupFutureUsage(
3717
          PaymentLinkCreateParams.PaymentIntentData.SetupFutureUsage setupFutureUsage) {
3718
        this.setupFutureUsage = setupFutureUsage;
×
3719
        return this;
×
3720
      }
3721

3722
      /**
3723
       * Text that appears on the customer's statement as the statement descriptor for a non-card
3724
       * charge. This value overrides the account's default statement descriptor. For information
3725
       * about requirements, including the 22-character limit, see <a
3726
       * href="https://docs.stripe.com/get-started/account/statement-descriptors">the Statement
3727
       * Descriptor docs</a>.
3728
       *
3729
       * <p>Setting this value for a card charge returns an error. For card charges, set the <a
3730
       * href="https://docs.stripe.com/get-started/account/statement-descriptors#dynamic">statement_descriptor_suffix</a>
3731
       * instead.
3732
       */
3733
      public Builder setStatementDescriptor(String statementDescriptor) {
3734
        this.statementDescriptor = statementDescriptor;
×
3735
        return this;
×
3736
      }
3737

3738
      /**
3739
       * Provides information about a card charge. Concatenated to the account's <a
3740
       * href="https://docs.stripe.com/get-started/account/statement-descriptors#static">statement
3741
       * descriptor prefix</a> to form the complete statement descriptor that appears on the
3742
       * customer's statement.
3743
       */
3744
      public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) {
3745
        this.statementDescriptorSuffix = statementDescriptorSuffix;
×
3746
        return this;
×
3747
      }
3748

3749
      /**
3750
       * A string that identifies the resulting payment as part of a group. See the PaymentIntents
3751
       * <a href="https://stripe.com/docs/connect/separate-charges-and-transfers">use case for
3752
       * connected accounts</a> for details.
3753
       */
3754
      public Builder setTransferGroup(String transferGroup) {
3755
        this.transferGroup = transferGroup;
×
3756
        return this;
×
3757
      }
3758
    }
3759

3760
    public enum CaptureMethod implements ApiRequestParams.EnumParam {
×
3761
      @SerializedName("automatic")
×
3762
      AUTOMATIC("automatic"),
3763

3764
      @SerializedName("automatic_async")
×
3765
      AUTOMATIC_ASYNC("automatic_async"),
3766

3767
      @SerializedName("manual")
×
3768
      MANUAL("manual");
3769

3770
      @Getter(onMethod_ = {@Override})
3771
      private final String value;
3772

3773
      CaptureMethod(String value) {
×
3774
        this.value = value;
×
3775
      }
×
3776
    }
3777

3778
    public enum SetupFutureUsage implements ApiRequestParams.EnumParam {
×
3779
      @SerializedName("off_session")
×
3780
      OFF_SESSION("off_session"),
3781

3782
      @SerializedName("on_session")
×
3783
      ON_SESSION("on_session");
3784

3785
      @Getter(onMethod_ = {@Override})
3786
      private final String value;
3787

3788
      SetupFutureUsage(String value) {
×
3789
        this.value = value;
×
3790
      }
×
3791
    }
3792
  }
3793

3794
  @Getter
3795
  public static class PhoneNumberCollection {
3796
    /** <strong>Required.</strong> Set to {@code true} to enable phone number collection. */
3797
    @SerializedName("enabled")
3798
    Boolean enabled;
3799

3800
    /**
3801
     * Map of extra parameters for custom features not available in this client library. The content
3802
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3803
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3804
     * param object. Effectively, this map is flattened to its parent instance.
3805
     */
3806
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3807
    Map<String, Object> extraParams;
3808

3809
    private PhoneNumberCollection(Boolean enabled, Map<String, Object> extraParams) {
×
3810
      this.enabled = enabled;
×
3811
      this.extraParams = extraParams;
×
3812
    }
×
3813

3814
    public static Builder builder() {
3815
      return new Builder();
×
3816
    }
3817

3818
    public static class Builder {
×
3819
      private Boolean enabled;
3820

3821
      private Map<String, Object> extraParams;
3822

3823
      /** Finalize and obtain parameter instance from this builder. */
3824
      public PaymentLinkCreateParams.PhoneNumberCollection build() {
3825
        return new PaymentLinkCreateParams.PhoneNumberCollection(this.enabled, this.extraParams);
×
3826
      }
3827

3828
      /** <strong>Required.</strong> Set to {@code true} to enable phone number collection. */
3829
      public Builder setEnabled(Boolean enabled) {
3830
        this.enabled = enabled;
×
3831
        return this;
×
3832
      }
3833

3834
      /**
3835
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3836
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3837
       * PaymentLinkCreateParams.PhoneNumberCollection#extraParams} for the field documentation.
3838
       */
3839
      public Builder putExtraParam(String key, Object value) {
3840
        if (this.extraParams == null) {
×
3841
          this.extraParams = new HashMap<>();
×
3842
        }
3843
        this.extraParams.put(key, value);
×
3844
        return this;
×
3845
      }
3846

3847
      /**
3848
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3849
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3850
       * See {@link PaymentLinkCreateParams.PhoneNumberCollection#extraParams} for the field
3851
       * documentation.
3852
       */
3853
      public Builder putAllExtraParam(Map<String, Object> map) {
3854
        if (this.extraParams == null) {
×
3855
          this.extraParams = new HashMap<>();
×
3856
        }
3857
        this.extraParams.putAll(map);
×
3858
        return this;
×
3859
      }
3860
    }
3861
  }
3862

3863
  @Getter
3864
  public static class Restrictions {
3865
    /**
3866
     * <strong>Required.</strong> Configuration for the {@code completed_sessions} restriction type.
3867
     */
3868
    @SerializedName("completed_sessions")
3869
    CompletedSessions completedSessions;
3870

3871
    /**
3872
     * Map of extra parameters for custom features not available in this client library. The content
3873
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3874
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3875
     * param object. Effectively, this map is flattened to its parent instance.
3876
     */
3877
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3878
    Map<String, Object> extraParams;
3879

3880
    private Restrictions(CompletedSessions completedSessions, Map<String, Object> extraParams) {
×
3881
      this.completedSessions = completedSessions;
×
3882
      this.extraParams = extraParams;
×
3883
    }
×
3884

3885
    public static Builder builder() {
3886
      return new Builder();
×
3887
    }
3888

3889
    public static class Builder {
×
3890
      private CompletedSessions completedSessions;
3891

3892
      private Map<String, Object> extraParams;
3893

3894
      /** Finalize and obtain parameter instance from this builder. */
3895
      public PaymentLinkCreateParams.Restrictions build() {
3896
        return new PaymentLinkCreateParams.Restrictions(this.completedSessions, this.extraParams);
×
3897
      }
3898

3899
      /**
3900
       * <strong>Required.</strong> Configuration for the {@code completed_sessions} restriction
3901
       * type.
3902
       */
3903
      public Builder setCompletedSessions(
3904
          PaymentLinkCreateParams.Restrictions.CompletedSessions completedSessions) {
3905
        this.completedSessions = completedSessions;
×
3906
        return this;
×
3907
      }
3908

3909
      /**
3910
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3911
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3912
       * PaymentLinkCreateParams.Restrictions#extraParams} for the field documentation.
3913
       */
3914
      public Builder putExtraParam(String key, Object value) {
3915
        if (this.extraParams == null) {
×
3916
          this.extraParams = new HashMap<>();
×
3917
        }
3918
        this.extraParams.put(key, value);
×
3919
        return this;
×
3920
      }
3921

3922
      /**
3923
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3924
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3925
       * See {@link PaymentLinkCreateParams.Restrictions#extraParams} for the field documentation.
3926
       */
3927
      public Builder putAllExtraParam(Map<String, Object> map) {
3928
        if (this.extraParams == null) {
×
3929
          this.extraParams = new HashMap<>();
×
3930
        }
3931
        this.extraParams.putAll(map);
×
3932
        return this;
×
3933
      }
3934
    }
3935

3936
    @Getter
3937
    public static class CompletedSessions {
3938
      /**
3939
       * Map of extra parameters for custom features not available in this client library. The
3940
       * content in this map is not serialized under this field's {@code @SerializedName} value.
3941
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
3942
       * name in this param object. Effectively, this map is flattened to its parent instance.
3943
       */
3944
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3945
      Map<String, Object> extraParams;
3946

3947
      /**
3948
       * <strong>Required.</strong> The maximum number of checkout sessions that can be completed
3949
       * for the {@code completed_sessions} restriction to be met.
3950
       */
3951
      @SerializedName("limit")
3952
      Long limit;
3953

3954
      private CompletedSessions(Map<String, Object> extraParams, Long limit) {
×
3955
        this.extraParams = extraParams;
×
3956
        this.limit = limit;
×
3957
      }
×
3958

3959
      public static Builder builder() {
3960
        return new Builder();
×
3961
      }
3962

3963
      public static class Builder {
×
3964
        private Map<String, Object> extraParams;
3965

3966
        private Long limit;
3967

3968
        /** Finalize and obtain parameter instance from this builder. */
3969
        public PaymentLinkCreateParams.Restrictions.CompletedSessions build() {
3970
          return new PaymentLinkCreateParams.Restrictions.CompletedSessions(
×
3971
              this.extraParams, this.limit);
3972
        }
3973

3974
        /**
3975
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
3976
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3977
         * map. See {@link PaymentLinkCreateParams.Restrictions.CompletedSessions#extraParams} for
3978
         * the field documentation.
3979
         */
3980
        public Builder putExtraParam(String key, Object value) {
3981
          if (this.extraParams == null) {
×
3982
            this.extraParams = new HashMap<>();
×
3983
          }
3984
          this.extraParams.put(key, value);
×
3985
          return this;
×
3986
        }
3987

3988
        /**
3989
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3990
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3991
         * map. See {@link PaymentLinkCreateParams.Restrictions.CompletedSessions#extraParams} for
3992
         * the field documentation.
3993
         */
3994
        public Builder putAllExtraParam(Map<String, Object> map) {
3995
          if (this.extraParams == null) {
×
3996
            this.extraParams = new HashMap<>();
×
3997
          }
3998
          this.extraParams.putAll(map);
×
3999
          return this;
×
4000
        }
4001

4002
        /**
4003
         * <strong>Required.</strong> The maximum number of checkout sessions that can be completed
4004
         * for the {@code completed_sessions} restriction to be met.
4005
         */
4006
        public Builder setLimit(Long limit) {
4007
          this.limit = limit;
×
4008
          return this;
×
4009
        }
4010
      }
4011
    }
4012
  }
4013

4014
  @Getter
4015
  public static class ShippingAddressCollection {
4016
    /**
4017
     * <strong>Required.</strong> An array of two-letter ISO country codes representing which
4018
     * countries Checkout should provide as options for shipping locations. Unsupported country
4019
     * codes: {@code AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}.
4020
     */
4021
    @SerializedName("allowed_countries")
4022
    List<PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry> allowedCountries;
4023

4024
    /**
4025
     * Map of extra parameters for custom features not available in this client library. The content
4026
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4027
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4028
     * param object. Effectively, this map is flattened to its parent instance.
4029
     */
4030
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4031
    Map<String, Object> extraParams;
4032

4033
    private ShippingAddressCollection(
4034
        List<PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry> allowedCountries,
4035
        Map<String, Object> extraParams) {
×
4036
      this.allowedCountries = allowedCountries;
×
4037
      this.extraParams = extraParams;
×
4038
    }
×
4039

4040
    public static Builder builder() {
4041
      return new Builder();
×
4042
    }
4043

4044
    public static class Builder {
×
4045
      private List<PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry>
4046
          allowedCountries;
4047

4048
      private Map<String, Object> extraParams;
4049

4050
      /** Finalize and obtain parameter instance from this builder. */
4051
      public PaymentLinkCreateParams.ShippingAddressCollection build() {
4052
        return new PaymentLinkCreateParams.ShippingAddressCollection(
×
4053
            this.allowedCountries, this.extraParams);
4054
      }
4055

4056
      /**
4057
       * Add an element to `allowedCountries` list. A list is initialized for the first `add/addAll`
4058
       * call, and subsequent calls adds additional elements to the original list. See {@link
4059
       * PaymentLinkCreateParams.ShippingAddressCollection#allowedCountries} for the field
4060
       * documentation.
4061
       */
4062
      public Builder addAllowedCountry(
4063
          PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry element) {
4064
        if (this.allowedCountries == null) {
×
4065
          this.allowedCountries = new ArrayList<>();
×
4066
        }
4067
        this.allowedCountries.add(element);
×
4068
        return this;
×
4069
      }
4070

4071
      /**
4072
       * Add all elements to `allowedCountries` list. A list is initialized for the first
4073
       * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
4074
       * {@link PaymentLinkCreateParams.ShippingAddressCollection#allowedCountries} for the field
4075
       * documentation.
4076
       */
4077
      public Builder addAllAllowedCountry(
4078
          List<PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry> elements) {
4079
        if (this.allowedCountries == null) {
×
4080
          this.allowedCountries = new ArrayList<>();
×
4081
        }
4082
        this.allowedCountries.addAll(elements);
×
4083
        return this;
×
4084
      }
4085

4086
      /**
4087
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4088
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4089
       * PaymentLinkCreateParams.ShippingAddressCollection#extraParams} for the field documentation.
4090
       */
4091
      public Builder putExtraParam(String key, Object value) {
4092
        if (this.extraParams == null) {
×
4093
          this.extraParams = new HashMap<>();
×
4094
        }
4095
        this.extraParams.put(key, value);
×
4096
        return this;
×
4097
      }
4098

4099
      /**
4100
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4101
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4102
       * See {@link PaymentLinkCreateParams.ShippingAddressCollection#extraParams} for the field
4103
       * documentation.
4104
       */
4105
      public Builder putAllExtraParam(Map<String, Object> map) {
4106
        if (this.extraParams == null) {
×
4107
          this.extraParams = new HashMap<>();
×
4108
        }
4109
        this.extraParams.putAll(map);
×
4110
        return this;
×
4111
      }
4112
    }
4113

4114
    public enum AllowedCountry implements ApiRequestParams.EnumParam {
×
4115
      @SerializedName("AC")
×
4116
      AC("AC"),
4117

4118
      @SerializedName("AD")
×
4119
      AD("AD"),
4120

4121
      @SerializedName("AE")
×
4122
      AE("AE"),
4123

4124
      @SerializedName("AF")
×
4125
      AF("AF"),
4126

4127
      @SerializedName("AG")
×
4128
      AG("AG"),
4129

4130
      @SerializedName("AI")
×
4131
      AI("AI"),
4132

4133
      @SerializedName("AL")
×
4134
      AL("AL"),
4135

4136
      @SerializedName("AM")
×
4137
      AM("AM"),
4138

4139
      @SerializedName("AO")
×
4140
      AO("AO"),
4141

4142
      @SerializedName("AQ")
×
4143
      AQ("AQ"),
4144

4145
      @SerializedName("AR")
×
4146
      AR("AR"),
4147

4148
      @SerializedName("AT")
×
4149
      AT("AT"),
4150

4151
      @SerializedName("AU")
×
4152
      AU("AU"),
4153

4154
      @SerializedName("AW")
×
4155
      AW("AW"),
4156

4157
      @SerializedName("AX")
×
4158
      AX("AX"),
4159

4160
      @SerializedName("AZ")
×
4161
      AZ("AZ"),
4162

4163
      @SerializedName("BA")
×
4164
      BA("BA"),
4165

4166
      @SerializedName("BB")
×
4167
      BB("BB"),
4168

4169
      @SerializedName("BD")
×
4170
      BD("BD"),
4171

4172
      @SerializedName("BE")
×
4173
      BE("BE"),
4174

4175
      @SerializedName("BF")
×
4176
      BF("BF"),
4177

4178
      @SerializedName("BG")
×
4179
      BG("BG"),
4180

4181
      @SerializedName("BH")
×
4182
      BH("BH"),
4183

4184
      @SerializedName("BI")
×
4185
      BI("BI"),
4186

4187
      @SerializedName("BJ")
×
4188
      BJ("BJ"),
4189

4190
      @SerializedName("BL")
×
4191
      BL("BL"),
4192

4193
      @SerializedName("BM")
×
4194
      BM("BM"),
4195

4196
      @SerializedName("BN")
×
4197
      BN("BN"),
4198

4199
      @SerializedName("BO")
×
4200
      BO("BO"),
4201

4202
      @SerializedName("BQ")
×
4203
      BQ("BQ"),
4204

4205
      @SerializedName("BR")
×
4206
      BR("BR"),
4207

4208
      @SerializedName("BS")
×
4209
      BS("BS"),
4210

4211
      @SerializedName("BT")
×
4212
      BT("BT"),
4213

4214
      @SerializedName("BV")
×
4215
      BV("BV"),
4216

4217
      @SerializedName("BW")
×
4218
      BW("BW"),
4219

4220
      @SerializedName("BY")
×
4221
      BY("BY"),
4222

4223
      @SerializedName("BZ")
×
4224
      BZ("BZ"),
4225

4226
      @SerializedName("CA")
×
4227
      CA("CA"),
4228

4229
      @SerializedName("CD")
×
4230
      CD("CD"),
4231

4232
      @SerializedName("CF")
×
4233
      CF("CF"),
4234

4235
      @SerializedName("CG")
×
4236
      CG("CG"),
4237

4238
      @SerializedName("CH")
×
4239
      CH("CH"),
4240

4241
      @SerializedName("CI")
×
4242
      CI("CI"),
4243

4244
      @SerializedName("CK")
×
4245
      CK("CK"),
4246

4247
      @SerializedName("CL")
×
4248
      CL("CL"),
4249

4250
      @SerializedName("CM")
×
4251
      CM("CM"),
4252

4253
      @SerializedName("CN")
×
4254
      CN("CN"),
4255

4256
      @SerializedName("CO")
×
4257
      CO("CO"),
4258

4259
      @SerializedName("CR")
×
4260
      CR("CR"),
4261

4262
      @SerializedName("CV")
×
4263
      CV("CV"),
4264

4265
      @SerializedName("CW")
×
4266
      CW("CW"),
4267

4268
      @SerializedName("CY")
×
4269
      CY("CY"),
4270

4271
      @SerializedName("CZ")
×
4272
      CZ("CZ"),
4273

4274
      @SerializedName("DE")
×
4275
      DE("DE"),
4276

4277
      @SerializedName("DJ")
×
4278
      DJ("DJ"),
4279

4280
      @SerializedName("DK")
×
4281
      DK("DK"),
4282

4283
      @SerializedName("DM")
×
4284
      DM("DM"),
4285

4286
      @SerializedName("DO")
×
4287
      DO("DO"),
4288

4289
      @SerializedName("DZ")
×
4290
      DZ("DZ"),
4291

4292
      @SerializedName("EC")
×
4293
      EC("EC"),
4294

4295
      @SerializedName("EE")
×
4296
      EE("EE"),
4297

4298
      @SerializedName("EG")
×
4299
      EG("EG"),
4300

4301
      @SerializedName("EH")
×
4302
      EH("EH"),
4303

4304
      @SerializedName("ER")
×
4305
      ER("ER"),
4306

4307
      @SerializedName("ES")
×
4308
      ES("ES"),
4309

4310
      @SerializedName("ET")
×
4311
      ET("ET"),
4312

4313
      @SerializedName("FI")
×
4314
      FI("FI"),
4315

4316
      @SerializedName("FJ")
×
4317
      FJ("FJ"),
4318

4319
      @SerializedName("FK")
×
4320
      FK("FK"),
4321

4322
      @SerializedName("FO")
×
4323
      FO("FO"),
4324

4325
      @SerializedName("FR")
×
4326
      FR("FR"),
4327

4328
      @SerializedName("GA")
×
4329
      GA("GA"),
4330

4331
      @SerializedName("GB")
×
4332
      GB("GB"),
4333

4334
      @SerializedName("GD")
×
4335
      GD("GD"),
4336

4337
      @SerializedName("GE")
×
4338
      GE("GE"),
4339

4340
      @SerializedName("GF")
×
4341
      GF("GF"),
4342

4343
      @SerializedName("GG")
×
4344
      GG("GG"),
4345

4346
      @SerializedName("GH")
×
4347
      GH("GH"),
4348

4349
      @SerializedName("GI")
×
4350
      GI("GI"),
4351

4352
      @SerializedName("GL")
×
4353
      GL("GL"),
4354

4355
      @SerializedName("GM")
×
4356
      GM("GM"),
4357

4358
      @SerializedName("GN")
×
4359
      GN("GN"),
4360

4361
      @SerializedName("GP")
×
4362
      GP("GP"),
4363

4364
      @SerializedName("GQ")
×
4365
      GQ("GQ"),
4366

4367
      @SerializedName("GR")
×
4368
      GR("GR"),
4369

4370
      @SerializedName("GS")
×
4371
      GS("GS"),
4372

4373
      @SerializedName("GT")
×
4374
      GT("GT"),
4375

4376
      @SerializedName("GU")
×
4377
      GU("GU"),
4378

4379
      @SerializedName("GW")
×
4380
      GW("GW"),
4381

4382
      @SerializedName("GY")
×
4383
      GY("GY"),
4384

4385
      @SerializedName("HK")
×
4386
      HK("HK"),
4387

4388
      @SerializedName("HN")
×
4389
      HN("HN"),
4390

4391
      @SerializedName("HR")
×
4392
      HR("HR"),
4393

4394
      @SerializedName("HT")
×
4395
      HT("HT"),
4396

4397
      @SerializedName("HU")
×
4398
      HU("HU"),
4399

4400
      @SerializedName("ID")
×
4401
      ID("ID"),
4402

4403
      @SerializedName("IE")
×
4404
      IE("IE"),
4405

4406
      @SerializedName("IL")
×
4407
      IL("IL"),
4408

4409
      @SerializedName("IM")
×
4410
      IM("IM"),
4411

4412
      @SerializedName("IN")
×
4413
      IN("IN"),
4414

4415
      @SerializedName("IO")
×
4416
      IO("IO"),
4417

4418
      @SerializedName("IQ")
×
4419
      IQ("IQ"),
4420

4421
      @SerializedName("IS")
×
4422
      IS("IS"),
4423

4424
      @SerializedName("IT")
×
4425
      IT("IT"),
4426

4427
      @SerializedName("JE")
×
4428
      JE("JE"),
4429

4430
      @SerializedName("JM")
×
4431
      JM("JM"),
4432

4433
      @SerializedName("JO")
×
4434
      JO("JO"),
4435

4436
      @SerializedName("JP")
×
4437
      JP("JP"),
4438

4439
      @SerializedName("KE")
×
4440
      KE("KE"),
4441

4442
      @SerializedName("KG")
×
4443
      KG("KG"),
4444

4445
      @SerializedName("KH")
×
4446
      KH("KH"),
4447

4448
      @SerializedName("KI")
×
4449
      KI("KI"),
4450

4451
      @SerializedName("KM")
×
4452
      KM("KM"),
4453

4454
      @SerializedName("KN")
×
4455
      KN("KN"),
4456

4457
      @SerializedName("KR")
×
4458
      KR("KR"),
4459

4460
      @SerializedName("KW")
×
4461
      KW("KW"),
4462

4463
      @SerializedName("KY")
×
4464
      KY("KY"),
4465

4466
      @SerializedName("KZ")
×
4467
      KZ("KZ"),
4468

4469
      @SerializedName("LA")
×
4470
      LA("LA"),
4471

4472
      @SerializedName("LB")
×
4473
      LB("LB"),
4474

4475
      @SerializedName("LC")
×
4476
      LC("LC"),
4477

4478
      @SerializedName("LI")
×
4479
      LI("LI"),
4480

4481
      @SerializedName("LK")
×
4482
      LK("LK"),
4483

4484
      @SerializedName("LR")
×
4485
      LR("LR"),
4486

4487
      @SerializedName("LS")
×
4488
      LS("LS"),
4489

4490
      @SerializedName("LT")
×
4491
      LT("LT"),
4492

4493
      @SerializedName("LU")
×
4494
      LU("LU"),
4495

4496
      @SerializedName("LV")
×
4497
      LV("LV"),
4498

4499
      @SerializedName("LY")
×
4500
      LY("LY"),
4501

4502
      @SerializedName("MA")
×
4503
      MA("MA"),
4504

4505
      @SerializedName("MC")
×
4506
      MC("MC"),
4507

4508
      @SerializedName("MD")
×
4509
      MD("MD"),
4510

4511
      @SerializedName("ME")
×
4512
      ME("ME"),
4513

4514
      @SerializedName("MF")
×
4515
      MF("MF"),
4516

4517
      @SerializedName("MG")
×
4518
      MG("MG"),
4519

4520
      @SerializedName("MK")
×
4521
      MK("MK"),
4522

4523
      @SerializedName("ML")
×
4524
      ML("ML"),
4525

4526
      @SerializedName("MM")
×
4527
      MM("MM"),
4528

4529
      @SerializedName("MN")
×
4530
      MN("MN"),
4531

4532
      @SerializedName("MO")
×
4533
      MO("MO"),
4534

4535
      @SerializedName("MQ")
×
4536
      MQ("MQ"),
4537

4538
      @SerializedName("MR")
×
4539
      MR("MR"),
4540

4541
      @SerializedName("MS")
×
4542
      MS("MS"),
4543

4544
      @SerializedName("MT")
×
4545
      MT("MT"),
4546

4547
      @SerializedName("MU")
×
4548
      MU("MU"),
4549

4550
      @SerializedName("MV")
×
4551
      MV("MV"),
4552

4553
      @SerializedName("MW")
×
4554
      MW("MW"),
4555

4556
      @SerializedName("MX")
×
4557
      MX("MX"),
4558

4559
      @SerializedName("MY")
×
4560
      MY("MY"),
4561

4562
      @SerializedName("MZ")
×
4563
      MZ("MZ"),
4564

4565
      @SerializedName("NA")
×
4566
      NA("NA"),
4567

4568
      @SerializedName("NC")
×
4569
      NC("NC"),
4570

4571
      @SerializedName("NE")
×
4572
      NE("NE"),
4573

4574
      @SerializedName("NG")
×
4575
      NG("NG"),
4576

4577
      @SerializedName("NI")
×
4578
      NI("NI"),
4579

4580
      @SerializedName("NL")
×
4581
      NL("NL"),
4582

4583
      @SerializedName("NO")
×
4584
      NO("NO"),
4585

4586
      @SerializedName("NP")
×
4587
      NP("NP"),
4588

4589
      @SerializedName("NR")
×
4590
      NR("NR"),
4591

4592
      @SerializedName("NU")
×
4593
      NU("NU"),
4594

4595
      @SerializedName("NZ")
×
4596
      NZ("NZ"),
4597

4598
      @SerializedName("OM")
×
4599
      OM("OM"),
4600

4601
      @SerializedName("PA")
×
4602
      PA("PA"),
4603

4604
      @SerializedName("PE")
×
4605
      PE("PE"),
4606

4607
      @SerializedName("PF")
×
4608
      PF("PF"),
4609

4610
      @SerializedName("PG")
×
4611
      PG("PG"),
4612

4613
      @SerializedName("PH")
×
4614
      PH("PH"),
4615

4616
      @SerializedName("PK")
×
4617
      PK("PK"),
4618

4619
      @SerializedName("PL")
×
4620
      PL("PL"),
4621

4622
      @SerializedName("PM")
×
4623
      PM("PM"),
4624

4625
      @SerializedName("PN")
×
4626
      PN("PN"),
4627

4628
      @SerializedName("PR")
×
4629
      PR("PR"),
4630

4631
      @SerializedName("PS")
×
4632
      PS("PS"),
4633

4634
      @SerializedName("PT")
×
4635
      PT("PT"),
4636

4637
      @SerializedName("PY")
×
4638
      PY("PY"),
4639

4640
      @SerializedName("QA")
×
4641
      QA("QA"),
4642

4643
      @SerializedName("RE")
×
4644
      RE("RE"),
4645

4646
      @SerializedName("RO")
×
4647
      RO("RO"),
4648

4649
      @SerializedName("RS")
×
4650
      RS("RS"),
4651

4652
      @SerializedName("RU")
×
4653
      RU("RU"),
4654

4655
      @SerializedName("RW")
×
4656
      RW("RW"),
4657

4658
      @SerializedName("SA")
×
4659
      SA("SA"),
4660

4661
      @SerializedName("SB")
×
4662
      SB("SB"),
4663

4664
      @SerializedName("SC")
×
4665
      SC("SC"),
4666

4667
      @SerializedName("SE")
×
4668
      SE("SE"),
4669

4670
      @SerializedName("SG")
×
4671
      SG("SG"),
4672

4673
      @SerializedName("SH")
×
4674
      SH("SH"),
4675

4676
      @SerializedName("SI")
×
4677
      SI("SI"),
4678

4679
      @SerializedName("SJ")
×
4680
      SJ("SJ"),
4681

4682
      @SerializedName("SK")
×
4683
      SK("SK"),
4684

4685
      @SerializedName("SL")
×
4686
      SL("SL"),
4687

4688
      @SerializedName("SM")
×
4689
      SM("SM"),
4690

4691
      @SerializedName("SN")
×
4692
      SN("SN"),
4693

4694
      @SerializedName("SO")
×
4695
      SO("SO"),
4696

4697
      @SerializedName("SR")
×
4698
      SR("SR"),
4699

4700
      @SerializedName("SS")
×
4701
      SS("SS"),
4702

4703
      @SerializedName("ST")
×
4704
      ST("ST"),
4705

4706
      @SerializedName("SV")
×
4707
      SV("SV"),
4708

4709
      @SerializedName("SX")
×
4710
      SX("SX"),
4711

4712
      @SerializedName("SZ")
×
4713
      SZ("SZ"),
4714

4715
      @SerializedName("TA")
×
4716
      TA("TA"),
4717

4718
      @SerializedName("TC")
×
4719
      TC("TC"),
4720

4721
      @SerializedName("TD")
×
4722
      TD("TD"),
4723

4724
      @SerializedName("TF")
×
4725
      TF("TF"),
4726

4727
      @SerializedName("TG")
×
4728
      TG("TG"),
4729

4730
      @SerializedName("TH")
×
4731
      TH("TH"),
4732

4733
      @SerializedName("TJ")
×
4734
      TJ("TJ"),
4735

4736
      @SerializedName("TK")
×
4737
      TK("TK"),
4738

4739
      @SerializedName("TL")
×
4740
      TL("TL"),
4741

4742
      @SerializedName("TM")
×
4743
      TM("TM"),
4744

4745
      @SerializedName("TN")
×
4746
      TN("TN"),
4747

4748
      @SerializedName("TO")
×
4749
      TO("TO"),
4750

4751
      @SerializedName("TR")
×
4752
      TR("TR"),
4753

4754
      @SerializedName("TT")
×
4755
      TT("TT"),
4756

4757
      @SerializedName("TV")
×
4758
      TV("TV"),
4759

4760
      @SerializedName("TW")
×
4761
      TW("TW"),
4762

4763
      @SerializedName("TZ")
×
4764
      TZ("TZ"),
4765

4766
      @SerializedName("UA")
×
4767
      UA("UA"),
4768

4769
      @SerializedName("UG")
×
4770
      UG("UG"),
4771

4772
      @SerializedName("US")
×
4773
      US("US"),
4774

4775
      @SerializedName("UY")
×
4776
      UY("UY"),
4777

4778
      @SerializedName("UZ")
×
4779
      UZ("UZ"),
4780

4781
      @SerializedName("VA")
×
4782
      VA("VA"),
4783

4784
      @SerializedName("VC")
×
4785
      VC("VC"),
4786

4787
      @SerializedName("VE")
×
4788
      VE("VE"),
4789

4790
      @SerializedName("VG")
×
4791
      VG("VG"),
4792

4793
      @SerializedName("VN")
×
4794
      VN("VN"),
4795

4796
      @SerializedName("VU")
×
4797
      VU("VU"),
4798

4799
      @SerializedName("WF")
×
4800
      WF("WF"),
4801

4802
      @SerializedName("WS")
×
4803
      WS("WS"),
4804

4805
      @SerializedName("XK")
×
4806
      XK("XK"),
4807

4808
      @SerializedName("YE")
×
4809
      YE("YE"),
4810

4811
      @SerializedName("YT")
×
4812
      YT("YT"),
4813

4814
      @SerializedName("ZA")
×
4815
      ZA("ZA"),
4816

4817
      @SerializedName("ZM")
×
4818
      ZM("ZM"),
4819

4820
      @SerializedName("ZW")
×
4821
      ZW("ZW"),
4822

4823
      @SerializedName("ZZ")
×
4824
      ZZ("ZZ");
4825

4826
      @Getter(onMethod_ = {@Override})
4827
      private final String value;
4828

4829
      AllowedCountry(String value) {
×
4830
        this.value = value;
×
4831
      }
×
4832
    }
4833
  }
4834

4835
  @Getter
4836
  public static class ShippingOption {
4837
    /**
4838
     * Map of extra parameters for custom features not available in this client library. The content
4839
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4840
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4841
     * param object. Effectively, this map is flattened to its parent instance.
4842
     */
4843
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4844
    Map<String, Object> extraParams;
4845

4846
    /** The ID of the Shipping Rate to use for this shipping option. */
4847
    @SerializedName("shipping_rate")
4848
    String shippingRate;
4849

4850
    private ShippingOption(Map<String, Object> extraParams, String shippingRate) {
×
4851
      this.extraParams = extraParams;
×
4852
      this.shippingRate = shippingRate;
×
4853
    }
×
4854

4855
    public static Builder builder() {
4856
      return new Builder();
×
4857
    }
4858

4859
    public static class Builder {
×
4860
      private Map<String, Object> extraParams;
4861

4862
      private String shippingRate;
4863

4864
      /** Finalize and obtain parameter instance from this builder. */
4865
      public PaymentLinkCreateParams.ShippingOption build() {
4866
        return new PaymentLinkCreateParams.ShippingOption(this.extraParams, this.shippingRate);
×
4867
      }
4868

4869
      /**
4870
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4871
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4872
       * PaymentLinkCreateParams.ShippingOption#extraParams} for the field documentation.
4873
       */
4874
      public Builder putExtraParam(String key, Object value) {
4875
        if (this.extraParams == null) {
×
4876
          this.extraParams = new HashMap<>();
×
4877
        }
4878
        this.extraParams.put(key, value);
×
4879
        return this;
×
4880
      }
4881

4882
      /**
4883
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4884
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4885
       * See {@link PaymentLinkCreateParams.ShippingOption#extraParams} for the field documentation.
4886
       */
4887
      public Builder putAllExtraParam(Map<String, Object> map) {
4888
        if (this.extraParams == null) {
×
4889
          this.extraParams = new HashMap<>();
×
4890
        }
4891
        this.extraParams.putAll(map);
×
4892
        return this;
×
4893
      }
4894

4895
      /** The ID of the Shipping Rate to use for this shipping option. */
4896
      public Builder setShippingRate(String shippingRate) {
4897
        this.shippingRate = shippingRate;
×
4898
        return this;
×
4899
      }
4900
    }
4901
  }
4902

4903
  @Getter
4904
  public static class SubscriptionData {
4905
    /**
4906
     * The subscription's description, meant to be displayable to the customer. Use this field to
4907
     * optionally store an explanation of the subscription for rendering in Stripe surfaces and
4908
     * certain local payment methods UIs.
4909
     */
4910
    @SerializedName("description")
4911
    String description;
4912

4913
    /**
4914
     * Map of extra parameters for custom features not available in this client library. The content
4915
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4916
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4917
     * param object. Effectively, this map is flattened to its parent instance.
4918
     */
4919
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4920
    Map<String, Object> extraParams;
4921

4922
    /** All invoices will be billed using the specified settings. */
4923
    @SerializedName("invoice_settings")
4924
    InvoiceSettings invoiceSettings;
4925

4926
    /**
4927
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
4928
     * declaratively set metadata on <a
4929
     * href="https://stripe.com/docs/api/subscriptions">Subscriptions</a> generated from this
4930
     * payment link. Unlike object-level metadata, this field is declarative. Updates will clear
4931
     * prior values.
4932
     */
4933
    @SerializedName("metadata")
4934
    Map<String, String> metadata;
4935

4936
    /**
4937
     * Integer representing the number of trial period days before the customer is charged for the
4938
     * first time. Has to be at least 1.
4939
     */
4940
    @SerializedName("trial_period_days")
4941
    Long trialPeriodDays;
4942

4943
    /** Settings related to subscription trials. */
4944
    @SerializedName("trial_settings")
4945
    TrialSettings trialSettings;
4946

4947
    private SubscriptionData(
4948
        String description,
4949
        Map<String, Object> extraParams,
4950
        InvoiceSettings invoiceSettings,
4951
        Map<String, String> metadata,
4952
        Long trialPeriodDays,
4953
        TrialSettings trialSettings) {
×
4954
      this.description = description;
×
4955
      this.extraParams = extraParams;
×
4956
      this.invoiceSettings = invoiceSettings;
×
4957
      this.metadata = metadata;
×
4958
      this.trialPeriodDays = trialPeriodDays;
×
4959
      this.trialSettings = trialSettings;
×
4960
    }
×
4961

4962
    public static Builder builder() {
4963
      return new Builder();
×
4964
    }
4965

4966
    public static class Builder {
×
4967
      private String description;
4968

4969
      private Map<String, Object> extraParams;
4970

4971
      private InvoiceSettings invoiceSettings;
4972

4973
      private Map<String, String> metadata;
4974

4975
      private Long trialPeriodDays;
4976

4977
      private TrialSettings trialSettings;
4978

4979
      /** Finalize and obtain parameter instance from this builder. */
4980
      public PaymentLinkCreateParams.SubscriptionData build() {
4981
        return new PaymentLinkCreateParams.SubscriptionData(
×
4982
            this.description,
4983
            this.extraParams,
4984
            this.invoiceSettings,
4985
            this.metadata,
4986
            this.trialPeriodDays,
4987
            this.trialSettings);
4988
      }
4989

4990
      /**
4991
       * The subscription's description, meant to be displayable to the customer. Use this field to
4992
       * optionally store an explanation of the subscription for rendering in Stripe surfaces and
4993
       * certain local payment methods UIs.
4994
       */
4995
      public Builder setDescription(String description) {
4996
        this.description = description;
×
4997
        return this;
×
4998
      }
4999

5000
      /**
5001
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5002
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5003
       * PaymentLinkCreateParams.SubscriptionData#extraParams} for the field documentation.
5004
       */
5005
      public Builder putExtraParam(String key, Object value) {
5006
        if (this.extraParams == null) {
×
5007
          this.extraParams = new HashMap<>();
×
5008
        }
5009
        this.extraParams.put(key, value);
×
5010
        return this;
×
5011
      }
5012

5013
      /**
5014
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5015
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5016
       * See {@link PaymentLinkCreateParams.SubscriptionData#extraParams} for the field
5017
       * documentation.
5018
       */
5019
      public Builder putAllExtraParam(Map<String, Object> map) {
5020
        if (this.extraParams == null) {
×
5021
          this.extraParams = new HashMap<>();
×
5022
        }
5023
        this.extraParams.putAll(map);
×
5024
        return this;
×
5025
      }
5026

5027
      /** All invoices will be billed using the specified settings. */
5028
      public Builder setInvoiceSettings(
5029
          PaymentLinkCreateParams.SubscriptionData.InvoiceSettings invoiceSettings) {
5030
        this.invoiceSettings = invoiceSettings;
×
5031
        return this;
×
5032
      }
5033

5034
      /**
5035
       * Add a key/value pair to `metadata` 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
       * PaymentLinkCreateParams.SubscriptionData#metadata} for the field documentation.
5038
       */
5039
      public Builder putMetadata(String key, String value) {
5040
        if (this.metadata == null) {
×
5041
          this.metadata = new HashMap<>();
×
5042
        }
5043
        this.metadata.put(key, value);
×
5044
        return this;
×
5045
      }
5046

5047
      /**
5048
       * Add all map key/value pairs to `metadata` 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 PaymentLinkCreateParams.SubscriptionData#metadata} for the field documentation.
5051
       */
5052
      public Builder putAllMetadata(Map<String, String> map) {
5053
        if (this.metadata == null) {
×
5054
          this.metadata = new HashMap<>();
×
5055
        }
5056
        this.metadata.putAll(map);
×
5057
        return this;
×
5058
      }
5059

5060
      /**
5061
       * Integer representing the number of trial period days before the customer is charged for the
5062
       * first time. Has to be at least 1.
5063
       */
5064
      public Builder setTrialPeriodDays(Long trialPeriodDays) {
5065
        this.trialPeriodDays = trialPeriodDays;
×
5066
        return this;
×
5067
      }
5068

5069
      /** Settings related to subscription trials. */
5070
      public Builder setTrialSettings(
5071
          PaymentLinkCreateParams.SubscriptionData.TrialSettings trialSettings) {
5072
        this.trialSettings = trialSettings;
×
5073
        return this;
×
5074
      }
5075
    }
5076

5077
    @Getter
5078
    public static class InvoiceSettings {
5079
      /**
5080
       * Map of extra parameters for custom features not available in this client library. The
5081
       * content in this map is not serialized under this field's {@code @SerializedName} value.
5082
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
5083
       * name in this param object. Effectively, this map is flattened to its parent instance.
5084
       */
5085
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5086
      Map<String, Object> extraParams;
5087

5088
      /**
5089
       * The connected account that issues the invoice. The invoice is presented with the branding
5090
       * and support information of the specified account.
5091
       */
5092
      @SerializedName("issuer")
5093
      Issuer issuer;
5094

5095
      private InvoiceSettings(Map<String, Object> extraParams, Issuer issuer) {
×
5096
        this.extraParams = extraParams;
×
5097
        this.issuer = issuer;
×
5098
      }
×
5099

5100
      public static Builder builder() {
5101
        return new Builder();
×
5102
      }
5103

5104
      public static class Builder {
×
5105
        private Map<String, Object> extraParams;
5106

5107
        private Issuer issuer;
5108

5109
        /** Finalize and obtain parameter instance from this builder. */
5110
        public PaymentLinkCreateParams.SubscriptionData.InvoiceSettings build() {
5111
          return new PaymentLinkCreateParams.SubscriptionData.InvoiceSettings(
×
5112
              this.extraParams, this.issuer);
5113
        }
5114

5115
        /**
5116
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
5117
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5118
         * map. See {@link PaymentLinkCreateParams.SubscriptionData.InvoiceSettings#extraParams} for
5119
         * the field documentation.
5120
         */
5121
        public Builder putExtraParam(String key, Object value) {
5122
          if (this.extraParams == null) {
×
5123
            this.extraParams = new HashMap<>();
×
5124
          }
5125
          this.extraParams.put(key, value);
×
5126
          return this;
×
5127
        }
5128

5129
        /**
5130
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5131
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5132
         * map. See {@link PaymentLinkCreateParams.SubscriptionData.InvoiceSettings#extraParams} for
5133
         * the field documentation.
5134
         */
5135
        public Builder putAllExtraParam(Map<String, Object> map) {
5136
          if (this.extraParams == null) {
×
5137
            this.extraParams = new HashMap<>();
×
5138
          }
5139
          this.extraParams.putAll(map);
×
5140
          return this;
×
5141
        }
5142

5143
        /**
5144
         * The connected account that issues the invoice. The invoice is presented with the branding
5145
         * and support information of the specified account.
5146
         */
5147
        public Builder setIssuer(
5148
            PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer issuer) {
5149
          this.issuer = issuer;
×
5150
          return this;
×
5151
        }
5152
      }
5153

5154
      @Getter
5155
      public static class Issuer {
5156
        /** The connected account being referenced when {@code type} is {@code account}. */
5157
        @SerializedName("account")
5158
        String account;
5159

5160
        /**
5161
         * Map of extra parameters for custom features not available in this client library. The
5162
         * content in this map is not serialized under this field's {@code @SerializedName} value.
5163
         * Instead, each key/value pair is serialized as if the key is a root-level field
5164
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
5165
         * instance.
5166
         */
5167
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5168
        Map<String, Object> extraParams;
5169

5170
        /** <strong>Required.</strong> Type of the account referenced in the request. */
5171
        @SerializedName("type")
5172
        Type type;
5173

5174
        private Issuer(String account, Map<String, Object> extraParams, Type type) {
×
5175
          this.account = account;
×
5176
          this.extraParams = extraParams;
×
5177
          this.type = type;
×
5178
        }
×
5179

5180
        public static Builder builder() {
5181
          return new Builder();
×
5182
        }
5183

5184
        public static class Builder {
×
5185
          private String account;
5186

5187
          private Map<String, Object> extraParams;
5188

5189
          private Type type;
5190

5191
          /** Finalize and obtain parameter instance from this builder. */
5192
          public PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer build() {
5193
            return new PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer(
×
5194
                this.account, this.extraParams, this.type);
5195
          }
5196

5197
          /** The connected account being referenced when {@code type} is {@code account}. */
5198
          public Builder setAccount(String account) {
5199
            this.account = account;
×
5200
            return this;
×
5201
          }
5202

5203
          /**
5204
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
5205
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5206
           * map. See {@link
5207
           * PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer#extraParams} for the
5208
           * field documentation.
5209
           */
5210
          public Builder putExtraParam(String key, Object value) {
5211
            if (this.extraParams == null) {
×
5212
              this.extraParams = new HashMap<>();
×
5213
            }
5214
            this.extraParams.put(key, value);
×
5215
            return this;
×
5216
          }
5217

5218
          /**
5219
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5220
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5221
           * map. See {@link
5222
           * PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer#extraParams} for the
5223
           * field documentation.
5224
           */
5225
          public Builder putAllExtraParam(Map<String, Object> map) {
5226
            if (this.extraParams == null) {
×
5227
              this.extraParams = new HashMap<>();
×
5228
            }
5229
            this.extraParams.putAll(map);
×
5230
            return this;
×
5231
          }
5232

5233
          /** <strong>Required.</strong> Type of the account referenced in the request. */
5234
          public Builder setType(
5235
              PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer.Type type) {
5236
            this.type = type;
×
5237
            return this;
×
5238
          }
5239
        }
5240

5241
        public enum Type implements ApiRequestParams.EnumParam {
×
5242
          @SerializedName("account")
×
5243
          ACCOUNT("account"),
5244

5245
          @SerializedName("self")
×
5246
          SELF("self");
5247

5248
          @Getter(onMethod_ = {@Override})
5249
          private final String value;
5250

5251
          Type(String value) {
×
5252
            this.value = value;
×
5253
          }
×
5254
        }
5255
      }
5256
    }
5257

5258
    @Getter
5259
    public static class TrialSettings {
5260
      /**
5261
       * <strong>Required.</strong> Defines how the subscription should behave when the user's free
5262
       * trial ends.
5263
       */
5264
      @SerializedName("end_behavior")
5265
      EndBehavior endBehavior;
5266

5267
      /**
5268
       * Map of extra parameters for custom features not available in this client library. The
5269
       * content in this map is not serialized under this field's {@code @SerializedName} value.
5270
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
5271
       * name in this param object. Effectively, this map is flattened to its parent instance.
5272
       */
5273
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5274
      Map<String, Object> extraParams;
5275

5276
      private TrialSettings(EndBehavior endBehavior, Map<String, Object> extraParams) {
×
5277
        this.endBehavior = endBehavior;
×
5278
        this.extraParams = extraParams;
×
5279
      }
×
5280

5281
      public static Builder builder() {
5282
        return new Builder();
×
5283
      }
5284

5285
      public static class Builder {
×
5286
        private EndBehavior endBehavior;
5287

5288
        private Map<String, Object> extraParams;
5289

5290
        /** Finalize and obtain parameter instance from this builder. */
5291
        public PaymentLinkCreateParams.SubscriptionData.TrialSettings build() {
5292
          return new PaymentLinkCreateParams.SubscriptionData.TrialSettings(
×
5293
              this.endBehavior, this.extraParams);
5294
        }
5295

5296
        /**
5297
         * <strong>Required.</strong> Defines how the subscription should behave when the user's
5298
         * free trial ends.
5299
         */
5300
        public Builder setEndBehavior(
5301
            PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior endBehavior) {
5302
          this.endBehavior = endBehavior;
×
5303
          return this;
×
5304
        }
5305

5306
        /**
5307
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
5308
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5309
         * map. See {@link PaymentLinkCreateParams.SubscriptionData.TrialSettings#extraParams} for
5310
         * the field documentation.
5311
         */
5312
        public Builder putExtraParam(String key, Object value) {
5313
          if (this.extraParams == null) {
×
5314
            this.extraParams = new HashMap<>();
×
5315
          }
5316
          this.extraParams.put(key, value);
×
5317
          return this;
×
5318
        }
5319

5320
        /**
5321
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5322
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5323
         * map. See {@link PaymentLinkCreateParams.SubscriptionData.TrialSettings#extraParams} for
5324
         * the field documentation.
5325
         */
5326
        public Builder putAllExtraParam(Map<String, Object> map) {
5327
          if (this.extraParams == null) {
×
5328
            this.extraParams = new HashMap<>();
×
5329
          }
5330
          this.extraParams.putAll(map);
×
5331
          return this;
×
5332
        }
5333
      }
5334

5335
      @Getter
5336
      public static class EndBehavior {
5337
        /**
5338
         * Map of extra parameters for custom features not available in this client library. The
5339
         * content in this map is not serialized under this field's {@code @SerializedName} value.
5340
         * Instead, each key/value pair is serialized as if the key is a root-level field
5341
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
5342
         * instance.
5343
         */
5344
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5345
        Map<String, Object> extraParams;
5346

5347
        /**
5348
         * <strong>Required.</strong> Indicates how the subscription should change when the trial
5349
         * ends if the user did not provide a payment method.
5350
         */
5351
        @SerializedName("missing_payment_method")
5352
        MissingPaymentMethod missingPaymentMethod;
5353

5354
        private EndBehavior(
5355
            Map<String, Object> extraParams, MissingPaymentMethod missingPaymentMethod) {
×
5356
          this.extraParams = extraParams;
×
5357
          this.missingPaymentMethod = missingPaymentMethod;
×
5358
        }
×
5359

5360
        public static Builder builder() {
5361
          return new Builder();
×
5362
        }
5363

5364
        public static class Builder {
×
5365
          private Map<String, Object> extraParams;
5366

5367
          private MissingPaymentMethod missingPaymentMethod;
5368

5369
          /** Finalize and obtain parameter instance from this builder. */
5370
          public PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior build() {
5371
            return new PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior(
×
5372
                this.extraParams, this.missingPaymentMethod);
5373
          }
5374

5375
          /**
5376
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
5377
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5378
           * map. See {@link
5379
           * PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior#extraParams} for the
5380
           * field documentation.
5381
           */
5382
          public Builder putExtraParam(String key, Object value) {
5383
            if (this.extraParams == null) {
×
5384
              this.extraParams = new HashMap<>();
×
5385
            }
5386
            this.extraParams.put(key, value);
×
5387
            return this;
×
5388
          }
5389

5390
          /**
5391
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5392
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5393
           * map. See {@link
5394
           * PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior#extraParams} for the
5395
           * field documentation.
5396
           */
5397
          public Builder putAllExtraParam(Map<String, Object> map) {
5398
            if (this.extraParams == null) {
×
5399
              this.extraParams = new HashMap<>();
×
5400
            }
5401
            this.extraParams.putAll(map);
×
5402
            return this;
×
5403
          }
5404

5405
          /**
5406
           * <strong>Required.</strong> Indicates how the subscription should change when the trial
5407
           * ends if the user did not provide a payment method.
5408
           */
5409
          public Builder setMissingPaymentMethod(
5410
              PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior
5411
                      .MissingPaymentMethod
5412
                  missingPaymentMethod) {
5413
            this.missingPaymentMethod = missingPaymentMethod;
×
5414
            return this;
×
5415
          }
5416
        }
5417

5418
        public enum MissingPaymentMethod implements ApiRequestParams.EnumParam {
×
5419
          @SerializedName("cancel")
×
5420
          CANCEL("cancel"),
5421

5422
          @SerializedName("create_invoice")
×
5423
          CREATE_INVOICE("create_invoice"),
5424

5425
          @SerializedName("pause")
×
5426
          PAUSE("pause");
5427

5428
          @Getter(onMethod_ = {@Override})
5429
          private final String value;
5430

5431
          MissingPaymentMethod(String value) {
×
5432
            this.value = value;
×
5433
          }
×
5434
        }
5435
      }
5436
    }
5437
  }
5438

5439
  @Getter
5440
  public static class TaxIdCollection {
5441
    /**
5442
     * <strong>Required.</strong> Enable tax ID collection during checkout. Defaults to {@code
5443
     * false}.
5444
     */
5445
    @SerializedName("enabled")
5446
    Boolean enabled;
5447

5448
    /**
5449
     * Map of extra parameters for custom features not available in this client library. The content
5450
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5451
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5452
     * param object. Effectively, this map is flattened to its parent instance.
5453
     */
5454
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5455
    Map<String, Object> extraParams;
5456

5457
    /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */
5458
    @SerializedName("required")
5459
    Required required;
5460

5461
    private TaxIdCollection(Boolean enabled, Map<String, Object> extraParams, Required required) {
×
5462
      this.enabled = enabled;
×
5463
      this.extraParams = extraParams;
×
5464
      this.required = required;
×
5465
    }
×
5466

5467
    public static Builder builder() {
5468
      return new Builder();
×
5469
    }
5470

5471
    public static class Builder {
×
5472
      private Boolean enabled;
5473

5474
      private Map<String, Object> extraParams;
5475

5476
      private Required required;
5477

5478
      /** Finalize and obtain parameter instance from this builder. */
5479
      public PaymentLinkCreateParams.TaxIdCollection build() {
5480
        return new PaymentLinkCreateParams.TaxIdCollection(
×
5481
            this.enabled, this.extraParams, this.required);
5482
      }
5483

5484
      /**
5485
       * <strong>Required.</strong> Enable tax ID collection during checkout. Defaults to {@code
5486
       * false}.
5487
       */
5488
      public Builder setEnabled(Boolean enabled) {
5489
        this.enabled = enabled;
×
5490
        return this;
×
5491
      }
5492

5493
      /**
5494
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5495
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5496
       * PaymentLinkCreateParams.TaxIdCollection#extraParams} for the field documentation.
5497
       */
5498
      public Builder putExtraParam(String key, Object value) {
5499
        if (this.extraParams == null) {
×
5500
          this.extraParams = new HashMap<>();
×
5501
        }
5502
        this.extraParams.put(key, value);
×
5503
        return this;
×
5504
      }
5505

5506
      /**
5507
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5508
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5509
       * See {@link PaymentLinkCreateParams.TaxIdCollection#extraParams} for the field
5510
       * documentation.
5511
       */
5512
      public Builder putAllExtraParam(Map<String, Object> map) {
5513
        if (this.extraParams == null) {
×
5514
          this.extraParams = new HashMap<>();
×
5515
        }
5516
        this.extraParams.putAll(map);
×
5517
        return this;
×
5518
      }
5519

5520
      /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */
5521
      public Builder setRequired(PaymentLinkCreateParams.TaxIdCollection.Required required) {
5522
        this.required = required;
×
5523
        return this;
×
5524
      }
5525
    }
5526

5527
    public enum Required implements ApiRequestParams.EnumParam {
×
5528
      @SerializedName("if_supported")
×
5529
      IF_SUPPORTED("if_supported"),
5530

5531
      @SerializedName("never")
×
5532
      NEVER("never");
5533

5534
      @Getter(onMethod_ = {@Override})
5535
      private final String value;
5536

5537
      Required(String value) {
×
5538
        this.value = value;
×
5539
      }
×
5540
    }
5541
  }
5542

5543
  @Getter
5544
  public static class TransferData {
5545
    /** The amount that will be transferred automatically when a charge succeeds. */
5546
    @SerializedName("amount")
5547
    Long amount;
5548

5549
    /**
5550
     * <strong>Required.</strong> If specified, successful charges will be attributed to the
5551
     * destination account for tax reporting, and the funds from charges will be transferred to the
5552
     * destination account. The ID of the resulting transfer will be returned on the successful
5553
     * charge's {@code transfer} field.
5554
     */
5555
    @SerializedName("destination")
5556
    String destination;
5557

5558
    /**
5559
     * Map of extra parameters for custom features not available in this client library. The content
5560
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5561
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5562
     * param object. Effectively, this map is flattened to its parent instance.
5563
     */
5564
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5565
    Map<String, Object> extraParams;
5566

5567
    private TransferData(Long amount, String destination, Map<String, Object> extraParams) {
×
5568
      this.amount = amount;
×
5569
      this.destination = destination;
×
5570
      this.extraParams = extraParams;
×
5571
    }
×
5572

5573
    public static Builder builder() {
5574
      return new Builder();
×
5575
    }
5576

5577
    public static class Builder {
×
5578
      private Long amount;
5579

5580
      private String destination;
5581

5582
      private Map<String, Object> extraParams;
5583

5584
      /** Finalize and obtain parameter instance from this builder. */
5585
      public PaymentLinkCreateParams.TransferData build() {
5586
        return new PaymentLinkCreateParams.TransferData(
×
5587
            this.amount, this.destination, this.extraParams);
5588
      }
5589

5590
      /** The amount that will be transferred automatically when a charge succeeds. */
5591
      public Builder setAmount(Long amount) {
5592
        this.amount = amount;
×
5593
        return this;
×
5594
      }
5595

5596
      /**
5597
       * <strong>Required.</strong> If specified, successful charges will be attributed to the
5598
       * destination account for tax reporting, and the funds from charges will be transferred to
5599
       * the destination account. The ID of the resulting transfer will be returned on the
5600
       * successful charge's {@code transfer} field.
5601
       */
5602
      public Builder setDestination(String destination) {
5603
        this.destination = destination;
×
5604
        return this;
×
5605
      }
5606

5607
      /**
5608
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5609
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5610
       * PaymentLinkCreateParams.TransferData#extraParams} for the field documentation.
5611
       */
5612
      public Builder putExtraParam(String key, Object value) {
5613
        if (this.extraParams == null) {
×
5614
          this.extraParams = new HashMap<>();
×
5615
        }
5616
        this.extraParams.put(key, value);
×
5617
        return this;
×
5618
      }
5619

5620
      /**
5621
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5622
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5623
       * See {@link PaymentLinkCreateParams.TransferData#extraParams} for the field documentation.
5624
       */
5625
      public Builder putAllExtraParam(Map<String, Object> map) {
5626
        if (this.extraParams == null) {
×
5627
          this.extraParams = new HashMap<>();
×
5628
        }
5629
        this.extraParams.putAll(map);
×
5630
        return this;
×
5631
      }
5632
    }
5633
  }
5634

5635
  public enum BillingAddressCollection implements ApiRequestParams.EnumParam {
×
5636
    @SerializedName("auto")
×
5637
    AUTO("auto"),
5638

5639
    @SerializedName("required")
×
5640
    REQUIRED("required");
5641

5642
    @Getter(onMethod_ = {@Override})
5643
    private final String value;
5644

5645
    BillingAddressCollection(String value) {
×
5646
      this.value = value;
×
5647
    }
×
5648
  }
5649

5650
  public enum CustomerCreation implements ApiRequestParams.EnumParam {
×
5651
    @SerializedName("always")
×
5652
    ALWAYS("always"),
5653

5654
    @SerializedName("if_required")
×
5655
    IF_REQUIRED("if_required");
5656

5657
    @Getter(onMethod_ = {@Override})
5658
    private final String value;
5659

5660
    CustomerCreation(String value) {
×
5661
      this.value = value;
×
5662
    }
×
5663
  }
5664

5665
  public enum PaymentMethodCollection implements ApiRequestParams.EnumParam {
×
5666
    @SerializedName("always")
×
5667
    ALWAYS("always"),
5668

5669
    @SerializedName("if_required")
×
5670
    IF_REQUIRED("if_required");
5671

5672
    @Getter(onMethod_ = {@Override})
5673
    private final String value;
5674

5675
    PaymentMethodCollection(String value) {
×
5676
      this.value = value;
×
5677
    }
×
5678
  }
5679

5680
  public enum PaymentMethodType implements ApiRequestParams.EnumParam {
×
5681
    @SerializedName("affirm")
×
5682
    AFFIRM("affirm"),
5683

5684
    @SerializedName("afterpay_clearpay")
×
5685
    AFTERPAY_CLEARPAY("afterpay_clearpay"),
5686

5687
    @SerializedName("alipay")
×
5688
    ALIPAY("alipay"),
5689

NEW
5690
    @SerializedName("alma")
×
5691
    ALMA("alma"),
5692

UNCOV
5693
    @SerializedName("au_becs_debit")
×
5694
    AU_BECS_DEBIT("au_becs_debit"),
5695

5696
    @SerializedName("bacs_debit")
×
5697
    BACS_DEBIT("bacs_debit"),
5698

5699
    @SerializedName("bancontact")
×
5700
    BANCONTACT("bancontact"),
5701

5702
    @SerializedName("blik")
×
5703
    BLIK("blik"),
5704

5705
    @SerializedName("boleto")
×
5706
    BOLETO("boleto"),
5707

5708
    @SerializedName("card")
×
5709
    CARD("card"),
5710

5711
    @SerializedName("cashapp")
×
5712
    CASHAPP("cashapp"),
5713

5714
    @SerializedName("eps")
×
5715
    EPS("eps"),
5716

5717
    @SerializedName("fpx")
×
5718
    FPX("fpx"),
5719

5720
    @SerializedName("giropay")
×
5721
    GIROPAY("giropay"),
5722

NEW
5723
    @SerializedName("gopay")
×
5724
    GOPAY("gopay"),
5725

UNCOV
5726
    @SerializedName("grabpay")
×
5727
    GRABPAY("grabpay"),
5728

5729
    @SerializedName("ideal")
×
5730
    IDEAL("ideal"),
5731

5732
    @SerializedName("klarna")
×
5733
    KLARNA("klarna"),
5734

5735
    @SerializedName("konbini")
×
5736
    KONBINI("konbini"),
5737

5738
    @SerializedName("link")
×
5739
    LINK("link"),
5740

5741
    @SerializedName("mb_way")
×
5742
    MB_WAY("mb_way"),
5743

5744
    @SerializedName("mobilepay")
×
5745
    MOBILEPAY("mobilepay"),
5746

5747
    @SerializedName("multibanco")
×
5748
    MULTIBANCO("multibanco"),
5749

5750
    @SerializedName("oxxo")
×
5751
    OXXO("oxxo"),
5752

5753
    @SerializedName("p24")
×
5754
    P24("p24"),
5755

5756
    @SerializedName("paynow")
×
5757
    PAYNOW("paynow"),
5758

5759
    @SerializedName("paypal")
×
5760
    PAYPAL("paypal"),
5761

5762
    @SerializedName("payto")
×
5763
    PAYTO("payto"),
5764

5765
    @SerializedName("pix")
×
5766
    PIX("pix"),
5767

5768
    @SerializedName("promptpay")
×
5769
    PROMPTPAY("promptpay"),
5770

NEW
5771
    @SerializedName("qris")
×
5772
    QRIS("qris"),
5773

UNCOV
5774
    @SerializedName("rechnung")
×
5775
    RECHNUNG("rechnung"),
5776

5777
    @SerializedName("sepa_debit")
×
5778
    SEPA_DEBIT("sepa_debit"),
5779

NEW
5780
    @SerializedName("shopeepay")
×
5781
    SHOPEEPAY("shopeepay"),
5782

UNCOV
5783
    @SerializedName("sofort")
×
5784
    SOFORT("sofort"),
5785

5786
    @SerializedName("swish")
×
5787
    SWISH("swish"),
5788

5789
    @SerializedName("twint")
×
5790
    TWINT("twint"),
5791

5792
    @SerializedName("us_bank_account")
×
5793
    US_BANK_ACCOUNT("us_bank_account"),
5794

5795
    @SerializedName("wechat_pay")
×
5796
    WECHAT_PAY("wechat_pay"),
5797

5798
    @SerializedName("zip")
×
5799
    ZIP("zip");
5800

5801
    @Getter(onMethod_ = {@Override})
5802
    private final String value;
5803

5804
    PaymentMethodType(String value) {
×
5805
      this.value = value;
×
5806
    }
×
5807
  }
5808

5809
  public enum SubmitType implements ApiRequestParams.EnumParam {
×
5810
    @SerializedName("auto")
×
5811
    AUTO("auto"),
5812

5813
    @SerializedName("book")
×
5814
    BOOK("book"),
5815

5816
    @SerializedName("donate")
×
5817
    DONATE("donate"),
5818

5819
    @SerializedName("pay")
×
5820
    PAY("pay");
5821

5822
    @Getter(onMethod_ = {@Override})
5823
    private final String value;
5824

5825
    SubmitType(String value) {
×
5826
      this.value = value;
×
5827
    }
×
5828
  }
5829
}
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