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

stripe / stripe-java / #16599

29 Oct 2024 11:04PM UTC coverage: 12.519% (-0.1%) from 12.62%
#16599

push

github

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

Update generated code for beta

40 of 1580 new or added lines in 51 files covered. (2.53%)

19 existing lines in 15 files now uncovered.

18843 of 150513 relevant lines covered (12.52%)

0.13 hits per line

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

4.43
/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
   * The time when this invoice should be scheduled to finalize. The invoice will be finalized at
51
   * this time if it is still in draft state.
52
   */
53
  @SerializedName("automatically_finalizes_at")
54
  Long automaticallyFinalizesAt;
55

56
  /**
57
   * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
58
   * Stripe will attempt to pay this invoice using the default source attached to the customer. When
59
   * sending an invoice, Stripe will email this invoice to the customer with payment instructions.
60
   * Defaults to {@code charge_automatically}.
61
   */
62
  @SerializedName("collection_method")
63
  CollectionMethod collectionMethod;
64

65
  /**
66
   * The currency to create this invoice in. Defaults to that of {@code customer} if not specified.
67
   */
68
  @SerializedName("currency")
69
  String currency;
70

71
  /** A list of up to 4 custom fields to be displayed on the invoice. */
72
  @SerializedName("custom_fields")
73
  Object customFields;
74

75
  /** The ID of the customer who will be billed. */
76
  @SerializedName("customer")
77
  String customer;
78

79
  /**
80
   * The number of days from when the invoice is created until it is due. Valid only for invoices
81
   * where {@code collection_method=send_invoice}.
82
   */
83
  @SerializedName("days_until_due")
84
  Long daysUntilDue;
85

86
  /**
87
   * The ids of the margins to apply to the invoice. Can be overridden by line item {@code margins}.
88
   */
89
  @SerializedName("default_margins")
90
  List<String> defaultMargins;
91

92
  /**
93
   * ID of the default payment method for the invoice. It must belong to the customer associated
94
   * with the invoice. If not set, defaults to the subscription's default payment method, if any, or
95
   * to the default payment method in the customer's invoice settings.
96
   */
97
  @SerializedName("default_payment_method")
98
  String defaultPaymentMethod;
99

100
  /**
101
   * ID of the default payment source for the invoice. It must belong to the customer associated
102
   * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
103
   * default source, if any, or to the customer's default source.
104
   */
105
  @SerializedName("default_source")
106
  String defaultSource;
107

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

112
  /**
113
   * An arbitrary string attached to the object. Often useful for displaying to users. Referenced as
114
   * 'memo' in the Dashboard.
115
   */
116
  @SerializedName("description")
117
  String description;
118

119
  /**
120
   * The coupons and promotion codes to redeem into discounts for the invoice. If not specified,
121
   * inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any
122
   * discounts.
123
   */
124
  @SerializedName("discounts")
125
  Object discounts;
126

127
  /**
128
   * The date on which payment for this invoice is due. Valid only for invoices where {@code
129
   * collection_method=send_invoice}.
130
   */
131
  @SerializedName("due_date")
132
  Long dueDate;
133

134
  /**
135
   * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten. When
136
   * defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF
137
   * and receipt.
138
   */
139
  @SerializedName("effective_at")
140
  Long effectiveAt;
141

142
  /** Specifies which fields in the response should be expanded. */
143
  @SerializedName("expand")
144
  List<String> expand;
145

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

155
  /** Footer to be displayed on the invoice. */
156
  @SerializedName("footer")
157
  String footer;
158

159
  /**
160
   * Revise an existing invoice. The new invoice will be created in {@code status=draft}. See the <a
161
   * href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more
162
   * details.
163
   */
164
  @SerializedName("from_invoice")
165
  FromInvoice fromInvoice;
166

167
  /**
168
   * The connected account that issues the invoice. The invoice is presented with the branding and
169
   * support information of the specified account.
170
   */
171
  @SerializedName("issuer")
172
  Issuer issuer;
173

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

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

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

203
  /**
204
   * Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
205
   */
206
  @SerializedName("payment_settings")
207
  PaymentSettings paymentSettings;
208

209
  /**
210
   * How to handle pending invoice items on invoice creation. Defaults to {@code exclude} if the
211
   * parameter is omitted.
212
   */
213
  @SerializedName("pending_invoice_items_behavior")
214
  PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior;
215

216
  /**
217
   * The rendering-related settings that control how the invoice is displayed on customer-facing
218
   * surfaces such as PDF and Hosted Invoice Page.
219
   */
220
  @SerializedName("rendering")
221
  Rendering rendering;
222

223
  /** Settings for the cost of shipping for this invoice. */
224
  @SerializedName("shipping_cost")
225
  ShippingCost shippingCost;
226

227
  /**
228
   * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
229
   * if it is set, otherwise the PDF will render the shipping address from the customer.
230
   */
231
  @SerializedName("shipping_details")
232
  ShippingDetails shippingDetails;
233

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

243
  /**
244
   * The ID of the subscription to invoice, if any. If set, the created invoice will only include
245
   * pending invoice items for that subscription. The subscription's billing cycle and regular
246
   * subscription events won't be affected.
247
   */
248
  @SerializedName("subscription")
249
  String subscription;
250

251
  /**
252
   * If specified, the funds from the invoice will be transferred to the destination and the ID of
253
   * the resulting transfer will be found on the invoice's charge.
254
   */
255
  @SerializedName("transfer_data")
256
  TransferData transferData;
257

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

331
  public static Builder builder() {
332
    return new Builder();
1✔
333
  }
334

335
  public static class Builder {
1✔
336
    private Object accountTaxIds;
337

338
    private Object amountsDue;
339

340
    private Long applicationFeeAmount;
341

342
    private Boolean autoAdvance;
343

344
    private AutomaticTax automaticTax;
345

346
    private Long automaticallyFinalizesAt;
347

348
    private CollectionMethod collectionMethod;
349

350
    private String currency;
351

352
    private Object customFields;
353

354
    private String customer;
355

356
    private Long daysUntilDue;
357

358
    private List<String> defaultMargins;
359

360
    private String defaultPaymentMethod;
361

362
    private String defaultSource;
363

364
    private List<String> defaultTaxRates;
365

366
    private String description;
367

368
    private Object discounts;
369

370
    private Long dueDate;
371

372
    private Long effectiveAt;
373

374
    private List<String> expand;
375

376
    private Map<String, Object> extraParams;
377

378
    private String footer;
379

380
    private FromInvoice fromInvoice;
381

382
    private Issuer issuer;
383

384
    private Object metadata;
385

386
    private String number;
387

388
    private String onBehalfOf;
389

390
    private PaymentSettings paymentSettings;
391

392
    private PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior;
393

394
    private Rendering rendering;
395

396
    private ShippingCost shippingCost;
397

398
    private ShippingDetails shippingDetails;
399

400
    private String statementDescriptor;
401

402
    private String subscription;
403

404
    private TransferData transferData;
405

406
    /** Finalize and obtain parameter instance from this builder. */
407
    public InvoiceCreateParams build() {
408
      return new InvoiceCreateParams(
1✔
409
          this.accountTaxIds,
410
          this.amountsDue,
411
          this.applicationFeeAmount,
412
          this.autoAdvance,
413
          this.automaticTax,
414
          this.automaticallyFinalizesAt,
415
          this.collectionMethod,
416
          this.currency,
417
          this.customFields,
418
          this.customer,
419
          this.daysUntilDue,
420
          this.defaultMargins,
421
          this.defaultPaymentMethod,
422
          this.defaultSource,
423
          this.defaultTaxRates,
424
          this.description,
425
          this.discounts,
426
          this.dueDate,
427
          this.effectiveAt,
428
          this.expand,
429
          this.extraParams,
430
          this.footer,
431
          this.fromInvoice,
432
          this.issuer,
433
          this.metadata,
434
          this.number,
435
          this.onBehalfOf,
436
          this.paymentSettings,
437
          this.pendingInvoiceItemsBehavior,
438
          this.rendering,
439
          this.shippingCost,
440
          this.shippingDetails,
441
          this.statementDescriptor,
442
          this.subscription,
443
          this.transferData);
444
    }
445

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

460
    /**
461
     * Add all elements to `accountTaxIds` list. A list is initialized for the first `add/addAll`
462
     * call, and subsequent calls adds additional elements to the original list. See {@link
463
     * InvoiceCreateParams#accountTaxIds} for the field documentation.
464
     */
465
    @SuppressWarnings("unchecked")
466
    public Builder addAllAccountTaxId(List<String> elements) {
467
      if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
468
        this.accountTaxIds = new ArrayList<String>();
×
469
      }
470
      ((List<String>) this.accountTaxIds).addAll(elements);
×
471
      return this;
×
472
    }
473

474
    /**
475
     * The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
476
     */
477
    public Builder setAccountTaxIds(EmptyParam accountTaxIds) {
478
      this.accountTaxIds = accountTaxIds;
×
479
      return this;
×
480
    }
481

482
    /**
483
     * The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
484
     */
485
    public Builder setAccountTaxIds(List<String> accountTaxIds) {
486
      this.accountTaxIds = accountTaxIds;
×
487
      return this;
×
488
    }
489

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

504
    /**
505
     * Add all elements to `amountsDue` list. A list is initialized for the first `add/addAll` call,
506
     * and subsequent calls adds additional elements to the original list. See {@link
507
     * InvoiceCreateParams#amountsDue} for the field documentation.
508
     */
509
    @SuppressWarnings("unchecked")
510
    public Builder addAllAmountsDue(List<InvoiceCreateParams.AmountsDue> elements) {
511
      if (this.amountsDue == null || this.amountsDue instanceof EmptyParam) {
×
512
        this.amountsDue = new ArrayList<InvoiceCreateParams.AmountsDue>();
×
513
      }
514
      ((List<InvoiceCreateParams.AmountsDue>) this.amountsDue).addAll(elements);
×
515
      return this;
×
516
    }
517

518
    /**
519
     * List of expected payments and corresponding due dates. Valid only for invoices where {@code
520
     * collection_method=send_invoice}.
521
     */
522
    public Builder setAmountsDue(EmptyParam amountsDue) {
523
      this.amountsDue = amountsDue;
×
524
      return this;
×
525
    }
526

527
    /**
528
     * List of expected payments and corresponding due dates. Valid only for invoices where {@code
529
     * collection_method=send_invoice}.
530
     */
531
    public Builder setAmountsDue(List<InvoiceCreateParams.AmountsDue> amountsDue) {
532
      this.amountsDue = amountsDue;
×
533
      return this;
×
534
    }
535

536
    /**
537
     * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to
538
     * the application owner's Stripe account. The request must be made with an OAuth key or the
539
     * Stripe-Account header in order to take an application fee. For more information, see the
540
     * application fees <a
541
     * href="https://stripe.com/docs/billing/invoices/connect#collecting-fees">documentation</a>.
542
     */
543
    public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
544
      this.applicationFeeAmount = applicationFeeAmount;
×
545
      return this;
×
546
    }
547

548
    /**
549
     * Controls whether Stripe performs <a
550
     * href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">automatic
551
     * collection</a> of the invoice. If {@code false}, the invoice's state doesn't automatically
552
     * advance without an explicit action.
553
     */
554
    public Builder setAutoAdvance(Boolean autoAdvance) {
555
      this.autoAdvance = autoAdvance;
×
556
      return this;
×
557
    }
558

559
    /** Settings for automatic tax lookup for this invoice. */
560
    public Builder setAutomaticTax(InvoiceCreateParams.AutomaticTax automaticTax) {
561
      this.automaticTax = automaticTax;
×
562
      return this;
×
563
    }
564

565
    /**
566
     * The time when this invoice should be scheduled to finalize. The invoice will be finalized at
567
     * this time if it is still in draft state.
568
     */
569
    public Builder setAutomaticallyFinalizesAt(Long automaticallyFinalizesAt) {
NEW
570
      this.automaticallyFinalizesAt = automaticallyFinalizesAt;
×
NEW
571
      return this;
×
572
    }
573

574
    /**
575
     * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
576
     * Stripe will attempt to pay this invoice using the default source attached to the customer.
577
     * When sending an invoice, Stripe will email this invoice to the customer with payment
578
     * instructions. Defaults to {@code charge_automatically}.
579
     */
580
    public Builder setCollectionMethod(InvoiceCreateParams.CollectionMethod collectionMethod) {
581
      this.collectionMethod = collectionMethod;
×
582
      return this;
×
583
    }
584

585
    /**
586
     * The currency to create this invoice in. Defaults to that of {@code customer} if not
587
     * specified.
588
     */
589
    public Builder setCurrency(String currency) {
590
      this.currency = currency;
×
591
      return this;
×
592
    }
593

594
    /**
595
     * Add an element to `customFields` list. A list is initialized for the first `add/addAll` call,
596
     * and subsequent calls adds additional elements to the original list. See {@link
597
     * InvoiceCreateParams#customFields} for the field documentation.
598
     */
599
    @SuppressWarnings("unchecked")
600
    public Builder addCustomField(InvoiceCreateParams.CustomField element) {
601
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
602
        this.customFields = new ArrayList<InvoiceCreateParams.CustomField>();
×
603
      }
604
      ((List<InvoiceCreateParams.CustomField>) this.customFields).add(element);
×
605
      return this;
×
606
    }
607

608
    /**
609
     * Add all elements to `customFields` list. A list is initialized for the first `add/addAll`
610
     * call, and subsequent calls adds additional elements to the original list. See {@link
611
     * InvoiceCreateParams#customFields} for the field documentation.
612
     */
613
    @SuppressWarnings("unchecked")
614
    public Builder addAllCustomField(List<InvoiceCreateParams.CustomField> elements) {
615
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
616
        this.customFields = new ArrayList<InvoiceCreateParams.CustomField>();
×
617
      }
618
      ((List<InvoiceCreateParams.CustomField>) this.customFields).addAll(elements);
×
619
      return this;
×
620
    }
621

622
    /** A list of up to 4 custom fields to be displayed on the invoice. */
623
    public Builder setCustomFields(EmptyParam customFields) {
624
      this.customFields = customFields;
×
625
      return this;
×
626
    }
627

628
    /** A list of up to 4 custom fields to be displayed on the invoice. */
629
    public Builder setCustomFields(List<InvoiceCreateParams.CustomField> customFields) {
630
      this.customFields = customFields;
1✔
631
      return this;
1✔
632
    }
633

634
    /** The ID of the customer who will be billed. */
635
    public Builder setCustomer(String customer) {
636
      this.customer = customer;
1✔
637
      return this;
1✔
638
    }
639

640
    /**
641
     * The number of days from when the invoice is created until it is due. Valid only for invoices
642
     * where {@code collection_method=send_invoice}.
643
     */
644
    public Builder setDaysUntilDue(Long daysUntilDue) {
645
      this.daysUntilDue = daysUntilDue;
×
646
      return this;
×
647
    }
648

649
    /**
650
     * Add an element to `defaultMargins` list. A list is initialized for the first `add/addAll`
651
     * call, and subsequent calls adds additional elements to the original list. See {@link
652
     * InvoiceCreateParams#defaultMargins} for the field documentation.
653
     */
654
    public Builder addDefaultMargin(String element) {
655
      if (this.defaultMargins == null) {
×
656
        this.defaultMargins = new ArrayList<>();
×
657
      }
658
      this.defaultMargins.add(element);
×
659
      return this;
×
660
    }
661

662
    /**
663
     * Add all elements to `defaultMargins` list. A list is initialized for the first `add/addAll`
664
     * call, and subsequent calls adds additional elements to the original list. See {@link
665
     * InvoiceCreateParams#defaultMargins} for the field documentation.
666
     */
667
    public Builder addAllDefaultMargin(List<String> elements) {
668
      if (this.defaultMargins == null) {
×
669
        this.defaultMargins = new ArrayList<>();
×
670
      }
671
      this.defaultMargins.addAll(elements);
×
672
      return this;
×
673
    }
674

675
    /**
676
     * ID of the default payment method for the invoice. It must belong to the customer associated
677
     * with the invoice. If not set, defaults to the subscription's default payment method, if any,
678
     * or to the default payment method in the customer's invoice settings.
679
     */
680
    public Builder setDefaultPaymentMethod(String defaultPaymentMethod) {
681
      this.defaultPaymentMethod = defaultPaymentMethod;
×
682
      return this;
×
683
    }
684

685
    /**
686
     * ID of the default payment source for the invoice. It must belong to the customer associated
687
     * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
688
     * default source, if any, or to the customer's default source.
689
     */
690
    public Builder setDefaultSource(String defaultSource) {
691
      this.defaultSource = defaultSource;
×
692
      return this;
×
693
    }
694

695
    /**
696
     * Add an element to `defaultTaxRates` list. A list is initialized for the first `add/addAll`
697
     * call, and subsequent calls adds additional elements to the original list. See {@link
698
     * InvoiceCreateParams#defaultTaxRates} for the field documentation.
699
     */
700
    public Builder addDefaultTaxRate(String element) {
701
      if (this.defaultTaxRates == null) {
×
702
        this.defaultTaxRates = new ArrayList<>();
×
703
      }
704
      this.defaultTaxRates.add(element);
×
705
      return this;
×
706
    }
707

708
    /**
709
     * Add all elements to `defaultTaxRates` list. A list is initialized for the first `add/addAll`
710
     * call, and subsequent calls adds additional elements to the original list. See {@link
711
     * InvoiceCreateParams#defaultTaxRates} for the field documentation.
712
     */
713
    public Builder addAllDefaultTaxRate(List<String> elements) {
714
      if (this.defaultTaxRates == null) {
×
715
        this.defaultTaxRates = new ArrayList<>();
×
716
      }
717
      this.defaultTaxRates.addAll(elements);
×
718
      return this;
×
719
    }
720

721
    /**
722
     * An arbitrary string attached to the object. Often useful for displaying to users. Referenced
723
     * as 'memo' in the Dashboard.
724
     */
725
    public Builder setDescription(String description) {
726
      this.description = description;
×
727
      return this;
×
728
    }
729

730
    /**
731
     * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call,
732
     * and subsequent calls adds additional elements to the original list. See {@link
733
     * InvoiceCreateParams#discounts} for the field documentation.
734
     */
735
    @SuppressWarnings("unchecked")
736
    public Builder addDiscount(InvoiceCreateParams.Discount element) {
737
      if (this.discounts == null || this.discounts instanceof EmptyParam) {
×
738
        this.discounts = new ArrayList<InvoiceCreateParams.Discount>();
×
739
      }
740
      ((List<InvoiceCreateParams.Discount>) this.discounts).add(element);
×
741
      return this;
×
742
    }
743

744
    /**
745
     * Add all elements to `discounts` list. A list is initialized for the first `add/addAll` call,
746
     * and subsequent calls adds additional elements to the original list. See {@link
747
     * InvoiceCreateParams#discounts} for the field documentation.
748
     */
749
    @SuppressWarnings("unchecked")
750
    public Builder addAllDiscount(List<InvoiceCreateParams.Discount> elements) {
751
      if (this.discounts == null || this.discounts instanceof EmptyParam) {
×
752
        this.discounts = new ArrayList<InvoiceCreateParams.Discount>();
×
753
      }
754
      ((List<InvoiceCreateParams.Discount>) this.discounts).addAll(elements);
×
755
      return this;
×
756
    }
757

758
    /**
759
     * The coupons and promotion codes to redeem into discounts for the invoice. If not specified,
760
     * inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting
761
     * any discounts.
762
     */
763
    public Builder setDiscounts(EmptyParam discounts) {
764
      this.discounts = discounts;
×
765
      return this;
×
766
    }
767

768
    /**
769
     * The coupons and promotion codes to redeem into discounts for the invoice. If not specified,
770
     * inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting
771
     * any discounts.
772
     */
773
    public Builder setDiscounts(List<InvoiceCreateParams.Discount> discounts) {
774
      this.discounts = discounts;
×
775
      return this;
×
776
    }
777

778
    /**
779
     * The date on which payment for this invoice is due. Valid only for invoices where {@code
780
     * collection_method=send_invoice}.
781
     */
