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

stripe / stripe-java / #16418

13 Sep 2024 05:53PM UTC coverage: 12.856% (-0.02%) from 12.874%
#16418

push

github

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

Update generated code for beta

9 of 344 new or added lines in 28 files covered. (2.62%)

10 existing lines in 8 files now uncovered.

18470 of 143664 relevant lines covered (12.86%)

0.13 hits per line

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

4.45
/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

4066
      @SerializedName("konbini")
×
4067
      KONBINI("konbini"),
4068

4069
      @SerializedName("link")
×
4070
      LINK("link"),
4071

4072
      @SerializedName("multibanco")
×
4073
      MULTIBANCO("multibanco"),
4074

4075
      @SerializedName("p24")
×
4076
      P24("p24"),
4077

4078
      @SerializedName("paynow")
×
4079
      PAYNOW("paynow"),
4080

4081
      @SerializedName("paypal")
×
4082
      PAYPAL("paypal"),
4083

4084
      @SerializedName("promptpay")
×
4085
      PROMPTPAY("promptpay"),
4086

4087
      @SerializedName("revolut_pay")
×
4088
      REVOLUT_PAY("revolut_pay"),
4089

4090
      @SerializedName("sepa_credit_transfer")
×
4091
      SEPA_CREDIT_TRANSFER("sepa_credit_transfer"),
4092

4093
      @SerializedName("sepa_debit")
×
4094
      SEPA_DEBIT("sepa_debit"),
4095

4096
      @SerializedName("sofort")
×
4097
      SOFORT("sofort"),
4098

4099
      @SerializedName("swish")
×
4100
      SWISH("swish"),
4101

4102
      @SerializedName("us_bank_account")
×
4103
      US_BANK_ACCOUNT("us_bank_account"),
4104

4105
      @SerializedName("wechat_pay")
×
4106
      WECHAT_PAY("wechat_pay");
4107

4108
      @Getter(onMethod_ = {@Override})
4109
      private final String value;
4110

4111
      PaymentMethodType(String value) {
×
4112
        this.value = value;
×
4113
      }
×
4114
    }
4115
  }
4116

4117
  @Getter
