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

stripe / stripe-java / #16624

07 Nov 2024 10:04PM UTC coverage: 12.419% (-0.1%) from 12.519%
#16624

push

github

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

Update generated code for beta

17 of 1341 new or added lines in 57 files covered. (1.27%)

33 existing lines in 29 files now uncovered.

18855 of 151828 relevant lines covered (12.42%)

0.12 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) {
570
      this.automaticallyFinalizesAt = automaticallyFinalizesAt;
×
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;
×
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) {
2385
          this.idBankTransfer = idBankTransfer;
×
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) {
2394
          this.idBankTransfer = idBankTransfer;
×
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

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

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

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() {
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) {
3479
            if (this.extraParams == null) {
×
3480
              this.extraParams = new HashMap<>();
×
3481
            }
3482
            this.extraParams.put(key, value);
×
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) {
3494
            if (this.extraParams == null) {
×
3495
              this.extraParams = new HashMap<>();
×
3496
            }
3497
            this.extraParams.putAll(map);
×
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

NEW
4162
      @SerializedName("custom")
×
4163
      CUSTOM("custom"),
4164

UNCOV
4165
      @SerializedName("customer_balance")
×
4166
      CUSTOMER_BALANCE("customer_balance"),
4167

4168
      @SerializedName("eps")
×
4169
      EPS("eps"),
4170

4171
      @SerializedName("fpx")
×
4172
      FPX("fpx"),
4173

4174
      @SerializedName("giropay")
×
4175
      GIROPAY("giropay"),
4176

4177
      @SerializedName("grabpay")
×
4178
      GRABPAY("grabpay"),
4179

4180
      @SerializedName("id_bank_transfer")
×
4181
      ID_BANK_TRANSFER("id_bank_transfer"),
4182

4183
      @SerializedName("ideal")
×
4184
      IDEAL("ideal"),
4185

4186
      @SerializedName("jp_credit_transfer")
×
4187
      JP_CREDIT_TRANSFER("jp_credit_transfer"),
4188

4189
      @SerializedName("kakao_pay")
×
4190
      KAKAO_PAY("kakao_pay"),
4191

4192
      @SerializedName("konbini")
×
4193
      KONBINI("konbini"),
4194

4195
      @SerializedName("kr_card")
×
4196
      KR_CARD("kr_card"),
4197

4198
      @SerializedName("link")
×
4199
      LINK("link"),
4200

4201
      @SerializedName("multibanco")
×
4202
      MULTIBANCO("multibanco"),
4203

4204
      @SerializedName("naver_pay")
×
4205
      NAVER_PAY("naver_pay"),
4206

4207
      @SerializedName("p24")
×
4208
      P24("p24"),
4209

4210
      @SerializedName("payco")
×
4211
      PAYCO("payco"),
4212

4213
      @SerializedName("paynow")
×
4214
      PAYNOW("paynow"),
4215

4216
      @SerializedName("paypal")
×
4217
      PAYPAL("paypal"),
4218

4219
      @SerializedName("promptpay")
×
4220
      PROMPTPAY("promptpay"),
4221

4222
      @SerializedName("revolut_pay")
×
4223
      REVOLUT_PAY("revolut_pay"),
4224

4225
      @SerializedName("sepa_credit_transfer")
×
4226
      SEPA_CREDIT_TRANSFER("sepa_credit_transfer"),
4227

4228
      @SerializedName("sepa_debit")
×
4229
      SEPA_DEBIT("sepa_debit"),
4230

4231
      @SerializedName("sofort")
×
4232
      SOFORT("sofort"),
4233

4234
      @SerializedName("swish")
×
4235
      SWISH("swish"),
4236

4237
      @SerializedName("us_bank_account")
×
4238
      US_BANK_ACCOUNT("us_bank_account"),
4239

4240
      @SerializedName("wechat_pay")
×
4241
      WECHAT_PAY("wechat_pay");
4242

4243
      @Getter(onMethod_ = {@Override})
4244
      private final String value;
4245

4246
      PaymentMethodType(String value) {
×
4247
        this.value = value;
×
4248
      }
×
4249
    }
4250
  }
4251

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

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

4272
    /** Invoice pdf rendering options. */
4273
    @SerializedName("pdf")
4274
    Pdf pdf;
4275

4276
    /** ID of the invoice rendering template to use for this invoice. */
4277
    @SerializedName("template")
4278
    String template;
4279

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

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

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

