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

stripe / stripe-java / #16418

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

push

github

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

Update generated code for beta

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

10 existing lines in 8 files now uncovered.

18470 of 143664 relevant lines covered (12.86%)

0.13 hits per line

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

4.73
/src/main/java/com/stripe/param/InvoiceUpdateParams.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 InvoiceUpdateParams 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.
40
   */
41
  @SerializedName("auto_advance")
42
  Boolean autoAdvance;
43

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

48
  /**
49
   * Either {@code charge_automatically} or {@code send_invoice}. This field can be updated only on
50
   * {@code draft} invoices.
51
   */
52
  @SerializedName("collection_method")
53
  CollectionMethod collectionMethod;
54

55
  /**
56
   * A list of up to 4 custom fields to be displayed on the invoice. If a value for {@code
57
   * custom_fields} is specified, the list specified will replace the existing custom field list on
58
   * this invoice. Pass an empty string to remove previously-defined fields.
59
   */
60
  @SerializedName("custom_fields")
61
  Object customFields;
62

63
  /**
64
   * The number of days from which the invoice is created until it is due. Only valid for invoices
65
   * where {@code collection_method=send_invoice}. This field can only be updated on {@code draft}
66
   * invoices.
67
   */
68
  @SerializedName("days_until_due")
69
  Long daysUntilDue;
70

71
  /**
72
   * The ids of the margins to apply to the invoice. Can be overridden by line item {@code margins}.
73
   */
74
  @SerializedName("default_margins")
75
  Object defaultMargins;
76

77
  /**
78
   * ID of the default payment method for the invoice. It must belong to the customer associated
79
   * with the invoice. If not set, defaults to the subscription's default payment method, if any, or
80
   * to the default payment method in the customer's invoice settings.
81
   */
82
  @SerializedName("default_payment_method")
83
  Object defaultPaymentMethod;
84

85
  /**
86
   * ID of the default payment source for the invoice. It must belong to the customer associated
87
   * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
88
   * default source, if any, or to the customer's default source.
89
   */
90
  @SerializedName("default_source")
91
  Object defaultSource;
92

93
  /**
94
   * The tax rates that will apply to any line item that does not have {@code tax_rates} set. Pass
95
   * an empty string to remove previously-defined tax rates.
96
   */
97
  @SerializedName("default_tax_rates")
98
  Object defaultTaxRates;
99

100
  /**
101
   * An arbitrary string attached to the object. Often useful for displaying to users. Referenced as
102
   * 'memo' in the Dashboard.
103
   */
104
  @SerializedName("description")
105
  Object description;
106

107
  /**
108
   * The discounts that will apply to the invoice. Pass an empty string to remove previously-defined
109
   * discounts.
110
   */
111
  @SerializedName("discounts")
112
  Object discounts;
113

114
  /**
115
   * The date on which payment for this invoice is due. Only valid for invoices where {@code
116
   * collection_method=send_invoice}. This field can only be updated on {@code draft} invoices.
117
   */
118
  @SerializedName("due_date")
119
  Long dueDate;
120

121
  /**
122
   * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten. When
123
   * defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF
124
   * and receipt.
125
   */
126
  @SerializedName("effective_at")
127
  Object effectiveAt;
128

129
  /** Specifies which fields in the response should be expanded. */
130
  @SerializedName("expand")
131
  List<String> expand;
132

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

142
  /** Footer to be displayed on the invoice. */
143
  @SerializedName("footer")
144
  Object footer;
145

146
  /**
147
   * The connected account that issues the invoice. The invoice is presented with the branding and
148
   * support information of the specified account.
149
   */
150
  @SerializedName("issuer")
151
  Issuer issuer;
152

153
  /**
154
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
155
   * to an object. This can be useful for storing additional information about the object in a
156
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
157
   * be unset by posting an empty value to {@code metadata}.
158
   */
159
  @SerializedName("metadata")
160
  Object metadata;
161

162
  /**
163
   * Set the number for this invoice. If no number is present then a number will be assigned
164
   * automatically when the invoice is finalized. In many markets, regulations require invoices to
165
   * be unique, sequential and / or gapless. You are responsible for ensuring this is true across
166
   * all your different invoicing systems in the event that you edit the invoice number using our
167
   * API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles
168
   * this aspect of compliance for you automatically.
169
   */
170
  @SerializedName("number")
171
  Object number;
172

173
  /**
174
   * The account (if any) for which the funds of the invoice payment are intended. If set, the
175
   * invoice will be presented with the branding and support information of the specified account.
176
   * See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a>
177
   * documentation for details.
178
   */
179
  @SerializedName("on_behalf_of")
180
  Object onBehalfOf;
181

182
  /**
183
   * Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
184
   */
185
  @SerializedName("payment_settings")
186
  PaymentSettings paymentSettings;
187

188
  /**
189
   * The rendering-related settings that control how the invoice is displayed on customer-facing
190
   * surfaces such as PDF and Hosted Invoice Page.
191
   */
192
  @SerializedName("rendering")
193
  Rendering rendering;
194

195
  /** Settings for the cost of shipping for this invoice. */
196
  @SerializedName("shipping_cost")
197
  Object shippingCost;
198

199
  /**
200
   * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
201
   * if it is set, otherwise the PDF will render the shipping address from the customer.
202
   */
203
  @SerializedName("shipping_details")
204
  Object shippingDetails;
205

206
  /**
207
   * Extra information about a charge for the customer's credit card statement. It must contain at
208
   * least one letter. If not specified and this invoice is part of a subscription, the default
209
   * {@code statement_descriptor} will be set to the first subscription item's product's {@code
210
   * statement_descriptor}.
211
   */
212
  @SerializedName("statement_descriptor")
213
  Object statementDescriptor;
214

215
  /**
216
   * If specified, the funds from the invoice will be transferred to the destination and the ID of
217
   * the resulting transfer will be found on the invoice's charge. This will be unset if you POST an
218
   * empty value.
219
   */
220
  @SerializedName("transfer_data")
221
  Object transferData;
222

223
  private InvoiceUpdateParams(
224
      Object accountTaxIds,
225
      Object amountsDue,
226
      Long applicationFeeAmount,
227
      Boolean autoAdvance,
228
      AutomaticTax automaticTax,
229
      CollectionMethod collectionMethod,
230
      Object customFields,
231
      Long daysUntilDue,
232
      Object defaultMargins,
233
      Object defaultPaymentMethod,
234
      Object defaultSource,
235
      Object defaultTaxRates,
236
      Object description,
237
      Object discounts,
238
      Long dueDate,
239
      Object effectiveAt,
240
      List<String> expand,
241
      Map<String, Object> extraParams,
242
      Object footer,
243
      Issuer issuer,
244
      Object metadata,
245
      Object number,
246
      Object onBehalfOf,
247
      PaymentSettings paymentSettings,
248
      Rendering rendering,
249
      Object shippingCost,
250
      Object shippingDetails,
251
      Object statementDescriptor,
252
      Object transferData) {
1✔
253
    this.accountTaxIds = accountTaxIds;
1✔
254
    this.amountsDue = amountsDue;
1✔
255
    this.applicationFeeAmount = applicationFeeAmount;
1✔
256
    this.autoAdvance = autoAdvance;
1✔
257
    this.automaticTax = automaticTax;
1✔
258
    this.collectionMethod = collectionMethod;
1✔
259
    this.customFields = customFields;
1✔
260
    this.daysUntilDue = daysUntilDue;
1✔
261
    this.defaultMargins = defaultMargins;
1✔
262
    this.defaultPaymentMethod = defaultPaymentMethod;
1✔
263
    this.defaultSource = defaultSource;
1✔
264
    this.defaultTaxRates = defaultTaxRates;
1✔
265
    this.description = description;
1✔
266
    this.discounts = discounts;
1✔
267
    this.dueDate = dueDate;
1✔
268
    this.effectiveAt = effectiveAt;
1✔
269
    this.expand = expand;
1✔
270
    this.extraParams = extraParams;
1✔
271
    this.footer = footer;
1✔
272
    this.issuer = issuer;
1✔
273
    this.metadata = metadata;
1✔
274
    this.number = number;
1✔
275
    this.onBehalfOf = onBehalfOf;
1✔
276
    this.paymentSettings = paymentSettings;
1✔
277
    this.rendering = rendering;
1✔
278
    this.shippingCost = shippingCost;
1✔
279
    this.shippingDetails = shippingDetails;
1✔
280
    this.statementDescriptor = statementDescriptor;
1✔
281
    this.transferData = transferData;
1✔
282
  }
1✔
283

284
  public static Builder builder() {
285
    return new Builder();
1✔
286
  }
287

288
  public static class Builder {
1✔
289
    private Object accountTaxIds;
290

291
    private Object amountsDue;
292

293
    private Long applicationFeeAmount;
294

295
    private Boolean autoAdvance;
296

297
    private AutomaticTax automaticTax;
298

299
    private CollectionMethod collectionMethod;
300

301
    private Object customFields;
302

303
    private Long daysUntilDue;
304

305
    private Object defaultMargins;
306

307
    private Object defaultPaymentMethod;
308

309
    private Object defaultSource;
310

311
    private Object defaultTaxRates;
312

313
    private Object description;
314

315
    private Object discounts;
316

317
    private Long dueDate;
318

319
    private Object effectiveAt;
320

321
    private List<String> expand;
322

323
    private Map<String, Object> extraParams;
324

325
    private Object footer;
326

327
    private Issuer issuer;
328

329
    private Object metadata;
330

331
    private Object number;
332

333
    private Object onBehalfOf;
334

335
    private PaymentSettings paymentSettings;
336

337
    private Rendering rendering;
338

339
    private Object shippingCost;
340

341
    private Object shippingDetails;
342

343
    private Object statementDescriptor;
344

345
    private Object transferData;
346

347
    /** Finalize and obtain parameter instance from this builder. */
348
    public InvoiceUpdateParams build() {
349
      return new InvoiceUpdateParams(
1✔
350
          this.accountTaxIds,
351
          this.amountsDue,
352
          this.applicationFeeAmount,
353
          this.autoAdvance,
354
          this.automaticTax,
355
          this.collectionMethod,
356
          this.customFields,
357
          this.daysUntilDue,
358
          this.defaultMargins,
359
          this.defaultPaymentMethod,
360
          this.defaultSource,
361
          this.defaultTaxRates,
362
          this.description,
363
          this.discounts,
364
          this.dueDate,
365
          this.effectiveAt,
366
          this.expand,
367
          this.extraParams,
368
          this.footer,
369
          this.issuer,
370
          this.metadata,
371
          this.number,
372
          this.onBehalfOf,
373
          this.paymentSettings,
374
          this.rendering,
375
          this.shippingCost,
376
          this.shippingDetails,
377
          this.statementDescriptor,
378
          this.transferData);
379
    }
380

381
    /**
382
     * Add an element to `accountTaxIds` list. A list is initialized for the first `add/addAll`
383
     * call, and subsequent calls adds additional elements to the original list. See {@link
384
     * InvoiceUpdateParams#accountTaxIds} for the field documentation.
385
     */
386
    @SuppressWarnings("unchecked")
387
    public Builder addAccountTaxId(String element) {
388
      if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
389
        this.accountTaxIds = new ArrayList<String>();
×
390
      }
391
      ((List<String>) this.accountTaxIds).add(element);
×
392
      return this;
×
393
    }
394

395
    /**
396
     * Add all elements to `accountTaxIds` list. A list is initialized for the first `add/addAll`
397
     * call, and subsequent calls adds additional elements to the original list. See {@link
398
     * InvoiceUpdateParams#accountTaxIds} for the field documentation.
399
     */
400
    @SuppressWarnings("unchecked")
401
    public Builder addAllAccountTaxId(List<String> elements) {
402
      if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
403
        this.accountTaxIds = new ArrayList<String>();
×
404
      }
405
      ((List<String>) this.accountTaxIds).addAll(elements);
×
406
      return this;
×
407
    }
408

409
    /**
410
     * The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
411
     */
412
    public Builder setAccountTaxIds(EmptyParam accountTaxIds) {
413
      this.accountTaxIds = accountTaxIds;
×
414
      return this;
×
415
    }
416

417
    /**
418
     * The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
419
     */
420
    public Builder setAccountTaxIds(List<String> accountTaxIds) {
421
      this.accountTaxIds = accountTaxIds;
×
422
      return this;
×
423
    }
424

425
    /**
426
     * Add an element to `amountsDue` list. A list is initialized for the first `add/addAll` call,
427
     * and subsequent calls adds additional elements to the original list. See {@link
428
     * InvoiceUpdateParams#amountsDue} for the field documentation.
429
     */
430
    @SuppressWarnings("unchecked")
431
    public Builder addAmountsDue(InvoiceUpdateParams.AmountsDue element) {
432
      if (this.amountsDue == null || this.amountsDue instanceof EmptyParam) {
×
433
        this.amountsDue = new ArrayList<InvoiceUpdateParams.AmountsDue>();
×
434
      }
435
      ((List<InvoiceUpdateParams.AmountsDue>) this.amountsDue).add(element);
×
436
      return this;
×
437
    }
438

439
    /**
440
     * Add all elements to `amountsDue` list. A list is initialized for the first `add/addAll` call,
441
     * and subsequent calls adds additional elements to the original list. See {@link
442
     * InvoiceUpdateParams#amountsDue} for the field documentation.
443
     */
444
    @SuppressWarnings("unchecked")
445
    public Builder addAllAmountsDue(List<InvoiceUpdateParams.AmountsDue> elements) {
446
      if (this.amountsDue == null || this.amountsDue instanceof EmptyParam) {
×
447
        this.amountsDue = new ArrayList<InvoiceUpdateParams.AmountsDue>();
×
448
      }
449
      ((List<InvoiceUpdateParams.AmountsDue>) this.amountsDue).addAll(elements);
×
450
      return this;
×
451
    }
452

453
    /**
454
     * List of expected payments and corresponding due dates. Valid only for invoices where {@code
455
     * collection_method=send_invoice}.
456
     */
457
    public Builder setAmountsDue(EmptyParam amountsDue) {
458
      this.amountsDue = amountsDue;
×
459
      return this;
×
460
    }
461

462
    /**
463
     * List of expected payments and corresponding due dates. Valid only for invoices where {@code
464
     * collection_method=send_invoice}.
465
     */
466
    public Builder setAmountsDue(List<InvoiceUpdateParams.AmountsDue> amountsDue) {
467
      this.amountsDue = amountsDue;
×
468
      return this;
×
469
    }
470

471
    /**
472
     * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to
473
     * the application owner's Stripe account. The request must be made with an OAuth key or the
474
     * Stripe-Account header in order to take an application fee. For more information, see the
475
     * application fees <a
476
     * href="https://stripe.com/docs/billing/invoices/connect#collecting-fees">documentation</a>.
477
     */
478
    public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
479
      this.applicationFeeAmount = applicationFeeAmount;
×
480
      return this;
×
481
    }
482

483
    /**
484
     * Controls whether Stripe performs <a
485
     * href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">automatic
486
     * collection</a> of the invoice.
487
     */
488
    public Builder setAutoAdvance(Boolean autoAdvance) {
489
      this.autoAdvance = autoAdvance;
×
490
      return this;
×
491
    }
492

493
    /** Settings for automatic tax lookup for this invoice. */
494
    public Builder setAutomaticTax(InvoiceUpdateParams.AutomaticTax automaticTax) {
495
      this.automaticTax = automaticTax;
×
496
      return this;
×
497
    }
498

499
    /**
500
     * Either {@code charge_automatically} or {@code send_invoice}. This field can be updated only
501
     * on {@code draft} invoices.
502
     */
503
    public Builder setCollectionMethod(InvoiceUpdateParams.CollectionMethod collectionMethod) {
504
      this.collectionMethod = collectionMethod;
×
505
      return this;
×
506
    }
507

508
    /**
509
     * Add an element to `customFields` list. A list is initialized for the first `add/addAll` call,
510
     * and subsequent calls adds additional elements to the original list. See {@link
511
     * InvoiceUpdateParams#customFields} for the field documentation.
512
     */
513
    @SuppressWarnings("unchecked")
514
    public Builder addCustomField(InvoiceUpdateParams.CustomField element) {
515
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
516
        this.customFields = new ArrayList<InvoiceUpdateParams.CustomField>();
×
517
      }
518
      ((List<InvoiceUpdateParams.CustomField>) this.customFields).add(element);
×
519
      return this;
×
520
    }
521

522
    /**
523
     * Add all elements to `customFields` list. A list is initialized for the first `add/addAll`
524
     * call, and subsequent calls adds additional elements to the original list. See {@link
525
     * InvoiceUpdateParams#customFields} for the field documentation.
526
     */
527
    @SuppressWarnings("unchecked")
528
    public Builder addAllCustomField(List<InvoiceUpdateParams.CustomField> elements) {
529
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
530
        this.customFields = new ArrayList<InvoiceUpdateParams.CustomField>();
×
531
      }
532
      ((List<InvoiceUpdateParams.CustomField>) this.customFields).addAll(elements);
×
533
      return this;
×
534
    }
535

536
    /**
537
     * A list of up to 4 custom fields to be displayed on the invoice. If a value for {@code
538
     * custom_fields} is specified, the list specified will replace the existing custom field list
539
     * on this invoice. Pass an empty string to remove previously-defined fields.
540
     */
541
    public Builder setCustomFields(EmptyParam customFields) {
542
      this.customFields = customFields;
1✔
543
      return this;
1✔
544
    }
545

546
    /**
547
     * A list of up to 4 custom fields to be displayed on the invoice. If a value for {@code
548
     * custom_fields} is specified, the list specified will replace the existing custom field list
549
     * on this invoice. Pass an empty string to remove previously-defined fields.
550
     */
551
    public Builder setCustomFields(List<InvoiceUpdateParams.CustomField> customFields) {
552
      this.customFields = customFields;
1✔
553
      return this;
1✔
554
    }
555

556
    /**
557
     * The number of days from which the invoice is created until it is due. Only valid for invoices
558
     * where {@code collection_method=send_invoice}. This field can only be updated on {@code draft}
559
     * invoices.
560
     */
561
    public Builder setDaysUntilDue(Long daysUntilDue) {
562
      this.daysUntilDue = daysUntilDue;
×
563
      return this;
×
564
    }
565

566
    /**
567
     * Add an element to `defaultMargins` list. A list is initialized for the first `add/addAll`
568
     * call, and subsequent calls adds additional elements to the original list. See {@link
569
     * InvoiceUpdateParams#defaultMargins} for the field documentation.
570
     */
571
    @SuppressWarnings("unchecked")
572
    public Builder addDefaultMargin(String element) {
573
      if (this.defaultMargins == null || this.defaultMargins instanceof EmptyParam) {
×
574
        this.defaultMargins = new ArrayList<String>();
×
575
      }
576
      ((List<String>) this.defaultMargins).add(element);
×
577
      return this;
×
578
    }
579

580
    /**
581
     * Add all elements to `defaultMargins` list. A list is initialized for the first `add/addAll`
582
     * call, and subsequent calls adds additional elements to the original list. See {@link
583
     * InvoiceUpdateParams#defaultMargins} for the field documentation.
584
     */
585
    @SuppressWarnings("unchecked")