4118
  public static class Rendering {
4119
    /**
4120
     * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4121
     * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4122
     * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code exclude_tax}
4123
     * will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4124
     */
4125
    @SerializedName("amount_tax_display")
4126
    ApiRequestParams.EnumParam amountTaxDisplay;
4127

4128
    /**
4129
     * Map of extra parameters for custom features not available in this client library. The content
4130
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4131
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4132
     * param object. Effectively, this map is flattened to its parent instance.
4133
     */
4134
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4135
    Map<String, Object> extraParams;
4136

4137
    /** Invoice pdf rendering options. */
4138
    @SerializedName("pdf")
4139
    Pdf pdf;
4140

4141
    /** ID of the invoice rendering template to use for this invoice. */
4142
    @SerializedName("template")
4143
    String template;
4144

4145
    /** The specific version of invoice rendering template to use for this invoice. */
4146
    @SerializedName("template_version")
4147
    Object templateVersion;
4148

4149
    private Rendering(
4150
        ApiRequestParams.EnumParam amountTaxDisplay,
4151
        Map<String, Object> extraParams,
4152
        Pdf pdf,
4153
        String template,
NEW
4154
        Object templateVersion) {
×
4155
      this.amountTaxDisplay = amountTaxDisplay;
×
4156
      this.extraParams = extraParams;
×
4157
      this.pdf = pdf;
×
NEW
4158
      this.template = template;
×
NEW
4159
      this.templateVersion = templateVersion;
×
UNCOV
4160
    }
×
4161

4162
    public static Builder builder() {
4163
      return new Builder();
×
4164
    }
4165

4166
    public static class Builder {
×
4167
      private ApiRequestParams.EnumParam amountTaxDisplay;
4168

4169
      private Map<String, Object> extraParams;
4170

4171
      private Pdf pdf;
4172

4173
      private String template;
4174

4175
      private Object templateVersion;
4176

4177
      /** Finalize and obtain parameter instance from this builder. */
4178
      public InvoiceCreateParams.Rendering build() {
NEW
4179
        return new InvoiceCreateParams.Rendering(
×
4180
            this.amountTaxDisplay, this.extraParams, this.pdf, this.template, this.templateVersion);
4181
      }
4182

4183
      /**
4184
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4185
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4186
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4187
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4188
       */
4189
      public Builder setAmountTaxDisplay(
4190
          InvoiceCreateParams.Rendering.AmountTaxDisplay amountTaxDisplay) {
4191
        this.amountTaxDisplay = amountTaxDisplay;
×
4192
        return this;
×
4193
      }
4194

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

4206
      /**
4207
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4208
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4209
       * InvoiceCreateParams.Rendering#extraParams} for the field documentation.
4210
       */
4211
      public Builder putExtraParam(String key, Object value) {
4212
        if (this.extraParams == null) {
×
4213
          this.extraParams = new HashMap<>();
×
4214
        }
4215
        this.extraParams.put(key, value);
×
4216
        return this;
×
4217
      }
4218

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

4232
      /** Invoice pdf rendering options. */
4233
      public Builder setPdf(InvoiceCreateParams.Rendering.Pdf pdf) {
4234
        this.pdf = pdf;
×
4235
        return this;
×
4236
      }
4237

4238
      /** ID of the invoice rendering template to use for this invoice. */
4239
      public Builder setTemplate(String template) {
NEW
4240
        this.template = template;
×
NEW
4241
        return this;
×
4242
      }
4243

4244
      /** The specific version of invoice rendering template to use for this invoice. */
4245
      public Builder setTemplateVersion(Long templateVersion) {
NEW
4246
        this.templateVersion = templateVersion;
×
NEW
4247
        return this;
×
4248
      }
4249

4250
      /** The specific version of invoice rendering template to use for this invoice. */
4251
      public Builder setTemplateVersion(EmptyParam templateVersion) {
NEW
4252
        this.templateVersion = templateVersion;
×
NEW
4253
        return this;
×
4254
      }
4255
    }
4256

4257
    @Getter
4258
    public static class Pdf {
4259
      /**
4260
       * Map of extra parameters for custom features not available in this client library. The
4261
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4262
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4263
       * name in this param object. Effectively, this map is flattened to its parent instance.
4264
       */
4265
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4266
      Map<String, Object> extraParams;
4267

4268
      /**
4269
       * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4270
       * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4271
       * Japanese locale and {@code letter} for customers with other locales.
4272
       */
4273
      @SerializedName("page_size")
4274
      PageSize pageSize;
4275

4276
      private Pdf(Map<String, Object> extraParams, PageSize pageSize) {
×
4277
        this.extraParams = extraParams;
×
4278
        this.pageSize = pageSize;
×
4279
      }
×
4280

4281
      public static Builder builder() {
4282
        return new Builder();
×
4283
      }
4284

4285
      public static class Builder {
×
4286
        private Map<String, Object> extraParams;
4287

4288
        private PageSize pageSize;
4289

4290
        /** Finalize and obtain parameter instance from this builder. */
4291
        public InvoiceCreateParams.Rendering.Pdf build() {
4292
          return new InvoiceCreateParams.Rendering.Pdf(this.extraParams, this.pageSize);
×
4293
        }
4294

4295
        /**
4296
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
4297
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4298
         * map. See {@link InvoiceCreateParams.Rendering.Pdf#extraParams} for the field
4299
         * documentation.
4300
         */
4301
        public Builder putExtraParam(String key, Object value) {
4302
          if (this.extraParams == null) {
×
4303
            this.extraParams = new HashMap<>();
×
4304
          }
4305
          this.extraParams.put(key, value);
×
4306
          return this;
×
4307
        }
4308

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

4323
        /**
4324
         * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4325
         * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4326
         * Japanese locale and {@code letter} for customers with other locales.
4327
         */
4328
        public Builder setPageSize(InvoiceCreateParams.Rendering.Pdf.PageSize pageSize) {
4329
          this.pageSize = pageSize;
×
4330
          return this;
×
4331
        }
4332
      }
4333

4334
      public enum PageSize implements ApiRequestParams.EnumParam {
×
4335
        @SerializedName("a4")
×
4336
        A4("a4"),
4337

4338
        @SerializedName("auto")
×
4339
        AUTO("auto"),
4340

4341
        @SerializedName("letter")
×
4342
        LETTER("letter");
4343

4344
        @Getter(onMethod_ = {@Override})
4345
        private final String value;
4346

4347
        PageSize(String value) {
×
4348
          this.value = value;
×
4349
        }
×
4350
      }
4351
    }
4352

4353
    public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
4354
      @SerializedName("exclude_tax")
×
4355
      EXCLUDE_TAX("exclude_tax"),
4356

4357
      @SerializedName("include_inclusive_tax")
×
4358
      INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
4359

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

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

4369
  @Getter
4370
  public static class ShippingCost {
4371
    /**
4372
     * Map of extra parameters for custom features not available in this client library. The content
4373
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4374
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4375
     * param object. Effectively, this map is flattened to its parent instance.
4376
     */
4377
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4378
    Map<String, Object> extraParams;
4379

4380
    /** The ID of the shipping rate to use for this order. */
4381
    @SerializedName("shipping_rate")
4382
    String shippingRate;
4383

4384
    /** Parameters to create a new ad-hoc shipping rate for this order. */
4385
    @SerializedName("shipping_rate_data")
4386
    ShippingRateData shippingRateData;
4387

4388
    private ShippingCost(
4389
        Map<String, Object> extraParams, String shippingRate, ShippingRateData shippingRateData) {
×
4390
      this.extraParams = extraParams;
×
4391
      this.shippingRate = shippingRate;
×
4392
      this.shippingRateData = shippingRateData;
×
4393
    }
×
4394

4395
    public static Builder builder() {
4396
      return new Builder();
×
4397
    }
4398

4399
    public static class Builder {
×
4400
      private Map<String, Object> extraParams;
4401

4402
      private String shippingRate;
4403

4404
      private ShippingRateData shippingRateData;
4405

4406
      /** Finalize and obtain parameter instance from this builder. */
4407
      public InvoiceCreateParams.ShippingCost build() {
4408
        return new InvoiceCreateParams.ShippingCost(
×
4409
            this.extraParams, this.shippingRate, this.shippingRateData);
4410
      }
4411

4412
      /**
4413
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4414
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4415
       * InvoiceCreateParams.ShippingCost#extraParams} for the field documentation.
4416
       */
4417
      public Builder putExtraParam(String key, Object value) {
4418
        if (this.extraParams == null) {
×
4419
          this.extraParams = new HashMap<>();
×
4420
        }
4421
        this.extraParams.put(key, value);
×
4422
        return this;
×
4423
      }
4424

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

4438
      /** The ID of the shipping rate to use for this order. */
4439
      public Builder setShippingRate(String shippingRate) {
4440
        this.shippingRate = shippingRate;
×
4441
        return this;
×
4442
      }
4443

4444
      /** Parameters to create a new ad-hoc shipping rate for this order. */
4445
      public Builder setShippingRateData(
4446
          InvoiceCreateParams.ShippingCost.ShippingRateData shippingRateData) {
4447
        this.shippingRateData = shippingRateData;
×
4448
        return this;
×
4449
      }
4450
    }
4451

4452
    @Getter
4453
    public static class ShippingRateData {
4454
      /**
4455
       * The estimated range for how long shipping will take, meant to be displayable to the
4456
       * customer. This will appear on CheckoutSessions.
4457
       */
4458
      @SerializedName("delivery_estimate")
4459
      DeliveryEstimate deliveryEstimate;
4460

4461
      /**
4462
       * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4463
       * customer. This will appear on CheckoutSessions.
4464
       */
4465
      @SerializedName("display_name")
4466
      String displayName;
4467

4468
      /**
4469
       * Map of extra parameters for custom features not available in this client library. The
4470
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4471
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4472
       * name in this param object. Effectively, this map is flattened to its parent instance.
4473
       */
4474
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4475
      Map<String, Object> extraParams;
4476

4477
      /**
4478
       * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4479
       * fixed_amount}.
4480
       */
4481
      @SerializedName("fixed_amount")
4482
      FixedAmount fixedAmount;
4483

4484
      /**
4485
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
4486
       * attach to an object. This can be useful for storing additional information about the object
4487
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
4488
       * keys can be unset by posting an empty value to {@code metadata}.
4489
       */
4490
      @SerializedName("metadata")
4491
      Map<String, String> metadata;
4492

4493
      /**
4494
       * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4495
       * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4496
       */
4497
      @SerializedName("tax_behavior")
4498
      TaxBehavior taxBehavior;
4499

4500
      /**
4501
       * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4502
       * code is {@code txcd_92010001}.
4503
       */
4504
      @SerializedName("tax_code")
4505
      String taxCode;
4506

4507
      /** The type of calculation to use on the shipping rate. */
4508
      @SerializedName("type")
4509
      Type type;
4510

4511
      private ShippingRateData(
4512
          DeliveryEstimate deliveryEstimate,
4513
          String displayName,
4514
          Map<String, Object> extraParams,
4515
          FixedAmount fixedAmount,
4516
          Map<String, String> metadata,
4517
          TaxBehavior taxBehavior,
4518
          String taxCode,
4519
          Type type) {
×
4520
        this.deliveryEstimate = deliveryEstimate;
×
4521
        this.displayName = displayName;
×
4522
        this.extraParams = extraParams;
×
4523
        this.fixedAmount = fixedAmount;
×
4524
        this.metadata = metadata;
×
4525
        this.taxBehavior = taxBehavior;
×
4526
        this.taxCode = taxCode;
×
4527
        this.type = type;
×
4528
      }
×
4529

4530
      public static Builder builder() {
4531
        return new Builder();
×
4532
      }
4533

4534
      public static class Builder {
×
4535
        private DeliveryEstimate deliveryEstimate;
4536

4537
        private String displayName;
4538

4539
        private Map<String, Object> extraParams;
4540

4541
        private FixedAmount fixedAmount;
4542

4543
        private Map<String, String> metadata;
4544

4545
        private TaxBehavior taxBehavior;
4546

4547
        private String taxCode;
4548

4549
        private Type type;
4550

4551
        /** Finalize and obtain parameter instance from this builder. */
4552
        public InvoiceCreateParams.ShippingCost.ShippingRateData build() {
4553
          return new InvoiceCreateParams.ShippingCost.ShippingRateData(
×
4554
              this.deliveryEstimate,
4555
              this.displayName,
4556
              this.extraParams,
4557
              this.fixedAmount,
4558
              this.metadata,
4559
              this.taxBehavior,
4560
              this.taxCode,
4561
              this.type);
4562
        }
4563

4564
        /**
4565
         * The estimated range for how long shipping will take, meant to be displayable to the
4566
         * customer. This will appear on CheckoutSessions.
4567
         */
4568
        public Builder setDeliveryEstimate(
4569
            InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate deliveryEstimate) {
4570
          this.deliveryEstimate = deliveryEstimate;
×
4571
          return this;
×
4572
        }
4573

4574
        /**
4575
         * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4576
         * customer. This will appear on CheckoutSessions.
4577
         */
4578
        public Builder setDisplayName(String displayName) {
4579
          this.displayName = displayName;
×
4580
          return this;
×
4581
        }
4582

4583
        /**
4584
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
4585
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4586
         * map. See {@link InvoiceCreateParams.ShippingCost.ShippingRateData#extraParams} for the
4587
         * field documentation.
4588
         */
4589
        public Builder putExtraParam(String key, Object value) {
4590
          if (this.extraParams == null) {
×
4591
            this.extraParams = new HashMap<>();
×
4592
          }
4593
          this.extraParams.put(key, value);
×
4594
          return this;
×
4595
        }
4596

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

4611
        /**
4612
         * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4613
         * fixed_amount}.
4614
         */
4615
        public Builder setFixedAmount(
4616
            InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount fixedAmount) {
4617
          this.fixedAmount = fixedAmount;
×
4618
          return this;
×
4619
        }
4620

4621
        /**
4622
         * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
4623
         * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4624
         * InvoiceCreateParams.ShippingCost.ShippingRateData#metadata} for the field documentation.
4625
         */
4626
        public Builder putMetadata(String key, String value) {
4627
          if (this.metadata == null) {
×
4628
            this.metadata = new HashMap<>();
×
4629
          }
4630
          this.metadata.put(key, value);
×
4631
          return this;
×
4632
        }
4633

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

4648
        /**
4649
         * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4650
         * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4651
         */
4652
        public Builder setTaxBehavior(
4653
            InvoiceCreateParams.ShippingCost.ShippingRateData.TaxBehavior taxBehavior) {
4654
          this.taxBehavior = taxBehavior;
×
4655
          return this;
×
4656
        }
4657

4658
        /**
4659
         * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4660
         * code is {@code txcd_92010001}.
4661
         */
4662
        public Builder setTaxCode(String taxCode) {
4663
          this.taxCode = taxCode;
×
4664
          return this;
×
4665
        }
4666

4667
        /** The type of calculation to use on the shipping rate. */
4668
        public Builder setType(InvoiceCreateParams.ShippingCost.ShippingRateData.Type type) {
4669
          this.type = type;
×
4670
          return this;
×
4671
        }
4672
      }
4673

4674
      @Getter
4675
      public static class DeliveryEstimate {
4676
        /**
4677
         * Map of extra parameters for custom features not available in this client library. The
4678
         * content in this map is not serialized under this field's {@code @SerializedName} value.
4679
         * Instead, each key/value pair is serialized as if the key is a root-level field
4680
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
4681
         * instance.
4682
         */
4683
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4684
        Map<String, Object> extraParams;
4685

4686
        /**
4687
         * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4688
         * infinite.
4689
         */
4690
        @SerializedName("maximum")
4691
        Maximum maximum;
4692

4693
        /** The lower bound of the estimated range. If empty, represents no lower bound. */
4694
        @SerializedName("minimum")
4695
        Minimum minimum;
4696

4697
        private DeliveryEstimate(
4698
            Map<String, Object> extraParams, Maximum maximum, Minimum minimum) {
×
4699
          this.extraParams = extraParams;
×
4700
          this.maximum = maximum;
×
4701
          this.minimum = minimum;
×
4702
        }
×
4703

4704
        public static Builder builder() {
4705
          return new Builder();
×
4706
        }
4707

4708
        public static class Builder {
×
4709
          private Map<String, Object> extraParams;
4710

4711
          private Maximum maximum;
4712

4713
          private Minimum minimum;
4714

4715
          /** Finalize and obtain parameter instance from this builder. */
4716
          public InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate build() {
4717
            return new InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate(
×
4718
                this.extraParams, this.maximum, this.minimum);
4719
          }
4720

4721
          /**
4722
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
4723
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4724
           * map. See {@link
4725
           * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate#extraParams} for the
4726
           * field documentation.
4727
           */
4728
          public Builder putExtraParam(String key, Object value) {
4729
            if (this.extraParams == null) {
×
4730
              this.extraParams = new HashMap<>();
×
4731
            }
4732
            this.extraParams.put(key, value);
×
4733
            return this;
×
4734
          }
4735

4736
          /**
4737
           * Add all map key/value pairs 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 putAllExtraParam(Map<String, Object> map) {
4744
            if (this.extraParams == null) {
×
4745
              this.extraParams = new HashMap<>();
×
4746
            }
4747
            this.extraParams.putAll(map);
×
4748
            return this;
×
4749
          }
4750

4751
          /**
4752
           * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4753
           * infinite.
4754
           */
4755
          public Builder setMaximum(
4756
              InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum maximum) {
4757
            this.maximum = maximum;
×
4758
            return this;
×
4759
          }
4760

4761
          /** The lower bound of the estimated range. If empty, represents no lower bound. */
4762
          public Builder setMinimum(
4763
              InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum minimum) {
4764
            this.minimum = minimum;
×
4765
            return this;
×
4766
          }
4767
        }
4768

4769
        @Getter
4770
        public static class Maximum {
4771
          /**
4772
           * Map of extra parameters for custom features not available in this client library. The
4773
           * content in this map is not serialized under this field's {@code @SerializedName} value.
4774
           * Instead, each key/value pair is serialized as if the key is a root-level field
4775
           * (serialized) name in this param object. Effectively, this map is flattened to its
4776
           * parent instance.
4777
           */
4778
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4779
          Map<String, Object> extraParams;
4780

4781
          /** <strong>Required.</strong> A unit of time. */
4782
          @SerializedName("unit")
4783
          Unit unit;
4784

4785
          /** <strong>Required.</strong> Must be greater than 0. */
4786
          @SerializedName("value")
4787
          Long value;
4788

4789
          private Maximum(Map<String, Object> extraParams, Unit unit, Long value) {
×
4790
            this.extraParams = extraParams;
×
4791
            this.unit = unit;
×
4792
            this.value = value;
×
4793
          }
×
4794

4795
          public static Builder builder() {
4796
            return new Builder();
×
4797
          }
4798

4799
          public static class Builder {
×
4800
            private Map<String, Object> extraParams;
4801

4802
            private Unit unit;
4803

4804
            private Long value;
4805

4806
            /** Finalize and obtain parameter instance from this builder. */
4807
            public InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum
4808
                build() {
4809
              return new InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum(
×
4810
                  this.extraParams, this.unit, this.value);
4811
            }
4812

4813
            /**
4814
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
4815
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4816
             * original map. See {@link
4817
             * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum#extraParams}
4818
             * for the field documentation.
4819
             */
4820
            public Builder putExtraParam(String key, Object value) {
4821
              if (this.extraParams == null) {
×
4822
                this.extraParams = new HashMap<>();
×
4823
              }
4824
              this.extraParams.put(key, value);
×
4825
              return this;
×
4826
            }
4827

4828
            /**
4829
             * Add all map key/value pairs 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 putAllExtraParam(Map<String, Object> map) {
4836
              if (this.extraParams == null) {
×
4837
                this.extraParams = new HashMap<>();
×
4838
              }
4839
              this.extraParams.putAll(map);
×
4840
              return this;
×
4841
            }
4842

4843
            /** <strong>Required.</strong> A unit of time. */
4844
            public Builder setUnit(
4845
                InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum.Unit
4846
                    unit) {
4847
              this.unit = unit;
×
4848
              return this;
×
4849
            }
4850

4851
            /** <strong>Required.</strong> Must be greater than 0. */
4852
            public Builder setValue(Long value) {
4853
              this.value = value;
×
4854
              return this;
×
4855
            }
4856
          }
4857

4858
          public enum Unit implements ApiRequestParams.EnumParam {
×
4859
            @SerializedName("business_day")
×
4860
            BUSINESS_DAY("business_day"),
4861

4862
            @SerializedName("day")
×
4863
            DAY("day"),
4864

4865
            @SerializedName("hour")
×
4866
            HOUR("hour"),
4867

4868
            @SerializedName("month")
×
4869
            MONTH("month"),
4870

4871
            @SerializedName("week")
×
4872
            WEEK("week");
4873

4874
            @Getter(onMethod_ = {@Override})
4875
            private final String value;
4876

4877
            Unit(String value) {
×
4878
              this.value = value;
×
4879
            }
×
4880
          }
4881
        }
4882

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

4895
          /** <strong>Required.</strong> A unit of time. */
4896
          @SerializedName("unit")
4897
          Unit unit;
4898

4899
          /** <strong>Required.</strong> Must be greater than 0. */
4900
          @SerializedName("value")
4901
          Long value;
4902

4903
          private Minimum(Map<String, Object> extraParams, Unit unit, Long value) {
×
4904
            this.extraParams = extraParams;
×
4905
            this.unit = unit;
×
4906
            this.value = value;
×
4907
          }
×
4908

4909
          public static Builder builder() {
4910
            return new Builder();
×
4911
          }
4912

4913
          public static class Builder {
×
4914
            private Map<String, Object> extraParams;
4915

4916
            private Unit unit;
4917

4918
            private Long value;
4919

4920
            /** Finalize and obtain parameter instance from this builder. */
4921
            public InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum
4922
                build() {
4923
              return new InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum(
×
4924
                  this.extraParams, this.unit, this.value);
4925
            }
4926

4927
            /**
4928
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
4929
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4930
             * original map. See {@link
4931
             * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
4932
             * for the field documentation.
4933
             */
4934
            public Builder putExtraParam(String key, Object value) {
4935
              if (this.extraParams == null) {
×
4936
                this.extraParams = new HashMap<>();
×
4937
              }
4938
              this.extraParams.put(key, value);
×
4939
              return this;
×
4940
            }
4941

4942
            /**
4943
             * Add all map key/value pairs 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 putAllExtraParam(Map<String, Object> map) {
4950
              if (this.extraParams == null) {
×
4951
                this.extraParams = new HashMap<>();
×
4952
              }
4953
              this.extraParams.putAll(map);
×
4954
              return this;
×
4955
            }
4956

4957
            /** <strong>Required.</strong> A unit of time. */
4958
            public Builder setUnit(
4959
                InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum.Unit
4960
                    unit) {
4961
              this.unit = unit;
×
4962
              return this;
×
4963
            }
4964

4965
            /** <strong>Required.</strong> Must be greater than 0. */
4966
            public Builder setValue(Long value) {
4967
              this.value = value;
×
4968
              return this;
×
4969
            }
4970
          }
4971

4972
          public enum Unit implements ApiRequestParams.EnumParam {
×
4973
            @SerializedName("business_day")
×
4974
            BUSINESS_DAY("business_day"),
4975

4976
            @SerializedName("day")
×
4977
            DAY("day"),
4978

4979
            @SerializedName("hour")
×
4980
            HOUR("hour"),
4981

4982
            @SerializedName("month")
×
4983
            MONTH("month"),
4984

4985
            @SerializedName("week")
×
4986
            WEEK("week");
4987

4988
            @Getter(onMethod_ = {@Override})
4989
            private final String value;
4990

4991
            Unit(String value) {
×
4992
              this.value = value;
×
4993
            }
×
4994
          }
4995
        }
4996
      }
4997

4998
      @Getter
4999
      public static class FixedAmount {
5000
        /**
5001
         * <strong>Required.</strong> A non-negative integer in cents representing how much to
5002
         * charge.
5003
         */
5004
        @SerializedName("amount")
5005
        Long amount;
5006

5007
        /**
5008
         * <strong>Required.</strong> Three-letter <a
5009
         * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5010
         * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
5011
         */
5012
        @SerializedName("currency")
5013
        String currency;
5014

5015
        /**
5016
         * Shipping rates defined in each available currency option. Each key must be a three-letter
5017
         * <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a
5018
         * href="https://stripe.com/docs/currencies">supported currency</a>.
5019
         */
5020
        @SerializedName("currency_options")
5021
        Map<String, InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5022
            currencyOptions;
5023

5024
        /**
5025
         * Map of extra parameters for custom features not available in this client library. The
5026
         * content in this map is not serialized under this field's {@code @SerializedName} value.
5027
         * Instead, each key/value pair is serialized as if the key is a root-level field
5028
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
5029
         * instance.
5030
         */
5031
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5032
        Map<String, Object> extraParams;
5033

5034
        private FixedAmount(
5035
            Long amount,
5036
            String currency,
5037
            Map<
5038
                    String,
5039
                    InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5040
                currencyOptions,
5041
            Map<String, Object> extraParams) {
×
5042
          this.amount = amount;
×
5043
          this.currency = currency;
×
5044
          this.currencyOptions = currencyOptions;
×
5045
          this.extraParams = extraParams;
×
5046
        }
×
5047

5048
        public static Builder builder() {
5049
          return new Builder();
×
5050
        }
5051

5052
        public static class Builder {
×
5053
          private Long amount;
5054

5055
          private String currency;
5056

5057
          private Map<
5058
                  String,
5059
                  InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5060
              currencyOptions;
5061

5062
          private Map<String, Object> extraParams;
5063

5064
          /** Finalize and obtain parameter instance from this builder. */
5065
          public InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount build() {
5066
            return new InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount(
×
5067
                this.amount, this.currency, this.currencyOptions, this.extraParams);
5068
          }
5069

5070
          /**
5071
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5072
           * charge.
5073
           */
5074
          public Builder setAmount(Long amount) {
5075
            this.amount = amount;
×
5076
            return this;
×
5077
          }
5078

5079
          /**
5080
           * <strong>Required.</strong> Three-letter <a
5081
           * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5082
           * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
5083
           * currency</a>.
5084
           */
5085
          public Builder setCurrency(String currency) {
5086
            this.currency = currency;
×
5087
            return this;
×
5088
          }
5089

5090
          /**
5091
           * Add a key/value pair to `currencyOptions` map. A map is initialized for the first
5092
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5093
           * map. See {@link
5094
           * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the
5095
           * field documentation.
5096
           */
5097
          public Builder putCurrencyOption(
5098
              String key,
5099
              InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption value) {
5100
            if (this.currencyOptions == null) {
×
5101
              this.currencyOptions = new HashMap<>();
×
5102
            }
5103
            this.currencyOptions.put(key, value);
×
5104
            return this;
×
5105
          }
5106

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

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

5141
          /**
5142
           * Add all map key/value pairs 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 putAllExtraParam(Map<String, Object> map) {
5149
            if (this.extraParams == null) {
×
5150
              this.extraParams = new HashMap<>();
×
5151
            }
5152
            this.extraParams.putAll(map);
×
5153
            return this;
×
5154
          }
5155
        }
5156

5157
        @Getter
5158
        public static class CurrencyOption {
5159
          /**
5160
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5161
           * charge.
5162
           */
5163
          @SerializedName("amount")
5164
          Long amount;
5165

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

5176
          /**
5177
           * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One
5178
           * of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5179
           */
5180
          @SerializedName("tax_behavior")
5181
          TaxBehavior taxBehavior;
5182

5183
          private CurrencyOption(
5184
              Long amount, Map<String, Object> extraParams, TaxBehavior taxBehavior) {
×
5185
            this.amount = amount;
×
5186
            this.extraParams = extraParams;
×
5187
            this.taxBehavior = taxBehavior;
×
5188
          }
×
5189

5190
          public static Builder builder() {
5191
            return new Builder();
×
5192
          }
5193

5194
          public static class Builder {
×
5195
            private Long amount;
5196

5197
            private Map<String, Object> extraParams;
5198

5199
            private TaxBehavior taxBehavior;
5200

5201
            /** Finalize and obtain parameter instance from this builder. */
5202
            public InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5203
                build() {
5204
              return new InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount
×
5205
                  .CurrencyOption(this.amount, this.extraParams, this.taxBehavior);
5206
            }
5207

5208
            /**
5209
             * <strong>Required.</strong> A non-negative integer in cents representing how much to
5210
             * charge.
5211
             */
5212
            public Builder setAmount(Long amount) {
5213
              this.amount = amount;
×
5214
              return this;
×
5215
            }
5216

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

5232
            /**
5233
             * Add all map key/value pairs 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 putAllExtraParam(Map<String, Object> map) {
5240
              if (this.extraParams == null) {
×
5241
                this.extraParams = new HashMap<>();
×
5242
              }
5243
              this.extraParams.putAll(map);
×
5244
              return this;
×
5245
            }
5246

5247
            /**
5248
             * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
5249
             * One of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5250
             */
5251
            public Builder setTaxBehavior(
5252
                InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5253
                        .TaxBehavior
5254
                    taxBehavior) {
5255
              this.taxBehavior = taxBehavior;
×
5256
              return this;
×
5257
            }
5258
          }
5259

5260
          public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5261
            @SerializedName("exclusive")
×
5262
            EXCLUSIVE("exclusive"),
5263

5264
            @SerializedName("inclusive")
×
5265
            INCLUSIVE("inclusive"),
5266

5267
            @SerializedName("unspecified")
×
5268
            UNSPECIFIED("unspecified");
5269

5270
            @Getter(onMethod_ = {@Override})
5271
            private final String value;
5272

5273
            TaxBehavior(String value) {
×
5274
              this.value = value;
×
5275
            }
×
5276
          }
5277
        }
5278
      }
5279

5280
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5281
        @SerializedName("exclusive")
×
5282
        EXCLUSIVE("exclusive"),
5283

5284
        @SerializedName("inclusive")
×
5285
        INCLUSIVE("inclusive"),
5286

5287
        @SerializedName("unspecified")
×
5288
        UNSPECIFIED("unspecified");
5289

5290
        @Getter(onMethod_ = {@Override})
5291
        private final String value;
5292

5293
        TaxBehavior(String value) {
×
5294
          this.value = value;
×
5295
        }
×
5296
      }
