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

stripe / stripe-java / #16644

14 Nov 2024 11:58PM UTC coverage: 12.414% (-0.005%) from 12.419%
#16644

push

github

web-flow
Update generated code for beta (#1922)

* Update generated code for v1334

* Update generated code for v1335

* Update generated code for v1337

* Update generated code for v1339

* Update generated code for v1340

* Update generated code for v1343

* Update generated code for v1345

* Update generated code for v1346

* Update generated code for v1347

* Update generated code for v1348

* Update generated code for v1349

* Update generated code for v1350

* Update generated code for v1352

* Update generated code for v1353

* Update generated code for v1356

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

2 of 79 new or added lines in 17 files covered. (2.53%)

1 existing line in 1 file now uncovered.

18857 of 151907 relevant lines covered (12.41%)

0.12 hits per line

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

3.69
/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.
4019
     */
4020
    @SerializedName("allowed_countries")
4021
    List<PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry> allowedCountries;
4022

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

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

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

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

4047
      private Map<String, Object> extraParams;
4048

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4861
      private String shippingRate;
4862

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

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

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

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

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

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

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

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

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

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

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

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

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

4968
      private Map<String, Object> extraParams;
4969

4970
      private InvoiceSettings invoiceSettings;
4971

4972
      private Map<String, String> metadata;
4973

4974
      private Long trialPeriodDays;
4975

4976
      private TrialSettings trialSettings;
4977

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5106
        private Issuer issuer;
5107

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

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

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

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

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

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

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

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

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

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

5186
          private Map<String, Object> extraParams;
5187

5188
          private Type type;
5189

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5287
        private Map<String, Object> extraParams;
5288

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

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

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

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

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

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

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

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

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

5366
          private MissingPaymentMethod missingPaymentMethod;
5367

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5473
      private Map<String, Object> extraParams;
5474

5475
      private Required required;
5476

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

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

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

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

5519
      /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */
5520
      public Builder setRequired(PaymentLinkCreateParams.TaxIdCollection.Required required) {
5521
        this.required = required;
×
5522
        return this;
×
5523
      }
5524
    }
5525

5526
    public enum Required implements ApiRequestParams.EnumParam {
×
5527
      @SerializedName("if_supported")
×
5528
      IF_SUPPORTED("if_supported"),
5529

5530
      @SerializedName("never")
×
5531
      NEVER("never");
5532

5533
      @Getter(onMethod_ = {@Override})
5534
      private final String value;
5535

5536
      Required(String value) {
×
5537
        this.value = value;
×
5538
      }
×
5539
    }
5540
  }
5541

5542
  @Getter
