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

stripe / stripe-java / #16562

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

push

github

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

Update generated code for beta

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

68 existing lines in 20 files now uncovered.

18798 of 149026 relevant lines covered (12.61%)

0.13 hits per line

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

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

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

13
@Getter
14
public class InvoiceCreateParams extends ApiRequestParams {
15
  /** The account tax IDs associated with the invoice. Only editable when the invoice is a draft. */
16
  @SerializedName("account_tax_ids")
17
  Object accountTaxIds;
18

19
  /**
20
   * List of expected payments and corresponding due dates. Valid only for invoices where {@code
21
   * collection_method=send_invoice}.
22
   */
23
  @SerializedName("amounts_due")
24
  Object amountsDue;
25

26
  /**
27
   * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the
28
   * application owner's Stripe account. The request must be made with an OAuth key or the
29
   * Stripe-Account header in order to take an application fee. For more information, see the
30
   * application fees <a
31
   * href="https://stripe.com/docs/billing/invoices/connect#collecting-fees">documentation</a>.
32
   */
33
  @SerializedName("application_fee_amount")
34
  Long applicationFeeAmount;
35

36
  /**
37
   * Controls whether Stripe performs <a
38
   * href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">automatic
39
   * collection</a> of the invoice. If {@code false}, the invoice's state doesn't automatically
40
   * advance without an explicit action.
41
   */
42
  @SerializedName("auto_advance")
43
  Boolean autoAdvance;
44

45
  /** Settings for automatic tax lookup for this invoice. */
46
  @SerializedName("automatic_tax")
47
  AutomaticTax automaticTax;
48

49
  /**
50
   * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
51
   * Stripe will attempt to pay this invoice using the default source attached to the customer. When
52
   * sending an invoice, Stripe will email this invoice to the customer with payment instructions.
53
   * Defaults to {@code charge_automatically}.
54
   */
55
  @SerializedName("collection_method")
56
  CollectionMethod collectionMethod;
57

58
  /**
59
   * The currency to create this invoice in. Defaults to that of {@code customer} if not specified.
60
   */
61
  @SerializedName("currency")
62
  String currency;
63

64
  /** A list of up to 4 custom fields to be displayed on the invoice. */
65
  @SerializedName("custom_fields")
66
  Object customFields;
67

68
  /** The ID of the customer who will be billed. */
69
  @SerializedName("customer")
70
  String customer;
71

72
  /**
73
   * The number of days from when the invoice is created until it is due. Valid only for invoices
74
   * where {@code collection_method=send_invoice}.
75
   */
76
  @SerializedName("days_until_due")
77
  Long daysUntilDue;
78

79
  /**
80
   * The ids of the margins to apply to the invoice. Can be overridden by line item {@code margins}.
81
   */
82
  @SerializedName("default_margins")
83
  List<String> defaultMargins;
84

85
  /**
86
   * ID of the default payment method for the invoice. It must belong to the customer associated
87
   * with the invoice. If not set, defaults to the subscription's default payment method, if any, or
88
   * to the default payment method in the customer's invoice settings.
89
   */
90
  @SerializedName("default_payment_method")
91
  String defaultPaymentMethod;
92

93
  /**
94
   * ID of the default payment source for the invoice. It must belong to the customer associated
95
   * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
96
   * default source, if any, or to the customer's default source.
97
   */
98
  @SerializedName("default_source")
99
  String defaultSource;
100

101
  /** The tax rates that will apply to any line item that does not have {@code tax_rates} set. */
102
  @SerializedName("default_tax_rates")
103
  List<String> defaultTaxRates;
104

105
  /**
106
   * An arbitrary string attached to the object. Often useful for displaying to users. Referenced as
107
   * 'memo' in the Dashboard.
108
   */
109
  @SerializedName("description")
110
  String description;
111

112
  /**
113
   * The coupons and promotion codes to redeem into discounts for the invoice. If not specified,
114
   * inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any
115
   * discounts.
116
   */
117
  @SerializedName("discounts")
118
  Object discounts;
119

120
  /**
121
   * The date on which payment for this invoice is due. Valid only for invoices where {@code
122
   * collection_method=send_invoice}.
123
   */
124
  @SerializedName("due_date")
125
  Long dueDate;
126

127
  /**
128
   * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten. When
129
   * defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF
130
   * and receipt.
131
   */
132
  @SerializedName("effective_at")
133
  Long effectiveAt;
134

135
  /** Specifies which fields in the response should be expanded. */
136
  @SerializedName("expand")
137
  List<String> expand;
138

139
  /**
140
   * Map of extra parameters for custom features not available in this client library. The content
141
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
142
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
143
   * param object. Effectively, this map is flattened to its parent instance.
144
   */
145
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
146
  Map<String, Object> extraParams;
147

148
  /** Footer to be displayed on the invoice. */
149
  @SerializedName("footer")
150
  String footer;
151

152
  /**
153
   * Revise an existing invoice. The new invoice will be created in {@code status=draft}. See the <a
154
   * href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more
155
   * details.
156
   */
157
  @SerializedName("from_invoice")
158
  FromInvoice fromInvoice;
159

160
  /**
161
   * The connected account that issues the invoice. The invoice is presented with the branding and
162
   * support information of the specified account.
163
   */
164
  @SerializedName("issuer")
165
  Issuer issuer;
166

167
  /**
168
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
169
   * to an object. This can be useful for storing additional information about the object in a
170
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
171
   * be unset by posting an empty value to {@code metadata}.
172
   */
173
  @SerializedName("metadata")
174
  Object metadata;
175

176
  /**
177
   * Set the number for this invoice. If no number is present then a number will be assigned
178
   * automatically when the invoice is finalized. In many markets, regulations require invoices to
179
   * be unique, sequential and / or gapless. You are responsible for ensuring this is true across
180
   * all your different invoicing systems in the event that you edit the invoice number using our
181
   * API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles
182
   * this aspect of compliance for you automatically.
183
   */
184
  @SerializedName("number")
185
  String number;
186

187
  /**
188
   * The account (if any) for which the funds of the invoice payment are intended. If set, the
189
   * invoice will be presented with the branding and support information of the specified account.
190
   * See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a>
191
   * documentation for details.
192
   */
193
  @SerializedName("on_behalf_of")
194
  String onBehalfOf;
195

196
  /**
197
   * Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
198
   */
199
  @SerializedName("payment_settings")
200
  PaymentSettings paymentSettings;
201

202
  /**
203
   * How to handle pending invoice items on invoice creation. Defaults to {@code exclude} if the
204
   * parameter is omitted.
205
   */
206
  @SerializedName("pending_invoice_items_behavior")
207
  PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior;
208

209
  /**
210
   * The rendering-related settings that control how the invoice is displayed on customer-facing
211
   * surfaces such as PDF and Hosted Invoice Page.
212
   */
213
  @SerializedName("rendering")
214
  Rendering rendering;
215

216
  /** Settings for the cost of shipping for this invoice. */
217
  @SerializedName("shipping_cost")
218
  ShippingCost shippingCost;
219

220
  /**
221
   * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
222
   * if it is set, otherwise the PDF will render the shipping address from the customer.
223
   */
224
  @SerializedName("shipping_details")
225
  ShippingDetails shippingDetails;
226

227
  /**
228
   * Extra information about a charge for the customer's credit card statement. It must contain at
229
   * least one letter. If not specified and this invoice is part of a subscription, the default
230
   * {@code statement_descriptor} will be set to the first subscription item's product's {@code
231
   * statement_descriptor}.
232
   */
233
  @SerializedName("statement_descriptor")
234
  String statementDescriptor;
235

236
  /**
237
   * The ID of the subscription to invoice, if any. If set, the created invoice will only include
238
   * pending invoice items for that subscription. The subscription's billing cycle and regular
239
   * subscription events won't be affected.
240
   */
241
  @SerializedName("subscription")
242
  String subscription;
243

244
  /**
245
   * If specified, the funds from the invoice will be transferred to the destination and the ID of
246
   * the resulting transfer will be found on the invoice's charge.
247
   */
248
  @SerializedName("transfer_data")
249
  TransferData transferData;
250

251
  private InvoiceCreateParams(
252
      Object accountTaxIds,
253
      Object amountsDue,
254
      Long applicationFeeAmount,
255
      Boolean autoAdvance,
256
      AutomaticTax automaticTax,
257
      CollectionMethod collectionMethod,
258
      String currency,
259
      Object customFields,
260
      String customer,
261
      Long daysUntilDue,
262
      List<String> defaultMargins,
263
      String defaultPaymentMethod,
264
      String defaultSource,
265
      List<String> defaultTaxRates,
266
      String description,
267
      Object discounts,
268
      Long dueDate,
269
      Long effectiveAt,
270
      List<String> expand,
271
      Map<String, Object> extraParams,
272
      String footer,
273
      FromInvoice fromInvoice,
274
      Issuer issuer,
275
      Object metadata,
276
      String number,
277
      String onBehalfOf,
278
      PaymentSettings paymentSettings,
279
      PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior,
280
      Rendering rendering,
281
      ShippingCost shippingCost,
282
      ShippingDetails shippingDetails,
283
      String statementDescriptor,
284
      String subscription,
285
      TransferData transferData) {
1✔
286
    this.accountTaxIds = accountTaxIds;
1✔
287
    this.amountsDue = amountsDue;
1✔
288
    this.applicationFeeAmount = applicationFeeAmount;
1✔
289
    this.autoAdvance = autoAdvance;
1✔
290
    this.automaticTax = automaticTax;
1✔
291
    this.collectionMethod = collectionMethod;
1✔
292
    this.currency = currency;
1✔
293
    this.customFields = customFields;
1✔
294
    this.customer = customer;
1✔
295
    this.daysUntilDue = daysUntilDue;
1✔
296
    this.defaultMargins = defaultMargins;
1✔
297
    this.defaultPaymentMethod = defaultPaymentMethod;
1✔
298
    this.defaultSource = defaultSource;
1✔
299
    this.defaultTaxRates = defaultTaxRates;
1✔
300
    this.description = description;
1✔
301
    this.discounts = discounts;
1✔
302
    this.dueDate = dueDate;
1✔
303
    this.effectiveAt = effectiveAt;
1✔
304
    this.expand = expand;
1✔
305
    this.extraParams = extraParams;
1✔
306
    this.footer = footer;
1✔
307
    this.fromInvoice = fromInvoice;
1✔
308
    this.issuer = issuer;
1✔
309
    this.metadata = metadata;
1✔
310
    this.number = number;
1✔
311
    this.onBehalfOf = onBehalfOf;
1✔
312
    this.paymentSettings = paymentSettings;
1✔
313
    this.pendingInvoiceItemsBehavior = pendingInvoiceItemsBehavior;
1✔
314
    this.rendering = rendering;
1✔
315
    this.shippingCost = shippingCost;
1✔
316
    this.shippingDetails = shippingDetails;
1✔
317
    this.statementDescriptor = statementDescriptor;
1✔
318
    this.subscription = subscription;
1✔
319
    this.transferData = transferData;
1✔
320
  }
1✔
321

322
  public static Builder builder() {
323
    return new Builder();
1✔
324
  }
325

326
  public static class Builder {
1✔
327
    private Object accountTaxIds;
328

329
    private Object amountsDue;
330

331
    private Long applicationFeeAmount;
332

333
    private Boolean autoAdvance;
334

335
    private AutomaticTax automaticTax;
336

337
    private CollectionMethod collectionMethod;
338

339
    private String currency;
340

341
    private Object customFields;
342

343
    private String customer;
344

345
    private Long daysUntilDue;
346

347
    private List<String> defaultMargins;
348

349
    private String defaultPaymentMethod;
350

351
    private String defaultSource;
352

353
    private List<String> defaultTaxRates;
354

355
    private String description;
356

357
    private Object discounts;
358

359
    private Long dueDate;
360

361
    private Long effectiveAt;
362

363
    private List<String> expand;
364

365
    private Map<String, Object> extraParams;
366

367
    private String footer;
368

369
    private FromInvoice fromInvoice;
370

371
    private Issuer issuer;
372

373
    private Object metadata;
374

375
    private String number;
376

377
    private String onBehalfOf;
378

379
    private PaymentSettings paymentSettings;
380

381
    private PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior;
382

383
    private Rendering rendering;
384

385
    private ShippingCost shippingCost;
386

387
    private ShippingDetails shippingDetails;
388

389
    private String statementDescriptor;
390

391
    private String subscription;
392

393
    private TransferData transferData;
394

395
    /** Finalize and obtain parameter instance from this builder. */
396
    public InvoiceCreateParams build() {
397
      return new InvoiceCreateParams(
1✔
398
          this.accountTaxIds,
399
          this.amountsDue,
400
          this.applicationFeeAmount,
401
          this.autoAdvance,
402
          this.automaticTax,
403
          this.collectionMethod,
404
          this.currency,
405
          this.customFields,
406
          this.customer,
407
          this.daysUntilDue,
408
          this.defaultMargins,
409
          this.defaultPaymentMethod,
410
          this.defaultSource,
411
          this.defaultTaxRates,
412
          this.description,
413
          this.discounts,
414
          this.dueDate,
415
          this.effectiveAt,
416
          this.expand,
417
          this.extraParams,
418
          this.footer,
419
          this.fromInvoice,
420
          this.issuer,
421
          this.metadata,
422
          this.number,
423
          this.onBehalfOf,
424
          this.paymentSettings,
425
          this.pendingInvoiceItemsBehavior,
426
          this.rendering,
427
          this.shippingCost,
428
          this.shippingDetails,
429
          this.statementDescriptor,
430
          this.subscription,
431
          this.transferData);
432
    }
433

434
    /**
435
     * Add an element to `accountTaxIds` list. A list is initialized for the first `add/addAll`
436
     * call, and subsequent calls adds additional elements to the original list. See {@link
437
     * InvoiceCreateParams#accountTaxIds} for the field documentation.
438
     */
439
    @SuppressWarnings("unchecked")
440
    public Builder addAccountTaxId(String element) {
441
      if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
442
        this.accountTaxIds = new ArrayList<String>();
×
443
      }
444
      ((List<String>) this.accountTaxIds).add(element);
×
445
      return this;
×
446
    }
447

448
    /**
449
     * Add all elements to `accountTaxIds` list. A list is initialized for the first `add/addAll`
450
     * call, and subsequent calls adds additional elements to the original list. See {@link
451
     * InvoiceCreateParams#accountTaxIds} for the field documentation.
452
     */
453
    @SuppressWarnings("unchecked")
454
    public Builder addAllAccountTaxId(List<String> elements) {
455
      if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
456
        this.accountTaxIds = new ArrayList<String>();
×
457
      }
458
      ((List<String>) this.accountTaxIds).addAll(elements);
×
459
      return this;
×
460
    }
461

462
    /**
463
     * The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
464
     */
465
    public Builder setAccountTaxIds(EmptyParam accountTaxIds) {
466
      this.accountTaxIds = accountTaxIds;
×
467
      return this;
×
468
    }
469

470
    /**
471
     * The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
472
     */
473
    public Builder setAccountTaxIds(List<String> accountTaxIds) {
474
      this.accountTaxIds = accountTaxIds;
×
475
      return this;
×
476
    }
477

478
    /**
479
     * Add an element to `amountsDue` list. A list is initialized for the first `add/addAll` call,
480
     * and subsequent calls adds additional elements to the original list. See {@link
481
     * InvoiceCreateParams#amountsDue} for the field documentation.
482
     */
483
    @SuppressWarnings("unchecked")
484
    public Builder addAmountsDue(InvoiceCreateParams.AmountsDue element) {
485
      if (this.amountsDue == null || this.amountsDue instanceof EmptyParam) {
×
486
        this.amountsDue = new ArrayList<InvoiceCreateParams.AmountsDue>();
×
487
      }
488
      ((List<InvoiceCreateParams.AmountsDue>) this.amountsDue).add(element);
×
489
      return this;
×
490
    }
491

492
    /**
493
     * Add all elements to `amountsDue` list. A list is initialized for the first `add/addAll` call,
494
     * and subsequent calls adds additional elements to the original list. See {@link
495
     * InvoiceCreateParams#amountsDue} for the field documentation.
496
     */
497
    @SuppressWarnings("unchecked")
498
    public Builder addAllAmountsDue(List<InvoiceCreateParams.AmountsDue> elements) {
499
      if (this.amountsDue == null || this.amountsDue instanceof EmptyParam) {
×
500
        this.amountsDue = new ArrayList<InvoiceCreateParams.AmountsDue>();
×
501
      }
502
      ((List<InvoiceCreateParams.AmountsDue>) this.amountsDue).addAll(elements);
×
503
      return this;
×
504
    }
505

506
    /**
507
     * List of expected payments and corresponding due dates. Valid only for invoices where {@code
508
     * collection_method=send_invoice}.
509
     */
510
    public Builder setAmountsDue(EmptyParam amountsDue) {
511
      this.amountsDue = amountsDue;
×
512
      return this;
×
513
    }
514

515
    /**
516
     * List of expected payments and corresponding due dates. Valid only for invoices where {@code
517
     * collection_method=send_invoice}.
518
     */
519
    public Builder setAmountsDue(List<InvoiceCreateParams.AmountsDue> amountsDue) {
520
      this.amountsDue = amountsDue;
×
521
      return this;
×
522
    }
523

524
    /**
525
     * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to
526
     * the application owner's Stripe account. The request must be made with an OAuth key or the
527
     * Stripe-Account header in order to take an application fee. For more information, see the
528
     * application fees <a
529
     * href="https://stripe.com/docs/billing/invoices/connect#collecting-fees">documentation</a>.
530
     */
531
    public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
532
      this.applicationFeeAmount = applicationFeeAmount;
×
533
      return this;
×
534
    }
535

536
    /**
537
     * Controls whether Stripe performs <a
538
     * href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">automatic
539
     * collection</a> of the invoice. If {@code false}, the invoice's state doesn't automatically
540
     * advance without an explicit action.
541
     */
542
    public Builder setAutoAdvance(Boolean autoAdvance) {
543
      this.autoAdvance = autoAdvance;
×
544
      return this;
×
545
    }
546

547
    /** Settings for automatic tax lookup for this invoice. */
548
    public Builder setAutomaticTax(InvoiceCreateParams.AutomaticTax automaticTax) {
549
      this.automaticTax = automaticTax;
×
550
      return this;
×
551
    }
552

553
    /**
554
     * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
555
     * Stripe will attempt to pay this invoice using the default source attached to the customer.
556
     * When sending an invoice, Stripe will email this invoice to the customer with payment
557
     * instructions. Defaults to {@code charge_automatically}.
558
     */
559
    public Builder setCollectionMethod(InvoiceCreateParams.CollectionMethod collectionMethod) {
560
      this.collectionMethod = collectionMethod;
×
561
      return this;
×
562
    }
563

564
    /**
565
     * The currency to create this invoice in. Defaults to that of {@code customer} if not
566
     * specified.
567
     */
568
    public Builder setCurrency(String currency) {
569
      this.currency = currency;
×
570
      return this;
×
571
    }
572

573
    /**
574
     * Add an element to `customFields` list. A list is initialized for the first `add/addAll` call,
575
     * and subsequent calls adds additional elements to the original list. See {@link
576
     * InvoiceCreateParams#customFields} for the field documentation.
577
     */
578
    @SuppressWarnings("unchecked")
579
    public Builder addCustomField(InvoiceCreateParams.CustomField element) {
580
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
581
        this.customFields = new ArrayList<InvoiceCreateParams.CustomField>();
×
582
      }
583
      ((List<InvoiceCreateParams.CustomField>) this.customFields).add(element);
×
584
      return this;
×
585
    }
586

587
    /**
588
     * Add all elements to `customFields` list. A list is initialized for the first `add/addAll`
589
     * call, and subsequent calls adds additional elements to the original list. See {@link
590
     * InvoiceCreateParams#customFields} for the field documentation.
591
     */
592
    @SuppressWarnings("unchecked")
593
    public Builder addAllCustomField(List<InvoiceCreateParams.CustomField> elements) {
594
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
595
        this.customFields = new ArrayList<InvoiceCreateParams.CustomField>();
×
596
      }
597
      ((List<InvoiceCreateParams.CustomField>) this.customFields).addAll(elements);
×
598
      return this;
×
599
    }
600

601
    /** A list of up to 4 custom fields to be displayed on the invoice. */
602
    public Builder setCustomFields(EmptyParam customFields) {
603
      this.customFields = customFields;
×
604
      return this;
×
605
    }
606

607
    /** A list of up to 4 custom fields to be displayed on the invoice. */
608
    public Builder setCustomFields(List<InvoiceCreateParams.CustomField> customFields) {
609
      this.customFields = customFields;
1✔
610
      return this;
1✔
611
    }
612

613
    /** The ID of the customer who will be billed. */
614
    public Builder setCustomer(String customer) {
615
      this.customer = customer;
1✔
616
      return this;
1✔
617
    }
618