586
    public Builder addAllDefaultMargin(List<String> elements) {
587
      if (this.defaultMargins == null || this.defaultMargins instanceof EmptyParam) {
×
588
        this.defaultMargins = new ArrayList<String>();
×
589
      }
590
      ((List<String>) this.defaultMargins).addAll(elements);
×
591
      return this;
×
592
    }
593

594
    /**
595
     * The ids of the margins to apply to the invoice. Can be overridden by line item {@code
596
     * margins}.
597
     */
598
    public Builder setDefaultMargins(EmptyParam defaultMargins) {
599
      this.defaultMargins = defaultMargins;
×
600
      return this;
×
601
    }
602

603
    /**
604
     * The ids of the margins to apply to the invoice. Can be overridden by line item {@code
605
     * margins}.
606
     */
607
    public Builder setDefaultMargins(List<String> defaultMargins) {
608
      this.defaultMargins = defaultMargins;
×
609
      return this;
×
610
    }
611

612
    /**
613
     * ID of the default payment method for the invoice. It must belong to the customer associated
614
     * with the invoice. If not set, defaults to the subscription's default payment method, if any,
615
     * or to the default payment method in the customer's invoice settings.
616
     */
617
    public Builder setDefaultPaymentMethod(String defaultPaymentMethod) {
618
      this.defaultPaymentMethod = defaultPaymentMethod;
×
619
      return this;
×
620
    }
621

622
    /**
623
     * ID of the default payment method for the invoice. It must belong to the customer associated
624
     * with the invoice. If not set, defaults to the subscription's default payment method, if any,
625
     * or to the default payment method in the customer's invoice settings.
626
     */
627
    public Builder setDefaultPaymentMethod(EmptyParam defaultPaymentMethod) {
628
      this.defaultPaymentMethod = defaultPaymentMethod;
1✔
629
      return this;
1✔
630
    }
631

632
    /**
633
     * ID of the default payment source for the invoice. It must belong to the customer associated
634
     * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
635
     * default source, if any, or to the customer's default source.
636
     */
637
    public Builder setDefaultSource(String defaultSource) {
638
      this.defaultSource = defaultSource;
×
639
      return this;
×
640
    }
641

642
    /**
643
     * ID of the default payment source for the invoice. It must belong to the customer associated
644
     * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
645
     * default source, if any, or to the customer's default source.
646
     */
647
    public Builder setDefaultSource(EmptyParam defaultSource) {
648
      this.defaultSource = defaultSource;
×
649
      return this;
×
650
    }
651

652
    /**
653
     * Add an element to `defaultTaxRates` list. A list is initialized for the first `add/addAll`
654
     * call, and subsequent calls adds additional elements to the original list. See {@link
655
     * InvoiceUpdateParams#defaultTaxRates} for the field documentation.
656
     */
657
    @SuppressWarnings("unchecked")
658
    public Builder addDefaultTaxRate(String element) {
659
      if (this.defaultTaxRates == null || this.defaultTaxRates instanceof EmptyParam) {
×
660
        this.defaultTaxRates = new ArrayList<String>();
×
661
      }
662
      ((List<String>) this.defaultTaxRates).add(element);
×
663
      return this;
×
664
    }
665

666
    /**
667
     * Add all elements to `defaultTaxRates` list. A list is initialized for the first `add/addAll`
668
     * call, and subsequent calls adds additional elements to the original list. See {@link
669
     * InvoiceUpdateParams#defaultTaxRates} for the field documentation.
670
     */
671
    @SuppressWarnings("unchecked")
672
    public Builder addAllDefaultTaxRate(List<String> elements) {
673
      if (this.defaultTaxRates == null || this.defaultTaxRates instanceof EmptyParam) {
×
674
        this.defaultTaxRates = new ArrayList<String>();
×
675
      }
676
      ((List<String>) this.defaultTaxRates).addAll(elements);
×
677
      return this;
×
678
    }
679

680
    /**
681
     * The tax rates that will apply to any line item that does not have {@code tax_rates} set. Pass
682
     * an empty string to remove previously-defined tax rates.
683
     */
684
    public Builder setDefaultTaxRates(EmptyParam defaultTaxRates) {
685
      this.defaultTaxRates = defaultTaxRates;
×
686
      return this;
×
687
    }
688

689
    /**
690
     * The tax rates that will apply to any line item that does not have {@code tax_rates} set. Pass
691
     * an empty string to remove previously-defined tax rates.
692
     */
693
    public Builder setDefaultTaxRates(List<String> defaultTaxRates) {
694
      this.defaultTaxRates = defaultTaxRates;
×
695
      return this;
×
696
    }
697

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

707
    /**
708
     * An arbitrary string attached to the object. Often useful for displaying to users. Referenced
709
     * as 'memo' in the Dashboard.
710
     */
711
    public Builder setDescription(EmptyParam description) {
712
      this.description = description;
×
713
      return this;
×
714
    }
715

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

730
    /**
731
     * Add all elements 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
     * InvoiceUpdateParams#discounts} for the field documentation.
734
     */
735
    @SuppressWarnings("unchecked")
736
    public Builder addAllDiscount(List<InvoiceUpdateParams.Discount> elements) {
737
      if (this.discounts == null || this.discounts instanceof EmptyParam) {
×
738
        this.discounts = new ArrayList<InvoiceUpdateParams.Discount>();
×
739
      }
740
      ((List<InvoiceUpdateParams.Discount>) this.discounts).addAll(elements);
×
741
      return this;
×
742
    }
743

744
    /**
745
     * The discounts that will apply to the invoice. Pass an empty string to remove
746
     * previously-defined discounts.
747
     */
748
    public Builder setDiscounts(EmptyParam discounts) {
749
      this.discounts = discounts;
×
750
      return this;
×
751
    }
752

753
    /**
754
     * The discounts that will apply to the invoice. Pass an empty string to remove
755
     * previously-defined discounts.
756
     */
757
    public Builder setDiscounts(List<InvoiceUpdateParams.Discount> discounts) {
758
      this.discounts = discounts;
×
759
      return this;
×
760
    }
761

762
    /**
763
     * The date on which payment for this invoice is due. Only valid for invoices where {@code
764
     * collection_method=send_invoice}. This field can only be updated on {@code draft} invoices.
765
     */
766
    public Builder setDueDate(Long dueDate) {
767
      this.dueDate = dueDate;
×
768
      return this;
×
769
    }
770

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

781
    /**
782
     * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten.
783
     * When defined, this value replaces the system-generated 'Date of issue' printed on the invoice
784
     * PDF and receipt.
785
     */
786
    public Builder setEffectiveAt(EmptyParam effectiveAt) {
787
      this.effectiveAt = effectiveAt;
×
788
      return this;
×
789
    }
790

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

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

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

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

843
    /** Footer to be displayed on the invoice. */
844
    public Builder setFooter(String footer) {
845
      this.footer = footer;
×
846
      return this;
×
847
    }
848

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

855
    /**
856
     * The connected account that issues the invoice. The invoice is presented with the branding and
857
     * support information of the specified account.
858
     */
859
    public Builder setIssuer(InvoiceUpdateParams.Issuer issuer) {
860
      this.issuer = issuer;
×
861
      return this;
×
862
    }
863

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

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

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

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

914
    /**
915
     * Set the number for this invoice. If no number is present then a number will be assigned
916
     * automatically when the invoice is finalized. In many markets, regulations require invoices to
917
     * be unique, sequential and / or gapless. You are responsible for ensuring this is true across
918
     * all your different invoicing systems in the event that you edit the invoice number using our
919
     * API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe
920
     * handles this aspect of compliance for you automatically.
921
     */
922
    public Builder setNumber(String number) {
923
      this.number = number;
×
924
      return this;
×
925
    }
926

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

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

951
    /**
952
     * The account (if any) for which the funds of the invoice payment are intended. If set, the
953
     * invoice will be presented with the branding and support information of the specified account.
954
     * See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a>
955
     * documentation for details.
956
     */
957
    public Builder setOnBehalfOf(EmptyParam onBehalfOf) {
958
      this.onBehalfOf = onBehalfOf;
×
959
      return this;
×
960
    }
961

962
    /**
963
     * Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
964
     */
965
    public Builder setPaymentSettings(InvoiceUpdateParams.PaymentSettings paymentSettings) {
966
      this.paymentSettings = paymentSettings;
×
967
      return this;
×
968
    }
969

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

979
    /** Settings for the cost of shipping for this invoice. */
980
    public Builder setShippingCost(InvoiceUpdateParams.ShippingCost shippingCost) {
981
      this.shippingCost = shippingCost;
×
982
      return this;
×
983
    }
984

985
    /** Settings for the cost of shipping for this invoice. */
986
    public Builder setShippingCost(EmptyParam shippingCost) {
987
      this.shippingCost = shippingCost;
×
988
      return this;
×
989
    }
990

991
    /**
992
     * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
993
     * if it is set, otherwise the PDF will render the shipping address from the customer.
994
     */
995
    public Builder setShippingDetails(InvoiceUpdateParams.ShippingDetails shippingDetails) {
996
      this.shippingDetails = shippingDetails;
×
997
      return this;
×
998
    }
999

1000
    /**
1001
     * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
1002
     * if it is set, otherwise the PDF will render the shipping address from the customer.
1003
     */
1004
    public Builder setShippingDetails(EmptyParam shippingDetails) {
1005
      this.shippingDetails = shippingDetails;
×
1006
      return this;
×
1007
    }
1008

1009
    /**
1010
     * Extra information about a charge for the customer's credit card statement. It must contain at
1011
     * least one letter. If not specified and this invoice is part of a subscription, the default
1012
     * {@code statement_descriptor} will be set to the first subscription item's product's {@code
1013
     * statement_descriptor}.
1014
     */
1015
    public Builder setStatementDescriptor(String statementDescriptor) {
1016
      this.statementDescriptor = statementDescriptor;
×
1017
      return this;
×
1018
    }
1019

1020
    /**
1021
     * Extra information about a charge for the customer's credit card statement. It must contain at
1022
     * least one letter. If not specified and this invoice is part of a subscription, the default
1023
     * {@code statement_descriptor} will be set to the first subscription item's product's {@code
1024
     * statement_descriptor}.
1025
     */
1026
    public Builder setStatementDescriptor(EmptyParam statementDescriptor) {
1027
      this.statementDescriptor = statementDescriptor;
×
1028
      return this;
×
1029
    }
1030

1031
    /**
1032
     * If specified, the funds from the invoice will be transferred to the destination and the ID of
1033
     * the resulting transfer will be found on the invoice's charge. This will be unset if you POST
1034
     * an empty value.
1035
     */
1036
    public Builder setTransferData(InvoiceUpdateParams.TransferData transferData) {
1037
      this.transferData = transferData;
×
1038
      return this;
×
1039
    }
1040

1041
    /**
1042
     * If specified, the funds from the invoice will be transferred to the destination and the ID of
1043
     * the resulting transfer will be found on the invoice's charge. This will be unset if you POST
1044
     * an empty value.
1045
     */
1046
    public Builder setTransferData(EmptyParam transferData) {
1047
      this.transferData = transferData;
×
1048
      return this;
×
1049
    }
1050
  }
1051

1052
  @Getter
