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

stripe / stripe-java / #16731

10 Jan 2025 10:03PM UTC coverage: 12.334% (-0.006%) from 12.34%
#16731

Pull #1935

github

web-flow
Merge a48a408cc into fc96887fe
Pull Request #1935: Update generated code for beta

1 of 85 new or added lines in 4 files covered. (1.18%)

5882 existing lines in 7 files now uncovered.

18907 of 153294 relevant lines covered (12.33%)

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> Set to {@code true} to <a
1010
     * href="https://docs.stripe.com/tax">calculate tax automatically</a> using the customer's
1011
     * location.
1012
     *
1013
     * <p>Enabling this parameter causes the payment link to collect any billing address information
1014
     * necessary for tax calculation.
1015
     */
1016
    @SerializedName("enabled")
1017
    Boolean enabled;
1018

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

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

1036
    private AutomaticTax(Boolean enabled, Map<String, Object> extraParams, Liability liability) {
×
1037
      this.enabled = enabled;
×
1038
      this.extraParams = extraParams;
×
1039
      this.liability = liability;
×
1040
    }
×
1041

1042
    public static Builder builder() {
1043
      return new Builder();
×
1044
    }
1045

1046
    public static class Builder {
×
1047
      private Boolean enabled;
1048

1049
      private Map<String, Object> extraParams;
1050

1051
      private Liability liability;
1052

1053
      /** Finalize and obtain parameter instance from this builder. */
1054
      public PaymentLinkCreateParams.AutomaticTax build() {
1055
        return new PaymentLinkCreateParams.AutomaticTax(
×
1056
            this.enabled, this.extraParams, this.liability);
1057
      }
1058

1059
      /**
1060
       * <strong>Required.</strong> Set to {@code true} to <a
1061
       * href="https://docs.stripe.com/tax">calculate tax automatically</a> using the customer's
1062
       * location.
1063
       *
1064
       * <p>Enabling this parameter causes the payment link to collect any billing address
1065
       * information necessary for tax calculation.
1066
       */
1067
      public Builder setEnabled(Boolean enabled) {
1068
        this.enabled = enabled;
×
1069
        return this;
×
1070
      }
1071

1072
      /**
1073
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1074
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1075
       * PaymentLinkCreateParams.AutomaticTax#extraParams} for the field documentation.
1076
       */
1077
      public Builder putExtraParam(String key, Object value) {
1078
        if (this.extraParams == null) {
×
1079
          this.extraParams = new HashMap<>();
×
1080
        }
1081
        this.extraParams.put(key, value);
×
1082
        return this;
×
1083
      }
1084

1085
      /**
1086
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1087
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1088
       * See {@link PaymentLinkCreateParams.AutomaticTax#extraParams} for the field documentation.
1089
       */
1090
      public Builder putAllExtraParam(Map<String, Object> map) {
1091
        if (this.extraParams == null) {
×
1092
          this.extraParams = new HashMap<>();
×
1093
        }
1094
        this.extraParams.putAll(map);
×
1095
        return this;
×
1096
      }
1097

1098
      /**
1099
       * The account that's liable for tax. If set, the business address and tax registrations
1100
       * required to perform the tax calculation are loaded from this account. The tax transaction
1101
       * is returned in the report of the connected account.
1102
       */
1103
      public Builder setLiability(PaymentLinkCreateParams.AutomaticTax.Liability liability) {
1104
        this.liability = liability;
×
1105
        return this;
×
1106
      }
1107
    }
1108

1109
    @Getter
1110
    public static class Liability {
1111
      /** The connected account being referenced when {@code type} is {@code account}. */
1112
      @SerializedName("account")
1113
      String account;
1114

1115
      /**
1116
       * Map of extra parameters for custom features not available in this client library. The
1117
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1118
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1119
       * name in this param object. Effectively, this map is flattened to its parent instance.
1120
       */
1121
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1122
      Map<String, Object> extraParams;
1123

1124
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1125
      @SerializedName("type")
1126
      Type type;
1127

1128
      private Liability(String account, Map<String, Object> extraParams, Type type) {
×
1129
        this.account = account;
×
1130
        this.extraParams = extraParams;
×
1131
        this.type = type;
×
1132
      }
×
1133

1134
      public static Builder builder() {
1135
        return new Builder();
×
1136
      }
1137

1138
      public static class Builder {
×
1139
        private String account;
1140

1141
        private Map<String, Object> extraParams;
1142

1143
        private Type type;
1144

1145
        /** Finalize and obtain parameter instance from this builder. */
1146
        public PaymentLinkCreateParams.AutomaticTax.Liability build() {
1147
          return new PaymentLinkCreateParams.AutomaticTax.Liability(
×
1148
              this.account, this.extraParams, this.type);
1149
        }
1150

1151
        /** The connected account being referenced when {@code type} is {@code account}. */
1152
        public Builder setAccount(String account) {
1153
          this.account = account;
×
1154
          return this;
×
1155
        }
1156

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

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

1185
        /** <strong>Required.</strong> Type of the account referenced in the request. */
1186
        public Builder setType(PaymentLinkCreateParams.AutomaticTax.Liability.Type type) {
1187
          this.type = type;
×
1188
          return this;
×
1189
        }
1190
      }
1191

1192
      public enum Type implements ApiRequestParams.EnumParam {
×
1193
        @SerializedName("account")
×
1194
        ACCOUNT("account"),
1195

1196
        @SerializedName("self")
×
1197
        SELF("self");
1198

1199
        @Getter(onMethod_ = {@Override})
1200
        private final String value;
1201

1202
        Type(String value) {
×
1203
          this.value = value;
×
1204
        }
×
1205
      }
1206
    }
1207
  }
1208

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

1220
    /**
1221
     * Determines the display of payment method reuse agreement text in the UI. If set to {@code
1222
     * hidden}, it will hide legal text related to the reuse of a payment method.
1223
     */
1224
    @SerializedName("payment_method_reuse_agreement")
1225
    PaymentMethodReuseAgreement paymentMethodReuseAgreement;
1226

1227
    /**
1228
     * If set to {@code auto}, enables the collection of customer consent for promotional
1229
     * communications. The Checkout Session will determine whether to display an option to opt into
1230
     * promotional communication from the merchant depending on the customer's locale. Only
1231
     * available to US merchants.
1232
     */
1233
    @SerializedName("promotions")
1234
    Promotions promotions;
1235

1236
    /**
1237
     * If set to {@code required}, it requires customers to check a terms of service checkbox before
1238
     * being able to pay. There must be a valid terms of service URL set in your <a
1239
     * href="https://dashboard.stripe.com/settings/public">Dashboard settings</a>.
1240
     */
1241
    @SerializedName("terms_of_service")
1242
    TermsOfService termsOfService;
1243

1244
    private ConsentCollection(
1245
        Map<String, Object> extraParams,
1246
        PaymentMethodReuseAgreement paymentMethodReuseAgreement,
1247
        Promotions promotions,
1248
        TermsOfService termsOfService) {
×
1249
      this.extraParams = extraParams;
×
1250
      this.paymentMethodReuseAgreement = paymentMethodReuseAgreement;
×
1251
      this.promotions = promotions;
×
1252
      this.termsOfService = termsOfService;
×
1253
    }
×
1254

1255
    public static Builder builder() {
1256
      return new Builder();
×
1257
    }
1258

1259
    public static class Builder {
×
1260
      private Map<String, Object> extraParams;
1261

1262
      private PaymentMethodReuseAgreement paymentMethodReuseAgreement;
1263

1264
      private Promotions promotions;
1265

1266
      private TermsOfService termsOfService;
1267

1268
      /** Finalize and obtain parameter instance from this builder. */
1269
      public PaymentLinkCreateParams.ConsentCollection build() {
1270
        return new PaymentLinkCreateParams.ConsentCollection(
×
1271
            this.extraParams,
1272
            this.paymentMethodReuseAgreement,
1273
            this.promotions,
1274
            this.termsOfService);
1275
      }
1276

1277
      /**
1278
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1279
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1280
       * PaymentLinkCreateParams.ConsentCollection#extraParams} for the field documentation.
1281
       */
1282
      public Builder putExtraParam(String key, Object value) {
1283
        if (this.extraParams == null) {
×
1284
          this.extraParams = new HashMap<>();
×
1285
        }
1286
        this.extraParams.put(key, value);
×
1287
        return this;
×
1288
      }
1289

1290
      /**
1291
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1292
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1293
       * See {@link PaymentLinkCreateParams.ConsentCollection#extraParams} for the field
1294
       * documentation.
1295
       */
1296
      public Builder putAllExtraParam(Map<String, Object> map) {
1297
        if (this.extraParams == null) {
×
1298
          this.extraParams = new HashMap<>();
×
1299
        }
1300
        this.extraParams.putAll(map);
×
1301
        return this;
×
1302
      }
1303

1304
      /**
1305
       * Determines the display of payment method reuse agreement text in the UI. If set to {@code
1306
       * hidden}, it will hide legal text related to the reuse of a payment method.
1307
       */
1308
      public Builder setPaymentMethodReuseAgreement(
1309
          PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement
1310
              paymentMethodReuseAgreement) {
1311
        this.paymentMethodReuseAgreement = paymentMethodReuseAgreement;
×
1312
        return this;
×
1313
      }
1314

1315
      /**
1316
       * If set to {@code auto}, enables the collection of customer consent for promotional
1317
       * communications. The Checkout Session will determine whether to display an option to opt
1318
       * into promotional communication from the merchant depending on the customer's locale. Only
1319
       * available to US merchants.
1320
       */
1321
      public Builder setPromotions(
1322
          PaymentLinkCreateParams.ConsentCollection.Promotions promotions) {
1323
        this.promotions = promotions;
×
1324
        return this;
×
1325
      }
1326

1327
      /**
1328
       * If set to {@code required}, it requires customers to check a terms of service checkbox
1329
       * before being able to pay. There must be a valid terms of service URL set in your <a
1330
       * href="https://dashboard.stripe.com/settings/public">Dashboard settings</a>.
1331
       */
1332
      public Builder setTermsOfService(
1333
          PaymentLinkCreateParams.ConsentCollection.TermsOfService termsOfService) {
1334
        this.termsOfService = termsOfService;
×
1335
        return this;
×
1336
      }
1337
    }
1338

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

1350
      /**
1351
       * <strong>Required.</strong> Determines the position and visibility of the payment method
1352
       * reuse agreement in the UI. When set to {@code auto}, Stripe's defaults will be used. When
1353
       * set to {@code hidden}, the payment method reuse agreement text will always be hidden in the
1354
       * UI.
1355
       */
1356
      @SerializedName("position")
1357
      Position position;
1358

1359
      private PaymentMethodReuseAgreement(Map<String, Object> extraParams, Position position) {
×
1360
        this.extraParams = extraParams;
×
1361
        this.position = position;
×
1362
      }
×
1363

1364
      public static Builder builder() {
1365
        return new Builder();
×
1366
      }
1367

1368
      public static class Builder {
×
1369
        private Map<String, Object> extraParams;
1370

1371
        private Position position;
1372

1373
        /** Finalize and obtain parameter instance from this builder. */
1374
        public PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement build() {
1375
          return new PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement(
×
1376
              this.extraParams, this.position);
1377
        }
1378

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

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

1409
        /**
1410
         * <strong>Required.</strong> Determines the position and visibility of the payment method
1411
         * reuse agreement in the UI. When set to {@code auto}, Stripe's defaults will be used. When
1412
         * set to {@code hidden}, the payment method reuse agreement text will always be hidden in
1413
         * the UI.
1414
         */
1415
        public Builder setPosition(
1416
            PaymentLinkCreateParams.ConsentCollection.PaymentMethodReuseAgreement.Position
1417
                position) {
1418
          this.position = position;
×
1419
          return this;
×
1420
        }
1421
      }
1422

1423
      public enum Position implements ApiRequestParams.EnumParam {
×
1424
        @SerializedName("auto")
×
1425
        AUTO("auto"),
1426

1427
        @SerializedName("hidden")
×
1428
        HIDDEN("hidden");
1429

1430
        @Getter(onMethod_ = {@Override})
1431
        private final String value;
1432

1433
        Position(String value) {
×
1434
          this.value = value;
×
1435
        }
×
1436
      }
1437
    }
1438

1439
    public enum Promotions implements ApiRequestParams.EnumParam {
×
1440
      @SerializedName("auto")
×
1441
      AUTO("auto"),
1442

1443
      @SerializedName("none")
×
1444
      NONE("none");
1445

1446
      @Getter(onMethod_ = {@Override})
1447
      private final String value;
1448

1449
      Promotions(String value) {
×
1450
        this.value = value;
×
1451
      }
×
1452
    }
1453

1454
    public enum TermsOfService implements ApiRequestParams.EnumParam {
×
1455
      @SerializedName("none")
×
1456
      NONE("none"),
1457

1458
      @SerializedName("required")
×
1459
      REQUIRED("required");
1460

1461
      @Getter(onMethod_ = {@Override})
1462
      private final String value;
1463

1464
      TermsOfService(String value) {
×
1465
        this.value = value;
×
1466
      }
×
1467
    }
1468
  }
1469

1470
  @Getter