782
    public Builder setDueDate(Long dueDate) {
783
      this.dueDate = dueDate;
×
784
      return this;
×
785
    }
786

787
    /**
788
     * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten.
789
     * When defined, this value replaces the system-generated 'Date of issue' printed on the invoice
790
     * PDF and receipt.
791
     */
792
    public Builder setEffectiveAt(Long effectiveAt) {
793
      this.effectiveAt = effectiveAt;
×
794
      return this;
×
795
    }
796

797
    /**
798
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
799
     * subsequent calls adds additional elements to the original list. See {@link
800
     * InvoiceCreateParams#expand} for the field documentation.
801
     */
802
    public Builder addExpand(String element) {
803
      if (this.expand == null) {
×
804
        this.expand = new ArrayList<>();
×
805
      }
806
      this.expand.add(element);
×
807
      return this;
×
808
    }
809

810
    /**
811
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
812
     * subsequent calls adds additional elements to the original list. See {@link
813
     * InvoiceCreateParams#expand} for the field documentation.
814
     */
815
    public Builder addAllExpand(List<String> elements) {
816
      if (this.expand == null) {
×
817
        this.expand = new ArrayList<>();
×
818
      }
819
      this.expand.addAll(elements);
×
820
      return this;
×
821
    }
822

823
    /**
824
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
825
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
826
     * InvoiceCreateParams#extraParams} for the field documentation.
827
     */
828
    public Builder putExtraParam(String key, Object value) {
829
      if (this.extraParams == null) {
×
830
        this.extraParams = new HashMap<>();
×
831
      }
832
      this.extraParams.put(key, value);
×
833
      return this;
×
834
    }
835

836
    /**
837
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
838
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
839
     * See {@link InvoiceCreateParams#extraParams} for the field documentation.
840
     */
841
    public Builder putAllExtraParam(Map<String, Object> map) {
842
      if (this.extraParams == null) {
×
843
        this.extraParams = new HashMap<>();
×
844
      }
845
      this.extraParams.putAll(map);
×
846
      return this;
×
847
    }
848

849
    /** Footer to be displayed on the invoice. */
850
    public Builder setFooter(String footer) {
851
      this.footer = footer;
×
852
      return this;
×
853
    }
854

855
    /**
856
     * Revise an existing invoice. The new invoice will be created in {@code status=draft}. See the
857
     * <a href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for
858
     * more details.
859
     */
860
    public Builder setFromInvoice(InvoiceCreateParams.FromInvoice fromInvoice) {
861
      this.fromInvoice = fromInvoice;
×
862
      return this;
×
863
    }
864

865
    /**
866
     * The connected account that issues the invoice. The invoice is presented with the branding and
867
     * support information of the specified account.
868
     */
869
    public Builder setIssuer(InvoiceCreateParams.Issuer issuer) {
870
      this.issuer = issuer;
×
871
      return this;
×
872
    }
873

874
    /**
875
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
876
     * and subsequent calls add additional key/value pairs to the original map. See {@link
877
     * InvoiceCreateParams#metadata} for the field documentation.
878
     */
879
    @SuppressWarnings("unchecked")
880
    public Builder putMetadata(String key, String value) {
881
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
882
        this.metadata = new HashMap<String, String>();
×
883
      }
884
      ((Map<String, String>) this.metadata).put(key, value);
×
885
      return this;
×
886
    }
887

888
    /**
889
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
890
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
891
     * See {@link InvoiceCreateParams#metadata} for the field documentation.
892
     */
893
    @SuppressWarnings("unchecked")
894
    public Builder putAllMetadata(Map<String, String> map) {
895
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
896
        this.metadata = new HashMap<String, String>();
×
897
      }
898
      ((Map<String, String>) this.metadata).putAll(map);
×
899
      return this;
×
900
    }
901

902
    /**
903
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
904
     * to an object. This can be useful for storing additional information about the object in a
905
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
906
     * can be unset by posting an empty value to {@code metadata}.
907
     */
908
    public Builder setMetadata(EmptyParam metadata) {
909
      this.metadata = metadata;
×
910
      return this;
×
911
    }
912

913
    /**
914
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
915
     * to an object. This can be useful for storing additional information about the object in a
916
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
917
     * can be unset by posting an empty value to {@code metadata}.
918
     */
919
    public Builder setMetadata(Map<String, String> metadata) {
920
      this.metadata = metadata;
×
921
      return this;
×
922
    }
923

924
    /**
925
     * Set the number for this invoice. If no number is present then a number will be assigned
926
     * automatically when the invoice is finalized. In many markets, regulations require invoices to
927
     * be unique, sequential and / or gapless. You are responsible for ensuring this is true across
928
     * all your different invoicing systems in the event that you edit the invoice number using our
929
     * API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe
930
     * handles this aspect of compliance for you automatically.
931
     */
932
    public Builder setNumber(String number) {
933
      this.number = number;
×
934
      return this;
×
935
    }
936

937
    /**
938
     * The account (if any) for which the funds of the invoice payment are intended. If set, the
939
     * invoice will be presented with the branding and support information of the specified account.
940
     * See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a>
941
     * documentation for details.
942
     */
943
    public Builder setOnBehalfOf(String onBehalfOf) {
944
      this.onBehalfOf = onBehalfOf;
×
945
      return this;
×
946
    }
947

948
    /**
949
     * Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
950
     */
951
    public Builder setPaymentSettings(InvoiceCreateParams.PaymentSettings paymentSettings) {
952
      this.paymentSettings = paymentSettings;
×
953
      return this;
×
954
    }
955

956
    /**
957
     * How to handle pending invoice items on invoice creation. Defaults to {@code exclude} if the
958
     * parameter is omitted.
959
     */
960
    public Builder setPendingInvoiceItemsBehavior(
961
        InvoiceCreateParams.PendingInvoiceItemsBehavior pendingInvoiceItemsBehavior) {
962
      this.pendingInvoiceItemsBehavior = pendingInvoiceItemsBehavior;
×
963
      return this;
×
964
    }
965

966
    /**
967
     * The rendering-related settings that control how the invoice is displayed on customer-facing
968
     * surfaces such as PDF and Hosted Invoice Page.
969
     */
970
    public Builder setRendering(InvoiceCreateParams.Rendering rendering) {
971
      this.rendering = rendering;
×
972
      return this;
×
973
    }
974

975
    /** Settings for the cost of shipping for this invoice. */
976
    public Builder setShippingCost(InvoiceCreateParams.ShippingCost shippingCost) {
977
      this.shippingCost = shippingCost;
×
978
      return this;
×
979
    }
980

981
    /**
982
     * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
983
     * if it is set, otherwise the PDF will render the shipping address from the customer.
984
     */
985
    public Builder setShippingDetails(InvoiceCreateParams.ShippingDetails shippingDetails) {
986
      this.shippingDetails = shippingDetails;
×
987
      return this;
×
988
    }
989

990
    /**
991
     * Extra information about a charge for the customer's credit card statement. It must contain at
992
     * least one letter. If not specified and this invoice is part of a subscription, the default
993
     * {@code statement_descriptor} will be set to the first subscription item's product's {@code
994
     * statement_descriptor}.
995
     */
996
    public Builder setStatementDescriptor(String statementDescriptor) {
997
      this.statementDescriptor = statementDescriptor;
×
998
      return this;
×
999
    }
1000

1001
    /**
1002
     * The ID of the subscription to invoice, if any. If set, the created invoice will only include
1003
     * pending invoice items for that subscription. The subscription's billing cycle and regular
1004
     * subscription events won't be affected.
1005
     */
1006
    public Builder setSubscription(String subscription) {
1007
      this.subscription = subscription;
×
1008
      return this;
×
1009
    }
1010

1011
    /**
1012
     * If specified, the funds from the invoice will be transferred to the destination and the ID of
1013
     * the resulting transfer will be found on the invoice's charge.
1014
     */
1015
    public Builder setTransferData(InvoiceCreateParams.TransferData transferData) {
1016
      this.transferData = transferData;
×
1017
      return this;
×
1018
    }
1019
  }
1020

1021
  @Getter
1022
  public static class AmountsDue {
1023
    /** <strong>Required.</strong> The amount in cents (or local equivalent). */
1024
    @SerializedName("amount")
1025
    Long amount;
1026

1027
    /** Number of days from when invoice is finalized until the payment is due. */
1028
    @SerializedName("days_until_due")
1029
    Long daysUntilDue;
1030

1031
    /**
1032
     * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1033
     * displaying to users.
1034
     */
1035
    @SerializedName("description")
1036
    String description;
1037

1038
    /** Date on which a payment plan’s payment is due. */
1039
    @SerializedName("due_date")
1040
    Long dueDate;
1041

1042
    /**
1043
     * Map of extra parameters for custom features not available in this client library. The content
1044
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1045
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1046
     * param object. Effectively, this map is flattened to its parent instance.
1047
     */
1048
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1049
    Map<String, Object> extraParams;
1050

1051
    private AmountsDue(
1052
        Long amount,
1053
        Long daysUntilDue,
1054
        String description,
1055
        Long dueDate,
1056
        Map<String, Object> extraParams) {
×
1057
      this.amount = amount;
×
1058
      this.daysUntilDue = daysUntilDue;
×
1059
      this.description = description;
×
1060
      this.dueDate = dueDate;
×
1061
      this.extraParams = extraParams;
×
1062
    }
×
1063

1064
    public static Builder builder() {
1065
      return new Builder();
×
1066
    }
1067

1068
    public static class Builder {
×
1069
      private Long amount;
1070

1071
      private Long daysUntilDue;
1072

1073
      private String description;
1074

1075
      private Long dueDate;
1076

1077
      private Map<String, Object> extraParams;
1078

1079
      /** Finalize and obtain parameter instance from this builder. */
1080
      public InvoiceCreateParams.AmountsDue build() {
1081
        return new InvoiceCreateParams.AmountsDue(
×
1082
            this.amount, this.daysUntilDue, this.description, this.dueDate, this.extraParams);
1083
      }
1084

1085
      /** <strong>Required.</strong> The amount in cents (or local equivalent). */
1086
      public Builder setAmount(Long amount) {
1087
        this.amount = amount;
×
1088
        return this;
×
1089
      }
1090

1091
      /** Number of days from when invoice is finalized until the payment is due. */
1092
      public Builder setDaysUntilDue(Long daysUntilDue) {
1093
        this.daysUntilDue = daysUntilDue;
×
1094
        return this;
×
1095
      }
1096

1097
      /**
1098
       * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1099
       * displaying to users.
1100
       */
1101
      public Builder setDescription(String description) {
1102
        this.description = description;
×
1103
        return this;
×
1104
      }
1105

1106
      /** Date on which a payment plan’s payment is due. */
1107
      public Builder setDueDate(Long dueDate) {
1108
        this.dueDate = dueDate;
×
1109
        return this;
×
1110
      }
1111

1112
      /**
1113
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1114
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1115
       * InvoiceCreateParams.AmountsDue#extraParams} for the field documentation.
1116
       */
1117
      public Builder putExtraParam(String key, Object value) {
1118
        if (this.extraParams == null) {
×
1119
          this.extraParams = new HashMap<>();
×
1120
        }
1121
        this.extraParams.put(key, value);
×
1122
        return this;
×
1123
      }
1124

1125
      /**
1126
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1127
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1128
       * See {@link InvoiceCreateParams.AmountsDue#extraParams} for the field documentation.
1129
       */
1130
      public Builder putAllExtraParam(Map<String, Object> map) {
1131
        if (this.extraParams == null) {
×
1132
          this.extraParams = new HashMap<>();
×
1133
        }
1134
        this.extraParams.putAll(map);
×
1135
        return this;
×
1136
      }
1137
    }
1138
  }
1139

1140
  @Getter
1141
  public static class AutomaticTax {
1142
    /**
1143
     * <strong>Required.</strong> Whether Stripe automatically computes tax on this invoice. Note
1144
     * that incompatible invoice items (invoice items with manually specified <a
1145
     * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1146
     * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1147
     */
1148
    @SerializedName("enabled")
1149
    Boolean enabled;
1150

1151
    /**
1152
     * Map of extra parameters for custom features not available in this client library. The content
1153
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1154
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1155
     * param object. Effectively, this map is flattened to its parent instance.
1156
     */
1157
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1158
    Map<String, Object> extraParams;
1159

1160
    /**
1161
     * The account that's liable for tax. If set, the business address and tax registrations
1162
     * required to perform the tax calculation are loaded from this account. The tax transaction is
1163
     * returned in the report of the connected account.
1164
     */
1165
    @SerializedName("liability")
1166
    Liability liability;
1167

1168
    private AutomaticTax(Boolean enabled, Map<String, Object> extraParams, Liability liability) {
×
1169
      this.enabled = enabled;
×
1170
      this.extraParams = extraParams;
×
1171
      this.liability = liability;
×
1172
    }
×
1173

1174
    public static Builder builder() {
1175
      return new Builder();
×
1176
    }
1177

1178
    public static class Builder {
×
1179
      private Boolean enabled;
1180

1181
      private Map<String, Object> extraParams;
1182

1183
      private Liability liability;
1184

1185
      /** Finalize and obtain parameter instance from this builder. */
1186
      public InvoiceCreateParams.AutomaticTax build() {
1187
        return new InvoiceCreateParams.AutomaticTax(this.enabled, this.extraParams, this.liability);
×
1188
      }
1189

1190
      /**
1191
       * <strong>Required.</strong> Whether Stripe automatically computes tax on this invoice. Note
1192
       * that incompatible invoice items (invoice items with manually specified <a
1193
       * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1194
       * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1195
       */
1196
      public Builder setEnabled(Boolean enabled) {
1197
        this.enabled = enabled;
×
1198
        return this;
×
1199
      }
1200

1201
      /**
1202
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1203
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1204
       * InvoiceCreateParams.AutomaticTax#extraParams} for the field documentation.
1205
       */
1206
      public Builder putExtraParam(String key, Object value) {
1207
        if (this.extraParams == null) {
×
1208
          this.extraParams = new HashMap<>();
×
1209
        }
1210
        this.extraParams.put(key, value);
×
1211
        return this;
×
1212
      }
1213

1214
      /**
1215
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1216
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1217
       * See {@link InvoiceCreateParams.AutomaticTax#extraParams} for the field documentation.
1218
       */
1219
      public Builder putAllExtraParam(Map<String, Object> map) {
1220
        if (this.extraParams == null) {
×
1221
          this.extraParams = new HashMap<>();
×
1222
        }
1223
        this.extraParams.putAll(map);
×
1224
        return this;
×
1225
      }
1226

1227
      /**
1228
       * The account that's liable for tax. If set, the business address and tax registrations
1229
       * required to perform the tax calculation are loaded from this account. The tax transaction
1230
       * is returned in the report of the connected account.
1231
       */
1232
      public Builder setLiability(InvoiceCreateParams.AutomaticTax.Liability liability) {
1233
        this.liability = liability;
×
1234
        return this;
×
1235
      }
1236
    }
1237

1238
    @Getter
1239
    public static class Liability {
1240
      /** The connected account being referenced when {@code type} is {@code account}. */
1241
      @SerializedName("account")
1242
      String account;
1243

1244
      /**
1245
       * Map of extra parameters for custom features not available in this client library. The
1246
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1247
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1248
       * name in this param object. Effectively, this map is flattened to its parent instance.
1249
       */
1250
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1251
      Map<String, Object> extraParams;
1252

1253
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1254
      @SerializedName("type")
1255
      Type type;
1256

1257
      private Liability(String account, Map<String, Object> extraParams, Type type) {
×
1258
        this.account = account;
×
1259
        this.extraParams = extraParams;
×
1260
        this.type = type;
×
1261
      }
×
1262

1263
      public static Builder builder() {
1264
        return new Builder();
×
1265
      }
1266

1267
      public static class Builder {
×
1268
        private String account;
1269

1270
        private Map<String, Object> extraParams;
1271

1272
        private Type type;
1273

1274
        /** Finalize and obtain parameter instance from this builder. */
1275
        public InvoiceCreateParams.AutomaticTax.Liability build() {
1276
          return new InvoiceCreateParams.AutomaticTax.Liability(
×
1277
              this.account, this.extraParams, this.type);
1278
        }
1279

1280
        /** The connected account being referenced when {@code type} is {@code account}. */
1281
        public Builder setAccount(String account) {
1282
          this.account = account;
×
1283
          return this;
×
1284
        }
1285

1286
        /**
1287
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1288
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1289
         * map. See {@link InvoiceCreateParams.AutomaticTax.Liability#extraParams} for the field
1290
         * documentation.
1291
         */
1292
        public Builder putExtraParam(String key, Object value) {
1293
          if (this.extraParams == null) {
×
1294
            this.extraParams = new HashMap<>();
×
1295
          }
1296
          this.extraParams.put(key, value);
×
1297
          return this;
×
1298
        }
1299

1300
        /**
1301
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1302
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1303
         * map. See {@link InvoiceCreateParams.AutomaticTax.Liability#extraParams} for the field
1304
         * documentation.
1305
         */
1306
        public Builder putAllExtraParam(Map<String, Object> map) {
1307
          if (this.extraParams == null) {
×
1308
            this.extraParams = new HashMap<>();
×
1309
          }
1310
          this.extraParams.putAll(map);
×
1311
          return this;
×
1312
        }
1313

1314
        /** <strong>Required.</strong> Type of the account referenced in the request. */
1315
        public Builder setType(InvoiceCreateParams.AutomaticTax.Liability.Type type) {
1316
          this.type = type;
×
1317
          return this;
×
1318
        }
1319
      }
1320

1321
      public enum Type implements ApiRequestParams.EnumParam {
×
1322
        @SerializedName("account")
×
1323
        ACCOUNT("account"),
1324

1325
        @SerializedName("self")
×
1326
        SELF("self");
1327

1328
        @Getter(onMethod_ = {@Override})
1329
        private final String value;
1330

1331
        Type(String value) {
×
1332
          this.value = value;
×
1333
        }
×
1334
      }
1335
    }
1336
  }
1337

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

1349
    /** <strong>Required.</strong> The name of the custom field. This may be up to 40 characters. */
1350
    @SerializedName("name")
1351
    String name;
1352

1353
    /**
1354
     * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1355
     */
1356
    @SerializedName("value")
1357
    String value;
1358

1359
    private CustomField(Map<String, Object> extraParams, String name, String value) {
1✔
1360
      this.extraParams = extraParams;
1✔
1361
      this.name = name;
1✔
1362
      this.value = value;
1✔
1363
    }
1✔
1364

1365
    public static Builder builder() {
1366
      return new Builder();
1✔
1367
    }
1368

1369
    public static class Builder {
1✔
1370
      private Map<String, Object> extraParams;
1371

1372
      private String name;
1373

1374
      private String value;
1375

1376
      /** Finalize and obtain parameter instance from this builder. */
1377
      public InvoiceCreateParams.CustomField build() {
1378
        return new InvoiceCreateParams.CustomField(this.extraParams, this.name, this.value);
1✔
1379
      }
1380

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

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

1407
      /**
1408
       * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1409
       */
1410
      public Builder setName(String name) {
1411
        this.name = name;
1✔
1412
        return this;
1✔
1413
      }
1414

1415
      /**
1416
       * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1417
       */
1418
      public Builder setValue(String value) {
1419
        this.value = value;
1✔
1420
        return this;
1✔
1421
      }
1422
    }
1423
  }
1424

1425
  @Getter