619
    /**
620
     * The number of days from when the invoice is created until it is due. Valid only for invoices
621
     * where {@code collection_method=send_invoice}.
622
     */
623
    public Builder setDaysUntilDue(Long daysUntilDue) {
624
      this.daysUntilDue = daysUntilDue;
×
625
      return this;
×
626
    }
627

628
    /**
629
     * Add an element to `defaultMargins` list. A list is initialized for the first `add/addAll`
630
     * call, and subsequent calls adds additional elements to the original list. See {@link
631
     * InvoiceCreateParams#defaultMargins} for the field documentation.
632
     */
633
    public Builder addDefaultMargin(String element) {
634
      if (this.defaultMargins == null) {
×
635
        this.defaultMargins = new ArrayList<>();
×
636
      }
637
      this.defaultMargins.add(element);
×
638
      return this;
×
639
    }
640

641
    /**
642
     * Add all elements to `defaultMargins` list. A list is initialized for the first `add/addAll`
643
     * call, and subsequent calls adds additional elements to the original list. See {@link
644
     * InvoiceCreateParams#defaultMargins} for the field documentation.
645
     */
646
    public Builder addAllDefaultMargin(List<String> elements) {
647
      if (this.defaultMargins == null) {
×
648
        this.defaultMargins = new ArrayList<>();
×
649
      }
650
      this.defaultMargins.addAll(elements);
×
651
      return this;
×
652
    }
653

654
    /**
655
     * ID of the default payment method for the invoice. It must belong to the customer associated
656
     * with the invoice. If not set, defaults to the subscription's default payment method, if any,
657
     * or to the default payment method in the customer's invoice settings.
658
     */
659
    public Builder setDefaultPaymentMethod(String defaultPaymentMethod) {
660
      this.defaultPaymentMethod = defaultPaymentMethod;
×
661
      return this;
×
662
    }
663

664
    /**
665
     * ID of the default payment source for the invoice. It must belong to the customer associated
666
     * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
667
     * default source, if any, or to the customer's default source.
668
     */
669
    public Builder setDefaultSource(String defaultSource) {
670
      this.defaultSource = defaultSource;
×
671
      return this;
×
672
    }
673

674
    /**
675
     * Add an element to `defaultTaxRates` list. A list is initialized for the first `add/addAll`
676
     * call, and subsequent calls adds additional elements to the original list. See {@link
677
     * InvoiceCreateParams#defaultTaxRates} for the field documentation.
678
     */
679
    public Builder addDefaultTaxRate(String element) {
680
      if (this.defaultTaxRates == null) {
×
681
        this.defaultTaxRates = new ArrayList<>();
×
682
      }
683
      this.defaultTaxRates.add(element);
×
684
      return this;
×
685
    }
686

687
    /**
688
     * Add all elements to `defaultTaxRates` list. A list is initialized for the first `add/addAll`
689
     * call, and subsequent calls adds additional elements to the original list. See {@link
690
     * InvoiceCreateParams#defaultTaxRates} for the field documentation.
691
     */
692
    public Builder addAllDefaultTaxRate(List<String> elements) {
693
      if (this.defaultTaxRates == null) {
×
694
        this.defaultTaxRates = new ArrayList<>();
×
695
      }
696
      this.defaultTaxRates.addAll(elements);
×
697
      return this;
×
698
    }
699

700
    /**
701
     * An arbitrary string attached to the object. Often useful for displaying to users. Referenced
702
     * as 'memo' in the Dashboard.
703
     */
704
    public Builder setDescription(String description) {
705
      this.description = description;
×
706
      return this;
×
707
    }
708

709
    /**
710
     * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call,
711
     * and subsequent calls adds additional elements to the original list. See {@link
712
     * InvoiceCreateParams#discounts} for the field documentation.
713
     */
714
    @SuppressWarnings("unchecked")
715
    public Builder addDiscount(InvoiceCreateParams.Discount element) {
716
      if (this.discounts == null || this.discounts instanceof EmptyParam) {
×
717
        this.discounts = new ArrayList<InvoiceCreateParams.Discount>();
×
718
      }
719
      ((List<InvoiceCreateParams.Discount>) this.discounts).add(element);
×
720
      return this;
×
721
    }
722

723
    /**
724
     * Add all elements to `discounts` list. A list is initialized for the first `add/addAll` call,
725
     * and subsequent calls adds additional elements to the original list. See {@link
726
     * InvoiceCreateParams#discounts} for the field documentation.
727
     */
728
    @SuppressWarnings("unchecked")
729
    public Builder addAllDiscount(List<InvoiceCreateParams.Discount> elements) {
730
      if (this.discounts == null || this.discounts instanceof EmptyParam) {
×
731
        this.discounts = new ArrayList<InvoiceCreateParams.Discount>();
×
732
      }
733
      ((List<InvoiceCreateParams.Discount>) this.discounts).addAll(elements);
×
734
      return this;
×
735
    }
736

737
    /**
738
     * The coupons and promotion codes to redeem into discounts for the invoice. If not specified,
739
     * inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting
740
     * any discounts.
741
     */
742
    public Builder setDiscounts(EmptyParam discounts) {
743
      this.discounts = discounts;
×
744
      return this;
×
745
    }
746

747
    /**
748
     * The coupons and promotion codes to redeem into discounts for the invoice. If not specified,
749
     * inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting
750
     * any discounts.
751
     */
752
    public Builder setDiscounts(List<InvoiceCreateParams.Discount> discounts) {
753
      this.discounts = discounts;
×
754
      return this;
×
755
    }
756

757
    /**
758
     * The date on which payment for this invoice is due. Valid only for invoices where {@code
759
     * collection_method=send_invoice}.
760
     */
761
    public Builder setDueDate(Long dueDate) {
762
      this.dueDate = dueDate;
×
763
      return this;
×
764
    }
765

766
    /**
767
     * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten.
768
     * When defined, this value replaces the system-generated 'Date of issue' printed on the invoice
769
     * PDF and receipt.
770
     */
771
    public Builder setEffectiveAt(Long effectiveAt) {
772
      this.effectiveAt = effectiveAt;
×
773
      return this;
×
774
    }
775

776
    /**
777
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
778
     * subsequent calls adds additional elements to the original list. See {@link
779
     * InvoiceCreateParams#expand} for the field documentation.
780
     */
781
    public Builder addExpand(String element) {
782
      if (this.expand == null) {
×
783
        this.expand = new ArrayList<>();
×
784
      }
785
      this.expand.add(element);
×
786
      return this;
×
787
    }
788

789
    /**
790
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
791
     * subsequent calls adds additional elements to the original list. See {@link
792
     * InvoiceCreateParams#expand} for the field documentation.
793
     */
794
    public Builder addAllExpand(List<String> elements) {
795
      if (this.expand == null) {
×
796
        this.expand = new ArrayList<>();
×
797
      }
798
      this.expand.addAll(elements);
×
799
      return this;
×
800
    }
801

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

815
    /**
816
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
817
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
818
     * See {@link InvoiceCreateParams#extraParams} for the field documentation.
819
     */
820
    public Builder putAllExtraParam(Map<String, Object> map) {
821
      if (this.extraParams == null) {
×
822
        this.extraParams = new HashMap<>();
×
823
      }
824
      this.extraParams.putAll(map);
×
825
      return this;
×
826
    }
827

828
    /** Footer to be displayed on the invoice. */
829
    public Builder setFooter(String footer) {
830
      this.footer = footer;
×
831
      return this;
×
832
    }
833

834
    /**
835
     * Revise an existing invoice. The new invoice will be created in {@code status=draft}. See the
836
     * <a href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for
837
     * more details.
838
     */
839
    public Builder setFromInvoice(InvoiceCreateParams.FromInvoice fromInvoice) {
840
      this.fromInvoice = fromInvoice;
×
841
      return this;
×
842
    }
843

844
    /**
845
     * The connected account that issues the invoice. The invoice is presented with the branding and
846
     * support information of the specified account.
847
     */
848
    public Builder setIssuer(InvoiceCreateParams.Issuer issuer) {
849
      this.issuer = issuer;
×
850
      return this;
×
851
    }
852

853
    /**
854
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
855
     * and subsequent calls add additional key/value pairs to the original map. See {@link
856
     * InvoiceCreateParams#metadata} for the field documentation.
857
     */
858
    @SuppressWarnings("unchecked")
859
    public Builder putMetadata(String key, String value) {
860
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
861
        this.metadata = new HashMap<String, String>();
×
862
      }
863
      ((Map<String, String>) this.metadata).put(key, value);
×
864
      return this;
×
865
    }
866

867
    /**
868
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
869
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
870
     * See {@link InvoiceCreateParams#metadata} for the field documentation.
871
     */
872
    @SuppressWarnings("unchecked")
873
    public Builder putAllMetadata(Map<String, String> map) {
874
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
875
        this.metadata = new HashMap<String, String>();
×
876
      }
877
      ((Map<String, String>) this.metadata).putAll(map);
×
878
      return this;
×
879
    }
880

881
    /**
882
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
883
     * to an object. This can be useful for storing additional information about the object in a
884
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
885
     * can be unset by posting an empty value to {@code metadata}.
886
     */
887
    public Builder setMetadata(EmptyParam metadata) {
888
      this.metadata = metadata;
×
889
      return this;
×
890
    }
891

892
    /**
893
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
894
     * to an object. This can be useful for storing additional information about the object in a
895
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
896
     * can be unset by posting an empty value to {@code metadata}.
897
     */
898
    public Builder setMetadata(Map<String, String> metadata) {
899
      this.metadata = metadata;
×
900
      return this;
×
901
    }
902

903
    /**
904
     * Set the number for this invoice. If no number is present then a number will be assigned
905
     * automatically when the invoice is finalized. In many markets, regulations require invoices to
906
     * be unique, sequential and / or gapless. You are responsible for ensuring this is true across
907
     * all your different invoicing systems in the event that you edit the invoice number using our
908
     * API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe
909
     * handles this aspect of compliance for you automatically.
910
     */
911
    public Builder setNumber(String number) {
912
      this.number = number;
×
913
      return this;
×
914
    }
915

916
    /**
917
     * The account (if any) for which the funds of the invoice payment are intended. If set, the
918
     * invoice will be presented with the branding and support information of the specified account.
919
     * See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a>
920
     * documentation for details.
921
     */
922
    public Builder setOnBehalfOf(String onBehalfOf) {
923
      this.onBehalfOf = onBehalfOf;
×
924
      return this;
×
925
    }
926

927
    /**
928
     * Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
929
     */
930
    public Builder setPaymentSettings(InvoiceCreateParams.PaymentSettings paymentSettings) {
931
      this.paymentSettings = paymentSettings;
×
932
      return this;
×
933
    }
934

935
    /**
936
     * How to handle pending invoice items on invoice creation. Defaults to {@code exclude} if the
937
     * parameter is omitted.
938
     */
939
    public Builder setPendingInvoiceItemsBehavior(
940
        InvoiceCreateParams.PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior) {
941
      this.pendingInvoiceItemsBehavior = pendingInvoiceItemsBehavior;
×
942
      return this;
×
943
    }
944

945
    /**
946
     * The rendering-related settings that control how the invoice is displayed on customer-facing
947
     * surfaces such as PDF and Hosted Invoice Page.
948
     */
949
    public Builder setRendering(InvoiceCreateParams.Rendering rendering) {
950
      this.rendering = rendering;
×
951
      return this;
×
952
    }
953

954
    /** Settings for the cost of shipping for this invoice. */
955
    public Builder setShippingCost(InvoiceCreateParams.ShippingCost shippingCost) {
956
      this.shippingCost = shippingCost;
×
957
      return this;
×
958
    }
959

960
    /**
961
     * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
962
     * if it is set, otherwise the PDF will render the shipping address from the customer.
963
     */
964
    public Builder setShippingDetails(InvoiceCreateParams.ShippingDetails shippingDetails) {
965
      this.shippingDetails = shippingDetails;
×
966
      return this;
×
967
    }
968

969
    /**
970
     * Extra information about a charge for the customer's credit card statement. It must contain at
971
     * least one letter. If not specified and this invoice is part of a subscription, the default
972
     * {@code statement_descriptor} will be set to the first subscription item's product's {@code
973
     * statement_descriptor}.
974
     */
975
    public Builder setStatementDescriptor(String statementDescriptor) {
976
      this.statementDescriptor = statementDescriptor;
×
977
      return this;
×
978
    }
979

980
    /**
981
     * The ID of the subscription to invoice, if any. If set, the created invoice will only include
982
     * pending invoice items for that subscription. The subscription's billing cycle and regular
983
     * subscription events won't be affected.
984
     */
985
    public Builder setSubscription(String subscription) {
986
      this.subscription = subscription;
×
987
      return this;
×
988
    }
989

990
    /**
991
     * If specified, the funds from the invoice will be transferred to the destination and the ID of
992
     * the resulting transfer will be found on the invoice's charge.
993
     */
994
    public Builder setTransferData(InvoiceCreateParams.TransferData transferData) {
995
      this.transferData = transferData;
×
996
      return this;
×
997
    }
998
  }
999

1000
  @Getter
1001
  public static class AmountsDue {
1002
    /** <strong>Required.</strong> The amount in cents (or local equivalent). */
1003
    @SerializedName("amount")
1004
    Long amount;
1005

1006
    /** Number of days from when invoice is finalized until the payment is due. */
1007
    @SerializedName("days_until_due")
1008
    Long daysUntilDue;
1009

1010
    /**
1011
     * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1012
     * displaying to users.
1013
     */
1014
    @SerializedName("description")
1015
    String description;
1016

1017
    /** Date on which a payment plan’s payment is due. */
1018
    @SerializedName("due_date")
1019
    Long dueDate;
1020

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

1030
    private AmountsDue(
1031
        Long amount,
1032
        Long daysUntilDue,
1033
        String description,
1034
        Long dueDate,
1035
        Map<String, Object> extraParams) {
×
1036
      this.amount = amount;
×
1037
      this.daysUntilDue = daysUntilDue;
×
1038
      this.description = description;
×
1039
      this.dueDate = dueDate;
×
1040
      this.extraParams = extraParams;
×
1041
    }
×
1042

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

1047
    public static class Builder {
×
1048
      private Long amount;
1049

1050
      private Long daysUntilDue;
1051

1052
      private String description;
1053

1054
      private Long dueDate;
1055

1056
      private Map<String, Object> extraParams;
1057

1058
      /** Finalize and obtain parameter instance from this builder. */
1059
      public InvoiceCreateParams.AmountsDue build() {
1060
        return new InvoiceCreateParams.AmountsDue(
×
1061
            this.amount, this.daysUntilDue, this.description, this.dueDate, this.extraParams);
1062
      }
1063

1064
      /** <strong>Required.</strong> The amount in cents (or local equivalent). */
1065
      public Builder setAmount(Long amount) {
1066
        this.amount = amount;
×
1067
        return this;
×
1068
      }
1069

1070
      /** Number of days from when invoice is finalized until the payment is due. */
1071
      public Builder setDaysUntilDue(Long daysUntilDue) {
1072
        this.daysUntilDue = daysUntilDue;
×
1073
        return this;
×
1074
      }
1075

1076
      /**
1077
       * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1078
       * displaying to users.
1079
       */
1080
      public Builder setDescription(String description) {
1081
        this.description = description;
×
1082
        return this;
×
1083
      }
1084

1085
      /** Date on which a payment plan’s payment is due. */
1086
      public Builder setDueDate(Long dueDate) {
1087
        this.dueDate = dueDate;
×
1088
        return this;
×
1089
      }
1090

1091
      /**
1092
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1093
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1094
       * InvoiceCreateParams.AmountsDue#extraParams} for the field documentation.
1095
       */
1096
      public Builder putExtraParam(String key, Object value) {
1097
        if (this.extraParams == null) {
×
1098
          this.extraParams = new HashMap<>();
×
1099
        }
1100
        this.extraParams.put(key, value);
×
1101
        return this;
×
1102
      }
1103

1104
      /**
1105
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1106
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1107
       * See {@link InvoiceCreateParams.AmountsDue#extraParams} for the field documentation.
1108
       */
1109
      public Builder putAllExtraParam(Map<String, Object> map) {
1110
        if (this.extraParams == null) {
×
1111
          this.extraParams = new HashMap<>();
×
1112
        }
1113
        this.extraParams.putAll(map);
×
1114
        return this;
×
1115
      }
1116
    }
1117
  }
1118

1119
  @Getter
1120
  public static class AutomaticTax {
1121
    /**
1122
     * <strong>Required.</strong> Whether Stripe automatically computes tax on this invoice. Note
1123
     * that incompatible invoice items (invoice items with manually specified <a
1124
     * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1125
     * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1126
     */
1127
    @SerializedName("enabled")
1128
    Boolean enabled;
1129

1130
    /**
1131
     * Map of extra parameters for custom features not available in this client library. The content
1132
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1133
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1134
     * param object. Effectively, this map is flattened to its parent instance.
1135
     */
1136
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1137
    Map<String, Object> extraParams;
1138

1139
    /**
1140
     * The account that's liable for tax. If set, the business address and tax registrations
1141
     * required to perform the tax calculation are loaded from this account. The tax transaction is
1142
     * returned in the report of the connected account.
1143
     */
1144
    @SerializedName("liability")
1145
    Liability liability;
1146

1147
    private AutomaticTax(Boolean enabled, Map<String, Object> extraParams, Liability liability) {
×
1148
      this.enabled = enabled;
×
1149
      this.extraParams = extraParams;
×
1150
      this.liability = liability;
×
1151
    }
×
1152

1153
    public static Builder builder() {
1154
      return new Builder();
×
1155
    }
1156

1157
    public static class Builder {
×
1158
      private Boolean enabled;
1159

1160
      private Map<String, Object> extraParams;
1161

1162
      private Liability liability;
1163

1164
      /** Finalize and obtain parameter instance from this builder. */
1165
      public InvoiceCreateParams.AutomaticTax build() {
1166
        return new InvoiceCreateParams.AutomaticTax(this.enabled, this.extraParams, this.liability);
×
1167
      }
1168

1169
      /**
1170
       * <strong>Required.</strong> Whether Stripe automatically computes tax on this invoice. Note
1171
       * that incompatible invoice items (invoice items with manually specified <a
1172
       * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1173
       * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1174
       */
1175
      public Builder setEnabled(Boolean enabled) {
1176
        this.enabled = enabled;
×
1177
        return this;
×
1178
      }
1179

1180
      /**
1181
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1182
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1183
       * InvoiceCreateParams.AutomaticTax#extraParams} for the field documentation.
1184
       */
1185
      public Builder putExtraParam(String key, Object value) {
1186
        if (this.extraParams == null) {
×
1187
          this.extraParams = new HashMap<>();
×
1188
        }
1189
        this.extraParams.put(key, value);
×
1190
        return this;
×
1191
      }
1192

1193
      /**
1194
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1195
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1196
       * See {@link InvoiceCreateParams.AutomaticTax#extraParams} for the field documentation.
1197
       */
1198
      public Builder putAllExtraParam(Map<String, Object> map) {
1199
        if (this.extraParams == null) {
×
1200
          this.extraParams = new HashMap<>();
×
1201
        }
1202
        this.extraParams.putAll(map);
×
1203
        return this;
×
1204
      }
1205

1206
      /**
1207
       * The account that's liable for tax. If set, the business address and tax registrations
1208
       * required to perform the tax calculation are loaded from this account. The tax transaction
1209
       * is returned in the report of the connected account.
1210
       */
1211
      public Builder setLiability(InvoiceCreateParams.AutomaticTax.Liability liability) {
1212
        this.liability = liability;
×
1213
        return this;
×
1214
      }
1215
    }
1216

1217
    @Getter
1218
    public static class Liability {
1219
      /** The connected account being referenced when {@code type} is {@code account}. */
1220
      @SerializedName("account")
1221
      String account;
1222

1223
      /**
1224
       * Map of extra parameters for custom features not available in this client library. The
1225
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1226
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1227
       * name in this param object. Effectively, this map is flattened to its parent instance.
1228
       */
1229
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1230
      Map<String, Object> extraParams;
1231

1232
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1233
      @SerializedName("type")
1234
      Type type;
1235

1236
      private Liability(String account, Map<String, Object> extraParams, Type type) {
×
1237
        this.account = account;
×
1238
        this.extraParams = extraParams;
×
1239
        this.type = type;
×
1240
      }
×
1241

1242
      public static Builder builder() {
1243
        return new Builder();
×
1244
      }
1245

1246
      public static class Builder {
×
1247
        private String account;
1248

1249
        private Map<String, Object> extraParams;
1250

1251
        private Type type;
1252

1253
        /** Finalize and obtain parameter instance from this builder. */
1254
        public InvoiceCreateParams.AutomaticTax.Liability build() {
1255
          return new InvoiceCreateParams.AutomaticTax.Liability(
×
1256
              this.account, this.extraParams, this.type);
1257
        }
1258

1259
        /** The connected account being referenced when {@code type} is {@code account}. */
1260
        public Builder setAccount(String account) {
1261
          this.account = account;
×
1262
          return this;
×
1263
        }
1264

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

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

1293
        /** <strong>Required.</strong> Type of the account referenced in the request. */
1294
        public Builder setType(InvoiceCreateParams.AutomaticTax.Liability.Type type) {
1295
          this.type = type;
×
1296
          return this;
×
1297
        }
1298
      }
1299

1300
      public enum Type implements ApiRequestParams.EnumParam {
×
1301
        @SerializedName("account")
×
1302
        ACCOUNT("account"),
1303

1304
        @SerializedName("self")
×
1305
        SELF("self");
1306

1307
        @Getter(onMethod_ = {@Override})
1308
        private final String value;
1309

1310
        Type(String value) {
×
1311
          this.value = value;
×
1312
        }
×
1313
      }
1314
    }
1315
  }