1471
  public static class CustomField {
1472
    /** Configuration for {@code type=dropdown} fields. */
1473
    @SerializedName("dropdown")
1474
    Dropdown dropdown;
1475

1476
    /**
1477
     * Map of extra parameters for custom features not available in this client library. The content
1478
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1479
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1480
     * param object. Effectively, this map is flattened to its parent instance.
1481
     */
1482
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1483
    Map<String, Object> extraParams;
1484

1485
    /**
1486
     * <strong>Required.</strong> String of your choice that your integration can use to reconcile
1487
     * this field. Must be unique to this field, alphanumeric, and up to 200 characters.
1488
     */
1489
    @SerializedName("key")
1490
    String key;
1491

1492
    /** <strong>Required.</strong> The label for the field, displayed to the customer. */
1493
    @SerializedName("label")
1494
    Label label;
1495

1496
    /** Configuration for {@code type=numeric} fields. */
1497
    @SerializedName("numeric")
1498
    Numeric numeric;
1499

1500
    /**
1501
     * Whether the customer is required to complete the field before completing the Checkout
1502
     * Session. Defaults to {@code false}.
1503
     */
1504
    @SerializedName("optional")
1505
    Boolean optional;
1506

1507
    /** Configuration for {@code type=text} fields. */
1508
    @SerializedName("text")
1509
    Text text;
1510

1511
    /** <strong>Required.</strong> The type of the field. */
1512
    @SerializedName("type")
1513
    Type type;
1514

1515
    private CustomField(
1516
        Dropdown dropdown,
1517
        Map<String, Object> extraParams,
1518
        String key,
1519
        Label label,
1520
        Numeric numeric,
1521
        Boolean optional,
1522
        Text text,
1523
        Type type) {
×
1524
      this.dropdown = dropdown;
×
1525
      this.extraParams = extraParams;
×
1526
      this.key = key;
×
1527
      this.label = label;
×
1528
      this.numeric = numeric;
×
1529
      this.optional = optional;
×
1530
      this.text = text;
×
1531
      this.type = type;
×
1532
    }
×
1533

1534
    public static Builder builder() {
1535
      return new Builder();
×
1536
    }
1537

1538
    public static class Builder {
×
1539
      private Dropdown dropdown;
1540

1541
      private Map<String, Object> extraParams;
1542

1543
      private String key;
1544

1545
      private Label label;
1546

1547
      private Numeric numeric;
1548

1549
      private Boolean optional;
1550

1551
      private Text text;
1552

1553
      private Type type;
1554

1555
      /** Finalize and obtain parameter instance from this builder. */
1556
      public PaymentLinkCreateParams.CustomField build() {
1557
        return new PaymentLinkCreateParams.CustomField(
×
1558
            this.dropdown,
1559
            this.extraParams,
1560
            this.key,
1561
            this.label,
1562
            this.numeric,
1563
            this.optional,
1564
            this.text,
1565
            this.type);
1566
      }
1567

1568
      /** Configuration for {@code type=dropdown} fields. */
1569
      public Builder setDropdown(PaymentLinkCreateParams.CustomField.Dropdown dropdown) {
1570
        this.dropdown = dropdown;
×
1571
        return this;
×
1572
      }
1573

1574
      /**
1575
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1576
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1577
       * PaymentLinkCreateParams.CustomField#extraParams} for the field documentation.
1578
       */
1579
      public Builder putExtraParam(String key, Object value) {
1580
        if (this.extraParams == null) {
×
1581
          this.extraParams = new HashMap<>();
×
1582
        }
1583
        this.extraParams.put(key, value);
×
1584
        return this;
×
1585
      }
1586

1587
      /**
1588
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1589
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1590
       * See {@link PaymentLinkCreateParams.CustomField#extraParams} for the field documentation.
1591
       */
1592
      public Builder putAllExtraParam(Map<String, Object> map) {
1593
        if (this.extraParams == null) {
×
1594
          this.extraParams = new HashMap<>();
×
1595
        }
1596
        this.extraParams.putAll(map);
×
1597
        return this;
×
1598
      }
1599

1600
      /**
1601
       * <strong>Required.</strong> String of your choice that your integration can use to reconcile
1602
       * this field. Must be unique to this field, alphanumeric, and up to 200 characters.
1603
       */
1604
      public Builder setKey(String key) {
1605
        this.key = key;
×
1606
        return this;
×
1607
      }
1608

1609
      /** <strong>Required.</strong> The label for the field, displayed to the customer. */
1610
      public Builder setLabel(PaymentLinkCreateParams.CustomField.Label label) {
1611
        this.label = label;
×
1612
        return this;
×
1613
      }
1614

1615
      /** Configuration for {@code type=numeric} fields. */
1616
      public Builder setNumeric(PaymentLinkCreateParams.CustomField.Numeric numeric) {
1617
        this.numeric = numeric;
×
1618
        return this;
×
1619
      }
1620

1621
      /**
1622
       * Whether the customer is required to complete the field before completing the Checkout
1623
       * Session. Defaults to {@code false}.
1624
       */
1625
      public Builder setOptional(Boolean optional) {
1626
        this.optional = optional;
×
1627
        return this;
×
1628
      }
1629

1630
      /** Configuration for {@code type=text} fields. */
1631
      public Builder setText(PaymentLinkCreateParams.CustomField.Text text) {
1632
        this.text = text;
×
1633
        return this;
×
1634
      }
1635

1636
      /** <strong>Required.</strong> The type of the field. */
1637
      public Builder setType(PaymentLinkCreateParams.CustomField.Type type) {
1638
        this.type = type;
×
1639
        return this;
×
1640
      }
1641
    }
1642

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

1654
      /**
1655
       * <strong>Required.</strong> The options available for the customer to select. Up to 200
1656
       * options allowed.
1657
       */
1658
      @SerializedName("options")
1659
      List<PaymentLinkCreateParams.CustomField.Dropdown.Option> options;
1660

1661
      private Dropdown(
1662
          Map<String, Object> extraParams,
1663
          List<PaymentLinkCreateParams.CustomField.Dropdown.Option> options) {
×
1664
        this.extraParams = extraParams;
×
1665
        this.options = options;
×
1666
      }
×
1667

1668
      public static Builder builder() {
1669
        return new Builder();
×
1670
      }
1671

1672
      public static class Builder {
×
1673
        private Map<String, Object> extraParams;
1674

1675
        private List<PaymentLinkCreateParams.CustomField.Dropdown.Option> options;
1676

1677
        /** Finalize and obtain parameter instance from this builder. */
1678
        public PaymentLinkCreateParams.CustomField.Dropdown build() {
1679
          return new PaymentLinkCreateParams.CustomField.Dropdown(this.extraParams, this.options);
×
1680
        }
1681

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

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

1710
        /**
1711
         * Add an element to `options` list. A list is initialized for the first `add/addAll` call,
1712
         * and subsequent calls adds additional elements to the original list. See {@link
1713
         * PaymentLinkCreateParams.CustomField.Dropdown#options} for the field documentation.
1714
         */
1715
        public Builder addOption(PaymentLinkCreateParams.CustomField.Dropdown.Option element) {
1716
          if (this.options == null) {
×
1717
            this.options = new ArrayList<>();
×
1718
          }
1719
          this.options.add(element);
×
1720
          return this;
×
1721
        }
1722

1723
        /**
1724
         * Add all elements to `options` list. A list is initialized for the first `add/addAll`
1725
         * call, and subsequent calls adds additional elements to the original list. See {@link
1726
         * PaymentLinkCreateParams.CustomField.Dropdown#options} for the field documentation.
1727
         */
1728
        public Builder addAllOption(
1729
            List<PaymentLinkCreateParams.CustomField.Dropdown.Option> elements) {
1730
          if (this.options == null) {
×
1731
            this.options = new ArrayList<>();
×
1732
          }
1733
          this.options.addAll(elements);
×
1734
          return this;
×
1735
        }
1736
      }
1737

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

1750
        /**
1751
         * <strong>Required.</strong> The label for the option, displayed to the customer. Up to 100
1752
         * characters.
1753
         */
1754
        @SerializedName("label")
1755
        String label;
1756

1757
        /**
1758
         * <strong>Required.</strong> The value for this option, not displayed to the customer, used
1759
         * by your integration to reconcile the option selected by the customer. Must be unique to
1760
         * this option, alphanumeric, and up to 100 characters.
1761
         */
1762
        @SerializedName("value")
1763
        String value;
1764

1765
        private Option(Map<String, Object> extraParams, String label, String value) {
×
1766
          this.extraParams = extraParams;
×
1767
          this.label = label;
×
1768
          this.value = value;
×
1769
        }
×
1770

1771
        public static Builder builder() {
1772
          return new Builder();
×
1773
        }
1774

1775
        public static class Builder {
×
1776
          private Map<String, Object> extraParams;
1777

1778
          private String label;
1779

1780
          private String value;
1781

1782
          /** Finalize and obtain parameter instance from this builder. */
1783
          public PaymentLinkCreateParams.CustomField.Dropdown.Option build() {
1784
            return new PaymentLinkCreateParams.CustomField.Dropdown.Option(
×
1785
                this.extraParams, this.label, this.value);
1786
          }
1787

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

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

1816
          /**
1817
           * <strong>Required.</strong> The label for the option, displayed to the customer. Up to
1818
           * 100 characters.
1819
           */
1820
          public Builder setLabel(String label) {
1821
            this.label = label;
×
1822
            return this;
×
1823
          }
1824

1825
          /**
1826
           * <strong>Required.</strong> The value for this option, not displayed to the customer,
1827
           * used by your integration to reconcile the option selected by the customer. Must be
1828
           * unique to this option, alphanumeric, and up to 100 characters.
1829
           */
1830
          public Builder setValue(String value) {
1831
            this.value = value;
×
1832
            return this;
×
1833
          }
1834
        }
1835
      }
1836
    }
1837

1838
    @Getter
1839
    public static class Label {
1840
      /**
1841
       * <strong>Required.</strong> Custom text for the label, displayed to the customer. Up to 50
1842
       * characters.
1843
       */
1844
      @SerializedName("custom")
1845
      String custom;
1846

1847
      /**
1848
       * Map of extra parameters for custom features not available in this client library. The
1849
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1850
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1851
       * name in this param object. Effectively, this map is flattened to its parent instance.
1852
       */
1853
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1854
      Map<String, Object> extraParams;
1855

1856
      /** <strong>Required.</strong> The type of the label. */
1857
      @SerializedName("type")
1858
      Type type;
1859

1860
      private Label(String custom, Map<String, Object> extraParams, Type type) {
×
1861
        this.custom = custom;
×
1862
        this.extraParams = extraParams;
×
1863
        this.type = type;
×
1864
      }
×
1865

1866
      public static Builder builder() {
1867
        return new Builder();
×
1868
      }
1869

1870
      public static class Builder {
×
1871
        private String custom;
1872

1873
        private Map<String, Object> extraParams;
1874

1875
        private Type type;
1876

1877
        /** Finalize and obtain parameter instance from this builder. */
1878
        public PaymentLinkCreateParams.CustomField.Label build() {
1879
          return new PaymentLinkCreateParams.CustomField.Label(
×
1880
              this.custom, this.extraParams, this.type);
1881
        }
1882

1883
        /**
1884
         * <strong>Required.</strong> Custom text for the label, displayed to the customer. Up to 50
1885
         * characters.
1886
         */
1887
        public Builder setCustom(String custom) {
1888
          this.custom = custom;
×
1889
          return this;
×
1890
        }
1891

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

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

1920
        /** <strong>Required.</strong> The type of the label. */
1921
        public Builder setType(PaymentLinkCreateParams.CustomField.Label.Type type) {
1922
          this.type = type;
×
1923
          return this;
×
1924
        }
1925
      }
1926

1927
      public enum Type implements ApiRequestParams.EnumParam {
×
1928
        @SerializedName("custom")
×
1929
        CUSTOM("custom");
1930

1931
        @Getter(onMethod_ = {@Override})
1932
        private final String value;
1933

1934
        Type(String value) {
×
1935
          this.value = value;
×
1936
        }
×
1937
      }
1938
    }
1939

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

1951
      /** The maximum character length constraint for the customer's input. */
1952
      @SerializedName("maximum_length")
1953
      Long maximumLength;
1954

1955
      /** The minimum character length requirement for the customer's input. */
1956
      @SerializedName("minimum_length")
1957
      Long minimumLength;
1958

1959
      private Numeric(Map<String, Object> extraParams, Long maximumLength, Long minimumLength) {
×
1960
        this.extraParams = extraParams;
×
1961
        this.maximumLength = maximumLength;
×
1962
        this.minimumLength = minimumLength;
×
1963
      }
×
1964

1965
      public static Builder builder() {
1966
        return new Builder();
×
1967
      }
1968

1969
      public static class Builder {
×
1970
        private Map<String, Object> extraParams;
1971

1972
        private Long maximumLength;
1973

1974
        private Long minimumLength;
1975

1976
        /** Finalize and obtain parameter instance from this builder. */
1977
        public PaymentLinkCreateParams.CustomField.Numeric build() {
1978
          return new PaymentLinkCreateParams.CustomField.Numeric(
×
1979
              this.extraParams, this.maximumLength, this.minimumLength);
1980
        }
1981

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

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

2010
        /** The maximum character length constraint for the customer's input. */
2011
        public Builder setMaximumLength(Long maximumLength) {
2012
          this.maximumLength = maximumLength;
×
2013
          return this;
×
2014
        }
2015

2016
        /** The minimum character length requirement for the customer's input. */
2017
        public Builder setMinimumLength(Long minimumLength) {
2018
          this.minimumLength = minimumLength;
×
2019
          return this;
×
2020
        }
2021
      }
2022
    }
2023

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

2035
      /** The maximum character length constraint for the customer's input. */
2036
      @SerializedName("maximum_length")
2037
      Long maximumLength;
2038

2039
      /** The minimum character length requirement for the customer's input. */
2040
      @SerializedName("minimum_length")
2041
      Long minimumLength;
2042

2043
      private Text(Map<String, Object> extraParams, Long maximumLength, Long minimumLength) {
×
2044
        this.extraParams = extraParams;
×
2045
        this.maximumLength = maximumLength;
×
2046
        this.minimumLength = minimumLength;
×
2047
      }
×
2048

2049
      public static Builder builder() {
2050
        return new Builder();
×
2051
      }
2052

2053
      public static class Builder {
×
2054
        private Map<String, Object> extraParams;
2055

2056
        private Long maximumLength;
2057

2058
        private Long minimumLength;
2059

2060
        /** Finalize and obtain parameter instance from this builder. */
2061
        public PaymentLinkCreateParams.CustomField.Text build() {
2062
          return new PaymentLinkCreateParams.CustomField.Text(
×
2063
              this.extraParams, this.maximumLength, this.minimumLength);
2064
        }
2065

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

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

2094
        /** The maximum character length constraint for the customer's input. */
2095
        public Builder setMaximumLength(Long maximumLength) {
2096
          this.maximumLength = maximumLength;
×
2097
          return this;
×
2098
        }
2099

2100
        /** The minimum character length requirement for the customer's input. */
2101
        public Builder setMinimumLength(Long minimumLength) {
2102
          this.minimumLength = minimumLength;
×
2103
          return this;
×
2104
        }
2105
      }
2106
    }
2107

2108
    public enum Type implements ApiRequestParams.EnumParam {
×
2109
      @SerializedName("dropdown")
×
2110
      DROPDOWN("dropdown"),
2111

2112
      @SerializedName("numeric")
×
2113
      NUMERIC("numeric"),
2114

2115
      @SerializedName("text")
×
2116
      TEXT("text");
2117

2118
      @Getter(onMethod_ = {@Override})
2119
      private final String value;
2120

2121
      Type(String value) {
×
2122
        this.value = value;
×
2123
      }
×
2124
    }
2125
  }
2126

2127
  @Getter