1053
  public static class AmountsDue {
1054
    /** <strong>Required.</strong> The amount in cents (or local equivalent). */
1055
    @SerializedName("amount")
1056
    Long amount;
1057

1058
    /** Number of days from when invoice is finalized until the payment is due. */
1059
    @SerializedName("days_until_due")
1060
    Long daysUntilDue;
1061

1062
    /**
1063
     * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1064
     * displaying to users.
1065
     */
1066
    @SerializedName("description")
1067
    Object description;
1068

1069
    /** Date on which a payment plan’s payment is due. */
1070
    @SerializedName("due_date")
1071
    Long dueDate;
1072

1073
    /**
1074
     * Map of extra parameters for custom features not available in this client library. The content
1075
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1076
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1077
     * param object. Effectively, this map is flattened to its parent instance.
1078
     */
1079
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1080
    Map<String, Object> extraParams;
1081

1082
    private AmountsDue(
1083
        Long amount,
1084
        Long daysUntilDue,
1085
        Object description,
1086
        Long dueDate,
1087
        Map<String, Object> extraParams) {
×
1088
      this.amount = amount;
×
1089
      this.daysUntilDue = daysUntilDue;
×
1090
      this.description = description;
×
1091
      this.dueDate = dueDate;
×
1092
      this.extraParams = extraParams;
×
1093
    }
×
1094

1095
    public static Builder builder() {
1096
      return new Builder();
×
1097
    }
1098

1099
    public static class Builder {
×
1100
      private Long amount;
1101

1102
      private Long daysUntilDue;
1103

1104
      private Object description;
1105

1106
      private Long dueDate;
1107

1108
      private Map<String, Object> extraParams;
1109

1110
      /** Finalize and obtain parameter instance from this builder. */
1111
      public InvoiceUpdateParams.AmountsDue build() {
1112
        return new InvoiceUpdateParams.AmountsDue(
×
1113
            this.amount, this.daysUntilDue, this.description, this.dueDate, this.extraParams);
1114
      }
1115

1116
      /** <strong>Required.</strong> The amount in cents (or local equivalent). */
1117
      public Builder setAmount(Long amount) {
1118
        this.amount = amount;
×
1119
        return this;
×
1120
      }
1121

1122
      /** Number of days from when invoice is finalized until the payment is due. */
1123
      public Builder setDaysUntilDue(Long daysUntilDue) {
1124
        this.daysUntilDue = daysUntilDue;
×
1125
        return this;
×
1126
      }
1127

1128
      /**
1129
       * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1130
       * displaying to users.
1131
       */
1132
      public Builder setDescription(String description) {
1133
        this.description = description;
×
1134
        return this;
×
1135
      }
1136

1137
      /**
1138
       * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1139
       * displaying to users.
1140
       */
1141
      public Builder setDescription(EmptyParam description) {
1142
        this.description = description;
×
1143
        return this;
×
1144
      }
1145

1146
      /** Date on which a payment plan’s payment is due. */
1147
      public Builder setDueDate(Long dueDate) {
1148
        this.dueDate = dueDate;
×
1149
        return this;
×
1150
      }
1151

1152
      /**
1153
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1154
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1155
       * InvoiceUpdateParams.AmountsDue#extraParams} for the field documentation.
1156
       */
1157
      public Builder putExtraParam(String key, Object value) {
1158
        if (this.extraParams == null) {
×
1159
          this.extraParams = new HashMap<>();
×
1160
        }
1161
        this.extraParams.put(key, value);
×
1162
        return this;
×
1163
      }
1164

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

1180
  @Getter
1181
  public static class AutomaticTax {
1182
    /**
1183
     * <strong>Required.</strong> Whether Stripe automatically computes tax on this invoice. Note
1184
     * that incompatible invoice items (invoice items with manually specified <a
1185
     * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1186
     * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1187
     */
1188
    @SerializedName("enabled")
1189
    Boolean enabled;
1190

1191
    /**
1192
     * Map of extra parameters for custom features not available in this client library. The content
1193
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1194
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1195
     * param object. Effectively, this map is flattened to its parent instance.
1196
     */
1197
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1198
    Map<String, Object> extraParams;
1199

1200
    /**
1201
     * The account that's liable for tax. If set, the business address and tax registrations
1202
     * required to perform the tax calculation are loaded from this account. The tax transaction is
1203
     * returned in the report of the connected account.
1204
     */
1205
    @SerializedName("liability")
1206
    Liability liability;
1207

1208
    private AutomaticTax(Boolean enabled, Map<String, Object> extraParams, Liability liability) {
×
1209
      this.enabled = enabled;
×
1210
      this.extraParams = extraParams;
×
1211
      this.liability = liability;
×
1212
    }
×
1213

1214
    public static Builder builder() {
1215
      return new Builder();
×
1216
    }
1217

1218
    public static class Builder {
×
1219
      private Boolean enabled;
1220

1221
      private Map<String, Object> extraParams;
1222

1223
      private Liability liability;
1224

1225
      /** Finalize and obtain parameter instance from this builder. */
1226
      public InvoiceUpdateParams.AutomaticTax build() {
1227
        return new InvoiceUpdateParams.AutomaticTax(this.enabled, this.extraParams, this.liability);
×
1228
      }
1229

1230
      /**
1231
       * <strong>Required.</strong> Whether Stripe automatically computes tax on this invoice. Note
1232
       * that incompatible invoice items (invoice items with manually specified <a
1233
       * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1234
       * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1235
       */
1236
      public Builder setEnabled(Boolean enabled) {
1237
        this.enabled = enabled;
×
1238
        return this;
×
1239
      }
1240

1241
      /**
1242
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1243
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1244
       * InvoiceUpdateParams.AutomaticTax#extraParams} for the field documentation.
1245
       */
1246
      public Builder putExtraParam(String key, Object value) {
1247
        if (this.extraParams == null) {
×
1248
          this.extraParams = new HashMap<>();
×
1249
        }
1250
        this.extraParams.put(key, value);
×
1251
        return this;
×
1252
      }
1253

1254
      /**
1255
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1256
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1257
       * See {@link InvoiceUpdateParams.AutomaticTax#extraParams} for the field documentation.
1258
       */
1259
      public Builder putAllExtraParam(Map<String, Object> map) {
1260
        if (this.extraParams == null) {
×
1261
          this.extraParams = new HashMap<>();
×
1262
        }
1263
        this.extraParams.putAll(map);
×
1264
        return this;
×
1265
      }
1266

1267
      /**
1268
       * The account that's liable for tax. If set, the business address and tax registrations
1269
       * required to perform the tax calculation are loaded from this account. The tax transaction
1270
       * is returned in the report of the connected account.
1271
       */
1272
      public Builder setLiability(InvoiceUpdateParams.AutomaticTax.Liability liability) {
1273
        this.liability = liability;
×
1274
        return this;
×
1275
      }
1276
    }
1277

1278
    @Getter
1279
    public static class Liability {
1280
      /** The connected account being referenced when {@code type} is {@code account}. */
1281
      @SerializedName("account")
1282
      Object account;
1283

1284
      /**
1285
       * Map of extra parameters for custom features not available in this client library. The
1286
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1287
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1288
       * name in this param object. Effectively, this map is flattened to its parent instance.
1289
       */
1290
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1291
      Map<String, Object> extraParams;
1292

1293
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1294
      @SerializedName("type")
1295
      Type type;
1296

1297
      private Liability(Object account, Map<String, Object> extraParams, Type type) {
×
1298
        this.account = account;
×
1299
        this.extraParams = extraParams;
×
1300
        this.type = type;
×
1301
      }
×
1302

1303
      public static Builder builder() {
1304
        return new Builder();
×
1305
      }
1306

1307
      public static class Builder {
×
1308
        private Object account;
1309

1310
        private Map<String, Object> extraParams;
1311

1312
        private Type type;
1313

1314
        /** Finalize and obtain parameter instance from this builder. */
1315
        public InvoiceUpdateParams.AutomaticTax.Liability build() {
1316
          return new InvoiceUpdateParams.AutomaticTax.Liability(
×
1317
              this.account, this.extraParams, this.type);
1318
        }
1319

1320
        /** The connected account being referenced when {@code type} is {@code account}. */
1321
        public Builder setAccount(String account) {
1322
          this.account = account;
×
1323
          return this;
×
1324
        }
1325

1326
        /** The connected account being referenced when {@code type} is {@code account}. */
1327
        public Builder setAccount(EmptyParam account) {
1328
          this.account = account;
×
1329
          return this;
×
1330
        }
1331

1332
        /**
1333
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1334
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1335
         * map. See {@link InvoiceUpdateParams.AutomaticTax.Liability#extraParams} for the field
1336
         * documentation.
1337
         */
1338
        public Builder putExtraParam(String key, Object value) {
1339
          if (this.extraParams == null) {
×
1340
            this.extraParams = new HashMap<>();
×
1341
          }
1342
          this.extraParams.put(key, value);
×
1343
          return this;
×
1344
        }
1345

1346
        /**
1347
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1348
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1349
         * map. See {@link InvoiceUpdateParams.AutomaticTax.Liability#extraParams} for the field
1350
         * documentation.
1351
         */
1352
        public Builder putAllExtraParam(Map<String, Object> map) {
1353
          if (this.extraParams == null) {
×
1354
            this.extraParams = new HashMap<>();
×
1355
          }
1356
          this.extraParams.putAll(map);
×
1357
          return this;
×
1358
        }
1359

1360
        /** <strong>Required.</strong> Type of the account referenced in the request. */
1361
        public Builder setType(InvoiceUpdateParams.AutomaticTax.Liability.Type type) {
1362
          this.type = type;
×
1363
          return this;
×
1364
        }
1365
      }
1366

1367
      public enum Type implements ApiRequestParams.EnumParam {
×
1368
        @SerializedName("account")
×
1369
        ACCOUNT("account"),
1370

1371
        @SerializedName("self")
×
1372
        SELF("self");
1373

1374
        @Getter(onMethod_ = {@Override})
1375
        private final String value;
1376

1377
        Type(String value) {
×
1378
          this.value = value;
×
1379
        }
×
1380
      }
1381
    }
1382
  }
1383

1384
  @Getter
1385
  public static class CustomField {
1386
    /**
1387
     * Map of extra parameters for custom features not available in this client library. The content
1388
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1389
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1390
     * param object. Effectively, this map is flattened to its parent instance.
1391
     */
1392
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1393
    Map<String, Object> extraParams;
1394

1395
    /** <strong>Required.</strong> The name of the custom field. This may be up to 40 characters. */
1396
    @SerializedName("name")
1397
    Object name;
1398

1399
    /**
1400
     * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1401
     */
1402
    @SerializedName("value")
1403
    Object value;
1404

1405
    private CustomField(Map<String, Object> extraParams, Object name, Object value) {
1✔
1406
      this.extraParams = extraParams;
1✔
1407
      this.name = name;
1✔
1408
      this.value = value;
1✔
1409
    }
1✔
1410

1411
    public static Builder builder() {
1412
      return new Builder();
1✔
1413
    }
1414

1415
    public static class Builder {
1✔
1416
      private Map<String, Object> extraParams;
1417

1418
      private Object name;
1419

1420
      private Object value;
1421

1422
      /** Finalize and obtain parameter instance from this builder. */
1423
      public InvoiceUpdateParams.CustomField build() {
1424
        return new InvoiceUpdateParams.CustomField(this.extraParams, this.name, this.value);
1✔
1425
      }
1426

1427
      /**
1428
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1429
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1430
       * InvoiceUpdateParams.CustomField#extraParams} for the field documentation.
1431
       */
1432
      public Builder putExtraParam(String key, Object value) {
1433
        if (this.extraParams == null) {
×
1434
          this.extraParams = new HashMap<>();
×
1435
        }
1436
        this.extraParams.put(key, value);
×
1437
        return this;
×
1438
      }
1439

1440
      /**
1441
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1442
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1443
       * See {@link InvoiceUpdateParams.CustomField#extraParams} for the field documentation.
1444
       */
1445
      public Builder putAllExtraParam(Map<String, Object> map) {
1446
        if (this.extraParams == null) {
×
1447
          this.extraParams = new HashMap<>();
×
1448
        }
1449
        this.extraParams.putAll(map);
×
1450
        return this;
×
1451
      }
1452

1453
      /**
1454
       * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1455
       */
1456
      public Builder setName(String name) {
1457
        this.name = name;
1✔
1458
        return this;
1✔
1459
      }
1460

1461
      /**
1462
       * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1463
       */
1464
      public Builder setName(EmptyParam name) {
1465
        this.name = name;
×
1466
        return this;
×
1467
      }
1468

1469
      /**
1470
       * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1471
       */
1472
      public Builder setValue(String value) {
1473
        this.value = value;
1✔
1474
        return this;
1✔
1475
      }
1476

1477
      /**
1478
       * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1479
       */
1480
      public Builder setValue(EmptyParam value) {
1481
        this.value = value;
×
1482
        return this;
×
1483
      }
1484
    }
1485
  }
1486

1487
  @Getter
1488
  public static class Discount {
1489
    /** ID of the coupon to create a new discount for. */
1490
    @SerializedName("coupon")
1491
    Object coupon;
1492

1493
    /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1494
    @SerializedName("discount")
1495
    Object discount;
1496

1497
    /** Details to determine how long the discount should be applied for. */
1498
    @SerializedName("discount_end")
1499
    DiscountEnd discountEnd;
1500

1501
    /**
1502
     * Map of extra parameters for custom features not available in this client library. The content
1503
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1504
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1505
     * param object. Effectively, this map is flattened to its parent instance.
1506
     */
1507
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1508
    Map<String, Object> extraParams;
1509

1510
    /** ID of the promotion code to create a new discount for. */
1511
    @SerializedName("promotion_code")
1512
    Object promotionCode;
1513

1514
    private Discount(
1515
        Object coupon,
1516
        Object discount,
1517
        DiscountEnd discountEnd,
1518
        Map<String, Object> extraParams,
1519
        Object promotionCode) {
×
1520
      this.coupon = coupon;
×
1521
      this.discount = discount;
×
1522
      this.discountEnd = discountEnd;
×
1523
      this.extraParams = extraParams;
×
1524
      this.promotionCode = promotionCode;
×
1525
    }
×
1526

1527
    public static Builder builder() {
1528
      return new Builder();
×
1529
    }
1530

1531
    public static class Builder {
×
1532
      private Object coupon;
1533

1534
      private Object discount;
1535

1536
      private DiscountEnd discountEnd;
1537

1538
      private Map<String, Object> extraParams;
1539

1540
      private Object promotionCode;
1541

1542
      /** Finalize and obtain parameter instance from this builder. */
1543
      public InvoiceUpdateParams.Discount build() {
1544
        return new InvoiceUpdateParams.Discount(
×
1545
            this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode);
1546
      }
1547

1548
      /** ID of the coupon to create a new discount for. */
1549
      public Builder setCoupon(String coupon) {
1550
        this.coupon = coupon;
×
1551
        return this;
×
1552
      }
1553

1554
      /** ID of the coupon to create a new discount for. */
1555
      public Builder setCoupon(EmptyParam coupon) {
1556
        this.coupon = coupon;
×
1557
        return this;
×
1558
      }
1559

1560
      /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1561
      public Builder setDiscount(String discount) {
1562
        this.discount = discount;
×
1563
        return this;
×
1564
      }
1565

1566
      /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1567
      public Builder setDiscount(EmptyParam discount) {
1568
        this.discount = discount;
×
1569
        return this;
×
1570
      }
1571

1572
      /** Details to determine how long the discount should be applied for. */
1573
      public Builder setDiscountEnd(InvoiceUpdateParams.Discount.DiscountEnd discountEnd) {
1574
        this.discountEnd = discountEnd;
×
1575
        return this;
×
1576
      }
1577

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

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

1604
      /** ID of the promotion code to create a new discount for. */
1605
      public Builder setPromotionCode(String promotionCode) {
1606
        this.promotionCode = promotionCode;
×
1607
        return this;
×
1608
      }
1609

1610
      /** ID of the promotion code to create a new discount for. */
1611
      public Builder setPromotionCode(EmptyParam promotionCode) {
1612
        this.promotionCode = promotionCode;
×
1613
        return this;
×
1614
      }
1615
    }
1616

1617
    @Getter
1618
    public static class DiscountEnd {
1619
      /** Time span for the redeemed discount. */
1620
      @SerializedName("duration")
1621
      Duration duration;
1622

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

1632
      /** A precise Unix timestamp for the discount to end. Must be in the future. */
1633
      @SerializedName("timestamp")
1634
      Long timestamp;
1635

1636
      /**
1637
       * <strong>Required.</strong> The type of calculation made to determine when the discount
1638
       * ends.
1639
       */
1640
      @SerializedName("type")
1641
      Type type;
1642

1643
      private DiscountEnd(
1644
          Duration duration, Map<String, Object> extraParams, Long timestamp, Type type) {
×
1645
        this.duration = duration;
×
1646
        this.extraParams = extraParams;
×
1647
        this.timestamp = timestamp;
×
1648
        this.type = type;
×
1649
      }
×
1650

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

1655
      public static class Builder {
×
1656
        private Duration duration;
1657

1658
        private Map<String, Object> extraParams;
1659

1660
        private Long timestamp;
1661

1662
        private Type type;
1663

1664
        /** Finalize and obtain parameter instance from this builder. */
1665
        public InvoiceUpdateParams.Discount.DiscountEnd build() {
1666
          return new InvoiceUpdateParams.Discount.DiscountEnd(
×
1667
              this.duration, this.extraParams, this.timestamp, this.type);
1668
        }
1669

1670
        /** Time span for the redeemed discount. */
1671
        public Builder setDuration(InvoiceUpdateParams.Discount.DiscountEnd.Duration duration) {
1672
          this.duration = duration;
×
1673
          return this;
×
1674
        }
1675

1676
        /**
1677
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1678
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1679
         * map. See {@link InvoiceUpdateParams.Discount.DiscountEnd#extraParams} for the field
1680
         * documentation.
1681
         */
1682
        public Builder putExtraParam(String key, Object value) {
1683
          if (this.extraParams == null) {
×
1684
            this.extraParams = new HashMap<>();
×
1685
          }
1686
          this.extraParams.put(key, value);
×
1687
          return this;
×
1688
        }
1689

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

1704
        /** A precise Unix timestamp for the discount to end. Must be in the future. */
1705
        public Builder setTimestamp(Long timestamp) {
1706
          this.timestamp = timestamp;
×
1707
          return this;
×
1708
        }
1709

1710
        /**
1711
         * <strong>Required.</strong> The type of calculation made to determine when the discount
1712
         * ends.
1713
         */
1714
        public Builder setType(InvoiceUpdateParams.Discount.DiscountEnd.Type type) {
1715
          this.type = type;
×
1716
          return this;
×
1717
        }
1718
      }
1719

1720
      @Getter
1721
      public static class Duration {
1722
        /**
1723
         * Map of extra parameters for custom features not available in this client library. The
1724
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1725
         * Instead, each key/value pair is serialized as if the key is a root-level field
1726
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1727
         * instance.
1728
         */
1729
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1730
        Map<String, Object> extraParams;
1731

1732
        /**
1733
         * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day}, {@code
1734
         * week}, {@code month} or {@code year}.
1735
         */
1736
        @SerializedName("interval")
1737
        Interval interval;
1738

1739
        /**
1740
         * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1741
         * Stripe multiplies this by the interval type to get the overall duration.
1742
         */
1743
        @SerializedName("interval_count")
1744
        Long intervalCount;
1745

1746
        private Duration(Map<String, Object> extraParams, Interval interval, Long intervalCount) {
×
1747
          this.extraParams = extraParams;
×
1748
          this.interval = interval;
×
1749
          this.intervalCount = intervalCount;
×
1750
        }
×
1751

1752
        public static Builder builder() {
1753
          return new Builder();
×
1754
        }
1755

1756
        public static class Builder {
×
1757
          private Map<String, Object> extraParams;
1758

1759
          private Interval interval;
1760

1761
          private Long intervalCount;
1762

1763
          /** Finalize and obtain parameter instance from this builder. */
1764
          public InvoiceUpdateParams.Discount.DiscountEnd.Duration build() {
1765
            return new InvoiceUpdateParams.Discount.DiscountEnd.Duration(
×
1766
                this.extraParams, this.interval, this.intervalCount);
1767
          }
1768

1769
          /**
1770
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1771
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1772
           * map. See {@link InvoiceUpdateParams.Discount.DiscountEnd.Duration#extraParams} for the
1773
           * field documentation.
1774
           */
1775
          public Builder putExtraParam(String key, Object value) {
1776
            if (this.extraParams == null) {
×
1777
              this.extraParams = new HashMap<>();
×
1778
            }
1779
            this.extraParams.put(key, value);
×
1780
            return this;
×
1781
          }
1782

1783
          /**
1784
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1785
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1786
           * map. See {@link InvoiceUpdateParams.Discount.DiscountEnd.Duration#extraParams} for the
1787
           * field documentation.
1788
           */
1789
          public Builder putAllExtraParam(Map<String, Object> map) {
1790
            if (this.extraParams == null) {
×
1791
              this.extraParams = new HashMap<>();
×
1792
            }
1793
            this.extraParams.putAll(map);
×
1794
            return this;
×
1795
          }
1796

1797
          /**
1798
           * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day},
1799
           * {@code week}, {@code month} or {@code year}.
1800
           */
1801
          public Builder setInterval(
1802
              InvoiceUpdateParams.Discount.DiscountEnd.Duration.Interval interval) {
1803
            this.interval = interval;
×
1804
            return this;
×
1805
          }
1806

1807
          /**
1808
           * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1809
           * Stripe multiplies this by the interval type to get the overall duration.
1810
           */
1811
          public Builder setIntervalCount(Long intervalCount) {
1812
            this.intervalCount = intervalCount;
×
1813
            return this;
×
1814
          }
1815
        }
1816

1817
        public enum Interval implements ApiRequestParams.EnumParam {
×
1818
          @SerializedName("day")
×
1819
          DAY("day"),
1820

1821
          @SerializedName("month")
×
1822
          MONTH("month"),
1823

1824
          @SerializedName("week")
×
1825
          WEEK("week"),
1826

1827
          @SerializedName("year")
×
1828
          YEAR("year");
1829

1830
          @Getter(onMethod_ = {@Override})
1831
          private final String value;
1832

1833
          Interval(String value) {
×
1834
            this.value = value;
×
1835
          }
×
1836
        }
1837
      }
1838

1839
      public enum Type implements ApiRequestParams.EnumParam {
×
1840
        @SerializedName("duration")
×
1841
        DURATION("duration"),
1842

1843
        @SerializedName("timestamp")
×
1844
        TIMESTAMP("timestamp");
1845

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

1849
        Type(String value) {
×
1850
          this.value = value;
×
1851
        }
×
1852
      }
1853
    }
1854
  }
1855

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

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

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

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

1881
    public static Builder builder() {
1882
      return new Builder();
×
1883
    }
1884

1885
    public static class Builder {
×
1886
      private Object account;
1887

1888
      private Map<String, Object> extraParams;
1889

1890
      private Type type;
1891

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

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

1903
      /** The connected account being referenced when {@code type} is {@code account}. */
1904
      public Builder setAccount(EmptyParam account) {
1905
        this.account = account;
×
1906
        return this;
×
1907
      }
1908

1909
      /**
1910
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1911
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1912
       * InvoiceUpdateParams.Issuer#extraParams} for the field documentation.
1913
       */
1914
      public Builder putExtraParam(String key, Object value) {
1915
        if (this.extraParams == null) {
×
1916
          this.extraParams = new HashMap<>();
×
1917
        }
1918
        this.extraParams.put(key, value);
×
1919
        return this;
×
1920
      }
1921

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

1935
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1936
      public Builder setType(InvoiceUpdateParams.Issuer.Type type) {
1937
        this.type = type;
×
1938
        return this;
×
1939
      }
1940
    }
1941

1942
    public enum Type implements ApiRequestParams.EnumParam {
×
1943
      @SerializedName("account")
×
1944
      ACCOUNT("account"),
1945

1946
      @SerializedName("self")
×
1947
      SELF("self");
1948

1949
      @Getter(onMethod_ = {@Override})
1950
      private final String value;
1951

1952
      Type(String value) {
×
1953
        this.value = value;
×
1954
      }
×
1955
    }
1956
  }
1957

1958
  @Getter
1959
  public static class PaymentSettings {
1960
    /**
1961
     * ID of the mandate to be used for this invoice. It must correspond to the payment method used
1962
     * to pay the invoice, including the invoice's default_payment_method or default_source, if set.
1963
     */
1964
    @SerializedName("default_mandate")
1965
    Object defaultMandate;
1966

1967
    /**
1968
     * Map of extra parameters for custom features not available in this client library. The content
1969
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1970
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1971
     * param object. Effectively, this map is flattened to its parent instance.
1972
     */
1973
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1974
    Map<String, Object> extraParams;
1975

1976
    /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
1977
    @SerializedName("payment_method_options")
1978
    PaymentMethodOptions paymentMethodOptions;
1979

1980
    /**
1981
     * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
1982
     * not set, Stripe attempts to automatically determine the types to use by looking at the
1983
     * invoice’s default payment method, the subscription’s default payment method, the customer’s
1984
     * default payment method, and your <a
1985
     * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
1986
     */
1987
    @SerializedName("payment_method_types")
1988
    Object paymentMethodTypes;
1989

1990
    private PaymentSettings(
1991
        Object defaultMandate,
1992
        Map<String, Object> extraParams,
1993
        PaymentMethodOptions paymentMethodOptions,
1994
        Object paymentMethodTypes) {
×
1995
      this.defaultMandate = defaultMandate;
×
1996
      this.extraParams = extraParams;
×
1997
      this.paymentMethodOptions = paymentMethodOptions;
×
1998
      this.paymentMethodTypes = paymentMethodTypes;
×
1999
    }
×
2000

2001
    public static Builder builder() {
2002
      return new Builder();
×
2003
    }
2004

2005
    public static class Builder {
×
2006
      private Object defaultMandate;
2007

2008
      private Map<String, Object> extraParams;
2009

2010
      private PaymentMethodOptions paymentMethodOptions;
2011

2012
      private Object paymentMethodTypes;
2013

2014
      /** Finalize and obtain parameter instance from this builder. */
2015
      public InvoiceUpdateParams.PaymentSettings build() {
2016
        return new InvoiceUpdateParams.PaymentSettings(
×
2017
            this.defaultMandate,
2018
            this.extraParams,
2019
            this.paymentMethodOptions,
2020
            this.paymentMethodTypes);
2021
      }
2022

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

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

2043
      /**
2044
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
2045
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
2046
       * InvoiceUpdateParams.PaymentSettings#extraParams} for the field documentation.
2047
       */
2048
      public Builder putExtraParam(String key, Object value) {
2049
        if (this.extraParams == null) {
×
2050
          this.extraParams = new HashMap<>();
×
2051
        }
2052
        this.extraParams.put(key, value);
×
2053
        return this;
×
2054
      }
2055

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

2069
      /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
2070
      public Builder setPaymentMethodOptions(
2071
          InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) {
2072
        this.paymentMethodOptions = paymentMethodOptions;
×
2073
        return this;
×
2074
      }
2075

2076
      /**
2077
       * Add an element to `paymentMethodTypes` list. A list is initialized for the first
2078
       * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
2079
       * {@link InvoiceUpdateParams.PaymentSettings#paymentMethodTypes} for the field documentation.
2080
       */
2081
      @SuppressWarnings("unchecked")
2082
      public Builder addPaymentMethodType(
2083
          InvoiceUpdateParams.PaymentSettings.PaymentMethodType element) {
2084
        if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) {
×
2085
          this.paymentMethodTypes =
×
2086
              new ArrayList<InvoiceUpdateParams.PaymentSettings.PaymentMethodType>();
2087
        }
2088
        ((List<InvoiceUpdateParams.PaymentSettings.PaymentMethodType>) this.paymentMethodTypes)
×
2089
            .add(element);
×
2090
        return this;
×
2091
      }
2092

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

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

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

2136
    @Getter
2137
    public static class PaymentMethodOptions {
2138
      /**
2139
       * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2140
       * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2141
       */
2142
      @SerializedName("acss_debit")
2143
      Object acssDebit;
2144

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

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

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

2166
      /**
2167
       * Map of extra parameters for custom features not available in this client library. The
2168
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2169
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2170
       * name in this param object. Effectively, this map is flattened to its parent instance.
2171
       */
2172
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2173
      Map<String, Object> extraParams;
2174

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

2182
      /**
2183
       * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct Debit
2184
       * payment method options to pass to the invoice’s PaymentIntent.
2185
       */
2186
      @SerializedName("sepa_debit")
2187
      Object sepaDebit;
2188

2189
      /**
2190
       * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2191
       * debit payment method options to pass to the invoice’s PaymentIntent.
2192
       */
2193
      @SerializedName("us_bank_account")
2194
      Object usBankAccount;
2195

2196
      private PaymentMethodOptions(
2197
          Object acssDebit,
2198
          Object bancontact,
2199
          Object card,
2200
          Object customerBalance,
2201
          Map<String, Object> extraParams,
2202
          Object konbini,
2203
          Object sepaDebit,
2204
          Object usBankAccount) {
×
2205
        this.acssDebit = acssDebit;
×
2206
        this.bancontact = bancontact;
×
2207
        this.card = card;
×
2208
        this.customerBalance = customerBalance;
×
2209
        this.extraParams = extraParams;
×
2210
        this.konbini = konbini;
×
2211
        this.sepaDebit = sepaDebit;
×
2212
        this.usBankAccount = usBankAccount;
×
2213
      }
×
2214

2215
      public static Builder builder() {
2216
        return new Builder();
×
2217
      }
2218

2219
      public static class Builder {
×
2220
        private Object acssDebit;
2221

2222
        private Object bancontact;
2223

2224
        private Object card;
2225

2226
        private Object customerBalance;
2227

2228
        private Map<String, Object> extraParams;
2229

2230
        private Object konbini;
2231

2232
        private Object sepaDebit;
2233

2234
        private Object usBankAccount;
2235

2236
        /** Finalize and obtain parameter instance from this builder. */
2237
        public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions build() {
2238
          return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions(
×
2239
              this.acssDebit,
2240
              this.bancontact,
2241
              this.card,
2242
              this.customerBalance,
2243
              this.extraParams,
2244
              this.konbini,
2245
              this.sepaDebit,
2246
              this.usBankAccount);
2247
        }
2248

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

2259
        /**
2260
         * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2261
         * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2262
         */
2263
        public Builder setAcssDebit(EmptyParam acssDebit) {
2264
          this.acssDebit = acssDebit;
×
2265
          return this;
×
2266
        }
2267

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

2278
        /**
2279
         * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
2280
         * payment method options to pass to the invoice’s PaymentIntent.
2281
         */
2282
        public Builder setBancontact(EmptyParam bancontact) {
2283
          this.bancontact = bancontact;
×
2284
          return this;
×
2285
        }
2286

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

2296
        /**
2297
         * If paying by {@code card}, this sub-hash contains details about the Card payment method
2298
         * options to pass to the invoice’s PaymentIntent.
2299
         */
2300
        public Builder setCard(EmptyParam card) {
2301
          this.card = card;
×
2302
          return this;
×
2303
        }
2304

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

2316
        /**
2317
         * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
2318
         * transfer payment method options to pass to the invoice’s PaymentIntent.
2319
         */
2320
        public Builder setCustomerBalance(EmptyParam customerBalance) {
2321
          this.customerBalance = customerBalance;
×
2322
          return this;
×
2323
        }
2324

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

2339
        /**
2340
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2341
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2342
         * map. See {@link InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions#extraParams} for
2343
         * the field documentation.
2344
         */
2345
        public Builder putAllExtraParam(Map<String, Object> map) {
2346
          if (this.extraParams == null) {
×
2347
            this.extraParams = new HashMap<>();
×
2348
          }
2349
          this.extraParams.putAll(map);
×
2350
          return this;
×
2351
        }
2352

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

2363
        /**
2364
         * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2365
         * method options to pass to the invoice’s PaymentIntent.
2366
         */
2367
        public Builder setKonbini(EmptyParam konbini) {
2368
          this.konbini = konbini;
×
2369
          return this;
×
2370
        }
2371

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

2382
        /**
2383
         * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct
2384
         * Debit payment method options to pass to the invoice’s PaymentIntent.
2385
         */
2386
        public Builder setSepaDebit(EmptyParam sepaDebit) {
2387
          this.sepaDebit = sepaDebit;
×
2388
          return this;
×
2389
        }
2390

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

2401
        /**
2402
         * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2403
         * debit payment method options to pass to the invoice’s PaymentIntent.
2404
         */
2405
        public Builder setUsBankAccount(EmptyParam usBankAccount) {
2406
          this.usBankAccount = usBankAccount;
×
2407
          return this;
×
2408
        }
2409
      }
2410

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

2423
        /** Additional fields for Mandate creation. */
2424
        @SerializedName("mandate_options")
2425
        MandateOptions mandateOptions;
2426

2427
        /** Verification method for the intent. */
2428
        @SerializedName("verification_method")
2429
        VerificationMethod verificationMethod;
2430

2431
        private AcssDebit(
2432
            Map<String, Object> extraParams,
2433
            MandateOptions mandateOptions,
2434
            VerificationMethod verificationMethod) {
×
2435
          this.extraParams = extraParams;
×
2436
          this.mandateOptions = mandateOptions;
×
2437
          this.verificationMethod = verificationMethod;
×
2438
        }
×
2439

2440
        public static Builder builder() {
2441
          return new Builder();
×
2442
        }
2443

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

2447
          private MandateOptions mandateOptions;
2448

2449
          private VerificationMethod verificationMethod;
2450

2451
          /** Finalize and obtain parameter instance from this builder. */
2452
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() {
2453
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit(
×
2454
                this.extraParams, this.mandateOptions, this.verificationMethod);
2455
          }
2456

2457
          /**
2458
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2459
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2460
           * map. See {@link
2461
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit#extraParams} for the
2462
           * field documentation.
2463
           */
2464
          public Builder putExtraParam(String key, Object value) {
2465
            if (this.extraParams == null) {
×
2466
              this.extraParams = new HashMap<>();
×
2467
            }
2468
            this.extraParams.put(key, value);
×
2469
            return this;
×
2470
          }
2471

2472
          /**
2473
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2474
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2475
           * map. See {@link
2476
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit#extraParams} for the
2477
           * field documentation.
2478
           */
2479
          public Builder putAllExtraParam(Map<String, Object> map) {
2480
            if (this.extraParams == null) {
×
2481
              this.extraParams = new HashMap<>();
×
2482
            }
2483
            this.extraParams.putAll(map);
×
2484
            return this;
×
2485
          }
2486

2487
          /** Additional fields for Mandate creation. */
2488
          public Builder setMandateOptions(
2489
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2490
                  mandateOptions) {
2491
            this.mandateOptions = mandateOptions;
×
2492
            return this;
×
2493
          }
2494

2495
          /** Verification method for the intent. */
2496
          public Builder setVerificationMethod(
2497
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.VerificationMethod
2498
                  verificationMethod) {
2499
            this.verificationMethod = verificationMethod;
×
2500
            return this;
×
2501
          }
2502
        }
2503

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

2516
          /** Transaction type of the mandate. */
2517
          @SerializedName("transaction_type")
2518
          TransactionType transactionType;
2519

2520
          private MandateOptions(Map<String, Object> extraParams, TransactionType transactionType) {
×
2521
            this.extraParams = extraParams;
×
2522
            this.transactionType = transactionType;
×
2523
          }
×
2524

2525
          public static Builder builder() {
2526
            return new Builder();
×
2527
          }
2528

2529
          public static class Builder {
×
2530
            private Map<String, Object> extraParams;
2531

2532
            private TransactionType transactionType;
2533

2534
            /** Finalize and obtain parameter instance from this builder. */
2535
            public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2536
                build() {
2537
              return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit
×
2538
                  .MandateOptions(this.extraParams, this.transactionType);
2539
            }
2540

2541
            /**
2542
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
2543
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2544
             * original map. See {@link
2545
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions#extraParams}
2546
             * for the field documentation.
2547
             */
2548
            public Builder putExtraParam(String key, Object value) {
2549
              if (this.extraParams == null) {
×
2550
                this.extraParams = new HashMap<>();
×
2551
              }
2552
              this.extraParams.put(key, value);
×
2553
              return this;
×
2554
            }
2555

2556
            /**
2557
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2558
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2559
             * original map. See {@link
2560
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions#extraParams}
2561
             * for the field documentation.
2562
             */
2563
            public Builder putAllExtraParam(Map<String, Object> map) {
2564
              if (this.extraParams == null) {
×
2565
                this.extraParams = new HashMap<>();
×
2566
              }
2567
              this.extraParams.putAll(map);
×
2568
              return this;
×
2569
            }
2570

2571
            /** Transaction type of the mandate. */
2572
            public Builder setTransactionType(
2573
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2574
                        .TransactionType
2575
                    transactionType) {
2576
              this.transactionType = transactionType;
×
2577
              return this;
×
2578
            }
2579
          }
2580

2581
          public enum TransactionType implements ApiRequestParams.EnumParam {
×
2582
            @SerializedName("business")
×
2583
            BUSINESS("business"),
2584

2585
            @SerializedName("personal")
×
2586
            PERSONAL("personal");
2587

2588
            @Getter(onMethod_ = {@Override})
2589
            private final String value;
2590

2591
            TransactionType(String value) {
×
2592
              this.value = value;
×
2593
            }
×
2594
          }
2595
        }
2596

2597
        public enum VerificationMethod implements ApiRequestParams.EnumParam {
×
2598
          @SerializedName("automatic")
×
2599
          AUTOMATIC("automatic"),
2600

2601
          @SerializedName("instant")
×
2602
          INSTANT("instant"),
2603

2604
          @SerializedName("microdeposits")
×
2605
          MICRODEPOSITS("microdeposits");
2606

2607
          @Getter(onMethod_ = {@Override})
2608
          private final String value;
2609

2610
          VerificationMethod(String value) {
×
2611
            this.value = value;
×
2612
          }
×
2613
        }
2614
      }