1426
  public static class Discount {
1427
    /** ID of the coupon to create a new discount for. */
1428
    @SerializedName("coupon")
1429
    String coupon;
1430

1431
    /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1432
    @SerializedName("discount")
1433
    String discount;
1434

1435
    /** Details to determine how long the discount should be applied for. */
1436
    @SerializedName("discount_end")
1437
    DiscountEnd discountEnd;
1438

1439
    /**
1440
     * Map of extra parameters for custom features not available in this client library. The content
1441
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1442
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1443
     * param object. Effectively, this map is flattened to its parent instance.
1444
     */
1445
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1446
    Map<String, Object> extraParams;
1447

1448
    /** ID of the promotion code to create a new discount for. */
1449
    @SerializedName("promotion_code")
1450
    String promotionCode;
1451

1452
    private Discount(
1453
        String coupon,
1454
        String discount,
1455
        DiscountEnd discountEnd,
1456
        Map<String, Object> extraParams,
1457
        String promotionCode) {
×
1458
      this.coupon = coupon;
×
1459
      this.discount = discount;
×
1460
      this.discountEnd = discountEnd;
×
1461
      this.extraParams = extraParams;
×
1462
      this.promotionCode = promotionCode;
×
1463
    }
×
1464

1465
    public static Builder builder() {
1466
      return new Builder();
×
1467
    }
1468

1469
    public static class Builder {
×
1470
      private String coupon;
1471

1472
      private String discount;
1473

1474
      private DiscountEnd discountEnd;
1475

1476
      private Map<String, Object> extraParams;
1477

1478
      private String promotionCode;
1479

1480
      /** Finalize and obtain parameter instance from this builder. */
1481
      public InvoiceCreateParams.Discount build() {
1482
        return new InvoiceCreateParams.Discount(
×
1483
            this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode);
1484
      }
1485

1486
      /** ID of the coupon to create a new discount for. */
1487
      public Builder setCoupon(String coupon) {
1488
        this.coupon = coupon;
×
1489
        return this;
×
1490
      }
1491

1492
      /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1493
      public Builder setDiscount(String discount) {
1494
        this.discount = discount;
×
1495
        return this;
×
1496
      }
1497

1498
      /** Details to determine how long the discount should be applied for. */
1499
      public Builder setDiscountEnd(InvoiceCreateParams.Discount.DiscountEnd discountEnd) {
1500
        this.discountEnd = discountEnd;
×
1501
        return this;
×
1502
      }
1503

1504
      /**
1505
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1506
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1507
       * InvoiceCreateParams.Discount#extraParams} for the field documentation.
1508
       */
1509
      public Builder putExtraParam(String key, Object value) {
1510
        if (this.extraParams == null) {
×
1511
          this.extraParams = new HashMap<>();
×
1512
        }
1513
        this.extraParams.put(key, value);
×
1514
        return this;
×
1515
      }
1516

1517
      /**
1518
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1519
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1520
       * See {@link InvoiceCreateParams.Discount#extraParams} for the field documentation.
1521
       */
1522
      public Builder putAllExtraParam(Map<String, Object> map) {
1523
        if (this.extraParams == null) {
×
1524
          this.extraParams = new HashMap<>();
×
1525
        }
1526
        this.extraParams.putAll(map);
×
1527
        return this;
×
1528
      }
1529

1530
      /** ID of the promotion code to create a new discount for. */
1531
      public Builder setPromotionCode(String promotionCode) {
1532
        this.promotionCode = promotionCode;
×
1533
        return this;
×
1534
      }
1535
    }
1536

1537
    @Getter
1538
    public static class DiscountEnd {
1539
      /** Time span for the redeemed discount. */
1540
      @SerializedName("duration")
1541
      Duration duration;
1542

1543
      /**
1544
       * Map of extra parameters for custom features not available in this client library. The
1545
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1546
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1547
       * name in this param object. Effectively, this map is flattened to its parent instance.
1548
       */
1549
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1550
      Map<String, Object> extraParams;
1551

1552
      /** A precise Unix timestamp for the discount to end. Must be in the future. */
1553
      @SerializedName("timestamp")
1554
      Long timestamp;
1555

1556
      /**
1557
       * <strong>Required.</strong> The type of calculation made to determine when the discount
1558
       * ends.
1559
       */
1560
      @SerializedName("type")
1561
      Type type;
1562

1563
      private DiscountEnd(
1564
          Duration duration, Map<String, Object> extraParams, Long timestamp, Type type) {
×
1565
        this.duration = duration;
×
1566
        this.extraParams = extraParams;
×
1567
        this.timestamp = timestamp;
×
1568
        this.type = type;
×
1569
      }
×
1570

1571
      public static Builder builder() {
1572
        return new Builder();
×
1573
      }
1574

1575
      public static class Builder {
×
1576
        private Duration duration;
1577

1578
        private Map<String, Object> extraParams;
1579

1580
        private Long timestamp;
1581

1582
        private Type type;
1583

1584
        /** Finalize and obtain parameter instance from this builder. */
1585
        public InvoiceCreateParams.Discount.DiscountEnd build() {
1586
          return new InvoiceCreateParams.Discount.DiscountEnd(
×
1587
              this.duration, this.extraParams, this.timestamp, this.type);
1588
        }
1589

1590
        /** Time span for the redeemed discount. */
1591
        public Builder setDuration(InvoiceCreateParams.Discount.DiscountEnd.Duration duration) {
1592
          this.duration = duration;
×
1593
          return this;
×
1594
        }
1595

1596
        /**
1597
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1598
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1599
         * map. See {@link InvoiceCreateParams.Discount.DiscountEnd#extraParams} for the field
1600
         * documentation.
1601
         */
1602
        public Builder putExtraParam(String key, Object value) {
1603
          if (this.extraParams == null) {
×
1604
            this.extraParams = new HashMap<>();
×
1605
          }
1606
          this.extraParams.put(key, value);
×
1607
          return this;
×
1608
        }
1609

1610
        /**
1611
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1612
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1613
         * map. See {@link InvoiceCreateParams.Discount.DiscountEnd#extraParams} for the field
1614
         * documentation.
1615
         */
1616
        public Builder putAllExtraParam(Map<String, Object> map) {
1617
          if (this.extraParams == null) {
×
1618
            this.extraParams = new HashMap<>();
×
1619
          }
1620
          this.extraParams.putAll(map);
×
1621
          return this;
×
1622
        }
1623

1624
        /** A precise Unix timestamp for the discount to end. Must be in the future. */
1625
        public Builder setTimestamp(Long timestamp) {
1626
          this.timestamp = timestamp;
×
1627
          return this;
×
1628
        }
1629

1630
        /**
1631
         * <strong>Required.</strong> The type of calculation made to determine when the discount
1632
         * ends.
1633
         */
1634
        public Builder setType(InvoiceCreateParams.Discount.DiscountEnd.Type type) {
1635
          this.type = type;
×
1636
          return this;
×
1637
        }
1638
      }
1639

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

1652
        /**
1653
         * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day}, {@code
1654
         * week}, {@code month} or {@code year}.
1655
         */
1656
        @SerializedName("interval")
1657
        Interval interval;
1658

1659
        /**
1660
         * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1661
         * Stripe multiplies this by the interval type to get the overall duration.
1662
         */
1663
        @SerializedName("interval_count")
1664
        Long intervalCount;
1665

1666
        private Duration(Map<String, Object> extraParams, Interval interval, Long intervalCount) {
×
1667
          this.extraParams = extraParams;
×
1668
          this.interval = interval;
×
1669
          this.intervalCount = intervalCount;
×
1670
        }
×
1671

1672
        public static Builder builder() {
1673
          return new Builder();
×
1674
        }
1675

1676
        public static class Builder {
×
1677
          private Map<String, Object> extraParams;
1678

1679
          private Interval interval;
1680

1681
          private Long intervalCount;
1682

1683
          /** Finalize and obtain parameter instance from this builder. */
1684
          public InvoiceCreateParams.Discount.DiscountEnd.Duration build() {
1685
            return new InvoiceCreateParams.Discount.DiscountEnd.Duration(
×
1686
                this.extraParams, this.interval, this.intervalCount);
1687
          }
1688

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

1703
          /**
1704
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1705
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1706
           * map. See {@link InvoiceCreateParams.Discount.DiscountEnd.Duration#extraParams} for the
1707
           * field documentation.
1708
           */
1709
          public Builder putAllExtraParam(Map<String, Object> map) {
1710
            if (this.extraParams == null) {
×
1711
              this.extraParams = new HashMap<>();
×
1712
            }
1713
            this.extraParams.putAll(map);
×
1714
            return this;
×
1715
          }
1716

1717
          /**
1718
           * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day},
1719
           * {@code week}, {@code month} or {@code year}.
1720
           */
1721
          public Builder setInterval(
1722
              InvoiceCreateParams.Discount.DiscountEnd.Duration.Interval interval) {
1723
            this.interval = interval;
×
1724
            return this;
×
1725
          }
1726

1727
          /**
1728
           * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1729
           * Stripe multiplies this by the interval type to get the overall duration.
1730
           */
1731
          public Builder setIntervalCount(Long intervalCount) {
1732
            this.intervalCount = intervalCount;
×
1733
            return this;
×
1734
          }
1735
        }
1736

1737
        public enum Interval implements ApiRequestParams.EnumParam {
×
1738
          @SerializedName("day")
×
1739
          DAY("day"),
1740

1741
          @SerializedName("month")
×
1742
          MONTH("month"),
1743

1744
          @SerializedName("week")
×
1745
          WEEK("week"),
1746

1747
          @SerializedName("year")
×
1748
          YEAR("year");
1749

1750
          @Getter(onMethod_ = {@Override})
1751
          private final String value;
1752

1753
          Interval(String value) {
×
1754
            this.value = value;
×
1755
          }
×
1756
        }
1757
      }
1758

1759
      public enum Type implements ApiRequestParams.EnumParam {
×
1760
        @SerializedName("duration")
×
1761
        DURATION("duration"),
1762

1763
        @SerializedName("timestamp")
×
1764
        TIMESTAMP("timestamp");
1765

1766
        @Getter(onMethod_ = {@Override})
1767
        private final String value;
1768

1769
        Type(String value) {
×
1770
          this.value = value;
×
1771
        }
×
1772
      }
1773
    }
1774
  }
1775

1776
  @Getter
1777
  public static class FromInvoice {
1778
    /**
1779
     * <strong>Required.</strong> The relation between the new invoice and the original invoice.
1780
     * Currently, only 'revision' is permitted
1781
     */
1782
    @SerializedName("action")
1783
    Action action;
1784

1785
    /**
1786
     * Map of extra parameters for custom features not available in this client library. The content
1787
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1788
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1789
     * param object. Effectively, this map is flattened to its parent instance.
1790
     */
1791
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1792
    Map<String, Object> extraParams;
1793

1794
    /** <strong>Required.</strong> The {@code id} of the invoice that will be cloned. */
1795
    @SerializedName("invoice")
1796
    String invoice;
1797

1798
    private FromInvoice(Action action, Map<String, Object> extraParams, String invoice) {
×
1799
      this.action = action;
×
1800
      this.extraParams = extraParams;
×
1801
      this.invoice = invoice;
×
1802
    }
×
1803

1804
    public static Builder builder() {
1805
      return new Builder();
×
1806
    }
1807

1808
    public static class Builder {
×
1809
      private Action action;
1810

1811
      private Map<String, Object> extraParams;
1812

1813
      private String invoice;
1814

1815
      /** Finalize and obtain parameter instance from this builder. */
1816
      public InvoiceCreateParams.FromInvoice build() {
1817
        return new InvoiceCreateParams.FromInvoice(this.action, this.extraParams, this.invoice);
×
1818
      }
1819

1820
      /**
1821
       * <strong>Required.</strong> The relation between the new invoice and the original invoice.
1822
       * Currently, only 'revision' is permitted
1823
       */
1824
      public Builder setAction(InvoiceCreateParams.FromInvoice.Action action) {
1825
        this.action = action;
×
1826
        return this;
×
1827
      }
1828

1829
      /**
1830
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1831
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1832
       * InvoiceCreateParams.FromInvoice#extraParams} for the field documentation.
1833
       */
1834
      public Builder putExtraParam(String key, Object value) {
1835
        if (this.extraParams == null) {
×
1836
          this.extraParams = new HashMap<>();
×
1837
        }
1838
        this.extraParams.put(key, value);
×
1839
        return this;
×
1840
      }
1841

1842
      /**
1843
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1844
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1845
       * See {@link InvoiceCreateParams.FromInvoice#extraParams} for the field documentation.
1846
       */
1847
      public Builder putAllExtraParam(Map<String, Object> map) {
1848
        if (this.extraParams == null) {
×
1849
          this.extraParams = new HashMap<>();
×
1850
        }
1851
        this.extraParams.putAll(map);
×
1852
        return this;
×
1853
      }
1854

1855
      /** <strong>Required.</strong> The {@code id} of the invoice that will be cloned. */
1856
      public Builder setInvoice(String invoice) {
1857
        this.invoice = invoice;
×
1858
        return this;
×
1859
      }
1860
    }
1861

1862
    public enum Action implements ApiRequestParams.EnumParam {
×
1863
      @SerializedName("revision")
×
1864
      REVISION("revision");
1865

1866
      @Getter(onMethod_ = {@Override})
1867
      private final String value;
1868

1869
      Action(String value) {
×
1870
        this.value = value;
×
1871
      }
×
1872
    }
1873
  }
1874

1875
  @Getter
1876
  public static class Issuer {
1877
    /** The connected account being referenced when {@code type} is {@code account}. */
1878
    @SerializedName("account")
1879
    String account;
1880

1881
    /**
1882
     * Map of extra parameters for custom features not available in this client library. The content
1883
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1884
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1885
     * param object. Effectively, this map is flattened to its parent instance.
1886
     */
1887
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1888
    Map<String, Object> extraParams;
1889

1890
    /** <strong>Required.</strong> Type of the account referenced in the request. */
1891
    @SerializedName("type")
1892
    Type type;
1893

1894
    private Issuer(String account, Map<String, Object> extraParams, Type type) {
×
1895
      this.account = account;
×
1896
      this.extraParams = extraParams;
×
1897
      this.type = type;
×
1898
    }
×
1899

1900
    public static Builder builder() {
1901
      return new Builder();
×
1902
    }
1903

1904
    public static class Builder {
×
1905
      private String account;
1906

1907
      private Map<String, Object> extraParams;
1908

1909
      private Type type;
1910

1911
      /** Finalize and obtain parameter instance from this builder. */
1912
      public InvoiceCreateParams.Issuer build() {
1913
        return new InvoiceCreateParams.Issuer(this.account, this.extraParams, this.type);
×
1914
      }
1915

1916
      /** The connected account being referenced when {@code type} is {@code account}. */
1917
      public Builder setAccount(String account) {
1918
        this.account = account;
×
1919
        return this;
×
1920
      }
1921

1922
      /**
1923
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1924
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1925
       * InvoiceCreateParams.Issuer#extraParams} for the field documentation.
1926
       */
1927
      public Builder putExtraParam(String key, Object value) {
1928
        if (this.extraParams == null) {
×
1929
          this.extraParams = new HashMap<>();
×
1930
        }
1931
        this.extraParams.put(key, value);
×
1932
        return this;
×
1933
      }
1934

1935
      /**
1936
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1937
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1938
       * See {@link InvoiceCreateParams.Issuer#extraParams} for the field documentation.
1939
       */
1940
      public Builder putAllExtraParam(Map<String, Object> map) {
1941
        if (this.extraParams == null) {
×
1942
          this.extraParams = new HashMap<>();
×
1943
        }
1944
        this.extraParams.putAll(map);
×
1945
        return this;
×
1946
      }
1947

1948
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1949
      public Builder setType(InvoiceCreateParams.Issuer.Type type) {
1950
        this.type = type;
×
1951
        return this;
×
1952
      }
1953
    }
1954

1955
    public enum Type implements ApiRequestParams.EnumParam {
×
1956
      @SerializedName("account")
×
1957
      ACCOUNT("account"),
1958

1959
      @SerializedName("self")
×
1960
      SELF("self");
1961

1962
      @Getter(onMethod_ = {@Override})
1963
      private final String value;
1964

1965
      Type(String value) {
×
1966
        this.value = value;
×
1967
      }
×
1968
    }
1969
  }
1970

1971
  @Getter
1972
  public static class PaymentSettings {
1973
    /**
1974
     * ID of the mandate to be used for this invoice. It must correspond to the payment method used
1975
     * to pay the invoice, including the invoice's default_payment_method or default_source, if set.
1976
     */
1977
    @SerializedName("default_mandate")
1978
    Object defaultMandate;
1979

1980
    /**
1981
     * Map of extra parameters for custom features not available in this client library. The content
1982
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1983
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1984
     * param object. Effectively, this map is flattened to its parent instance.
1985
     */
1986
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1987
    Map<String, Object> extraParams;
1988

1989
    /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
1990
    @SerializedName("payment_method_options")
1991
    PaymentMethodOptions paymentMethodOptions;
1992

1993
    /**
1994
     * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
1995
     * not set, Stripe attempts to automatically determine the types to use by looking at the
1996
     * invoice’s default payment method, the subscription’s default payment method, the customer’s
1997
     * default payment method, and your <a
1998
     * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
1999
     */
2000
    @SerializedName("payment_method_types")
2001
    Object paymentMethodTypes;
2002

2003
    private PaymentSettings(
2004
        Object defaultMandate,
2005
        Map<String, Object> extraParams,
2006
        PaymentMethodOptions paymentMethodOptions,
2007
        Object paymentMethodTypes) {
×
2008
      this.defaultMandate = defaultMandate;
×
2009
      this.extraParams = extraParams;
×
2010
      this.paymentMethodOptions = paymentMethodOptions;
×
2011
      this.paymentMethodTypes = paymentMethodTypes;
×
2012
    }
×
2013

2014
    public static Builder builder() {
2015
      return new Builder();
×
2016
    }
2017

2018
    public static class Builder {
×
2019
      private Object defaultMandate;
2020

2021
      private Map<String, Object> extraParams;
2022

2023
      private PaymentMethodOptions paymentMethodOptions;
2024

2025
      private Object paymentMethodTypes;
2026

2027
      /** Finalize and obtain parameter instance from this builder. */
2028
      public InvoiceCreateParams.PaymentSettings build() {
2029
        return new InvoiceCreateParams.PaymentSettings(
×
2030
            this.defaultMandate,
2031
            this.extraParams,
2032
            this.paymentMethodOptions,
2033
            this.paymentMethodTypes);
2034
      }
2035

2036
      /**
2037
       * ID of the mandate to be used for this invoice. It must correspond to the payment method
2038
       * used to pay the invoice, including the invoice's default_payment_method or default_source,
2039
       * if set.
2040
       */
2041
      public Builder setDefaultMandate(String defaultMandate) {
2042
        this.defaultMandate = defaultMandate;
×
2043
        return this;
×
2044
      }
2045

2046
      /**
2047
       * ID of the mandate to be used for this invoice. It must correspond to the payment method
2048
       * used to pay the invoice, including the invoice's default_payment_method or default_source,
2049
       * if set.
2050
       */
2051
      public Builder setDefaultMandate(EmptyParam defaultMandate) {
2052
        this.defaultMandate = defaultMandate;
×
2053
        return this;
×
2054
      }
2055

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

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

2082
      /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
2083
      public Builder setPaymentMethodOptions(
2084
          InvoiceCreateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) {
2085
        this.paymentMethodOptions = paymentMethodOptions;
×
2086
        return this;
×
2087
      }
2088

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

2106
      /**
2107
       * Add all elements to `paymentMethodTypes` list. A list is initialized for the first
2108
       * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
2109
       * {@link InvoiceCreateParams.PaymentSettings#paymentMethodTypes} for the field documentation.
2110
       */
2111
      @SuppressWarnings("unchecked")
2112
      public Builder addAllPaymentMethodType(
2113
          List<InvoiceCreateParams.PaymentSettings.PaymentMethodType> elements) {
2114
        if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) {
×
2115
          this.paymentMethodTypes =
×
2116
              new ArrayList<InvoiceCreateParams.PaymentSettings.PaymentMethodType>();
2117
        }
2118
        ((List<InvoiceCreateParams.PaymentSettings.PaymentMethodType>) this.paymentMethodTypes)
×
2119
            .addAll(elements);
×
2120
        return this;
×
2121
      }
2122

2123
      /**
2124
       * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
2125
       * not set, Stripe attempts to automatically determine the types to use by looking at the
2126
       * invoice’s default payment method, the subscription’s default payment method, the customer’s
2127
       * default payment method, and your <a
2128
       * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
2129
       */
2130
      public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) {
2131
        this.paymentMethodTypes = paymentMethodTypes;
×
2132
        return this;
×
2133
      }