2128
  public static class CustomText {
2129
    /** Custom text that should be displayed after the payment confirmation button. */
2130
    @SerializedName("after_submit")
2131
    Object afterSubmit;
2132

2133
    /**
2134
     * Map of extra parameters for custom features not available in this client library. The content
2135
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
2136
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
2137
     * param object. Effectively, this map is flattened to its parent instance.
2138
     */
2139
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2140
    Map<String, Object> extraParams;
2141

2142
    /** Custom text that should be displayed alongside shipping address collection. */
2143
    @SerializedName("shipping_address")
2144
    Object shippingAddress;
2145

2146
    /** Custom text that should be displayed alongside the payment confirmation button. */
2147
    @SerializedName("submit")
2148
    Object submit;
2149

2150
    /**
2151
     * Custom text that should be displayed in place of the default terms of service agreement text.
2152
     */
2153
    @SerializedName("terms_of_service_acceptance")
2154
    Object termsOfServiceAcceptance;
2155

2156
    private CustomText(
2157
        Object afterSubmit,
2158
        Map<String, Object> extraParams,
2159
        Object shippingAddress,
2160
        Object submit,
2161
        Object termsOfServiceAcceptance) {
×
2162
      this.afterSubmit = afterSubmit;
×
2163
      this.extraParams = extraParams;
×
2164
      this.shippingAddress = shippingAddress;
×
2165
      this.submit = submit;
×
2166
      this.termsOfServiceAcceptance = termsOfServiceAcceptance;
×
2167
    }
×
2168

2169
    public static Builder builder() {
2170
      return new Builder();
×
2171
    }
2172

2173
    public static class Builder {
×
2174
      private Object afterSubmit;
2175

2176
      private Map<String, Object> extraParams;
2177

2178
      private Object shippingAddress;
2179

2180
      private Object submit;
2181

2182
      private Object termsOfServiceAcceptance;
2183

2184
      /** Finalize and obtain parameter instance from this builder. */
2185
      public PaymentLinkCreateParams.CustomText build() {
2186
        return new PaymentLinkCreateParams.CustomText(
×
2187
            this.afterSubmit,
2188
            this.extraParams,
2189
            this.shippingAddress,
2190
            this.submit,
2191
            this.termsOfServiceAcceptance);
2192
      }
2193

2194
      /** Custom text that should be displayed after the payment confirmation button. */
2195
      public Builder setAfterSubmit(PaymentLinkCreateParams.CustomText.AfterSubmit afterSubmit) {
2196
        this.afterSubmit = afterSubmit;
×
2197
        return this;
×
2198
      }
2199

2200
      /** Custom text that should be displayed after the payment confirmation button. */
2201
      public Builder setAfterSubmit(EmptyParam afterSubmit) {
2202
        this.afterSubmit = afterSubmit;
×
2203
        return this;
×
2204
      }
2205

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

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

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

2239
      /** Custom text that should be displayed alongside shipping address collection. */
2240
      public Builder setShippingAddress(EmptyParam shippingAddress) {
2241
        this.shippingAddress = shippingAddress;
×
2242
        return this;
×
2243
      }
2244

2245
      /** Custom text that should be displayed alongside the payment confirmation button. */
2246
      public Builder setSubmit(PaymentLinkCreateParams.CustomText.Submit submit) {
2247
        this.submit = submit;
×
2248
        return this;
×
2249
      }
2250

2251
      /** Custom text that should be displayed alongside the payment confirmation button. */
2252
      public Builder setSubmit(EmptyParam submit) {
2253
        this.submit = submit;
×
2254
        return this;
×
2255
      }
2256

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

2267
      /**
2268
       * Custom text that should be displayed in place of the default terms of service agreement
2269
       * text.
2270
       */
2271
      public Builder setTermsOfServiceAcceptance(EmptyParam termsOfServiceAcceptance) {
2272
        this.termsOfServiceAcceptance = termsOfServiceAcceptance;
×
2273
        return this;
×
2274
      }
2275
    }
2276

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

2288
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2289
      @SerializedName("message")
2290
      String message;
2291

2292
      private AfterSubmit(Map<String, Object> extraParams, String message) {
×
2293
        this.extraParams = extraParams;
×
2294
        this.message = message;
×
2295
      }
×
2296

2297
      public static Builder builder() {
2298
        return new Builder();
×
2299
      }
2300

2301
      public static class Builder {
×
2302
        private Map<String, Object> extraParams;
2303

2304
        private String message;
2305

2306
        /** Finalize and obtain parameter instance from this builder. */
2307
        public PaymentLinkCreateParams.CustomText.AfterSubmit build() {
2308
          return new PaymentLinkCreateParams.CustomText.AfterSubmit(this.extraParams, this.message);
×
2309
        }
2310

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

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

2339
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2340
        public Builder setMessage(String message) {
2341
          this.message = message;
×
2342
          return this;
×
2343
        }
2344
      }
2345
    }
2346

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

2358
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2359
      @SerializedName("message")
2360
      String message;
2361

2362
      private ShippingAddress(Map<String, Object> extraParams, String message) {
×
2363
        this.extraParams = extraParams;
×
2364
        this.message = message;
×
2365
      }
×
2366

2367
      public static Builder builder() {
2368
        return new Builder();
×
2369
      }
2370

2371
      public static class Builder {
×
2372
        private Map<String, Object> extraParams;
2373

2374
        private String message;
2375

2376
        /** Finalize and obtain parameter instance from this builder. */
2377
        public PaymentLinkCreateParams.CustomText.ShippingAddress build() {
2378
          return new PaymentLinkCreateParams.CustomText.ShippingAddress(
×
2379
              this.extraParams, this.message);
2380
        }
2381

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

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

2410
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2411
        public Builder setMessage(String message) {
2412
          this.message = message;
×
2413
          return this;
×
2414
        }
2415
      }
2416
    }
2417

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

2429
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2430
      @SerializedName("message")
2431
      String message;
2432

2433
      private Submit(Map<String, Object> extraParams, String message) {
×
2434
        this.extraParams = extraParams;
×
2435
        this.message = message;
×
2436
      }
×
2437

2438
      public static Builder builder() {
2439
        return new Builder();
×
2440
      }
2441

2442
      public static class Builder {
×
2443
        private Map<String, Object> extraParams;
2444

2445
        private String message;
2446

2447
        /** Finalize and obtain parameter instance from this builder. */
2448
        public PaymentLinkCreateParams.CustomText.Submit build() {
2449
          return new PaymentLinkCreateParams.CustomText.Submit(this.extraParams, this.message);
×
2450
        }
2451

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

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

2480
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2481
        public Builder setMessage(String message) {
2482
          this.message = message;
×
2483
          return this;
×
2484
        }
2485
      }
2486
    }
2487

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

2499
      /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2500
      @SerializedName("message")
2501
      String message;
2502

2503
      private TermsOfServiceAcceptance(Map<String, Object> extraParams, String message) {
×
2504
        this.extraParams = extraParams;
×
2505
        this.message = message;
×
2506
      }
×
2507

2508
      public static Builder builder() {
2509
        return new Builder();
×
2510
      }
2511

2512
      public static class Builder {
×
2513
        private Map<String, Object> extraParams;
2514

2515
        private String message;
2516

2517
        /** Finalize and obtain parameter instance from this builder. */
2518
        public PaymentLinkCreateParams.CustomText.TermsOfServiceAcceptance build() {
2519
          return new PaymentLinkCreateParams.CustomText.TermsOfServiceAcceptance(
×
2520
              this.extraParams, this.message);
2521
        }
2522

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

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

2551
        /** <strong>Required.</strong> Text may be up to 1200 characters in length. */
2552
        public Builder setMessage(String message) {
2553
          this.message = message;
×
2554
          return this;
×
2555
        }
2556
      }
2557
    }
2558
  }
2559

2560
  @Getter
2561
  public static class InvoiceCreation {
2562
    /** <strong>Required.</strong> Whether the feature is enabled */
2563
    @SerializedName("enabled")
2564
    Boolean enabled;
2565

2566
    /**
2567
     * Map of extra parameters for custom features not available in this client library. The content
2568
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
2569
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
2570
     * param object. Effectively, this map is flattened to its parent instance.
2571
     */
2572
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2573
    Map<String, Object> extraParams;
2574

2575
    /** Invoice PDF configuration. */
2576
    @SerializedName("invoice_data")
2577
    InvoiceData invoiceData;
2578

2579
    private InvoiceCreation(
2580
        Boolean enabled, Map<String, Object> extraParams, InvoiceData invoiceData) {
×
2581
      this.enabled = enabled;
×
2582
      this.extraParams = extraParams;
×
2583
      this.invoiceData = invoiceData;
×
2584
    }
×
2585

2586
    public static Builder builder() {
2587
      return new Builder();
×
2588
    }
2589

2590
    public static class Builder {
×
2591
      private Boolean enabled;
2592

2593
      private Map<String, Object> extraParams;
2594

2595
      private InvoiceData invoiceData;
2596

2597
      /** Finalize and obtain parameter instance from this builder. */
2598
      public PaymentLinkCreateParams.InvoiceCreation build() {
2599
        return new PaymentLinkCreateParams.InvoiceCreation(
×
2600
            this.enabled, this.extraParams, this.invoiceData);
2601
      }
2602

2603
      /** <strong>Required.</strong> Whether the feature is enabled */
2604
      public Builder setEnabled(Boolean enabled) {
2605
        this.enabled = enabled;
×
2606
        return this;
×
2607
      }
2608

2609
      /**
2610
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
2611
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
2612
       * PaymentLinkCreateParams.InvoiceCreation#extraParams} for the field documentation.
2613
       */
2614
      public Builder putExtraParam(String key, Object value) {
2615
        if (this.extraParams == null) {
×
2616
          this.extraParams = new HashMap<>();
×
2617
        }
2618
        this.extraParams.put(key, value);
×
2619
        return this;
×
2620
      }
2621

2622
      /**
2623
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2624
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
2625
       * See {@link PaymentLinkCreateParams.InvoiceCreation#extraParams} for the field
2626
       * documentation.
2627
       */
2628
      public Builder putAllExtraParam(Map<String, Object> map) {
2629
        if (this.extraParams == null) {
×
2630
          this.extraParams = new HashMap<>();
×
2631
        }
2632
        this.extraParams.putAll(map);
×
2633
        return this;
×
2634
      }
2635

2636
      /** Invoice PDF configuration. */
2637
      public Builder setInvoiceData(
2638
          PaymentLinkCreateParams.InvoiceCreation.InvoiceData invoiceData) {
2639
        this.invoiceData = invoiceData;
×
2640
        return this;
×
2641
      }
2642
    }
2643

2644
    @Getter
2645
    public static class InvoiceData {
2646
      /** The account tax IDs associated with the invoice. */
2647
      @SerializedName("account_tax_ids")
2648
      Object accountTaxIds;
2649

2650
      /** Default custom fields to be displayed on invoices for this customer. */
2651
      @SerializedName("custom_fields")
2652
      Object customFields;
2653

2654
      /** An arbitrary string attached to the object. Often useful for displaying to users. */
2655
      @SerializedName("description")
2656
      String description;
2657

2658
      /**
2659
       * Map of extra parameters for custom features not available in this client library. The
2660
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2661
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2662
       * name in this param object. Effectively, this map is flattened to its parent instance.
2663
       */
2664
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2665
      Map<String, Object> extraParams;
2666

2667
      /** Default footer to be displayed on invoices for this customer. */
2668
      @SerializedName("footer")
2669
      String footer;
2670

2671
      /**
2672
       * The connected account that issues the invoice. The invoice is presented with the branding
2673
       * and support information of the specified account.
2674
       */
2675
      @SerializedName("issuer")
2676
      Issuer issuer;
2677

2678
      /**
2679
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
2680
       * attach to an object. This can be useful for storing additional information about the object
2681
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
2682
       * keys can be unset by posting an empty value to {@code metadata}.
2683
       */
2684
      @SerializedName("metadata")
2685
      Object metadata;
2686

2687
      /** Default options for invoice PDF rendering for this customer. */
2688
      @SerializedName("rendering_options")
2689
      Object renderingOptions;
2690

2691
      private InvoiceData(
2692
          Object accountTaxIds,
2693
          Object customFields,
2694
          String description,
2695
          Map<String, Object> extraParams,
2696
          String footer,
2697
          Issuer issuer,
2698
          Object metadata,
2699
          Object renderingOptions) {
×
2700
        this.accountTaxIds = accountTaxIds;
×
2701
        this.customFields = customFields;
×
2702
        this.description = description;
×
2703
        this.extraParams = extraParams;
×
2704
        this.footer = footer;
×
2705
        this.issuer = issuer;
×
2706
        this.metadata = metadata;
×
2707
        this.renderingOptions = renderingOptions;
×
2708
      }
×
2709

2710
      public static Builder builder() {
2711
        return new Builder();
×
2712
      }
2713

2714
      public static class Builder {
×
2715
        private Object accountTaxIds;
2716

2717
        private Object customFields;
2718

2719
        private String description;
2720

2721
        private Map<String, Object> extraParams;
2722

2723
        private String footer;
2724

2725
        private Issuer issuer;
2726

2727
        private Object metadata;
2728

2729
        private Object renderingOptions;
2730

2731
        /** Finalize and obtain parameter instance from this builder. */
2732
        public PaymentLinkCreateParams.InvoiceCreation.InvoiceData build() {
2733
          return new PaymentLinkCreateParams.InvoiceCreation.InvoiceData(
×
2734
              this.accountTaxIds,
2735
              this.customFields,
2736
              this.description,
2737
              this.extraParams,
2738
              this.footer,
2739
              this.issuer,
2740
              this.metadata,
2741
              this.renderingOptions);
2742
        }
2743

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

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

2774
        /** The account tax IDs associated with the invoice. */
2775
        public Builder setAccountTaxIds(EmptyParam accountTaxIds) {
2776
          this.accountTaxIds = accountTaxIds;
×
2777
          return this;
×
2778
        }
2779

2780
        /** The account tax IDs associated with the invoice. */
2781
        public Builder setAccountTaxIds(List<String> accountTaxIds) {
2782
          this.accountTaxIds = accountTaxIds;
×
2783
          return this;
×
2784
        }
2785

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

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

2824
        /** Default custom fields to be displayed on invoices for this customer. */
2825
        public Builder setCustomFields(EmptyParam customFields) {
2826
          this.customFields = customFields;
×
2827
          return this;
×
2828
        }
2829

2830
        /** Default custom fields to be displayed on invoices for this customer. */
2831
        public Builder setCustomFields(
2832
            List<PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField> customFields) {
2833
          this.customFields = customFields;
×
2834
          return this;
×
2835
        }
2836

2837
        /** An arbitrary string attached to the object. Often useful for displaying to users. */
2838
        public Builder setDescription(String description) {
2839
          this.description = description;
×
2840
          return this;
×
2841
        }
2842

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

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

2871
        /** Default footer to be displayed on invoices for this customer. */
2872
        public Builder setFooter(String footer) {
2873
          this.footer = footer;
×
2874
          return this;
×
2875
        }
2876

2877
        /**
2878
         * The connected account that issues the invoice. The invoice is presented with the branding
2879
         * and support information of the specified account.
2880
         */
2881
        public Builder setIssuer(
2882
            PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer issuer) {
2883
          this.issuer = issuer;
×
2884
          return this;
×
2885
        }
2886

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

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

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

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

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

2946
        /** Default options for invoice PDF rendering for this customer. */
2947
        public Builder setRenderingOptions(EmptyParam renderingOptions) {
2948
          this.renderingOptions = renderingOptions;
×
2949
          return this;
×
2950
        }
2951
      }
2952

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

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

2971
        /**
2972
         * <strong>Required.</strong> The value of the custom field. This may be up to 140
2973
         * characters.
2974
         */
2975
        @SerializedName("value")
2976
        String value;
2977

2978
        private CustomField(Map<String, Object> extraParams, String name, String value) {
×
2979
          this.extraParams = extraParams;
×
2980
          this.name = name;
×
2981
          this.value = value;
×
2982
        }
×
2983

2984
        public static Builder builder() {
2985
          return new Builder();
×
2986
        }
2987

2988
        public static class Builder {
×
2989
          private Map<String, Object> extraParams;
2990

2991
          private String name;
2992

2993
          private String value;
2994

2995
          /** Finalize and obtain parameter instance from this builder. */
2996
          public PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField build() {
2997
            return new PaymentLinkCreateParams.InvoiceCreation.InvoiceData.CustomField(
×
2998
                this.extraParams, this.name, this.value);
2999
          }
3000

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

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

3031
          /**
3032
           * <strong>Required.</strong> The name of the custom field. This may be up to 40
3033
           * characters.
3034
           */
3035
          public Builder setName(String name) {
3036
            this.name = name;
×
3037
            return this;
×
3038
          }
3039

3040
          /**
3041
           * <strong>Required.</strong> The value of the custom field. This may be up to 140
3042
           * characters.
3043
           */
3044
          public Builder setValue(String value) {
3045
            this.value = value;
×
3046
            return this;
×
3047
          }
3048
        }
3049
      }
3050

3051
      @Getter
3052
      public static class Issuer {
3053
        /** The connected account being referenced when {@code type} is {@code account}. */
3054
        @SerializedName("account")
3055
        String account;
3056

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

3067
        /** <strong>Required.</strong> Type of the account referenced in the request. */
3068
        @SerializedName("type")
3069
        Type type;
3070

3071
        private Issuer(String account, Map<String, Object> extraParams, Type type) {
×
3072
          this.account = account;
×
3073
          this.extraParams = extraParams;
×
3074
          this.type = type;
×
3075
        }
×
3076

3077
        public static Builder builder() {
3078
          return new Builder();
×
3079
        }
3080

3081
        public static class Builder {
×
3082
          private String account;
3083

3084
          private Map<String, Object> extraParams;
3085

3086
          private Type type;
3087

3088
          /** Finalize and obtain parameter instance from this builder. */
3089
          public PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer build() {
3090
            return new PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer(
×
3091
                this.account, this.extraParams, this.type);
3092
          }
3093

3094
          /** The connected account being referenced when {@code type} is {@code account}. */
3095
          public Builder setAccount(String account) {
3096
            this.account = account;
×
3097
            return this;
×
3098
          }
3099

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

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

3128
          /** <strong>Required.</strong> Type of the account referenced in the request. */
3129
          public Builder setType(
3130
              PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer.Type type) {
3131
            this.type = type;
×
3132
            return this;
×
3133
          }
3134
        }
3135

3136
        public enum Type implements ApiRequestParams.EnumParam {
×
3137
          @SerializedName("account")
×
3138
          ACCOUNT("account"),
3139

3140
          @SerializedName("self")
×
3141
          SELF("self");
3142

3143
          @Getter(onMethod_ = {@Override})
3144
          private final String value;
3145

3146
          Type(String value) {
×
3147
            this.value = value;
×
3148
          }
×
3149
        }
3150
      }
3151

3152
      @Getter
3153
      public static class RenderingOptions {
3154
        /**
3155
         * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
3156
         * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
3157
         * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in invoice
3158
         * PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive alike)
3159
         * from invoice PDF amounts.
3160
         */
3161
        @SerializedName("amount_tax_display")
3162
        ApiRequestParams.EnumParam amountTaxDisplay;
3163

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

3174
        private RenderingOptions(
3175
            ApiRequestParams.EnumParam amountTaxDisplay, Map<String, Object> extraParams) {
×
3176
          this.amountTaxDisplay = amountTaxDisplay;
×
3177
          this.extraParams = extraParams;
×
3178
        }
×
3179

3180
        public static Builder builder() {
3181
          return new Builder();
×
3182
        }
3183

3184
        public static class Builder {
×
3185
          private ApiRequestParams.EnumParam amountTaxDisplay;
3186

3187
          private Map<String, Object> extraParams;
3188

3189
          /** Finalize and obtain parameter instance from this builder. */
3190
          public PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions build() {
3191
            return new PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions(
×
3192
                this.amountTaxDisplay, this.extraParams);
3193
          }
3194

3195
          /**
3196
           * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
3197
           * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
3198
           * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in
3199
           * invoice PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive
3200
           * alike) from invoice PDF amounts.
3201
           */
3202
          public Builder setAmountTaxDisplay(
3203
              PaymentLinkCreateParams.InvoiceCreation.InvoiceData.RenderingOptions.AmountTaxDisplay
3204
                  amountTaxDisplay) {
3205
            this.amountTaxDisplay = amountTaxDisplay;
×
3206
            return this;
×
3207
          }
3208

3209
          /**
3210
           * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
3211
           * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
3212
           * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in
3213
           * invoice PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive
3214
           * alike) from invoice PDF amounts.
3215
           */
3216
          public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
3217
            this.amountTaxDisplay = amountTaxDisplay;
×
3218
            return this;
×
3219
          }
3220

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

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

3252
        public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
3253
          @SerializedName("exclude_tax")
×
3254
          EXCLUDE_TAX("exclude_tax"),
3255

3256
          @SerializedName("include_inclusive_tax")
×
3257
          INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
3258

3259
          @Getter(onMethod_ = {@Override})
3260
          private final String value;
3261

3262
          AmountTaxDisplay(String value) {
×
3263
            this.value = value;
×
3264
          }
×
3265
        }
3266
      }