5543
  public static class TransferData {
5544
    /** The amount that will be transferred automatically when a charge succeeds. */
5545
    @SerializedName("amount")
5546
    Long amount;
5547

5548
    /**
5549
     * <strong>Required.</strong> If specified, successful charges will be attributed to the
5550
     * destination account for tax reporting, and the funds from charges will be transferred to the
5551
     * destination account. The ID of the resulting transfer will be returned on the successful
5552
     * charge's {@code transfer} field.
5553
     */
5554
    @SerializedName("destination")
5555
    String destination;
5556

5557
    /**
5558
     * Map of extra parameters for custom features not available in this client library. The content
5559
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5560
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5561
     * param object. Effectively, this map is flattened to its parent instance.
5562
     */
5563
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5564
    Map<String, Object> extraParams;
5565

5566
    private TransferData(Long amount, String destination, Map<String, Object> extraParams) {
×
5567
      this.amount = amount;
×
5568
      this.destination = destination;
×
5569
      this.extraParams = extraParams;
×
5570
    }
×
5571

5572
    public static Builder builder() {
5573
      return new Builder();
×
5574
    }
5575

5576
    public static class Builder {
×
5577
      private Long amount;
5578

5579
      private String destination;
5580

5581
      private Map<String, Object> extraParams;
5582

5583
      /** Finalize and obtain parameter instance from this builder. */
5584
      public PaymentLinkCreateParams.TransferData build() {
5585
        return new PaymentLinkCreateParams.TransferData(
×
5586
            this.amount, this.destination, this.extraParams);
5587
      }
5588

5589
      /** The amount that will be transferred automatically when a charge succeeds. */
5590
      public Builder setAmount(Long amount) {
5591
        this.amount = amount;
×
5592
        return this;
×
5593
      }
5594

5595
      /**
5596
       * <strong>Required.</strong> If specified, successful charges will be attributed to the
5597
       * destination account for tax reporting, and the funds from charges will be transferred to
5598
       * the destination account. The ID of the resulting transfer will be returned on the
5599
       * successful charge's {@code transfer} field.
5600
       */
5601
      public Builder setDestination(String destination) {
5602
        this.destination = destination;
×
5603
        return this;
×
5604
      }
5605

5606
      /**
5607
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5608
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5609
       * PaymentLinkCreateParams.TransferData#extraParams} for the field documentation.
5610
       */
5611
      public Builder putExtraParam(String key, Object value) {
5612
        if (this.extraParams == null) {
×
5613
          this.extraParams = new HashMap<>();
×
5614
        }
5615
        this.extraParams.put(key, value);
×
5616
        return this;
×
5617
      }
5618

5619
      /**
5620
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5621
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5622
       * See {@link PaymentLinkCreateParams.TransferData#extraParams} for the field documentation.
5623
       */
5624
      public Builder putAllExtraParam(Map<String, Object> map) {
5625
        if (this.extraParams == null) {
×
5626
          this.extraParams = new HashMap<>();
×
5627
        }
5628
        this.extraParams.putAll(map);
×
5629
        return this;
×
5630
      }
5631
    }
5632
  }
5633

5634
  public enum BillingAddressCollection implements ApiRequestParams.EnumParam {
×
5635
    @SerializedName("auto")
×
5636
    AUTO("auto"),
5637

5638
    @SerializedName("required")
×
5639
    REQUIRED("required");
5640

5641
    @Getter(onMethod_ = {@Override})
5642
    private final String value;
5643

5644
    BillingAddressCollection(String value) {
×
5645
      this.value = value;
×
5646
    }
×
5647
  }
5648

5649
  public enum CustomerCreation implements ApiRequestParams.EnumParam {
×
5650
    @SerializedName("always")
×
5651
    ALWAYS("always"),
5652

5653
    @SerializedName("if_required")
×
5654
    IF_REQUIRED("if_required");
5655

5656
    @Getter(onMethod_ = {@Override})
5657
    private final String value;
5658

5659
    CustomerCreation(String value) {
×
5660
      this.value = value;
×
5661
    }
×
5662
  }
5663

5664
  public enum PaymentMethodCollection implements ApiRequestParams.EnumParam {
×
5665
    @SerializedName("always")
×
5666
    ALWAYS("always"),
5667

5668
    @SerializedName("if_required")
×
5669
    IF_REQUIRED("if_required");
5670

5671
    @Getter(onMethod_ = {@Override})
5672
    private final String value;
5673

5674
    PaymentMethodCollection(String value) {
×
5675
      this.value = value;
×
5676
    }
×
5677
  }
5678