2134

2135
      /**
2136
       * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
2137
       * not set, Stripe attempts to automatically determine the types to use by looking at the
2138
       * invoice’s default payment method, the subscription’s default payment method, the customer’s
2139
       * default payment method, and your <a
2140
       * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
2141
       */
2142
      public Builder setPaymentMethodTypes(
2143
          List<InvoiceCreateParams.PaymentSettings.PaymentMethodType> paymentMethodTypes) {
2144
        this.paymentMethodTypes = paymentMethodTypes;
×
2145
        return this;
×
2146
      }
2147
    }
2148

2149
    @Getter
2150
    public static class PaymentMethodOptions {
2151
      /**
2152
       * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2153
       * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2154
       */
2155
      @SerializedName("acss_debit")
2156
      Object acssDebit;
2157

2158
      /**
2159
       * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
2160
       * payment method options to pass to the invoice’s PaymentIntent.
2161
       */
2162
      @SerializedName("bancontact")
2163
      Object bancontact;
2164

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

2172
      /**
2173
       * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
2174
       * transfer payment method options to pass to the invoice’s PaymentIntent.
2175
       */
2176
      @SerializedName("customer_balance")
2177
      Object customerBalance;
2178

2179
      /**
2180
       * Map of extra parameters for custom features not available in this client library. The
2181
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2182
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2183
       * name in this param object. Effectively, this map is flattened to its parent instance.
2184
       */
2185
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2186
      Map<String, Object> extraParams;
2187

2188
      /**
2189
       * If paying by {@code id_bank_transfer}, this sub-hash contains details about the Indonesia
2190
       * bank transfer payment method options to pass to the invoice’s PaymentIntent.
2191
       */
2192
      @SerializedName("id_bank_transfer")
2193
      Object idBankTransfer;
2194

2195
      /**
2196
       * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2197
       * method options to pass to the invoice’s PaymentIntent.
2198
       */
2199
      @SerializedName("konbini")
2200
      Object konbini;
2201

2202
      /**
2203
       * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct Debit
2204
       * payment method options to pass to the invoice’s PaymentIntent.
2205
       */
2206
      @SerializedName("sepa_debit")
2207
      Object sepaDebit;
2208

2209
      /**
2210
       * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2211
       * debit payment method options to pass to the invoice’s PaymentIntent.
2212
       */
2213
      @SerializedName("us_bank_account")
2214
      Object usBankAccount;
2215

2216
      private PaymentMethodOptions(
2217
          Object acssDebit,
2218
          Object bancontact,
2219
          Object card,
2220
          Object customerBalance,
2221
          Map<String, Object> extraParams,
2222
          Object idBankTransfer,
2223
          Object konbini,
2224
          Object sepaDebit,
2225
          Object usBankAccount) {
×
2226
        this.acssDebit = acssDebit;
×
2227
        this.bancontact = bancontact;
×
2228
        this.card = card;
×
2229
        this.customerBalance = customerBalance;
×
2230
        this.extraParams = extraParams;
×
NEW
2231
        this.idBankTransfer = idBankTransfer;
×
2232
        this.konbini = konbini;
×
2233
        this.sepaDebit = sepaDebit;
×
2234
        this.usBankAccount = usBankAccount;
×
2235
      }
×
2236

2237
      public static Builder builder() {
2238
        return new Builder();
×
2239
      }
2240

2241
      public static class Builder {
×
2242
        private Object acssDebit;
2243

2244
        private Object bancontact;
2245

2246
        private Object card;
2247

2248
        private Object customerBalance;
2249

2250
        private Map<String, Object> extraParams;
2251

2252
        private Object idBankTransfer;
2253

2254
        private Object konbini;
2255

2256
        private Object sepaDebit;
2257

2258
        private Object usBankAccount;
2259

2260
        /** Finalize and obtain parameter instance from this builder. */
2261
        public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions build() {
2262
          return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions(
×
2263
              this.acssDebit,
2264
              this.bancontact,
2265
              this.card,
2266
              this.customerBalance,
2267
              this.extraParams,
2268
              this.idBankTransfer,
2269
              this.konbini,
2270
              this.sepaDebit,
2271
              this.usBankAccount);
2272
        }
2273

2274
        /**
2275
         * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2276
         * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2277
         */
2278
        public Builder setAcssDebit(
2279
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit acssDebit) {
2280
          this.acssDebit = acssDebit;
×
2281
          return this;
×
2282
        }
2283

2284
        /**
2285
         * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2286
         * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2287
         */
2288
        public Builder setAcssDebit(EmptyParam acssDebit) {
2289
          this.acssDebit = acssDebit;
×
2290
          return this;
×
2291
        }
2292

2293
        /**
2294
         * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
2295
         * payment method options to pass to the invoice’s PaymentIntent.
2296
         */
2297
        public Builder setBancontact(
2298
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact bancontact) {
2299
          this.bancontact = bancontact;
×
2300
          return this;
×
2301
        }
2302

2303
        /**
2304
         * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
2305
         * payment method options to pass to the invoice’s PaymentIntent.
2306
         */
2307
        public Builder setBancontact(EmptyParam bancontact) {
2308
          this.bancontact = bancontact;
×
2309
          return this;
×
2310
        }
2311

2312
        /**
2313
         * If paying by {@code card}, this sub-hash contains details about the Card payment method
2314
         * options to pass to the invoice’s PaymentIntent.
2315
         */
2316
        public Builder setCard(InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card card) {
2317
          this.card = card;
×
2318
          return this;
×
2319
        }
2320

2321
        /**
2322
         * If paying by {@code card}, this sub-hash contains details about the Card payment method
2323
         * options to pass to the invoice’s PaymentIntent.
2324
         */
2325
        public Builder setCard(EmptyParam card) {
2326
          this.card = card;
×
2327
          return this;
×
2328
        }
2329

2330
        /**
2331
         * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
2332
         * transfer payment method options to pass to the invoice’s PaymentIntent.
2333
         */
2334
        public Builder setCustomerBalance(
2335
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
2336
                customerBalance) {
2337
          this.customerBalance = customerBalance;
×
2338
          return this;
×
2339
        }
2340

2341
        /**
2342
         * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
2343
         * transfer payment method options to pass to the invoice’s PaymentIntent.
2344
         */
2345
        public Builder setCustomerBalance(EmptyParam customerBalance) {
2346
          this.customerBalance = customerBalance;
×
2347
          return this;
×
2348
        }
2349

2350
        /**
2351
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
2352
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2353
         * map. See {@link InvoiceCreateParams.PaymentSettings.PaymentMethodOptions#extraParams} for
2354
         * the field documentation.
2355
         */
2356
        public Builder putExtraParam(String key, Object value) {
2357
          if (this.extraParams == null) {
×
2358
            this.extraParams = new HashMap<>();
×
2359
          }
2360
          this.extraParams.put(key, value);
×
2361
          return this;
×
2362
        }
2363

2364
        /**
2365
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2366
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2367
         * map. See {@link InvoiceCreateParams.PaymentSettings.PaymentMethodOptions#extraParams} for
2368
         * the field documentation.
2369
         */
2370
        public Builder putAllExtraParam(Map<String, Object> map) {
2371
          if (this.extraParams == null) {
×
2372
            this.extraParams = new HashMap<>();
×
2373
          }
2374
          this.extraParams.putAll(map);
×
2375
          return this;
×
2376
        }
2377

2378
        /**
2379
         * If paying by {@code id_bank_transfer}, this sub-hash contains details about the Indonesia
2380
         * bank transfer payment method options to pass to the invoice’s PaymentIntent.
2381
         */
2382
        public Builder setIdBankTransfer(
2383
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.IdBankTransfer
2384
                idBankTransfer) {
NEW
2385
          this.idBankTransfer = idBankTransfer;
×
NEW
2386
          return this;
×
2387
        }
2388

2389
        /**
2390
         * If paying by {@code id_bank_transfer}, this sub-hash contains details about the Indonesia
2391
         * bank transfer payment method options to pass to the invoice’s PaymentIntent.
2392
         */
2393
        public Builder setIdBankTransfer(EmptyParam idBankTransfer) {
NEW
2394
          this.idBankTransfer = idBankTransfer;
×
NEW
2395
          return this;
×
2396
        }
2397

2398
        /**
2399
         * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2400
         * method options to pass to the invoice’s PaymentIntent.
2401
         */
2402
        public Builder setKonbini(
2403
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini konbini) {
2404
          this.konbini = konbini;
×
2405
          return this;
×
2406
        }
2407

2408
        /**
2409
         * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2410
         * method options to pass to the invoice’s PaymentIntent.
2411
         */
2412
        public Builder setKonbini(EmptyParam konbini) {
2413
          this.konbini = konbini;
×
2414
          return this;
×
2415
        }
2416

2417
        /**
2418
         * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct
2419
         * Debit payment method options to pass to the invoice’s PaymentIntent.
2420
         */
2421
        public Builder setSepaDebit(
2422
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit sepaDebit) {
2423
          this.sepaDebit = sepaDebit;
×
2424
          return this;
×
2425
        }
2426

2427
        /**
2428
         * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct
2429
         * Debit payment method options to pass to the invoice’s PaymentIntent.
2430
         */
2431
        public Builder setSepaDebit(EmptyParam sepaDebit) {
2432
          this.sepaDebit = sepaDebit;
×
2433
          return this;
×
2434
        }
2435

2436
        /**
2437
         * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2438
         * debit payment method options to pass to the invoice’s PaymentIntent.
2439
         */
2440
        public Builder setUsBankAccount(
2441
            InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount usBankAccount) {
2442
          this.usBankAccount = usBankAccount;
×
2443
          return this;
×
2444
        }
2445

2446
        /**
2447
         * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2448
         * debit payment method options to pass to the invoice’s PaymentIntent.
2449
         */
2450
        public Builder setUsBankAccount(EmptyParam usBankAccount) {
2451
          this.usBankAccount = usBankAccount;
×
2452
          return this;
×
2453
        }
2454
      }
2455

2456
      @Getter
2457
      public static class AcssDebit {
2458
        /**
2459
         * Map of extra parameters for custom features not available in this client library. The
2460
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2461
         * Instead, each key/value pair is serialized as if the key is a root-level field
2462
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2463
         * instance.
2464
         */
2465
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2466
        Map<String, Object> extraParams;
2467

2468
        /** Additional fields for Mandate creation. */
2469
        @SerializedName("mandate_options")
2470
        MandateOptions mandateOptions;
2471

2472
        /** Verification method for the intent. */
2473
        @SerializedName("verification_method")
2474
        VerificationMethod verificationMethod;
2475

2476
        private AcssDebit(
2477
            Map<String, Object> extraParams,
2478
            MandateOptions mandateOptions,
2479
            VerificationMethod verificationMethod) {
×
2480
          this.extraParams = extraParams;
×
2481
          this.mandateOptions = mandateOptions;
×
2482
          this.verificationMethod = verificationMethod;
×
2483
        }
×
2484

2485
        public static Builder builder() {
2486
          return new Builder();
×
2487
        }
2488

2489
        public static class Builder {
×
2490
          private Map<String, Object> extraParams;
2491

2492
          private MandateOptions mandateOptions;
2493

2494
          private VerificationMethod verificationMethod;
2495

2496
          /** Finalize and obtain parameter instance from this builder. */
2497
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() {
2498
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit(
×
2499
                this.extraParams, this.mandateOptions, this.verificationMethod);
2500
          }
2501

2502
          /**
2503
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2504
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2505
           * map. See {@link
2506
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit#extraParams} for the
2507
           * field documentation.
2508
           */
2509
          public Builder putExtraParam(String key, Object value) {
2510
            if (this.extraParams == null) {
×
2511
              this.extraParams = new HashMap<>();
×
2512
            }
2513
            this.extraParams.put(key, value);
×
2514
            return this;
×
2515
          }
2516

2517
          /**
2518
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2519
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2520
           * map. See {@link
2521
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit#extraParams} for the
2522
           * field documentation.
2523
           */
2524
          public Builder putAllExtraParam(Map<String, Object> map) {
2525
            if (this.extraParams == null) {
×
2526
              this.extraParams = new HashMap<>();
×
2527
            }
2528
            this.extraParams.putAll(map);
×
2529
            return this;
×
2530
          }
2531

2532
          /** Additional fields for Mandate creation. */
2533
          public Builder setMandateOptions(
2534
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2535
                  mandateOptions) {
2536
            this.mandateOptions = mandateOptions;
×
2537
            return this;
×
2538
          }
2539

2540
          /** Verification method for the intent. */
2541
          public Builder setVerificationMethod(
2542
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.VerificationMethod
2543
                  verificationMethod) {
2544
            this.verificationMethod = verificationMethod;
×
2545
            return this;
×
2546
          }
2547
        }
2548

2549
        @Getter
2550
        public static class MandateOptions {
2551
          /**
2552
           * Map of extra parameters for custom features not available in this client library. The
2553
           * content in this map is not serialized under this field's {@code @SerializedName} value.
2554
           * Instead, each key/value pair is serialized as if the key is a root-level field
2555
           * (serialized) name in this param object. Effectively, this map is flattened to its
2556
           * parent instance.
2557
           */
2558
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2559
          Map<String, Object> extraParams;
2560

2561
          /** Transaction type of the mandate. */
2562
          @SerializedName("transaction_type")
2563
          TransactionType transactionType;
2564

2565
          private MandateOptions(Map<String, Object> extraParams, TransactionType transactionType) {
×
2566
            this.extraParams = extraParams;
×
2567
            this.transactionType = transactionType;
×
2568
          }
×
2569

2570
          public static Builder builder() {
2571
            return new Builder();
×
2572
          }
2573

2574
          public static class Builder {
×
2575
            private Map<String, Object> extraParams;
2576

2577
            private TransactionType transactionType;
2578

2579
            /** Finalize and obtain parameter instance from this builder. */
2580
            public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2581
                build() {
2582
              return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit
×
2583
                  .MandateOptions(this.extraParams, this.transactionType);
2584
            }
2585

2586
            /**
2587
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
2588
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2589
             * original map. See {@link
2590
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions#extraParams}
2591
             * for the field documentation.
2592
             */
2593
            public Builder putExtraParam(String key, Object value) {
2594
              if (this.extraParams == null) {
×
2595
                this.extraParams = new HashMap<>();
×
2596
              }
2597
              this.extraParams.put(key, value);
×
2598
              return this;
×
2599
            }
2600

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

2616
            /** Transaction type of the mandate. */
2617
            public Builder setTransactionType(
2618
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2619
                        .TransactionType
2620
                    transactionType) {
2621
              this.transactionType = transactionType;
×
2622
              return this;
×
2623
            }
2624
          }
2625

2626
          public enum TransactionType implements ApiRequestParams.EnumParam {
×
2627
            @SerializedName("business")
×
2628
            BUSINESS("business"),
2629

2630
            @SerializedName("personal")
×
2631
            PERSONAL("personal");
2632

2633
            @Getter(onMethod_ = {@Override})
2634
            private final String value;
2635

2636
            TransactionType(String value) {
×
2637
              this.value = value;
×
2638
            }
×
2639
          }
2640
        }
2641

2642
        public enum VerificationMethod implements ApiRequestParams.EnumParam {
×
2643
          @SerializedName("automatic")
×
2644
          AUTOMATIC("automatic"),
2645

2646
          @SerializedName("instant")
×
2647
          INSTANT("instant"),
2648

2649
          @SerializedName("microdeposits")
×
2650
          MICRODEPOSITS("microdeposits");
2651

2652
          @Getter(onMethod_ = {@Override})
2653
          private final String value;
2654

2655
          VerificationMethod(String value) {
×
2656
            this.value = value;
×
2657
          }
×
2658
        }
2659
      }
2660

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

2673
        /**
2674
         * Preferred language of the Bancontact authorization page that the customer is redirected
2675
         * to.
2676
         */
2677
        @SerializedName("preferred_language")
2678
        PreferredLanguage preferredLanguage;
2679

2680
        private Bancontact(Map<String, Object> extraParams, PreferredLanguage preferredLanguage) {
×
2681
          this.extraParams = extraParams;
×
2682
          this.preferredLanguage = preferredLanguage;
×
2683
        }
×
2684

2685
        public static Builder builder() {
2686
          return new Builder();
×
2687
        }
2688

2689
        public static class Builder {
×
2690
          private Map<String, Object> extraParams;
2691

2692
          private PreferredLanguage preferredLanguage;
2693

2694
          /** Finalize and obtain parameter instance from this builder. */
2695
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() {
2696
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact(
×
2697
                this.extraParams, this.preferredLanguage);
2698
          }
2699

2700
          /**
2701
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2702
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2703
           * map. See {@link
2704
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for
2705
           * the field documentation.
2706
           */
2707
          public Builder putExtraParam(String key, Object value) {
2708
            if (this.extraParams == null) {
×
2709
              this.extraParams = new HashMap<>();
×
2710
            }
2711
            this.extraParams.put(key, value);
×
2712
            return this;
×
2713
          }
2714

2715
          /**
2716
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2717
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2718
           * map. See {@link
2719
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for
2720
           * the field documentation.
2721
           */
2722
          public Builder putAllExtraParam(Map<String, Object> map) {
2723
            if (this.extraParams == null) {
×
2724
              this.extraParams = new HashMap<>();
×
2725
            }
2726
            this.extraParams.putAll(map);
×
2727
            return this;
×
2728
          }
2729

2730
          /**
2731
           * Preferred language of the Bancontact authorization page that the customer is redirected
2732
           * to.
2733
           */
2734
          public Builder setPreferredLanguage(
2735
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Bancontact.PreferredLanguage
2736
                  preferredLanguage) {
2737
            this.preferredLanguage = preferredLanguage;
×
2738
            return this;
×
2739
          }
2740
        }
2741

2742
        public enum PreferredLanguage implements ApiRequestParams.EnumParam {
×
2743
          @SerializedName("de")
×
2744
          DE("de"),
2745

2746
          @SerializedName("en")
×
2747
          EN("en"),
2748

2749
          @SerializedName("fr")
×
2750
          FR("fr"),
2751

2752
          @SerializedName("nl")
×
2753
          NL("nl");
2754

2755
          @Getter(onMethod_ = {@Override})
2756
          private final String value;
2757

2758
          PreferredLanguage(String value) {
×
2759
            this.value = value;
×
2760
          }
×
2761
        }
2762
      }
2763

2764
      @Getter