3267
    }
3268
  }
3269

3270
  @Getter
3271
  public static class LineItem {
3272
    /**
3273
     * When set, provides configuration for this item’s quantity to be adjusted by the customer
3274
     * during checkout.
3275
     */
3276
    @SerializedName("adjustable_quantity")
3277
    AdjustableQuantity adjustableQuantity;
3278

3279
    /**
3280
     * Map of extra parameters for custom features not available in this client library. The content
3281
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3282
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3283
     * param object. Effectively, this map is flattened to its parent instance.
3284
     */
3285
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3286
    Map<String, Object> extraParams;
3287

3288
    /**
3289
     * <strong>Required.</strong> The ID of the <a
3290
     * href="https://stripe.com/docs/api/prices">Price</a> or <a
3291
     * href="https://stripe.com/docs/api/plans">Plan</a> object.
3292
     */
3293
    @SerializedName("price")
3294
    String price;
3295

3296
    /** <strong>Required.</strong> The quantity of the line item being purchased. */
3297
    @SerializedName("quantity")
3298
    Long quantity;
3299

3300
    private LineItem(
3301
        AdjustableQuantity adjustableQuantity,
3302
        Map<String, Object> extraParams,
3303
        String price,
3304
        Long quantity) {
1✔
3305
      this.adjustableQuantity = adjustableQuantity;
1✔
3306
      this.extraParams = extraParams;
1✔
3307
      this.price = price;
1✔
3308
      this.quantity = quantity;
1✔
3309
    }
1✔
3310

3311
    public static Builder builder() {
3312
      return new Builder();
1✔
3313
    }
3314

3315
    public static class Builder {
1✔
3316
      private AdjustableQuantity adjustableQuantity;
3317

3318
      private Map<String, Object> extraParams;
3319

3320
      private String price;
3321

3322
      private Long quantity;
3323

3324
      /** Finalize and obtain parameter instance from this builder. */
3325
      public PaymentLinkCreateParams.LineItem build() {
3326
        return new PaymentLinkCreateParams.LineItem(
1✔
3327
            this.adjustableQuantity, this.extraParams, this.price, this.quantity);
3328
      }
3329

3330
      /**
3331
       * When set, provides configuration for this item’s quantity to be adjusted by the customer
3332
       * during checkout.
3333
       */
3334
      public Builder setAdjustableQuantity(
3335
          PaymentLinkCreateParams.LineItem.AdjustableQuantity adjustableQuantity) {
3336
        this.adjustableQuantity = adjustableQuantity;
×
3337
        return this;
×
3338
      }
3339

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

3353
      /**
3354
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3355
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3356
       * See {@link PaymentLinkCreateParams.LineItem#extraParams} for the field documentation.
3357
       */
3358
      public Builder putAllExtraParam(Map<String, Object> map) {
3359
        if (this.extraParams == null) {
×
3360
          this.extraParams = new HashMap<>();
×
3361
        }
3362
        this.extraParams.putAll(map);
×
3363
        return this;
×
3364
      }
3365

3366
      /**
3367
       * <strong>Required.</strong> The ID of the <a
3368
       * href="https://stripe.com/docs/api/prices">Price</a> or <a
3369
       * href="https://stripe.com/docs/api/plans">Plan</a> object.
3370
       */
3371
      public Builder setPrice(String price) {
3372
        this.price = price;
1✔
3373
        return this;
1✔
3374
      }
3375

3376
      /** <strong>Required.</strong> The quantity of the line item being purchased. */
3377
      public Builder setQuantity(Long quantity) {
3378
        this.quantity = quantity;
1✔
3379
        return this;
1✔
3380
      }
3381
    }
3382

3383
    @Getter
3384
    public static class AdjustableQuantity {
3385
      /**
3386
       * <strong>Required.</strong> Set to true if the quantity can be adjusted to any non-negative
3387
       * Integer.
3388
       */
3389
      @SerializedName("enabled")
3390
      Boolean enabled;
3391

3392
      /**
3393
       * Map of extra parameters for custom features not available in this client library. The
3394
       * content in this map is not serialized under this field's {@code @SerializedName} value.
3395
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
3396
       * name in this param object. Effectively, this map is flattened to its parent instance.
3397
       */
3398
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3399
      Map<String, Object> extraParams;
3400

3401
      /**
3402
       * The maximum quantity the customer can purchase. By default this value is 99. You can
3403
       * specify a value up to 999.
3404
       */
3405
      @SerializedName("maximum")
3406
      Long maximum;
3407

3408
      /**
3409
       * The minimum quantity the customer can purchase. By default this value is 0. If there is
3410
       * only one item in the cart then that item's quantity cannot go down to 0.
3411
       */
3412
      @SerializedName("minimum")
3413
      Long minimum;
3414

3415
      private AdjustableQuantity(
3416
          Boolean enabled, Map<String, Object> extraParams, Long maximum, Long minimum) {
×
3417
        this.enabled = enabled;
×
3418
        this.extraParams = extraParams;
×
3419
        this.maximum = maximum;
×
3420
        this.minimum = minimum;
×
3421
      }
×
3422

3423
      public static Builder builder() {
3424
        return new Builder();
×
3425
      }
3426

3427
      public static class Builder {
×
3428
        private Boolean enabled;
3429

3430
        private Map<String, Object> extraParams;
3431

3432
        private Long maximum;
3433

3434
        private Long minimum;
3435

3436
        /** Finalize and obtain parameter instance from this builder. */
3437
        public PaymentLinkCreateParams.LineItem.AdjustableQuantity build() {
3438
          return new PaymentLinkCreateParams.LineItem.AdjustableQuantity(
×
3439
              this.enabled, this.extraParams, this.maximum, this.minimum);
3440
        }
3441

3442
        /**
3443
         * <strong>Required.</strong> Set to true if the quantity can be adjusted to any
3444
         * non-negative Integer.
3445
         */
3446
        public Builder setEnabled(Boolean enabled) {
3447
          this.enabled = enabled;
×
3448
          return this;
×
3449
        }
3450

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

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

3479
        /**
3480
         * The maximum quantity the customer can purchase. By default this value is 99. You can
3481
         * specify a value up to 999.
3482
         */
3483
        public Builder setMaximum(Long maximum) {
3484
          this.maximum = maximum;
×
3485
          return this;
×
3486
        }
3487

3488
        /**
3489
         * The minimum quantity the customer can purchase. By default this value is 0. If there is
3490
         * only one item in the cart then that item's quantity cannot go down to 0.
3491
         */
3492
        public Builder setMinimum(Long minimum) {
3493
          this.minimum = minimum;
×
3494
          return this;
×
3495
        }
3496
      }
3497
    }
3498
  }
3499

3500
  @Getter