2615

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

2628
        /**
2629
         * Preferred language of the Bancontact authorization page that the customer is redirected
2630
         * to.
2631
         */
2632
        @SerializedName("preferred_language")
2633
        PreferredLanguage preferredLanguage;
2634

2635
        private Bancontact(Map<String, Object> extraParams, PreferredLanguage preferredLanguage) {
×
2636
          this.extraParams = extraParams;
×
2637
          this.preferredLanguage = preferredLanguage;
×
2638
        }
×
2639

2640
        public static Builder builder() {
2641
          return new Builder();
×
2642
        }
2643

2644
        public static class Builder {
×
2645
          private Map<String, Object> extraParams;
2646

2647
          private PreferredLanguage preferredLanguage;
2648

2649
          /** Finalize and obtain parameter instance from this builder. */
2650
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() {
2651
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact(
×
2652
                this.extraParams, this.preferredLanguage);
2653
          }
2654

2655
          /**
2656
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2657
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2658
           * map. See {@link
2659
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for
2660
           * the field documentation.
2661
           */
2662
          public Builder putExtraParam(String key, Object value) {
2663
            if (this.extraParams == null) {
×
2664
              this.extraParams = new HashMap<>();
×
2665
            }
2666
            this.extraParams.put(key, value);
×
2667
            return this;
×
2668
          }
2669

2670
          /**
2671
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2672
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2673
           * map. See {@link
2674
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for
2675
           * the field documentation.
2676
           */
2677
          public Builder putAllExtraParam(Map<String, Object> map) {
2678
            if (this.extraParams == null) {
×
2679
              this.extraParams = new HashMap<>();
×
2680
            }
2681
            this.extraParams.putAll(map);
×
2682
            return this;
×
2683
          }
2684

2685
          /**
2686
           * Preferred language of the Bancontact authorization page that the customer is redirected
2687
           * to.
2688
           */
2689
          public Builder setPreferredLanguage(
2690
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact.PreferredLanguage
2691
                  preferredLanguage) {
2692
            this.preferredLanguage = preferredLanguage;
×
2693
            return this;
×
2694
          }
2695
        }
2696

2697
        public enum PreferredLanguage implements ApiRequestParams.EnumParam {
×
2698
          @SerializedName("de")
×
2699
          DE("de"),
2700

2701
          @SerializedName("en")
×
2702
          EN("en"),
2703

2704
          @SerializedName("fr")
×
2705
          FR("fr"),
2706

2707
          @SerializedName("nl")
×
2708
          NL("nl");
2709

2710
          @Getter(onMethod_ = {@Override})
2711
          private final String value;
2712

2713
          PreferredLanguage(String value) {
×
2714
            this.value = value;
×
2715
          }
×
2716
        }
2717
      }
2718

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

2731
        /**
2732
         * Installment configuration for payments attempted on this invoice (Mexico Only).
2733
         *
2734
         * <p>For more information, see the <a
2735
         * href="https://stripe.com/docs/payments/installments">installments integration guide</a>.
2736
         */
2737
        @SerializedName("installments")
2738
        Installments installments;
2739

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

2753
        private Card(
2754
            Map<String, Object> extraParams,
2755
            Installments installments,
2756
            RequestThreeDSecure requestThreeDSecure) {
×
2757
          this.extraParams = extraParams;
×
2758
          this.installments = installments;
×
2759
          this.requestThreeDSecure = requestThreeDSecure;
×
2760
        }
×
2761

2762
        public static Builder builder() {
2763
          return new Builder();
×
2764
        }
2765

2766
        public static class Builder {
×
2767
          private Map<String, Object> extraParams;
2768

2769
          private Installments installments;
2770

2771
          private RequestThreeDSecure requestThreeDSecure;
2772

2773
          /** Finalize and obtain parameter instance from this builder. */
2774
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card build() {
2775
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card(
×
2776
                this.extraParams, this.installments, this.requestThreeDSecure);
2777
          }
2778

2779
          /**
2780
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2781
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2782
           * map. See {@link
2783
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card#extraParams} for the
2784
           * field documentation.
2785
           */
2786
          public Builder putExtraParam(String key, Object value) {
2787
            if (this.extraParams == null) {
×
2788
              this.extraParams = new HashMap<>();
×
2789
            }
2790
            this.extraParams.put(key, value);
×
2791
            return this;
×
2792
          }
2793

2794
          /**
2795
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2796
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2797
           * map. See {@link
2798
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card#extraParams} for the
2799
           * field documentation.
2800
           */
2801
          public Builder putAllExtraParam(Map<String, Object> map) {
2802
            if (this.extraParams == null) {
×
2803
              this.extraParams = new HashMap<>();
×
2804
            }
2805
            this.extraParams.putAll(map);
×
2806
            return this;
×
2807
          }
2808

2809
          /**
2810
           * Installment configuration for payments attempted on this invoice (Mexico Only).
2811
           *
2812
           * <p>For more information, see the <a
2813
           * href="https://stripe.com/docs/payments/installments">installments integration
2814
           * guide</a>.
2815
           */
2816
          public Builder setInstallments(
2817
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments
2818
                  installments) {
2819
            this.installments = installments;
×
2820
            return this;
×
2821
          }
2822

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

2841
        @Getter
2842
        public static class Installments {
2843
          /**
2844
           * Setting to true enables installments for this invoice. Setting to false will prevent
2845
           * any selected plan from applying to a payment.
2846
           */
2847
          @SerializedName("enabled")
2848
          Boolean enabled;
2849

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

2860
          /** The selected installment plan to use for this invoice. */
2861
          @SerializedName("plan")
2862
          Object plan;
2863

2864
          private Installments(Boolean enabled, Map<String, Object> extraParams, Object plan) {
×
2865
            this.enabled = enabled;
×
2866
            this.extraParams = extraParams;
×
2867
            this.plan = plan;
×
2868
          }
×
2869

2870
          public static Builder builder() {
2871
            return new Builder();
×
2872
          }
2873

2874
          public static class Builder {
×
2875
            private Boolean enabled;
2876

2877
            private Map<String, Object> extraParams;
2878

2879
            private Object plan;
2880

2881
            /** Finalize and obtain parameter instance from this builder. */
2882
            public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments
2883
                build() {
2884
              return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments(
×
2885
                  this.enabled, this.extraParams, this.plan);
2886
            }
2887

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
            public Builder setEnabled(Boolean enabled) {
2893
              this.enabled = enabled;
×
2894
              return this;
×
2895
            }
2896

2897
            /**
2898
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
2899
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2900
             * original map. See {@link
2901
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments#extraParams}
2902
             * for the field documentation.
2903
             */
2904
            public Builder putExtraParam(String key, Object value) {
2905
              if (this.extraParams == null) {
×
2906
                this.extraParams = new HashMap<>();
×
2907
              }
2908
              this.extraParams.put(key, value);
×
2909
              return this;
×
2910
            }
2911

2912
            /**
2913
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2914
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2915
             * original map. See {@link
2916
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments#extraParams}
2917
             * for the field documentation.
2918
             */
2919
            public Builder putAllExtraParam(Map<String, Object> map) {
2920
              if (this.extraParams == null) {
×
2921
                this.extraParams = new HashMap<>();
×
2922
              }
2923
              this.extraParams.putAll(map);
×
2924
              return this;
×
2925
            }
2926

2927
            /** The selected installment plan to use for this invoice. */
2928
            public Builder setPlan(
2929
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
2930
                    plan) {
2931
              this.plan = plan;
×
2932
              return this;
×
2933
            }
2934

2935
            /** The selected installment plan to use for this invoice. */
2936
            public Builder setPlan(EmptyParam plan) {
2937
              this.plan = plan;
×
2938
              return this;
×
2939
            }
2940
          }
2941

2942
          @Getter
2943
          public static class Plan {
2944
            /**
2945
             * For {@code fixed_count} installment plans, this is required. It represents the number
2946
             * of installment payments your customer will make to their credit card.
2947
             */
2948
            @SerializedName("count")
2949
            Long count;
2950

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

2961
            /**
2962
             * For {@code fixed_count} installment plans, this is required. It represents the
2963
             * interval between installment payments your customer will make to their credit card.
2964
             * One of {@code month}.
2965
             */
2966
            @SerializedName("interval")
2967
            Interval interval;
2968

2969
            /** <strong>Required.</strong> Type of installment plan, one of {@code fixed_count}. */
2970
            @SerializedName("type")
2971
            Type type;
2972

2973
            private Plan(
2974
                Long count, Map<String, Object> extraParams, Interval interval, Type type) {
×
2975
              this.count = count;
×
2976
              this.extraParams = extraParams;
×
2977
              this.interval = interval;
×
2978
              this.type = type;
×
2979
            }
×
2980

2981
            public static Builder builder() {
2982
              return new Builder();
×
2983
            }
2984

2985
            public static class Builder {
×
2986
              private Long count;
2987

2988
              private Map<String, Object> extraParams;
2989

2990
              private Interval interval;
2991

2992
              private Type type;
2993

2994
              /** Finalize and obtain parameter instance from this builder. */
2995
              public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
2996
                  build() {
2997
                return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card
×
2998
                    .Installments.Plan(this.count, this.extraParams, this.interval, this.type);
2999
              }
3000

3001
              /**
3002
               * For {@code fixed_count} installment plans, this is required. It represents the
3003
               * number of installment payments your customer will make to their credit card.
3004
               */
3005
              public Builder setCount(Long count) {
3006
                this.count = count;
×
3007
                return this;
×
3008
              }
3009

3010
              /**
3011
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3012
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3013
               * original map. See {@link
3014
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan#extraParams}
3015
               * for the field documentation.
3016
               */
3017
              public Builder putExtraParam(String key, Object value) {
3018
                if (this.extraParams == null) {
×
3019
                  this.extraParams = new HashMap<>();
×
3020
                }
3021
                this.extraParams.put(key, value);
×
3022
                return this;
×
3023
              }
3024

3025
              /**
3026
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
3027
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
3028
               * original map. See {@link
3029
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan#extraParams}
3030
               * for the field documentation.
3031
               */
3032
              public Builder putAllExtraParam(Map<String, Object> map) {
3033
                if (this.extraParams == null) {
×
3034
                  this.extraParams = new HashMap<>();
×
3035
                }
3036
                this.extraParams.putAll(map);
×
3037
                return this;
×
3038
              }
3039

3040
              /**
3041
               * For {@code fixed_count} installment plans, this is required. It represents the
3042
               * interval between installment payments your customer will make to their credit card.
3043
               * One of {@code month}.
3044
               */
3045
              public Builder setInterval(
3046
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3047
                          .Interval
3048
                      interval) {
3049
                this.interval = interval;
×
3050
                return this;
×
3051
              }
3052

3053
              /**
3054
               * <strong>Required.</strong> Type of installment plan, one of {@code fixed_count}.
3055
               */
3056
              public Builder setType(
3057
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3058
                          .Type
3059
                      type) {
3060
                this.type = type;
×
3061
                return this;
×
3062
              }
3063
            }
3064

3065
            public enum Interval implements ApiRequestParams.EnumParam {
×
3066
              @SerializedName("month")
×
3067
              MONTH("month");
3068

3069
              @Getter(onMethod_ = {@Override})
3070
              private final String value;
3071

3072
              Interval(String value) {
×
3073
                this.value = value;
×
3074
              }
×
3075
            }
3076

3077
            public enum Type implements ApiRequestParams.EnumParam {
×
3078
              @SerializedName("fixed_count")
×
3079
              FIXED_COUNT("fixed_count");
3080

3081
              @Getter(onMethod_ = {@Override})
3082
              private final String value;
3083

3084
              Type(String value) {
×
3085
                this.value = value;
×
3086
              }
×
3087
            }
3088
          }
3089
        }
3090

3091
        public enum RequestThreeDSecure implements ApiRequestParams.EnumParam {
×
3092
          @SerializedName("any")
×
3093
          ANY("any"),
3094

3095
          @SerializedName("automatic")
×
3096
          AUTOMATIC("automatic"),
3097

3098
          @SerializedName("challenge")
×
3099
          CHALLENGE("challenge");
3100

3101
          @Getter(onMethod_ = {@Override})
3102
          private final String value;
3103

3104
          RequestThreeDSecure(String value) {
×
3105
            this.value = value;
×
3106
          }
×
3107
        }
3108
      }