2765
      public static class Card {
2766
        /**
2767
         * Map of extra parameters for custom features not available in this client library. The
2768
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2769
         * Instead, each key/value pair is serialized as if the key is a root-level field
2770
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2771
         * instance.
2772
         */
2773
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2774
        Map<String, Object> extraParams;
2775

2776
        /**
2777
         * Installment configuration for payments attempted on this invoice (Mexico Only).
2778
         *
2779
         * <p>For more information, see the <a
2780
         * href="https://stripe.com/docs/payments/installments">installments integration guide</a>.
2781
         */
2782
        @SerializedName("installments")
2783
        Installments installments;
2784

2785
        /**
2786
         * We strongly recommend that you rely on our SCA Engine to automatically prompt your
2787
         * customers for authentication based on risk level and <a
2788
         * href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
2789
         * However, if you wish to request 3D Secure based on logic from your own fraud engine,
2790
         * provide this option. Read our guide on <a
2791
         * href="https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds">manually
2792
         * requesting 3D Secure</a> for more information on how this configuration interacts with
2793
         * Radar and our SCA Engine.
2794
         */
2795
        @SerializedName("request_three_d_secure")
2796
        RequestThreeDSecure requestThreeDSecure;
2797

2798
        private Card(
2799
            Map<String, Object> extraParams,
2800
            Installments installments,
2801
            RequestThreeDSecure requestThreeDSecure) {
×
2802
          this.extraParams = extraParams;
×
2803
          this.installments = installments;
×
2804
          this.requestThreeDSecure = requestThreeDSecure;
×
2805
        }
×
2806

2807
        public static Builder builder() {
2808
          return new Builder();
×
2809
        }
2810

2811
        public static class Builder {
×
2812
          private Map<String, Object> extraParams;
2813

2814
          private Installments installments;
2815

2816
          private RequestThreeDSecure requestThreeDSecure;
2817

2818
          /** Finalize and obtain parameter instance from this builder. */
2819
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card build() {
2820
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card(
×
2821
                this.extraParams, this.installments, this.requestThreeDSecure);
2822
          }
2823

2824
          /**
2825
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2826
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2827
           * map. See {@link
2828
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card#extraParams} for the
2829
           * field documentation.
2830
           */
2831
          public Builder putExtraParam(String key, Object value) {
2832
            if (this.extraParams == null) {
×
2833
              this.extraParams = new HashMap<>();
×
2834
            }
2835
            this.extraParams.put(key, value);
×
2836
            return this;
×
2837
          }
2838

2839
          /**
2840
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2841
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2842
           * map. See {@link
2843
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card#extraParams} for the
2844
           * field documentation.
2845
           */
2846
          public Builder putAllExtraParam(Map<String, Object> map) {
2847
            if (this.extraParams == null) {
×
2848
              this.extraParams = new HashMap<>();
×
2849
            }
2850
            this.extraParams.putAll(map);
×
2851
            return this;
×
2852
          }
2853

2854
          /**
2855
           * Installment configuration for payments attempted on this invoice (Mexico Only).
2856
           *
2857
           * <p>For more information, see the <a
2858
           * href="https://stripe.com/docs/payments/installments">installments integration
2859
           * guide</a>.
2860
           */
2861
          public Builder setInstallments(
2862
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments
2863
                  installments) {
2864
            this.installments = installments;
×
2865
            return this;
×
2866
          }
2867

2868
          /**
2869
           * We strongly recommend that you rely on our SCA Engine to automatically prompt your
2870
           * customers for authentication based on risk level and <a
2871
           * href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
2872
           * However, if you wish to request 3D Secure based on logic from your own fraud engine,
2873
           * provide this option. Read our guide on <a
2874
           * href="https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds">manually
2875
           * requesting 3D Secure</a> for more information on how this configuration interacts with
2876
           * Radar and our SCA Engine.
2877
           */
2878
          public Builder setRequestThreeDSecure(
2879
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.RequestThreeDSecure
2880
                  requestThreeDSecure) {
2881
            this.requestThreeDSecure = requestThreeDSecure;
×
2882
            return this;
×
2883
          }
2884
        }
2885

2886
        @Getter
2887
        public static class Installments {
2888
          /**
2889
           * Setting to true enables installments for this invoice. Setting to false will prevent
2890
           * any selected plan from applying to a payment.
2891
           */
2892
          @SerializedName("enabled")
2893
          Boolean enabled;
2894

2895
          /**
2896
           * Map of extra parameters for custom features not available in this client library. The
2897
           * content in this map is not serialized under this field's {@code @SerializedName} value.
2898
           * Instead, each key/value pair is serialized as if the key is a root-level field
2899
           * (serialized) name in this param object. Effectively, this map is flattened to its
2900
           * parent instance.
2901
           */
2902
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2903
          Map<String, Object> extraParams;
2904

2905
          /** The selected installment plan to use for this invoice. */
2906
          @SerializedName("plan")
2907
          Object plan;
2908

2909
          private Installments(Boolean enabled, Map<String, Object> extraParams, Object plan) {
×
2910
            this.enabled = enabled;
×
2911
            this.extraParams = extraParams;
×
2912
            this.plan = plan;
×
2913
          }
×
2914

2915
          public static Builder builder() {
2916
            return new Builder();
×
2917
          }
2918

2919
          public static class Builder {
×
2920
            private Boolean enabled;
2921

2922
            private Map<String, Object> extraParams;
2923

2924
            private Object plan;
2925

2926
            /** Finalize and obtain parameter instance from this builder. */
2927
            public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments
2928
                build() {
2929
              return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments(
×
2930
                  this.enabled, this.extraParams, this.plan);
2931
            }
2932

2933
            /**
2934
             * Setting to true enables installments for this invoice. Setting to false will prevent
2935
             * any selected plan from applying to a payment.
2936
             */
2937
            public Builder setEnabled(Boolean enabled) {
2938
              this.enabled = enabled;
×
2939
              return this;
×
2940
            }
2941

2942
            /**
2943
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
2944
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2945
             * original map. See {@link
2946
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments#extraParams}
2947
             * for the field documentation.
2948
             */
2949
            public Builder putExtraParam(String key, Object value) {
2950
              if (this.extraParams == null) {
×
2951
                this.extraParams = new HashMap<>();
×
2952
              }
2953
              this.extraParams.put(key, value);
×
2954
              return this;
×
2955
            }
2956

2957
            /**
2958
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2959
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2960
             * original map. See {@link
2961
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments#extraParams}
2962
             * for the field documentation.
2963
             */
2964
            public Builder putAllExtraParam(Map<String, Object> map) {
2965
              if (this.extraParams == null) {
×
2966
                this.extraParams = new HashMap<>();
×
2967
              }
2968
              this.extraParams.putAll(map);
×
2969
              return this;
×
2970
            }
2971

2972
            /** The selected installment plan to use for this invoice. */
2973
            public Builder setPlan(
2974
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
2975
                    plan) {
2976
              this.plan = plan;
×
2977
              return this;
×
2978
            }
2979

2980
            /** The selected installment plan to use for this invoice. */
2981
            public Builder setPlan(EmptyParam plan) {
2982
              this.plan = plan;
×
2983
              return this;
×
2984
            }
2985
          }
2986

2987
          @Getter
2988
          public static class Plan {
2989
            /**
2990
             * For {@code fixed_count} installment plans, this is required. It represents the number
2991
             * of installment payments your customer will make to their credit card.
2992
             */
2993
            @SerializedName("count")
2994
            Long count;
2995

2996
            /**
2997
             * Map of extra parameters for custom features not available in this client library. The
2998
             * content in this map is not serialized under this field's {@code @SerializedName}
2999
             * value. Instead, each key/value pair is serialized as if the key is a root-level field
3000
             * (serialized) name in this param object. Effectively, this map is flattened to its
3001
             * parent instance.
3002
             */
3003
            @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3004
            Map<String, Object> extraParams;
3005

3006
            /**
3007
             * For {@code fixed_count} installment plans, this is required. It represents the
3008
             * interval between installment payments your customer will make to their credit card.
3009
             * One of {@code month}.
3010
             */
3011
            @SerializedName("interval")
3012
            Interval interval;
3013

3014
            /** <strong>Required.</strong> Type of installment plan, one of {@code fixed_count}. */
3015
            @SerializedName("type")
3016
            Type type;
3017

3018
            private Plan(
3019
                Long count, Map<String, Object> extraParams, Interval interval, Type type) {
×
3020
              this.count = count;
×
3021
              this.extraParams = extraParams;
×
3022
              this.interval = interval;
×
3023
              this.type = type;
×
3024
            }
×
3025

3026
            public static Builder builder() {
3027
              return new Builder();
×
3028
            }
3029

3030
            public static class Builder {
×
3031
              private Long count;
3032

3033
              private Map<String, Object> extraParams;
3034

3035
              private Interval interval;
3036

3037
              private Type type;
3038

3039
              /** Finalize and obtain parameter instance from this builder. */
3040
              public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3041
                  build() {
3042
                return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card
×
3043
                    .Installments.Plan(this.count, this.extraParams, this.interval, this.type);
3044
              }
3045

3046
              /**
3047
               * For {@code fixed_count} installment plans, this is required. It represents the
3048
               * number of installment payments your customer will make to their credit card.
3049
               */
3050
              public Builder setCount(Long count) {
3051
                this.count = count;
×
3052
                return this;
×
3053
              }
3054

3055
              /**
3056
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3057
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3058
               * original map. See {@link
3059
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan#extraParams}
3060
               * for the field documentation.
3061
               */
3062
              public Builder putExtraParam(String key, Object value) {
3063
                if (this.extraParams == null) {
×
3064
                  this.extraParams = new HashMap<>();
×
3065
                }
3066
                this.extraParams.put(key, value);
×
3067
                return this;
×
3068
              }
3069

3070
              /**
3071
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
3072
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
3073
               * original map. See {@link
3074
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan#extraParams}
3075
               * for the field documentation.
3076
               */
3077
              public Builder putAllExtraParam(Map<String, Object> map) {
3078
                if (this.extraParams == null) {
×
3079
                  this.extraParams = new HashMap<>();
×
3080
                }
3081
                this.extraParams.putAll(map);
×
3082
                return this;
×
3083
              }
3084

3085
              /**
3086
               * For {@code fixed_count} installment plans, this is required. It represents the
3087
               * interval between installment payments your customer will make to their credit card.
3088
               * One of {@code month}.
3089
               */
3090
              public Builder setInterval(
3091
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3092
                          .Interval
3093
                      interval) {
3094
                this.interval = interval;
×
3095
                return this;
×
3096
              }
3097

3098
              /**
3099
               * <strong>Required.</strong> Type of installment plan, one of {@code fixed_count}.
3100
               */
3101
              public Builder setType(
3102
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3103
                          .Type
3104
                      type) {
3105
                this.type = type;
×
3106
                return this;
×
3107
              }
3108
            }
3109

3110
            public enum Interval implements ApiRequestParams.EnumParam {
×
3111
              @SerializedName("month")
×
3112
              MONTH("month");
3113

3114
              @Getter(onMethod_ = {@Override})
3115
              private final String value;
3116

3117
              Interval(String value) {
×
3118
                this.value = value;
×
3119
              }
×
3120
            }
3121

3122
            public enum Type implements ApiRequestParams.EnumParam {
×
3123
              @SerializedName("fixed_count")
×
3124
              FIXED_COUNT("fixed_count");
3125

3126
              @Getter(onMethod_ = {@Override})
3127
              private final String value;
3128

3129
              Type(String value) {
×
3130
                this.value = value;
×
3131
              }
×
3132
            }
3133
          }
3134
        }
3135

3136
        public enum RequestThreeDSecure implements ApiRequestParams.EnumParam {
×
3137
          @SerializedName("any")
×
3138
          ANY("any"),
3139

3140
          @SerializedName("automatic")
×
3141
          AUTOMATIC("automatic"),
3142

3143
          @SerializedName("challenge")
×
3144
          CHALLENGE("challenge");
3145

3146
          @Getter(onMethod_ = {@Override})
3147
          private final String value;
3148

3149
          RequestThreeDSecure(String value) {
×
3150
            this.value = value;
×
3151
          }
×
3152
        }
3153
      }
3154

3155
      @Getter
3156
      public static class CustomerBalance {
3157
        /**
3158
         * Configuration for the bank transfer funding type, if the {@code funding_type} is set to
3159
         * {@code bank_transfer}.
3160
         */
3161
        @SerializedName("bank_transfer")
3162
        BankTransfer bankTransfer;
3163

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

3174
        /**
3175
         * The funding method type to be used when there are not enough funds in the customer
3176
         * balance. Permitted values include: {@code bank_transfer}.
3177
         */
3178
        @SerializedName("funding_type")
3179
        String fundingType;
3180

3181
        private CustomerBalance(
3182
            BankTransfer bankTransfer, Map<String, Object> extraParams, String fundingType) {
×
3183
          this.bankTransfer = bankTransfer;
×
3184
          this.extraParams = extraParams;
×
3185
          this.fundingType = fundingType;
×
3186
        }
×
3187

3188
        public static Builder builder() {
3189
          return new Builder();
×
3190
        }
3191

3192
        public static class Builder {
×
3193
          private BankTransfer bankTransfer;
3194

3195
          private Map<String, Object> extraParams;
3196

3197
          private String fundingType;
3198

3199
          /** Finalize and obtain parameter instance from this builder. */
3200
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance build() {
3201
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance(
×
3202
                this.bankTransfer, this.extraParams, this.fundingType);
3203
          }
3204

3205
          /**
3206
           * Configuration for the bank transfer funding type, if the {@code funding_type} is set to
3207
           * {@code bank_transfer}.
3208
           */
3209
          public Builder setBankTransfer(
3210
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer
3211
                  bankTransfer) {
3212
            this.bankTransfer = bankTransfer;
×
3213
            return this;
×
3214
          }
3215

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

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

3246
          /**
3247
           * The funding method type to be used when there are not enough funds in the customer
3248
           * balance. Permitted values include: {@code bank_transfer}.
3249
           */
3250
          public Builder setFundingType(String fundingType) {
3251
            this.fundingType = fundingType;
×
3252
            return this;
×
3253
          }
3254
        }
3255

3256
        @Getter
3257
        public static class BankTransfer {
3258
          /** Configuration for eu_bank_transfer funding type. */
3259
          @SerializedName("eu_bank_transfer")
3260
          EuBankTransfer euBankTransfer;
3261

3262
          /**
3263
           * Map of extra parameters for custom features not available in this client library. The
3264
           * content in this map is not serialized under this field's {@code @SerializedName} value.
3265
           * Instead, each key/value pair is serialized as if the key is a root-level field
3266
           * (serialized) name in this param object. Effectively, this map is flattened to its
3267
           * parent instance.
3268
           */
3269
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3270
          Map<String, Object> extraParams;
3271

3272
          /**
3273
           * The bank transfer type that can be used for funding. Permitted values include: {@code
3274
           * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3275
           * mx_bank_transfer}, or {@code us_bank_transfer}.
3276
           */
3277
          @SerializedName("type")
3278
          String type;
3279

3280
          private BankTransfer(
3281
              EuBankTransfer euBankTransfer, Map<String, Object> extraParams, String type) {
×
3282
            this.euBankTransfer = euBankTransfer;
×
3283
            this.extraParams = extraParams;
×
3284
            this.type = type;
×
3285
          }
×
3286

3287
          public static Builder builder() {
3288
            return new Builder();
×
3289
          }
3290

3291
          public static class Builder {
×
3292
            private EuBankTransfer euBankTransfer;
3293

3294
            private Map<String, Object> extraParams;
3295

3296
            private String type;
3297

3298
            /** Finalize and obtain parameter instance from this builder. */
3299
            public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3300
                    .BankTransfer
3301
                build() {
3302
              return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
×
3303
                  .BankTransfer(this.euBankTransfer, this.extraParams, this.type);
3304
            }
3305

3306
            /** Configuration for eu_bank_transfer funding type. */
3307
            public Builder setEuBankTransfer(
3308
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3309
                        .BankTransfer.EuBankTransfer
3310
                    euBankTransfer) {
3311
              this.euBankTransfer = euBankTransfer;
×
3312
              return this;
×
3313
            }
3314

3315
            /**
3316
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
3317
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3318
             * original map. See {@link
3319
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer#extraParams}
3320
             * for the field documentation.
3321
             */
3322
            public Builder putExtraParam(String key, Object value) {
3323
              if (this.extraParams == null) {
×
3324
                this.extraParams = new HashMap<>();
×
3325
              }
3326
              this.extraParams.put(key, value);
×
3327
              return this;
×
3328
            }
3329

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

3345
            /**
3346
             * The bank transfer type that can be used for funding. Permitted values include: {@code
3347
             * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3348
             * mx_bank_transfer}, or {@code us_bank_transfer}.
3349
             */
3350
            public Builder setType(String type) {
3351
              this.type = type;
×
3352
              return this;
×
3353
            }
3354
          }
3355

3356
          @Getter
3357
          public static class EuBankTransfer {
3358
            /**
3359
             * <strong>Required.</strong> The desired country code of the bank account information.
3360
             * Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE},
3361
             * or {@code NL}.
3362
             */
3363
            @SerializedName("country")
3364
            String country;
3365

3366
            /**
3367
             * Map of extra parameters for custom features not available in this client library. The
3368
             * content in this map is not serialized under this field's {@code @SerializedName}
3369
             * value. Instead, each key/value pair is serialized as if the key is a root-level field
3370
             * (serialized) name in this param object. Effectively, this map is flattened to its
3371
             * parent instance.
3372
             */
3373
            @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3374
            Map<String, Object> extraParams;
3375

3376
            private EuBankTransfer(String country, Map<String, Object> extraParams) {
×
3377
              this.country = country;
×
3378
              this.extraParams = extraParams;
×
3379
            }
×
3380

3381
            public static Builder builder() {
3382
              return new Builder();
×
3383
            }
3384

3385
            public static class Builder {
×
3386
              private String country;
3387

3388
              private Map<String, Object> extraParams;
3389

3390
              /** Finalize and obtain parameter instance from this builder. */
3391
              public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3392
                      .BankTransfer.EuBankTransfer
3393
                  build() {
3394
                return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
×
3395
                    .BankTransfer.EuBankTransfer(this.country, this.extraParams);
3396
              }
3397

3398
              /**
3399
               * <strong>Required.</strong> The desired country code of the bank account
3400
               * information. Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code
3401
               * FR}, {@code IE}, or {@code NL}.
3402
               */
3403
              public Builder setCountry(String country) {
3404
                this.country = country;
×
3405
                return this;
×
3406
              }
3407

3408
              /**
3409
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3410
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3411
               * original map. See {@link
3412
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams}
3413
               * for the field documentation.
3414
               */
3415
              public Builder putExtraParam(String key, Object value) {
3416
                if (this.extraParams == null) {
×
3417
                  this.extraParams = new HashMap<>();
×
3418
                }
3419
                this.extraParams.put(key, value);
×
3420
                return this;
×
3421
              }
3422

3423
              /**
3424
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
3425
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
3426
               * original map. See {@link
3427
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams}
3428
               * for the field documentation.
3429
               */
3430
              public Builder putAllExtraParam(Map<String, Object> map) {
3431
                if (this.extraParams == null) {
×
3432
                  this.extraParams = new HashMap<>();
×
3433
                }
3434
                this.extraParams.putAll(map);
×
3435
                return this;
×
3436
              }
3437
            }
3438
          }
3439
        }
3440
      }
3441

3442
      @Getter
3443
      public static class IdBankTransfer {
3444
        /**
3445
         * Map of extra parameters for custom features not available in this client library. The
3446
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3447
         * Instead, each key/value pair is serialized as if the key is a root-level field
3448
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3449
         * instance.
3450
         */
3451
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3452
        Map<String, Object> extraParams;
3453

NEW
3454
        private IdBankTransfer(Map<String, Object> extraParams) {
×
NEW
3455
          this.extraParams = extraParams;
×
NEW
3456
        }
×
3457

3458
        public static Builder builder() {
NEW
3459
          return new Builder();
×
3460
        }
3461

NEW
3462
        public static class Builder {
×
3463
          private Map<String, Object> extraParams;
3464

3465
          /** Finalize and obtain parameter instance from this builder. */
3466
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.IdBankTransfer build() {
NEW
3467
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.IdBankTransfer(
×
3468
                this.extraParams);
3469
          }
3470

3471
          /**
3472
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3473
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3474
           * map. See {@link
3475
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.IdBankTransfer#extraParams}
3476
           * for the field documentation.
3477
           */
3478
          public Builder putExtraParam(String key, Object value) {
NEW
3479
            if (this.extraParams == null) {
×
NEW
3480
              this.extraParams = new HashMap<>();
×
3481
            }
NEW
3482
            this.extraParams.put(key, value);
×
NEW
3483
            return this;
×
3484
          }
3485

3486
          /**
3487
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3488
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3489
           * map. See {@link
3490
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.IdBankTransfer#extraParams}
3491
           * for the field documentation.
3492
           */
3493
          public Builder putAllExtraParam(Map<String, Object> map) {
NEW
3494
            if (this.extraParams == null) {
×
NEW
3495
              this.extraParams = new HashMap<>();
×
3496
            }
NEW
3497
            this.extraParams.putAll(map);
×
NEW
3498
            return this;
×
3499
          }
3500
        }
3501
      }
3502

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

3515
        private Konbini(Map<String, Object> extraParams) {
×
3516
          this.extraParams = extraParams;
×
3517
        }
×
3518

3519
        public static Builder builder() {
3520
          return new Builder();
×
3521
        }
3522