5297

5298
      public enum Type implements ApiRequestParams.EnumParam {
×
5299
        @SerializedName("fixed_amount")
×
5300
        FIXED_AMOUNT("fixed_amount");
5301

5302
        @Getter(onMethod_ = {@Override})
5303
        private final String value;
5304

5305
        Type(String value) {
×
5306
          this.value = value;
×
5307
        }
×
5308
      }
5309
    }
5310
  }
5311

5312
  @Getter
5313
  public static class ShippingDetails {
5314
    /** <strong>Required.</strong> Shipping address */
5315
    @SerializedName("address")
5316
    Address address;
5317

5318
    /**
5319
     * Map of extra parameters for custom features not available in this client library. The content
5320
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5321
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5322
     * param object. Effectively, this map is flattened to its parent instance.
5323
     */
5324
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5325
    Map<String, Object> extraParams;
5326

5327
    /** <strong>Required.</strong> Recipient name. */
5328
    @SerializedName("name")
5329
    String name;
5330

5331
    /** Recipient phone (including extension). */
5332
    @SerializedName("phone")
5333
    Object phone;
5334

5335
    private ShippingDetails(
5336
        Address address, Map<String, Object> extraParams, String name, Object phone) {
×
5337
      this.address = address;
×
5338
      this.extraParams = extraParams;
×
5339
      this.name = name;
×
5340
      this.phone = phone;
×
5341
    }
×
5342

5343
    public static Builder builder() {
5344
      return new Builder();
×
5345
    }
5346

5347
    public static class Builder {
×
5348
      private Address address;
5349

5350
      private Map<String, Object> extraParams;
5351

5352
      private String name;
5353

5354
      private Object phone;
5355

5356
      /** Finalize and obtain parameter instance from this builder. */
5357
      public InvoiceCreateParams.ShippingDetails build() {
5358
        return new InvoiceCreateParams.ShippingDetails(
×
5359
            this.address, this.extraParams, this.name, this.phone);
5360
      }
5361

5362
      /** <strong>Required.</strong> Shipping address */
5363
      public Builder setAddress(InvoiceCreateParams.ShippingDetails.Address address) {
5364
        this.address = address;
×
5365
        return this;
×
5366
      }
5367

5368
      /**
5369
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5370
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5371
       * InvoiceCreateParams.ShippingDetails#extraParams} for the field documentation.
5372
       */
5373
      public Builder putExtraParam(String key, Object value) {
5374
        if (this.extraParams == null) {
×
5375
          this.extraParams = new HashMap<>();
×
5376
        }
5377
        this.extraParams.put(key, value);
×
5378
        return this;
×
5379
      }
5380

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

5394
      /** <strong>Required.</strong> Recipient name. */
5395
      public Builder setName(String name) {
5396
        this.name = name;
×
5397
        return this;
×
5398
      }
5399

5400
      /** Recipient phone (including extension). */
5401
      public Builder setPhone(String phone) {
5402
        this.phone = phone;
×
5403
        return this;
×
5404
      }
5405

5406
      /** Recipient phone (including extension). */
5407
      public Builder setPhone(EmptyParam phone) {
5408
        this.phone = phone;
×
5409
        return this;
×
5410
      }
5411
    }
5412

5413
    @Getter
5414
    public static class Address {
5415
      /** City, district, suburb, town, or village. */
5416
      @SerializedName("city")
5417
      String city;
5418

5419
      /**
5420
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5421
       * 3166-1 alpha-2</a>).
5422
       */
5423
      @SerializedName("country")
5424
      String country;
5425

5426
      /**
5427
       * Map of extra parameters for custom features not available in this client library. The
5428
       * content in this map is not serialized under this field's {@code @SerializedName} value.
5429
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
5430
       * name in this param object. Effectively, this map is flattened to its parent instance.
5431
       */
5432
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5433
      Map<String, Object> extraParams;
5434

5435
      /** Address line 1 (e.g., street, PO Box, or company name). */
5436
      @SerializedName("line1")
5437
      String line1;
5438

5439
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
5440
      @SerializedName("line2")
5441
      String line2;
5442

5443
      /** ZIP or postal code. */
5444
      @SerializedName("postal_code")
5445
      String postalCode;
5446

5447
      /** State, county, province, or region. */
5448
      @SerializedName("state")
5449
      String state;
5450

5451
      private Address(
5452
          String city,
5453
          String country,
5454
          Map<String, Object> extraParams,
5455
          String line1,
5456
          String line2,
5457
          String postalCode,
5458
          String state) {
×
5459
        this.city = city;
×
5460
        this.country = country;
×
5461
        this.extraParams = extraParams;
×
5462
        this.line1 = line1;
×
5463
        this.line2 = line2;
×
5464
        this.postalCode = postalCode;
×
5465
        this.state = state;
×
5466
      }
×
5467

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

5472
      public static class Builder {
×
5473
        private String city;
5474

5475
        private String country;
5476

5477
        private Map<String, Object> extraParams;
5478

5479
        private String line1;
5480

5481
        private String line2;
5482

5483
        private String postalCode;
5484

5485
        private String state;
5486

5487
        /** Finalize and obtain parameter instance from this builder. */
5488
        public InvoiceCreateParams.ShippingDetails.Address build() {
5489
          return new InvoiceCreateParams.ShippingDetails.Address(
×
5490
              this.city,
5491
              this.country,
5492
              this.extraParams,
5493
              this.line1,
5494
              this.line2,
5495
              this.postalCode,
5496
              this.state);
5497
        }
5498

5499
        /** City, district, suburb, town, or village. */
5500
        public Builder setCity(String city) {
5501
          this.city = city;
×
5502
          return this;
×
5503
        }
5504

5505
        /**
5506
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5507
         * 3166-1 alpha-2</a>).
5508
         */
5509
        public Builder setCountry(String country) {
5510
          this.country = country;
×
5511
          return this;
×
5512
        }
5513

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

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

5542
        /** Address line 1 (e.g., street, PO Box, or company name). */
5543
        public Builder setLine1(String line1) {
5544
          this.line1 = line1;
×
5545
          return this;
×
5546
        }
5547

5548
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
5549
        public Builder setLine2(String line2) {
5550
          this.line2 = line2;
×
5551
          return this;
×
5552
        }
5553

5554
        /** ZIP or postal code. */
5555
        public Builder setPostalCode(String postalCode) {
5556
          this.postalCode = postalCode;
×
5557
          return this;
×
5558
        }
5559

5560
        /** State, county, province, or region. */
5561
        public Builder setState(String state) {
5562
          this.state = state;
×
5563
          return this;
×
5564
        }
5565
      }
5566
    }
5567
  }