3501
  public static class PaymentIntentData {
3502
    /** Controls when the funds will be captured from the customer's account. */
3503
    @SerializedName("capture_method")
3504
    CaptureMethod captureMethod;
3505

3506
    /** An arbitrary string attached to the object. Often useful for displaying to users. */
3507
    @SerializedName("description")
3508
    String description;
3509

3510
    /**
3511
     * Map of extra parameters for custom features not available in this client library. The content
3512
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3513
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3514
     * param object. Effectively, this map is flattened to its parent instance.
3515
     */
3516
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3517
    Map<String, Object> extraParams;
3518

3519
    /**
3520
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
3521
     * declaratively set metadata on <a href="https://stripe.com/docs/api/payment_intents">Payment
3522
     * Intents</a> generated from this payment link. Unlike object-level metadata, this field is
3523
     * declarative. Updates will clear prior values.
3524
     */
3525
    @SerializedName("metadata")
3526
    Map<String, String> metadata;
3527

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

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

3566
    /**
3567
     * Provides information about a card charge. Concatenated to the account's <a
3568
     * href="https://docs.stripe.com/get-started/account/statement-descriptors#static">statement
3569
     * descriptor prefix</a> to form the complete statement descriptor that appears on the
3570
     * customer's statement.
3571
     */
3572
    @SerializedName("statement_descriptor_suffix")
3573
    String statementDescriptorSuffix;
3574

3575
    /**
3576
     * A string that identifies the resulting payment as part of a group. See the PaymentIntents <a
3577
     * href="https://stripe.com/docs/connect/separate-charges-and-transfers">use case for connected
3578
     * accounts</a> for details.
3579
     */
3580
    @SerializedName("transfer_group")
3581
    String transferGroup;
3582

3583
    private PaymentIntentData(
3584
        CaptureMethod captureMethod,
3585
        String description,
3586
        Map<String, Object> extraParams,
3587
        Map<String, String> metadata,
3588
        SetupFutureUsage setupFutureUsage,
3589
        String statementDescriptor,
3590
        String statementDescriptorSuffix,
3591
        String transferGroup) {
×
3592
      this.captureMethod = captureMethod;
×
3593
      this.description = description;
×
3594
      this.extraParams = extraParams;
×
3595
      this.metadata = metadata;
×
3596
      this.setupFutureUsage = setupFutureUsage;
×
3597
      this.statementDescriptor = statementDescriptor;
×
3598
      this.statementDescriptorSuffix = statementDescriptorSuffix;
×
3599
      this.transferGroup = transferGroup;
×
3600
    }
×
3601

3602
    public static Builder builder() {
3603
      return new Builder();
×
3604
    }
3605

3606
    public static class Builder {
×
3607
      private CaptureMethod captureMethod;
3608

3609
      private String description;
3610

3611
      private Map<String, Object> extraParams;
3612

3613
      private Map<String, String> metadata;
3614

3615
      private SetupFutureUsage setupFutureUsage;
3616

3617
      private String statementDescriptor;
3618

3619
      private String statementDescriptorSuffix;
3620

3621
      private String transferGroup;
3622

3623
      /** Finalize and obtain parameter instance from this builder. */
3624
      public PaymentLinkCreateParams.PaymentIntentData build() {
3625
        return new PaymentLinkCreateParams.PaymentIntentData(
×
3626
            this.captureMethod,
3627
            this.description,
3628
            this.extraParams,
3629
            this.metadata,
3630
            this.setupFutureUsage,
3631
            this.statementDescriptor,
3632
            this.statementDescriptorSuffix,
3633
            this.transferGroup);
3634
      }
3635

3636
      /** Controls when the funds will be captured from the customer's account. */
3637
      public Builder setCaptureMethod(
3638
          PaymentLinkCreateParams.PaymentIntentData.CaptureMethod captureMethod) {
3639
        this.captureMethod = captureMethod;
×
3640
        return this;
×
3641
      }
3642

3643
      /** An arbitrary string attached to the object. Often useful for displaying to users. */
3644
      public Builder setDescription(String description) {
3645
        this.description = description;
×
3646
        return this;
×
3647
      }
3648

3649
      /**
3650
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3651
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3652
       * PaymentLinkCreateParams.PaymentIntentData#extraParams} for the field documentation.
3653
       */
3654
      public Builder putExtraParam(String key, Object value) {
3655
        if (this.extraParams == null) {
×
3656
          this.extraParams = new HashMap<>();
×
3657
        }
3658
        this.extraParams.put(key, value);
×
3659
        return this;
×
3660
      }
3661

3662
      /**
3663
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3664
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3665
       * See {@link PaymentLinkCreateParams.PaymentIntentData#extraParams} for the field
3666
       * documentation.
3667
       */
3668
      public Builder putAllExtraParam(Map<String, Object> map) {
3669
        if (this.extraParams == null) {
×
3670
          this.extraParams = new HashMap<>();
×
3671
        }
3672
        this.extraParams.putAll(map);
×
3673
        return this;
×
3674
      }
3675

3676
      /**
3677
       * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
3678
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3679
       * PaymentLinkCreateParams.PaymentIntentData#metadata} for the field documentation.
3680
       */
3681
      public Builder putMetadata(String key, String value) {
3682
        if (this.metadata == null) {
×
3683
          this.metadata = new HashMap<>();
×
3684
        }
3685
        this.metadata.put(key, value);
×
3686
        return this;
×
3687
      }
3688

3689
      /**
3690
       * Add all map key/value pairs to `metadata` map. A map is initialized for the first
3691
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3692
       * See {@link PaymentLinkCreateParams.PaymentIntentData#metadata} for the field documentation.
3693
       */
3694
      public Builder putAllMetadata(Map<String, String> map) {
3695
        if (this.metadata == null) {
×
3696
          this.metadata = new HashMap<>();
×
3697
        }
3698
        this.metadata.putAll(map);
×
3699
        return this;
×
3700
      }
3701

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

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

3746
      /**
3747
       * Provides information about a card charge. Concatenated to the account's <a
3748
       * href="https://docs.stripe.com/get-started/account/statement-descriptors#static">statement
3749
       * descriptor prefix</a> to form the complete statement descriptor that appears on the
3750
       * customer's statement.
3751
       */
3752
      public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) {
3753
        this.statementDescriptorSuffix = statementDescriptorSuffix;
×
3754
        return this;
×
3755
      }
3756

3757
      /**
3758
       * A string that identifies the resulting payment as part of a group. See the PaymentIntents
3759
       * <a href="https://stripe.com/docs/connect/separate-charges-and-transfers">use case for
3760
       * connected accounts</a> for details.
3761
       */
3762
      public Builder setTransferGroup(String transferGroup) {
3763
        this.transferGroup = transferGroup;
×
3764
        return this;
×
3765
      }
3766
    }
3767

3768
    public enum CaptureMethod implements ApiRequestParams.EnumParam {
×
3769
      @SerializedName("automatic")
×
3770
      AUTOMATIC("automatic"),
3771

3772
      @SerializedName("automatic_async")
×
3773
      AUTOMATIC_ASYNC("automatic_async"),
3774

3775
      @SerializedName("manual")
×
3776
      MANUAL("manual");
3777

3778
      @Getter(onMethod_ = {@Override})
3779
      private final String value;
3780

3781
      CaptureMethod(String value) {
×
3782
        this.value = value;
×
3783
      }
×
3784
    }
3785

3786
    public enum SetupFutureUsage implements ApiRequestParams.EnumParam {
×
3787
      @SerializedName("off_session")
×
3788
      OFF_SESSION("off_session"),
3789

3790
      @SerializedName("on_session")
×
3791
      ON_SESSION("on_session");
3792

3793
      @Getter(onMethod_ = {@Override})
3794
      private final String value;
3795

3796
      SetupFutureUsage(String value) {
×
3797
        this.value = value;
×
3798
      }
×
3799
    }
3800
  }
3801

3802
  @Getter