3523
        public static class Builder {
×
3524
          private Map<String, Object> extraParams;
3525

3526
          /** Finalize and obtain parameter instance from this builder. */
3527
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini build() {
3528
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini(
×
3529
                this.extraParams);
3530
          }
3531

3532
          /**
3533
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3534
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3535
           * map. See {@link
3536
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini#extraParams} for the
3537
           * field documentation.
3538
           */
3539
          public Builder putExtraParam(String key, Object value) {
3540
            if (this.extraParams == null) {
×
3541
              this.extraParams = new HashMap<>();
×
3542
            }
3543
            this.extraParams.put(key, value);
×
3544
            return this;
×
3545
          }
3546

3547
          /**
3548
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3549
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3550
           * map. See {@link
3551
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Konbini#extraParams} for the
3552
           * field documentation.
3553
           */
3554
          public Builder putAllExtraParam(Map<String, Object> map) {
3555
            if (this.extraParams == null) {
×
3556
              this.extraParams = new HashMap<>();
×
3557
            }
3558
            this.extraParams.putAll(map);
×
3559
            return this;
×
3560
          }
3561
        }
3562
      }
3563

3564
      @Getter
3565
      public static class SepaDebit {
3566
        /**
3567
         * Map of extra parameters for custom features not available in this client library. The
3568
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3569
         * Instead, each key/value pair is serialized as if the key is a root-level field
3570
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3571
         * instance.
3572
         */
3573
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3574
        Map<String, Object> extraParams;
3575

3576
        private SepaDebit(Map<String, Object> extraParams) {
×
3577
          this.extraParams = extraParams;
×
3578
        }
×
3579

3580
        public static Builder builder() {
3581
          return new Builder();
×
3582
        }
3583

3584
        public static class Builder {
×
3585
          private Map<String, Object> extraParams;
3586

3587
          /** Finalize and obtain parameter instance from this builder. */
3588
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit build() {
3589
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit(
×
3590
                this.extraParams);
3591
          }
3592

3593
          /**
3594
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3595
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3596
           * map. See {@link
3597
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit#extraParams} for the
3598
           * field documentation.
3599
           */
3600
          public Builder putExtraParam(String key, Object value) {
3601
            if (this.extraParams == null) {
×
3602
              this.extraParams = new HashMap<>();
×
3603
            }
3604
            this.extraParams.put(key, value);
×
3605
            return this;
×
3606
          }
3607

3608
          /**
3609
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3610
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3611
           * map. See {@link
3612
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.SepaDebit#extraParams} for the
3613
           * field documentation.
3614
           */
3615
          public Builder putAllExtraParam(Map<String, Object> map) {
3616
            if (this.extraParams == null) {
×
3617
              this.extraParams = new HashMap<>();
×
3618
            }
3619
            this.extraParams.putAll(map);
×
3620
            return this;
×
3621
          }
3622
        }
3623
      }
3624

3625
      @Getter
3626
      public static class UsBankAccount {
3627
        /**
3628
         * Map of extra parameters for custom features not available in this client library. The
3629
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3630
         * Instead, each key/value pair is serialized as if the key is a root-level field
3631
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3632
         * instance.
3633
         */
3634
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3635
        Map<String, Object> extraParams;
3636

3637
        /** Additional fields for Financial Connections Session creation. */
3638
        @SerializedName("financial_connections")
3639
        FinancialConnections financialConnections;
3640

3641
        /** Verification method for the intent. */
3642
        @SerializedName("verification_method")
3643
        VerificationMethod verificationMethod;
3644

3645
        private UsBankAccount(
3646
            Map<String, Object> extraParams,
3647
            FinancialConnections financialConnections,
3648
            VerificationMethod verificationMethod) {
×
3649
          this.extraParams = extraParams;
×
3650
          this.financialConnections = financialConnections;
×
3651
          this.verificationMethod = verificationMethod;
×
3652
        }
×
3653

3654
        public static Builder builder() {
3655
          return new Builder();
×
3656
        }
3657

3658
        public static class Builder {
×
3659
          private Map<String, Object> extraParams;
3660

3661
          private FinancialConnections financialConnections;
3662

3663
          private VerificationMethod verificationMethod;
3664

3665
          /** Finalize and obtain parameter instance from this builder. */
3666
          public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount build() {
3667
            return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount(
×
3668
                this.extraParams, this.financialConnections, this.verificationMethod);
3669
          }
3670

3671
          /**
3672
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3673
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3674
           * map. See {@link
3675
           * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount#extraParams} for
3676
           * the field documentation.
3677
           */
3678
          public Builder putExtraParam(String key, Object value) {
3679
            if (this.extraParams == null) {
×
3680
              this.extraParams = new HashMap<>();
×
3681
            }
3682
            this.extraParams.put(key, value);
×
3683
            return this;
×
3684
          }
3685

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

3701
          /** Additional fields for Financial Connections Session creation. */
3702
          public Builder setFinancialConnections(
3703
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3704
                      .FinancialConnections
3705
                  financialConnections) {
3706
            this.financialConnections = financialConnections;
×
3707
            return this;
×
3708
          }
3709

3710
          /** Verification method for the intent. */
3711
          public Builder setVerificationMethod(
3712
              InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3713
                      .VerificationMethod
3714
                  verificationMethod) {
3715
            this.verificationMethod = verificationMethod;
×
3716
            return this;
×
3717
          }
3718
        }
3719

3720
        @Getter
3721
        public static class FinancialConnections {
3722
          /**
3723
           * Map of extra parameters for custom features not available in this client library. The
3724
           * content in this map is not serialized under this field's {@code @SerializedName} value.
3725
           * Instead, each key/value pair is serialized as if the key is a root-level field
3726
           * (serialized) name in this param object. Effectively, this map is flattened to its
3727
           * parent instance.
3728
           */
3729
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3730
          Map<String, Object> extraParams;
3731

3732
          /**
3733
           * Provide filters for the linked accounts that the customer can select for the payment
3734
           * method.
3735
           */
3736
          @SerializedName("filters")
3737
          Filters filters;
3738

3739
          /**
3740
           * The list of permissions to request. If this parameter is passed, the {@code
3741
           * payment_method} permission must be included. Valid permissions include: {@code
3742
           * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}.
3743
           */
3744
          @SerializedName("permissions")
3745
          List<
3746
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3747
                      .FinancialConnections.Permission>
3748
              permissions;
3749

3750
          /** List of data features that you would like to retrieve upon account creation. */
3751
          @SerializedName("prefetch")
3752
          List<
3753
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3754
                      .FinancialConnections.Prefetch>
3755
              prefetch;
3756

3757
          private FinancialConnections(
3758
              Map<String, Object> extraParams,
3759
              Filters filters,
3760
              List<
3761
                      InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3762
                          .FinancialConnections.Permission>
3763
                  permissions,
3764
              List<
3765
                      InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3766
                          .FinancialConnections.Prefetch>
3767
                  prefetch) {
×
3768
            this.extraParams = extraParams;
×
3769
            this.filters = filters;
×
3770
            this.permissions = permissions;
×
3771
            this.prefetch = prefetch;
×
3772
          }
×
3773

3774
          public static Builder builder() {
3775
            return new Builder();
×
3776
          }
3777

3778
          public static class Builder {
×
3779
            private Map<String, Object> extraParams;
3780

3781
            private Filters filters;
3782

3783
            private List<
3784
                    InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3785
                        .FinancialConnections.Permission>
3786
                permissions;
3787

3788
            private List<
3789
                    InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3790
                        .FinancialConnections.Prefetch>
3791
                prefetch;
3792

3793
            /** Finalize and obtain parameter instance from this builder. */
3794
            public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3795
                    .FinancialConnections
3796
                build() {
3797
              return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
×
3798
                  .FinancialConnections(
3799
                  this.extraParams, this.filters, this.permissions, this.prefetch);
3800
            }
3801

3802
            /**
3803
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
3804
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3805
             * original map. See {@link
3806
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams}
3807
             * for the field documentation.
3808
             */
3809
            public Builder putExtraParam(String key, Object value) {
3810
              if (this.extraParams == null) {
×
3811
                this.extraParams = new HashMap<>();
×
3812
              }
3813
              this.extraParams.put(key, value);
×
3814
              return this;
×
3815
            }
3816

3817
            /**
3818
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3819
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3820
             * original map. See {@link
3821
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams}
3822
             * for the field documentation.
3823
             */
3824
            public Builder putAllExtraParam(Map<String, Object> map) {
3825
              if (this.extraParams == null) {
×
3826
                this.extraParams = new HashMap<>();
×
3827
              }
3828
              this.extraParams.putAll(map);
×
3829
              return this;
×
3830
            }
3831

3832
            /**
3833
             * Provide filters for the linked accounts that the customer can select for the payment
3834
             * method.
3835
             */
3836
            public Builder setFilters(
3837
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3838
                        .FinancialConnections.Filters
3839
                    filters) {
3840
              this.filters = filters;
×
3841
              return this;
×
3842
            }
3843

3844
            /**
3845
             * Add an element to `permissions` list. A list is initialized for the first
3846
             * `add/addAll` call, and subsequent calls adds additional elements to the original
3847
             * list. See {@link
3848
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#permissions}
3849
             * for the field documentation.
3850
             */
3851
            public Builder addPermission(
3852
                InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3853
                        .FinancialConnections.Permission
3854
                    element) {
3855
              if (this.permissions == null) {
×
3856
                this.permissions = new ArrayList<>();
×
3857
              }
3858
              this.permissions.add(element);
×
3859
              return this;
×
3860
            }
3861

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

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

3898
            /**
3899
             * Add all elements to `prefetch` list. A list is initialized for the first `add/addAll`
3900
             * call, and subsequent calls adds additional elements to the original list. See {@link
3901
             * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch}
3902
             * for the field documentation.
3903
             */
3904
            public Builder addAllPrefetch(
3905
                List<
3906
                        InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3907
                            .FinancialConnections.Prefetch>
3908
                    elements) {
3909
              if (this.prefetch == null) {
×
3910
                this.prefetch = new ArrayList<>();
×
3911
              }
3912
              this.prefetch.addAll(elements);
×
3913
              return this;
×
3914
            }
3915
          }
3916

3917
          @Getter
3918
          public static class Filters {
3919
            /**
3920
             * The account subcategories to use to filter for selectable accounts. Valid
3921
             * subcategories are {@code checking} and {@code savings}.
3922
             */
3923
            @SerializedName("account_subcategories")
3924
            List<
3925
                    InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3926
                        .FinancialConnections.Filters.AccountSubcategory>
3927
                accountSubcategories;
3928

3929
            /**
3930
             * Map of extra parameters for custom features not available in this client library. The
3931
             * content in this map is not serialized under this field's {@code @SerializedName}
3932
             * value. Instead, each key/value pair is serialized as if the key is a root-level field
3933
             * (serialized) name in this param object. Effectively, this map is flattened to its
3934
             * parent instance.
3935
             */
3936
            @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3937
            Map<String, Object> extraParams;
3938

3939
            /** ID of the institution to use to filter for selectable accounts. */
3940
            @SerializedName("institution")
3941
            String institution;
3942

3943
            private Filters(
3944
                List<
3945
                        InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3946
                            .FinancialConnections.Filters.AccountSubcategory>
3947
                    accountSubcategories,
3948
                Map<String, Object> extraParams,
3949
                String institution) {
×
3950
              this.accountSubcategories = accountSubcategories;
×
3951
              this.extraParams = extraParams;
×
3952
              this.institution = institution;
×
3953
            }
×
3954

3955
            public static Builder builder() {
3956
              return new Builder();
×
3957
            }
3958

3959
            public static class Builder {
×
3960
              private List<
3961
                      InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3962
                          .FinancialConnections.Filters.AccountSubcategory>
3963
                  accountSubcategories;
3964

3965
              private Map<String, Object> extraParams;
3966

3967
              private String institution;
3968

3969
              /** Finalize and obtain parameter instance from this builder. */
3970
              public InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3971
                      .FinancialConnections.Filters
3972
                  build() {
3973
                return new InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
×
3974
                    .FinancialConnections.Filters(
3975
                    this.accountSubcategories, this.extraParams, this.institution);
3976
              }
3977

3978
              /**
3979
               * Add an element to `accountSubcategories` list. A list is initialized for the first
3980
               * `add/addAll` call, and subsequent calls adds additional elements to the original
3981
               * list. See {@link
3982
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories}
3983
               * for the field documentation.
3984
               */
3985
              public Builder addAccountSubcategory(
3986
                  InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3987
                          .FinancialConnections.Filters.AccountSubcategory
3988
                      element) {
3989
                if (this.accountSubcategories == null) {
×
3990
                  this.accountSubcategories = new ArrayList<>();
×
3991
                }
3992
                this.accountSubcategories.add(element);
×
3993
                return this;
×
3994
              }
3995

3996
              /**
3997
               * Add all elements to `accountSubcategories` list. A list is initialized for the
3998
               * first `add/addAll` call, and subsequent calls adds additional elements to the
3999
               * original list. See {@link
4000
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories}
4001
               * for the field documentation.
4002
               */
4003
              public Builder addAllAccountSubcategory(
4004
                  List<
4005
                          InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
4006
                              .FinancialConnections.Filters.AccountSubcategory>
4007
                      elements) {
4008
                if (this.accountSubcategories == null) {
×
4009
                  this.accountSubcategories = new ArrayList<>();
×
4010
                }
4011
                this.accountSubcategories.addAll(elements);
×
4012
                return this;
×
4013
              }
4014

4015
              /**
4016
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
4017
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4018
               * original map. See {@link
4019
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams}
4020
               * for the field documentation.
4021
               */
4022
              public Builder putExtraParam(String key, Object value) {
4023
                if (this.extraParams == null) {
×
4024
                  this.extraParams = new HashMap<>();
×
4025
                }
4026
                this.extraParams.put(key, value);
×
4027
                return this;
×
4028
              }
4029

4030
              /**
4031
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
4032
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
4033
               * original map. See {@link
4034
               * InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams}
4035
               * for the field documentation.
4036
               */
4037
              public Builder putAllExtraParam(Map<String, Object> map) {
4038
                if (this.extraParams == null) {
×
4039
                  this.extraParams = new HashMap<>();
×
4040
                }
4041
                this.extraParams.putAll(map);
×
4042
                return this;
×
4043
              }
4044

4045
              /** ID of the institution to use to filter for selectable accounts. */
4046
              public Builder setInstitution(String institution) {
4047
                this.institution = institution;
×
4048
                return this;
×
4049
              }
4050
            }
4051

4052
            public enum AccountSubcategory implements ApiRequestParams.EnumParam {
×
4053
              @SerializedName("checking")
×
4054
              CHECKING("checking"),
4055

4056
              @SerializedName("savings")
×
4057
              SAVINGS("savings");
4058

4059
              @Getter(onMethod_ = {@Override})
4060
              private final String value;
4061

4062
              AccountSubcategory(String value) {
×
4063
                this.value = value;
×
4064
              }
×
4065
            }
4066
          }
4067

4068
          public enum Permission implements ApiRequestParams.EnumParam {
×
4069
            @SerializedName("balances")
×
4070
            BALANCES("balances"),
4071

4072
            @SerializedName("ownership")
×
4073
            OWNERSHIP("ownership"),
4074

4075
            @SerializedName("payment_method")
×
4076
            PAYMENT_METHOD("payment_method"),
4077

4078
            @SerializedName("transactions")
×
4079
            TRANSACTIONS("transactions");
4080

4081
            @Getter(onMethod_ = {@Override})
4082
            private final String value;
4083

4084
            Permission(String value) {
×
4085
              this.value = value;
×
4086
            }
×
4087
          }
4088

4089
          public enum Prefetch implements ApiRequestParams.EnumParam {
×
4090
            @SerializedName("balances")
×
4091
            BALANCES("balances"),
4092

4093
            @SerializedName("inferred_balances")
×
4094
            INFERRED_BALANCES("inferred_balances"),
4095

4096
            @SerializedName("ownership")
×
4097
            OWNERSHIP("ownership"),
4098

4099
            @SerializedName("transactions")
×
4100
            TRANSACTIONS("transactions");
4101

4102
            @Getter(onMethod_ = {@Override})
4103
            private final String value;
4104

4105
            Prefetch(String value) {
×
4106
              this.value = value;
×
4107
            }
×
4108
          }
4109
        }
4110

4111
        public enum VerificationMethod implements ApiRequestParams.EnumParam {
×
4112
          @SerializedName("automatic")
×
4113
          AUTOMATIC("automatic"),
4114

4115
          @SerializedName("instant")
×
4116
          INSTANT("instant"),
4117

4118
          @SerializedName("microdeposits")
×
4119
          MICRODEPOSITS("microdeposits");
4120

4121
          @Getter(onMethod_ = {@Override})
4122
          private final String value;
4123

4124
          VerificationMethod(String value) {
×
4125
            this.value = value;
×
4126
          }
×
4127
        }
4128
      }
4129
    }
4130

4131
    public enum PaymentMethodType implements ApiRequestParams.EnumParam {
×
4132
      @SerializedName("ach_credit_transfer")
×
4133
      ACH_CREDIT_TRANSFER("ach_credit_transfer"),
4134

4135
      @SerializedName("ach_debit")
×
4136
      ACH_DEBIT("ach_debit"),
4137

4138
      @SerializedName("acss_debit")
×
4139
      ACSS_DEBIT("acss_debit"),
4140

4141
      @SerializedName("amazon_pay")
×
4142
      AMAZON_PAY("amazon_pay"),
4143

4144
      @SerializedName("au_becs_debit")
×
4145
      AU_BECS_DEBIT("au_becs_debit"),
4146

4147
      @SerializedName("bacs_debit")
×
4148
      BACS_DEBIT("bacs_debit"),
4149

4150
      @SerializedName("bancontact")
×
4151
      BANCONTACT("bancontact"),
4152

4153
      @SerializedName("boleto")
×
4154
      BOLETO("boleto"),
4155

4156
      @SerializedName("card")
×
4157
      CARD("card"),
4158

4159
      @SerializedName("cashapp")
×
4160
      CASHAPP("cashapp"),
4161

4162
      @SerializedName("customer_balance")
×
4163
      CUSTOMER_BALANCE("customer_balance"),
4164

4165
      @SerializedName("eps")
×
4166
      EPS("eps"),
4167

4168
      @SerializedName("fpx")
×
4169
      FPX("fpx"),
4170

4171
      @SerializedName("giropay")
×
4172
      GIROPAY("giropay"),
4173

4174
      @SerializedName("grabpay")
×
4175
      GRABPAY("grabpay"),
4176

NEW
4177
      @SerializedName("id_bank_transfer")
×
4178
      ID_BANK_TRANSFER("id_bank_transfer"),
4179

UNCOV
4180
      @SerializedName("ideal")
×
4181
      IDEAL("ideal"),
4182

4183
      @SerializedName("jp_credit_transfer")
×
4184
      JP_CREDIT_TRANSFER("jp_credit_transfer"),
4185

4186
      @SerializedName("kakao_pay")
×
4187
      KAKAO_PAY("kakao_pay"),
4188

4189
      @SerializedName("konbini")
×
4190
      KONBINI("konbini"),
4191

4192
      @SerializedName("kr_card")
×
4193
      KR_CARD("kr_card"),
4194

4195
      @SerializedName("link")
×
4196
      LINK("link"),
4197

4198
      @SerializedName("multibanco")
×
4199
      MULTIBANCO("multibanco"),
4200

4201
      @SerializedName("naver_pay")
×
4202
      NAVER_PAY("naver_pay"),
4203

4204
      @SerializedName("p24")
×
4205
      P24("p24"),
4206

4207
      @SerializedName("payco")
×
4208
      PAYCO("payco"),
4209

4210
      @SerializedName("paynow")
×
4211
      PAYNOW("paynow"),
4212

4213
      @SerializedName("paypal")
×
4214
      PAYPAL("paypal"),
4215

4216
      @SerializedName("promptpay")
×
4217
      PROMPTPAY("promptpay"),
4218

4219
      @SerializedName("revolut_pay")
×
4220
      REVOLUT_PAY("revolut_pay"),
4221

4222
      @SerializedName("sepa_credit_transfer")
×
4223
      SEPA_CREDIT_TRANSFER("sepa_credit_transfer"),
4224

4225
      @SerializedName("sepa_debit")
×
4226
      SEPA_DEBIT("sepa_debit"),
4227

4228
      @SerializedName("sofort")
×
4229
      SOFORT("sofort"),
4230

4231
      @SerializedName("swish")
×
4232
      SWISH("swish"),
4233

4234
      @SerializedName("us_bank_account")
×
4235
      US_BANK_ACCOUNT("us_bank_account"),
4236

4237
      @SerializedName("wechat_pay")
×
4238
      WECHAT_PAY("wechat_pay");
4239

4240
      @Getter(onMethod_ = {@Override})
4241
      private final String value;
4242

4243
      PaymentMethodType(String value) {
×
4244
        this.value = value;
×
4245
      }
×
4246
    }