1316

1317
  @Getter
1318
  public static class CustomField {
1319
    /**
1320
     * Map of extra parameters for custom features not available in this client library. The content
1321
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1322
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1323
     * param object. Effectively, this map is flattened to its parent instance.
1324
     */
1325
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1326
    Map<String, Object> extraParams;
1327

1328
    /** <strong>Required.</strong> The name of the custom field. This may be up to 40 characters. */
1329
    @SerializedName("name")
1330
    String name;
1331

1332
    /**
1333
     * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1334
     */
1335
    @SerializedName("value")
1336
    String value;
1337

1338
    private CustomField(Map<String, Object> extraParams, String name, String value) {
1✔
1339
      this.extraParams = extraParams;
1✔
1340
      this.name = name;
1✔
1341
      this.value = value;
1✔
1342
    }
1✔
1343

1344
    public static Builder builder() {
1345
      return new Builder();
1✔
1346
    }
1347

1348
    public static class Builder {
1✔
1349
      private Map<String, Object> extraParams;
1350

1351
      private String name;
1352

1353
      private String value;
1354

1355
      /** Finalize and obtain parameter instance from this builder. */
1356
      public InvoiceCreateParams.CustomField build() {
1357
        return new InvoiceCreateParams.CustomField(this.extraParams, this.name, this.value);
1✔
1358
      }
1359

1360
      /**
1361
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1362
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1363
       * InvoiceCreateParams.CustomField#extraParams} for the field documentation.
1364
       */
1365
      public Builder putExtraParam(String key, Object value) {
1366
        if (this.extraParams == null) {
×
1367
          this.extraParams = new HashMap<>();
×
1368
        }
1369
        this.extraParams.put(key, value);
×
1370
        return this;
×
1371
      }
1372

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

1386
      /**
1387
       * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1388
       */
1389
      public Builder setName(String name) {
1390
        this.name = name;
1✔
1391
        return this;
1✔
1392
      }
1393

1394
      /**
1395
       * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1396
       */
1397
      public Builder setValue(String value) {
1398
        this.value = value;
1✔
1399
        return this;
1✔
1400
      }
1401
    }
1402
  }
1403

1404
  @Getter
1405
  public static class Discount {
1406
    /** ID of the coupon to create a new discount for. */
1407
    @SerializedName("coupon")
1408
    String coupon;
1409

1410
    /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1411
    @SerializedName("discount")
1412
    String discount;
1413

1414
    /** Details to determine how long the discount should be applied for. */
1415
    @SerializedName("discount_end")
1416
    DiscountEnd discountEnd;
1417

1418
    /**
1419
     * Map of extra parameters for custom features not available in this client library. The content
1420
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1421
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1422
     * param object. Effectively, this map is flattened to its parent instance.
1423
     */
1424
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1425
    Map<String, Object> extraParams;
1426

1427
    /** ID of the promotion code to create a new discount for. */
1428
    @SerializedName("promotion_code")
1429
    String promotionCode;
1430

1431
    private Discount(
1432
        String coupon,
1433
        String discount,
1434
        DiscountEnd discountEnd,
1435
        Map<String, Object> extraParams,
1436
        String promotionCode) {
×
1437
      this.coupon = coupon;
×
1438
      this.discount = discount;
×
1439
      this.discountEnd = discountEnd;
×
1440
      this.extraParams = extraParams;
×
1441
      this.promotionCode = promotionCode;
×
1442
    }
×
1443

1444
    public static Builder builder() {
1445
      return new Builder();
×
1446
    }
1447

1448
    public static class Builder {
×
1449
      private String coupon;
1450

1451
      private String discount;
1452

1453
      private DiscountEnd discountEnd;
1454

1455
      private Map<String, Object> extraParams;
1456

1457
      private String promotionCode;
1458

1459
      /** Finalize and obtain parameter instance from this builder. */
1460
      public InvoiceCreateParams.Discount build() {
1461
        return new InvoiceCreateParams.Discount(
×
1462
            this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode);
1463
      }
1464

1465
      /** ID of the coupon to create a new discount for. */
1466
      public Builder setCoupon(String coupon) {
1467
        this.coupon = coupon;
×
1468
        return this;
×
1469
      }
1470

1471
      /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1472
      public Builder setDiscount(String discount) {
1473
        this.discount = discount;
×
1474
        return this;
×
1475
      }
1476

1477
      /** Details to determine how long the discount should be applied for. */
1478
      public Builder setDiscountEnd(InvoiceCreateParams.Discount.DiscountEnd discountEnd) {
1479
        this.discountEnd = discountEnd;
×
1480
        return this;
×
1481
      }
1482

1483
      /**
1484
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1485
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1486
       * InvoiceCreateParams.Discount#extraParams} for the field documentation.
1487
       */
1488
      public Builder putExtraParam(String key, Object value) {
1489
        if (this.extraParams == null) {
×
1490
          this.extraParams = new HashMap<>();
×
1491
        }
1492
        this.extraParams.put(key, value);
×
1493
        return this;
×
1494
      }
1495

1496
      /**
1497
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1498
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1499
       * See {@link InvoiceCreateParams.Discount#extraParams} for the field documentation.
1500
       */
1501
      public Builder putAllExtraParam(Map<String, Object> map) {
1502
        if (this.extraParams == null) {
×
1503
          this.extraParams = new HashMap<>();
×
1504
        }
1505
        this.extraParams.putAll(map);
×
1506
        return this;
×
1507
      }
1508

1509
      /** ID of the promotion code to create a new discount for. */
1510
      public Builder setPromotionCode(String promotionCode) {
1511
        this.promotionCode = promotionCode;
×
1512
        return this;
×
1513
      }
1514
    }
1515

1516
    @Getter
1517
    public static class DiscountEnd {
1518
      /** Time span for the redeemed discount. */
1519
      @SerializedName("duration")
1520
      Duration duration;
1521

1522
      /**
1523
       * Map of extra parameters for custom features not available in this client library. The
1524
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1525
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1526
       * name in this param object. Effectively, this map is flattened to its parent instance.
1527
       */
1528
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1529
      Map<String, Object> extraParams;
1530

1531
      /** A precise Unix timestamp for the discount to end. Must be in the future. */
1532
      @SerializedName("timestamp")
1533
      Long timestamp;
1534

1535
      /**
1536
       * <strong>Required.</strong> The type of calculation made to determine when the discount
1537
       * ends.
1538
       */
1539
      @SerializedName("type")
1540
      Type type;
1541

1542
      private DiscountEnd(
1543
          Duration duration, Map<String, Object> extraParams, Long timestamp, Type type) {
×
1544
        this.duration = duration;
×
1545
        this.extraParams = extraParams;
×
1546
        this.timestamp = timestamp;
×
1547
        this.type = type;
×
1548
      }
×
1549

1550
      public static Builder builder() {
1551
        return new Builder();
×
1552
      }
1553

1554
      public static class Builder {
×
1555
        private Duration duration;
1556

1557
        private Map<String, Object> extraParams;
1558

1559
        private Long timestamp;
1560

1561
        private Type type;
1562

1563
        /** Finalize and obtain parameter instance from this builder. */
1564
        public InvoiceCreateParams.Discount.DiscountEnd build() {
1565
          return new InvoiceCreateParams.Discount.DiscountEnd(
×
1566
              this.duration, this.extraParams, this.timestamp, this.type);
1567
        }
1568

1569
        /** Time span for the redeemed discount. */
1570
        public Builder setDuration(InvoiceCreateParams.Discount.DiscountEnd.Duration duration) {
1571
          this.duration = duration;
×
1572
          return this;
×
1573
        }
1574

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

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

1603
        /** A precise Unix timestamp for the discount to end. Must be in the future. */
1604
        public Builder setTimestamp(Long timestamp) {
1605
          this.timestamp = timestamp;
×
1606
          return this;
×
1607
        }
1608

1609
        /**
1610
         * <strong>Required.</strong> The type of calculation made to determine when the discount
1611
         * ends.
1612
         */
1613
        public Builder setType(InvoiceCreateParams.Discount.DiscountEnd.Type type) {
1614
          this.type = type;
×
1615
          return this;
×
1616
        }
1617
      }
1618

1619
      @Getter
1620
      public static class Duration {
1621
        /**
1622
         * Map of extra parameters for custom features not available in this client library. The
1623
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1624
         * Instead, each key/value pair is serialized as if the key is a root-level field
1625
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1626
         * instance.
1627
         */
1628
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1629
        Map<String, Object> extraParams;
1630

1631
        /**
1632
         * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day}, {@code
1633
         * week}, {@code month} or {@code year}.
1634
         */
1635
        @SerializedName("interval")
1636
        Interval interval;
1637

1638
        /**
1639
         * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1640
         * Stripe multiplies this by the interval type to get the overall duration.
1641
         */
1642
        @SerializedName("interval_count")
1643
        Long intervalCount;
1644

1645
        private Duration(Map<String, Object> extraParams, Interval interval, Long intervalCount) {
×
1646
          this.extraParams = extraParams;
×
1647
          this.interval = interval;
×
1648
          this.intervalCount = intervalCount;
×
1649
        }
×
1650

1651
        public static Builder builder() {
1652
          return new Builder();
×
1653
        }
1654

1655
        public static class Builder {
×
1656
          private Map<String, Object> extraParams;
1657

1658
          private Interval interval;
1659

1660
          private Long intervalCount;
1661

1662
          /** Finalize and obtain parameter instance from this builder. */
1663
          public InvoiceCreateParams.Discount.DiscountEnd.Duration build() {
1664
            return new InvoiceCreateParams.Discount.DiscountEnd.Duration(
×
1665
                this.extraParams, this.interval, this.intervalCount);
1666
          }
1667

1668
          /**
1669
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1670
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1671
           * map. See {@link InvoiceCreateParams.Discount.DiscountEnd.Duration#extraParams} for the
1672
           * field documentation.
1673
           */
1674
          public Builder putExtraParam(String key, Object value) {
1675
            if (this.extraParams == null) {
×
1676
              this.extraParams = new HashMap<>();
×
1677
            }
1678
            this.extraParams.put(key, value);
×
1679
            return this;
×
1680
          }
1681

1682
          /**
1683
           * Add all map key/value pairs 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 InvoiceCreateParams.Discount.DiscountEnd.Duration#extraParams} for the
1686
           * field documentation.
1687
           */
1688
          public Builder putAllExtraParam(Map<String, Object> map) {
1689
            if (this.extraParams == null) {
×
1690
              this.extraParams = new HashMap<>();
×
1691
            }
1692
            this.extraParams.putAll(map);
×
1693
            return this;
×
1694
          }
1695

1696
          /**
1697
           * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day},
1698
           * {@code week}, {@code month} or {@code year}.
1699
           */
1700
          public Builder setInterval(
1701
              InvoiceCreateParams.Discount.DiscountEnd.Duration.Interval interval) {
1702
            this.interval = interval;
×
1703
            return this;
×
1704
          }
1705

1706
          /**
1707
           * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1708
           * Stripe multiplies this by the interval type to get the overall duration.
1709
           */
1710
          public Builder setIntervalCount(Long intervalCount) {
1711
            this.intervalCount = intervalCount;
×
1712
            return this;
×
1713
          }
1714
        }
1715

1716
        public enum Interval implements ApiRequestParams.EnumParam {
×
1717
          @SerializedName("day")
×
1718
          DAY("day"),
1719

1720
          @SerializedName("month")
×
1721
          MONTH("month"),
1722

1723
          @SerializedName("week")
×
1724
          WEEK("week"),
1725

1726
          @SerializedName("year")
×
1727
          YEAR("year");
1728

1729
          @Getter(onMethod_ = {@Override})
1730
          private final String value;
1731

1732
          Interval(String value) {
×
1733
            this.value = value;
×
1734
          }
×
1735
        }
1736
      }
1737

1738
      public enum Type implements ApiRequestParams.EnumParam {
×
1739
        @SerializedName("duration")
×
1740
        DURATION("duration"),
1741

1742
        @SerializedName("timestamp")
×
1743
        TIMESTAMP("timestamp");
1744

1745
        @Getter(onMethod_ = {@Override})
1746
        private final String value;
1747

1748
        Type(String value) {
×
1749
          this.value = value;
×
1750
        }
×
1751
      }
1752
    }
1753
  }
1754

1755
  @Getter
1756
  public static class FromInvoice {
1757
    /**
1758
     * <strong>Required.</strong> The relation between the new invoice and the original invoice.
1759
     * Currently, only 'revision' is permitted
1760
     */
1761
    @SerializedName("action")
1762
    Action action;
1763

1764
    /**
1765
     * Map of extra parameters for custom features not available in this client library. The content
1766
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1767
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1768
     * param object. Effectively, this map is flattened to its parent instance.
1769
     */
1770
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1771
    Map<String, Object> extraParams;
1772

1773
    /** <strong>Required.</strong> The {@code id} of the invoice that will be cloned. */
1774
    @SerializedName("invoice")
1775
    String invoice;
1776

1777
    private FromInvoice(Action action, Map<String, Object> extraParams, String invoice) {
×
1778
      this.action = action;
×
1779
      this.extraParams = extraParams;
×
1780
      this.invoice = invoice;
×
1781
    }
×
1782

1783
    public static Builder builder() {
1784
      return new Builder();
×
1785
    }
1786

1787
    public static class Builder {
×
1788
      private Action action;
1789

1790
      private Map<String, Object> extraParams;
1791

1792
      private String invoice;
1793

1794
      /** Finalize and obtain parameter instance from this builder. */
1795
      public InvoiceCreateParams.FromInvoice build() {
1796
        return new InvoiceCreateParams.FromInvoice(this.action, this.extraParams, this.invoice);
×
1797
      }
1798

1799
      /**
1800
       * <strong>Required.</strong> The relation between the new invoice and the original invoice.
1801
       * Currently, only 'revision' is permitted
1802
       */
1803
      public Builder setAction(InvoiceCreateParams.FromInvoice.Action action) {
1804
        this.action = action;
×
1805
        return this;
×
1806
      }
1807

1808
      /**
1809
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1810
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1811
       * InvoiceCreateParams.FromInvoice#extraParams} for the field documentation.
1812
       */
1813
      public Builder putExtraParam(String key, Object value) {
1814
        if (this.extraParams == null) {
×
1815
          this.extraParams = new HashMap<>();
×
1816
        }
1817
        this.extraParams.put(key, value);
×
1818
        return this;
×
1819
      }
1820

1821
      /**
1822
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1823
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1824
       * See {@link InvoiceCreateParams.FromInvoice#extraParams} for the field documentation.
1825
       */
1826
      public Builder putAllExtraParam(Map<String, Object> map) {
1827
        if (this.extraParams == null) {
×
1828
          this.extraParams = new HashMap<>();
×
1829
        }
1830
        this.extraParams.putAll(map);
×
1831
        return this;
×
1832
      }
1833

1834
      /** <strong>Required.</strong> The {@code id} of the invoice that will be cloned. */
1835
      public Builder setInvoice(String invoice) {
1836
        this.invoice = invoice;
×
1837
        return this;
×
1838
      }
1839
    }
1840

1841
    public enum Action implements ApiRequestParams.EnumParam {
×
1842
      @SerializedName("revision")
×
1843
      REVISION("revision");
1844

1845
      @Getter(onMethod_ = {@Override})
1846
      private final String value;
1847

1848
      Action(String value) {
×
1849
        this.value = value;
×
1850
      }
×
1851
    }
1852
  }
1853

1854
  @Getter
1855
  public static class Issuer {
1856
    /** The connected account being referenced when {@code type} is {@code account}. */
1857
    @SerializedName("account")
1858
    String account;
1859

1860
    /**
1861
     * Map of extra parameters for custom features not available in this client library. The content
1862
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1863
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1864
     * param object. Effectively, this map is flattened to its parent instance.
1865
     */
1866
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1867
    Map<String, Object> extraParams;
1868

1869
    /** <strong>Required.</strong> Type of the account referenced in the request. */
1870
    @SerializedName("type")
1871
    Type type;
1872

1873
    private Issuer(String account, Map<String, Object> extraParams, Type type) {
×
1874
      this.account = account;
×
1875
      this.extraParams = extraParams;
×
1876
      this.type = type;
×
1877
    }
×
1878

1879
    public static Builder builder() {
1880
      return new Builder();
×
1881
    }
1882

1883
    public static class Builder {
×
1884
      private String account;
1885

1886
      private Map<String, Object> extraParams;
1887

1888
      private Type type;
1889

1890
      /** Finalize and obtain parameter instance from this builder. */
1891
      public InvoiceCreateParams.Issuer build() {
1892
        return new InvoiceCreateParams.Issuer(this.account, this.extraParams, this.type);
×
1893
      }
1894

1895
      /** The connected account being referenced when {@code type} is {@code account}. */
1896
      public Builder setAccount(String account) {
1897
        this.account = account;
×
1898
        return this;
×
1899
      }
1900

1901
      /**
1902
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1903
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1904
       * InvoiceCreateParams.Issuer#extraParams} for the field documentation.
1905
       */
1906
      public Builder putExtraParam(String key, Object value) {
1907
        if (this.extraParams == null) {
×
1908
          this.extraParams = new HashMap<>();
×
1909
        }
1910
        this.extraParams.put(key, value);
×
1911
        return this;
×
1912
      }
1913

1914
      /**
1915
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1916
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1917
       * See {@link InvoiceCreateParams.Issuer#extraParams} for the field documentation.
1918
       */
1919
      public Builder putAllExtraParam(Map<String, Object> map) {
1920
        if (this.extraParams == null) {
×
1921
          this.extraParams = new HashMap<>();
×
1922
        }
1923
        this.extraParams.putAll(map);
×
1924
        return this;
×
1925
      }
1926

1927
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1928
      public Builder setType(InvoiceCreateParams.Issuer.Type type) {
1929
        this.type = type;
×
1930
        return this;
×
1931
      }
1932
    }
1933

1934
    public enum Type implements ApiRequestParams.EnumParam {
×
1935
      @SerializedName("account")
×
1936
      ACCOUNT("account"),
1937

1938
      @SerializedName("self")
×
1939
      SELF("self");
1940

1941
      @Getter(onMethod_ = {@Override})
1942
      private final String value;
1943

1944
      Type(String value) {
×
1945
        this.value = value;
×
1946
      }
×
1947
    }
1948
  }
1949

1950
  @Getter