3803
  public static class PhoneNumberCollection {
3804
    /** <strong>Required.</strong> Set to {@code true} to enable phone number collection. */
3805
    @SerializedName("enabled")
3806
    Boolean enabled;
3807

3808
    /**
3809
     * Map of extra parameters for custom features not available in this client library. The content
3810
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3811
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3812
     * param object. Effectively, this map is flattened to its parent instance.
3813
     */
3814
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3815
    Map<String, Object> extraParams;
3816

3817
    private PhoneNumberCollection(Boolean enabled, Map<String, Object> extraParams) {
×
3818
      this.enabled = enabled;
×
3819
      this.extraParams = extraParams;
×
3820
    }
×
3821

3822
    public static Builder builder() {
3823
      return new Builder();
×
3824
    }
3825

3826
    public static class Builder {
×
3827
      private Boolean enabled;
3828

3829
      private Map<String, Object> extraParams;
3830

3831
      /** Finalize and obtain parameter instance from this builder. */
3832
      public PaymentLinkCreateParams.PhoneNumberCollection build() {
3833
        return new PaymentLinkCreateParams.PhoneNumberCollection(this.enabled, this.extraParams);
×
3834
      }
3835

3836
      /** <strong>Required.</strong> Set to {@code true} to enable phone number collection. */
3837
      public Builder setEnabled(Boolean enabled) {
3838
        this.enabled = enabled;
×
3839
        return this;
×
3840
      }
3841

3842
      /**
3843
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3844
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3845
       * PaymentLinkCreateParams.PhoneNumberCollection#extraParams} for the field documentation.
3846
       */
3847
      public Builder putExtraParam(String key, Object value) {
3848
        if (this.extraParams == null) {
×
3849
          this.extraParams = new HashMap<>();
×
3850
        }
3851
        this.extraParams.put(key, value);
×
3852
        return this;
×
3853
      }
3854

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

3871
  @Getter
3872
  public static class Restrictions {
3873
    /**
3874
     * <strong>Required.</strong> Configuration for the {@code completed_sessions} restriction type.
3875
     */
3876
    @SerializedName("completed_sessions")
3877
    CompletedSessions completedSessions;
3878

3879
    /**
3880
     * Map of extra parameters for custom features not available in this client library. The content
3881
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
3882
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
3883
     * param object. Effectively, this map is flattened to its parent instance.
3884
     */
3885
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3886
    Map<String, Object> extraParams;
3887

3888
    private Restrictions(CompletedSessions completedSessions, Map<String, Object> extraParams) {
×
3889
      this.completedSessions = completedSessions;
×
3890
      this.extraParams = extraParams;
×
3891
    }
×
3892

3893
    public static Builder builder() {
3894
      return new Builder();
×
3895
    }
3896

3897
    public static class Builder {
×
3898
      private CompletedSessions completedSessions;
3899

3900
      private Map<String, Object> extraParams;
3901

3902
      /** Finalize and obtain parameter instance from this builder. */
3903
      public PaymentLinkCreateParams.Restrictions build() {
3904
        return new PaymentLinkCreateParams.Restrictions(this.completedSessions, this.extraParams);
×
3905
      }
3906

3907
      /**
3908
       * <strong>Required.</strong> Configuration for the {@code completed_sessions} restriction
3909
       * type.
3910
       */
3911
      public Builder setCompletedSessions(
3912
          PaymentLinkCreateParams.Restrictions.CompletedSessions completedSessions) {
3913
        this.completedSessions = completedSessions;
×
3914
        return this;
×
3915
      }
3916

3917
      /**
3918
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
3919
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
3920
       * PaymentLinkCreateParams.Restrictions#extraParams} for the field documentation.
3921
       */
3922
      public Builder putExtraParam(String key, Object value) {
3923
        if (this.extraParams == null) {
×
3924
          this.extraParams = new HashMap<>();
×
3925
        }
3926
        this.extraParams.put(key, value);
×
3927
        return this;
×
3928
      }
3929

3930
      /**
3931
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3932
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
3933
       * See {@link PaymentLinkCreateParams.Restrictions#extraParams} for the field documentation.
3934
       */
3935
      public Builder putAllExtraParam(Map<String, Object> map) {
3936
        if (this.extraParams == null) {
×
3937
          this.extraParams = new HashMap<>();
×
3938
        }
3939
        this.extraParams.putAll(map);
×
3940
        return this;
×
3941
      }
3942
    }
3943

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

3955
      /**
3956
       * <strong>Required.</strong> The maximum number of checkout sessions that can be completed
3957
       * for the {@code completed_sessions} restriction to be met.
3958
       */
3959
      @SerializedName("limit")
3960
      Long limit;
3961

3962
      private CompletedSessions(Map<String, Object> extraParams, Long limit) {
×
3963
        this.extraParams = extraParams;
×
3964
        this.limit = limit;
×
3965
      }
×
3966

3967
      public static Builder builder() {
3968
        return new Builder();
×
3969
      }
3970

3971
      public static class Builder {
×
3972
        private Map<String, Object> extraParams;
3973

3974
        private Long limit;
3975

3976
        /** Finalize and obtain parameter instance from this builder. */
3977
        public PaymentLinkCreateParams.Restrictions.CompletedSessions build() {
3978
          return new PaymentLinkCreateParams.Restrictions.CompletedSessions(
×
3979
              this.extraParams, this.limit);
3980
        }
3981

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

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

4010
        /**
4011
         * <strong>Required.</strong> The maximum number of checkout sessions that can be completed
4012
         * for the {@code completed_sessions} restriction to be met.
4013
         */
4014
        public Builder setLimit(Long limit) {
4015
          this.limit = limit;
×
4016
          return this;
×
4017
        }
4018
      }
4019
    }
4020
  }
4021

4022
  @Getter
4023
  public static class ShippingAddressCollection {
4024
    /**
4025
     * <strong>Required.</strong> An array of two-letter ISO country codes representing which
4026
     * countries Checkout should provide as options for shipping locations.
4027
     */
4028
    @SerializedName("allowed_countries")
4029
    List<PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry> allowedCountries;
4030

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

4040
    private ShippingAddressCollection(
4041
        List<PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry> allowedCountries,
4042
        Map<String, Object> extraParams) {
×
4043
      this.allowedCountries = allowedCountries;
×
4044
      this.extraParams = extraParams;
×
4045
    }
×
4046

4047
    public static Builder builder() {
4048
      return new Builder();
×
4049
    }
4050

4051
    public static class Builder {
×
4052
      private List<PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry>
4053
          allowedCountries;
4054

4055
      private Map<String, Object> extraParams;
4056

4057
      /** Finalize and obtain parameter instance from this builder. */
4058
      public PaymentLinkCreateParams.ShippingAddressCollection build() {
4059
        return new PaymentLinkCreateParams.ShippingAddressCollection(
×
4060
            this.allowedCountries, this.extraParams);
4061
      }
4062

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

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

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

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

4121
    public enum AllowedCountry implements ApiRequestParams.EnumParam {
×
4122
      @SerializedName("AC")
×
4123
      AC("AC"),
4124

4125
      @SerializedName("AD")
×
4126
      AD("AD"),
4127

4128
      @SerializedName("AE")
×
4129
      AE("AE"),
4130

4131
      @SerializedName("AF")
×
4132
      AF("AF"),
4133

4134
      @SerializedName("AG")
×
4135
      AG("AG"),
4136

4137
      @SerializedName("AI")
×
4138
      AI("AI"),
4139

4140
      @SerializedName("AL")
×
4141
      AL("AL"),
4142

4143
      @SerializedName("AM")
×
4144
      AM("AM"),
4145

4146
      @SerializedName("AO")
×
4147
      AO("AO"),
4148

4149
      @SerializedName("AQ")
×
4150
      AQ("AQ"),
4151

4152
      @SerializedName("AR")
×
4153
      AR("AR"),
4154

4155
      @SerializedName("AT")
×
4156
      AT("AT"),
4157

4158
      @SerializedName("AU")
×
4159
      AU("AU"),
4160

4161
      @SerializedName("AW")
×
4162
      AW("AW"),
4163

4164
      @SerializedName("AX")
×
4165
      AX("AX"),
4166

4167
      @SerializedName("AZ")
×
4168
      AZ("AZ"),
4169

4170
      @SerializedName("BA")
×
4171
      BA("BA"),
4172

4173
      @SerializedName("BB")
×
4174
      BB("BB"),
4175

4176
      @SerializedName("BD")
×
4177
      BD("BD"),
4178

4179
      @SerializedName("BE")
×
4180
      BE("BE"),
4181

4182
      @SerializedName("BF")
×
4183
      BF("BF"),
4184

4185
      @SerializedName("BG")
×
4186
      BG("BG"),
4187

4188
      @SerializedName("BH")
×
4189
      BH("BH"),
4190

4191
      @SerializedName("BI")
×
4192
      BI("BI"),
4193

4194
      @SerializedName("BJ")
×
4195
      BJ("BJ"),
4196

4197
      @SerializedName("BL")
×
4198
      BL("BL"),
4199

4200
      @SerializedName("BM")
×
4201
      BM("BM"),
4202

4203
      @SerializedName("BN")
×
4204
      BN("BN"),
4205

4206
      @SerializedName("BO")
×
4207
      BO("BO"),
4208

4209
      @SerializedName("BQ")
×
4210
      BQ("BQ"),
4211

4212
      @SerializedName("BR")
×
4213
      BR("BR"),
4214

4215
      @SerializedName("BS")
×
4216
      BS("BS"),
4217

4218
      @SerializedName("BT")
×
4219
      BT("BT"),
4220

4221
      @SerializedName("BV")
×
4222
      BV("BV"),
4223

4224
      @SerializedName("BW")
×
4225
      BW("BW"),
4226

4227
      @SerializedName("BY")
×
4228
      BY("BY"),
4229

4230
      @SerializedName("BZ")
×
4231
      BZ("BZ"),
4232

4233
      @SerializedName("CA")
×
4234
      CA("CA"),
4235

4236
      @SerializedName("CD")
×
4237
      CD("CD"),
4238

4239
      @SerializedName("CF")
×
4240
      CF("CF"),
4241

4242
      @SerializedName("CG")
×
4243
      CG("CG"),
4244

4245
      @SerializedName("CH")
×
4246
      CH("CH"),
4247

4248
      @SerializedName("CI")
×
4249
      CI("CI"),
4250

4251
      @SerializedName("CK")
×
4252
      CK("CK"),
4253

4254
      @SerializedName("CL")
×
4255
      CL("CL"),
4256

4257
      @SerializedName("CM")
×
4258
      CM("CM"),
4259

4260
      @SerializedName("CN")
×
4261
      CN("CN"),
4262

4263
      @SerializedName("CO")
×
4264
      CO("CO"),
4265

4266
      @SerializedName("CR")
×
4267
      CR("CR"),
4268

4269
      @SerializedName("CV")
×
4270
      CV("CV"),
4271

4272
      @SerializedName("CW")
×
4273
      CW("CW"),
4274

4275
      @SerializedName("CY")
×
4276
      CY("CY"),
4277

4278
      @SerializedName("CZ")
×
4279
      CZ("CZ"),
4280

4281
      @SerializedName("DE")
×
4282
      DE("DE"),
4283

4284
      @SerializedName("DJ")
×
4285
      DJ("DJ"),
4286

4287
      @SerializedName("DK")
×
4288
      DK("DK"),
4289

4290
      @SerializedName("DM")
×
4291
      DM("DM"),
4292

4293
      @SerializedName("DO")
×
4294
      DO("DO"),
4295

4296
      @SerializedName("DZ")
×
4297
      DZ("DZ"),
4298

4299
      @SerializedName("EC")
×
4300
      EC("EC"),
4301

4302
      @SerializedName("EE")
×
4303
      EE("EE"),
4304

4305
      @SerializedName("EG")
×
4306
      EG("EG"),
4307

4308
      @SerializedName("EH")
×
4309
      EH("EH"),
4310

4311
      @SerializedName("ER")
×
4312
      ER("ER"),
4313

4314
      @SerializedName("ES")
×
4315
      ES("ES"),
4316

4317
      @SerializedName("ET")
×
4318
      ET("ET"),
4319

4320
      @SerializedName("FI")
×
4321
      FI("FI"),
4322

4323
      @SerializedName("FJ")
×
4324
      FJ("FJ"),
4325

4326
      @SerializedName("FK")
×
4327
      FK("FK"),
4328

4329
      @SerializedName("FO")
×
4330
      FO("FO"),
4331

4332
      @SerializedName("FR")
×
4333
      FR("FR"),
4334

4335
      @SerializedName("GA")
×
4336
      GA("GA"),
4337

4338
      @SerializedName("GB")
×
4339
      GB("GB"),
4340

4341
      @SerializedName("GD")
×
4342
      GD("GD"),
4343

4344
      @SerializedName("GE")
×
4345
      GE("GE"),
4346

4347
      @SerializedName("GF")
×
4348
      GF("GF"),
4349

4350
      @SerializedName("GG")
×
4351
      GG("GG"),
4352

4353
      @SerializedName("GH")
×
4354
      GH("GH"),
4355

4356
      @SerializedName("GI")
×
4357
      GI("GI"),
4358

4359
      @SerializedName("GL")
×
4360
      GL("GL"),
4361

4362
      @SerializedName("GM")
×
4363
      GM("GM"),
4364

4365
      @SerializedName("GN")
×
4366
      GN("GN"),
4367

4368
      @SerializedName("GP")
×
4369
      GP("GP"),
4370

4371
      @SerializedName("GQ")
×
4372
      GQ("GQ"),
4373

4374
      @SerializedName("GR")
×
4375
      GR("GR"),
4376

4377
      @SerializedName("GS")
×
4378
      GS("GS"),
4379

4380
      @SerializedName("GT")
×
4381
      GT("GT"),
4382

4383
      @SerializedName("GU")
×
4384
      GU("GU"),
4385

4386
      @SerializedName("GW")
×
4387
      GW("GW"),
4388

4389
      @SerializedName("GY")
×
4390
      GY("GY"),
4391

4392
      @SerializedName("HK")
×
4393
      HK("HK"),
4394

4395
      @SerializedName("HN")
×
4396
      HN("HN"),
4397

4398
      @SerializedName("HR")
×
4399
      HR("HR"),
4400

4401
      @SerializedName("HT")
×
4402
      HT("HT"),
4403

4404
      @SerializedName("HU")
×
4405
      HU("HU"),
4406

4407
      @SerializedName("ID")
×
4408
      ID("ID"),
4409

4410
      @SerializedName("IE")
×
4411
      IE("IE"),
4412

4413
      @SerializedName("IL")
×
4414
      IL("IL"),
4415

4416
      @SerializedName("IM")
×
4417
      IM("IM"),
4418

4419
      @SerializedName("IN")
×
4420
      IN("IN"),
4421

4422
      @SerializedName("IO")
×
4423
      IO("IO"),
4424

4425
      @SerializedName("IQ")
×
4426
      IQ("IQ"),
4427

4428
      @SerializedName("IS")
×
4429
      IS("IS"),
4430

4431
      @SerializedName("IT")
×
4432
      IT("IT"),
4433

4434
      @SerializedName("JE")
×
4435
      JE("JE"),
4436

4437
      @SerializedName("JM")
×
4438
      JM("JM"),
4439

4440
      @SerializedName("JO")
×
4441
      JO("JO"),
4442

4443
      @SerializedName("JP")
×
4444
      JP("JP"),
4445

4446
      @SerializedName("KE")
×
4447
      KE("KE"),
4448

4449
      @SerializedName("KG")
×
4450
      KG("KG"),
4451

4452
      @SerializedName("KH")
×
4453
      KH("KH"),
4454

4455
      @SerializedName("KI")
×
4456
      KI("KI"),
4457

4458
      @SerializedName("KM")
×
4459
      KM("KM"),
4460

4461
      @SerializedName("KN")
×
4462
      KN("KN"),
4463

4464
      @SerializedName("KR")
×
4465
      KR("KR"),
4466

4467
      @SerializedName("KW")
×
4468
      KW("KW"),
4469

4470
      @SerializedName("KY")
×
4471
      KY("KY"),
4472

4473
      @SerializedName("KZ")
×
4474
      KZ("KZ"),
4475

4476
      @SerializedName("LA")
×
4477
      LA("LA"),
4478

4479
      @SerializedName("LB")
×
4480
      LB("LB"),
4481

4482
      @SerializedName("LC")
×
4483
      LC("LC"),
4484

4485
      @SerializedName("LI")
×
4486
      LI("LI"),
4487

4488
      @SerializedName("LK")
×
4489
      LK("LK"),
4490

4491
      @SerializedName("LR")
×
4492
      LR("LR"),
4493

4494
      @SerializedName("LS")
×
4495
      LS("LS"),
4496

4497
      @SerializedName("LT")
×
4498
      LT("LT"),
4499

4500
      @SerializedName("LU")
×
4501
      LU("LU"),
4502

4503
      @SerializedName("LV")
×
4504
      LV("LV"),
4505

4506
      @SerializedName("LY")
×
4507
      LY("LY"),
4508

4509
      @SerializedName("MA")
×
4510
      MA("MA"),
4511

4512
      @SerializedName("MC")
×
4513
      MC("MC"),
4514

4515
      @SerializedName("MD")
×
4516
      MD("MD"),
4517

4518
      @SerializedName("ME")
×
4519
      ME("ME"),
4520

4521
      @SerializedName("MF")
×
4522
      MF("MF"),
4523

4524
      @SerializedName("MG")
×
4525
      MG("MG"),
4526

4527
      @SerializedName("MK")
×
4528
      MK("MK"),
4529

4530
      @SerializedName("ML")
×
4531
      ML("ML"),
4532

4533
      @SerializedName("MM")
×
4534
      MM("MM"),
4535

4536
      @SerializedName("MN")
×
4537
      MN("MN"),
4538

4539
      @SerializedName("MO")
×
4540
      MO("MO"),
4541

4542
      @SerializedName("MQ")
×
4543
      MQ("MQ"),
4544

4545
      @SerializedName("MR")
×
4546
      MR("MR"),
4547

4548
      @SerializedName("MS")
×
4549
      MS("MS"),
4550

4551
      @SerializedName("MT")
×
4552
      MT("MT"),
4553

4554
      @SerializedName("MU")
×
4555
      MU("MU"),
4556

4557
      @SerializedName("MV")
×
4558
      MV("MV"),
4559

4560
      @SerializedName("MW")
×
4561
      MW("MW"),
4562

4563
      @SerializedName("MX")
×
4564
      MX("MX"),
4565

4566
      @SerializedName("MY")
×
4567
      MY("MY"),
4568

4569
      @SerializedName("MZ")
×
4570
      MZ("MZ"),
4571

4572
      @SerializedName("NA")
×
4573
      NA("NA"),
4574

4575
      @SerializedName("NC")
×
4576
      NC("NC"),
4577

4578
      @SerializedName("NE")
×
4579
      NE("NE"),
4580

4581
      @SerializedName("NG")
×
4582
      NG("NG"),
4583

4584
      @SerializedName("NI")
×
4585
      NI("NI"),
4586

4587
      @SerializedName("NL")
×
4588
      NL("NL"),
4589

4590
      @SerializedName("NO")
×
4591
      NO("NO"),
4592

4593
      @SerializedName("NP")
×
4594
      NP("NP"),
4595

4596
      @SerializedName("NR")
×
4597
      NR("NR"),
4598

4599
      @SerializedName("NU")
×
4600
      NU("NU"),
4601

4602
      @SerializedName("NZ")
×
4603
      NZ("NZ"),
4604

4605
      @SerializedName("OM")
×
4606
      OM("OM"),
4607

4608
      @SerializedName("PA")
×
4609
      PA("PA"),
4610

4611
      @SerializedName("PE")
×
4612
      PE("PE"),
4613

4614
      @SerializedName("PF")
×
4615
      PF("PF"),
4616

4617
      @SerializedName("PG")
×
4618
      PG("PG"),
4619

4620
      @SerializedName("PH")
×
4621
      PH("PH"),
4622

4623
      @SerializedName("PK")
×
4624
      PK("PK"),
4625

4626
      @SerializedName("PL")
×
4627
      PL("PL"),
4628

4629
      @SerializedName("PM")
×
4630
      PM("PM"),
4631

4632
      @SerializedName("PN")
×
4633
      PN("PN"),
4634

4635
      @SerializedName("PR")
×
4636
      PR("PR"),
4637

4638
      @SerializedName("PS")
×
4639
      PS("PS"),
4640

4641
      @SerializedName("PT")
×
4642
      PT("PT"),
4643

4644
      @SerializedName("PY")
×
4645
      PY("PY"),
4646

4647
      @SerializedName("QA")
×
4648
      QA("QA"),
4649

4650
      @SerializedName("RE")
×
4651
      RE("RE"),
4652

4653
      @SerializedName("RO")
×
4654
      RO("RO"),
4655

4656
      @SerializedName("RS")
×
4657
      RS("RS"),
4658

4659
      @SerializedName("RU")
×
4660
      RU("RU"),
4661

4662
      @SerializedName("RW")
×
4663
      RW("RW"),
4664

4665
      @SerializedName("SA")
×
4666
      SA("SA"),
4667

4668
      @SerializedName("SB")
×
4669
      SB("SB"),
4670

4671
      @SerializedName("SC")
×
4672
      SC("SC"),
4673

4674
      @SerializedName("SE")
×
4675
      SE("SE"),
4676

UNCOV
4677
      @SerializedName("SG")
×
4678
      SG("SG"),
4679

4680
      @SerializedName("SH")
×
4681
      SH("SH"),
4682

4683
      @SerializedName("SI")
×
4684
      SI("SI"),
4685

4686
      @SerializedName("SJ")
×
4687
      SJ("SJ"),
4688

4689
      @SerializedName("SK")
×
4690
      SK("SK"),
4691

4692
      @SerializedName("SL")
×
4693
      SL("SL"),
4694

4695
      @SerializedName("SM")
×
4696
      SM("SM"),
4697

4698
      @SerializedName("SN")
×
4699
      SN("SN"),
4700

4701
      @SerializedName("SO")
×
4702
      SO("SO"),
4703

4704
      @SerializedName("SR")
×
4705
      SR("SR"),
4706

4707
      @SerializedName("SS")
×
4708
      SS("SS"),
4709

4710
      @SerializedName("ST")
×
4711
      ST("ST"),
4712

4713
      @SerializedName("SV")
×
4714
      SV("SV"),
4715

4716
      @SerializedName("SX")
×
4717
      SX("SX"),
4718

4719
      @SerializedName("SZ")
×
4720
      SZ("SZ"),
4721

4722
      @SerializedName("TA")
×
4723
      TA("TA"),
4724

4725
      @SerializedName("TC")
×
4726
      TC("TC"),
4727

4728
      @SerializedName("TD")
×
4729
      TD("TD"),
4730

4731
      @SerializedName("TF")
×
4732
      TF("TF"),
4733

4734
      @SerializedName("TG")
×
4735
      TG("TG"),
4736

4737
      @SerializedName("TH")
×
4738
      TH("TH"),
4739

4740
      @SerializedName("TJ")
×
4741
      TJ("TJ"),
4742

4743
      @SerializedName("TK")
×
4744
      TK("TK"),
4745

4746
      @SerializedName("TL")
×
4747
      TL("TL"),
4748

4749
      @SerializedName("TM")
×
4750
      TM("TM"),
4751

4752
      @SerializedName("TN")
×
4753
      TN("TN"),
4754

4755
      @SerializedName("TO")
×
4756
      TO("TO"),
4757

4758
      @SerializedName("TR")
×
4759
      TR("TR"),
4760

4761
      @SerializedName("TT")
×
4762
      TT("TT"),
4763

4764
      @SerializedName("TV")
×
4765
      TV("TV"),
4766

4767
      @SerializedName("TW")
×
4768
      TW("TW"),
4769

4770
      @SerializedName("TZ")
×
4771
      TZ("TZ"),
4772

4773
      @SerializedName("UA")
×
4774
      UA("UA"),
4775

4776
      @SerializedName("UG")
×
4777
      UG("UG"),
4778

4779
      @SerializedName("US")
×
4780
      US("US"),
4781

4782
      @SerializedName("UY")
×
4783
      UY("UY"),
4784

4785
      @SerializedName("UZ")
×
4786
      UZ("UZ"),
4787

4788
      @SerializedName("VA")
×
4789
      VA("VA"),
4790

4791
      @SerializedName("VC")
×
4792
      VC("VC"),
4793

4794
      @SerializedName("VE")
×
4795
      VE("VE"),
4796

4797
      @SerializedName("VG")
×
4798
      VG("VG"),
4799

4800
      @SerializedName("VN")
×
4801
      VN("VN"),
4802

4803
      @SerializedName("VU")
×
4804
      VU("VU"),
4805

4806
      @SerializedName("WF")
×
4807
      WF("WF"),
4808

4809
      @SerializedName("WS")
×
4810
      WS("WS"),
4811

4812
      @SerializedName("XK")
×
4813
      XK("XK"),
4814

4815
      @SerializedName("YE")
×
4816
      YE("YE"),
4817

4818
      @SerializedName("YT")
×
4819
      YT("YT"),
4820

4821
      @SerializedName("ZA")
×
4822
      ZA("ZA"),
4823

4824
      @SerializedName("ZM")
×
4825
      ZM("ZM"),
4826

4827
      @SerializedName("ZW")
×
4828
      ZW("ZW"),
4829

4830
      @SerializedName("ZZ")
×
4831
      ZZ("ZZ");
4832

4833
      @Getter(onMethod_ = {@Override})
4834
      private final String value;
4835

UNCOV
4836
      AllowedCountry(String value) {
×
UNCOV
4837
        this.value = value;
×
UNCOV
4838
      }
×
4839
    }
4840
  }
4841

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

4853
    /** The ID of the Shipping Rate to use for this shipping option. */
4854
    @SerializedName("shipping_rate")
4855
    String shippingRate;
4856

UNCOV
4857
    private ShippingOption(Map<String, Object> extraParams, String shippingRate) {
×
UNCOV
4858
      this.extraParams = extraParams;
×
UNCOV
4859
      this.shippingRate = shippingRate;
×
4860
    }
×
4861

4862
    public static Builder builder() {
4863
      return new Builder();
×
4864
    }
4865

4866
    public static class Builder {
×
4867
      private Map<String, Object> extraParams;
4868

4869
      private String shippingRate;
4870

4871
      /** Finalize and obtain parameter instance from this builder. */
4872
      public PaymentLinkCreateParams.ShippingOption build() {
UNCOV
4873
        return new PaymentLinkCreateParams.ShippingOption(this.extraParams, this.shippingRate);
×
4874
      }
4875

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

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

4902
      /** The ID of the Shipping Rate to use for this shipping option. */
4903
      public Builder setShippingRate(String shippingRate) {
UNCOV
4904
        this.shippingRate = shippingRate;
×
UNCOV
4905
        return this;
×
4906
      }
4907
    }
4908
  }
4909

4910
  @Getter
4911
  public static class SubscriptionData {
4912
    /**
4913
     * The subscription's description, meant to be displayable to the customer. Use this field to
4914
     * optionally store an explanation of the subscription for rendering in Stripe surfaces and
4915
     * certain local payment methods UIs.
4916
     */
4917
    @SerializedName("description")
4918
    String description;
4919

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

4929
    /** All invoices will be billed using the specified settings. */
4930
    @SerializedName("invoice_settings")
4931
    InvoiceSettings invoiceSettings;
4932

4933
    /**
4934
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
4935
     * declaratively set metadata on <a
4936
     * href="https://stripe.com/docs/api/subscriptions">Subscriptions</a> generated from this
4937
     * payment link. Unlike object-level metadata, this field is declarative. Updates will clear
4938
     * prior values.
4939
     */
4940
    @SerializedName("metadata")
4941
    Map<String, String> metadata;
4942

4943
    /**
4944
     * Integer representing the number of trial period days before the customer is charged for the
4945
     * first time. Has to be at least 1.
4946
     */
4947
    @SerializedName("trial_period_days")
4948
    Long trialPeriodDays;
4949

4950
    /** Settings related to subscription trials. */
4951
    @SerializedName("trial_settings")
4952
    TrialSettings trialSettings;
4953

4954
    private SubscriptionData(
4955
        String description,
4956
        Map<String, Object> extraParams,
4957
        InvoiceSettings invoiceSettings,
4958
        Map<String, String> metadata,
4959
        Long trialPeriodDays,
UNCOV
4960
        TrialSettings trialSettings) {
×
UNCOV
4961
      this.description = description;
×
UNCOV
4962
      this.extraParams = extraParams;
×
4963
      this.invoiceSettings = invoiceSettings;
×
4964
      this.metadata = metadata;
×
4965
      this.trialPeriodDays = trialPeriodDays;
×
4966
      this.trialSettings = trialSettings;
×
4967
    }
×
4968

4969
    public static Builder builder() {
4970
      return new Builder();
×
4971
    }
4972

4973
    public static class Builder {
×
4974
      private String description;
4975

4976
      private Map<String, Object> extraParams;
4977

4978
      private InvoiceSettings invoiceSettings;
4979

4980
      private Map<String, String> metadata;
4981

4982
      private Long trialPeriodDays;
4983

4984
      private TrialSettings trialSettings;
4985

4986
      /** Finalize and obtain parameter instance from this builder. */
4987
      public PaymentLinkCreateParams.SubscriptionData build() {
UNCOV
4988
        return new PaymentLinkCreateParams.SubscriptionData(
×
4989
            this.description,
4990
            this.extraParams,
4991
            this.invoiceSettings,
4992
            this.metadata,
4993
            this.trialPeriodDays,
4994
            this.trialSettings);
4995
      }
4996

4997
      /**
4998
       * The subscription's description, meant to be displayable to the customer. Use this field to
4999
       * optionally store an explanation of the subscription for rendering in Stripe surfaces and
5000
       * certain local payment methods UIs.
5001
       */
5002
      public Builder setDescription(String description) {
UNCOV
5003
        this.description = description;
×
UNCOV
5004
        return this;
×
5005
      }
5006

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

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

5034
      /** All invoices will be billed using the specified settings. */
5035
      public Builder setInvoiceSettings(
5036
          PaymentLinkCreateParams.SubscriptionData.InvoiceSettings invoiceSettings) {
UNCOV
5037
        this.invoiceSettings = invoiceSettings;
×
UNCOV
5038
        return this;
×
5039
      }
5040

5041
      /**
5042
       * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
5043
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5044
       * PaymentLinkCreateParams.SubscriptionData#metadata} for the field documentation.
5045
       */
5046
      public Builder putMetadata(String key, String value) {
UNCOV
5047
        if (this.metadata == null) {
×
UNCOV
5048
          this.metadata = new HashMap<>();
×
5049
        }
5050
        this.metadata.put(key, value);
×
5051
        return this;
×
5052
      }
5053

5054
      /**
5055
       * Add all map key/value pairs to `metadata` map. A map is initialized for the first
5056
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5057
       * See {@link PaymentLinkCreateParams.SubscriptionData#metadata} for the field documentation.
5058
       */
5059
      public Builder putAllMetadata(Map<String, String> map) {
UNCOV
5060
        if (this.metadata == null) {
×
UNCOV
5061
          this.metadata = new HashMap<>();
×
5062
        }
5063
        this.metadata.putAll(map);
×
5064
        return this;
×
5065
      }
5066

5067
      /**
5068
       * Integer representing the number of trial period days before the customer is charged for the
5069
       * first time. Has to be at least 1.
5070
       */
5071
      public Builder setTrialPeriodDays(Long trialPeriodDays) {
UNCOV
5072
        this.trialPeriodDays = trialPeriodDays;
×
UNCOV
5073
        return this;
×
5074
      }
5075

5076
      /** Settings related to subscription trials. */
5077
      public Builder setTrialSettings(
5078
          PaymentLinkCreateParams.SubscriptionData.TrialSettings trialSettings) {
UNCOV
5079
        this.trialSettings = trialSettings;
×
UNCOV
5080
        return this;
×
5081
      }
5082
    }
5083

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

5095
      /**
5096
       * The connected account that issues the invoice. The invoice is presented with the branding
5097
       * and support information of the specified account.
5098
       */
5099
      @SerializedName("issuer")
5100
      Issuer issuer;
5101

UNCOV
5102
      private InvoiceSettings(Map<String, Object> extraParams, Issuer issuer) {
×
UNCOV
5103
        this.extraParams = extraParams;
×
UNCOV
5104
        this.issuer = issuer;
×
5105
      }
×
5106

5107
      public static Builder builder() {
5108
        return new Builder();
×
5109
      }
5110

5111
      public static class Builder {
×
5112
        private Map<String, Object> extraParams;
5113

5114
        private Issuer issuer;
5115

5116
        /** Finalize and obtain parameter instance from this builder. */
5117
        public PaymentLinkCreateParams.SubscriptionData.InvoiceSettings build() {
UNCOV
5118
          return new PaymentLinkCreateParams.SubscriptionData.InvoiceSettings(
×
5119
              this.extraParams, this.issuer);
5120
        }
5121

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

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

5150
        /**
5151
         * The connected account that issues the invoice. The invoice is presented with the branding
5152
         * and support information of the specified account.
5153
         */
5154
        public Builder setIssuer(
5155
            PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer issuer) {
UNCOV
5156
          this.issuer = issuer;
×
UNCOV
5157
          return this;
×
5158
        }
5159
      }
5160

5161
      @Getter
5162
      public static class Issuer {
5163
        /** The connected account being referenced when {@code type} is {@code account}. */
5164
        @SerializedName("account")
5165
        String account;
5166

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

5177
        /** <strong>Required.</strong> Type of the account referenced in the request. */
5178
        @SerializedName("type")
5179
        Type type;
5180

UNCOV
5181
        private Issuer(String account, Map<String, Object> extraParams, Type type) {
×
UNCOV
5182
          this.account = account;
×
UNCOV
5183
          this.extraParams = extraParams;
×
5184
          this.type = type;
×
5185
        }
×
5186

5187
        public static Builder builder() {
5188
          return new Builder();
×
5189
        }
5190

5191
        public static class Builder {
×
5192
          private String account;
5193

5194
          private Map<String, Object> extraParams;
5195

5196
          private Type type;
5197

5198
          /** Finalize and obtain parameter instance from this builder. */
5199
          public PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer build() {
UNCOV
5200
            return new PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer(
×
5201
                this.account, this.extraParams, this.type);
5202
          }
5203

5204
          /** The connected account being referenced when {@code type} is {@code account}. */
5205
          public Builder setAccount(String account) {
UNCOV
5206
            this.account = account;
×
UNCOV
5207
            return this;
×
5208
          }
5209

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

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

5240
          /** <strong>Required.</strong> Type of the account referenced in the request. */
5241
          public Builder setType(
5242
              PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer.Type type) {
UNCOV
5243
            this.type = type;
×
UNCOV
5244
            return this;
×
5245
          }
5246
        }
5247

UNCOV
5248
        public enum Type implements ApiRequestParams.EnumParam {
×
UNCOV
5249
          @SerializedName("account")
×
5250
          ACCOUNT("account"),
5251

5252
          @SerializedName("self")
×
5253
          SELF("self");
5254

5255
          @Getter(onMethod_ = {@Override})
5256
          private final String value;
5257

UNCOV
5258
          Type(String value) {
×
UNCOV
5259
            this.value = value;
×
UNCOV
5260
          }
×
5261
        }
5262
      }
5263
    }
5264

5265
    @Getter
5266
    public static class TrialSettings {
5267
      /**
5268
       * <strong>Required.</strong> Defines how the subscription should behave when the user's free
5269
       * trial ends.
5270
       */
5271
      @SerializedName("end_behavior")
5272
      EndBehavior endBehavior;
5273

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

UNCOV
5283
      private TrialSettings(EndBehavior endBehavior, Map<String, Object> extraParams) {
×
UNCOV
5284
        this.endBehavior = endBehavior;
×
UNCOV
5285
        this.extraParams = extraParams;
×
5286
      }
×
5287

5288
      public static Builder builder() {
5289
        return new Builder();
×
5290
      }
5291

5292
      public static class Builder {
×
5293
        private EndBehavior endBehavior;
5294

5295
        private Map<String, Object> extraParams;
5296

5297
        /** Finalize and obtain parameter instance from this builder. */
5298
        public PaymentLinkCreateParams.SubscriptionData.TrialSettings build() {
UNCOV
5299
          return new PaymentLinkCreateParams.SubscriptionData.TrialSettings(
×
5300
              this.endBehavior, this.extraParams);
5301
        }
5302

5303
        /**
5304
         * <strong>Required.</strong> Defines how the subscription should behave when the user's
5305
         * free trial ends.
5306
         */
5307
        public Builder setEndBehavior(
5308
            PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior endBehavior) {
UNCOV
5309
          this.endBehavior = endBehavior;
×
UNCOV
5310
          return this;
×
5311
        }
5312

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

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

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

5354
        /**
5355
         * <strong>Required.</strong> Indicates how the subscription should change when the trial
5356
         * ends if the user did not provide a payment method.
5357
         */
5358
        @SerializedName("missing_payment_method")
5359
        MissingPaymentMethod missingPaymentMethod;
5360

5361
        private EndBehavior(
UNCOV
5362
            Map<String, Object> extraParams, MissingPaymentMethod missingPaymentMethod) {
×
UNCOV
5363
          this.extraParams = extraParams;
×
UNCOV
5364
          this.missingPaymentMethod = missingPaymentMethod;
×
5365
        }
×
5366

5367
        public static Builder builder() {
5368
          return new Builder();
×
5369
        }
5370

5371
        public static class Builder {
×
5372
          private Map<String, Object> extraParams;
5373

5374
          private MissingPaymentMethod missingPaymentMethod;
5375

5376
          /** Finalize and obtain parameter instance from this builder. */
5377
          public PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior build() {
UNCOV
5378
            return new PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior(
×
5379
                this.extraParams, this.missingPaymentMethod);
5380
          }
5381

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

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

5412
          /**
5413
           * <strong>Required.</strong> Indicates how the subscription should change when the trial
5414
           * ends if the user did not provide a payment method.
5415
           */
5416
          public Builder setMissingPaymentMethod(
5417
              PaymentLinkCreateParams.SubscriptionData.TrialSettings.EndBehavior
5418
                      .MissingPaymentMethod
5419
                  missingPaymentMethod) {
UNCOV
5420
            this.missingPaymentMethod = missingPaymentMethod;
×
UNCOV
5421
            return this;
×
5422
          }
5423
        }
5424

UNCOV
5425
        public enum MissingPaymentMethod implements ApiRequestParams.EnumParam {
×
UNCOV
5426
          @SerializedName("cancel")
×
5427
          CANCEL("cancel"),
5428

5429
          @SerializedName("create_invoice")
×
5430
          CREATE_INVOICE("create_invoice"),
5431

5432
          @SerializedName("pause")
×
5433
          PAUSE("pause");
5434

5435
          @Getter(onMethod_ = {@Override})
5436
          private final String value;
5437

UNCOV
5438
          MissingPaymentMethod(String value) {
×
UNCOV
5439
            this.value = value;
×
UNCOV
5440
          }
×
5441
        }
5442
      }
5443
    }
5444
  }