4247
  }
4248

4249
  @Getter
4250
  public static class Rendering {
4251
    /**
4252
     * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4253
     * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4254
     * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code exclude_tax}
4255
     * will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4256
     */
4257
    @SerializedName("amount_tax_display")
4258
    ApiRequestParams.EnumParam amountTaxDisplay;
4259

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

4269
    /** Invoice pdf rendering options. */
4270
    @SerializedName("pdf")
4271
    Pdf pdf;
4272

4273
    /** ID of the invoice rendering template to use for this invoice. */
4274
    @SerializedName("template")
4275
    String template;
4276

4277
    /** The specific version of invoice rendering template to use for this invoice. */
4278
    @SerializedName("template_version")
4279
    Object templateVersion;
4280

4281
    private Rendering(
4282
        ApiRequestParams.EnumParam amountTaxDisplay,
4283
        Map<String, Object> extraParams,
4284
        Pdf pdf,
4285
        String template,
4286
        Object templateVersion) {
×
4287
      this.amountTaxDisplay = amountTaxDisplay;
×
4288
      this.extraParams = extraParams;
×
4289
      this.pdf = pdf;
×
4290
      this.template = template;
×
4291
      this.templateVersion = templateVersion;
×
4292
    }
×
4293

4294
    public static Builder builder() {
4295
      return new Builder();
×
4296
    }
4297

4298
    public static class Builder {
×
4299
      private ApiRequestParams.EnumParam amountTaxDisplay;
4300

4301
      private Map<String, Object> extraParams;
4302

4303
      private Pdf pdf;
4304

4305
      private String template;
4306

4307
      private Object templateVersion;
4308

4309
      /** Finalize and obtain parameter instance from this builder. */
4310
      public InvoiceCreateParams.Rendering build() {
4311
        return new InvoiceCreateParams.Rendering(
×
4312
            this.amountTaxDisplay, this.extraParams, this.pdf, this.template, this.templateVersion);
4313
      }
4314

4315
      /**
4316
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4317
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4318
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4319
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4320
       */
4321
      public Builder setAmountTaxDisplay(
4322
          InvoiceCreateParams.Rendering.AmountTaxDisplay amountTaxDisplay) {
4323
        this.amountTaxDisplay = amountTaxDisplay;
×
4324
        return this;
×
4325
      }
4326

4327
      /**
4328
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4329
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4330
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4331
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4332
       */
4333
      public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
4334
        this.amountTaxDisplay = amountTaxDisplay;
×
4335
        return this;
×
4336
      }
4337

4338
      /**
4339
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4340
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4341
       * InvoiceCreateParams.Rendering#extraParams} for the field documentation.
4342
       */
4343
      public Builder putExtraParam(String key, Object value) {
4344
        if (this.extraParams == null) {
×
4345
          this.extraParams = new HashMap<>();
×
4346
        }
4347
        this.extraParams.put(key, value);
×
4348
        return this;
×
4349
      }
4350

4351
      /**
4352
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4353
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4354
       * See {@link InvoiceCreateParams.Rendering#extraParams} for the field documentation.
4355
       */
4356
      public Builder putAllExtraParam(Map<String, Object> map) {
4357
        if (this.extraParams == null) {
×
4358
          this.extraParams = new HashMap<>();
×
4359
        }
4360
        this.extraParams.putAll(map);
×
4361
        return this;
×
4362
      }
4363

4364
      /** Invoice pdf rendering options. */
4365
      public Builder setPdf(InvoiceCreateParams.Rendering.Pdf pdf) {
4366
        this.pdf = pdf;
×
4367
        return this;
×
4368
      }
4369

4370
      /** ID of the invoice rendering template to use for this invoice. */
4371
      public Builder setTemplate(String template) {
4372
        this.template = template;
×
4373
        return this;
×
4374
      }
4375

4376
      /** The specific version of invoice rendering template to use for this invoice. */
4377
      public Builder setTemplateVersion(Long templateVersion) {
4378
        this.templateVersion = templateVersion;
×
4379
        return this;
×
4380
      }
4381

4382
      /** The specific version of invoice rendering template to use for this invoice. */
4383
      public Builder setTemplateVersion(EmptyParam templateVersion) {
4384
        this.templateVersion = templateVersion;
×
4385
        return this;
×
4386
      }
4387
    }
4388

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

4400
      /**
4401
       * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4402
       * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4403
       * Japanese locale and {@code letter} for customers with other locales.
4404
       */
4405
      @SerializedName("page_size")
4406
      PageSize pageSize;
4407

4408
      private Pdf(Map<String, Object> extraParams, PageSize pageSize) {
×
4409
        this.extraParams = extraParams;
×
4410
        this.pageSize = pageSize;
×
4411
      }
×
4412

4413
      public static Builder builder() {
4414
        return new Builder();
×
4415
      }
4416

4417
      public static class Builder {
×
4418
        private Map<String, Object> extraParams;
4419

4420
        private PageSize pageSize;
4421

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

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

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

4455
        /**
4456
         * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4457
         * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4458
         * Japanese locale and {@code letter} for customers with other locales.
4459
         */
4460
        public Builder setPageSize(InvoiceCreateParams.Rendering.Pdf.PageSize pageSize) {
4461
          this.pageSize = pageSize;
×
4462
          return this;
×
4463
        }
4464
      }
4465

4466
      public enum PageSize implements ApiRequestParams.EnumParam {
×
4467
        @SerializedName("a4")
×
4468
        A4("a4"),
4469

4470
        @SerializedName("auto")
×
4471
        AUTO("auto"),
4472

4473
        @SerializedName("letter")
×
4474
        LETTER("letter");
4475

4476
        @Getter(onMethod_ = {@Override})
4477
        private final String value;
4478

4479
        PageSize(String value) {
×
4480
          this.value = value;
×
4481
        }
×
4482
      }
4483
    }
4484

4485
    public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
4486
      @SerializedName("exclude_tax")
×
4487
      EXCLUDE_TAX("exclude_tax"),
4488

4489
      @SerializedName("include_inclusive_tax")
×
4490
      INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
4491

4492
      @Getter(onMethod_ = {@Override})
4493
      private final String value;
4494

4495
      AmountTaxDisplay(String value) {
×
4496
        this.value = value;
×
4497
      }
×
4498
    }
4499
  }
4500

4501
  @Getter
4502
  public static class ShippingCost {
4503
    /**
4504
     * Map of extra parameters for custom features not available in this client library. The content
4505
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4506
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4507
     * param object. Effectively, this map is flattened to its parent instance.
4508
     */
4509
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4510
    Map<String, Object> extraParams;
4511

4512
    /** The ID of the shipping rate to use for this order. */
4513
    @SerializedName("shipping_rate")
4514
    String shippingRate;
4515

4516
    /** Parameters to create a new ad-hoc shipping rate for this order. */
4517
    @SerializedName("shipping_rate_data")
4518
    ShippingRateData shippingRateData;
4519

4520
    private ShippingCost(
4521
        Map<String, Object> extraParams, String shippingRate, ShippingRateData shippingRateData) {
×
4522
      this.extraParams = extraParams;
×
4523
      this.shippingRate = shippingRate;
×
4524
      this.shippingRateData = shippingRateData;
×
4525
    }
×
4526

4527
    public static Builder builder() {
4528
      return new Builder();
×
4529
    }
4530

4531
    public static class Builder {
×
4532
      private Map<String, Object> extraParams;
4533

4534
      private String shippingRate;
4535

4536
      private ShippingRateData shippingRateData;
4537

4538
      /** Finalize and obtain parameter instance from this builder. */
4539
      public InvoiceCreateParams.ShippingCost build() {
4540
        return new InvoiceCreateParams.ShippingCost(
×
4541
            this.extraParams, this.shippingRate, this.shippingRateData);
4542
      }
4543

4544
      /**
4545
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4546
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4547
       * InvoiceCreateParams.ShippingCost#extraParams} for the field documentation.
4548
       */
4549
      public Builder putExtraParam(String key, Object value) {
4550
        if (this.extraParams == null) {
×
4551
          this.extraParams = new HashMap<>();
×
4552
        }
4553
        this.extraParams.put(key, value);
×
4554
        return this;
×
4555
      }
4556

4557
      /**
4558
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4559
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4560
       * See {@link InvoiceCreateParams.ShippingCost#extraParams} for the field documentation.
4561
       */
4562
      public Builder putAllExtraParam(Map<String, Object> map) {
4563
        if (this.extraParams == null) {
×
4564
          this.extraParams = new HashMap<>();
×
4565
        }
4566
        this.extraParams.putAll(map);
×
4567
        return this;
×
4568
      }
4569

4570
      /** The ID of the shipping rate to use for this order. */
4571
      public Builder setShippingRate(String shippingRate) {
4572
        this.shippingRate = shippingRate;
×
4573
        return this;
×
4574
      }
4575

4576
      /** Parameters to create a new ad-hoc shipping rate for this order. */
4577
      public Builder setShippingRateData(
4578
          InvoiceCreateParams.ShippingCost.ShippingRateData shippingRateData) {
4579
        this.shippingRateData = shippingRateData;
×
4580
        return this;
×
4581
      }
4582
    }
4583

4584
    @Getter
4585
    public static class ShippingRateData {
4586
      /**
4587
       * The estimated range for how long shipping will take, meant to be displayable to the
4588
       * customer. This will appear on CheckoutSessions.
4589
       */
4590
      @SerializedName("delivery_estimate")
4591
      DeliveryEstimate deliveryEstimate;
4592

4593
      /**
4594
       * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4595
       * customer. This will appear on CheckoutSessions.
4596
       */
4597
      @SerializedName("display_name")
4598
      String displayName;
4599

4600
      /**
4601
       * Map of extra parameters for custom features not available in this client library. The
4602
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4603
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4604
       * name in this param object. Effectively, this map is flattened to its parent instance.
4605
       */
4606
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4607
      Map<String, Object> extraParams;
4608

4609
      /**
4610
       * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4611
       * fixed_amount}.
4612
       */
4613
      @SerializedName("fixed_amount")
4614
      FixedAmount fixedAmount;
4615

4616
      /**
4617
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
4618
       * attach to an object. This can be useful for storing additional information about the object
4619
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
4620
       * keys can be unset by posting an empty value to {@code metadata}.
4621
       */
4622
      @SerializedName("metadata")
4623
      Map<String, String> metadata;
4624

4625
      /**
4626
       * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4627
       * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4628
       */
4629
      @SerializedName("tax_behavior")
4630
      TaxBehavior taxBehavior;
4631

4632
      /**
4633
       * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4634
       * code is {@code txcd_92010001}.
4635
       */
4636
      @SerializedName("tax_code")
4637
      String taxCode;
4638

4639
      /** The type of calculation to use on the shipping rate. */
4640
      @SerializedName("type")
4641
      Type type;
4642

4643
      private ShippingRateData(
4644
          DeliveryEstimate deliveryEstimate,
4645
          String displayName,
4646
          Map<String, Object> extraParams,
4647
          FixedAmount fixedAmount,
4648
          Map<String, String> metadata,
4649
          TaxBehavior taxBehavior,
4650
          String taxCode,
4651
          Type type) {
×
4652
        this.deliveryEstimate = deliveryEstimate;
×
4653
        this.displayName = displayName;
×
4654
        this.extraParams = extraParams;
×
4655
        this.fixedAmount = fixedAmount;
×
4656
        this.metadata = metadata;
×
4657
        this.taxBehavior = taxBehavior;
×
4658
        this.taxCode = taxCode;
×
4659
        this.type = type;
×
4660
      }
×
4661

4662
      public static Builder builder() {
4663
        return new Builder();
×
4664
      }
4665

4666
      public static class Builder {
×
4667
        private DeliveryEstimate deliveryEstimate;
4668

4669
        private String displayName;
4670

4671
        private Map<String, Object> extraParams;
4672

4673
        private FixedAmount fixedAmount;
4674

4675
        private Map<String, String> metadata;
4676

4677
        private TaxBehavior taxBehavior;
4678

4679
        private String taxCode;
4680

4681
        private Type type;
4682

4683
        /** Finalize and obtain parameter instance from this builder. */
4684
        public InvoiceCreateParams.ShippingCost.ShippingRateData build() {
4685
          return new InvoiceCreateParams.ShippingCost.ShippingRateData(
×
4686
              this.deliveryEstimate,
4687
              this.displayName,
4688
              this.extraParams,
4689
              this.fixedAmount,
4690
              this.metadata,
4691
              this.taxBehavior,
4692
              this.taxCode,
4693
              this.type);
4694
        }
4695

4696
        /**
4697
         * The estimated range for how long shipping will take, meant to be displayable to the
4698
         * customer. This will appear on CheckoutSessions.
4699
         */
4700
        public Builder setDeliveryEstimate(
4701
            InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate deliveryEstimate) {
4702
          this.deliveryEstimate = deliveryEstimate;
×
4703
          return this;
×
4704
        }
4705

4706
        /**
4707
         * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4708
         * customer. This will appear on CheckoutSessions.
4709
         */
4710
        public Builder setDisplayName(String displayName) {
4711
          this.displayName = displayName;
×
4712
          return this;
×
4713
        }
4714

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

4729
        /**
4730
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4731
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4732
         * map. See {@link InvoiceCreateParams.ShippingCost.ShippingRateData#extraParams} for the
4733
         * field documentation.
4734
         */
4735
        public Builder putAllExtraParam(Map<String, Object> map) {
4736
          if (this.extraParams == null) {
×
4737
            this.extraParams = new HashMap<>();
×
4738
          }
4739
          this.extraParams.putAll(map);
×
4740
          return this;
×
4741
        }
4742

4743
        /**
4744
         * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4745
         * fixed_amount}.
4746
         */
4747
        public Builder setFixedAmount(
4748
            InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount fixedAmount) {
4749
          this.fixedAmount = fixedAmount;
×
4750
          return this;
×
4751
        }
4752

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

4766
        /**
4767
         * Add all map key/value pairs to `metadata` map. A map is initialized for the first
4768
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4769
         * map. See {@link InvoiceCreateParams.ShippingCost.ShippingRateData#metadata} for the field
4770
         * documentation.
4771
         */
4772
        public Builder putAllMetadata(Map<String, String> map) {
4773
          if (this.metadata == null) {
×
4774
            this.metadata = new HashMap<>();
×
4775
          }
4776
          this.metadata.putAll(map);
×
4777
          return this;
×
4778
        }
4779

4780
        /**
4781
         * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4782
         * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4783
         */
4784
        public Builder setTaxBehavior(
4785
            InvoiceCreateParams.ShippingCost.ShippingRateData.TaxBehavior taxBehavior) {
4786
          this.taxBehavior = taxBehavior;
×
4787
          return this;
×
4788
        }
4789

4790
        /**
4791
         * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4792
         * code is {@code txcd_92010001}.
4793
         */
4794
        public Builder setTaxCode(String taxCode) {
4795
          this.taxCode = taxCode;
×
4796
          return this;
×
4797
        }
4798

4799
        /** The type of calculation to use on the shipping rate. */
4800
        public Builder setType(InvoiceCreateParams.ShippingCost.ShippingRateData.Type type) {
4801
          this.type = type;
×
4802
          return this;
×
4803
        }
4804
      }
4805

4806
      @Getter
4807
      public static class DeliveryEstimate {
4808
        /**
4809
         * Map of extra parameters for custom features not available in this client library. The
4810
         * content in this map is not serialized under this field's {@code @SerializedName} value.
4811
         * Instead, each key/value pair is serialized as if the key is a root-level field
4812
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
4813
         * instance.
4814
         */
4815
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4816
        Map<String, Object> extraParams;
4817

4818
        /**
4819
         * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4820
         * infinite.
4821
         */
4822
        @SerializedName("maximum")
4823
        Maximum maximum;
4824

4825
        /** The lower bound of the estimated range. If empty, represents no lower bound. */
4826
        @SerializedName("minimum")
4827
        Minimum minimum;
4828

4829
        private DeliveryEstimate(
4830
            Map<String, Object> extraParams, Maximum maximum, Minimum minimum) {
×
4831
          this.extraParams = extraParams;
×
4832
          this.maximum = maximum;
×
4833
          this.minimum = minimum;
×
4834
        }
×
4835

4836
        public static Builder builder() {
4837
          return new Builder();
×
4838
        }
4839

4840
        public static class Builder {
×
4841
          private Map<String, Object> extraParams;
4842

4843
          private Maximum maximum;
4844

4845
          private Minimum minimum;
4846

4847
          /** Finalize and obtain parameter instance from this builder. */
4848
          public InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate build() {
4849
            return new InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate(
×
4850
                this.extraParams, this.maximum, this.minimum);
4851
          }
4852

4853
          /**
4854
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
4855
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4856
           * map. See {@link
4857
           * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate#extraParams} for the
4858
           * field documentation.
4859
           */
4860
          public Builder putExtraParam(String key, Object value) {
4861
            if (this.extraParams == null) {
×
4862
              this.extraParams = new HashMap<>();
×
4863
            }
4864
            this.extraParams.put(key, value);
×
4865
            return this;
×
4866
          }
4867

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

4883
          /**
4884
           * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4885
           * infinite.
4886
           */
4887
          public Builder setMaximum(
4888
              InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum maximum) {
4889
            this.maximum = maximum;
×
4890
            return this;
×
4891
          }
4892

4893
          /** The lower bound of the estimated range. If empty, represents no lower bound. */
4894
          public Builder setMinimum(
4895
              InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum minimum) {
4896
            this.minimum = minimum;
×
4897
            return this;
×
4898
          }
4899
        }
4900

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

4913
          /** <strong>Required.</strong> A unit of time. */
4914
          @SerializedName("unit")
4915
          Unit unit;
4916

4917
          /** <strong>Required.</strong> Must be greater than 0. */
4918
          @SerializedName("value")
4919
          Long value;
4920

4921
          private Maximum(Map<String, Object> extraParams, Unit unit, Long value) {
×
4922
            this.extraParams = extraParams;
×
4923
            this.unit = unit;
×
4924
            this.value = value;
×
4925
          }
×
4926

4927
          public static Builder builder() {
4928
            return new Builder();
×
4929
          }
4930

4931
          public static class Builder {
×
4932
            private Map<String, Object> extraParams;
4933

4934
            private Unit unit;
4935

4936
            private Long value;
4937

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

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

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

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

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

4990
          public enum Unit implements ApiRequestParams.EnumParam {
×
4991
            @SerializedName("business_day")
×
4992
            BUSINESS_DAY("business_day"),
4993

4994
            @SerializedName("day")
×
4995
            DAY("day"),
4996

4997
            @SerializedName("hour")
×
4998
            HOUR("hour"),
4999

5000
            @SerializedName("month")
×
5001
            MONTH("month"),
5002

5003
            @SerializedName("week")
×
5004
            WEEK("week");
5005

5006
            @Getter(onMethod_ = {@Override})
5007
            private final String value;
5008

5009
            Unit(String value) {
×
5010
              this.value = value;
×
5011
            }
×
5012
          }
5013
        }
5014

5015
        @Getter
5016
        public static class Minimum {
5017
          /**
5018
           * Map of extra parameters for custom features not available in this client library. The
5019
           * content in this map is not serialized under this field's {@code @SerializedName} value.
5020
           * Instead, each key/value pair is serialized as if the key is a root-level field
5021
           * (serialized) name in this param object. Effectively, this map is flattened to its
5022
           * parent instance.
5023
           */
5024
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5025
          Map<String, Object> extraParams;
5026

5027
          /** <strong>Required.</strong> A unit of time. */
5028
          @SerializedName("unit")
5029
          Unit unit;
5030

5031
          /** <strong>Required.</strong> Must be greater than 0. */
5032
          @SerializedName("value")
5033
          Long value;
5034

5035
          private Minimum(Map<String, Object> extraParams, Unit unit, Long value) {
×
5036
            this.extraParams = extraParams;
×
5037
            this.unit = unit;
×
5038
            this.value = value;
×
5039
          }
×
5040

5041
          public static Builder builder() {
5042
            return new Builder();
×
5043
          }
5044

5045
          public static class Builder {
×
5046
            private Map<String, Object> extraParams;
5047

5048
            private Unit unit;
5049

5050
            private Long value;
5051

5052
            /** Finalize and obtain parameter instance from this builder. */
5053
            public InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum
5054
                build() {
5055
              return new InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum(
×
5056
                  this.extraParams, this.unit, this.value);
5057
            }
5058

5059
            /**
5060
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
5061
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5062
             * original map. See {@link
5063
             * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
5064
             * for the field documentation.
5065
             */
5066
            public Builder putExtraParam(String key, Object value) {
5067
              if (this.extraParams == null) {
×
5068
                this.extraParams = new HashMap<>();
×
5069
              }
5070
              this.extraParams.put(key, value);
×
5071
              return this;
×
5072
            }
5073

5074
            /**
5075
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5076
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5077
             * original map. See {@link
5078
             * InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
5079
             * for the field documentation.
5080
             */
5081
            public Builder putAllExtraParam(Map<String, Object> map) {
5082
              if (this.extraParams == null) {
×
5083
                this.extraParams = new HashMap<>();
×
5084
              }
5085
              this.extraParams.putAll(map);
×
5086
              return this;
×
5087
            }
5088

5089
            /** <strong>Required.</strong> A unit of time. */
5090
            public Builder setUnit(
5091
                InvoiceCreateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum.Unit
5092
                    unit) {
5093
              this.unit = unit;
×
5094
              return this;
×
5095
            }
5096

5097
            /** <strong>Required.</strong> Must be greater than 0. */
5098
            public Builder setValue(Long value) {
5099
              this.value = value;
×
5100
              return this;
×
5101
            }
5102
          }
5103

5104
          public enum Unit implements ApiRequestParams.EnumParam {
×
5105
            @SerializedName("business_day")
×
5106
            BUSINESS_DAY("business_day"),
5107

5108
            @SerializedName("day")
×
5109
            DAY("day"),
5110

5111
            @SerializedName("hour")
×
5112
            HOUR("hour"),
5113

5114
            @SerializedName("month")
×
5115
            MONTH("month"),
5116

5117
            @SerializedName("week")
×
5118
            WEEK("week");
5119

5120
            @Getter(onMethod_ = {@Override})
5121
            private final String value;
5122

5123
            Unit(String value) {
×
5124
              this.value = value;
×
5125
            }
×
5126
          }
5127
        }
5128
      }
5129

5130
      @Getter
5131
      public static class FixedAmount {
5132
        /**
5133
         * <strong>Required.</strong> A non-negative integer in cents representing how much to
5134
         * charge.
5135
         */
5136
        @SerializedName("amount")
5137
        Long amount;
5138

5139
        /**
5140
         * <strong>Required.</strong> Three-letter <a
5141
         * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5142
         * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
5143
         */
5144
        @SerializedName("currency")
5145
        String currency;
5146

5147
        /**
5148
         * Shipping rates defined in each available currency option. Each key must be a three-letter
5149
         * <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a
5150
         * href="https://stripe.com/docs/currencies">supported currency</a>.
5151
         */
5152
        @SerializedName("currency_options")
5153
        Map<String, InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5154
            currencyOptions;
5155

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

5166
        private FixedAmount(
5167
            Long amount,
5168
            String currency,
5169
            Map<
5170
                    String,
5171
                    InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5172
                currencyOptions,
5173
            Map<String, Object> extraParams) {
×
5174
          this.amount = amount;
×
5175
          this.currency = currency;
×
5176
          this.currencyOptions = currencyOptions;
×
5177
          this.extraParams = extraParams;
×
5178
        }
×
5179

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

5184
        public static class Builder {
×
5185
          private Long amount;
5186

5187
          private String currency;
5188

5189
          private Map<
5190
                  String,
5191
                  InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5192
              currencyOptions;
5193

5194
          private Map<String, Object> extraParams;
5195

5196
          /** Finalize and obtain parameter instance from this builder. */
5197
          public InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount build() {
5198
            return new InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount(
×
5199
                this.amount, this.currency, this.currencyOptions, this.extraParams);
5200
          }
5201

5202
          /**
5203
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5204
           * charge.
5205
           */
5206
          public Builder setAmount(Long amount) {
5207
            this.amount = amount;
×
5208
            return this;
×
5209
          }
5210

5211
          /**
5212
           * <strong>Required.</strong> Three-letter <a
5213
           * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5214
           * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
5215
           * currency</a>.
5216
           */
5217
          public Builder setCurrency(String currency) {
5218
            this.currency = currency;
×
5219
            return this;
×
5220
          }
5221

5222
          /**
5223
           * Add a key/value pair to `currencyOptions` map. A map is initialized for the first
5224
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5225
           * map. See {@link
5226
           * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the
5227
           * field documentation.
5228
           */
5229
          public Builder putCurrencyOption(
5230
              String key,
5231
              InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption value) {
5232
            if (this.currencyOptions == null) {
×
5233
              this.currencyOptions = new HashMap<>();
×
5234
            }
5235
            this.currencyOptions.put(key, value);
×
5236
            return this;
×
5237
          }
5238

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

5258
          /**
5259
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
5260
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5261
           * map. See {@link
5262
           * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount#extraParams} for the
5263
           * field documentation.
5264
           */
5265
          public Builder putExtraParam(String key, Object value) {
5266
            if (this.extraParams == null) {
×
5267
              this.extraParams = new HashMap<>();
×
5268
            }
5269
            this.extraParams.put(key, value);
×
5270
            return this;
×
5271
          }
5272

5273
          /**
5274
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5275
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5276
           * map. See {@link
5277
           * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount#extraParams} for the
5278
           * field documentation.
5279
           */
5280
          public Builder putAllExtraParam(Map<String, Object> map) {
5281
            if (this.extraParams == null) {
×
5282
              this.extraParams = new HashMap<>();
×
5283
            }
5284
            this.extraParams.putAll(map);
×
5285
            return this;
×
5286
          }
5287
        }
5288

5289
        @Getter
5290
        public static class CurrencyOption {
5291
          /**
5292
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5293
           * charge.
5294
           */
5295
          @SerializedName("amount")
5296
          Long amount;
5297

5298
          /**
5299
           * Map of extra parameters for custom features not available in this client library. The
5300
           * content in this map is not serialized under this field's {@code @SerializedName} value.
5301
           * Instead, each key/value pair is serialized as if the key is a root-level field
5302
           * (serialized) name in this param object. Effectively, this map is flattened to its
5303
           * parent instance.
5304
           */
5305
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5306
          Map<String, Object> extraParams;
5307

5308
          /**
5309
           * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One
5310
           * of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5311
           */
5312
          @SerializedName("tax_behavior")
5313
          TaxBehavior taxBehavior;
5314

5315
          private CurrencyOption(
5316
              Long amount, Map<String, Object> extraParams, TaxBehavior taxBehavior) {
×
5317
            this.amount = amount;
×
5318
            this.extraParams = extraParams;
×
5319
            this.taxBehavior = taxBehavior;
×
5320
          }
×
5321

5322
          public static Builder builder() {
5323
            return new Builder();
×
5324
          }
5325

5326
          public static class Builder {
×
5327
            private Long amount;
5328

5329
            private Map<String, Object> extraParams;
5330

5331
            private TaxBehavior taxBehavior;
5332

5333
            /** Finalize and obtain parameter instance from this builder. */
5334
            public InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5335
                build() {
5336
              return new InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount
×
5337
                  .CurrencyOption(this.amount, this.extraParams, this.taxBehavior);
5338
            }
5339

5340
            /**
5341
             * <strong>Required.</strong> A non-negative integer in cents representing how much to
5342
             * charge.
5343
             */
5344
            public Builder setAmount(Long amount) {
5345
              this.amount = amount;
×
5346
              return this;
×
5347
            }
5348

5349
            /**
5350
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
5351
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5352
             * original map. See {@link
5353
             * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption#extraParams}
5354
             * for the field documentation.
5355
             */
5356
            public Builder putExtraParam(String key, Object value) {
5357
              if (this.extraParams == null) {
×
5358
                this.extraParams = new HashMap<>();
×
5359
              }
5360
              this.extraParams.put(key, value);
×
5361
              return this;
×
5362
            }
5363

5364
            /**
5365
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5366
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5367
             * original map. See {@link
5368
             * InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption#extraParams}
5369
             * for the field documentation.
5370
             */
5371
            public Builder putAllExtraParam(Map<String, Object> map) {
5372
              if (this.extraParams == null) {
×
5373
                this.extraParams = new HashMap<>();
×
5374
              }
5375
              this.extraParams.putAll(map);
×
5376
              return this;
×
5377
            }
5378

5379
            /**
5380
             * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
5381
             * One of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5382
             */
5383
            public Builder setTaxBehavior(
5384
                InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5385
                        .TaxBehavior
5386
                    taxBehavior) {
5387
              this.taxBehavior = taxBehavior;
×
5388
              return this;
×
5389
            }
5390
          }
5391

5392
          public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5393
            @SerializedName("exclusive")
×
5394
            EXCLUSIVE("exclusive"),
5395

5396
            @SerializedName("inclusive")
×
5397
            INCLUSIVE("inclusive"),
5398

5399
            @SerializedName("unspecified")
×
5400
            UNSPECIFIED("unspecified");
5401

5402
            @Getter(onMethod_ = {@Override})
5403
            private final String value;
5404

5405
            TaxBehavior(String value) {
×
5406
              this.value = value;
×
5407
            }
×
5408
          }
5409
        }
5410
      }
5411

5412
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5413
        @SerializedName("exclusive")
×
5414
        EXCLUSIVE("exclusive"),
5415

5416
        @SerializedName("inclusive")
×
5417
        INCLUSIVE("inclusive"),
5418

5419
        @SerializedName("unspecified")
×
5420
        UNSPECIFIED("unspecified");
5421

5422
        @Getter(onMethod_ = {@Override})
5423
        private final String value;
5424

5425
        TaxBehavior(String value) {
×
5426
          this.value = value;
×
5427
        }
×
5428
      }