1951
  public static class PaymentSettings {
1952
    /**
1953
     * ID of the mandate to be used for this invoice. It must correspond to the payment method used
1954
     * to pay the invoice, including the invoice's default_payment_method or default_source, if set.
1955
     */
1956
    @SerializedName("default_mandate")
1957
    Object defaultMandate;
1958

1959
    /**
1960
     * Map of extra parameters for custom features not available in this client library. The content
1961
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1962
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1963
     * param object. Effectively, this map is flattened to its parent instance.
1964
     */
1965
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1966
    Map<String, Object> extraParams;
1967

1968
    /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
1969
    @SerializedName("payment_method_options")
1970
    PaymentMethodOptions paymentMethodOptions;
1971

1972
    /**
1973
     * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
1974
     * not set, Stripe attempts to automatically determine the types to use by looking at the
1975
     * invoice’s default payment method, the subscription’s default payment method, the customer’s
1976
     * default payment method, and your <a
1977
     * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
1978
     */
1979
    @SerializedName("payment_method_types")
1980
    Object paymentMethodTypes;
1981

1982
    private PaymentSettings(
1983
        Object defaultMandate,
1984
        Map<String, Object> extraParams,
1985
        PaymentMethodOptions paymentMethodOptions,
1986
        Object paymentMethodTypes) {
×
1987
      this.defaultMandate = defaultMandate;
×
1988
      this.extraParams = extraParams;
×
1989
      this.paymentMethodOptions = paymentMethodOptions;
×
1990
      this.paymentMethodTypes = paymentMethodTypes;
×
1991
    }
×
1992

1993
    public static Builder builder() {
1994
      return new Builder();
×
1995
    }
1996

1997
    public static class Builder {
×
1998
      private Object defaultMandate;
1999

2000
      private Map<String, Object> extraParams;
2001

2002
      private PaymentMethodOptions paymentMethodOptions;
2003

2004
      private Object paymentMethodTypes;
2005

2006
      /** Finalize and obtain parameter instance from this builder. */
2007
      public InvoiceCreateParams.PaymentSettings build() {
2008
        return new InvoiceCreateParams.PaymentSettings(
×
2009
            this.defaultMandate,
2010
            this.extraParams,
2011
            this.paymentMethodOptions,
2012
            this.paymentMethodTypes);
2013
      }
2014

2015
      /**
2016
       * ID of the mandate to be used for this invoice. It must correspond to the payment method
2017
       * used to pay the invoice, including the invoice's default_payment_method or default_source,
2018
       * if set.
2019
       */
2020
      public Builder setDefaultMandate(String defaultMandate) {
2021
        this.defaultMandate = defaultMandate;
×
2022
        return this;
×
2023
      }
2024

2025
      /**
2026
       * ID of the mandate to be used for this invoice. It must correspond to the payment method
2027
       * used to pay the invoice, including the invoice's default_payment_method or default_source,
2028
       * if set.
2029
       */
2030
      public Builder setDefaultMandate(EmptyParam defaultMandate) {
2031
        this.defaultMandate = defaultMandate;
×
2032
        return this;
×
2033
      }
2034

2035
      /**
2036
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
2037
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
2038
       * InvoiceCreateParams.PaymentSettings#extraParams} for the field documentation.
2039
       */
2040
      public Builder putExtraParam(String key, Object value) {
2041
        if (this.extraParams == null) {
×
2042
          this.extraParams = new HashMap<>();
×
2043
        }
2044
        this.extraParams.put(key, value);
×
2045
        return this;
×
2046
      }
2047

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

2061
      /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
2062
      public Builder setPaymentMethodOptions(
2063
          InvoiceCreateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) {
2064
        this.paymentMethodOptions = paymentMethodOptions;
×
2065
        return this;
×
2066
      }
2067

2068
      /**
2069
       * Add an element to `paymentMethodTypes` list. A list is initialized for the first
2070
       * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
2071
       * {@link InvoiceCreateParams.PaymentSettings#paymentMethodTypes} for the field documentation.
2072
       */
2073
      @SuppressWarnings("unchecked")
2074
      public Builder addPaymentMethodType(
2075
          InvoiceCreateParams.PaymentSettings.PaymentMethodType element) {
2076
        if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) {
×
2077
          this.paymentMethodTypes =
×
2078
              new ArrayList<InvoiceCreateParams.PaymentSettings.PaymentMethodType>();
2079
        }
2080
        ((List<InvoiceCreateParams.PaymentSettings.PaymentMethodType>) this.paymentMethodTypes)
×
2081
            .add(element);
×
2082
        return this;
×
2083
      }
2084

2085
      /**
2086
       * Add all elements to `paymentMethodTypes` list. A list is initialized for the first
2087
       * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
2088
       * {@link InvoiceCreateParams.PaymentSettings#paymentMethodTypes} for the field documentation.
2089
       */
2090
      @SuppressWarnings("unchecked")
2091
      public Builder addAllPaymentMethodType(
2092
          List<InvoiceCreateParams.PaymentSettings.PaymentMethodType> elements) {
2093
        if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) {
×
2094
          this.paymentMethodTypes =
×
2095
              new ArrayList<InvoiceCreateParams.PaymentSettings.PaymentMethodType>();
2096
        }
2097
        ((List<InvoiceCreateParams.PaymentSettings.PaymentMethodType>) this.paymentMethodTypes)
×
2098
            .addAll(elements);
×
2099
        return this;
×
2100
      }
2101

2102
      /**
2103
       * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
2104
       * not set, Stripe attempts to automatically determine the types to use by looking at the
2105
       * invoice’s default payment method, the subscription’s default payment method, the customer’s
2106
       * default payment method, and your <a
2107
       * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
2108
       */
2109
      public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) {
2110
        this.paymentMethodTypes = paymentMethodTypes;
×
2111
        return this;
×
2112
      }
2113

2114
      /**
2115
       * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
2116
       * not set, Stripe attempts to automatically determine the types to use by looking at the
2117
       * invoice’s default payment method, the subscription’s default payment method, the customer’s
2118
       * default payment method, and your <a
2119
       * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
2120
       */
2121
      public Builder setPaymentMethodTypes(
2122
          List<InvoiceCreateParams.PaymentSettings.PaymentMethodType> paymentMethodTypes) {
2123
        this.paymentMethodTypes = paymentMethodTypes;
×
2124
        return this;
×
2125
      }
2126
    }
2127

2128
    @Getter
2129
    public static class PaymentMethodOptions {
2130
      /**
2131
       * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2132
       * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2133
       */
2134
      @SerializedName("acss_debit")
2135
      Object acssDebit;
2136

2137
      /**
2138
       * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
2139
       * payment method options to pass to the invoice’s PaymentIntent.
2140
       */
2141
      @SerializedName("bancontact")
2142
      Object bancontact;
2143

2144
      /**
2145
       * If paying by {@code card}, this sub-hash contains details about the Card payment method
2146
       * options to pass to the invoice’s PaymentIntent.
2147
       */
2148
      @SerializedName("card")
2149
      Object card;
2150

2151
      /**
2152
       * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
2153
       * transfer payment method options to pass to the invoice’s PaymentIntent.
2154
       */
2155
      @SerializedName("customer_balance")
2156
      Object customerBalance;
2157

2158
      /**
2159
       * Map of extra parameters for custom features not available in this client library. The
2160
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2161
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2162
       * name in this param object. Effectively, this map is flattened to its parent instance.
2163
       */
2164
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2165
      Map<String, Object> extraParams;
2166

2167
      /**
2168
       * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2169
       * method options to pass to the invoice’s PaymentIntent.
2170
       */
2171
      @SerializedName("konbini")
2172
      Object konbini;
2173

2174
      /**
2175
       * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct Debit
2176
       * payment method options to pass to the invoice’s PaymentIntent.
2177
       */
2178
      @SerializedName("sepa_debit")
2179
      Object sepaDebit;
2180

2181
      /**
2182
       * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2183
       * debit payment method options to pass to the invoice’s PaymentIntent.
2184
       */
2185
      @SerializedName("us_bank_account")
2186
      Object usBankAccount;
2187

2188
      private PaymentMethodOptions(
2189
          Object acssDebit,
2190
          Object bancontact,
2191
          Object card,
2192
          Object customerBalance,
2193
          Map<String, Object> extraParams,
2194
          Object konbini,
2195
          Object sepaDebit,
2196
          Object usBankAccount) {
×
2197
        this.acssDebit = acssDebit;
×
2198
        this.bancontact = bancontact;
×
2199
        this.card = card;
×
2200
        this.customerBalance = customerBalance;
×
2201
        this.extraParams = extraParams;
×
2202
        this.konbini = konbini;
×
2203
        this.sepaDebit = sepaDebit;
×
2204
        this.usBankAccount = usBankAccount;
×
2205
      }
×
2206

2207
      public static Builder builder() {
2208
        return new Builder();
×
2209
      }
2210

2211
      public static class Builder {
×
2212
        private Object acssDebit;
2213

2214
        private Object bancontact;
2215

2216
        private Object card;
2217

2218
        private Object customerBalance;
2219

2220
        private Map<String, Object> extraParams;
2221

2222
        private Object konbini;
2223

2224
        private Object sepaDebit;
2225

2226
        private Object usBankAccount;
2227

2228
        /** Finalize and obtain parameter instance from this builder. */
2229
        public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions build() {
2230
          return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions(
×
2231
              this.acssDebit,
2232
              this.bancontact,
2233
              this.card,
2234
              this.customerBalance,
2235
              this.extraParams,
2236
              this.konbini,
2237
              this.sepaDebit,
2238
              this.usBankAccount);
2239
        }
2240

2241
        /**
2242
         * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2243
         * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2244
         */
2245
        public Builder setAcssDebit(
2246
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit acssDebit) {
2247
          this.acssDebit = acssDebit;
×
2248
          return this;
×
2249
        }
2250

2251
        /**
2252
         * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2253
         * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2254
         */
2255
        public Builder setAcssDebit(EmptyParam acssDebit) {
2256
          this.acssDebit = acssDebit;
×
2257
          return this;
×
2258
        }
2259

2260
        /**
2261
         * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
2262
         * payment method options to pass to the invoice’s PaymentIntent.
2263
         */
2264
        public Builder setBancontact(
2265
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact bancontact) {
2266
          this.bancontact = bancontact;
×
2267
          return this;
×
2268
        }
2269

2270
        /**
2271
         * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
2272
         * payment method options to pass to the invoice’s PaymentIntent.
2273
         */
2274
        public Builder setBancontact(EmptyParam bancontact) {
2275
          this.bancontact = bancontact;
×
2276
          return this;
×
2277
        }
2278

2279
        /**
2280
         * If paying by {@code card}, this sub-hash contains details about the Card payment method
2281
         * options to pass to the invoice’s PaymentIntent.
2282
         */
2283
        public Builder setCard(InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card card) {
2284
          this.card = card;
×
2285
          return this;
×
2286
        }
2287

2288
        /**
2289
         * If paying by {@code card}, this sub-hash contains details about the Card payment method
2290
         * options to pass to the invoice’s PaymentIntent.
2291
         */
2292
        public Builder setCard(EmptyParam card) {
2293
          this.card = card;
×
2294
          return this;
×
2295
        }
2296

2297
        /**
2298
         * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
2299
         * transfer payment method options to pass to the invoice’s PaymentIntent.
2300
         */
2301
        public Builder setCustomerBalance(
2302
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
2303
                customerBalance) {
2304
          this.customerBalance = customerBalance;
×
2305
          return this;
×
2306
        }
2307

2308
        /**
2309
         * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
2310
         * transfer payment method options to pass to the invoice’s PaymentIntent.
2311
         */
2312
        public Builder setCustomerBalance(EmptyParam customerBalance) {
2313
          this.customerBalance = customerBalance;
×
2314
          return this;
×
2315
        }
2316

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

2331
        /**
2332
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2333
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2334
         * map. See {@link InvoiceCreateParams.PaymentSettings.PaymentMethodOptions#extraParams} for
2335
         * the field documentation.
2336
         */
2337
        public Builder putAllExtraParam(Map<String, Object> map) {
2338
          if (this.extraParams == null) {
×
2339
            this.extraParams = new HashMap<>();
×
2340
          }
2341
          this.extraParams.putAll(map);
×
2342
          return this;
×
2343
        }
2344

2345
        /**
2346
         * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2347
         * method options to pass to the invoice’s PaymentIntent.
2348
         */
2349
        public Builder setKonbini(
2350
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini konbini) {
2351
          this.konbini = konbini;
×
2352
          return this;
×
2353
        }
2354

2355
        /**
2356
         * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2357
         * method options to pass to the invoice’s PaymentIntent.
2358
         */
2359
        public Builder setKonbini(EmptyParam konbini) {
2360
          this.konbini = konbini;
×
2361
          return this;
×
2362
        }
2363

2364
        /**
2365
         * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct
2366
         * Debit payment method options to pass to the invoice’s PaymentIntent.
2367
         */
2368
        public Builder setSepaDebit(
2369
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit sepaDebit) {
2370
          this.sepaDebit = sepaDebit;
×
2371
          return this;
×
2372
        }
2373

2374
        /**
2375
         * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct
2376
         * Debit payment method options to pass to the invoice’s PaymentIntent.
2377
         */
2378
        public Builder setSepaDebit(EmptyParam sepaDebit) {
2379
          this.sepaDebit = sepaDebit;
×
2380
          return this;
×
2381
        }
2382

2383
        /**
2384
         * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2385
         * debit payment method options to pass to the invoice’s PaymentIntent.
2386
         */
2387
        public Builder setUsBankAccount(
2388
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount usBankAccount) {
2389
          this.usBankAccount = usBankAccount;
×
2390
          return this;
×
2391
        }
2392

2393
        /**
2394
         * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2395
         * debit payment method options to pass to the invoice’s PaymentIntent.
2396
         */
2397
        public Builder setUsBankAccount(EmptyParam usBankAccount) {
2398
          this.usBankAccount = usBankAccount;
×
2399
          return this;
×
2400
        }
2401
      }
2402

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

2415
        /** Additional fields for Mandate creation. */
2416
        @SerializedName("mandate_options")
2417
        MandateOptions mandateOptions;
2418

2419
        /** Verification method for the intent. */
2420
        @SerializedName("verification_method")
2421
        VerificationMethod verificationMethod;
2422

2423
        private AcssDebit(
2424
            Map<String, Object> extraParams,
2425
            MandateOptions mandateOptions,
2426
            VerificationMethod verificationMethod) {
×
2427
          this.extraParams = extraParams;
×
2428
          this.mandateOptions = mandateOptions;
×
2429
          this.verificationMethod = verificationMethod;
×
2430
        }
×
2431

2432
        public static Builder builder() {
2433
          return new Builder();
×
2434
        }
2435

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

2439
          private MandateOptions mandateOptions;
2440

2441
          private VerificationMethod verificationMethod;
2442

2443
          /** Finalize and obtain parameter instance from this builder. */
2444
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() {
2445
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit(
×
2446
                this.extraParams, this.mandateOptions, this.verificationMethod);
2447
          }
2448

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

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

2479
          /** Additional fields for Mandate creation. */
2480
          public Builder setMandateOptions(
2481
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2482
                  mandateOptions) {
2483
            this.mandateOptions = mandateOptions;
×
2484
            return this;
×
2485
          }
2486

2487
          /** Verification method for the intent. */
2488
          public Builder setVerificationMethod(
2489
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.VerificationMethod
2490
                  verificationMethod) {
2491
            this.verificationMethod = verificationMethod;
×
2492
            return this;
×
2493
          }
2494
        }
2495

2496
        @Getter
2497
        public static class MandateOptions {
2498
          /**
2499
           * Map of extra parameters for custom features not available in this client library. The
2500
           * content in this map is not serialized under this field's {@code @SerializedName} value.
2501
           * Instead, each key/value pair is serialized as if the key is a root-level field
2502
           * (serialized) name in this param object. Effectively, this map is flattened to its
2503
           * parent instance.
2504
           */
2505
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2506
          Map<String, Object> extraParams;
2507

2508
          /** Transaction type of the mandate. */
2509
          @SerializedName("transaction_type")
2510
          TransactionType transactionType;
2511

2512
          private MandateOptions(Map<String, Object> extraParams, TransactionType transactionType) {
×
2513
            this.extraParams = extraParams;
×
2514
            this.transactionType = transactionType;
×
2515
          }
×
2516

2517
          public static Builder builder() {
2518
            return new Builder();
×
2519
          }
2520

2521
          public static class Builder {
×
2522
            private Map<String, Object> extraParams;
2523

2524
            private TransactionType transactionType;
2525

2526
            /** Finalize and obtain parameter instance from this builder. */
2527
            public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2528
                build() {
2529
              return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit
×
2530
                  .MandateOptions(this.extraParams, this.transactionType);
2531
            }
2532

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

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

2563
            /** Transaction type of the mandate. */
2564
            public Builder setTransactionType(
2565
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2566
                        .TransactionType
2567
                    transactionType) {
2568
              this.transactionType = transactionType;
×
2569
              return this;
×
2570
            }
2571
          }
2572

2573
          public enum TransactionType implements ApiRequestParams.EnumParam {
×
2574
            @SerializedName("business")
×
2575
            BUSINESS("business"),
2576

2577
            @SerializedName("personal")
×
2578
            PERSONAL("personal");
2579

2580
            @Getter(onMethod_ = {@Override})
2581
            private final String value;
2582

2583
            TransactionType(String value) {
×
2584
              this.value = value;
×
2585
            }
×
2586
          }
2587
        }
2588

2589
        public enum VerificationMethod implements ApiRequestParams.EnumParam {
×
2590
          @SerializedName("automatic")
×
2591
          AUTOMATIC("automatic"),
2592

2593
          @SerializedName("instant")
×
2594
          INSTANT("instant"),
2595

2596
          @SerializedName("microdeposits")
×
2597
          MICRODEPOSITS("microdeposits");
2598

2599
          @Getter(onMethod_ = {@Override})
2600
          private final String value;
2601

2602
          VerificationMethod(String value) {
×
2603
            this.value = value;
×
2604
          }
×
2605
        }
2606
      }
2607

2608
      @Getter
2609
      public static class Bancontact {
2610
        /**
2611
         * Map of extra parameters for custom features not available in this client library. The
2612
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2613
         * Instead, each key/value pair is serialized as if the key is a root-level field
2614
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2615
         * instance.
2616
         */
2617
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2618
        Map<String, Object> extraParams;
2619

2620
        /**
2621
         * Preferred language of the Bancontact authorization page that the customer is redirected
2622
         * to.
2623
         */
2624
        @SerializedName("preferred_language")
2625
        PreferredLanguage preferredLanguage;
2626

2627
        private Bancontact(Map<String, Object> extraParams, PreferredLanguage preferredLanguage) {
×
2628
          this.extraParams = extraParams;
×
2629
          this.preferredLanguage = preferredLanguage;
×
2630
        }
×
2631

2632
        public static Builder builder() {
2633
          return new Builder();
×
2634
        }
2635

2636
        public static class Builder {
×
2637
          private Map<String, Object> extraParams;
2638

2639
          private PreferredLanguage preferredLanguage;
2640

2641
          /** Finalize and obtain parameter instance from this builder. */
2642
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() {
2643
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact(
×
2644
                this.extraParams, this.preferredLanguage);
2645
          }
2646

2647
          /**
2648
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2649
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2650
           * map. See {@link
2651
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for
2652
           * the field documentation.
2653
           */
2654
          public Builder putExtraParam(String key, Object value) {
2655
            if (this.extraParams == null) {
×
2656
              this.extraParams = new HashMap<>();
×
2657
            }
2658
            this.extraParams.put(key, value);
×
2659
            return this;
×
2660
          }
2661

2662
          /**
2663
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2664
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2665
           * map. See {@link
2666
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for
2667
           * the field documentation.
2668
           */
2669
          public Builder putAllExtraParam(Map<String, Object> map) {
2670
            if (this.extraParams == null) {
×
2671
              this.extraParams = new HashMap<>();
×
2672
            }
2673
            this.extraParams.putAll(map);
×
2674
            return this;
×
2675
          }
2676

2677
          /**
2678
           * Preferred language of the Bancontact authorization page that the customer is redirected
2679
           * to.
2680
           */
2681
          public Builder setPreferredLanguage(
2682
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact.PreferredLanguage
2683
                  preferredLanguage) {
2684
            this.preferredLanguage = preferredLanguage;
×
2685
            return this;
×
2686
          }
2687
        }
2688

2689
        public enum PreferredLanguage implements ApiRequestParams.EnumParam {
×
2690
          @SerializedName("de")
×
2691
          DE("de"),
2692

2693
          @SerializedName("en")
×
2694
          EN("en"),
2695

2696
          @SerializedName("fr")
×
2697
          FR("fr"),
2698

2699
          @SerializedName("nl")
×
2700
          NL("nl");
2701

2702
          @Getter(onMethod_ = {@Override})
2703
          private final String value;
2704

2705
          PreferredLanguage(String value) {
×
2706
            this.value = value;
×
2707
          }
×
2708
        }
2709
      }
2710

2711
      @Getter