5445

5446
  @Getter
5447
  public static class TaxIdCollection {
5448
    /**
5449
     * <strong>Required.</strong> Enable tax ID collection during checkout. Defaults to {@code
5450
     * false}.
5451
     */
5452
    @SerializedName("enabled")
5453
    Boolean enabled;
5454

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

5464
    /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */
5465
    @SerializedName("required")
5466
    Required required;
5467

UNCOV
5468
    private TaxIdCollection(Boolean enabled, Map<String, Object> extraParams, Required required) {
×
UNCOV
5469
      this.enabled = enabled;
×
UNCOV
5470
      this.extraParams = extraParams;
×
5471
      this.required = required;
×
5472
    }
×
5473

5474
    public static Builder builder() {
5475
      return new Builder();
×
5476
    }
5477

5478
    public static class Builder {
×
5479
      private Boolean enabled;
5480

5481
      private Map<String, Object> extraParams;
5482

5483
      private Required required;
5484

5485
      /** Finalize and obtain parameter instance from this builder. */
5486
      public PaymentLinkCreateParams.TaxIdCollection build() {
UNCOV
5487
        return new PaymentLinkCreateParams.TaxIdCollection(
×
5488
            this.enabled, this.extraParams, this.required);
5489
      }
5490

5491
      /**
5492
       * <strong>Required.</strong> Enable tax ID collection during checkout. Defaults to {@code
5493
       * false}.
5494
       */
5495
      public Builder setEnabled(Boolean enabled) {
UNCOV
5496
        this.enabled = enabled;
×
UNCOV
5497
        return this;
×
5498
      }
5499

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

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

5527
      /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */
5528
      public Builder setRequired(PaymentLinkCreateParams.TaxIdCollection.Required required) {
UNCOV
5529
        this.required = required;
×
UNCOV
5530
        return this;
×
5531
      }
5532
    }
5533

UNCOV
5534
    public enum Required implements ApiRequestParams.EnumParam {
×
UNCOV
5535
      @SerializedName("if_supported")
×
5536
      IF_SUPPORTED("if_supported"),
5537

5538
      @SerializedName("never")
×
5539
      NEVER("never");
5540

5541
      @Getter(onMethod_ = {@Override})
5542
      private final String value;
5543

UNCOV
5544
      Required(String value) {
×
UNCOV
5545
        this.value = value;
×
UNCOV
5546
      }
×
5547
    }
5548
  }