3109

3110
      @Getter
3111
      public static class CustomerBalance {
3112
        /**
3113
         * Configuration for the bank transfer funding type, if the {@code funding_type} is set to
3114
         * {@code bank_transfer}.
3115
         */
3116
        @SerializedName("bank_transfer")
3117
        BankTransfer bankTransfer;
3118

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

3129
        /**
3130
         * The funding method type to be used when there are not enough funds in the customer
3131
         * balance. Permitted values include: {@code bank_transfer}.
3132
         */
3133
        @SerializedName("funding_type")
3134
        Object fundingType;
3135

3136
        private CustomerBalance(
3137
            BankTransfer bankTransfer, Map<String, Object> extraParams, Object fundingType) {
×
3138
          this.bankTransfer = bankTransfer;
×
3139
          this.extraParams = extraParams;
×
3140
          this.fundingType = fundingType;
×
3141
        }
×
3142

3143
        public static Builder builder() {
3144
          return new Builder();
×
3145
        }
3146

3147
        public static class Builder {
×
3148
          private BankTransfer bankTransfer;
3149

3150
          private Map<String, Object> extraParams;
3151

3152
          private Object fundingType;
3153

3154
          /** Finalize and obtain parameter instance from this builder. */
3155
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance build() {
3156
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance(
×
3157
                this.bankTransfer, this.extraParams, this.fundingType);
3158
          }
3159

3160
          /**
3161
           * Configuration for the bank transfer funding type, if the {@code funding_type} is set to
3162
           * {@code bank_transfer}.
3163
           */
3164
          public Builder setBankTransfer(
3165
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer
3166
                  bankTransfer) {
3167
            this.bankTransfer = bankTransfer;
×
3168
            return this;
×
3169
          }
3170

3171
          /**
3172
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3173
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3174
           * map. See {@link
3175
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance#extraParams}
3176
           * for the field documentation.
3177
           */
3178
          public Builder putExtraParam(String key, Object value) {
3179
            if (this.extraParams == null) {
×
3180
              this.extraParams = new HashMap<>();
×
3181
            }
3182
            this.extraParams.put(key, value);
×
3183
            return this;
×
3184
          }
3185

3186
          /**
3187
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3188
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3189
           * map. See {@link
3190
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance#extraParams}
3191
           * for the field documentation.
3192
           */
3193
          public Builder putAllExtraParam(Map<String, Object> map) {
3194
            if (this.extraParams == null) {
×
3195
              this.extraParams = new HashMap<>();
×
3196
            }
3197
            this.extraParams.putAll(map);
×
3198
            return this;
×
3199
          }
3200

3201
          /**
3202
           * The funding method type to be used when there are not enough funds in the customer
3203
           * balance. Permitted values include: {@code bank_transfer}.
3204
           */
3205
          public Builder setFundingType(String fundingType) {
3206
            this.fundingType = fundingType;
×
3207
            return this;
×
3208
          }
3209

3210
          /**
3211
           * The funding method type to be used when there are not enough funds in the customer
3212
           * balance. Permitted values include: {@code bank_transfer}.
3213
           */
3214
          public Builder setFundingType(EmptyParam fundingType) {
3215
            this.fundingType = fundingType;
×
3216
            return this;
×
3217
          }
3218
        }
3219

3220
        @Getter
3221
        public static class BankTransfer {
3222
          /** Configuration for eu_bank_transfer funding type. */
3223
          @SerializedName("eu_bank_transfer")
3224
          EuBankTransfer euBankTransfer;
3225

3226
          /**
3227
           * Map of extra parameters for custom features not available in this client library. The
3228
           * content in this map is not serialized under this field's {@code @SerializedName} value.
3229
           * Instead, each key/value pair is serialized as if the key is a root-level field
3230
           * (serialized) name in this param object. Effectively, this map is flattened to its
3231
           * parent instance.
3232
           */
3233
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3234
          Map<String, Object> extraParams;
3235

3236
          /**
3237
           * The bank transfer type that can be used for funding. Permitted values include: {@code
3238
           * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3239
           * mx_bank_transfer}, or {@code us_bank_transfer}.
3240
           */
3241
          @SerializedName("type")
3242
          Object type;
3243

3244
          private BankTransfer(
3245
              EuBankTransfer euBankTransfer, Map<String, Object> extraParams, Object type) {
×
3246
            this.euBankTransfer = euBankTransfer;
×
3247
            this.extraParams = extraParams;
×
3248
            this.type = type;
×
3249
          }
×
3250

3251
          public static Builder builder() {
3252
            return new Builder();
×
3253
          }
3254

3255
          public static class Builder {
×
3256
            private EuBankTransfer euBankTransfer;
3257

3258
            private Map<String, Object> extraParams;
3259

3260
            private Object type;
3261

3262
            /** Finalize and obtain parameter instance from this builder. */
3263
            public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3264
                    .BankTransfer
3265
                build() {
3266
              return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
×
3267
                  .BankTransfer(this.euBankTransfer, this.extraParams, this.type);
3268
            }
3269

3270
            /** Configuration for eu_bank_transfer funding type. */
3271
            public Builder setEuBankTransfer(
3272
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3273
                        .BankTransfer.EuBankTransfer
3274
                    euBankTransfer) {
3275
              this.euBankTransfer = euBankTransfer;
×
3276
              return this;
×
3277
            }
3278

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

3294
            /**
3295
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3296
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3297
             * original map. See {@link
3298
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer#extraParams}
3299
             * for the field documentation.
3300
             */
3301
            public Builder putAllExtraParam(Map<String, Object> map) {
3302
              if (this.extraParams == null) {
×
3303
                this.extraParams = new HashMap<>();
×
3304
              }
3305
              this.extraParams.putAll(map);
×
3306
              return this;
×
3307
            }
3308

3309
            /**
3310
             * The bank transfer type that can be used for funding. Permitted values include: {@code
3311
             * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3312
             * mx_bank_transfer}, or {@code us_bank_transfer}.
3313
             */
3314
            public Builder setType(String type) {
3315
              this.type = type;
×
3316
              return this;
×
3317
            }
3318

3319
            /**
3320
             * The bank transfer type that can be used for funding. Permitted values include: {@code
3321
             * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3322
             * mx_bank_transfer}, or {@code us_bank_transfer}.
3323
             */
3324
            public Builder setType(EmptyParam type) {
3325
              this.type = type;
×
3326
              return this;
×
3327
            }
3328
          }
3329

3330
          @Getter
3331
          public static class EuBankTransfer {
3332
            /**
3333
             * <strong>Required.</strong> The desired country code of the bank account information.
3334
             * Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE},
3335
             * or {@code NL}.
3336
             */
3337
            @SerializedName("country")
3338
            Object country;
3339

3340
            /**
3341
             * Map of extra parameters for custom features not available in this client library. The
3342
             * content in this map is not serialized under this field's {@code @SerializedName}
3343
             * value. Instead, each key/value pair is serialized as if the key is a root-level field
3344
             * (serialized) name in this param object. Effectively, this map is flattened to its
3345
             * parent instance.
3346
             */
3347
            @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3348
            Map<String, Object> extraParams;
3349

3350
            private EuBankTransfer(Object country, Map<String, Object> extraParams) {
×
3351
              this.country = country;
×
3352
              this.extraParams = extraParams;
×
3353
            }
×
3354

3355
            public static Builder builder() {
3356
              return new Builder();
×
3357
            }
3358

3359
            public static class Builder {
×
3360
              private Object country;
3361

3362
              private Map<String, Object> extraParams;
3363

3364
              /** Finalize and obtain parameter instance from this builder. */
3365
              public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3366
                      .BankTransfer.EuBankTransfer
3367
                  build() {
3368
                return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
×
3369
                    .BankTransfer.EuBankTransfer(this.country, this.extraParams);
3370
              }
3371

3372
              /**
3373
               * <strong>Required.</strong> The desired country code of the bank account
3374
               * information. Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code
3375
               * FR}, {@code IE}, or {@code NL}.
3376
               */
3377
              public Builder setCountry(String country) {
3378
                this.country = country;
×
3379
                return this;
×
3380
              }
3381

3382
              /**
3383
               * <strong>Required.</strong> The desired country code of the bank account
3384
               * information. Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code
3385
               * FR}, {@code IE}, or {@code NL}.
3386
               */
3387
              public Builder setCountry(EmptyParam country) {
3388
                this.country = country;
×
3389
                return this;
×
3390
              }
3391

3392
              /**
3393
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3394
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3395
               * original map. See {@link
3396
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams}
3397
               * for the field documentation.
3398
               */
3399
              public Builder putExtraParam(String key, Object value) {
3400
                if (this.extraParams == null) {
×
3401
                  this.extraParams = new HashMap<>();
×
3402
                }
3403
                this.extraParams.put(key, value);
×
3404
                return this;
×
3405
              }
3406

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

3426
      @Getter
3427
      public static class Konbini {
3428
        /**
3429
         * Map of extra parameters for custom features not available in this client library. The
3430
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3431
         * Instead, each key/value pair is serialized as if the key is a root-level field
3432
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3433
         * instance.
3434
         */
3435
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3436
        Map<String, Object> extraParams;
3437

3438
        private Konbini(Map<String, Object> extraParams) {
×
3439
          this.extraParams = extraParams;
×
3440
        }
×
3441

3442
        public static Builder builder() {
3443
          return new Builder();
×
3444
        }
3445

3446
        public static class Builder {
×
3447
          private Map<String, Object> extraParams;
3448

3449
          /** Finalize and obtain parameter instance from this builder. */
3450
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini build() {
3451
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini(
×
3452
                this.extraParams);
3453
          }
3454

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

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

3487
      @Getter
3488
      public static class SepaDebit {
3489
        /**
3490
         * Map of extra parameters for custom features not available in this client library. The
3491
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3492
         * Instead, each key/value pair is serialized as if the key is a root-level field
3493
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3494
         * instance.
3495
         */
3496
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3497
        Map<String, Object> extraParams;
3498

3499
        private SepaDebit(Map<String, Object> extraParams) {
×
3500
          this.extraParams = extraParams;
×
3501
        }
×
3502

3503
        public static Builder builder() {
3504
          return new Builder();
×
3505
        }
3506

3507
        public static class Builder {
×
3508
          private Map<String, Object> extraParams;
3509

3510
          /** Finalize and obtain parameter instance from this builder. */
3511
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.SepaDebit build() {
3512
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.SepaDebit(
×
3513
                this.extraParams);
3514
          }
3515

3516
          /**
3517
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3518
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3519
           * map. See {@link
3520
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.SepaDebit#extraParams} for the
3521
           * field documentation.
3522
           */
3523
          public Builder putExtraParam(String key, Object value) {
3524
            if (this.extraParams == null) {
×
3525
              this.extraParams = new HashMap<>();
×
3526
            }
3527
            this.extraParams.put(key, value);
×
3528
            return this;
×
3529
          }
3530

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

3548
      @Getter
3549
      public static class UsBankAccount {
3550
        /**
3551
         * Map of extra parameters for custom features not available in this client library. The
3552
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3553
         * Instead, each key/value pair is serialized as if the key is a root-level field
3554
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3555
         * instance.
3556
         */
3557
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3558
        Map<String, Object> extraParams;
3559

3560
        /** Additional fields for Financial Connections Session creation. */
3561
        @SerializedName("financial_connections")
3562
        FinancialConnections financialConnections;
3563

3564
        /** Verification method for the intent. */
3565
        @SerializedName("verification_method")
3566
        VerificationMethod verificationMethod;
3567

3568
        private UsBankAccount(
3569
            Map<String, Object> extraParams,
3570
            FinancialConnections financialConnections,
3571
            VerificationMethod verificationMethod) {
×
3572
          this.extraParams = extraParams;
×
3573
          this.financialConnections = financialConnections;
×
3574
          this.verificationMethod = verificationMethod;
×
3575
        }
×
3576

3577
        public static Builder builder() {
3578
          return new Builder();
×
3579
        }
3580

3581
        public static class Builder {
×
3582
          private Map<String, Object> extraParams;
3583

3584
          private FinancialConnections financialConnections;
3585

3586
          private VerificationMethod verificationMethod;
3587

3588
          /** Finalize and obtain parameter instance from this builder. */
3589
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount build() {
3590
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount(
×
3591
                this.extraParams, this.financialConnections, this.verificationMethod);
3592
          }
3593

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

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

3624
          /** Additional fields for Financial Connections Session creation. */
3625
          public Builder setFinancialConnections(
3626
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3627
                      .FinancialConnections
3628
                  financialConnections) {
3629
            this.financialConnections = financialConnections;
×
3630
            return this;
×
3631
          }
3632

3633
          /** Verification method for the intent. */
3634
          public Builder setVerificationMethod(
3635
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3636
                      .VerificationMethod
3637
                  verificationMethod) {
3638
            this.verificationMethod = verificationMethod;
×
3639
            return this;
×
3640
          }
3641
        }
3642

3643
        @Getter
3644
        public static class FinancialConnections {
3645
          /**
3646
           * Map of extra parameters for custom features not available in this client library. The
3647
           * content in this map is not serialized under this field's {@code @SerializedName} value.
3648
           * Instead, each key/value pair is serialized as if the key is a root-level field
3649
           * (serialized) name in this param object. Effectively, this map is flattened to its
3650
           * parent instance.
3651
           */
3652
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3653
          Map<String, Object> extraParams;
3654

3655
          /**
3656
           * Provide filters for the linked accounts that the customer can select for the payment
3657
           * method.
3658
           */
3659
          @SerializedName("filters")
3660
          Filters filters;
3661

3662
          /**
3663
           * The list of permissions to request. If this parameter is passed, the {@code
3664
           * payment_method} permission must be included. Valid permissions include: {@code
3665
           * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}.
3666
           */
3667
          @SerializedName("permissions")
3668
          List<
3669
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3670
                      .FinancialConnections.Permission>
3671
              permissions;
3672

3673
          /** List of data features that you would like to retrieve upon account creation. */
3674
          @SerializedName("prefetch")
3675
          List<
3676
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3677
                      .FinancialConnections.Prefetch>
3678
              prefetch;
3679

3680
          private FinancialConnections(
3681
              Map<String, Object> extraParams,
3682
              Filters filters,
3683
              List<
3684
                      InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3685
                          .FinancialConnections.Permission>
3686
                  permissions,
3687
              List<
3688
                      InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3689
                          .FinancialConnections.Prefetch>
3690
                  prefetch) {
×
3691
            this.extraParams = extraParams;
×
3692
            this.filters = filters;
×
3693
            this.permissions = permissions;
×
3694
            this.prefetch = prefetch;
×
3695
          }
×
3696

3697
          public static Builder builder() {
3698
            return new Builder();
×
3699
          }
3700

3701
          public static class Builder {
×
3702
            private Map<String, Object> extraParams;
3703

3704
            private Filters filters;
3705

3706
            private List<
3707
                    InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3708
                        .FinancialConnections.Permission>
3709
                permissions;
3710

3711
            private List<
3712
                    InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3713
                        .FinancialConnections.Prefetch>
3714
                prefetch;
3715

3716
            /** Finalize and obtain parameter instance from this builder. */
3717
            public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3718
                    .FinancialConnections
3719
                build() {
3720
              return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
×
3721
                  .FinancialConnections(
3722
                  this.extraParams, this.filters, this.permissions, this.prefetch);
3723
            }
3724

3725
            /**
3726
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
3727
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3728
             * original map. See {@link
3729
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams}
3730
             * for the field documentation.
3731
             */
3732
            public Builder putExtraParam(String key, Object value) {
3733
              if (this.extraParams == null) {
×
3734
                this.extraParams = new HashMap<>();
×
3735
              }
3736
              this.extraParams.put(key, value);
×
3737
              return this;
×
3738
            }
3739

3740
            /**
3741
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3742
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3743
             * original map. See {@link
3744
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams}
3745
             * for the field documentation.
3746
             */
3747
            public Builder putAllExtraParam(Map<String, Object> map) {
3748
              if (this.extraParams == null) {
×
3749
                this.extraParams = new HashMap<>();
×
3750
              }
3751
              this.extraParams.putAll(map);
×
3752
              return this;
×
3753
            }
3754

3755
            /**
3756
             * Provide filters for the linked accounts that the customer can select for the payment
3757
             * method.
3758
             */
3759
            public Builder setFilters(
3760
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3761
                        .FinancialConnections.Filters
3762
                    filters) {
3763
              this.filters = filters;
×
3764
              return this;
×
3765
            }
3766

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

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

3804
            /**
3805
             * Add an element to `prefetch` list. A list is initialized for the first `add/addAll`
3806
             * call, and subsequent calls adds additional elements to the original list. See {@link
3807
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch}
3808
             * for the field documentation.
3809
             */
3810
            public Builder addPrefetch(
3811
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3812
                        .FinancialConnections.Prefetch
3813
                    element) {
3814
              if (this.prefetch == null) {
×
3815
                this.prefetch = new ArrayList<>();
×
3816
              }
3817
              this.prefetch.add(element);
×
3818
              return this;
×
3819
            }
3820

3821
            /**
3822
             * Add all elements to `prefetch` list. A list is initialized for the first `add/addAll`
3823
             * call, and subsequent calls adds additional elements to the original list. See {@link
3824
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch}
3825
             * for the field documentation.
3826
             */
3827
            public Builder addAllPrefetch(
3828
                List<
3829
                        InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3830
                            .FinancialConnections.Prefetch>
3831
                    elements) {
3832
              if (this.prefetch == null) {
×
3833
                this.prefetch = new ArrayList<>();
×
3834
              }
3835
              this.prefetch.addAll(elements);
×
3836
              return this;
×
3837
            }
3838
          }
3839

3840
          @Getter
3841
          public static class Filters {
3842
            /**
3843
             * The account subcategories to use to filter for selectable accounts. Valid
3844
             * subcategories are {@code checking} and {@code savings}.
3845
             */
3846
            @SerializedName("account_subcategories")
3847
            List<
3848
                    InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3849
                        .FinancialConnections.Filters.AccountSubcategory>
3850
                accountSubcategories;
3851

3852
            /**
3853
             * Map of extra parameters for custom features not available in this client library. The
3854
             * content in this map is not serialized under this field's {@code @SerializedName}
3855
             * value. Instead, each key/value pair is serialized as if the key is a root-level field
3856
             * (serialized) name in this param object. Effectively, this map is flattened to its
3857
             * parent instance.
3858
             */
3859
            @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3860
            Map<String, Object> extraParams;
3861

3862
            /** ID of the institution to use to filter for selectable accounts. */
3863
            @SerializedName("institution")
3864
            Object institution;
3865

3866
            private Filters(
3867
                List<
3868
                        InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3869
                            .FinancialConnections.Filters.AccountSubcategory>
3870
                    accountSubcategories,
3871
                Map<String, Object> extraParams,
3872
                Object institution) {
×
3873
              this.accountSubcategories = accountSubcategories;
×
3874
              this.extraParams = extraParams;
×
3875
              this.institution = institution;
×
3876
            }
×
3877

3878
            public static Builder builder() {
3879
              return new Builder();
×
3880
            }
3881

3882
            public static class Builder {
×
3883
              private List<
3884
                      InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3885
                          .FinancialConnections.Filters.AccountSubcategory>
3886
                  accountSubcategories;
3887

3888
              private Map<String, Object> extraParams;
3889

3890
              private Object institution;
3891

3892
              /** Finalize and obtain parameter instance from this builder. */
3893
              public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3894
                      .FinancialConnections.Filters
3895
                  build() {
3896
                return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
×
3897
                    .FinancialConnections.Filters(
3898
                    this.accountSubcategories, this.extraParams, this.institution);
3899
              }
3900

3901
              /**
3902
               * Add an element to `accountSubcategories` list. A list is initialized for the first
3903
               * `add/addAll` call, and subsequent calls adds additional elements to the original
3904
               * list. See {@link
3905
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories}
3906
               * for the field documentation.
3907
               */
3908
              public Builder addAccountSubcategory(
3909
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3910
                          .FinancialConnections.Filters.AccountSubcategory
3911
                      element) {
3912
                if (this.accountSubcategories == null) {
×
3913
                  this.accountSubcategories = new ArrayList<>();
×
3914
                }
3915
                this.accountSubcategories.add(element);
×
3916
                return this;
×
3917
              }
3918

3919
              /**
3920
               * Add all elements to `accountSubcategories` list. A list is initialized for the
3921
               * first `add/addAll` call, and subsequent calls adds additional elements to the
3922
               * original list. See {@link
3923
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories}
3924
               * for the field documentation.
3925
               */
3926
              public Builder addAllAccountSubcategory(
3927
                  List<
3928
                          InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3929
                              .FinancialConnections.Filters.AccountSubcategory>
3930
                      elements) {
3931
                if (this.accountSubcategories == null) {
×
3932
                  this.accountSubcategories = new ArrayList<>();
×
3933
                }
3934
                this.accountSubcategories.addAll(elements);
×
3935
                return this;
×
3936
              }
3937

3938
              /**
3939
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3940
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3941
               * original map. See {@link
3942
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams}
3943
               * for the field documentation.
3944
               */
3945
              public Builder putExtraParam(String key, Object value) {
3946
                if (this.extraParams == null) {
×
3947
                  this.extraParams = new HashMap<>();
×
3948
                }
3949
                this.extraParams.put(key, value);
×
3950
                return this;
×
3951
              }
3952

3953
              /**
3954
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
3955
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
3956
               * original map. See {@link
3957
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams}
3958
               * for the field documentation.
3959
               */
3960
              public Builder putAllExtraParam(Map<String, Object> map) {
3961
                if (this.extraParams == null) {
×
3962
                  this.extraParams = new HashMap<>();
×
3963
                }
3964
                this.extraParams.putAll(map);
×
3965
                return this;
×
3966
              }
3967

3968
              /** ID of the institution to use to filter for selectable accounts. */
3969
              public Builder setInstitution(String institution) {
3970
                this.institution = institution;
×
3971
                return this;
×
3972
              }
3973

3974
              /** ID of the institution to use to filter for selectable accounts. */
3975
              public Builder setInstitution(EmptyParam institution) {
3976
                this.institution = institution;
×
3977
                return this;
×
3978
              }
3979
            }
3980

3981
            public enum AccountSubcategory implements ApiRequestParams.EnumParam {
×
3982
              @SerializedName("checking")
×
3983
              CHECKING("checking"),
3984

3985
              @SerializedName("savings")
×
3986
              SAVINGS("savings");
3987

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

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

3997
          public enum Permission implements ApiRequestParams.EnumParam {
×
3998
            @SerializedName("balances")
×
3999
            BALANCES("balances"),
4000

4001
            @SerializedName("ownership")
×
4002
            OWNERSHIP("ownership"),
4003

4004
            @SerializedName("payment_method")
×
4005
            PAYMENT_METHOD("payment_method"),
4006

4007
            @SerializedName("transactions")
×
4008
            TRANSACTIONS("transactions");
4009

4010
            @Getter(onMethod_ = {@Override})
4011
            private final String value;
4012

4013
            Permission(String value) {
×
4014
              this.value = value;
×
4015
            }
×
4016
          }
4017

4018
          public enum Prefetch implements ApiRequestParams.EnumParam {
×
4019
            @SerializedName("balances")
×
4020
            BALANCES("balances"),
4021

4022
            @SerializedName("inferred_balances")
×
4023
            INFERRED_BALANCES("inferred_balances"),
4024

4025
            @SerializedName("ownership")
×
4026
            OWNERSHIP("ownership"),
4027

4028
            @SerializedName("transactions")
×
4029
            TRANSACTIONS("transactions");
4030

4031
            @Getter(onMethod_ = {@Override})
4032
            private final String value;
4033

4034
            Prefetch(String value) {
×
4035
              this.value = value;
×
4036
            }
×
4037
          }
4038
        }
4039

4040
        public enum VerificationMethod implements ApiRequestParams.EnumParam {
×
4041
          @SerializedName("automatic")
×
4042
          AUTOMATIC("automatic"),
4043

4044
          @SerializedName("instant")
×
4045
          INSTANT("instant"),
4046

4047
          @SerializedName("microdeposits")
×
4048
          MICRODEPOSITS("microdeposits");
4049

4050
          @Getter(onMethod_ = {@Override})
4051
          private final String value;
4052

4053
          VerificationMethod(String value) {
×
4054
            this.value = value;
×
4055
          }
×
4056
        }
4057
      }
4058
    }
4059

4060
    public enum PaymentMethodType implements ApiRequestParams.EnumParam {
×
4061
      @SerializedName("ach_credit_transfer")
×
4062
      ACH_CREDIT_TRANSFER("ach_credit_transfer"),
4063

4064
      @SerializedName("ach_debit")
×
4065
      ACH_DEBIT("ach_debit"),
4066

4067
      @SerializedName("acss_debit")
×
4068
      ACSS_DEBIT("acss_debit"),
4069

4070
      @SerializedName("amazon_pay")
×
4071
      AMAZON_PAY("amazon_pay"),
4072

4073
      @SerializedName("au_becs_debit")
×
4074
      AU_BECS_DEBIT("au_becs_debit"),
4075

4076
      @SerializedName("bacs_debit")
×
4077
      BACS_DEBIT("bacs_debit"),
4078

4079
      @SerializedName("bancontact")
×
4080
      BANCONTACT("bancontact"),
4081

4082
      @SerializedName("boleto")
×
4083
      BOLETO("boleto"),
4084

4085
      @SerializedName("card")
×
4086
      CARD("card"),
4087

4088
      @SerializedName("cashapp")
×
4089
      CASHAPP("cashapp"),
4090

4091
      @SerializedName("customer_balance")
×
4092
      CUSTOMER_BALANCE("customer_balance"),
4093

4094
      @SerializedName("eps")
×
4095
      EPS("eps"),
4096

4097
      @SerializedName("fpx")
×
4098
      FPX("fpx"),
4099

4100
      @SerializedName("giropay")
×
4101
      GIROPAY("giropay"),
4102

4103
      @SerializedName("grabpay")
×
4104
      GRABPAY("grabpay"),
4105

4106
      @SerializedName("ideal")
×
4107
      IDEAL("ideal"),
4108

4109
      @SerializedName("konbini")
×
4110
      KONBINI("konbini"),
4111

4112
      @SerializedName("link")
×
4113
      LINK("link"),
4114

4115
      @SerializedName("multibanco")
×
4116
      MULTIBANCO("multibanco"),
4117

4118
      @SerializedName("p24")
×
4119
      P24("p24"),
4120

4121
      @SerializedName("paynow")
×
4122
      PAYNOW("paynow"),
4123

4124
      @SerializedName("paypal")
×
4125
      PAYPAL("paypal"),
4126

4127
      @SerializedName("promptpay")
×
4128
      PROMPTPAY("promptpay"),
4129

4130
      @SerializedName("revolut_pay")
×
4131
      REVOLUT_PAY("revolut_pay"),
4132

4133
      @SerializedName("sepa_credit_transfer")
×
4134
      SEPA_CREDIT_TRANSFER("sepa_credit_transfer"),
4135

4136
      @SerializedName("sepa_debit")
×
4137
      SEPA_DEBIT("sepa_debit"),
4138

4139
      @SerializedName("sofort")
×
4140
      SOFORT("sofort"),
4141

4142
      @SerializedName("swish")
×
4143
      SWISH("swish"),
4144

4145
      @SerializedName("us_bank_account")
×
4146
      US_BANK_ACCOUNT("us_bank_account"),
4147

4148
      @SerializedName("wechat_pay")
×
4149
      WECHAT_PAY("wechat_pay");
4150

4151
      @Getter(onMethod_ = {@Override})
4152
      private final String value;
4153

4154
      PaymentMethodType(String value) {
×
4155
        this.value = value;
×
4156
      }
×
4157
    }
4158
  }
4159

4160
  @Getter
4161
  public static class Rendering {
4162
    /**
4163
     * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4164
     * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4165
     * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code exclude_tax}
4166
     * will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4167
     */
4168
    @SerializedName("amount_tax_display")
4169
    ApiRequestParams.EnumParam amountTaxDisplay;
4170

4171
    /**
4172
     * Map of extra parameters for custom features not available in this client library. The content
4173
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4174
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4175
     * param object. Effectively, this map is flattened to its parent instance.
4176
     */
4177
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4178
    Map<String, Object> extraParams;
4179

4180
    /** Invoice pdf rendering options. */
4181
    @SerializedName("pdf")
4182
    Pdf pdf;
4183

4184
    /** ID of the invoice rendering template to use for this invoice. */
4185
    @SerializedName("template")
4186
    Object template;
4187

4188
    /** The specific version of invoice rendering template to use for this invoice. */
4189
    @SerializedName("template_version")
4190
    Object templateVersion;
4191

4192
    private Rendering(
4193
        ApiRequestParams.EnumParam amountTaxDisplay,
4194
        Map<String, Object> extraParams,
4195
        Pdf pdf,
4196
        Object template,
NEW
4197
        Object templateVersion) {
×
4198
      this.amountTaxDisplay = amountTaxDisplay;
×
4199
      this.extraParams = extraParams;
×
4200
      this.pdf = pdf;
×
NEW
4201
      this.template = template;
×
NEW
4202
      this.templateVersion = templateVersion;
×
UNCOV
4203
    }
×
4204

4205
    public static Builder builder() {
4206
      return new Builder();
×
4207
    }
4208

4209
    public static class Builder {
×
4210
      private ApiRequestParams.EnumParam amountTaxDisplay;
4211

4212
      private Map<String, Object> extraParams;
4213

4214
      private Pdf pdf;
4215

4216
      private Object template;
4217

4218
      private Object templateVersion;
4219

4220
      /** Finalize and obtain parameter instance from this builder. */
4221
      public InvoiceUpdateParams.Rendering build() {
NEW
4222
        return new InvoiceUpdateParams.Rendering(
×
4223
            this.amountTaxDisplay, this.extraParams, this.pdf, this.template, this.templateVersion);
4224
      }
4225

4226
      /**
4227
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4228
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4229
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4230
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4231
       */
4232
      public Builder setAmountTaxDisplay(
4233
          InvoiceUpdateParams.Rendering.AmountTaxDisplay amountTaxDisplay) {
4234
        this.amountTaxDisplay = amountTaxDisplay;
×
4235
        return this;
×
4236
      }
4237

4238
      /**
4239
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4240
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4241
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4242
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4243
       */
4244
      public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
4245
        this.amountTaxDisplay = amountTaxDisplay;
×
4246
        return this;
×
4247
      }
4248

4249
      /**
4250
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4251
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4252
       * InvoiceUpdateParams.Rendering#extraParams} for the field documentation.
4253
       */
4254
      public Builder putExtraParam(String key, Object value) {
4255
        if (this.extraParams == null) {
×
4256
          this.extraParams = new HashMap<>();
×
4257
        }
4258
        this.extraParams.put(key, value);
×
4259
        return this;
×
4260
      }
4261

4262
      /**
4263
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4264
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4265
       * See {@link InvoiceUpdateParams.Rendering#extraParams} for the field documentation.
4266
       */
4267
      public Builder putAllExtraParam(Map<String, Object> map) {
4268
        if (this.extraParams == null) {
×
4269
          this.extraParams = new HashMap<>();
×
4270
        }
4271
        this.extraParams.putAll(map);
×
4272
        return this;
×
4273
      }
4274

4275
      /** Invoice pdf rendering options. */
4276
      public Builder setPdf(InvoiceUpdateParams.Rendering.Pdf pdf) {
4277
        this.pdf = pdf;
×
4278
        return this;
×
4279
      }
4280

4281
      /** ID of the invoice rendering template to use for this invoice. */
4282
      public Builder setTemplate(String template) {
NEW
4283
        this.template = template;
×
NEW
4284
        return this;
×
4285
      }
4286

4287
      /** ID of the invoice rendering template to use for this invoice. */
4288
      public Builder setTemplate(EmptyParam template) {
NEW
4289
        this.template = template;
×
NEW
4290
        return this;
×
4291
      }
4292

4293
      /** The specific version of invoice rendering template to use for this invoice. */
4294
      public Builder setTemplateVersion(Long templateVersion) {
NEW
4295
        this.templateVersion = templateVersion;
×
NEW
4296
        return this;
×
4297
      }
4298

4299
      /** The specific version of invoice rendering template to use for this invoice. */
4300
      public Builder setTemplateVersion(EmptyParam templateVersion) {
NEW
4301
        this.templateVersion = templateVersion;
×
NEW
4302
        return this;
×
4303
      }
4304
    }
4305

4306
    @Getter
4307
    public static class Pdf {
4308
      /**
4309
       * Map of extra parameters for custom features not available in this client library. The
4310
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4311
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4312
       * name in this param object. Effectively, this map is flattened to its parent instance.
4313
       */
4314
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4315
      Map<String, Object> extraParams;
4316

4317
      /**
4318
       * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4319
       * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4320
       * Japanese locale and {@code letter} for customers with other locales.
4321
       */
4322
      @SerializedName("page_size")
4323
      PageSize pageSize;
4324

4325
      private Pdf(Map<String, Object> extraParams, PageSize pageSize) {
×
4326
        this.extraParams = extraParams;
×
4327
        this.pageSize = pageSize;
×
4328
      }
×
4329

4330
      public static Builder builder() {
4331
        return new Builder();
×
4332
      }
4333

4334
      public static class Builder {
×
4335
        private Map<String, Object> extraParams;
4336

4337
        private PageSize pageSize;
4338

4339
        /** Finalize and obtain parameter instance from this builder. */
4340
        public InvoiceUpdateParams.Rendering.Pdf build() {
4341
          return new InvoiceUpdateParams.Rendering.Pdf(this.extraParams, this.pageSize);
×
4342
        }
4343

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

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

4372
        /**
4373
         * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4374
         * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4375
         * Japanese locale and {@code letter} for customers with other locales.
4376
         */
4377
        public Builder setPageSize(InvoiceUpdateParams.Rendering.Pdf.PageSize pageSize) {
4378
          this.pageSize = pageSize;
×
4379
          return this;
×
4380
        }
4381
      }
4382

4383
      public enum PageSize implements ApiRequestParams.EnumParam {
×
4384
        @SerializedName("a4")
×
4385
        A4("a4"),
4386

4387
        @SerializedName("auto")
×
4388
        AUTO("auto"),
4389

4390
        @SerializedName("letter")
×
4391
        LETTER("letter");
4392

4393
        @Getter(onMethod_ = {@Override})
4394
        private final String value;
4395

4396
        PageSize(String value) {
×
4397
          this.value = value;
×
4398
        }
×
4399
      }
4400
    }
4401

4402
    public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
4403
      @SerializedName("exclude_tax")
×
4404
      EXCLUDE_TAX("exclude_tax"),
4405

4406
      @SerializedName("include_inclusive_tax")
×
4407
      INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
4408

4409
      @Getter(onMethod_ = {@Override})
4410
      private final String value;
4411

4412
      AmountTaxDisplay(String value) {
×
4413
        this.value = value;
×
4414
      }
×
4415
    }
4416
  }
4417

4418
  @Getter
4419
  public static class ShippingCost {
4420
    /**
4421
     * Map of extra parameters for custom features not available in this client library. The content
4422
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4423
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4424
     * param object. Effectively, this map is flattened to its parent instance.
4425
     */
4426
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4427
    Map<String, Object> extraParams;
4428

4429
    /** The ID of the shipping rate to use for this order. */
4430
    @SerializedName("shipping_rate")
4431
    Object shippingRate;
4432

4433
    /** Parameters to create a new ad-hoc shipping rate for this order. */
4434
    @SerializedName("shipping_rate_data")
4435
    ShippingRateData shippingRateData;
4436

4437
    private ShippingCost(
4438
        Map<String, Object> extraParams, Object shippingRate, ShippingRateData shippingRateData) {
×
4439
      this.extraParams = extraParams;
×
4440
      this.shippingRate = shippingRate;
×
4441
      this.shippingRateData = shippingRateData;
×
4442
    }
×
4443

4444
    public static Builder builder() {
4445
      return new Builder();
×
4446
    }
4447

4448
    public static class Builder {
×
4449
      private Map<String, Object> extraParams;
4450

4451
      private Object shippingRate;
4452

4453
      private ShippingRateData shippingRateData;
4454

4455
      /** Finalize and obtain parameter instance from this builder. */
4456
      public InvoiceUpdateParams.ShippingCost build() {
4457
        return new InvoiceUpdateParams.ShippingCost(
×
4458
            this.extraParams, this.shippingRate, this.shippingRateData);
4459
      }
4460

4461
      /**
4462
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4463
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4464
       * InvoiceUpdateParams.ShippingCost#extraParams} for the field documentation.
4465
       */
4466
      public Builder putExtraParam(String key, Object value) {
4467
        if (this.extraParams == null) {
×
4468
          this.extraParams = new HashMap<>();
×
4469
        }
4470
        this.extraParams.put(key, value);
×
4471
        return this;
×
4472
      }
4473

4474
      /**
4475
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4476
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4477
       * See {@link InvoiceUpdateParams.ShippingCost#extraParams} for the field documentation.
4478
       */
4479
      public Builder putAllExtraParam(Map<String, Object> map) {
4480
        if (this.extraParams == null) {
×
4481
          this.extraParams = new HashMap<>();
×
4482
        }
4483
        this.extraParams.putAll(map);
×
4484
        return this;
×
4485
      }
4486

4487
      /** The ID of the shipping rate to use for this order. */
4488
      public Builder setShippingRate(String shippingRate) {
4489
        this.shippingRate = shippingRate;
×
4490
        return this;
×
4491
      }
4492

4493
      /** The ID of the shipping rate to use for this order. */
4494
      public Builder setShippingRate(EmptyParam shippingRate) {
4495
        this.shippingRate = shippingRate;
×
4496
        return this;
×
4497
      }
4498

4499
      /** Parameters to create a new ad-hoc shipping rate for this order. */
4500
      public Builder setShippingRateData(
4501
          InvoiceUpdateParams.ShippingCost.ShippingRateData shippingRateData) {
4502
        this.shippingRateData = shippingRateData;
×
4503
        return this;
×
4504
      }
4505
    }
4506

4507
    @Getter
4508
    public static class ShippingRateData {
4509
      /**
4510
       * The estimated range for how long shipping will take, meant to be displayable to the
4511
       * customer. This will appear on CheckoutSessions.
4512
       */
4513
      @SerializedName("delivery_estimate")
4514
      DeliveryEstimate deliveryEstimate;
4515

4516
      /**
4517
       * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4518
       * customer. This will appear on CheckoutSessions.
4519
       */
4520
      @SerializedName("display_name")
4521
      Object displayName;
4522

4523
      /**
4524
       * Map of extra parameters for custom features not available in this client library. The
4525
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4526
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4527
       * name in this param object. Effectively, this map is flattened to its parent instance.
4528
       */
4529
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4530
      Map<String, Object> extraParams;
4531

4532
      /**
4533
       * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4534
       * fixed_amount}.
4535
       */
4536
      @SerializedName("fixed_amount")
4537
      FixedAmount fixedAmount;
4538

4539
      /**
4540
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
4541
       * attach to an object. This can be useful for storing additional information about the object
4542
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
4543
       * keys can be unset by posting an empty value to {@code metadata}.
4544
       */
4545
      @SerializedName("metadata")
4546
      Map<String, String> metadata;
4547

4548
      /**
4549
       * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4550
       * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4551
       */
4552
      @SerializedName("tax_behavior")
4553
      TaxBehavior taxBehavior;
4554

4555
      /**
4556
       * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4557
       * code is {@code txcd_92010001}.
4558
       */
4559
      @SerializedName("tax_code")
4560
      Object taxCode;
4561

4562
      /** The type of calculation to use on the shipping rate. */
4563
      @SerializedName("type")
4564
      Type type;
4565

4566
      private ShippingRateData(
4567
          DeliveryEstimate deliveryEstimate,
4568
          Object displayName,
4569
          Map<String, Object> extraParams,
4570
          FixedAmount fixedAmount,
4571
          Map<String, String> metadata,
4572
          TaxBehavior taxBehavior,
4573
          Object taxCode,
4574
          Type type) {
×
4575
        this.deliveryEstimate = deliveryEstimate;
×
4576
        this.displayName = displayName;
×
4577
        this.extraParams = extraParams;
×
4578
        this.fixedAmount = fixedAmount;
×
4579
        this.metadata = metadata;
×
4580
        this.taxBehavior = taxBehavior;
×
4581
        this.taxCode = taxCode;
×
4582
        this.type = type;
×
4583
      }
×
4584

4585
      public static Builder builder() {
4586
        return new Builder();
×
4587
      }
4588

4589
      public static class Builder {
×
4590
        private DeliveryEstimate deliveryEstimate;
4591

4592
        private Object displayName;
4593

4594
        private Map<String, Object> extraParams;
4595

4596
        private FixedAmount fixedAmount;
4597

4598
        private Map<String, String> metadata;
4599

4600
        private TaxBehavior taxBehavior;
4601

4602
        private Object taxCode;
4603

4604
        private Type type;
4605

4606
        /** Finalize and obtain parameter instance from this builder. */
4607
        public InvoiceUpdateParams.ShippingCost.ShippingRateData build() {
4608
          return new InvoiceUpdateParams.ShippingCost.ShippingRateData(
×
4609
              this.deliveryEstimate,
4610
              this.displayName,
4611
              this.extraParams,
4612
              this.fixedAmount,
4613
              this.metadata,
4614
              this.taxBehavior,
4615
              this.taxCode,
4616
              this.type);
4617
        }
4618

4619
        /**
4620
         * The estimated range for how long shipping will take, meant to be displayable to the
4621
         * customer. This will appear on CheckoutSessions.
4622
         */
4623
        public Builder setDeliveryEstimate(
4624
            InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate deliveryEstimate) {
4625
          this.deliveryEstimate = deliveryEstimate;
×
4626
          return this;
×
4627
        }
4628

4629
        /**
4630
         * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4631
         * customer. This will appear on CheckoutSessions.
4632
         */
4633
        public Builder setDisplayName(String displayName) {
4634
          this.displayName = displayName;
×
4635
          return this;
×
4636
        }
4637

4638
        /**
4639
         * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4640
         * customer. This will appear on CheckoutSessions.
4641
         */
4642
        public Builder setDisplayName(EmptyParam displayName) {
4643
          this.displayName = displayName;
×
4644
          return this;
×
4645
        }
4646

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

4661
        /**
4662
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4663
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4664
         * map. See {@link InvoiceUpdateParams.ShippingCost.ShippingRateData#extraParams} for the
4665
         * field documentation.
4666
         */
4667
        public Builder putAllExtraParam(Map<String, Object> map) {
4668
          if (this.extraParams == null) {
×
4669
            this.extraParams = new HashMap<>();
×
4670
          }
4671
          this.extraParams.putAll(map);
×
4672
          return this;
×
4673
        }
4674

4675
        /**
4676
         * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4677
         * fixed_amount}.
4678
         */
4679
        public Builder setFixedAmount(
4680
            InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount fixedAmount) {
4681
          this.fixedAmount = fixedAmount;
×
4682
          return this;
×
4683
        }
4684

4685
        /**
4686
         * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
4687
         * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4688
         * InvoiceUpdateParams.ShippingCost.ShippingRateData#metadata} for the field documentation.
4689
         */
4690
        public Builder putMetadata(String key, String value) {
4691
          if (this.metadata == null) {
×
4692
            this.metadata = new HashMap<>();
×
4693
          }
4694
          this.metadata.put(key, value);
×
4695
          return this;
×
4696
        }
4697

4698
        /**
4699
         * Add all map key/value pairs to `metadata` map. A map is initialized for the first
4700
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4701
         * map. See {@link InvoiceUpdateParams.ShippingCost.ShippingRateData#metadata} for the field
4702
         * documentation.
4703
         */
4704
        public Builder putAllMetadata(Map<String, String> map) {
4705
          if (this.metadata == null) {
×
4706
            this.metadata = new HashMap<>();
×
4707
          }
4708
          this.metadata.putAll(map);
×
4709
          return this;
×
4710
        }
4711

4712
        /**
4713
         * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4714
         * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4715
         */
4716
        public Builder setTaxBehavior(
4717
            InvoiceUpdateParams.ShippingCost.ShippingRateData.TaxBehavior taxBehavior) {
4718
          this.taxBehavior = taxBehavior;
×
4719
          return this;
×
4720
        }
4721

4722
        /**
4723
         * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4724
         * code is {@code txcd_92010001}.
4725
         */
4726
        public Builder setTaxCode(String taxCode) {
4727
          this.taxCode = taxCode;
×
4728
          return this;
×
4729
        }
4730

4731
        /**
4732
         * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4733
         * code is {@code txcd_92010001}.
4734
         */
4735
        public Builder setTaxCode(EmptyParam taxCode) {
4736
          this.taxCode = taxCode;
×
4737
          return this;
×
4738
        }
4739

4740
        /** The type of calculation to use on the shipping rate. */
4741
        public Builder setType(InvoiceUpdateParams.ShippingCost.ShippingRateData.Type type) {
4742
          this.type = type;
×
4743
          return this;
×
4744
        }
4745
      }
4746

4747
      @Getter
4748
      public static class DeliveryEstimate {
4749
        /**
4750
         * Map of extra parameters for custom features not available in this client library. The
4751
         * content in this map is not serialized under this field's {@code @SerializedName} value.
4752
         * Instead, each key/value pair is serialized as if the key is a root-level field
4753
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
4754
         * instance.
4755
         */
4756
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4757
        Map<String, Object> extraParams;
4758

4759
        /**
4760
         * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4761
         * infinite.
4762
         */
4763
        @SerializedName("maximum")
4764
        Maximum maximum;
4765

4766
        /** The lower bound of the estimated range. If empty, represents no lower bound. */
4767
        @SerializedName("minimum")
4768
        Minimum minimum;
4769

4770
        private DeliveryEstimate(
4771
            Map<String, Object> extraParams, Maximum maximum, Minimum minimum) {
×
4772
          this.extraParams = extraParams;
×
4773
          this.maximum = maximum;
×
4774
          this.minimum = minimum;
×
4775
        }
×
4776

4777
        public static Builder builder() {
4778
          return new Builder();
×
4779
        }
4780

4781
        public static class Builder {
×
4782
          private Map<String, Object> extraParams;
4783

4784
          private Maximum maximum;
4785

4786
          private Minimum minimum;
4787

4788
          /** Finalize and obtain parameter instance from this builder. */
4789
          public InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate build() {
4790
            return new InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate(
×
4791
                this.extraParams, this.maximum, this.minimum);
4792
          }
4793

4794
          /**
4795
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
4796
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4797
           * map. See {@link
4798
           * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate#extraParams} for the
4799
           * field documentation.
4800
           */
4801
          public Builder putExtraParam(String key, Object value) {
4802
            if (this.extraParams == null) {
×
4803
              this.extraParams = new HashMap<>();
×
4804
            }
4805
            this.extraParams.put(key, value);
×
4806
            return this;
×
4807
          }
4808

4809
          /**
4810
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4811
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4812
           * map. See {@link
4813
           * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate#extraParams} for the
4814
           * field documentation.
4815
           */
4816
          public Builder putAllExtraParam(Map<String, Object> map) {
4817
            if (this.extraParams == null) {
×
4818
              this.extraParams = new HashMap<>();
×
4819
            }
4820
            this.extraParams.putAll(map);
×
4821
            return this;
×
4822
          }
4823

4824
          /**
4825
           * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4826
           * infinite.
4827
           */
4828
          public Builder setMaximum(
4829
              InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum maximum) {
4830
            this.maximum = maximum;
×
4831
            return this;
×
4832
          }
4833

4834
          /** The lower bound of the estimated range. If empty, represents no lower bound. */
4835
          public Builder setMinimum(
4836
              InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum minimum) {
4837
            this.minimum = minimum;
×
4838
            return this;
×
4839
          }
4840
        }
4841

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

4854
          /** <strong>Required.</strong> A unit of time. */
4855
          @SerializedName("unit")
4856
          Unit unit;
4857

4858
          /** <strong>Required.</strong> Must be greater than 0. */
4859
          @SerializedName("value")
4860
          Long value;
4861

4862
          private Maximum(Map<String, Object> extraParams, Unit unit, Long value) {
×
4863
            this.extraParams = extraParams;
×
4864
            this.unit = unit;
×
4865
            this.value = value;
×
4866
          }
×
4867

4868
          public static Builder builder() {
4869
            return new Builder();
×
4870
          }
4871

4872
          public static class Builder {
×
4873
            private Map<String, Object> extraParams;
4874

4875
            private Unit unit;
4876

4877
            private Long value;
4878

4879
            /** Finalize and obtain parameter instance from this builder. */
4880
            public InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum
4881
                build() {
4882
              return new InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum(
×
4883
                  this.extraParams, this.unit, this.value);
4884
            }
4885

4886
            /**
4887
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
4888
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4889
             * original map. See {@link
4890
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum#extraParams}
4891
             * for the field documentation.
4892
             */
4893
            public Builder putExtraParam(String key, Object value) {
4894
              if (this.extraParams == null) {
×
4895
                this.extraParams = new HashMap<>();
×
4896
              }
4897
              this.extraParams.put(key, value);
×
4898
              return this;
×
4899
            }
4900

4901
            /**
4902
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4903
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4904
             * original map. See {@link
4905
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum#extraParams}
4906
             * for the field documentation.
4907
             */
4908
            public Builder putAllExtraParam(Map<String, Object> map) {
4909
              if (this.extraParams == null) {
×
4910
                this.extraParams = new HashMap<>();
×
4911
              }
4912
              this.extraParams.putAll(map);
×
4913
              return this;
×
4914
            }
4915

4916
            /** <strong>Required.</strong> A unit of time. */
4917
            public Builder setUnit(
4918
                InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum.Unit
4919
                    unit) {
4920
              this.unit = unit;
×
4921
              return this;
×
4922
            }
4923

4924
            /** <strong>Required.</strong> Must be greater than 0. */
4925
            public Builder setValue(Long value) {
4926
              this.value = value;
×
4927
              return this;
×
4928
            }
4929
          }
4930

4931
          public enum Unit implements ApiRequestParams.EnumParam {
×
4932
            @SerializedName("business_day")
×
4933
            BUSINESS_DAY("business_day"),
4934

4935
            @SerializedName("day")
×
4936
            DAY("day"),
4937

4938
            @SerializedName("hour")
×
4939
            HOUR("hour"),
4940

4941
            @SerializedName("month")
×
4942
            MONTH("month"),
4943

4944
            @SerializedName("week")
×
4945
            WEEK("week");
4946

4947
            @Getter(onMethod_ = {@Override})
4948
            private final String value;
4949

4950
            Unit(String value) {
×
4951
              this.value = value;
×
4952
            }
×
4953
          }
4954
        }
4955

4956
        @Getter
4957
        public static class Minimum {
4958
          /**
4959
           * Map of extra parameters for custom features not available in this client library. The
4960
           * content in this map is not serialized under this field's {@code @SerializedName} value.
4961
           * Instead, each key/value pair is serialized as if the key is a root-level field
4962
           * (serialized) name in this param object. Effectively, this map is flattened to its
4963
           * parent instance.
4964
           */
4965
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4966
          Map<String, Object> extraParams;
4967

4968
          /** <strong>Required.</strong> A unit of time. */
4969
          @SerializedName("unit")
4970
          Unit unit;
4971

4972
          /** <strong>Required.</strong> Must be greater than 0. */
4973
          @SerializedName("value")
4974
          Long value;
4975

4976
          private Minimum(Map<String, Object> extraParams, Unit unit, Long value) {
×
4977
            this.extraParams = extraParams;
×
4978
            this.unit = unit;
×
4979
            this.value = value;
×
4980
          }
×
4981

4982
          public static Builder builder() {
4983
            return new Builder();
×
4984
          }
4985

4986
          public static class Builder {
×
4987
            private Map<String, Object> extraParams;
4988

4989
            private Unit unit;
4990

4991
            private Long value;
4992

4993
            /** Finalize and obtain parameter instance from this builder. */
4994
            public InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum
4995
                build() {
4996
              return new InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum(
×
4997
                  this.extraParams, this.unit, this.value);
4998
            }
4999

5000
            /**
5001
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
5002
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5003
             * original map. See {@link
5004
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
5005
             * for the field documentation.
5006
             */
5007
            public Builder putExtraParam(String key, Object value) {
5008
              if (this.extraParams == null) {
×
5009
                this.extraParams = new HashMap<>();
×
5010
              }
5011
              this.extraParams.put(key, value);
×
5012
              return this;
×
5013
            }
5014

5015
            /**
5016
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5017
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5018
             * original map. See {@link
5019
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
5020
             * for the field documentation.
5021
             */
5022
            public Builder putAllExtraParam(Map<String, Object> map) {
5023
              if (this.extraParams == null) {
×
5024
                this.extraParams = new HashMap<>();
×
5025
              }
5026
              this.extraParams.putAll(map);
×
5027
              return this;
×
5028
            }
5029

5030
            /** <strong>Required.</strong> A unit of time. */
5031
            public Builder setUnit(
5032
                InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum.Unit
5033
                    unit) {
5034
              this.unit = unit;
×
5035
              return this;
×
5036
            }
5037

5038
            /** <strong>Required.</strong> Must be greater than 0. */
5039
            public Builder setValue(Long value) {
5040
              this.value = value;
×
5041
              return this;
×
5042
            }
5043
          }
5044

5045
          public enum Unit implements ApiRequestParams.EnumParam {
×
5046
            @SerializedName("business_day")
×
5047
            BUSINESS_DAY("business_day"),
5048

5049
            @SerializedName("day")
×
5050
            DAY("day"),
5051

5052
            @SerializedName("hour")
×
5053
            HOUR("hour"),
5054

5055
            @SerializedName("month")
×
5056
            MONTH("month"),
5057

5058
            @SerializedName("week")
×
5059
            WEEK("week");
5060

5061
            @Getter(onMethod_ = {@Override})
5062
            private final String value;
5063

5064
            Unit(String value) {
×
5065
              this.value = value;
×
5066
            }
×
5067
          }
5068
        }
5069
      }
5070

5071
      @Getter
5072
      public static class FixedAmount {
5073
        /**
5074
         * <strong>Required.</strong> A non-negative integer in cents representing how much to
5075
         * charge.
5076
         */
5077
        @SerializedName("amount")
5078
        Long amount;
5079

5080
        /**
5081
         * <strong>Required.</strong> Three-letter <a
5082
         * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5083
         * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
5084
         */
5085
        @SerializedName("currency")
5086
        Object currency;
5087

5088
        /**
5089
         * Shipping rates defined in each available currency option. Each key must be a three-letter
5090
         * <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a
5091
         * href="https://stripe.com/docs/currencies">supported currency</a>.
5092
         */
5093
        @SerializedName("currency_options")
5094
        Map<String, InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5095
            currencyOptions;
5096

5097
        /**
5098
         * Map of extra parameters for custom features not available in this client library. The
5099
         * content in this map is not serialized under this field's {@code @SerializedName} value.
5100
         * Instead, each key/value pair is serialized as if the key is a root-level field
5101
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
5102
         * instance.
5103
         */
5104
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5105
        Map<String, Object> extraParams;
5106

5107
        private FixedAmount(
5108
            Long amount,
5109
            Object currency,
5110
            Map<
5111
                    String,
5112
                    InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5113
                currencyOptions,
5114
            Map<String, Object> extraParams) {
×
5115
          this.amount = amount;
×
5116
          this.currency = currency;
×
5117
          this.currencyOptions = currencyOptions;
×
5118
          this.extraParams = extraParams;
×
5119
        }
×
5120

5121
        public static Builder builder() {
5122
          return new Builder();
×
5123
        }
5124

5125
        public static class Builder {
×
5126
          private Long amount;
5127

5128
          private Object currency;
5129

5130
          private Map<
5131
                  String,
5132
                  InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5133
              currencyOptions;
5134

5135
          private Map<String, Object> extraParams;
5136

5137
          /** Finalize and obtain parameter instance from this builder. */
5138
          public InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount build() {
5139
            return new InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount(
×
5140
                this.amount, this.currency, this.currencyOptions, this.extraParams);
5141
          }
5142

5143
          /**
5144
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5145
           * charge.
5146
           */
5147
          public Builder setAmount(Long amount) {
5148
            this.amount = amount;
×
5149
            return this;
×
5150
          }
5151

5152
          /**
5153
           * <strong>Required.</strong> Three-letter <a
5154
           * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5155
           * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
5156
           * currency</a>.
5157
           */
5158
          public Builder setCurrency(String currency) {
5159
            this.currency = currency;
×
5160
            return this;
×
5161
          }
5162

5163
          /**
5164
           * <strong>Required.</strong> Three-letter <a
5165
           * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5166
           * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
5167
           * currency</a>.
5168
           */
5169
          public Builder setCurrency(EmptyParam currency) {
5170
            this.currency = currency;
×
5171
            return this;
×
5172
          }
5173

5174
          /**
5175
           * Add a key/value pair to `currencyOptions` map. A map is initialized for the first
5176
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5177
           * map. See {@link
5178
           * InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the
5179
           * field documentation.
5180
           */
5181
          public Builder putCurrencyOption(
5182
              String key,
5183
              InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption value) {
5184
            if (this.currencyOptions == null) {
×
5185
              this.currencyOptions = new HashMap<>();
×
5186
            }
5187
            this.currencyOptions.put(key, value);
×
5188
            return this;
×
5189
          }
5190

5191
          /**
5192
           * Add all map key/value pairs to `currencyOptions` map. A map is initialized for the
5193
           * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
5194
           * original map. See {@link
5195
           * InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the
5196
           * field documentation.
5197
           */
5198
          public Builder putAllCurrencyOption(
5199
              Map<
5200
                      String,
5201
                      InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5202
                  map) {
5203
            if (this.currencyOptions == null) {
×
5204
              this.currencyOptions = new HashMap<>();
×
5205
            }
5206
            this.currencyOptions.putAll(map);
×
5207
            return this;
×
5208
          }
5209

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

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

5241
        @Getter
5242
        public static class CurrencyOption {
5243
          /**
5244
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5245
           * charge.
5246
           */
5247
          @SerializedName("amount")
5248
          Long amount;
5249

5250
          /**
5251
           * Map of extra parameters for custom features not available in this client library. The
5252
           * content in this map is not serialized under this field's {@code @SerializedName} value.
5253
           * Instead, each key/value pair is serialized as if the key is a root-level field
5254
           * (serialized) name in this param object. Effectively, this map is flattened to its
5255
           * parent instance.
5256
           */
5257
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5258
          Map<String, Object> extraParams;
5259

5260
          /**
5261
           * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One
5262
           * of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5263
           */
5264
          @SerializedName("tax_behavior")
5265
          TaxBehavior taxBehavior;
5266

5267
          private CurrencyOption(
5268
              Long amount, Map<String, Object> extraParams, TaxBehavior taxBehavior) {
×
5269
            this.amount = amount;
×
5270
            this.extraParams = extraParams;
×
5271
            this.taxBehavior = taxBehavior;
×
5272
          }
×
5273

5274
          public static Builder builder() {
5275
            return new Builder();
×
5276
          }
5277

5278
          public static class Builder {
×
5279
            private Long amount;
5280

5281
            private Map<String, Object> extraParams;
5282

5283
            private TaxBehavior taxBehavior;
5284

5285
            /** Finalize and obtain parameter instance from this builder. */
5286
            public InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5287
                build() {
5288
              return new InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount
×
5289
                  .CurrencyOption(this.amount, this.extraParams, this.taxBehavior);
5290
            }
5291

5292
            /**
5293
             * <strong>Required.</strong> A non-negative integer in cents representing how much to
5294
             * charge.
5295
             */
5296
            public Builder setAmount(Long amount) {
5297
              this.amount = amount;
×
5298
              return this;
×
5299
            }
5300

5301
            /**
5302
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
5303
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5304
             * original map. See {@link
5305
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption#extraParams}
5306
             * for the field documentation.
5307
             */
5308
            public Builder putExtraParam(String key, Object value) {
5309
              if (this.extraParams == null) {
×
5310
                this.extraParams = new HashMap<>();
×
5311
              }
5312
              this.extraParams.put(key, value);
×
5313
              return this;
×
5314
            }
5315

5316
            /**
5317
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5318
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5319
             * original map. See {@link
5320
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption#extraParams}
5321
             * for the field documentation.
5322
             */
5323
            public Builder putAllExtraParam(Map<String, Object> map) {
5324
              if (this.extraParams == null) {
×
5325
                this.extraParams = new HashMap<>();
×
5326
              }
5327
              this.extraParams.putAll(map);
×
5328
              return this;
×
5329
            }
5330

5331
            /**
5332
             * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
5333
             * One of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5334
             */
5335
            public Builder setTaxBehavior(
5336
                InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5337
                        .TaxBehavior
5338
                    taxBehavior) {
5339
              this.taxBehavior = taxBehavior;
×
5340
              return this;
×
5341
            }
5342
          }
5343

5344
          public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5345
            @SerializedName("exclusive")
×
5346
            EXCLUSIVE("exclusive"),
5347

5348
            @SerializedName("inclusive")
×
5349
            INCLUSIVE("inclusive"),
5350

5351
            @SerializedName("unspecified")
×
5352
            UNSPECIFIED("unspecified");
5353

5354
            @Getter(onMethod_ = {@Override})
5355
            private final String value;
5356

5357
            TaxBehavior(String value) {
×
5358
              this.value = value;
×
5359
            }
×
5360
          }
5361
        }
5362
      }
5363

5364
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5365
        @SerializedName("exclusive")
×
5366
        EXCLUSIVE("exclusive"),
5367

5368
        @SerializedName("inclusive")
×
5369
        INCLUSIVE("inclusive"),
5370

5371
        @SerializedName("unspecified")
×
5372
        UNSPECIFIED("unspecified");
5373

5374
        @Getter(onMethod_ = {@Override})
5375
        private final String value;
5376

5377
        TaxBehavior(String value) {
×
5378
          this.value = value;
×
5379
        }
×
5380
      }
5381

5382
      public enum Type implements ApiRequestParams.EnumParam {
×
5383
        @SerializedName("fixed_amount")
×
5384
        FIXED_AMOUNT("fixed_amount");
5385

5386
        @Getter(onMethod_ = {@Override})
5387
        private final String value;
5388

5389
        Type(String value) {
×
5390
          this.value = value;
×
5391
        }
×
5392
      }
5393
    }
5394
  }
5395

5396
  @Getter
5397
  public static class ShippingDetails {
5398
    /** <strong>Required.</strong> Shipping address */
5399
    @SerializedName("address")
5400
    Address address;
5401

5402
    /**
5403
     * Map of extra parameters for custom features not available in this client library. The content
5404
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5405
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5406
     * param object. Effectively, this map is flattened to its parent instance.
5407
     */
5408
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5409
    Map<String, Object> extraParams;
5410

5411
    /** <strong>Required.</strong> Recipient name. */
5412
    @SerializedName("name")
5413
    Object name;
5414

5415
    /** Recipient phone (including extension). */
5416
    @SerializedName("phone")
5417
    Object phone;
5418

5419
    private ShippingDetails(
5420
        Address address, Map<String, Object> extraParams, Object name, Object phone) {
×
5421
      this.address = address;
×
5422
      this.extraParams = extraParams;
×
5423
      this.name = name;
×
5424
      this.phone = phone;
×
5425
    }
×
5426

5427
    public static Builder builder() {
5428
      return new Builder();
×
5429
    }
5430

5431
    public static class Builder {
×
5432
      private Address address;
5433

5434
      private Map<String, Object> extraParams;
5435

5436
      private Object name;
5437

5438
      private Object phone;
5439

5440
      /** Finalize and obtain parameter instance from this builder. */
5441
      public InvoiceUpdateParams.ShippingDetails build() {
5442
        return new InvoiceUpdateParams.ShippingDetails(
×
5443
            this.address, this.extraParams, this.name, this.phone);
5444
      }
5445

5446
      /** <strong>Required.</strong> Shipping address */
5447
      public Builder setAddress(InvoiceUpdateParams.ShippingDetails.Address address) {
5448
        this.address = address;
×
5449
        return this;
×
5450
      }
5451

5452
      /**
5453
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5454
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5455
       * InvoiceUpdateParams.ShippingDetails#extraParams} for the field documentation.
5456
       */
5457
      public Builder putExtraParam(String key, Object value) {
5458
        if (this.extraParams == null) {
×
5459
          this.extraParams = new HashMap<>();
×
5460
        }
5461
        this.extraParams.put(key, value);
×
5462
        return this;
×
5463
      }
5464

5465
      /**
5466
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5467
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5468
       * See {@link InvoiceUpdateParams.ShippingDetails#extraParams} for the field documentation.
5469
       */
5470
      public Builder putAllExtraParam(Map<String, Object> map) {
5471
        if (this.extraParams == null) {
×
5472
          this.extraParams = new HashMap<>();
×
5473
        }
5474
        this.extraParams.putAll(map);
×
5475
        return this;
×
5476
      }
5477

5478
      /** <strong>Required.</strong> Recipient name. */
5479
      public Builder setName(String name) {
5480
        this.name = name;
×
5481
        return this;
×
5482
      }
5483

5484
      /** <strong>Required.</strong> Recipient name. */
5485
      public Builder setName(EmptyParam name) {
5486
        this.name = name;
×
5487
        return this;
×
5488
      }
5489

5490
      /** Recipient phone (including extension). */
5491
      public Builder setPhone(String phone) {
5492
        this.phone = phone;
×
5493
        return this;
×
5494
      }
5495

5496
      /** Recipient phone (including extension). */
5497
      public Builder setPhone(EmptyParam phone) {
5498
        this.phone = phone;
×
5499
        return this;
×
5500
      }
5501
    }
5502

5503
    @Getter
5504
    public static class Address {
5505
      /** City, district, suburb, town, or village. */
5506
      @SerializedName("city")
5507
      Object city;
5508

5509
      /**
5510
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5511
       * 3166-1 alpha-2</a>).
5512
       */
5513
      @SerializedName("country")
5514
      Object country;
5515

5516
      /**
5517
       * Map of extra parameters for custom features not available in this client library. The
5518
       * content in this map is not serialized under this field's {@code @SerializedName} value.
5519
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
5520
       * name in this param object. Effectively, this map is flattened to its parent instance.
5521
       */
5522
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5523
      Map<String, Object> extraParams;
5524

5525
      /** Address line 1 (e.g., street, PO Box, or company name). */
5526
      @SerializedName("line1")
5527
      Object line1;
5528

5529
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
5530
      @SerializedName("line2")
5531
      Object line2;
5532

5533
      /** ZIP or postal code. */
5534
      @SerializedName("postal_code")
5535
      Object postalCode;
5536

5537
      /** State, county, province, or region. */
5538
      @SerializedName("state")
5539
      Object state;
5540

5541
      private Address(
5542
          Object city,
5543
          Object country,
5544
          Map<String, Object> extraParams,
5545
          Object line1,
5546
          Object line2,
5547
          Object postalCode,
5548
          Object state) {
×
5549
        this.city = city;
×
5550
        this.country = country;
×
5551
        this.extraParams = extraParams;
×
5552
        this.line1 = line1;
×
5553
        this.line2 = line2;
×
5554
        this.postalCode = postalCode;
×
5555
        this.state = state;
×
5556
      }
×
5557

5558
      public static Builder builder() {
5559
        return new Builder();
×
5560
      }
5561

5562
      public static class Builder {
×
5563
        private Object city;
5564

5565
        private Object country;
5566

5567
        private Map<String, Object> extraParams;
5568

5569
        private Object line1;
5570

5571
        private Object line2;
5572

5573
        private Object postalCode;
5574

5575
        private Object state;
5576

5577
        /** Finalize and obtain parameter instance from this builder. */
5578
        public InvoiceUpdateParams.ShippingDetails.Address build() {
5579
          return new InvoiceUpdateParams.ShippingDetails.Address(
×
5580
              this.city,
5581
              this.country,
5582
              this.extraParams,
5583
              this.line1,
5584
              this.line2,
5585
              this.postalCode,
5586
              this.state);
5587
        }
5588

5589
        /** City, district, suburb, town, or village. */
5590
        public Builder setCity(String city) {
5591
          this.city = city;
×
5592
          return this;
×
5593
        }
5594

5595
        /** City, district, suburb, town, or village. */
5596
        public Builder setCity(EmptyParam city) {
5597
          this.city = city;
×
5598
          return this;
×
5599
        }
5600

5601
        /**
5602
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5603
         * 3166-1 alpha-2</a>).
5604
         */
5605
        public Builder setCountry(String country) {
5606
          this.country = country;
×
5607
          return this;
×
5608
        }
5609

5610
        /**
5611
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5612
         * 3166-1 alpha-2</a>).
5613
         */
5614
        public Builder setCountry(EmptyParam country) {
5615
          this.country = country;
×
5616
          return this;
×
5617
        }
5618

5619
        /**
5620
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
5621
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5622
         * map. See {@link InvoiceUpdateParams.ShippingDetails.Address#extraParams} for the field
5623
         * documentation.
5624
         */
5625
        public Builder putExtraParam(String key, Object value) {
5626
          if (this.extraParams == null) {
×
5627
            this.extraParams = new HashMap<>();
×
5628
          }
5629
          this.extraParams.put(key, value);
×
5630
          return this;
×
5631
        }
5632

5633
        /**
5634
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5635
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5636
         * map. See {@link InvoiceUpdateParams.ShippingDetails.Address#extraParams} for the field
5637
         * documentation.
5638
         */
5639
        public Builder putAllExtraParam(Map<String, Object> map) {
5640
          if (this.extraParams == null) {
×
5641
            this.extraParams = new HashMap<>();
×
5642
          }
5643
          this.extraParams.putAll(map);
×
5644
          return this;
×
5645
        }
5646

5647
        /** Address line 1 (e.g., street, PO Box, or company name). */
5648
        public Builder setLine1(String line1) {
5649
          this.line1 = line1;
×
5650
          return this;
×
5651
        }
5652

5653
        /** Address line 1 (e.g., street, PO Box, or company name). */
5654
        public Builder setLine1(EmptyParam line1) {
5655
          this.line1 = line1;
×
5656
          return this;
×
5657
        }
5658

5659
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
5660
        public Builder setLine2(String line2) {
5661
          this.line2 = line2;
×
5662
          return this;
×
5663
        }
5664

5665
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
5666
        public Builder setLine2(EmptyParam line2) {
5667
          this.line2 = line2;
×
5668
          return this;
×
5669
        }
5670

5671
        /** ZIP or postal code. */
5672
        public Builder setPostalCode(String postalCode) {
5673
          this.postalCode = postalCode;
×
5674
          return this;
×
5675
        }
5676

5677
        /** ZIP or postal code. */
5678
        public Builder setPostalCode(EmptyParam postalCode) {
5679
          this.postalCode = postalCode;
×
5680
          return this;
×
5681
        }
5682

5683
        /** State, county, province, or region. */
5684
        public Builder setState(String state) {
5685
          this.state = state;
×
5686
          return this;
×
5687
        }
5688

5689
        /** State, county, province, or region. */
5690
        public Builder setState(EmptyParam state) {
5691
          this.state = state;
×
5692
          return this;
×
5693
        }
5694
      }
5695
    }
5696
  }
5697

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

5707
    /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5708
    @SerializedName("destination")
5709
    Object destination;
5710

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

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

5726
    public static Builder builder() {
5727
      return new Builder();
×
5728
    }
5729

5730
    public static class Builder {
×
5731
      private Long amount;
5732

5733
      private Object destination;
5734

5735
      private Map<String, Object> extraParams;
5736

5737
      /** Finalize and obtain parameter instance from this builder. */
5738
      public InvoiceUpdateParams.TransferData build() {
5739
        return new InvoiceUpdateParams.TransferData(
×
5740
            this.amount, this.destination, this.extraParams);
5741
      }
5742

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

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

5758
      /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5759
      public Builder setDestination(EmptyParam 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
       * InvoiceUpdateParams.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 InvoiceUpdateParams.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
}
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