2712
      public static class Card {
2713
        /**
2714
         * Map of extra parameters for custom features not available in this client library. The
2715
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2716
         * Instead, each key/value pair is serialized as if the key is a root-level field
2717
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2718
         * instance.
2719
         */
2720
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2721
        Map<String, Object> extraParams;
2722

2723
        /**
2724
         * Installment configuration for payments attempted on this invoice (Mexico Only).
2725
         *
2726
         * <p>For more information, see the <a
2727
         * href="https://stripe.com/docs/payments/installments">installments integration guide</a>.
2728
         */
2729
        @SerializedName("installments")
2730
        Installments installments;
2731

2732
        /**
2733
         * We strongly recommend that you rely on our SCA Engine to automatically prompt your
2734
         * customers for authentication based on risk level and <a
2735
         * href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
2736
         * However, if you wish to request 3D Secure based on logic from your own fraud engine,
2737
         * provide this option. Read our guide on <a
2738
         * href="https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds">manually
2739
         * requesting 3D Secure</a> for more information on how this configuration interacts with
2740
         * Radar and our SCA Engine.
2741
         */
2742
        @SerializedName("request_three_d_secure")
2743
        RequestThreeDSecure requestThreeDSecure;
2744

2745
        private Card(
2746
            Map<String, Object> extraParams,
2747
            Installments installments,
2748
            RequestThreeDSecure requestThreeDSecure) {
×
2749
          this.extraParams = extraParams;
×
2750
          this.installments = installments;
×
2751
          this.requestThreeDSecure = requestThreeDSecure;
×
2752
        }
×
2753

2754
        public static Builder builder() {
2755
          return new Builder();
×
2756
        }
2757

2758
        public static class Builder {
×
2759
          private Map<String, Object> extraParams;
2760

2761
          private Installments installments;
2762

2763
          private RequestThreeDSecure requestThreeDSecure;
2764

2765
          /** Finalize and obtain parameter instance from this builder. */
2766
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card build() {
2767
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card(
×
2768
                this.extraParams, this.installments, this.requestThreeDSecure);
2769
          }
2770

2771
          /**
2772
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2773
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2774
           * map. See {@link
2775
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card#extraParams} for the
2776
           * field documentation.
2777
           */
2778
          public Builder putExtraParam(String key, Object value) {
2779
            if (this.extraParams == null) {
×
2780
              this.extraParams = new HashMap<>();
×
2781
            }
2782
            this.extraParams.put(key, value);
×
2783
            return this;
×
2784
          }
2785

2786
          /**
2787
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2788
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2789
           * map. See {@link
2790
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card#extraParams} for the
2791
           * field documentation.
2792
           */
2793
          public Builder putAllExtraParam(Map<String, Object> map) {
2794
            if (this.extraParams == null) {
×
2795
              this.extraParams = new HashMap<>();
×
2796
            }
2797
            this.extraParams.putAll(map);
×
2798
            return this;
×
2799
          }
2800

2801
          /**
2802
           * Installment configuration for payments attempted on this invoice (Mexico Only).
2803
           *
2804
           * <p>For more information, see the <a
2805
           * href="https://stripe.com/docs/payments/installments">installments integration
2806
           * guide</a>.
2807
           */
2808
          public Builder setInstallments(
2809
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments
2810
                  installments) {
2811
            this.installments = installments;
×
2812
            return this;
×
2813
          }
2814

2815
          /**
2816
           * We strongly recommend that you rely on our SCA Engine to automatically prompt your
2817
           * customers for authentication based on risk level and <a
2818
           * href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
2819
           * However, if you wish to request 3D Secure based on logic from your own fraud engine,
2820
           * provide this option. Read our guide on <a
2821
           * href="https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds">manually
2822
           * requesting 3D Secure</a> for more information on how this configuration interacts with
2823
           * Radar and our SCA Engine.
2824
           */
2825
          public Builder setRequestThreeDSecure(
2826
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.RequestThreeDSecure
2827
                  requestThreeDSecure) {
2828
            this.requestThreeDSecure = requestThreeDSecure;
×
2829
            return this;
×
2830
          }
2831
        }
2832

2833
        @Getter
2834
        public static class Installments {
2835
          /**
2836
           * Setting to true enables installments for this invoice. Setting to false will prevent
2837
           * any selected plan from applying to a payment.
2838
           */
2839
          @SerializedName("enabled")
2840
          Boolean enabled;
2841

2842
          /**
2843
           * Map of extra parameters for custom features not available in this client library. The
2844
           * content in this map is not serialized under this field's {@code @SerializedName} value.
2845
           * Instead, each key/value pair is serialized as if the key is a root-level field
2846
           * (serialized) name in this param object. Effectively, this map is flattened to its
2847
           * parent instance.
2848
           */
2849
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2850
          Map<String, Object> extraParams;
2851

2852
          /** The selected installment plan to use for this invoice. */
2853
          @SerializedName("plan")
2854
          Object plan;
2855

2856
          private Installments(Boolean enabled, Map<String, Object> extraParams, Object plan) {
×
2857
            this.enabled = enabled;
×
2858
            this.extraParams = extraParams;
×
2859
            this.plan = plan;
×
2860
          }
×
2861

2862
          public static Builder builder() {
2863
            return new Builder();
×
2864
          }
2865

2866
          public static class Builder {
×
2867
            private Boolean enabled;
2868

2869
            private Map<String, Object> extraParams;
2870

2871
            private Object plan;
2872

2873
            /** Finalize and obtain parameter instance from this builder. */
2874
            public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments
2875
                build() {
2876
              return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments(
×
2877
                  this.enabled, this.extraParams, this.plan);
2878
            }
2879

2880
            /**
2881
             * Setting to true enables installments for this invoice. Setting to false will prevent
2882
             * any selected plan from applying to a payment.
2883
             */
2884
            public Builder setEnabled(Boolean enabled) {
2885
              this.enabled = enabled;
×
2886
              return this;
×
2887
            }
2888

2889
            /**
2890
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
2891
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2892
             * original map. See {@link
2893
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments#extraParams}
2894
             * for the field documentation.
2895
             */
2896
            public Builder putExtraParam(String key, Object value) {
2897
              if (this.extraParams == null) {
×
2898
                this.extraParams = new HashMap<>();
×
2899
              }
2900
              this.extraParams.put(key, value);
×
2901
              return this;
×
2902
            }
2903

2904
            /**
2905
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2906
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2907
             * original map. See {@link
2908
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments#extraParams}
2909
             * for the field documentation.
2910
             */
2911
            public Builder putAllExtraParam(Map<String, Object> map) {
2912
              if (this.extraParams == null) {
×
2913
                this.extraParams = new HashMap<>();
×
2914
              }
2915
              this.extraParams.putAll(map);
×
2916
              return this;
×
2917
            }
2918

2919
            /** The selected installment plan to use for this invoice. */
2920
            public Builder setPlan(
2921
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
2922
                    plan) {
2923
              this.plan = plan;
×
2924
              return this;
×
2925
            }
2926

2927
            /** The selected installment plan to use for this invoice. */
2928
            public Builder setPlan(EmptyParam plan) {
2929
              this.plan = plan;
×
2930
              return this;
×
2931
            }
2932
          }
2933

2934
          @Getter
2935
          public static class Plan {
2936
            /**
2937
             * For {@code fixed_count} installment plans, this is required. It represents the number
2938
             * of installment payments your customer will make to their credit card.
2939
             */
2940
            @SerializedName("count")
2941
            Long count;
2942

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

2953
            /**
2954
             * For {@code fixed_count} installment plans, this is required. It represents the
2955
             * interval between installment payments your customer will make to their credit card.
2956
             * One of {@code month}.
2957
             */
2958
            @SerializedName("interval")
2959
            Interval interval;
2960

2961
            /** <strong>Required.</strong> Type of installment plan, one of {@code fixed_count}. */
2962
            @SerializedName("type")
2963
            Type type;
2964

2965
            private Plan(
2966
                Long count, Map<String, Object> extraParams, Interval interval, Type type) {
×
2967
              this.count = count;
×
2968
              this.extraParams = extraParams;
×
2969
              this.interval = interval;
×
2970
              this.type = type;
×
2971
            }
×
2972

2973
            public static Builder builder() {
2974
              return new Builder();
×
2975
            }
2976

2977
            public static class Builder {
×
2978
              private Long count;
2979

2980
              private Map<String, Object> extraParams;
2981

2982
              private Interval interval;
2983

2984
              private Type type;
2985

2986
              /** Finalize and obtain parameter instance from this builder. */
2987
              public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
2988
                  build() {
2989
                return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card
×
2990
                    .Installments.Plan(this.count, this.extraParams, this.interval, this.type);
2991
              }
2992

2993
              /**
2994
               * For {@code fixed_count} installment plans, this is required. It represents the
2995
               * number of installment payments your customer will make to their credit card.
2996
               */
2997
              public Builder setCount(Long count) {
2998
                this.count = count;
×
2999
                return this;
×
3000
              }
3001

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

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

3032
              /**
3033
               * For {@code fixed_count} installment plans, this is required. It represents the
3034
               * interval between installment payments your customer will make to their credit card.
3035
               * One of {@code month}.
3036
               */
3037
              public Builder setInterval(
3038
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3039
                          .Interval
3040
                      interval) {
3041
                this.interval = interval;
×
3042
                return this;
×
3043
              }
3044

3045
              /**
3046
               * <strong>Required.</strong> Type of installment plan, one of {@code fixed_count}.
3047
               */
3048
              public Builder setType(
3049
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3050
                          .Type
3051
                      type) {
3052
                this.type = type;
×
3053
                return this;
×
3054
              }
3055
            }
3056

3057
            public enum Interval implements ApiRequestParams.EnumParam {
×
3058
              @SerializedName("month")
×
3059
              MONTH("month");
3060

3061
              @Getter(onMethod_ = {@Override})
3062
              private final String value;
3063

3064
              Interval(String value) {
×
3065
                this.value = value;
×
3066
              }
×
3067
            }
3068

3069
            public enum Type implements ApiRequestParams.EnumParam {
×
3070
              @SerializedName("fixed_count")
×
3071
              FIXED_COUNT("fixed_count");
3072

3073
              @Getter(onMethod_ = {@Override})
3074
              private final String value;
3075

3076
              Type(String value) {
×
3077
                this.value = value;
×
3078
              }
×
3079
            }
3080
          }
3081
        }
3082

3083
        public enum RequestThreeDSecure implements ApiRequestParams.EnumParam {
×
3084
          @SerializedName("any")
×
3085
          ANY("any"),
3086

3087
          @SerializedName("automatic")
×
3088
          AUTOMATIC("automatic"),
3089

3090
          @SerializedName("challenge")
×
3091
          CHALLENGE("challenge");
3092

3093
          @Getter(onMethod_ = {@Override})
3094
          private final String value;
3095

3096
          RequestThreeDSecure(String value) {
×
3097
            this.value = value;
×
3098
          }
×
3099
        }
3100
      }
3101

3102
      @Getter
3103
      public static class CustomerBalance {
3104
        /**
3105
         * Configuration for the bank transfer funding type, if the {@code funding_type} is set to
3106
         * {@code bank_transfer}.
3107
         */
3108
        @SerializedName("bank_transfer")
3109
        BankTransfer bankTransfer;
3110

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

3121
        /**
3122
         * The funding method type to be used when there are not enough funds in the customer
3123
         * balance. Permitted values include: {@code bank_transfer}.
3124
         */
3125
        @SerializedName("funding_type")
3126
        String fundingType;
3127

3128
        private CustomerBalance(
3129
            BankTransfer bankTransfer, Map<String, Object> extraParams, String fundingType) {
×
3130
          this.bankTransfer = bankTransfer;
×
3131
          this.extraParams = extraParams;
×
3132
          this.fundingType = fundingType;
×
3133
        }
×
3134

3135
        public static Builder builder() {
3136
          return new Builder();
×
3137
        }
3138

3139
        public static class Builder {
×
3140
          private BankTransfer bankTransfer;
3141

3142
          private Map<String, Object> extraParams;
3143

3144
          private String fundingType;
3145

3146
          /** Finalize and obtain parameter instance from this builder. */
3147
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance build() {
3148
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance(
×
3149
                this.bankTransfer, this.extraParams, this.fundingType);
3150
          }
3151

3152
          /**
3153
           * Configuration for the bank transfer funding type, if the {@code funding_type} is set to
3154
           * {@code bank_transfer}.
3155
           */
3156
          public Builder setBankTransfer(
3157
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer
3158
                  bankTransfer) {
3159
            this.bankTransfer = bankTransfer;
×
3160
            return this;
×
3161
          }
3162

3163
          /**
3164
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3165
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3166
           * map. See {@link
3167
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance#extraParams}
3168
           * for the field documentation.
3169
           */
3170
          public Builder putExtraParam(String key, Object value) {
3171
            if (this.extraParams == null) {
×
3172
              this.extraParams = new HashMap<>();
×
3173
            }
3174
            this.extraParams.put(key, value);
×
3175
            return this;
×
3176
          }
3177

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

3193
          /**
3194
           * The funding method type to be used when there are not enough funds in the customer
3195
           * balance. Permitted values include: {@code bank_transfer}.
3196
           */
3197
          public Builder setFundingType(String fundingType) {
3198
            this.fundingType = fundingType;
×
3199
            return this;
×
3200
          }
3201
        }
3202

3203
        @Getter
3204
        public static class BankTransfer {
3205
          /** Configuration for eu_bank_transfer funding type. */
3206
          @SerializedName("eu_bank_transfer")
3207
          EuBankTransfer euBankTransfer;
3208

3209
          /**
3210
           * Map of extra parameters for custom features not available in this client library. The
3211
           * content in this map is not serialized under this field's {@code @SerializedName} value.
3212
           * Instead, each key/value pair is serialized as if the key is a root-level field
3213
           * (serialized) name in this param object. Effectively, this map is flattened to its
3214
           * parent instance.
3215
           */
3216
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3217
          Map<String, Object> extraParams;
3218

3219
          /**
3220
           * The bank transfer type that can be used for funding. Permitted values include: {@code
3221
           * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3222
           * mx_bank_transfer}, or {@code us_bank_transfer}.
3223
           */
3224
          @SerializedName("type")
3225
          String type;
3226

3227
          private BankTransfer(
3228
              EuBankTransfer euBankTransfer, Map<String, Object> extraParams, String type) {
×
3229
            this.euBankTransfer = euBankTransfer;
×
3230
            this.extraParams = extraParams;
×
3231
            this.type = type;
×
3232
          }
×
3233

3234
          public static Builder builder() {
3235
            return new Builder();
×
3236
          }
3237

3238
          public static class Builder {
×
3239
            private EuBankTransfer euBankTransfer;
3240

3241
            private Map<String, Object> extraParams;
3242

3243
            private String type;
3244

3245
            /** Finalize and obtain parameter instance from this builder. */
3246
            public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3247
                    .BankTransfer
3248
                build() {
3249
              return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
×
3250
                  .BankTransfer(this.euBankTransfer, this.extraParams, this.type);
3251
            }
3252

3253
            /** Configuration for eu_bank_transfer funding type. */
3254
            public Builder setEuBankTransfer(
3255
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3256
                        .BankTransfer.EuBankTransfer
3257
                    euBankTransfer) {
3258
              this.euBankTransfer = euBankTransfer;
×
3259
              return this;
×
3260
            }
3261

3262
            /**
3263
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
3264
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3265
             * original map. See {@link
3266
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer#extraParams}
3267
             * for the field documentation.
3268
             */
3269
            public Builder putExtraParam(String key, Object value) {
3270
              if (this.extraParams == null) {
×
3271
                this.extraParams = new HashMap<>();
×
3272
              }
3273
              this.extraParams.put(key, value);
×
3274
              return this;
×
3275
            }
3276

3277
            /**
3278
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3279
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3280
             * original map. See {@link
3281
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer#extraParams}
3282
             * for the field documentation.
3283
             */
3284
            public Builder putAllExtraParam(Map<String, Object> map) {
3285
              if (this.extraParams == null) {
×
3286
                this.extraParams = new HashMap<>();
×
3287
              }
3288
              this.extraParams.putAll(map);
×
3289
              return this;
×
3290
            }
3291

3292
            /**
3293
             * The bank transfer type that can be used for funding. Permitted values include: {@code
3294
             * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3295
             * mx_bank_transfer}, or {@code us_bank_transfer}.
3296
             */
3297
            public Builder setType(String type) {
3298
              this.type = type;
×
3299
              return this;
×
3300
            }
3301
          }
3302

3303
          @Getter
3304
          public static class EuBankTransfer {
3305
            /**
3306
             * <strong>Required.</strong> The desired country code of the bank account information.
3307
             * Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE},
3308
             * or {@code NL}.
3309
             */
3310
            @SerializedName("country")
3311
            String country;
3312

3313
            /**
3314
             * Map of extra parameters for custom features not available in this client library. The
3315
             * content in this map is not serialized under this field's {@code @SerializedName}
3316
             * value. Instead, each key/value pair is serialized as if the key is a root-level field
3317
             * (serialized) name in this param object. Effectively, this map is flattened to its
3318
             * parent instance.
3319
             */
3320
            @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3321
            Map<String, Object> extraParams;
3322

3323
            private EuBankTransfer(String country, Map<String, Object> extraParams) {
×
3324
              this.country = country;
×
3325
              this.extraParams = extraParams;
×
3326
            }
×
3327

3328
            public static Builder builder() {
3329
              return new Builder();
×
3330
            }
3331

3332
            public static class Builder {
×
3333
              private String country;
3334

3335
              private Map<String, Object> extraParams;
3336

3337
              /** Finalize and obtain parameter instance from this builder. */
3338
              public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3339
                      .BankTransfer.EuBankTransfer
3340
                  build() {
3341
                return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
×
3342
                    .BankTransfer.EuBankTransfer(this.country, this.extraParams);
3343
              }
3344

3345
              /**
3346
               * <strong>Required.</strong> The desired country code of the bank account
3347
               * information. Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code
3348
               * FR}, {@code IE}, or {@code NL}.
3349
               */
3350
              public Builder setCountry(String country) {
3351
                this.country = country;
×
3352
                return this;
×
3353
              }
3354

3355
              /**
3356
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3357
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3358
               * original map. See {@link
3359
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams}
3360
               * for the field documentation.
3361
               */
3362
              public Builder putExtraParam(String key, Object value) {
3363
                if (this.extraParams == null) {
×
3364
                  this.extraParams = new HashMap<>();
×
3365
                }
3366
                this.extraParams.put(key, value);
×
3367
                return this;
×
3368
              }
3369

3370
              /**
3371
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
3372
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
3373
               * original map. See {@link
3374
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams}
3375
               * for the field documentation.
3376
               */
3377
              public Builder putAllExtraParam(Map<String, Object> map) {
3378
                if (this.extraParams == null) {
×
3379
                  this.extraParams = new HashMap<>();
×
3380
                }
3381
                this.extraParams.putAll(map);
×
3382
                return this;
×
3383
              }
3384
            }
3385
          }
3386
        }
3387
      }
3388

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

3401
        private Konbini(Map<String, Object> extraParams) {
×
3402
          this.extraParams = extraParams;
×
3403
        }
×
3404

3405
        public static Builder builder() {
3406
          return new Builder();
×
3407
        }
3408

3409
        public static class Builder {
×
3410
          private Map<String, Object> extraParams;
3411

3412
          /** Finalize and obtain parameter instance from this builder. */
3413
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini build() {
3414
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini(
×
3415
                this.extraParams);
3416
          }
3417

3418
          /**
3419
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3420
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3421
           * map. See {@link
3422
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini#extraParams} for the
3423
           * field documentation.
3424
           */
3425
          public Builder putExtraParam(String key, Object value) {
3426
            if (this.extraParams == null) {
×
3427
              this.extraParams = new HashMap<>();
×
3428
            }
3429
            this.extraParams.put(key, value);
×
3430
            return this;
×
3431
          }
3432

3433
          /**
3434
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3435
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3436
           * map. See {@link
3437
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini#extraParams} for the
3438
           * field documentation.
3439
           */
3440
          public Builder putAllExtraParam(Map<String, Object> map) {
3441
            if (this.extraParams == null) {
×
3442
              this.extraParams = new HashMap<>();
×
3443
            }
3444
            this.extraParams.putAll(map);
×
3445
            return this;
×
3446
          }
3447
        }
3448
      }
3449

3450
      @Getter
3451
      public static class SepaDebit {
3452
        /**
3453
         * Map of extra parameters for custom features not available in this client library. The
3454
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3455
         * Instead, each key/value pair is serialized as if the key is a root-level field
3456
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3457
         * instance.
3458
         */
3459
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3460
        Map<String, Object> extraParams;
3461

3462
        private SepaDebit(Map<String, Object> extraParams) {
×
3463
          this.extraParams = extraParams;
×
3464
        }
×
3465

3466
        public static Builder builder() {
3467
          return new Builder();
×
3468
        }
3469

3470
        public static class Builder {
×
3471
          private Map<String, Object> extraParams;
3472

3473
          /** Finalize and obtain parameter instance from this builder. */
3474
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit build() {
3475
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit(
×
3476
                this.extraParams);
3477
          }
3478

3479
          /**
3480
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3481
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3482
           * map. See {@link
3483
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit#extraParams} for the
3484
           * field documentation.
3485
           */
3486
          public Builder putExtraParam(String key, Object value) {
3487
            if (this.extraParams == null) {
×
3488
              this.extraParams = new HashMap<>();
×
3489
            }
3490
            this.extraParams.put(key, value);
×
3491
            return this;
×
3492
          }
3493

3494
          /**
3495
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3496
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3497
           * map. See {@link
3498
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit#extraParams} for the
3499
           * field documentation.
3500
           */
3501
          public Builder putAllExtraParam(Map<String, Object> map) {
3502
            if (this.extraParams == null) {
×
3503
              this.extraParams = new HashMap<>();
×
3504
            }
3505
            this.extraParams.putAll(map);
×
3506
            return this;
×
3507
          }
3508
        }
3509
      }
3510

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

3523
        /** Additional fields for Financial Connections Session creation. */
3524
        @SerializedName("financial_connections")
3525
        FinancialConnections financialConnections;
3526

3527
        /** Verification method for the intent. */
3528
        @SerializedName("verification_method")
3529
        VerificationMethod verificationMethod;
3530

3531
        private UsBankAccount(
3532
            Map<String, Object> extraParams,
3533
            FinancialConnections financialConnections,
3534
            VerificationMethod verificationMethod) {
×
3535
          this.extraParams = extraParams;
×
3536
          this.financialConnections = financialConnections;
×
3537
          this.verificationMethod = verificationMethod;
×
3538
        }