4301
    public static class Builder {
×
4302
      private ApiRequestParams.EnumParam amountTaxDisplay;
4303

4304
      private Map<String, Object> extraParams;
4305

4306
      private Pdf pdf;
4307

4308
      private String template;
4309

4310
      private Object templateVersion;
4311

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

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

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

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

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

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

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

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

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

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

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

4411
      private Pdf(Map<String, Object> extraParams, PageSize pageSize) {
×
4412
        this.extraParams = extraParams;
×
4413
        this.pageSize = pageSize;
×
4414
      }
×
4415

4416
      public static Builder builder() {
4417
        return new Builder();
×
4418
      }
4419

4420
      public static class Builder {
×
4421
        private Map<String, Object> extraParams;
4422

4423
        private PageSize pageSize;
4424

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

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

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

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

4469
      public enum PageSize implements ApiRequestParams.EnumParam {
×
4470
        @SerializedName("a4")
×
4471
        A4("a4"),
4472

4473
        @SerializedName("auto")
×
4474
        AUTO("auto"),
4475

4476
        @SerializedName("letter")
×
4477
        LETTER("letter");
4478

4479
        @Getter(onMethod_ = {@Override})
4480
        private final String value;
4481

4482
        PageSize(String value) {
×
4483
          this.value = value;
×
4484
        }
×
4485
      }
4486
    }
4487

4488
    public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
4489
      @SerializedName("exclude_tax")
×
4490
      EXCLUDE_TAX("exclude_tax"),
4491

4492
      @SerializedName("include_inclusive_tax")
×
4493
      INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
4494

4495
      @Getter(onMethod_ = {@Override})
4496
      private final String value;
4497

4498
      AmountTaxDisplay(String value) {
×
4499
        this.value = value;
×
4500
      }
×
4501
    }
4502
  }
4503

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

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

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

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

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

4534
    public static class Builder {
×
4535
      private Map<String, Object> extraParams;
4536

4537
      private String shippingRate;
4538

4539
      private ShippingRateData shippingRateData;
4540

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

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

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

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

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

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

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

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

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

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

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

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

4642
      /** The type of calculation to use on the shipping rate. */
4643
      @SerializedName("type")
4644
      Type type;
4645

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

4665
      public static Builder builder() {
4666
        return new Builder();
×
4667
      }
4668

4669
      public static class Builder {
×
4670
        private DeliveryEstimate deliveryEstimate;
4671

4672
        private String displayName;
4673

4674
        private Map<String, Object> extraParams;
4675

4676
        private FixedAmount fixedAmount;
4677

4678
        private Map<String, String> metadata;
4679

4680
        private TaxBehavior taxBehavior;
4681

4682
        private String taxCode;
4683

4684
        private Type type;
4685

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4839
        public static Builder builder() {
4840
          return new Builder();
×
4841
        }
4842

4843
        public static class Builder {
×
4844
          private Map<String, Object> extraParams;
4845

4846
          private Maximum maximum;
4847

4848
          private Minimum minimum;
4849

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

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

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

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

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

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

4916
          /** <strong>Required.</strong> A unit of time. */
4917
          @SerializedName("unit")
4918
          Unit unit;
4919

4920
          /** <strong>Required.</strong> Must be greater than 0. */
4921
          @SerializedName("value")
4922
          Long value;
4923

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

4930
          public static Builder builder() {
4931
            return new Builder();
×
4932
          }
4933

4934
          public static class Builder {
×
4935
            private Map<String, Object> extraParams;
4936

4937
            private Unit unit;
4938

4939
            private Long value;
4940

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

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

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

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

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

4993
          public enum Unit implements ApiRequestParams.EnumParam {
×
4994
            @SerializedName("business_day")
×
4995
            BUSINESS_DAY("business_day"),
4996

4997
            @SerializedName("day")
×
4998
            DAY("day"),
4999

5000
            @SerializedName("hour")
×
5001
            HOUR("hour"),
5002

5003
            @SerializedName("month")
×
5004
            MONTH("month"),
5005

5006
            @SerializedName("week")
×
5007
            WEEK("week");
5008

5009
            @Getter(onMethod_ = {@Override})
5010
            private final String value;
5011

5012
            Unit(String value) {
×
5013
              this.value = value;
×
5014
            }
×
5015
          }
5016
        }
5017

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

5030
          /** <strong>Required.</strong> A unit of time. */
5031
          @SerializedName("unit")
5032
          Unit unit;
5033

5034
          /** <strong>Required.</strong> Must be greater than 0. */
5035
          @SerializedName("value")
5036
          Long value;
5037

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

5044
          public static Builder builder() {
5045
            return new Builder();
×
5046
          }
5047

5048
          public static class Builder {
×
5049
            private Map<String, Object> extraParams;
5050

5051
            private Unit unit;
5052

5053
            private Long value;
5054

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

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

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

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

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

5107
          public enum Unit implements ApiRequestParams.EnumParam {
×
5108
            @SerializedName("business_day")
×
5109
            BUSINESS_DAY("business_day"),
5110

5111
            @SerializedName("day")
×
5112
            DAY("day"),
5113

5114
            @SerializedName("hour")
×
5115
            HOUR("hour"),
5116

5117
            @SerializedName("month")
×
5118
            MONTH("month"),
5119

5120
            @SerializedName("week")
×
5121
            WEEK("week");
5122

5123
            @Getter(onMethod_ = {@Override})
5124
            private final String value;
5125

5126
            Unit(String value) {
×
5127
              this.value = value;
×
5128
            }
×
5129
          }
5130
        }
5131
      }
5132

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

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

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

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

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

5183
        public static Builder builder() {
5184
          return new Builder();
×
5185
        }
5186

5187
        public static class Builder {
×
5188
          private Long amount;
5189

5190
          private String currency;
5191

5192
          private Map<
5193
                  String,
5194
                  InvoiceCreateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5195
              currencyOptions;
5196

5197
          private Map<String, Object> extraParams;
5198

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

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

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

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

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

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

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

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

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

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

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

5325
          public static Builder builder() {
5326
            return new Builder();
×
5327
          }
5328

5329
          public static class Builder {
×
5330
            private Long amount;
5331

5332
            private Map<String, Object> extraParams;
5333

5334
            private TaxBehavior taxBehavior;
5335

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

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

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

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

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

5395
          public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5396
            @SerializedName("exclusive")
×
5397
            EXCLUSIVE("exclusive"),
5398

5399
            @SerializedName("inclusive")
×
5400
            INCLUSIVE("inclusive"),
5401

5402
            @SerializedName("unspecified")
×
5403
            UNSPECIFIED("unspecified");
5404

5405
            @Getter(onMethod_ = {@Override})
5406
            private final String value;
5407

5408
            TaxBehavior(String value) {
×
5409
              this.value = value;
×
5410
            }
×
5411
          }
5412
        }
5413
      }
5414

5415
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5416
        @SerializedName("exclusive")
×
5417
        EXCLUSIVE("exclusive"),
5418

5419
        @SerializedName("inclusive")
×
5420
        INCLUSIVE("inclusive"),
5421

5422
        @SerializedName("unspecified")
×
5423
        UNSPECIFIED("unspecified");
5424

5425
        @Getter(onMethod_ = {@Override})
5426
        private final String value;
5427

5428
        TaxBehavior(String value) {
×
5429
          this.value = value;
×
5430
        }
×
5431
      }