5568

5569
  @Getter
5570
  public static class TransferData {
5571
    /**
5572
     * The amount that will be transferred automatically when the invoice is paid. If no amount is
5573
     * set, the full amount is transferred.
5574
     */
5575
    @SerializedName("amount")
5576
    Long amount;
5577

5578
    /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5579
    @SerializedName("destination")
5580
    String destination;
5581

5582
    /**
5583
     * Map of extra parameters for custom features not available in this client library. The content
5584
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5585
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5586
     * param object. Effectively, this map is flattened to its parent instance.
5587
     */
5588
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5589
    Map<String, Object> extraParams;
5590

5591
    private TransferData(Long amount, String destination, Map<String, Object> extraParams) {
×
5592
      this.amount = amount;
×
5593
      this.destination = destination;
×
5594
      this.extraParams = extraParams;
×
5595
    }
×
5596

5597
    public static Builder builder() {
5598
      return new Builder();
×
5599
    }
5600

5601
    public static class Builder {
×
5602
      private Long amount;
5603

5604
      private String destination;
5605

5606
      private Map<String, Object> extraParams;
5607

5608
      /** Finalize and obtain parameter instance from this builder. */
5609
      public InvoiceCreateParams.TransferData build() {
5610
        return new InvoiceCreateParams.TransferData(
×
5611
            this.amount, this.destination, this.extraParams);
5612
      }
5613

5614
      /**
5615
       * The amount that will be transferred automatically when the invoice is paid. If no amount is
5616
       * set, the full amount is transferred.
5617
       */
5618
      public Builder setAmount(Long amount) {
5619
        this.amount = amount;
×
5620
        return this;
×
5621
      }
5622

5623
      /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5624
      public Builder setDestination(String destination) {
5625
        this.destination = destination;
×
5626
        return this;
×
5627
      }
5628

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

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

5657
  public enum CollectionMethod implements ApiRequestParams.EnumParam {
×
5658
    @SerializedName("charge_automatically")
×
5659
    CHARGE_AUTOMATICALLY("charge_automatically"),
5660

5661
    @SerializedName("send_invoice")
×
5662
    SEND_INVOICE("send_invoice");
5663

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

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

5672
  public enum PendingInvoiceItemsBehavior implements ApiRequestParams.EnumParam {
×
5673
    @SerializedName("exclude")
×
5674
    EXCLUDE("exclude"),
5675

5676
    @SerializedName("include")
×
5677
    INCLUDE("include");
5678

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

5682
    PendingInvoiceItemsBehavior(String value) {
×
5683
      this.value = value;
×
5684
    }
×
5685
  }
5686
}
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