×
3539

3540
        public static Builder builder() {
3541
          return new Builder();
×
3542
        }
3543

3544
        public static class Builder {
×
3545
          private Map<String, Object> extraParams;
3546

3547
          private FinancialConnections financialConnections;
3548

3549
          private VerificationMethod verificationMethod;
3550

3551
          /** Finalize and obtain parameter instance from this builder. */
3552
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount build() {
3553
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount(
×
3554
                this.extraParams, this.financialConnections, this.verificationMethod);
3555
          }
3556

3557
          /**
3558
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3559
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3560
           * map. See {@link
3561
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount#extraParams} for
3562
           * the field documentation.
3563
           */
3564
          public Builder putExtraParam(String key, Object value) {
3565
            if (this.extraParams == null) {
×
3566
              this.extraParams = new HashMap<>();
×
3567
            }
3568
            this.extraParams.put(key, value);
×
3569
            return this;
×
3570
          }
3571

3572
          /**
3573
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3574
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3575
           * map. See {@link
3576
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount#extraParams} for
3577
           * the field documentation.
3578
           */
3579
          public Builder putAllExtraParam(Map<String, Object> map) {
3580
            if (this.extraParams == null) {
×
3581
              this.extraParams = new HashMap<>();
×
3582
            }
3583
            this.extraParams.putAll(map);
×
3584
            return this;
×
3585
          }
3586

3587
          /** Additional fields for Financial Connections Session creation. */
3588
          public Builder setFinancialConnections(
3589
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3590
                      .FinancialConnections
3591
                  financialConnections) {
3592
            this.financialConnections = financialConnections;
×
3593
            return this;
×
3594
          }
3595

3596
          /** Verification method for the intent. */
3597
          public Builder setVerificationMethod(
3598
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3599
                      .VerificationMethod
3600
                  verificationMethod) {
3601
            this.verificationMethod = verificationMethod;
×
3602
            return this;
×
3603
          }
3604
        }
3605

3606
        @Getter
3607
        public static class FinancialConnections {
3608
          /**
3609
           * Map of extra parameters for custom features not available in this client library. The
3610
           * content in this map is not serialized under this field's {@code @SerializedName} value.
3611
           * Instead, each key/value pair is serialized as if the key is a root-level field
3612
           * (serialized) name in this param object. Effectively, this map is flattened to its
3613
           * parent instance.
3614
           */
3615
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3616
          Map<String, Object> extraParams;
3617

3618
          /**
3619
           * Provide filters for the linked accounts that the customer can select for the payment
3620
           * method.
3621
           */
3622
          @SerializedName("filters")
3623
          Filters filters;
3624

3625
          /**
3626
           * The list of permissions to request. If this parameter is passed, the {@code
3627
           * payment_method} permission must be included. Valid permissions include: {@code
3628
           * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}.
3629
           */
3630
          @SerializedName("permissions")
3631
          List<
3632
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3633
                      .FinancialConnections.Permission>
3634
              permissions;
3635

3636
          /** List of data features that you would like to retrieve upon account creation. */
3637
          @SerializedName("prefetch")
3638
          List<
3639
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3640
                      .FinancialConnections.Prefetch>
3641
              prefetch;
3642

3643
          private FinancialConnections(
3644
              Map<String, Object> extraParams,
3645
              Filters filters,
3646
              List<
3647
                      InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3648
                          .FinancialConnections.Permission>
3649
                  permissions,
3650
              List<
3651
                      InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3652
                          .FinancialConnections.Prefetch>
3653
                  prefetch) {
×
3654
            this.extraParams = extraParams;
×
3655
            this.filters = filters;
×
3656
            this.permissions = permissions;
×
3657
            this.prefetch = prefetch;
×
3658
          }
×
3659

3660
          public static Builder builder() {
3661
            return new Builder();
×
3662
          }
3663

3664
          public static class Builder {
×
3665
            private Map<String, Object> extraParams;
3666

3667
            private Filters filters;
3668

3669
            private List<
3670
                    InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3671
                        .FinancialConnections.Permission>
3672
                permissions;
3673

3674
            private List<
3675
                    InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3676
                        .FinancialConnections.Prefetch>
3677
                prefetch;
3678

3679
            /** Finalize and obtain parameter instance from this builder. */
3680
            public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3681
                    .FinancialConnections
3682
                build() {
3683
              return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
×
3684
                  .FinancialConnections(
3685
                  this.extraParams, this.filters, this.permissions, this.prefetch);
3686
            }
3687

3688
            /**
3689
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
3690
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3691
             * original map. See {@link
3692
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams}
3693
             * for the field documentation.
3694
             */
3695
            public Builder putExtraParam(String key, Object value) {
3696
              if (this.extraParams == null) {
×
3697
                this.extraParams = new HashMap<>();
×
3698
              }
3699
              this.extraParams.put(key, value);
×
3700
              return this;
×
3701
            }
3702

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

3718
            /**
3719
             * Provide filters for the linked accounts that the customer can select for the payment
3720
             * method.
3721
             */
3722
            public Builder setFilters(
3723
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3724
                        .FinancialConnections.Filters
3725
                    filters) {
3726
              this.filters = filters;
×
3727
              return this;
×
3728
            }
3729

3730
            /**
3731
             * Add an element to `permissions` list. A list is initialized for the first
3732
             * `add/addAll` call, and subsequent calls adds additional elements to the original
3733
             * list. See {@link
3734
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions}
3735
             * for the field documentation.
3736
             */
3737
            public Builder addPermission(
3738
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3739
                        .FinancialConnections.Permission
3740
                    element) {
3741
              if (this.permissions == null) {
×
3742
                this.permissions = new ArrayList<>();
×
3743
              }
3744
              this.permissions.add(element);
×
3745
              return this;
×
3746
            }
3747

3748
            /**
3749
             * Add all elements to `permissions` list. A list is initialized for the first
3750
             * `add/addAll` call, and subsequent calls adds additional elements to the original
3751
             * list. See {@link
3752
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions}
3753
             * for the field documentation.
3754
             */
3755
            public Builder addAllPermission(
3756
                List<
3757
                        InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3758
                            .FinancialConnections.Permission>
3759
                    elements) {
3760
              if (this.permissions == null) {
×
3761
                this.permissions = new ArrayList<>();
×
3762
              }
3763
              this.permissions.addAll(elements);
×
3764
              return this;
×
3765
            }
3766

3767
            /**
3768
             * Add an element to `prefetch` list. A list is initialized for the first `add/addAll`
3769
             * call, and subsequent calls adds additional elements to the original list. See {@link
3770
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch}
3771
             * for the field documentation.
3772
             */
3773
            public Builder addPrefetch(
3774
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3775
                        .FinancialConnections.Prefetch
3776
                    element) {
3777
              if (this.prefetch == null) {
×
3778
                this.prefetch = new ArrayList<>();
×
3779
              }
3780
              this.prefetch.add(element);
×
3781
              return this;
×
3782
            }
3783

3784
            /**
3785
             * Add all elements to `prefetch` list. A list is initialized for the first `add/addAll`
3786
             * call, and subsequent calls adds additional elements to the original list. See {@link
3787
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch}
3788
             * for the field documentation.
3789
             */
3790
            public Builder addAllPrefetch(
3791
                List<
3792
                        InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3793
                            .FinancialConnections.Prefetch>
3794
                    elements) {
3795
              if (this.prefetch == null) {
×
3796
                this.prefetch = new ArrayList<>();
×
3797
              }
3798
              this.prefetch.addAll(elements);
×
3799
              return this;
×
3800
            }
3801
          }
3802

3803
          @Getter
3804
          public static class Filters {
3805
            /**
3806
             * The account subcategories to use to filter for selectable accounts. Valid
3807
             * subcategories are {@code checking} and {@code savings}.
3808
             */
3809
            @SerializedName("account_subcategories")
3810
            List<
3811
                    InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3812
                        .FinancialConnections.Filters.AccountSubcategory>
3813
                accountSubcategories;
3814

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

3825
            /** ID of the institution to use to filter for selectable accounts. */
3826
            @SerializedName("institution")
3827
            String institution;
3828

3829
            private Filters(
3830
                List<
3831
                        InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3832
                            .FinancialConnections.Filters.AccountSubcategory>
3833
                    accountSubcategories,
3834
                Map<String, Object> extraParams,
3835
                String institution) {
×
3836
              this.accountSubcategories = accountSubcategories;
×
3837
              this.extraParams = extraParams;
×
3838
              this.institution = institution;
×
3839
            }
×
3840

3841
            public static Builder builder() {
3842
              return new Builder();
×
3843
            }
3844

3845
            public static class Builder {
×
3846
              private List<
3847
                      InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3848
                          .FinancialConnections.Filters.AccountSubcategory>
3849
                  accountSubcategories;
3850

3851
              private Map<String, Object> extraParams;
3852

3853
              private String institution;
3854

3855
              /** Finalize and obtain parameter instance from this builder. */
3856
              public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3857
                      .FinancialConnections.Filters
3858
                  build() {
3859
                return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
×
3860
                    .FinancialConnections.Filters(
3861
                    this.accountSubcategories, this.extraParams, this.institution);
3862
              }
3863

3864
              /**
3865
               * Add an element to `accountSubcategories` list. A list is initialized for the first
3866
               * `add/addAll` call, and subsequent calls adds additional elements to the original
3867
               * list. See {@link
3868
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories}
3869
               * for the field documentation.
3870
               */
3871
              public Builder addAccountSubcategory(
3872
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3873
                          .FinancialConnections.Filters.AccountSubcategory
3874
                      element) {
3875
                if (this.accountSubcategories == null) {
×
3876
                  this.accountSubcategories = new ArrayList<>();
×
3877
                }
3878
                this.accountSubcategories.add(element);
×
3879
                return this;
×
3880
              }
3881

3882
              /**
3883
               * Add all elements to `accountSubcategories` list. A list is initialized for the
3884
               * first `add/addAll` call, and subsequent calls adds additional elements to the
3885
               * original list. See {@link
3886
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories}
3887
               * for the field documentation.
3888
               */
3889
              public Builder addAllAccountSubcategory(
3890
                  List<
3891
                          InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3892
                              .FinancialConnections.Filters.AccountSubcategory>
3893
                      elements) {
3894
                if (this.accountSubcategories == null) {
×
3895
                  this.accountSubcategories = new ArrayList<>();
×
3896
                }
3897
                this.accountSubcategories.addAll(elements);
×
3898
                return this;
×
3899
              }
3900

3901
              /**
3902
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3903
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3904
               * original map. See {@link
3905
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams}
3906
               * for the field documentation.
3907
               */
3908
              public Builder putExtraParam(String key, Object value) {
3909
                if (this.extraParams == null) {
×
3910
                  this.extraParams = new HashMap<>();
×
3911
                }
3912
                this.extraParams.put(key, value);
×
3913
                return this;
×
3914
              }
3915

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

3931
              /** ID of the institution to use to filter for selectable accounts. */
3932
              public Builder setInstitution(String institution) {
3933
                this.institution = institution;
×
3934
                return this;
×
3935
              }
3936
            }
3937

3938
            public enum AccountSubcategory implements ApiRequestParams.EnumParam {
×
3939
              @SerializedName("checking")
×
3940
              CHECKING("checking"),
3941

3942
              @SerializedName("savings")
×
3943
              SAVINGS("savings");
3944

3945
              @Getter(onMethod_ = {@Override})
3946
              private final String value;
3947

3948
              AccountSubcategory(String value) {
×
3949
                this.value = value;
×
3950
              }
×
3951
            }
3952
          }
3953

3954
          public enum Permission implements ApiRequestParams.EnumParam {
×
3955
            @SerializedName("balances")
×
3956
            BALANCES("balances"),
3957

3958
            @SerializedName("ownership")
×
3959
            OWNERSHIP("ownership"),
3960

3961
            @SerializedName("payment_method")
×
3962
            PAYMENT_METHOD("payment_method"),
3963

3964
            @SerializedName("transactions")
×
3965
            TRANSACTIONS("transactions");
3966

3967
            @Getter(onMethod_ = {@Override})
3968
            private final String value;
3969

3970
            Permission(String value) {
×
3971
              this.value = value;
×
3972
            }
×
3973
          }
3974

3975
          public enum Prefetch implements ApiRequestParams.EnumParam {
×
3976
            @SerializedName("balances")
×
3977
            BALANCES("balances"),
3978

3979
            @SerializedName("inferred_balances")
×
3980
            INFERRED_BALANCES("inferred_balances"),
3981

3982
            @SerializedName("ownership")
×
3983
            OWNERSHIP("ownership"),
3984

3985
            @SerializedName("transactions")
×
3986
            TRANSACTIONS("transactions");
3987

3988
            @Getter(onMethod_ = {@Override})
3989
            private final String value;
3990

3991
            Prefetch(String value) {
×
3992
              this.value = value;
×
3993
            }
×
3994
          }
3995
        }
3996

3997
        public enum VerificationMethod implements ApiRequestParams.EnumParam {
×
3998
          @SerializedName("automatic")
×
3999
          AUTOMATIC("automatic"),
4000

4001
          @SerializedName("instant")
×
4002
          INSTANT("instant"),
4003

4004
          @SerializedName("microdeposits")
×
4005
          MICRODEPOSITS("microdeposits");
4006

4007
          @Getter(onMethod_ = {@Override})
4008
          private final String value;
4009

4010
          VerificationMethod(String value) {
×
4011
            this.value = value;
×
4012
          }
×
4013
        }
4014
      }
4015
    }
4016

4017
    public enum PaymentMethodType implements ApiRequestParams.EnumParam {
×
4018
      @SerializedName("ach_credit_transfer")
×
4019
      ACH_CREDIT_TRANSFER("ach_credit_transfer"),
4020

4021
      @SerializedName("ach_debit")
×
4022
      ACH_DEBIT("ach_debit"),
4023

4024
      @SerializedName("acss_debit")
×
4025
      ACSS_DEBIT("acss_debit"),
4026

4027
      @SerializedName("amazon_pay")
×
4028
      AMAZON_PAY("amazon_pay"),
4029

4030
      @SerializedName("au_becs_debit")
×
4031
      AU_BECS_DEBIT("au_becs_debit"),
4032

4033
      @SerializedName("bacs_debit")
×
4034
      BACS_DEBIT("bacs_debit"),
4035

4036
      @SerializedName("bancontact")
×
4037
      BANCONTACT("bancontact"),
4038

4039
      @SerializedName("boleto")
×
4040
      BOLETO("boleto"),
4041

4042
      @SerializedName("card")
×
4043
      CARD("card"),
4044

4045
      @SerializedName("cashapp")
×
4046
      CASHAPP("cashapp"),
4047

4048
      @SerializedName("customer_balance")
×
4049
      CUSTOMER_BALANCE("customer_balance"),
4050

4051
      @SerializedName("eps")
×
4052
      EPS("eps"),
4053

4054
      @SerializedName("fpx")
×
4055
      FPX("fpx"),
4056

4057
      @SerializedName("giropay")
×
4058
      GIROPAY("giropay"),
4059

4060
      @SerializedName("grabpay")
×
4061
      GRABPAY("grabpay"),
4062

4063
      @SerializedName("ideal")
×
4064
      IDEAL("ideal"),
4065

NEW
4066
      @SerializedName("jp_credit_transfer")
×
4067
      JP_CREDIT_TRANSFER("jp_credit_transfer"),
4068

NEW
4069
      @SerializedName("kakao_pay")
×
4070
      KAKAO_PAY("kakao_pay"),
4071

UNCOV
4072
      @SerializedName("konbini")
×
4073
      KONBINI("konbini"),
4074

NEW
4075
      @SerializedName("kr_card")
×
4076
      KR_CARD("kr_card"),
4077

UNCOV
4078
      @SerializedName("link")
×
4079
      LINK("link"),
4080

4081
      @SerializedName("multibanco")
×
4082
      MULTIBANCO("multibanco"),
4083

NEW
4084
      @SerializedName("naver_pay")
×
4085
      NAVER_PAY("naver_pay"),
4086

UNCOV
4087
      @SerializedName("p24")
×
4088
      P24("p24"),
4089

NEW
4090
      @SerializedName("payco")
×
4091
      PAYCO("payco"),
4092

UNCOV
4093
      @SerializedName("paynow")
×
4094
      PAYNOW("paynow"),
4095

4096
      @SerializedName("paypal")
×
4097
      PAYPAL("paypal"),
4098

4099
      @SerializedName("promptpay")
×
4100
      PROMPTPAY("promptpay"),
4101

4102
      @SerializedName("revolut_pay")
×
4103
      REVOLUT_PAY("revolut_pay"),
4104

4105
      @SerializedName("sepa_credit_transfer")
×
4106
      SEPA_CREDIT_TRANSFER("sepa_credit_transfer"),
4107

4108
      @SerializedName("sepa_debit")
×
4109
      SEPA_DEBIT("sepa_debit"),
4110

4111
      @SerializedName("sofort")
×
4112
      SOFORT("sofort"),
4113

4114
      @SerializedName("swish")
×
4115
      SWISH("swish"),
4116

4117
      @SerializedName("us_bank_account")
×
4118
      US_BANK_ACCOUNT("us_bank_account"),
4119

4120
      @SerializedName("wechat_pay")
×
4121
      WECHAT_PAY("wechat_pay");
4122

4123
      @Getter(onMethod_ = {@Override})
4124
      private final String value;
4125

4126
      PaymentMethodType(String value) {
×
4127
        this.value = value;
×
4128
      }
×
4129
    }
4130
  }
4131

4132
  @Getter
4133
  public static class Rendering {
4134
    /**
4135
     * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4136
     * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4137
     * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code exclude_tax}
4138
     * will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4139
     */
4140
    @SerializedName("amount_tax_display")
4141
    ApiRequestParams.EnumParam amountTaxDisplay;
4142

4143
    /**
4144
     * Map of extra parameters for custom features not available in this client library. The content
4145
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4146
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4147
     * param object. Effectively, this map is flattened to its parent instance.
4148
     */
4149
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4150
    Map<String, Object> extraParams;
4151

4152
    /** Invoice pdf rendering options. */
4153
    @SerializedName("pdf")
4154
    Pdf pdf;
4155

4156
    /** ID of the invoice rendering template to use for this invoice. */
4157
    @SerializedName("template")
4158
    String template;
4159

4160
    /** The specific version of invoice rendering template to use for this invoice. */
4161
    @SerializedName("template_version")
4162
    Object templateVersion;
4163

4164
    private Rendering(
4165
        ApiRequestParams.EnumParam amountTaxDisplay,
4166
        Map<String, Object> extraParams,
4167
        Pdf pdf,
4168
        String template,
4169
        Object templateVersion) {
×
4170
      this.amountTaxDisplay = amountTaxDisplay;
×
4171
      this.extraParams = extraParams;
×
4172
      this.pdf = pdf;
×
4173
      this.template = template;
×
4174
      this.templateVersion = templateVersion;
×
4175
    }
×
4176

4177
    public static Builder builder() {
4178
      return new Builder();
×
4179
    }
4180

4181
    public static class Builder {
×
4182
      private ApiRequestParams.EnumParam amountTaxDisplay;
4183

4184
      private Map<String, Object> extraParams;
4185

4186
      private Pdf pdf;
4187

4188
      private String template;
4189

4190
      private Object templateVersion;
4191

4192
      /** Finalize and obtain parameter instance from this builder. */
4193
      public InvoiceCreateParams.Rendering build() {
4194
        return new InvoiceCreateParams.Rendering(
×
4195
            this.amountTaxDisplay, this.extraParams, this.pdf, this.template, this.templateVersion);
4196
      }
4197

4198
      /**
4199
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4200
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4201
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4202
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4203
       */
4204
      public Builder setAmountTaxDisplay(
4205
          InvoiceCreateParams.Rendering.AmountTaxDisplay amountTaxDisplay) {
4206
        this.amountTaxDisplay = amountTaxDisplay;
×
4207
        return this;
×
4208
      }
4209

4210
      /**
4211
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4212
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4213
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4214
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4215
       */
4216
      public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
4217
        this.amountTaxDisplay = amountTaxDisplay;
×
4218
        return this;
×
4219
      }
4220

4221
      /**
4222
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4223
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4224
       * InvoiceCreateParams.Rendering#extraParams} for the field documentation.
4225
       */
4226
      public Builder putExtraParam(String key, Object value) {
4227
        if (this.extraParams == null) {
×
4228
          this.extraParams = new HashMap<>();
×
4229
        }
4230
        this.extraParams.put(key, value);
×
4231
        return this;
×
4232
      }
4233

4234
      /**
4235
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4236
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4237
       * See {@link InvoiceCreateParams.Rendering#extraParams} for the field documentation.
4238
       */
4239
      public Builder putAllExtraParam(Map<String, Object> map) {
4240
        if (this.extraParams == null) {
×
4241
          this.extraParams = new HashMap<>();
×
4242
        }
4243
        this.extraParams.putAll(map);
×
4244
        return this;
×
4245
      }
4246

4247
      /** Invoice pdf rendering options. */
4248
      public Builder setPdf(InvoiceCreateParams.Rendering.Pdf pdf) {
4249
        this.pdf = pdf;
×
4250
        return this;
×
4251
      }
4252

4253
      /** ID of the invoice rendering template to use for this invoice. */
4254
      public Builder setTemplate(String template) {
4255
        this.template = template;
×
4256
        return this;
×
4257
      }
4258

4259
      /** The specific version of invoice rendering template to use for this invoice. */
4260
      public Builder setTemplateVersion(Long templateVersion) {
4261
        this.templateVersion = templateVersion;
×
4262
        return this;
×
4263
      }
4264

4265
      /** The specific version of invoice rendering template to use for this invoice. */
4266
      public Builder setTemplateVersion(EmptyParam templateVersion) {
4267
        this.templateVersion = templateVersion;
×
4268
        return this;
×
4269
      }
4270
    }