5549

5550
  @Getter
5551
  public static class TransferData {
5552
    /** The amount that will be transferred automatically when a charge succeeds. */
5553
    @SerializedName("amount")
5554
    Long amount;
5555

5556
    /**
5557
     * <strong>Required.</strong> If specified, successful charges will be attributed to the
5558
     * destination account for tax reporting, and the funds from charges will be transferred to the
5559
     * destination account. The ID of the resulting transfer will be returned on the successful
5560
     * charge's {@code transfer} field.
5561
     */
5562
    @SerializedName("destination")
5563
    String destination;
5564

5565
    /**
5566
     * Map of extra parameters for custom features not available in this client library. The content
5567
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5568
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5569
     * param object. Effectively, this map is flattened to its parent instance.
5570
     */
5571
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5572
    Map<String, Object> extraParams;
5573

UNCOV
5574
    private TransferData(Long amount, String destination, Map<String, Object> extraParams) {
×
UNCOV
5575
      this.amount = amount;
×
UNCOV
5576
      this.destination = destination;
×
5577
      this.extraParams = extraParams;
×
5578
    }
×
5579

5580
    public static Builder builder() {
5581
      return new Builder();
×
5582
    }
5583

5584
    public static class Builder {
×
5585
      private Long amount;
5586

5587
      private String destination;
5588

5589
      private Map<String, Object> extraParams;
5590

5591
      /** Finalize and obtain parameter instance from this builder. */
5592
      public PaymentLinkCreateParams.TransferData build() {
UNCOV
5593
        return new PaymentLinkCreateParams.TransferData(
×
5594
            this.amount, this.destination, this.extraParams);
5595
      }
5596

5597
      /** The amount that will be transferred automatically when a charge succeeds. */
5598
      public Builder setAmount(Long amount) {
UNCOV
5599
        this.amount = amount;
×
UNCOV
5600
        return this;
×
5601
      }
5602

5603
      /**
5604
       * <strong>Required.</strong> If specified, successful charges will be attributed to the
5605
       * destination account for tax reporting, and the funds from charges will be transferred to
5606
       * the destination account. The ID of the resulting transfer will be returned on the
5607
       * successful charge's {@code transfer} field.
5608
       */
5609
      public Builder setDestination(String destination) {
UNCOV
5610
        this.destination = destination;
×
UNCOV
5611
        return this;
×
5612
      }
5613

5614
      /**
5615
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5616
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5617
       * PaymentLinkCreateParams.TransferData#extraParams} for the field documentation.
5618
       */
5619
      public Builder putExtraParam(String key, Object value) {
UNCOV
5620
        if (this.extraParams == null) {
×
UNCOV
5621
          this.extraParams = new HashMap<>();
×
5622
        }
5623
        this.extraParams.put(key, value);
×
5624
        return this;
×
5625
      }
5626

5627
      /**
5628
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5629
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5630
       * See {@link PaymentLinkCreateParams.TransferData#extraParams} for the field documentation.
5631
       */
5632
      public Builder putAllExtraParam(Map<String, Object> map) {
UNCOV
5633
        if (this.extraParams == null) {
×
UNCOV
5634
          this.extraParams = new HashMap<>();
×
5635
        }
5636
        this.extraParams.putAll(map);
×
5637
        return this;
×
5638
      }
5639
    }
5640
  }
5641

UNCOV
5642
  public enum BillingAddressCollection implements ApiRequestParams.EnumParam {
×
UNCOV
5643
    @SerializedName("auto")
×
5644
    AUTO("auto"),
5645

5646
    @SerializedName("required")
×
5647
    REQUIRED("required");
5648

5649
    @Getter(onMethod_ = {@Override})
5650
    private final String value;
5651

UNCOV
5652
    BillingAddressCollection(String value) {
×
UNCOV
5653
      this.value = value;
×
UNCOV
5654
    }
×
5655
  }
5656

5657
  public enum CustomerCreation implements ApiRequestParams.EnumParam {
×
UNCOV
5658
    @SerializedName("always")
×
5659
    ALWAYS("always"),
5660

5661
    @SerializedName("if_required")
×
5662
    IF_REQUIRED("if_required");
5663

5664
    @Getter(onMethod_ = {@Override})
5665
    private final String value;
5666

UNCOV
5667
    CustomerCreation(String value) {
×
UNCOV
5668
      this.value = value;
×
UNCOV
5669
    }
×
5670
  }
5671

5672
  public enum PaymentMethodCollection implements ApiRequestParams.EnumParam {
×
UNCOV
5673
    @SerializedName("always")
×
5674
    ALWAYS("always"),
5675

5676
    @SerializedName("if_required")
×
5677
    IF_REQUIRED("if_required");
5678

5679
    @Getter(onMethod_ = {@Override})
5680
    private final String value;
5681

UNCOV
5682
    PaymentMethodCollection(String value) {
×
UNCOV
5683
      this.value = value;
×
UNCOV
5684
    }
×
5685
  }
5686

5687
  public enum PaymentMethodType implements ApiRequestParams.EnumParam {
×
UNCOV
5688
    @SerializedName("affirm")
×
5689
    AFFIRM("affirm"),
5690

5691
    @SerializedName("afterpay_clearpay")
×
5692
    AFTERPAY_CLEARPAY("afterpay_clearpay"),
5693

5694
    @SerializedName("alipay")
×
5695
    ALIPAY("alipay"),
5696

5697
    @SerializedName("alma")
×
5698
    ALMA("alma"),
5699

5700
    @SerializedName("au_becs_debit")
×
5701
    AU_BECS_DEBIT("au_becs_debit"),
5702

5703
    @SerializedName("bacs_debit")
×
5704
    BACS_DEBIT("bacs_debit"),
5705

5706
    @SerializedName("bancontact")
×
5707
    BANCONTACT("bancontact"),
5708

5709
    @SerializedName("blik")
×
5710
    BLIK("blik"),
5711

5712
    @SerializedName("boleto")
×
5713
    BOLETO("boleto"),
5714

5715
    @SerializedName("card")
×
5716
    CARD("card"),
5717

5718
    @SerializedName("cashapp")
×
5719
    CASHAPP("cashapp"),
5720

5721
    @SerializedName("eps")
×
5722
    EPS("eps"),
5723

5724
    @SerializedName("fpx")
×
5725
    FPX("fpx"),
5726

5727
    @SerializedName("giropay")
×
5728
    GIROPAY("giropay"),
5729

5730
    @SerializedName("gopay")
×
5731
    GOPAY("gopay"),
5732

5733
    @SerializedName("grabpay")
×
5734
    GRABPAY("grabpay"),
5735

5736
    @SerializedName("ideal")
×
5737
    IDEAL("ideal"),
5738

5739
    @SerializedName("klarna")
×
5740
    KLARNA("klarna"),
5741

5742
    @SerializedName("konbini")
×
5743
    KONBINI("konbini"),
5744

5745
    @SerializedName("link")
×
5746
    LINK("link"),
5747

5748
    @SerializedName("mb_way")
×
5749
    MB_WAY("mb_way"),
5750

5751
    @SerializedName("mobilepay")
×
5752
    MOBILEPAY("mobilepay"),
5753

5754
    @SerializedName("multibanco")
×
5755
    MULTIBANCO("multibanco"),
5756

5757
    @SerializedName("oxxo")
×
5758
    OXXO("oxxo"),
5759

5760
    @SerializedName("p24")
×
5761
    P24("p24"),
5762

5763
    @SerializedName("paynow")
×
5764
    PAYNOW("paynow"),
5765

5766
    @SerializedName("paypal")
×
5767
    PAYPAL("paypal"),
5768

5769
    @SerializedName("payto")
×
5770
    PAYTO("payto"),
5771

5772
    @SerializedName("pix")
×
5773
    PIX("pix"),
5774

5775
    @SerializedName("promptpay")
×
5776
    PROMPTPAY("promptpay"),
5777

5778
    @SerializedName("qris")
×
5779
    QRIS("qris"),
5780

5781
    @SerializedName("rechnung")
×
5782
    RECHNUNG("rechnung"),
5783

5784
    @SerializedName("sepa_debit")
×
5785
    SEPA_DEBIT("sepa_debit"),
5786

5787
    @SerializedName("shopeepay")
×
5788
    SHOPEEPAY("shopeepay"),
5789

5790
    @SerializedName("sofort")
×
5791
    SOFORT("sofort"),
5792

5793
    @SerializedName("swish")
×
5794
    SWISH("swish"),
5795

5796
    @SerializedName("twint")
×
5797
    TWINT("twint"),
5798

5799
    @SerializedName("us_bank_account")
×
5800
    US_BANK_ACCOUNT("us_bank_account"),
5801

5802
    @SerializedName("wechat_pay")
×
5803
    WECHAT_PAY("wechat_pay"),
5804

5805
    @SerializedName("zip")
×
5806
    ZIP("zip");
5807

5808
    @Getter(onMethod_ = {@Override})
5809
    private final String value;
5810

UNCOV
5811
    PaymentMethodType(String value) {
×
UNCOV
5812
      this.value = value;
×
UNCOV
5813
    }
×
5814
  }
5815

5816
  public enum SubmitType implements ApiRequestParams.EnumParam {
×
UNCOV
5817
    @SerializedName("auto")
×
5818
    AUTO("auto"),
5819

5820
    @SerializedName("book")
×
5821
    BOOK("book"),
5822

5823
    @SerializedName("donate")
×
5824
    DONATE("donate"),
5825

5826
    @SerializedName("pay")
×
5827
    PAY("pay"),
5828

5829
    @SerializedName("subscribe")
×
5830
    SUBSCRIBE("subscribe");
5831

5832
    @Getter(onMethod_ = {@Override})
5833
    private final String value;
5834

UNCOV
5835
    SubmitType(String value) {
×
UNCOV
5836
      this.value = value;
×
UNCOV
5837
    }
×
5838
  }
5839
}
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