5679
  public enum PaymentMethodType implements ApiRequestParams.EnumParam {
×
5680
    @SerializedName("affirm")
×
5681
    AFFIRM("affirm"),
5682

5683
    @SerializedName("afterpay_clearpay")
×
5684
    AFTERPAY_CLEARPAY("afterpay_clearpay"),
5685

5686
    @SerializedName("alipay")
×
5687
    ALIPAY("alipay"),
5688

5689
    @SerializedName("alma")
×
5690
    ALMA("alma"),
5691

5692
    @SerializedName("au_becs_debit")
×
5693
    AU_BECS_DEBIT("au_becs_debit"),
5694

5695
    @SerializedName("bacs_debit")
×
5696
    BACS_DEBIT("bacs_debit"),
5697

5698
    @SerializedName("bancontact")
×
5699
    BANCONTACT("bancontact"),
5700

5701
    @SerializedName("blik")
×
5702
    BLIK("blik"),
5703

5704
    @SerializedName("boleto")
×
5705
    BOLETO("boleto"),
5706

5707
    @SerializedName("card")
×
5708
    CARD("card"),
5709

5710
    @SerializedName("cashapp")
×
5711
    CASHAPP("cashapp"),
5712

5713
    @SerializedName("eps")
×
5714
    EPS("eps"),
5715

5716
    @SerializedName("fpx")
×
5717
    FPX("fpx"),
5718

5719
    @SerializedName("giropay")
×
5720
    GIROPAY("giropay"),
5721

5722
    @SerializedName("gopay")
×
5723
    GOPAY("gopay"),
5724

5725
    @SerializedName("grabpay")
×
5726
    GRABPAY("grabpay"),
5727

5728
    @SerializedName("ideal")
×
5729
    IDEAL("ideal"),
5730

5731
    @SerializedName("klarna")
×
5732
    KLARNA("klarna"),
5733

5734
    @SerializedName("konbini")
×
5735
    KONBINI("konbini"),
5736

5737
    @SerializedName("link")
×
5738
    LINK("link"),
5739

5740
    @SerializedName("mb_way")
×
5741
    MB_WAY("mb_way"),
5742

5743
    @SerializedName("mobilepay")
×
5744
    MOBILEPAY("mobilepay"),
5745

5746
    @SerializedName("multibanco")
×
5747
    MULTIBANCO("multibanco"),
5748

5749
    @SerializedName("oxxo")
×
5750
    OXXO("oxxo"),
5751

5752
    @SerializedName("p24")
×
5753
    P24("p24"),
5754

5755
    @SerializedName("paynow")
×
5756
    PAYNOW("paynow"),
5757

5758
    @SerializedName("paypal")
×
5759
    PAYPAL("paypal"),
5760

5761
    @SerializedName("payto")
×
5762
    PAYTO("payto"),
5763

5764
    @SerializedName("pix")
×
5765
    PIX("pix"),
5766

5767
    @SerializedName("promptpay")
×
5768
    PROMPTPAY("promptpay"),
5769

5770
    @SerializedName("qris")
×
5771
    QRIS("qris"),
5772

5773
    @SerializedName("rechnung")
×
5774
    RECHNUNG("rechnung"),
5775

5776
    @SerializedName("sepa_debit")
×
5777
    SEPA_DEBIT("sepa_debit"),
5778

5779
    @SerializedName("shopeepay")
×
5780
    SHOPEEPAY("shopeepay"),
5781

5782
    @SerializedName("sofort")
×
5783
    SOFORT("sofort"),
5784

5785
    @SerializedName("swish")
×
5786
    SWISH("swish"),
5787

5788
    @SerializedName("twint")
×
5789
    TWINT("twint"),
5790

5791
    @SerializedName("us_bank_account")
×
5792
    US_BANK_ACCOUNT("us_bank_account"),
5793

5794
    @SerializedName("wechat_pay")
×
5795
    WECHAT_PAY("wechat_pay"),
5796

5797
    @SerializedName("zip")
×
5798
    ZIP("zip");
5799

5800
    @Getter(onMethod_ = {@Override})
5801
    private final String value;
5802

5803
    PaymentMethodType(String value) {
×
5804
      this.value = value;
×
5805
    }
×
5806
  }
5807

5808
  public enum SubmitType implements ApiRequestParams.EnumParam {
×
5809
    @SerializedName("auto")
×
5810
    AUTO("auto"),
5811

5812
    @SerializedName("book")
×
5813
    BOOK("book"),
5814

5815
    @SerializedName("donate")
×
5816
    DONATE("donate"),
5817

5818
    @SerializedName("pay")
×
5819
    PAY("pay"),
5820

NEW
5821
    @SerializedName("subscribe")
×
5822
    SUBSCRIBE("subscribe");
5823

5824
    @Getter(onMethod_ = {@Override})
5825
    private final String value;
5826

5827
    SubmitType(String value) {
×
5828
      this.value = value;
×
5829
    }
×
5830
  }
5831
}
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

© 2025 Coveralls, Inc