5432

5433
      public enum Type implements ApiRequestParams.EnumParam {
×
5434
        @SerializedName("fixed_amount")
×
5435
        FIXED_AMOUNT("fixed_amount");
5436

5437
        @Getter(onMethod_ = {@Override})
5438
        private final String value;
5439

5440
        Type(String value) {
×
5441
          this.value = value;
×
5442
        }
×
5443
      }
5444
    }
5445
  }
5446

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

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

5462
    /** <strong>Required.</strong> Recipient name. */
5463
    @SerializedName("name")
5464
    String name;
5465

5466
    /** Recipient phone (including extension). */
5467
    @SerializedName("phone")
5468
    Object phone;
5469

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

5478
    public static Builder builder() {
5479
      return new Builder();
×
5480
    }
5481

5482
    public static class Builder {
×
5483
      private Address address;
5484

5485
      private Map<String, Object> extraParams;
5486

5487
      private String name;
5488

5489
      private Object phone;
5490

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

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

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

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

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

5535
      /** Recipient phone (including extension). */
5536
      public Builder setPhone(String phone) {
5537
        this.phone = phone;
×
5538
        return this;
×
5539
      }
5540

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

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

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

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

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

5574
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
5575
      @SerializedName("line2")
5576
      String line2;
5577

5578
      /** ZIP or postal code. */
5579
      @SerializedName("postal_code")
5580
      String postalCode;
5581

5582
      /** State, county, province, or region. */
5583
      @SerializedName("state")
5584
      String state;
5585

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

5603
      public static Builder builder() {
5604
        return new Builder();
×
5605
      }
5606

5607
      public static class Builder {
×
5608
        private String city;
5609

5610
        private String country;
5611

5612
        private Map<String, Object> extraParams;
5613

5614
        private String line1;
5615

5616
        private String line2;
5617

5618
        private String postalCode;
5619

5620
        private String state;
5621

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

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

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

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

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

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

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

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

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

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

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

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

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

5732
    public static Builder builder() {
5733
      return new Builder();
×
5734
    }
5735

5736
    public static class Builder {
×
5737
      private Long amount;
5738

5739
      private String destination;
5740

5741
      private Map<String, Object> extraParams;
5742

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

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

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

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

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

5792
  public enum CollectionMethod implements ApiRequestParams.EnumParam {
×
5793
    @SerializedName("charge_automatically")
×
5794
    CHARGE_AUTOMATICALLY("charge_automatically"),
5795

5796
    @SerializedName("send_invoice")
×
5797
    SEND_INVOICE("send_invoice");
5798

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

5802
    CollectionMethod(String value) {
×
5803
      this.value = value;
×
5804
    }
×
5805
  }
5806

5807
  public enum PendingInvoiceItemsBehavior implements ApiRequestParams.EnumParam {
×
5808
    @SerializedName("exclude")
×
5809
    EXCLUDE("exclude"),
5810

5811
    @SerializedName("include")
×
5812
    INCLUDE("include");
5813

5814
    @Getter(onMethod_ = {@Override})
5815
    private final String value;
5816

5817
    PendingInvoiceItemsBehavior(String value) {
×
5818
      this.value = value;
×
5819
    }
×
5820
  }
5821
}
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