5429

5430
      public enum Type implements ApiRequestParams.EnumParam {
×
5431
        @SerializedName("fixed_amount")
×
5432
        FIXED_AMOUNT("fixed_amount");
5433

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

5437
        Type(String value) {
×
5438
          this.value = value;
×
5439
        }
×
5440
      }
5441
    }
5442
  }
5443

5444
  @Getter
5445
  public static class ShippingDetails {
5446
    /** <strong>Required.</strong> Shipping address */
5447
    @SerializedName("address")
5448
    Address address;
5449

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

5459
    /** <strong>Required.</strong> Recipient name. */
5460
    @SerializedName("name")
5461
    String name;
5462

5463
    /** Recipient phone (including extension). */
5464
    @SerializedName("phone")
5465
    Object phone;
5466

5467
    private ShippingDetails(
5468
        Address address, Map<String, Object> extraParams, String name, Object phone) {
×
5469
      this.address = address;
×
5470
      this.extraParams = extraParams;
×
5471
      this.name = name;
×
5472
      this.phone = phone;
×
5473
    }
×
5474

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

5479
    public static class Builder {
×
5480
      private Address address;
5481

5482
      private Map<String, Object> extraParams;
5483

5484
      private String name;
5485

5486
      private Object phone;
5487

5488
      /** Finalize and obtain parameter instance from this builder. */
5489
      public InvoiceCreateParams.ShippingDetails build() {
5490
        return new InvoiceCreateParams.ShippingDetails(
×
5491
            this.address, this.extraParams, this.name, this.phone);
5492
      }
5493

5494
      /** <strong>Required.</strong> Shipping address */
5495
      public Builder setAddress(InvoiceCreateParams.ShippingDetails.Address address) {
5496
        this.address = address;
×
5497
        return this;
×
5498
      }
5499

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

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

5526
      /** <strong>Required.</strong> Recipient name. */
5527
      public Builder setName(String name) {
5528
        this.name = name;
×
5529
        return this;
×
5530
      }
5531

5532
      /** Recipient phone (including extension). */
5533
      public Builder setPhone(String phone) {
5534
        this.phone = phone;
×
5535
        return this;
×
5536
      }
5537

5538
      /** Recipient phone (including extension). */
5539
      public Builder setPhone(EmptyParam phone) {
5540
        this.phone = phone;
×
5541
        return this;
×
5542
      }
5543
    }
5544

5545
    @Getter
5546
    public static class Address {
5547
      /** City, district, suburb, town, or village. */
5548
      @SerializedName("city")
5549
      String city;
5550

5551
      /**
5552
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5553
       * 3166-1 alpha-2</a>).
5554
       */
5555
      @SerializedName("country")
5556
      String country;
5557

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

5567
      /** Address line 1 (e.g., street, PO Box, or company name). */
5568
      @SerializedName("line1")
5569
      String line1;
5570

5571
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
5572
      @SerializedName("line2")
5573
      String line2;
5574

5575
      /** ZIP or postal code. */
5576
      @SerializedName("postal_code")
5577
      String postalCode;
5578

5579
      /** State, county, province, or region. */
5580
      @SerializedName("state")
5581
      String state;
5582

5583
      private Address(
5584
          String city,
5585
          String country,
5586
          Map<String, Object> extraParams,
5587
          String line1,
5588
          String line2,
5589
          String postalCode,
5590
          String state) {
×
5591
        this.city = city;
×
5592
        this.country = country;
×
5593
        this.extraParams = extraParams;
×
5594
        this.line1 = line1;
×
5595
        this.line2 = line2;
×
5596
        this.postalCode = postalCode;
×
5597
        this.state = state;
×
5598
      }
×
5599

5600
      public static Builder builder() {
5601
        return new Builder();
×
5602
      }
5603

5604
      public static class Builder {
×
5605
        private String city;
5606

5607
        private String country;
5608

5609
        private Map<String, Object> extraParams;
5610

5611
        private String line1;
5612

5613
        private String line2;
5614

5615
        private String postalCode;
5616

5617
        private String state;
5618

5619
        /** Finalize and obtain parameter instance from this builder. */
5620
        public InvoiceCreateParams.ShippingDetails.Address build() {
5621
          return new InvoiceCreateParams.ShippingDetails.Address(
×
5622
              this.city,
5623
              this.country,
5624
              this.extraParams,
5625
              this.line1,
5626
              this.line2,
5627
              this.postalCode,
5628
              this.state);
5629
        }
5630

5631
        /** City, district, suburb, town, or village. */
5632
        public Builder setCity(String city) {
5633
          this.city = city;
×
5634
          return this;
×
5635
        }
5636

5637
        /**
5638
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5639
         * 3166-1 alpha-2</a>).
5640
         */
5641
        public Builder setCountry(String country) {
5642
          this.country = country;
×
5643
          return this;
×
5644
        }
5645

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

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

5674
        /** Address line 1 (e.g., street, PO Box, or company name). */
5675
        public Builder setLine1(String line1) {
5676
          this.line1 = line1;
×
5677
          return this;
×
5678
        }
5679

5680
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
5681
        public Builder setLine2(String line2) {
5682
          this.line2 = line2;
×
5683
          return this;
×
5684
        }
5685

5686
        /** ZIP or postal code. */
5687
        public Builder setPostalCode(String postalCode) {
5688
          this.postalCode = postalCode;
×
5689
          return this;
×
5690
        }
5691

5692
        /** State, county, province, or region. */
5693
        public Builder setState(String state) {
5694
          this.state = state;
×
5695
          return this;
×
5696
        }
5697
      }
5698
    }
5699
  }
5700

5701
  @Getter
5702
  public static class TransferData {
5703
    /**
5704
     * The amount that will be transferred automatically when the invoice is paid. If no amount is
5705
     * set, the full amount is transferred.
5706
     */
5707
    @SerializedName("amount")
5708
    Long amount;
5709

5710
    /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5711
    @SerializedName("destination")
5712
    String destination;
5713

5714
    /**
5715
     * Map of extra parameters for custom features not available in this client library. The content
5716
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5717
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5718
     * param object. Effectively, this map is flattened to its parent instance.
5719
     */
5720
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5721
    Map<String, Object> extraParams;
5722

5723
    private TransferData(Long amount, String destination, Map<String, Object> extraParams) {
×
5724
      this.amount = amount;
×
5725
      this.destination = destination;
×
5726
      this.extraParams = extraParams;
×
5727
    }
×
5728

5729
    public static Builder builder() {
5730
      return new Builder();
×
5731
    }
5732

5733
    public static class Builder {
×
5734
      private Long amount;
5735

5736
      private String destination;
5737

5738
      private Map<String, Object> extraParams;
5739

5740
      /** Finalize and obtain parameter instance from this builder. */
5741
      public InvoiceCreateParams.TransferData build() {
5742
        return new InvoiceCreateParams.TransferData(
×
5743
            this.amount, this.destination, this.extraParams);
5744
      }
5745

5746
      /**
5747
       * The amount that will be transferred automatically when the invoice is paid. If no amount is
5748
       * set, the full amount is transferred.
5749
       */
5750
      public Builder setAmount(Long amount) {
5751
        this.amount = amount;
×
5752
        return this;
×
5753
      }
5754

5755
      /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5756
      public Builder setDestination(String destination) {
5757
        this.destination = destination;
×
5758
        return this;
×
5759
      }
5760

5761
      /**
5762
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5763
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5764
       * InvoiceCreateParams.TransferData#extraParams} for the field documentation.
5765
       */
5766
      public Builder putExtraParam(String key, Object value) {
5767
        if (this.extraParams == null) {
×
5768
          this.extraParams = new HashMap<>();
×
5769
        }
5770
        this.extraParams.put(key, value);
×
5771
        return this;
×
5772
      }
5773

5774
      /**
5775
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5776
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5777
       * See {@link InvoiceCreateParams.TransferData#extraParams} for the field documentation.
5778
       */
5779
      public Builder putAllExtraParam(Map<String, Object> map) {
5780
        if (this.extraParams == null) {
×
5781
          this.extraParams = new HashMap<>();
×
5782
        }
5783
        this.extraParams.putAll(map);
×
5784
        return this;
×
5785
      }
5786
    }
5787
  }
5788

5789
  public enum CollectionMethod implements ApiRequestParams.EnumParam {
×
5790
    @SerializedName("charge_automatically")
×
5791
    CHARGE_AUTOMATICALLY("charge_automatically"),
5792

5793
    @SerializedName("send_invoice")
×
5794
    SEND_INVOICE("send_invoice");
5795

5796
    @Getter(onMethod_ = {@Override})
5797
    private final String value;
5798

5799
    CollectionMethod(String value) {
×
5800
      this.value = value;
×
5801
    }
×
5802
  }
5803

5804
  public enum PendingInvoiceItemsBehavior implements ApiRequestParams.EnumParam {
×
5805
    @SerializedName("exclude")
×
5806
    EXCLUDE("exclude"),
5807

5808
    @SerializedName("include")
×
5809
    INCLUDE("include");
5810

5811
    @Getter(onMethod_ = {@Override})
5812
    private final String value;
5813

5814
    PendingInvoiceItemsBehavior(String value) {
×
5815
      this.value = value;
×
5816
    }
×
5817
  }
5818
}
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