4271

4272
    @Getter
4273
    public static class Pdf {
4274
      /**
4275
       * Map of extra parameters for custom features not available in this client library. The
4276
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4277
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4278
       * name in this param object. Effectively, this map is flattened to its parent instance.
4279
       */
4280
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4281
      Map<String, Object> extraParams;
4282

4283
      /**
4284
       * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4285
       * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4286
       * Japanese locale and {@code letter} for customers with other locales.
4287
       */
4288
      @SerializedName("page_size")
4289
      PageSize pageSize;
4290

4291
      private Pdf(Map<String, Object> extraParams, PageSize pageSize) {
×
4292
        this.extraParams = extraParams;
×
4293
        this.pageSize = pageSize;
×
4294
      }
×
4295

4296
      public static Builder builder() {
4297
        return new Builder();
×
4298
      }
4299

4300
      public static class Builder {
×
4301
        private Map<String, Object> extraParams;
4302

4303
        private PageSize pageSize;
4304

4305
        /** Finalize and obtain parameter instance from this builder. */
4306
        public InvoiceCreateParams.Rendering.Pdf build() {
4307
          return new InvoiceCreateParams.Rendering.Pdf(this.extraParams, this.pageSize);
×
4308
        }
4309

4310
        /**
4311
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
4312
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4313
         * map. See {@link InvoiceCreateParams.Rendering.Pdf#extraParams} for the field
4314
         * documentation.
4315
         */
4316
        public Builder putExtraParam(String key, Object value) {
4317
          if (this.extraParams == null) {
×
4318
            this.extraParams = new HashMap<>();
×
4319
          }
4320
          this.extraParams.put(key, value);
×
4321
          return this;
×
4322
        }
4323

4324
        /**
4325
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4326
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4327
         * map. See {@link InvoiceCreateParams.Rendering.Pdf#extraParams} for the field
4328
         * documentation.
4329
         */
4330
        public Builder putAllExtraParam(Map<String, Object> map) {
4331
          if (this.extraParams == null) {
×
4332
            this.extraParams = new HashMap<>();
×
4333
          }
4334
          this.extraParams.putAll(map);
×
4335
          return this;
×
4336
        }
4337

4338
        /**
4339
         * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4340
         * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4341
         * Japanese locale and {@code letter} for customers with other locales.
4342
         */
4343
        public Builder setPageSize(InvoiceCreateParams.Rendering.Pdf.PageSize pageSize) {
4344
          this.pageSize = pageSize;
×
4345
          return this;
×
4346
        }
4347
      }
4348

4349
      public enum PageSize implements ApiRequestParams.EnumParam {
×
4350
        @SerializedName("a4")
×
4351
        A4("a4"),
4352

4353
        @SerializedName("auto")
×
4354
        AUTO("auto"),
4355

4356
        @SerializedName("letter")
×
4357
        LETTER("letter");
4358

4359
        @Getter(onMethod_ = {@Override})
4360
        private final String value;
4361

4362
        PageSize(String value) {
×
4363
          this.value = value;
×
4364
        }
×
4365
      }
4366
    }
4367

4368
    public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
4369
      @SerializedName("exclude_tax")
×
4370
      EXCLUDE_TAX("exclude_tax"),
4371

4372
      @SerializedName("include_inclusive_tax")
×
4373
      INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
4374

4375
      @Getter(onMethod_ = {@Override})
4376
      private final String value;
4377

4378
      AmountTaxDisplay(String value) {
×
4379
        this.value = value;
×
4380
      }
×
4381
    }
4382
  }
4383

4384
  @Getter
4385
  public static class ShippingCost {
4386
    /**
4387
     * Map of extra parameters for custom features not available in this client library. The content
4388
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4389
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4390
     * param object. Effectively, this map is flattened to its parent instance.
4391
     */
4392
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4393
    Map<String, Object> extraParams;
4394

4395
    /** The ID of the shipping rate to use for this order. */
4396
    @SerializedName("shipping_rate")
4397
    String shippingRate;
4398

4399
    /** Parameters to create a new ad-hoc shipping rate for this order. */
4400
    @SerializedName("shipping_rate_data")
4401
    ShippingRateData shippingRateData;
4402

4403
    private ShippingCost(
4404
        Map<String, Object> extraParams, String shippingRate, ShippingRateData shippingRateData) {
×
4405
      this.extraParams = extraParams;
×
4406
      this.shippingRate = shippingRate;
×
4407
      this.shippingRateData = shippingRateData;
×
4408
    }
×
4409

4410
    public static Builder builder() {
4411
      return new Builder();
×
4412
    }
4413

4414
    public static class Builder {
×
4415
      private Map<String, Object> extraParams;
4416

4417
      private String shippingRate;
4418

4419
      private ShippingRateData shippingRateData;
4420

4421
      /** Finalize and obtain parameter instance from this builder. */
4422
      public InvoiceCreateParams.ShippingCost build() {
4423
        return new InvoiceCreateParams.ShippingCost(
×
4424
            this.extraParams, this.shippingRate, this.shippingRateData);
4425
      }
4426

4427
      /**
4428
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4429
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4430
       * InvoiceCreateParams.ShippingCost#extraParams} for the field documentation.
4431
       */
4432
      public Builder putExtraParam(String key, Object value) {
4433
        if (this.extraParams == null) {
×
4434
          this.extraParams = new HashMap<>();
×
4435
        }
4436
        this.extraParams.put(key, value);
×
4437
        return this;
×
4438
      }
4439

4440
      /**
4441
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4442
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4443
       * See {@link InvoiceCreateParams.ShippingCost#extraParams} for the field documentation.
4444
       */
4445
      public Builder putAllExtraParam(Map<String, Object> map) {
4446
        if (this.extraParams == null) {
×
4447
          this.extraParams = new HashMap<>();
×
4448
        }
4449
        this.extraParams.putAll(map);
×
4450
        return this;
×
4451
      }
4452

4453
      /** The ID of the shipping rate to use for this order. */
4454
      public Builder setShippingRate(String shippingRate) {
4455
        this.shippingRate = shippingRate;
×
4456
        return this;
×
4457
      }
4458

4459
      /** Parameters to create a new ad-hoc shipping rate for this order. */
4460
      public Builder setShippingRateData(
4461
          InvoiceCreateParams.ShippingCost.ShippingRateData shippingRateData) {
4462
        this.shippingRateData = shippingRateData;
×
4463
        return this;
×
4464
      }
4465
    }
4466

4467
    @Getter
4468
    public static class ShippingRateData {
4469
      /**
4470
       * The estimated range for how long shipping will take, meant to be displayable to the
4471
       * customer. This will appear on CheckoutSessions.
4472
       */
4473
      @SerializedName("delivery_estimate")
4474
      DeliveryEstimate deliveryEstimate;
4475

4476
      /**
4477
       * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4478
       * customer. This will appear on CheckoutSessions.
4479
       */
4480
      @SerializedName("display_name")
4481
      String displayName;
4482

4483
      /**
4484
       * Map of extra parameters for custom features not available in this client library. The
4485
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4486
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4487
       * name in this param object. Effectively, this map is flattened to its parent instance.
4488
       */
4489
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4490
      Map<String, Object> extraParams;
4491

4492
      /**
4493
       * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4494
       * fixed_amount}.
4495
       */
4496
      @SerializedName("fixed_amount")
4497
      FixedAmount fixedAmount;
4498

4499
      /**
4500
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
4501
       * attach to an object. This can be useful for storing additional information about the object
4502
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
4503
       * keys can be unset by posting an empty value to {@code metadata}.
4504
       */
4505
      @SerializedName("metadata")
4506
      Map<String, String> metadata;
4507

4508
      /**
4509
       * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4510
       * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4511
       */
4512
      @SerializedName("tax_behavior")
4513
      TaxBehavior taxBehavior;
4514

4515
      /**
4516
       * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4517
       * code is {@code txcd_92010001}.
4518
       */
4519
      @SerializedName("tax_code")
4520
      String taxCode;
4521

4522
      /** The type of calculation to use on the shipping rate. */
4523
      @SerializedName("type")
4524
      Type type;
4525

4526
      private ShippingRateData(
4527
          DeliveryEstimate deliveryEstimate,
4528
          String displayName,
4529
          Map<String, Object> extraParams,
4530
          FixedAmount fixedAmount,
4531
          Map<String, String> metadata,
4532
          TaxBehavior taxBehavior,
4533
          String taxCode,
4534
          Type type) {
×
4535
        this.deliveryEstimate = deliveryEstimate;
×
4536
        this.displayName = displayName;
×
4537
        this.extraParams = extraParams;
×
4538
        this.fixedAmount = fixedAmount;
×
4539
        this.metadata = metadata;
×
4540
        this.taxBehavior = taxBehavior;
×
4541
        this.taxCode = taxCode;
×
4542
        this.type = type;
×
4543
      }
×
4544

4545
      public static Builder builder() {
4546
        return new Builder();
×
4547
      }
4548

4549
      public static class Builder {
×
4550
        private DeliveryEstimate deliveryEstimate;
4551

4552
        private String displayName;
4553

4554
        private Map<String, Object> extraParams;
4555

4556
        private FixedAmount fixedAmount;
4557

4558
        private Map<String, String> metadata;
4559

4560
        private TaxBehavior taxBehavior;
4561

4562
        private String taxCode;
4563

4564
        private Type type;
4565

4566
        /** Finalize and obtain parameter instance from this builder. */
4567
        public InvoiceCreateParams.ShippingCost.ShippingRateData build() {
4568
          return new InvoiceCreateParams.ShippingCost.ShippingRateData(
×
4569
              this.deliveryEstimate,
4570
              this.displayName,
4571
              this.extraParams,
4572
              this.fixedAmount,
4573
              this.metadata,
4574
              this.taxBehavior,
4575
              this.taxCode,
4576
              this.type);
4577
        }
4578

4579
        /**
4580
         * The estimated range for how long shipping will take, meant to be displayable to the
4581
         * customer. This will appear on CheckoutSessions.
4582
         */
4583
        public Builder setDeliveryEstimate(
4584
            InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate deliveryEstimate) {
4585
          this.deliveryEstimate = deliveryEstimate;
×
4586
          return this;
×
4587
        }
4588

4589
        /**
4590
         * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4591
         * customer. This will appear on CheckoutSessions.
4592
         */
4593
        public Builder setDisplayName(String displayName) {
4594
          this.displayName = displayName;
×
4595
          return this;
×
4596
        }
4597

4598
        /**
4599
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
4600
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4601
         * map. See {@link InvoiceCreateParams.ShippingCost.ShippingRateData#extraParams} for the
4602
         * field documentation.
4603
         */
4604
        public Builder putExtraParam(String key, Object value) {
4605
          if (this.extraParams == null) {
×
4606
            this.extraParams = new HashMap<>();
×
4607
          }
4608
          this.extraParams.put(key, value);
×
4609
          return this;
×
4610
        }
4611

4612
        /**
4613
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4614
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4615
         * map. See {@link InvoiceCreateParams.ShippingCost.ShippingRateData#extraParams} for the
4616
         * field documentation.
4617
         */
4618
        public Builder putAllExtraParam(Map<String, Object> map) {
4619
          if (this.extraParams == null) {
×
4620
            this.extraParams = new HashMap<>();
×
4621
          }
4622
          this.extraParams.putAll(map);
×
4623
          return this;
×
4624
        }
4625

4626
        /**
4627
         * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4628
         * fixed_amount}.
4629
         */
4630
        public Builder setFixedAmount(
4631
            InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount fixedAmount) {
4632
          this.fixedAmount = fixedAmount;
×
4633
          return this;
×
4634
        }
4635

4636
        /**
4637
         * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
4638
         * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4639
         * InvoiceCreateParams.ShippingCost.ShippingRateData#metadata} for the field documentation.
4640
         */
4641
        public Builder putMetadata(String key, String value) {
4642
          if (this.metadata == null) {
×
4643
            this.metadata = new HashMap<>();
×
4644
          }
4645
          this.metadata.put(key, value);
×
4646
          return this;
×
4647
        }
4648

4649
        /**
4650
         * Add all map key/value pairs to `metadata` map. A map is initialized for the first
4651
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4652
         * map. See {@link InvoiceCreateParams.ShippingCost.ShippingRateData#metadata} for the field
4653
         * documentation.
4654
         */
4655
        public Builder putAllMetadata(Map<String, String> map) {
4656
          if (this.metadata == null) {
×
4657
            this.metadata = new HashMap<>();
×
4658
          }
4659
          this.metadata.putAll(map);
×
4660
          return this;
×
4661
        }
4662

4663
        /**
4664
         * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4665
         * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4666
         */
4667
        public Builder setTaxBehavior(
4668
            InvoiceCreateParams.ShippingCost.ShippingRateData.TaxBehavior taxBehavior) {
4669
          this.taxBehavior = taxBehavior;
×
4670
          return this;
×
4671
        }
4672

4673
        /**
4674
         * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4675
         * code is {@code txcd_92010001}.
4676
         */
4677
        public Builder setTaxCode(String taxCode) {
4678
          this.taxCode = taxCode;
×
4679
          return this;
×
4680
        }
4681

4682
        /** The type of calculation to use on the shipping rate. */
4683
        public Builder setType(InvoiceCreateParams.ShippingCost.ShippingRateData.Type type) {
4684
          this.type = type;
×
4685
          return this;
×
4686
        }
4687
      }
4688

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

4701
        /**
4702
         * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4703
         * infinite.
4704
         */
4705
        @SerializedName("maximum")
4706
        Maximum maximum;
4707

4708
        /** The lower bound of the estimated range. If empty, represents no lower bound. */
4709
        @SerializedName("minimum")
4710
        Minimum minimum;
4711

4712
        private DeliveryEstimate(
4713
            Map<String, Object> extraParams, Maximum maximum, Minimum minimum) {
×
4714
          this.extraParams = extraParams;
×
4715
          this.maximum = maximum;
×
4716
          this.minimum = minimum;
×
4717
        }
×
4718

4719
        public static Builder builder() {
4720
          return new Builder();
×
4721
        }
4722

4723
        public static class Builder {
×
4724
          private Map<String, Object> extraParams;
4725

4726
          private Maximum maximum;
4727

4728
          private Minimum minimum;
4729

4730
          /** Finalize and obtain parameter instance from this builder. */
4731
          public InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate build() {
4732
            return new InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate(
×
4733
                this.extraParams, this.maximum, this.minimum);
4734
          }
4735

4736
          /**
4737
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
4738
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4739
           * map. See {@link
4740
           * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate#extraParams} for the
4741
           * field documentation.
4742
           */
4743
          public Builder putExtraParam(String key, Object value) {
4744
            if (this.extraParams == null) {
×
4745
              this.extraParams = new HashMap<>();
×
4746
            }
4747
            this.extraParams.put(key, value);
×
4748
            return this;
×
4749
          }
4750

4751
          /**
4752
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4753
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4754
           * map. See {@link
4755
           * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate#extraParams} for the
4756
           * field documentation.
4757
           */
4758
          public Builder putAllExtraParam(Map<String, Object> map) {
4759
            if (this.extraParams == null) {
×
4760
              this.extraParams = new HashMap<>();
×
4761
            }
4762
            this.extraParams.putAll(map);
×
4763
            return this;
×
4764
          }
4765

4766
          /**
4767
           * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4768
           * infinite.
4769
           */
4770
          public Builder setMaximum(
4771
              InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum maximum) {
4772
            this.maximum = maximum;
×
4773
            return this;
×
4774
          }
4775

4776
          /** The lower bound of the estimated range. If empty, represents no lower bound. */
4777
          public Builder setMinimum(
4778
              InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum minimum) {
4779
            this.minimum = minimum;
×
4780
            return this;
×
4781
          }
4782
        }
4783

4784
        @Getter
4785
        public static class Maximum {
4786
          /**
4787
           * Map of extra parameters for custom features not available in this client library. The
4788
           * content in this map is not serialized under this field's {@code @SerializedName} value.
4789
           * Instead, each key/value pair is serialized as if the key is a root-level field
4790
           * (serialized) name in this param object. Effectively, this map is flattened to its
4791
           * parent instance.
4792
           */
4793
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4794
          Map<String, Object> extraParams;
4795

4796
          /** <strong>Required.</strong> A unit of time. */
4797
          @SerializedName("unit")
4798
          Unit unit;
4799

4800
          /** <strong>Required.</strong> Must be greater than 0. */
4801
          @SerializedName("value")
4802
          Long value;
4803

4804
          private Maximum(Map<String, Object> extraParams, Unit unit, Long value) {
×
4805
            this.extraParams = extraParams;
×
4806
            this.unit = unit;
×
4807
            this.value = value;
×
4808
          }
×
4809

4810
          public static Builder builder() {
4811
            return new Builder();
×
4812
          }
4813

4814
          public static class Builder {
×
4815
            private Map<String, Object> extraParams;
4816

4817
            private Unit unit;
4818

4819
            private Long value;
4820

4821
            /** Finalize and obtain parameter instance from this builder. */
4822
            public InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum
4823
                build() {
4824
              return new InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum(
×
4825
                  this.extraParams, this.unit, this.value);
4826
            }
4827

4828
            /**
4829
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
4830
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4831
             * original map. See {@link
4832
             * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum#extraParams}
4833
             * for the field documentation.
4834
             */
4835
            public Builder putExtraParam(String key, Object value) {
4836
              if (this.extraParams == null) {
×
4837
                this.extraParams = new HashMap<>();
×
4838
              }
4839
              this.extraParams.put(key, value);
×
4840
              return this;
×
4841
            }
4842

4843
            /**
4844
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4845
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4846
             * original map. See {@link
4847
             * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum#extraParams}
4848
             * for the field documentation.
4849
             */
4850
            public Builder putAllExtraParam(Map<String, Object> map) {
4851
              if (this.extraParams == null) {
×
4852
                this.extraParams = new HashMap<>();
×
4853
              }
4854
              this.extraParams.putAll(map);
×
4855
              return this;
×
4856
            }
4857

4858
            /** <strong>Required.</strong> A unit of time. */
4859
            public Builder setUnit(
4860
                InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum.Unit
4861
                    unit) {
4862
              this.unit = unit;
×
4863
              return this;
×
4864
            }
4865

4866
            /** <strong>Required.</strong> Must be greater than 0. */
4867
            public Builder setValue(Long value) {
4868
              this.value = value;
×
4869
              return this;
×
4870
            }
4871
          }
4872

4873
          public enum Unit implements ApiRequestParams.EnumParam {
×
4874
            @SerializedName("business_day")
×
4875
            BUSINESS_DAY("business_day"),
4876

4877
            @SerializedName("day")
×
4878
            DAY("day"),
4879

4880
            @SerializedName("hour")
×
4881
            HOUR("hour"),
4882

4883
            @SerializedName("month")
×
4884
            MONTH("month"),
4885

4886
            @SerializedName("week")
×
4887
            WEEK("week");
4888

4889
            @Getter(onMethod_ = {@Override})
4890
            private final String value;
4891

4892
            Unit(String value) {
×
4893
              this.value = value;
×
4894
            }
×
4895
          }
4896
        }
4897

4898
        @Getter
4899
        public static class Minimum {
4900
          /**
4901
           * Map of extra parameters for custom features not available in this client library. The
4902
           * content in this map is not serialized under this field's {@code @SerializedName} value.
4903
           * Instead, each key/value pair is serialized as if the key is a root-level field
4904
           * (serialized) name in this param object. Effectively, this map is flattened to its
4905
           * parent instance.
4906
           */
4907
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4908
          Map<String, Object> extraParams;
4909

4910
          /** <strong>Required.</strong> A unit of time. */
4911
          @SerializedName("unit")
4912
          Unit unit;
4913

4914
          /** <strong>Required.</strong> Must be greater than 0. */
4915
          @SerializedName("value")
4916
          Long value;
4917

4918
          private Minimum(Map<String, Object> extraParams, Unit unit, Long value) {
×
4919
            this.extraParams = extraParams;
×
4920
            this.unit = unit;
×
4921
            this.value = value;
×
4922
          }
×
4923

4924
          public static Builder builder() {
4925
            return new Builder();
×
4926
          }
4927

4928
          public static class Builder {
×
4929
            private Map<String, Object> extraParams;
4930

4931
            private Unit unit;
4932

4933
            private Long value;
4934

4935
            /** Finalize and obtain parameter instance from this builder. */
4936
            public InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum
4937
                build() {
4938
              return new InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum(
×
4939
                  this.extraParams, this.unit, this.value);
4940
            }
4941

4942
            /**
4943
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
4944
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4945
             * original map. See {@link
4946
             * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
4947
             * for the field documentation.
4948
             */
4949
            public Builder putExtraParam(String key, Object value) {
4950
              if (this.extraParams == null) {
×
4951
                this.extraParams = new HashMap<>();
×
4952
              }
4953
              this.extraParams.put(key, value);
×
4954
              return this;
×
4955
            }
4956

4957
            /**
4958
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4959
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4960
             * original map. See {@link
4961
             * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
4962
             * for the field documentation.
4963
             */
4964
            public Builder putAllExtraParam(Map<String, Object> map) {
4965
              if (this.extraParams == null) {
×
4966
                this.extraParams = new HashMap<>();
×
4967
              }
4968
              this.extraParams.putAll(map);
×
4969
              return this;
×
4970
            }
4971

4972
            /** <strong>Required.</strong> A unit of time. */
4973
            public Builder setUnit(
4974
                InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum.Unit
4975
                    unit) {
4976
              this.unit = unit;
×
4977
              return this;
×
4978
            }
4979

4980
            /** <strong>Required.</strong> Must be greater than 0. */
4981
            public Builder setValue(Long value) {
4982
              this.value = value;
×
4983
              return this;
×
4984
            }
4985
          }
4986

4987
          public enum Unit implements ApiRequestParams.EnumParam {
×
4988
            @SerializedName("business_day")
×
4989
            BUSINESS_DAY("business_day"),
4990

4991
            @SerializedName("day")
×
4992
            DAY("day"),
4993

4994
            @SerializedName("hour")
×
4995
            HOUR("hour"),
4996

4997
            @SerializedName("month")
×
4998
            MONTH("month"),
4999

5000
            @SerializedName("week")
×
5001
            WEEK("week");
5002

5003
            @Getter(onMethod_ = {@Override})
5004
            private final String value;
5005

5006
            Unit(String value) {
×
5007
              this.value = value;
×
5008
            }
×
5009
          }
5010
        }
5011
      }
5012

5013
      @Getter
5014
      public static class FixedAmount {
5015
        /**
5016
         * <strong>Required.</strong> A non-negative integer in cents representing how much to
5017
         * charge.
5018
         */
5019
        @SerializedName("amount")
5020
        Long amount;
5021

5022
        /**
5023
         * <strong>Required.</strong> Three-letter <a
5024
         * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5025
         * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
5026
         */
5027
        @SerializedName("currency")
5028
        String currency;
5029

5030
        /**
5031
         * Shipping rates defined in each available currency option. Each key must be a three-letter
5032
         * <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a
5033
         * href="https://stripe.com/docs/currencies">supported currency</a>.
5034
         */
5035
        @SerializedName("currency_options")
5036
        Map<String, InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5037
            currencyOptions;
5038

5039
        /**
5040
         * Map of extra parameters for custom features not available in this client library. The
5041
         * content in this map is not serialized under this field's {@code @SerializedName} value.
5042
         * Instead, each key/value pair is serialized as if the key is a root-level field
5043
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
5044
         * instance.
5045
         */
5046
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5047
        Map<String, Object> extraParams;
5048

5049
        private FixedAmount(
5050
            Long amount,
5051
            String currency,
5052
            Map<
5053
                    String,
5054
                    InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5055
                currencyOptions,
5056
            Map<String, Object> extraParams) {
×
5057
          this.amount = amount;
×
5058
          this.currency = currency;
×
5059
          this.currencyOptions = currencyOptions;
×
5060
          this.extraParams = extraParams;
×
5061
        }
×
5062

5063
        public static Builder builder() {
5064
          return new Builder();
×
5065
        }
5066

5067
        public static class Builder {
×
5068
          private Long amount;
5069

5070
          private String currency;
5071

5072
          private Map<
5073
                  String,
5074
                  InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5075
              currencyOptions;
5076

5077
          private Map<String, Object> extraParams;
5078

5079
          /** Finalize and obtain parameter instance from this builder. */
5080
          public InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount build() {
5081
            return new InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount(
×
5082
                this.amount, this.currency, this.currencyOptions, this.extraParams);
5083
          }
5084

5085
          /**
5086
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5087
           * charge.
5088
           */
5089
          public Builder setAmount(Long amount) {
5090
            this.amount = amount;
×
5091
            return this;
×
5092
          }
5093

5094
          /**
5095
           * <strong>Required.</strong> Three-letter <a
5096
           * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5097
           * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
5098
           * currency</a>.
5099
           */
5100
          public Builder setCurrency(String currency) {
5101
            this.currency = currency;
×
5102
            return this;
×
5103
          }
5104

5105
          /**
5106
           * Add a key/value pair to `currencyOptions` map. A map is initialized for the first
5107
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5108
           * map. See {@link
5109
           * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the
5110
           * field documentation.
5111
           */
5112
          public Builder putCurrencyOption(
5113
              String key,
5114
              InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption value) {
5115
            if (this.currencyOptions == null) {
×
5116
              this.currencyOptions = new HashMap<>();
×
5117
            }
5118
            this.currencyOptions.put(key, value);
×
5119
            return this;
×
5120
          }
5121

5122
          /**
5123
           * Add all map key/value pairs to `currencyOptions` map. A map is initialized for the
5124
           * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
5125
           * original map. See {@link
5126
           * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the
5127
           * field documentation.
5128
           */
5129
          public Builder putAllCurrencyOption(
5130
              Map<
5131
                      String,
5132
                      InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5133
                  map) {
5134
            if (this.currencyOptions == null) {
×
5135
              this.currencyOptions = new HashMap<>();
×
5136
            }
5137
            this.currencyOptions.putAll(map);
×
5138
            return this;
×
5139
          }
5140

5141
          /**
5142
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
5143
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5144
           * map. See {@link
5145
           * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount#extraParams} for the
5146
           * field documentation.
5147
           */
5148
          public Builder putExtraParam(String key, Object value) {
5149
            if (this.extraParams == null) {
×
5150
              this.extraParams = new HashMap<>();
×
5151
            }
5152
            this.extraParams.put(key, value);
×
5153
            return this;
×
5154
          }
5155

5156
          /**
5157
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5158
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5159
           * map. See {@link
5160
           * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount#extraParams} for the
5161
           * field documentation.
5162
           */
5163
          public Builder putAllExtraParam(Map<String, Object> map) {
5164
            if (this.extraParams == null) {
×
5165
              this.extraParams = new HashMap<>();
×
5166
            }
5167
            this.extraParams.putAll(map);
×
5168
            return this;
×
5169
          }
5170
        }
5171

5172
        @Getter
5173
        public static class CurrencyOption {
5174
          /**
5175
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5176
           * charge.
5177
           */
5178
          @SerializedName("amount")
5179
          Long amount;
5180

5181
          /**
5182
           * Map of extra parameters for custom features not available in this client library. The
5183
           * content in this map is not serialized under this field's {@code @SerializedName} value.
5184
           * Instead, each key/value pair is serialized as if the key is a root-level field
5185
           * (serialized) name in this param object. Effectively, this map is flattened to its
5186
           * parent instance.
5187
           */
5188
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5189
          Map<String, Object> extraParams;
5190

5191
          /**
5192
           * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One
5193
           * of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5194
           */
5195
          @SerializedName("tax_behavior")
5196
          TaxBehavior taxBehavior;
5197

5198
          private CurrencyOption(
5199
              Long amount, Map<String, Object> extraParams, TaxBehavior taxBehavior) {
×
5200
            this.amount = amount;
×
5201
            this.extraParams = extraParams;
×
5202
            this.taxBehavior = taxBehavior;
×
5203
          }
×
5204

5205
          public static Builder builder() {
5206
            return new Builder();
×
5207
          }
5208

5209
          public static class Builder {
×
5210
            private Long amount;
5211

5212
            private Map<String, Object> extraParams;
5213

5214
            private TaxBehavior taxBehavior;
5215

5216
            /** Finalize and obtain parameter instance from this builder. */
5217
            public InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5218
                build() {
5219
              return new InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount
×
5220
                  .CurrencyOption(this.amount, this.extraParams, this.taxBehavior);
5221
            }
5222

5223
            /**
5224
             * <strong>Required.</strong> A non-negative integer in cents representing how much to
5225
             * charge.
5226
             */
5227
            public Builder setAmount(Long amount) {
5228
              this.amount = amount;
×
5229
              return this;
×
5230
            }
5231

5232
            /**
5233
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
5234
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5235
             * original map. See {@link
5236
             * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption#extraParams}
5237
             * for the field documentation.
5238
             */
5239
            public Builder putExtraParam(String key, Object value) {
5240
              if (this.extraParams == null) {
×
5241
                this.extraParams = new HashMap<>();
×
5242
              }
5243
              this.extraParams.put(key, value);
×
5244
              return this;
×
5245
            }
5246

5247
            /**
5248
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5249
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5250
             * original map. See {@link
5251
             * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption#extraParams}
5252
             * for the field documentation.
5253
             */
5254
            public Builder putAllExtraParam(Map<String, Object> map) {
5255
              if (this.extraParams == null) {
×
5256
                this.extraParams = new HashMap<>();
×
5257
              }
5258
              this.extraParams.putAll(map);
×
5259
              return this;
×
5260
            }
5261

5262
            /**
5263
             * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
5264
             * One of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5265
             */
5266
            public Builder setTaxBehavior(
5267
                InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5268
                        .TaxBehavior
5269
                    taxBehavior) {
5270
              this.taxBehavior = taxBehavior;
×
5271
              return this;
×
5272
            }
5273
          }
5274

5275
          public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5276
            @SerializedName("exclusive")
×
5277
            EXCLUSIVE("exclusive"),
5278

5279
            @SerializedName("inclusive")
×
5280
            INCLUSIVE("inclusive"),
5281

5282
            @SerializedName("unspecified")
×
5283
            UNSPECIFIED("unspecified");
5284

5285
            @Getter(onMethod_ = {@Override})
5286
            private final String value;
5287

5288
            TaxBehavior(String value) {
×
5289
              this.value = value;
×
5290
            }
×
5291
          }
5292
        }
5293
      }
5294

5295
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5296
        @SerializedName("exclusive")
×
5297
        EXCLUSIVE("exclusive"),
5298

5299
        @SerializedName("inclusive")
×
5300
        INCLUSIVE("inclusive"),
5301

5302
        @SerializedName("unspecified")
×
5303
        UNSPECIFIED("unspecified");
5304

5305
        @Getter(onMethod_ = {@Override})
5306
        private final String value;
5307

5308
        TaxBehavior(String value) {
×
5309
          this.value = value;
×
5310
        }
×
5311
      }
5312

5313
      public enum Type implements ApiRequestParams.EnumParam {
×
5314
        @SerializedName("fixed_amount")
×
5315
        FIXED_AMOUNT("fixed_amount");
5316

5317
        @Getter(onMethod_ = {@Override})
5318
        private final String value;
5319

5320
        Type(String value) {
×
5321
          this.value = value;
×
5322
        }
×
5323
      }
5324
    }
5325
  }
5326

5327
  @Getter
5328
  public static class ShippingDetails {
5329
    /** <strong>Required.</strong> Shipping address */
5330
    @SerializedName("address")
5331
    Address address;
5332

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

5342
    /** <strong>Required.</strong> Recipient name. */
5343
    @SerializedName("name")
5344
    String name;
5345

5346
    /** Recipient phone (including extension). */
5347
    @SerializedName("phone")
5348
    Object phone;
5349

5350
    private ShippingDetails(
5351
        Address address, Map<String, Object> extraParams, String name, Object phone) {
×
5352
      this.address = address;
×
5353
      this.extraParams = extraParams;
×
5354
      this.name = name;
×
5355
      this.phone = phone;
×
5356
    }
×
5357

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

5362
    public static class Builder {
×
5363
      private Address address;
5364

5365
      private Map<String, Object> extraParams;
5366

5367
      private String name;
5368

5369
      private Object phone;
5370

5371
      /** Finalize and obtain parameter instance from this builder. */
5372
      public InvoiceCreateParams.ShippingDetails build() {
5373
        return new InvoiceCreateParams.ShippingDetails(
×
5374
            this.address, this.extraParams, this.name, this.phone);
5375
      }
5376

5377
      /** <strong>Required.</strong> Shipping address */
5378
      public Builder setAddress(InvoiceCreateParams.ShippingDetails.Address address) {
5379
        this.address = address;
×
5380
        return this;
×
5381
      }
5382

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

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

5409
      /** <strong>Required.</strong> Recipient name. */
5410
      public Builder setName(String name) {
5411
        this.name = name;
×
5412
        return this;
×
5413
      }
5414

5415
      /** Recipient phone (including extension). */
5416
      public Builder setPhone(String phone) {
5417
        this.phone = phone;
×
5418
        return this;
×
5419
      }
5420

5421
      /** Recipient phone (including extension). */
5422
      public Builder setPhone(EmptyParam phone) {
5423
        this.phone = phone;
×
5424
        return this;
×
5425
      }
5426
    }
5427

5428
    @Getter
5429
    public static class Address {
5430
      /** City, district, suburb, town, or village. */
5431
      @SerializedName("city")
5432
      String city;
5433

5434
      /**
5435
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5436
       * 3166-1 alpha-2</a>).
5437
       */
5438
      @SerializedName("country")
5439
      String country;
5440

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

5450
      /** Address line 1 (e.g., street, PO Box, or company name). */
5451
      @SerializedName("line1")
5452
      String line1;
5453

5454
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
5455
      @SerializedName("line2")
5456
      String line2;
5457

5458
      /** ZIP or postal code. */
5459
      @SerializedName("postal_code")
5460
      String postalCode;
5461

5462
      /** State, county, province, or region. */
5463
      @SerializedName("state")
5464
      String state;
5465

5466
      private Address(
5467
          String city,
5468
          String country,
5469
          Map<String, Object> extraParams,
5470
          String line1,
5471
          String line2,
5472
          String postalCode,
5473
          String state) {
×
5474
        this.city = city;
×
5475
        this.country = country;
×
5476
        this.extraParams = extraParams;
×
5477
        this.line1 = line1;
×
5478
        this.line2 = line2;
×
5479
        this.postalCode = postalCode;
×
5480
        this.state = state;
×
5481
      }
×
5482

5483
      public static Builder builder() {
5484
        return new Builder();
×
5485
      }
5486

5487
      public static class Builder {
×
5488
        private String city;
5489

5490
        private String country;
5491

5492
        private Map<String, Object> extraParams;
5493

5494
        private String line1;
5495

5496
        private String line2;
5497

5498
        private String postalCode;
5499

5500
        private String state;
5501

5502
        /** Finalize and obtain parameter instance from this builder. */
5503
        public InvoiceCreateParams.ShippingDetails.Address build() {
5504
          return new InvoiceCreateParams.ShippingDetails.Address(
×
5505
              this.city,
5506
              this.country,
5507
              this.extraParams,
5508
              this.line1,
5509
              this.line2,
5510
              this.postalCode,
5511
              this.state);
5512
        }
5513

5514
        /** City, district, suburb, town, or village. */
5515
        public Builder setCity(String city) {
5516
          this.city = city;
×
5517
          return this;
×
5518
        }
5519

5520
        /**
5521
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5522
         * 3166-1 alpha-2</a>).
5523
         */
5524
        public Builder setCountry(String country) {
5525
          this.country = country;
×
5526
          return this;
×
5527
        }
5528

5529
        /**
5530
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
5531
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5532
         * map. See {@link InvoiceCreateParams.ShippingDetails.Address#extraParams} for the field
5533
         * documentation.
5534
         */
5535
        public Builder putExtraParam(String key, Object value) {
5536
          if (this.extraParams == null) {
×
5537
            this.extraParams = new HashMap<>();
×
5538
          }
5539
          this.extraParams.put(key, value);
×
5540
          return this;
×
5541
        }
5542

5543
        /**
5544
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5545
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5546
         * map. See {@link InvoiceCreateParams.ShippingDetails.Address#extraParams} for the field
5547
         * documentation.
5548
         */
5549
        public Builder putAllExtraParam(Map<String, Object> map) {
5550
          if (this.extraParams == null) {
×
5551
            this.extraParams = new HashMap<>();
×
5552
          }
5553
          this.extraParams.putAll(map);
×
5554
          return this;
×
5555
        }
5556

5557
        /** Address line 1 (e.g., street, PO Box, or company name). */
5558
        public Builder setLine1(String line1) {
5559
          this.line1 = line1;
×
5560
          return this;
×
5561
        }
5562

5563
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
5564
        public Builder setLine2(String line2) {
5565
          this.line2 = line2;
×
5566
          return this;
×
5567
        }
5568

5569
        /** ZIP or postal code. */
5570
        public Builder setPostalCode(String postalCode) {
5571
          this.postalCode = postalCode;
×
5572
          return this;
×
5573
        }
5574

5575
        /** State, county, province, or region. */
5576
        public Builder setState(String state) {
5577
          this.state = state;
×
5578
          return this;
×
5579
        }
5580
      }
5581
    }
5582
  }
5583

5584
  @Getter
5585
  public static class TransferData {
5586
    /**
5587
     * The amount that will be transferred automatically when the invoice is paid. If no amount is
5588
     * set, the full amount is transferred.
5589
     */
5590
    @SerializedName("amount")
5591
    Long amount;
5592

5593
    /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5594
    @SerializedName("destination")
5595
    String destination;
5596

5597
    /**
5598
     * Map of extra parameters for custom features not available in this client library. The content
5599
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5600
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5601
     * param object. Effectively, this map is flattened to its parent instance.
5602
     */
5603
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5604
    Map<String, Object> extraParams;
5605

5606
    private TransferData(Long amount, String destination, Map<String, Object> extraParams) {
×
5607
      this.amount = amount;
×
5608
      this.destination = destination;
×
5609
      this.extraParams = extraParams;
×
5610
    }
×
5611

5612
    public static Builder builder() {
5613
      return new Builder();
×
5614
    }
5615

5616
    public static class Builder {
×
5617
      private Long amount;
5618

5619
      private String destination;
5620

5621
      private Map<String, Object> extraParams;
5622

5623
      /** Finalize and obtain parameter instance from this builder. */
5624
      public InvoiceCreateParams.TransferData build() {
5625
        return new InvoiceCreateParams.TransferData(
×
5626
            this.amount, this.destination, this.extraParams);
5627
      }
5628

5629
      /**
5630
       * The amount that will be transferred automatically when the invoice is paid. If no amount is
5631
       * set, the full amount is transferred.
5632
       */
5633
      public Builder setAmount(Long amount) {
5634
        this.amount = amount;
×
5635
        return this;
×
5636
      }
5637

5638
      /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5639
      public Builder setDestination(String destination) {
5640
        this.destination = destination;
×
5641
        return this;
×
5642
      }
5643

5644
      /**
5645
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5646
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5647
       * InvoiceCreateParams.TransferData#extraParams} for the field documentation.
5648
       */
5649
      public Builder putExtraParam(String key, Object value) {
5650
        if (this.extraParams == null) {
×
5651
          this.extraParams = new HashMap<>();
×
5652
        }
5653
        this.extraParams.put(key, value);
×
5654
        return this;
×
5655
      }
5656

5657
      /**
5658
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5659
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5660
       * See {@link InvoiceCreateParams.TransferData#extraParams} for the field documentation.
5661
       */
5662
      public Builder putAllExtraParam(Map<String, Object> map) {
5663
        if (this.extraParams == null) {
×
5664
          this.extraParams = new HashMap<>();
×
5665
        }
5666
        this.extraParams.putAll(map);
×
5667
        return this;
×
5668
      }
5669
    }
5670
  }
5671

5672
  public enum CollectionMethod implements ApiRequestParams.EnumParam {
×
5673
    @SerializedName("charge_automatically")
×
5674
    CHARGE_AUTOMATICALLY("charge_automatically"),
5675

5676
    @SerializedName("send_invoice")
×
5677
    SEND_INVOICE("send_invoice");
5678

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

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

5687
  public enum PendingInvoiceItemsBehavior implements ApiRequestParams.EnumParam {
×
5688
    @SerializedName("exclude")
×
5689
    EXCLUDE("exclude"),
5690

5691
    @SerializedName("include")
×
5692
    INCLUDE("include");
5693

5694
    @Getter(onMethod_ = {@Override})
5695
    private final String value;
5696

5697
    PendingInvoiceItemsBehavior(String value) {
×
5698
      this.value = value;
×
5699
    }
×
5700
  }
5701
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc