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

stripe / stripe-java / #16599

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

push

github

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

Update generated code for beta

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

19 existing lines in 15 files now uncovered.

18843 of 150513 relevant lines covered (12.52%)

0.13 hits per line

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

4.7
/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
   * The time when this invoice should be scheduled to finalize. The invoice will be finalized at
50
   * this time if it is still in draft state. To turn off automatic finalization, set {@code
51
   * auto_advance} to false.
52
   */
53
  @SerializedName("automatically_finalizes_at")
54
  Long automaticallyFinalizesAt;
55

56
  /**
57
   * Either {@code charge_automatically} or {@code send_invoice}. This field can be updated only on
58
   * {@code draft} invoices.
59
   */
60
  @SerializedName("collection_method")
61
  CollectionMethod collectionMethod;
62

63
  /**
64
   * A list of up to 4 custom fields to be displayed on the invoice. If a value for {@code
65
   * custom_fields} is specified, the list specified will replace the existing custom field list on
66
   * this invoice. Pass an empty string to remove previously-defined fields.
67
   */
68
  @SerializedName("custom_fields")
69
  Object customFields;
70

71
  /**
72
   * The number of days from which the invoice is created until it is due. Only valid for invoices
73
   * where {@code collection_method=send_invoice}. This field can only be updated on {@code draft}
74
   * invoices.
75
   */
76
  @SerializedName("days_until_due")
77
  Long daysUntilDue;
78

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

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

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

101
  /**
102
   * The tax rates that will apply to any line item that does not have {@code tax_rates} set. Pass
103
   * an empty string to remove previously-defined tax rates.
104
   */
105
  @SerializedName("default_tax_rates")
106
  Object defaultTaxRates;
107

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

115
  /**
116
   * The discounts that will apply to the invoice. Pass an empty string to remove previously-defined
117
   * discounts.
118
   */
119
  @SerializedName("discounts")
120
  Object discounts;
121

122
  /**
123
   * The date on which payment for this invoice is due. Only valid for invoices where {@code
124
   * collection_method=send_invoice}. This field can only be updated on {@code draft} invoices.
125
   */
126
  @SerializedName("due_date")
127
  Long dueDate;
128

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

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

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

150
  /** Footer to be displayed on the invoice. */
151
  @SerializedName("footer")
152
  Object footer;
153

154
  /**
155
   * The connected account that issues the invoice. The invoice is presented with the branding and
156
   * support information of the specified account.
157
   */
158
  @SerializedName("issuer")
159
  Issuer issuer;
160

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

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

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

190
  /**
191
   * Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
192
   */
193
  @SerializedName("payment_settings")
194
  PaymentSettings paymentSettings;
195

196
  /**
197
   * The rendering-related settings that control how the invoice is displayed on customer-facing
198
   * surfaces such as PDF and Hosted Invoice Page.
199
   */
200
  @SerializedName("rendering")
201
  Rendering rendering;
202

203
  /** Settings for the cost of shipping for this invoice. */
204
  @SerializedName("shipping_cost")
205
  Object shippingCost;
206

207
  /**
208
   * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
209
   * if it is set, otherwise the PDF will render the shipping address from the customer.
210
   */
211
  @SerializedName("shipping_details")
212
  Object shippingDetails;
213

214
  /**
215
   * Extra information about a charge for the customer's credit card statement. It must contain at
216
   * least one letter. If not specified and this invoice is part of a subscription, the default
217
   * {@code statement_descriptor} will be set to the first subscription item's product's {@code
218
   * statement_descriptor}.
219
   */
220
  @SerializedName("statement_descriptor")
221
  Object statementDescriptor;
222

223
  /**
224
   * If specified, the funds from the invoice will be transferred to the destination and the ID of
225
   * the resulting transfer will be found on the invoice's charge. This will be unset if you POST an
226
   * empty value.
227
   */
228
  @SerializedName("transfer_data")
229
  Object transferData;
230

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

294
  public static Builder builder() {
295
    return new Builder();
1✔
296
  }
297

298
  public static class Builder {
1✔
299
    private Object accountTaxIds;
300

301
    private Object amountsDue;
302

303
    private Long applicationFeeAmount;
304

305
    private Boolean autoAdvance;
306

307
    private AutomaticTax automaticTax;
308

309
    private Long automaticallyFinalizesAt;
310

311
    private CollectionMethod collectionMethod;
312

313
    private Object customFields;
314

315
    private Long daysUntilDue;
316

317
    private Object defaultMargins;
318

319
    private Object defaultPaymentMethod;
320

321
    private Object defaultSource;
322

323
    private Object defaultTaxRates;
324

325
    private Object description;
326

327
    private Object discounts;
328

329
    private Long dueDate;
330

331
    private Object effectiveAt;
332

333
    private List<String> expand;
334

335
    private Map<String, Object> extraParams;
336

337
    private Object footer;
338

339
    private Issuer issuer;
340

341
    private Object metadata;
342

343
    private Object number;
344

345
    private Object onBehalfOf;
346

347
    private PaymentSettings paymentSettings;
348

349
    private Rendering rendering;
350

351
    private Object shippingCost;
352

353
    private Object shippingDetails;
354

355
    private Object statementDescriptor;
356

357
    private Object transferData;
358

359
    /** Finalize and obtain parameter instance from this builder. */
360
    public InvoiceUpdateParams build() {
361
      return new InvoiceUpdateParams(
1✔
362
          this.accountTaxIds,
363
          this.amountsDue,
364
          this.applicationFeeAmount,
365
          this.autoAdvance,
366
          this.automaticTax,
367
          this.automaticallyFinalizesAt,
368
          this.collectionMethod,
369
          this.customFields,
370
          this.daysUntilDue,
371
          this.defaultMargins,
372
          this.defaultPaymentMethod,
373
          this.defaultSource,
374
          this.defaultTaxRates,
375
          this.description,
376
          this.discounts,
377
          this.dueDate,
378
          this.effectiveAt,
379
          this.expand,
380
          this.extraParams,
381
          this.footer,
382
          this.issuer,
383
          this.metadata,
384
          this.number,
385
          this.onBehalfOf,
386
          this.paymentSettings,
387
          this.rendering,
388
          this.shippingCost,
389
          this.shippingDetails,
390
          this.statementDescriptor,
391
          this.transferData);
392
    }
393

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

408
    /**
409
     * Add all elements to `accountTaxIds` list. A list is initialized for the first `add/addAll`
410
     * call, and subsequent calls adds additional elements to the original list. See {@link
411
     * InvoiceUpdateParams#accountTaxIds} for the field documentation.
412
     */
413
    @SuppressWarnings("unchecked")
414
    public Builder addAllAccountTaxId(List<String> elements) {
415
      if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) {
×
416
        this.accountTaxIds = new ArrayList<String>();
×
417
      }
418
      ((List<String>) this.accountTaxIds).addAll(elements);
×
419
      return this;
×
420
    }
421

422
    /**
423
     * The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
424
     */
425
    public Builder setAccountTaxIds(EmptyParam accountTaxIds) {
426
      this.accountTaxIds = accountTaxIds;
×
427
      return this;
×
428
    }
429

430
    /**
431
     * The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
432
     */
433
    public Builder setAccountTaxIds(List<String> accountTaxIds) {
434
      this.accountTaxIds = accountTaxIds;
×
435
      return this;
×
436
    }
437

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

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

466
    /**
467
     * List of expected payments and corresponding due dates. Valid only for invoices where {@code
468
     * collection_method=send_invoice}.
469
     */
470
    public Builder setAmountsDue(EmptyParam amountsDue) {
471
      this.amountsDue = amountsDue;
×
472
      return this;
×
473
    }
474

475
    /**
476
     * List of expected payments and corresponding due dates. Valid only for invoices where {@code
477
     * collection_method=send_invoice}.
478
     */
479
    public Builder setAmountsDue(List<InvoiceUpdateParams.AmountsDue> amountsDue) {
480
      this.amountsDue = amountsDue;
×
481
      return this;
×
482
    }
483

484
    /**
485
     * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to
486
     * the application owner's Stripe account. The request must be made with an OAuth key or the
487
     * Stripe-Account header in order to take an application fee. For more information, see the
488
     * application fees <a
489
     * href="https://stripe.com/docs/billing/invoices/connect#collecting-fees">documentation</a>.
490
     */
491
    public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
492
      this.applicationFeeAmount = applicationFeeAmount;
×
493
      return this;
×
494
    }
495

496
    /**
497
     * Controls whether Stripe performs <a
498
     * href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">automatic
499
     * collection</a> of the invoice.
500
     */
501
    public Builder setAutoAdvance(Boolean autoAdvance) {
502
      this.autoAdvance = autoAdvance;
×
503
      return this;
×
504
    }
505

506
    /** Settings for automatic tax lookup for this invoice. */
507
    public Builder setAutomaticTax(InvoiceUpdateParams.AutomaticTax automaticTax) {
508
      this.automaticTax = automaticTax;
×
509
      return this;
×
510
    }
511

512
    /**
513
     * The time when this invoice should be scheduled to finalize. The invoice will be finalized at
514
     * this time if it is still in draft state. To turn off automatic finalization, set {@code
515
     * auto_advance} to false.
516
     */
517
    public Builder setAutomaticallyFinalizesAt(Long automaticallyFinalizesAt) {
NEW
518
      this.automaticallyFinalizesAt = automaticallyFinalizesAt;
×
NEW
519
      return this;
×
520
    }
521

522
    /**
523
     * Either {@code charge_automatically} or {@code send_invoice}. This field can be updated only
524
     * on {@code draft} invoices.
525
     */
526
    public Builder setCollectionMethod(InvoiceUpdateParams.CollectionMethod collectionMethod) {
527
      this.collectionMethod = collectionMethod;
×
528
      return this;
×
529
    }
530

531
    /**
532
     * Add an element to `customFields` list. A list is initialized for the first `add/addAll` call,
533
     * and subsequent calls adds additional elements to the original list. See {@link
534
     * InvoiceUpdateParams#customFields} for the field documentation.
535
     */
536
    @SuppressWarnings("unchecked")
537
    public Builder addCustomField(InvoiceUpdateParams.CustomField element) {
538
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
539
        this.customFields = new ArrayList<InvoiceUpdateParams.CustomField>();
×
540
      }
541
      ((List<InvoiceUpdateParams.CustomField>) this.customFields).add(element);
×
542
      return this;
×
543
    }
544

545
    /**
546
     * Add all elements to `customFields` list. A list is initialized for the first `add/addAll`
547
     * call, and subsequent calls adds additional elements to the original list. See {@link
548
     * InvoiceUpdateParams#customFields} for the field documentation.
549
     */
550
    @SuppressWarnings("unchecked")
551
    public Builder addAllCustomField(List<InvoiceUpdateParams.CustomField> elements) {
552
      if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
553
        this.customFields = new ArrayList<InvoiceUpdateParams.CustomField>();
×
554
      }
555
      ((List<InvoiceUpdateParams.CustomField>) this.customFields).addAll(elements);
×
556
      return this;
×
557
    }
558

559
    /**
560
     * A list of up to 4 custom fields to be displayed on the invoice. If a value for {@code
561
     * custom_fields} is specified, the list specified will replace the existing custom field list
562
     * on this invoice. Pass an empty string to remove previously-defined fields.
563
     */
564
    public Builder setCustomFields(EmptyParam customFields) {
565
      this.customFields = customFields;
1✔
566
      return this;
1✔
567
    }
568

569
    /**
570
     * A list of up to 4 custom fields to be displayed on the invoice. If a value for {@code
571
     * custom_fields} is specified, the list specified will replace the existing custom field list
572
     * on this invoice. Pass an empty string to remove previously-defined fields.
573
     */
574
    public Builder setCustomFields(List<InvoiceUpdateParams.CustomField> customFields) {
575
      this.customFields = customFields;
1✔
576
      return this;
1✔
577
    }
578

579
    /**
580
     * The number of days from which the invoice is created until it is due. Only valid for invoices
581
     * where {@code collection_method=send_invoice}. This field can only be updated on {@code draft}
582
     * invoices.
583
     */
584
    public Builder setDaysUntilDue(Long daysUntilDue) {
585
      this.daysUntilDue = daysUntilDue;
×
586
      return this;
×
587
    }
588

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

603
    /**
604
     * Add all elements to `defaultMargins` list. A list is initialized for the first `add/addAll`
605
     * call, and subsequent calls adds additional elements to the original list. See {@link
606
     * InvoiceUpdateParams#defaultMargins} for the field documentation.
607
     */
608
    @SuppressWarnings("unchecked")
609
    public Builder addAllDefaultMargin(List<String> elements) {
610
      if (this.defaultMargins == null || this.defaultMargins instanceof EmptyParam) {
×
611
        this.defaultMargins = new ArrayList<String>();
×
612
      }
613
      ((List<String>) this.defaultMargins).addAll(elements);
×
614
      return this;
×
615
    }
616

617
    /**
618
     * The ids of the margins to apply to the invoice. Can be overridden by line item {@code
619
     * margins}.
620
     */
621
    public Builder setDefaultMargins(EmptyParam defaultMargins) {
622
      this.defaultMargins = defaultMargins;
×
623
      return this;
×
624
    }
625

626
    /**
627
     * The ids of the margins to apply to the invoice. Can be overridden by line item {@code
628
     * margins}.
629
     */
630
    public Builder setDefaultMargins(List<String> defaultMargins) {
631
      this.defaultMargins = defaultMargins;
×
632
      return this;
×
633
    }
634

635
    /**
636
     * ID of the default payment method for the invoice. It must belong to the customer associated
637
     * with the invoice. If not set, defaults to the subscription's default payment method, if any,
638
     * or to the default payment method in the customer's invoice settings.
639
     */
640
    public Builder setDefaultPaymentMethod(String defaultPaymentMethod) {
641
      this.defaultPaymentMethod = defaultPaymentMethod;
×
642
      return this;
×
643
    }
644

645
    /**
646
     * ID of the default payment method for the invoice. It must belong to the customer associated
647
     * with the invoice. If not set, defaults to the subscription's default payment method, if any,
648
     * or to the default payment method in the customer's invoice settings.
649
     */
650
    public Builder setDefaultPaymentMethod(EmptyParam defaultPaymentMethod) {
651
      this.defaultPaymentMethod = defaultPaymentMethod;
1✔
652
      return this;
1✔
653
    }
654

655
    /**
656
     * ID of the default payment source for the invoice. It must belong to the customer associated
657
     * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
658
     * default source, if any, or to the customer's default source.
659
     */
660
    public Builder setDefaultSource(String defaultSource) {
661
      this.defaultSource = defaultSource;
×
662
      return this;
×
663
    }
664

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

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

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

703
    /**
704
     * The tax rates that will apply to any line item that does not have {@code tax_rates} set. Pass
705
     * an empty string to remove previously-defined tax rates.
706
     */
707
    public Builder setDefaultTaxRates(EmptyParam defaultTaxRates) {
708
      this.defaultTaxRates = defaultTaxRates;
×
709
      return this;
×
710
    }
711

712
    /**
713
     * The tax rates that will apply to any line item that does not have {@code tax_rates} set. Pass
714
     * an empty string to remove previously-defined tax rates.
715
     */
716
    public Builder setDefaultTaxRates(List<String> defaultTaxRates) {
717
      this.defaultTaxRates = defaultTaxRates;
×
718
      return this;
×
719
    }
720

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

730
    /**
731
     * An arbitrary string attached to the object. Often useful for displaying to users. Referenced
732
     * as 'memo' in the Dashboard.
733
     */
734
    public Builder setDescription(EmptyParam description) {
735
      this.description = description;
×
736
      return this;
×
737
    }
738

739
    /**
740
     * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call,
741
     * and subsequent calls adds additional elements to the original list. See {@link
742
     * InvoiceUpdateParams#discounts} for the field documentation.
743
     */
744
    @SuppressWarnings("unchecked")
745
    public Builder addDiscount(InvoiceUpdateParams.Discount element) {
746
      if (this.discounts == null || this.discounts instanceof EmptyParam) {
×
747
        this.discounts = new ArrayList<InvoiceUpdateParams.Discount>();
×
748
      }
749
      ((List<InvoiceUpdateParams.Discount>) this.discounts).add(element);
×
750
      return this;
×
751
    }
752

753
    /**
754
     * Add all elements to `discounts` list. A list is initialized for the first `add/addAll` call,
755
     * and subsequent calls adds additional elements to the original list. See {@link
756
     * InvoiceUpdateParams#discounts} for the field documentation.
757
     */
758
    @SuppressWarnings("unchecked")
759
    public Builder addAllDiscount(List<InvoiceUpdateParams.Discount> elements) {
760
      if (this.discounts == null || this.discounts instanceof EmptyParam) {
×
761
        this.discounts = new ArrayList<InvoiceUpdateParams.Discount>();
×
762
      }
763
      ((List<InvoiceUpdateParams.Discount>) this.discounts).addAll(elements);
×
764
      return this;
×
765
    }
766

767
    /**
768
     * The discounts that will apply to the invoice. Pass an empty string to remove
769
     * previously-defined discounts.
770
     */
771
    public Builder setDiscounts(EmptyParam discounts) {
772
      this.discounts = discounts;
×
773
      return this;
×
774
    }
775

776
    /**
777
     * The discounts that will apply to the invoice. Pass an empty string to remove
778
     * previously-defined discounts.
779
     */
780
    public Builder setDiscounts(List<InvoiceUpdateParams.Discount> discounts) {
781
      this.discounts = discounts;
×
782
      return this;
×
783
    }
784

785
    /**
786
     * The date on which payment for this invoice is due. Only valid for invoices where {@code
787
     * collection_method=send_invoice}. This field can only be updated on {@code draft} invoices.
788
     */
789
    public Builder setDueDate(Long dueDate) {
790
      this.dueDate = dueDate;
×
791
      return this;
×
792
    }
793

794
    /**
795
     * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten.
796
     * When defined, this value replaces the system-generated 'Date of issue' printed on the invoice
797
     * PDF and receipt.
798
     */
799
    public Builder setEffectiveAt(Long effectiveAt) {
800
      this.effectiveAt = effectiveAt;
×
801
      return this;
×
802
    }
803

804
    /**
805
     * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten.
806
     * When defined, this value replaces the system-generated 'Date of issue' printed on the invoice
807
     * PDF and receipt.
808
     */
809
    public Builder setEffectiveAt(EmptyParam effectiveAt) {
810
      this.effectiveAt = effectiveAt;
×
811
      return this;
×
812
    }
813

814
    /**
815
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
816
     * subsequent calls adds additional elements to the original list. See {@link
817
     * InvoiceUpdateParams#expand} for the field documentation.
818
     */
819
    public Builder addExpand(String element) {
820
      if (this.expand == null) {
×
821
        this.expand = new ArrayList<>();
×
822
      }
823
      this.expand.add(element);
×
824
      return this;
×
825
    }
826

827
    /**
828
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
829
     * subsequent calls adds additional elements to the original list. See {@link
830
     * InvoiceUpdateParams#expand} for the field documentation.
831
     */
832
    public Builder addAllExpand(List<String> elements) {
833
      if (this.expand == null) {
×
834
        this.expand = new ArrayList<>();
×
835
      }
836
      this.expand.addAll(elements);
×
837
      return this;
×
838
    }
839

840
    /**
841
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
842
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
843
     * InvoiceUpdateParams#extraParams} for the field documentation.
844
     */
845
    public Builder putExtraParam(String key, Object value) {
846
      if (this.extraParams == null) {
1✔
847
        this.extraParams = new HashMap<>();
1✔
848
      }
849
      this.extraParams.put(key, value);
1✔
850
      return this;
1✔
851
    }
852

853
    /**
854
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
855
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
856
     * See {@link InvoiceUpdateParams#extraParams} for the field documentation.
857
     */
858
    public Builder putAllExtraParam(Map<String, Object> map) {
859
      if (this.extraParams == null) {
×
860
        this.extraParams = new HashMap<>();
×
861
      }
862
      this.extraParams.putAll(map);
×
863
      return this;
×
864
    }
865

866
    /** Footer to be displayed on the invoice. */
867
    public Builder setFooter(String footer) {
868
      this.footer = footer;
×
869
      return this;
×
870
    }
871

872
    /** Footer to be displayed on the invoice. */
873
    public Builder setFooter(EmptyParam footer) {
874
      this.footer = footer;
×
875
      return this;
×
876
    }
877

878
    /**
879
     * The connected account that issues the invoice. The invoice is presented with the branding and
880
     * support information of the specified account.
881
     */
882
    public Builder setIssuer(InvoiceUpdateParams.Issuer issuer) {
883
      this.issuer = issuer;
×
884
      return this;
×
885
    }
886

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

901
    /**
902
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
903
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
904
     * See {@link InvoiceUpdateParams#metadata} for the field documentation.
905
     */
906
    @SuppressWarnings("unchecked")
907
    public Builder putAllMetadata(Map<String, String> map) {
908
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
909
        this.metadata = new HashMap<String, String>();
×
910
      }
911
      ((Map<String, String>) this.metadata).putAll(map);
×
912
      return this;
×
913
    }
914

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

926
    /**
927
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
928
     * to an object. This can be useful for storing additional information about the object in a
929
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
930
     * can be unset by posting an empty value to {@code metadata}.
931
     */
932
    public Builder setMetadata(Map<String, String> metadata) {
933
      this.metadata = metadata;
×
934
      return this;
×
935
    }
936

937
    /**
938
     * Set the number for this invoice. If no number is present then a number will be assigned
939
     * automatically when the invoice is finalized. In many markets, regulations require invoices to
940
     * be unique, sequential and / or gapless. You are responsible for ensuring this is true across
941
     * all your different invoicing systems in the event that you edit the invoice number using our
942
     * API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe
943
     * handles this aspect of compliance for you automatically.
944
     */
945
    public Builder setNumber(String number) {
946
      this.number = number;
×
947
      return this;
×
948
    }
949

950
    /**
951
     * Set the number for this invoice. If no number is present then a number will be assigned
952
     * automatically when the invoice is finalized. In many markets, regulations require invoices to
953
     * be unique, sequential and / or gapless. You are responsible for ensuring this is true across
954
     * all your different invoicing systems in the event that you edit the invoice number using our
955
     * API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe
956
     * handles this aspect of compliance for you automatically.
957
     */
958
    public Builder setNumber(EmptyParam number) {
959
      this.number = number;
×
960
      return this;
×
961
    }
962

963
    /**
964
     * The account (if any) for which the funds of the invoice payment are intended. If set, the
965
     * invoice will be presented with the branding and support information of the specified account.
966
     * See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a>
967
     * documentation for details.
968
     */
969
    public Builder setOnBehalfOf(String onBehalfOf) {
970
      this.onBehalfOf = onBehalfOf;
×
971
      return this;
×
972
    }
973

974
    /**
975
     * The account (if any) for which the funds of the invoice payment are intended. If set, the
976
     * invoice will be presented with the branding and support information of the specified account.
977
     * See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a>
978
     * documentation for details.
979
     */
980
    public Builder setOnBehalfOf(EmptyParam onBehalfOf) {
981
      this.onBehalfOf = onBehalfOf;
×
982
      return this;
×
983
    }
984

985
    /**
986
     * Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
987
     */
988
    public Builder setPaymentSettings(InvoiceUpdateParams.PaymentSettings paymentSettings) {
989
      this.paymentSettings = paymentSettings;
×
990
      return this;
×
991
    }
992

993
    /**
994
     * The rendering-related settings that control how the invoice is displayed on customer-facing
995
     * surfaces such as PDF and Hosted Invoice Page.
996
     */
997
    public Builder setRendering(InvoiceUpdateParams.Rendering rendering) {
998
      this.rendering = rendering;
×
999
      return this;
×
1000
    }
1001

1002
    /** Settings for the cost of shipping for this invoice. */
1003
    public Builder setShippingCost(InvoiceUpdateParams.ShippingCost shippingCost) {
1004
      this.shippingCost = shippingCost;
×
1005
      return this;
×
1006
    }
1007

1008
    /** Settings for the cost of shipping for this invoice. */
1009
    public Builder setShippingCost(EmptyParam shippingCost) {
1010
      this.shippingCost = shippingCost;
×
1011
      return this;
×
1012
    }
1013

1014
    /**
1015
     * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
1016
     * if it is set, otherwise the PDF will render the shipping address from the customer.
1017
     */
1018
    public Builder setShippingDetails(InvoiceUpdateParams.ShippingDetails shippingDetails) {
1019
      this.shippingDetails = shippingDetails;
×
1020
      return this;
×
1021
    }
1022

1023
    /**
1024
     * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
1025
     * if it is set, otherwise the PDF will render the shipping address from the customer.
1026
     */
1027
    public Builder setShippingDetails(EmptyParam shippingDetails) {
1028
      this.shippingDetails = shippingDetails;
×
1029
      return this;
×
1030
    }
1031

1032
    /**
1033
     * Extra information about a charge for the customer's credit card statement. It must contain at
1034
     * least one letter. If not specified and this invoice is part of a subscription, the default
1035
     * {@code statement_descriptor} will be set to the first subscription item's product's {@code
1036
     * statement_descriptor}.
1037
     */
1038
    public Builder setStatementDescriptor(String statementDescriptor) {
1039
      this.statementDescriptor = statementDescriptor;
×
1040
      return this;
×
1041
    }
1042

1043
    /**
1044
     * Extra information about a charge for the customer's credit card statement. It must contain at
1045
     * least one letter. If not specified and this invoice is part of a subscription, the default
1046
     * {@code statement_descriptor} will be set to the first subscription item's product's {@code
1047
     * statement_descriptor}.
1048
     */
1049
    public Builder setStatementDescriptor(EmptyParam statementDescriptor) {
1050
      this.statementDescriptor = statementDescriptor;
×
1051
      return this;
×
1052
    }
1053

1054
    /**
1055
     * If specified, the funds from the invoice will be transferred to the destination and the ID of
1056
     * the resulting transfer will be found on the invoice's charge. This will be unset if you POST
1057
     * an empty value.
1058
     */
1059
    public Builder setTransferData(InvoiceUpdateParams.TransferData transferData) {
1060
      this.transferData = transferData;
×
1061
      return this;
×
1062
    }
1063

1064
    /**
1065
     * If specified, the funds from the invoice will be transferred to the destination and the ID of
1066
     * the resulting transfer will be found on the invoice's charge. This will be unset if you POST
1067
     * an empty value.
1068
     */
1069
    public Builder setTransferData(EmptyParam transferData) {
1070
      this.transferData = transferData;
×
1071
      return this;
×
1072
    }
1073
  }
1074

1075
  @Getter
1076
  public static class AmountsDue {
1077
    /** <strong>Required.</strong> The amount in cents (or local equivalent). */
1078
    @SerializedName("amount")
1079
    Long amount;
1080

1081
    /** Number of days from when invoice is finalized until the payment is due. */
1082
    @SerializedName("days_until_due")
1083
    Long daysUntilDue;
1084

1085
    /**
1086
     * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1087
     * displaying to users.
1088
     */
1089
    @SerializedName("description")
1090
    Object description;
1091

1092
    /** Date on which a payment plan’s payment is due. */
1093
    @SerializedName("due_date")
1094
    Long dueDate;
1095

1096
    /**
1097
     * Map of extra parameters for custom features not available in this client library. The content
1098
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1099
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1100
     * param object. Effectively, this map is flattened to its parent instance.
1101
     */
1102
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1103
    Map<String, Object> extraParams;
1104

1105
    private AmountsDue(
1106
        Long amount,
1107
        Long daysUntilDue,
1108
        Object description,
1109
        Long dueDate,
1110
        Map<String, Object> extraParams) {
×
1111
      this.amount = amount;
×
1112
      this.daysUntilDue = daysUntilDue;
×
1113
      this.description = description;
×
1114
      this.dueDate = dueDate;
×
1115
      this.extraParams = extraParams;
×
1116
    }
×
1117

1118
    public static Builder builder() {
1119
      return new Builder();
×
1120
    }
1121

1122
    public static class Builder {
×
1123
      private Long amount;
1124

1125
      private Long daysUntilDue;
1126

1127
      private Object description;
1128

1129
      private Long dueDate;
1130

1131
      private Map<String, Object> extraParams;
1132

1133
      /** Finalize and obtain parameter instance from this builder. */
1134
      public InvoiceUpdateParams.AmountsDue build() {
1135
        return new InvoiceUpdateParams.AmountsDue(
×
1136
            this.amount, this.daysUntilDue, this.description, this.dueDate, this.extraParams);
1137
      }
1138

1139
      /** <strong>Required.</strong> The amount in cents (or local equivalent). */
1140
      public Builder setAmount(Long amount) {
1141
        this.amount = amount;
×
1142
        return this;
×
1143
      }
1144

1145
      /** Number of days from when invoice is finalized until the payment is due. */
1146
      public Builder setDaysUntilDue(Long daysUntilDue) {
1147
        this.daysUntilDue = daysUntilDue;
×
1148
        return this;
×
1149
      }
1150

1151
      /**
1152
       * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1153
       * displaying to users.
1154
       */
1155
      public Builder setDescription(String description) {
1156
        this.description = description;
×
1157
        return this;
×
1158
      }
1159

1160
      /**
1161
       * <strong>Required.</strong> An arbitrary string attached to the object. Often useful for
1162
       * displaying to users.
1163
       */
1164
      public Builder setDescription(EmptyParam description) {
1165
        this.description = description;
×
1166
        return this;
×
1167
      }
1168

1169
      /** Date on which a payment plan’s payment is due. */
1170
      public Builder setDueDate(Long dueDate) {
1171
        this.dueDate = dueDate;
×
1172
        return this;
×
1173
      }
1174

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

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

1203
  @Getter
1204
  public static class AutomaticTax {
1205
    /**
1206
     * <strong>Required.</strong> Whether Stripe automatically computes tax on this invoice. Note
1207
     * that incompatible invoice items (invoice items with manually specified <a
1208
     * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1209
     * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1210
     */
1211
    @SerializedName("enabled")
1212
    Boolean enabled;
1213

1214
    /**
1215
     * Map of extra parameters for custom features not available in this client library. The content
1216
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1217
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1218
     * param object. Effectively, this map is flattened to its parent instance.
1219
     */
1220
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1221
    Map<String, Object> extraParams;
1222

1223
    /**
1224
     * The account that's liable for tax. If set, the business address and tax registrations
1225
     * required to perform the tax calculation are loaded from this account. The tax transaction is
1226
     * returned in the report of the connected account.
1227
     */
1228
    @SerializedName("liability")
1229
    Liability liability;
1230

1231
    private AutomaticTax(Boolean enabled, Map<String, Object> extraParams, Liability liability) {
×
1232
      this.enabled = enabled;
×
1233
      this.extraParams = extraParams;
×
1234
      this.liability = liability;
×
1235
    }
×
1236

1237
    public static Builder builder() {
1238
      return new Builder();
×
1239
    }
1240

1241
    public static class Builder {
×
1242
      private Boolean enabled;
1243

1244
      private Map<String, Object> extraParams;
1245

1246
      private Liability liability;
1247

1248
      /** Finalize and obtain parameter instance from this builder. */
1249
      public InvoiceUpdateParams.AutomaticTax build() {
1250
        return new InvoiceUpdateParams.AutomaticTax(this.enabled, this.extraParams, this.liability);
×
1251
      }
1252

1253
      /**
1254
       * <strong>Required.</strong> Whether Stripe automatically computes tax on this invoice. Note
1255
       * that incompatible invoice items (invoice items with manually specified <a
1256
       * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1257
       * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1258
       */
1259
      public Builder setEnabled(Boolean enabled) {
1260
        this.enabled = enabled;
×
1261
        return this;
×
1262
      }
1263

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

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

1290
      /**
1291
       * The account that's liable for tax. If set, the business address and tax registrations
1292
       * required to perform the tax calculation are loaded from this account. The tax transaction
1293
       * is returned in the report of the connected account.
1294
       */
1295
      public Builder setLiability(InvoiceUpdateParams.AutomaticTax.Liability liability) {
1296
        this.liability = liability;
×
1297
        return this;
×
1298
      }
1299
    }
1300

1301
    @Getter
1302
    public static class Liability {
1303
      /** The connected account being referenced when {@code type} is {@code account}. */
1304
      @SerializedName("account")
1305
      Object account;
1306

1307
      /**
1308
       * Map of extra parameters for custom features not available in this client library. The
1309
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1310
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1311
       * name in this param object. Effectively, this map is flattened to its parent instance.
1312
       */
1313
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1314
      Map<String, Object> extraParams;
1315

1316
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1317
      @SerializedName("type")
1318
      Type type;
1319

1320
      private Liability(Object account, Map<String, Object> extraParams, Type type) {
×
1321
        this.account = account;
×
1322
        this.extraParams = extraParams;
×
1323
        this.type = type;
×
1324
      }
×
1325

1326
      public static Builder builder() {
1327
        return new Builder();
×
1328
      }
1329

1330
      public static class Builder {
×
1331
        private Object account;
1332

1333
        private Map<String, Object> extraParams;
1334

1335
        private Type type;
1336

1337
        /** Finalize and obtain parameter instance from this builder. */
1338
        public InvoiceUpdateParams.AutomaticTax.Liability build() {
1339
          return new InvoiceUpdateParams.AutomaticTax.Liability(
×
1340
              this.account, this.extraParams, this.type);
1341
        }
1342

1343
        /** The connected account being referenced when {@code type} is {@code account}. */
1344
        public Builder setAccount(String account) {
1345
          this.account = account;
×
1346
          return this;
×
1347
        }
1348

1349
        /** The connected account being referenced when {@code type} is {@code account}. */
1350
        public Builder setAccount(EmptyParam account) {
1351
          this.account = account;
×
1352
          return this;
×
1353
        }
1354

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

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

1383
        /** <strong>Required.</strong> Type of the account referenced in the request. */
1384
        public Builder setType(InvoiceUpdateParams.AutomaticTax.Liability.Type type) {
1385
          this.type = type;
×
1386
          return this;
×
1387
        }
1388
      }
1389

1390
      public enum Type implements ApiRequestParams.EnumParam {
×
1391
        @SerializedName("account")
×
1392
        ACCOUNT("account"),
1393

1394
        @SerializedName("self")
×
1395
        SELF("self");
1396

1397
        @Getter(onMethod_ = {@Override})
1398
        private final String value;
1399

1400
        Type(String value) {
×
1401
          this.value = value;
×
1402
        }
×
1403
      }
1404
    }
1405
  }
1406

1407
  @Getter
1408
  public static class CustomField {
1409
    /**
1410
     * Map of extra parameters for custom features not available in this client library. The content
1411
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1412
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1413
     * param object. Effectively, this map is flattened to its parent instance.
1414
     */
1415
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1416
    Map<String, Object> extraParams;
1417

1418
    /** <strong>Required.</strong> The name of the custom field. This may be up to 40 characters. */
1419
    @SerializedName("name")
1420
    Object name;
1421

1422
    /**
1423
     * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1424
     */
1425
    @SerializedName("value")
1426
    Object value;
1427

1428
    private CustomField(Map<String, Object> extraParams, Object name, Object value) {
1✔
1429
      this.extraParams = extraParams;
1✔
1430
      this.name = name;
1✔
1431
      this.value = value;
1✔
1432
    }
1✔
1433

1434
    public static Builder builder() {
1435
      return new Builder();
1✔
1436
    }
1437

1438
    public static class Builder {
1✔
1439
      private Map<String, Object> extraParams;
1440

1441
      private Object name;
1442

1443
      private Object value;
1444

1445
      /** Finalize and obtain parameter instance from this builder. */
1446
      public InvoiceUpdateParams.CustomField build() {
1447
        return new InvoiceUpdateParams.CustomField(this.extraParams, this.name, this.value);
1✔
1448
      }
1449

1450
      /**
1451
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1452
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1453
       * InvoiceUpdateParams.CustomField#extraParams} for the field documentation.
1454
       */
1455
      public Builder putExtraParam(String key, Object value) {
1456
        if (this.extraParams == null) {
×
1457
          this.extraParams = new HashMap<>();
×
1458
        }
1459
        this.extraParams.put(key, value);
×
1460
        return this;
×
1461
      }
1462

1463
      /**
1464
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1465
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1466
       * See {@link InvoiceUpdateParams.CustomField#extraParams} for the field documentation.
1467
       */
1468
      public Builder putAllExtraParam(Map<String, Object> map) {
1469
        if (this.extraParams == null) {
×
1470
          this.extraParams = new HashMap<>();
×
1471
        }
1472
        this.extraParams.putAll(map);
×
1473
        return this;
×
1474
      }
1475

1476
      /**
1477
       * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1478
       */
1479
      public Builder setName(String name) {
1480
        this.name = name;
1✔
1481
        return this;
1✔
1482
      }
1483

1484
      /**
1485
       * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1486
       */
1487
      public Builder setName(EmptyParam name) {
1488
        this.name = name;
×
1489
        return this;
×
1490
      }
1491

1492
      /**
1493
       * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1494
       */
1495
      public Builder setValue(String value) {
1496
        this.value = value;
1✔
1497
        return this;
1✔
1498
      }
1499

1500
      /**
1501
       * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1502
       */
1503
      public Builder setValue(EmptyParam value) {
1504
        this.value = value;
×
1505
        return this;
×
1506
      }
1507
    }
1508
  }
1509

1510
  @Getter
1511
  public static class Discount {
1512
    /** ID of the coupon to create a new discount for. */
1513
    @SerializedName("coupon")
1514
    Object coupon;
1515

1516
    /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1517
    @SerializedName("discount")
1518
    Object discount;
1519

1520
    /** Details to determine how long the discount should be applied for. */
1521
    @SerializedName("discount_end")
1522
    DiscountEnd discountEnd;
1523

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

1533
    /** ID of the promotion code to create a new discount for. */
1534
    @SerializedName("promotion_code")
1535
    Object promotionCode;
1536

1537
    private Discount(
1538
        Object coupon,
1539
        Object discount,
1540
        DiscountEnd discountEnd,
1541
        Map<String, Object> extraParams,
1542
        Object promotionCode) {
×
1543
      this.coupon = coupon;
×
1544
      this.discount = discount;
×
1545
      this.discountEnd = discountEnd;
×
1546
      this.extraParams = extraParams;
×
1547
      this.promotionCode = promotionCode;
×
1548
    }
×
1549

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

1554
    public static class Builder {
×
1555
      private Object coupon;
1556

1557
      private Object discount;
1558

1559
      private DiscountEnd discountEnd;
1560

1561
      private Map<String, Object> extraParams;
1562

1563
      private Object promotionCode;
1564

1565
      /** Finalize and obtain parameter instance from this builder. */
1566
      public InvoiceUpdateParams.Discount build() {
1567
        return new InvoiceUpdateParams.Discount(
×
1568
            this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode);
1569
      }
1570

1571
      /** ID of the coupon to create a new discount for. */
1572
      public Builder setCoupon(String coupon) {
1573
        this.coupon = coupon;
×
1574
        return this;
×
1575
      }
1576

1577
      /** ID of the coupon to create a new discount for. */
1578
      public Builder setCoupon(EmptyParam coupon) {
1579
        this.coupon = coupon;
×
1580
        return this;
×
1581
      }
1582

1583
      /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1584
      public Builder setDiscount(String discount) {
1585
        this.discount = discount;
×
1586
        return this;
×
1587
      }
1588

1589
      /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
1590
      public Builder setDiscount(EmptyParam discount) {
1591
        this.discount = discount;
×
1592
        return this;
×
1593
      }
1594

1595
      /** Details to determine how long the discount should be applied for. */
1596
      public Builder setDiscountEnd(InvoiceUpdateParams.Discount.DiscountEnd discountEnd) {
1597
        this.discountEnd = discountEnd;
×
1598
        return this;
×
1599
      }
1600

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

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

1627
      /** ID of the promotion code to create a new discount for. */
1628
      public Builder setPromotionCode(String promotionCode) {
1629
        this.promotionCode = promotionCode;
×
1630
        return this;
×
1631
      }
1632

1633
      /** ID of the promotion code to create a new discount for. */
1634
      public Builder setPromotionCode(EmptyParam promotionCode) {
1635
        this.promotionCode = promotionCode;
×
1636
        return this;
×
1637
      }
1638
    }
1639

1640
    @Getter
1641
    public static class DiscountEnd {
1642
      /** Time span for the redeemed discount. */
1643
      @SerializedName("duration")
1644
      Duration duration;
1645

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

1655
      /** A precise Unix timestamp for the discount to end. Must be in the future. */
1656
      @SerializedName("timestamp")
1657
      Long timestamp;
1658

1659
      /**
1660
       * <strong>Required.</strong> The type of calculation made to determine when the discount
1661
       * ends.
1662
       */
1663
      @SerializedName("type")
1664
      Type type;
1665

1666
      private DiscountEnd(
1667
          Duration duration, Map<String, Object> extraParams, Long timestamp, Type type) {
×
1668
        this.duration = duration;
×
1669
        this.extraParams = extraParams;
×
1670
        this.timestamp = timestamp;
×
1671
        this.type = type;
×
1672
      }
×
1673

1674
      public static Builder builder() {
1675
        return new Builder();
×
1676
      }
1677

1678
      public static class Builder {
×
1679
        private Duration duration;
1680

1681
        private Map<String, Object> extraParams;
1682

1683
        private Long timestamp;
1684

1685
        private Type type;
1686

1687
        /** Finalize and obtain parameter instance from this builder. */
1688
        public InvoiceUpdateParams.Discount.DiscountEnd build() {
1689
          return new InvoiceUpdateParams.Discount.DiscountEnd(
×
1690
              this.duration, this.extraParams, this.timestamp, this.type);
1691
        }
1692

1693
        /** Time span for the redeemed discount. */
1694
        public Builder setDuration(InvoiceUpdateParams.Discount.DiscountEnd.Duration duration) {
1695
          this.duration = duration;
×
1696
          return this;
×
1697
        }
1698

1699
        /**
1700
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1701
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1702
         * map. See {@link InvoiceUpdateParams.Discount.DiscountEnd#extraParams} for the field
1703
         * documentation.
1704
         */
1705
        public Builder putExtraParam(String key, Object value) {
1706
          if (this.extraParams == null) {
×
1707
            this.extraParams = new HashMap<>();
×
1708
          }
1709
          this.extraParams.put(key, value);
×
1710
          return this;
×
1711
        }
1712

1713
        /**
1714
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1715
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1716
         * map. See {@link InvoiceUpdateParams.Discount.DiscountEnd#extraParams} for the field
1717
         * documentation.
1718
         */
1719
        public Builder putAllExtraParam(Map<String, Object> map) {
1720
          if (this.extraParams == null) {
×
1721
            this.extraParams = new HashMap<>();
×
1722
          }
1723
          this.extraParams.putAll(map);
×
1724
          return this;
×
1725
        }
1726

1727
        /** A precise Unix timestamp for the discount to end. Must be in the future. */
1728
        public Builder setTimestamp(Long timestamp) {
1729
          this.timestamp = timestamp;
×
1730
          return this;
×
1731
        }
1732

1733
        /**
1734
         * <strong>Required.</strong> The type of calculation made to determine when the discount
1735
         * ends.
1736
         */
1737
        public Builder setType(InvoiceUpdateParams.Discount.DiscountEnd.Type type) {
1738
          this.type = type;
×
1739
          return this;
×
1740
        }
1741
      }
1742

1743
      @Getter
1744
      public static class Duration {
1745
        /**
1746
         * Map of extra parameters for custom features not available in this client library. The
1747
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1748
         * Instead, each key/value pair is serialized as if the key is a root-level field
1749
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1750
         * instance.
1751
         */
1752
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1753
        Map<String, Object> extraParams;
1754

1755
        /**
1756
         * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day}, {@code
1757
         * week}, {@code month} or {@code year}.
1758
         */
1759
        @SerializedName("interval")
1760
        Interval interval;
1761

1762
        /**
1763
         * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1764
         * Stripe multiplies this by the interval type to get the overall duration.
1765
         */
1766
        @SerializedName("interval_count")
1767
        Long intervalCount;
1768

1769
        private Duration(Map<String, Object> extraParams, Interval interval, Long intervalCount) {
×
1770
          this.extraParams = extraParams;
×
1771
          this.interval = interval;
×
1772
          this.intervalCount = intervalCount;
×
1773
        }
×
1774

1775
        public static Builder builder() {
1776
          return new Builder();
×
1777
        }
1778

1779
        public static class Builder {
×
1780
          private Map<String, Object> extraParams;
1781

1782
          private Interval interval;
1783

1784
          private Long intervalCount;
1785

1786
          /** Finalize and obtain parameter instance from this builder. */
1787
          public InvoiceUpdateParams.Discount.DiscountEnd.Duration build() {
1788
            return new InvoiceUpdateParams.Discount.DiscountEnd.Duration(
×
1789
                this.extraParams, this.interval, this.intervalCount);
1790
          }
1791

1792
          /**
1793
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1794
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1795
           * map. See {@link InvoiceUpdateParams.Discount.DiscountEnd.Duration#extraParams} for the
1796
           * field documentation.
1797
           */
1798
          public Builder putExtraParam(String key, Object value) {
1799
            if (this.extraParams == null) {
×
1800
              this.extraParams = new HashMap<>();
×
1801
            }
1802
            this.extraParams.put(key, value);
×
1803
            return this;
×
1804
          }
1805

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

1820
          /**
1821
           * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day},
1822
           * {@code week}, {@code month} or {@code year}.
1823
           */
1824
          public Builder setInterval(
1825
              InvoiceUpdateParams.Discount.DiscountEnd.Duration.Interval interval) {
1826
            this.interval = interval;
×
1827
            return this;
×
1828
          }
1829

1830
          /**
1831
           * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1832
           * Stripe multiplies this by the interval type to get the overall duration.
1833
           */
1834
          public Builder setIntervalCount(Long intervalCount) {
1835
            this.intervalCount = intervalCount;
×
1836
            return this;
×
1837
          }
1838
        }
1839

1840
        public enum Interval implements ApiRequestParams.EnumParam {
×
1841
          @SerializedName("day")
×
1842
          DAY("day"),
1843

1844
          @SerializedName("month")
×
1845
          MONTH("month"),
1846

1847
          @SerializedName("week")
×
1848
          WEEK("week"),
1849

1850
          @SerializedName("year")
×
1851
          YEAR("year");
1852

1853
          @Getter(onMethod_ = {@Override})
1854
          private final String value;
1855

1856
          Interval(String value) {
×
1857
            this.value = value;
×
1858
          }
×
1859
        }
1860
      }
1861

1862
      public enum Type implements ApiRequestParams.EnumParam {
×
1863
        @SerializedName("duration")
×
1864
        DURATION("duration"),
1865

1866
        @SerializedName("timestamp")
×
1867
        TIMESTAMP("timestamp");
1868

1869
        @Getter(onMethod_ = {@Override})
1870
        private final String value;
1871

1872
        Type(String value) {
×
1873
          this.value = value;
×
1874
        }
×
1875
      }
1876
    }
1877
  }
1878

1879
  @Getter
1880
  public static class Issuer {
1881
    /** The connected account being referenced when {@code type} is {@code account}. */
1882
    @SerializedName("account")
1883
    Object account;
1884

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

1894
    /** <strong>Required.</strong> Type of the account referenced in the request. */
1895
    @SerializedName("type")
1896
    Type type;
1897

1898
    private Issuer(Object account, Map<String, Object> extraParams, Type type) {
×
1899
      this.account = account;
×
1900
      this.extraParams = extraParams;
×
1901
      this.type = type;
×
1902
    }
×
1903

1904
    public static Builder builder() {
1905
      return new Builder();
×
1906
    }
1907

1908
    public static class Builder {
×
1909
      private Object account;
1910

1911
      private Map<String, Object> extraParams;
1912

1913
      private Type type;
1914

1915
      /** Finalize and obtain parameter instance from this builder. */
1916
      public InvoiceUpdateParams.Issuer build() {
1917
        return new InvoiceUpdateParams.Issuer(this.account, this.extraParams, this.type);
×
1918
      }
1919

1920
      /** The connected account being referenced when {@code type} is {@code account}. */
1921
      public Builder setAccount(String account) {
1922
        this.account = account;
×
1923
        return this;
×
1924
      }
1925

1926
      /** The connected account being referenced when {@code type} is {@code account}. */
1927
      public Builder setAccount(EmptyParam account) {
1928
        this.account = account;
×
1929
        return this;
×
1930
      }
1931

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

1945
      /**
1946
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1947
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1948
       * See {@link InvoiceUpdateParams.Issuer#extraParams} for the field documentation.
1949
       */
1950
      public Builder putAllExtraParam(Map<String, Object> map) {
1951
        if (this.extraParams == null) {
×
1952
          this.extraParams = new HashMap<>();
×
1953
        }
1954
        this.extraParams.putAll(map);
×
1955
        return this;
×
1956
      }
1957

1958
      /** <strong>Required.</strong> Type of the account referenced in the request. */
1959
      public Builder setType(InvoiceUpdateParams.Issuer.Type type) {
1960
        this.type = type;
×
1961
        return this;
×
1962
      }
1963
    }
1964

1965
    public enum Type implements ApiRequestParams.EnumParam {
×
1966
      @SerializedName("account")
×
1967
      ACCOUNT("account"),
1968

1969
      @SerializedName("self")
×
1970
      SELF("self");
1971

1972
      @Getter(onMethod_ = {@Override})
1973
      private final String value;
1974

1975
      Type(String value) {
×
1976
        this.value = value;
×
1977
      }
×
1978
    }
1979
  }
1980

1981
  @Getter
1982
  public static class PaymentSettings {
1983
    /**
1984
     * ID of the mandate to be used for this invoice. It must correspond to the payment method used
1985
     * to pay the invoice, including the invoice's default_payment_method or default_source, if set.
1986
     */
1987
    @SerializedName("default_mandate")
1988
    Object defaultMandate;
1989

1990
    /**
1991
     * Map of extra parameters for custom features not available in this client library. The content
1992
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1993
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1994
     * param object. Effectively, this map is flattened to its parent instance.
1995
     */
1996
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1997
    Map<String, Object> extraParams;
1998

1999
    /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
2000
    @SerializedName("payment_method_options")
2001
    PaymentMethodOptions paymentMethodOptions;
2002

2003
    /**
2004
     * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
2005
     * not set, Stripe attempts to automatically determine the types to use by looking at the
2006
     * invoice’s default payment method, the subscription’s default payment method, the customer’s
2007
     * default payment method, and your <a
2008
     * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
2009
     */
2010
    @SerializedName("payment_method_types")
2011
    Object paymentMethodTypes;
2012

2013
    private PaymentSettings(
2014
        Object defaultMandate,
2015
        Map<String, Object> extraParams,
2016
        PaymentMethodOptions paymentMethodOptions,
2017
        Object paymentMethodTypes) {
×
2018
      this.defaultMandate = defaultMandate;
×
2019
      this.extraParams = extraParams;
×
2020
      this.paymentMethodOptions = paymentMethodOptions;
×
2021
      this.paymentMethodTypes = paymentMethodTypes;
×
2022
    }
×
2023

2024
    public static Builder builder() {
2025
      return new Builder();
×
2026
    }
2027

2028
    public static class Builder {
×
2029
      private Object defaultMandate;
2030

2031
      private Map<String, Object> extraParams;
2032

2033
      private PaymentMethodOptions paymentMethodOptions;
2034

2035
      private Object paymentMethodTypes;
2036

2037
      /** Finalize and obtain parameter instance from this builder. */
2038
      public InvoiceUpdateParams.PaymentSettings build() {
2039
        return new InvoiceUpdateParams.PaymentSettings(
×
2040
            this.defaultMandate,
2041
            this.extraParams,
2042
            this.paymentMethodOptions,
2043
            this.paymentMethodTypes);
2044
      }
2045

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

2056
      /**
2057
       * ID of the mandate to be used for this invoice. It must correspond to the payment method
2058
       * used to pay the invoice, including the invoice's default_payment_method or default_source,
2059
       * if set.
2060
       */
2061
      public Builder setDefaultMandate(EmptyParam defaultMandate) {
2062
        this.defaultMandate = defaultMandate;
×
2063
        return this;
×
2064
      }
2065

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

2079
      /**
2080
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2081
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
2082
       * See {@link InvoiceUpdateParams.PaymentSettings#extraParams} for the field documentation.
2083
       */
2084
      public Builder putAllExtraParam(Map<String, Object> map) {
2085
        if (this.extraParams == null) {
×
2086
          this.extraParams = new HashMap<>();
×
2087
        }
2088
        this.extraParams.putAll(map);
×
2089
        return this;
×
2090
      }
2091

2092
      /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
2093
      public Builder setPaymentMethodOptions(
2094
          InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions paymentMethodOptions) {
2095
        this.paymentMethodOptions = paymentMethodOptions;
×
2096
        return this;
×
2097
      }
2098

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

2116
      /**
2117
       * Add all elements to `paymentMethodTypes` list. A list is initialized for the first
2118
       * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
2119
       * {@link InvoiceUpdateParams.PaymentSettings#paymentMethodTypes} for the field documentation.
2120
       */
2121
      @SuppressWarnings("unchecked")
2122
      public Builder addAllPaymentMethodType(
2123
          List<InvoiceUpdateParams.PaymentSettings.PaymentMethodType> elements) {
2124
        if (this.paymentMethodTypes == null || this.paymentMethodTypes instanceof EmptyParam) {
×
2125
          this.paymentMethodTypes =
×
2126
              new ArrayList<InvoiceUpdateParams.PaymentSettings.PaymentMethodType>();
2127
        }
2128
        ((List<InvoiceUpdateParams.PaymentSettings.PaymentMethodType>) this.paymentMethodTypes)
×
2129
            .addAll(elements);
×
2130
        return this;
×
2131
      }
2132

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

2145
      /**
2146
       * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
2147
       * not set, Stripe attempts to automatically determine the types to use by looking at the
2148
       * invoice’s default payment method, the subscription’s default payment method, the customer’s
2149
       * default payment method, and your <a
2150
       * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
2151
       */
2152
      public Builder setPaymentMethodTypes(
2153
          List<InvoiceUpdateParams.PaymentSettings.PaymentMethodType> paymentMethodTypes) {
2154
        this.paymentMethodTypes = paymentMethodTypes;
×
2155
        return this;
×
2156
      }
2157
    }
2158

2159
    @Getter
2160
    public static class PaymentMethodOptions {
2161
      /**
2162
       * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2163
       * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2164
       */
2165
      @SerializedName("acss_debit")
2166
      Object acssDebit;
2167

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

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

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

2189
      /**
2190
       * Map of extra parameters for custom features not available in this client library. The
2191
       * content in this map is not serialized under this field's {@code @SerializedName} value.
2192
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
2193
       * name in this param object. Effectively, this map is flattened to its parent instance.
2194
       */
2195
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2196
      Map<String, Object> extraParams;
2197

2198
      /**
2199
       * If paying by {@code id_bank_transfer}, this sub-hash contains details about the Indonesia
2200
       * bank transfer payment method options to pass to the invoice’s PaymentIntent.
2201
       */
2202
      @SerializedName("id_bank_transfer")
2203
      Object idBankTransfer;
2204

2205
      /**
2206
       * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2207
       * method options to pass to the invoice’s PaymentIntent.
2208
       */
2209
      @SerializedName("konbini")
2210
      Object konbini;
2211

2212
      /**
2213
       * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct Debit
2214
       * payment method options to pass to the invoice’s PaymentIntent.
2215
       */
2216
      @SerializedName("sepa_debit")
2217
      Object sepaDebit;
2218

2219
      /**
2220
       * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2221
       * debit payment method options to pass to the invoice’s PaymentIntent.
2222
       */
2223
      @SerializedName("us_bank_account")
2224
      Object usBankAccount;
2225

2226
      private PaymentMethodOptions(
2227
          Object acssDebit,
2228
          Object bancontact,
2229
          Object card,
2230
          Object customerBalance,
2231
          Map<String, Object> extraParams,
2232
          Object idBankTransfer,
2233
          Object konbini,
2234
          Object sepaDebit,
2235
          Object usBankAccount) {
×
2236
        this.acssDebit = acssDebit;
×
2237
        this.bancontact = bancontact;
×
2238
        this.card = card;
×
2239
        this.customerBalance = customerBalance;
×
2240
        this.extraParams = extraParams;
×
NEW
2241
        this.idBankTransfer = idBankTransfer;
×
2242
        this.konbini = konbini;
×
2243
        this.sepaDebit = sepaDebit;
×
2244
        this.usBankAccount = usBankAccount;
×
2245
      }
×
2246

2247
      public static Builder builder() {
2248
        return new Builder();
×
2249
      }
2250

2251
      public static class Builder {
×
2252
        private Object acssDebit;
2253

2254
        private Object bancontact;
2255

2256
        private Object card;
2257

2258
        private Object customerBalance;
2259

2260
        private Map<String, Object> extraParams;
2261

2262
        private Object idBankTransfer;
2263

2264
        private Object konbini;
2265

2266
        private Object sepaDebit;
2267

2268
        private Object usBankAccount;
2269

2270
        /** Finalize and obtain parameter instance from this builder. */
2271
        public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions build() {
2272
          return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions(
×
2273
              this.acssDebit,
2274
              this.bancontact,
2275
              this.card,
2276
              this.customerBalance,
2277
              this.extraParams,
2278
              this.idBankTransfer,
2279
              this.konbini,
2280
              this.sepaDebit,
2281
              this.usBankAccount);
2282
        }
2283

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

2294
        /**
2295
         * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
2296
         * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
2297
         */
2298
        public Builder setAcssDebit(EmptyParam acssDebit) {
2299
          this.acssDebit = acssDebit;
×
2300
          return this;
×
2301
        }
2302

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

2313
        /**
2314
         * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
2315
         * payment method options to pass to the invoice’s PaymentIntent.
2316
         */
2317
        public Builder setBancontact(EmptyParam bancontact) {
2318
          this.bancontact = bancontact;
×
2319
          return this;
×
2320
        }
2321

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

2331
        /**
2332
         * If paying by {@code card}, this sub-hash contains details about the Card payment method
2333
         * options to pass to the invoice’s PaymentIntent.
2334
         */
2335
        public Builder setCard(EmptyParam card) {
2336
          this.card = card;
×
2337
          return this;
×
2338
        }
2339

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

2351
        /**
2352
         * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
2353
         * transfer payment method options to pass to the invoice’s PaymentIntent.
2354
         */
2355
        public Builder setCustomerBalance(EmptyParam customerBalance) {
2356
          this.customerBalance = customerBalance;
×
2357
          return this;
×
2358
        }
2359

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

2374
        /**
2375
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2376
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2377
         * map. See {@link InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions#extraParams} for
2378
         * the field documentation.
2379
         */
2380
        public Builder putAllExtraParam(Map<String, Object> map) {
2381
          if (this.extraParams == null) {
×
2382
            this.extraParams = new HashMap<>();
×
2383
          }
2384
          this.extraParams.putAll(map);
×
2385
          return this;
×
2386
        }
2387

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

2399
        /**
2400
         * If paying by {@code id_bank_transfer}, this sub-hash contains details about the Indonesia
2401
         * bank transfer payment method options to pass to the invoice’s PaymentIntent.
2402
         */
2403
        public Builder setIdBankTransfer(EmptyParam idBankTransfer) {
NEW
2404
          this.idBankTransfer = idBankTransfer;
×
NEW
2405
          return this;
×
2406
        }
2407

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

2418
        /**
2419
         * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
2420
         * method options to pass to the invoice’s PaymentIntent.
2421
         */
2422
        public Builder setKonbini(EmptyParam konbini) {
2423
          this.konbini = konbini;
×
2424
          return this;
×
2425
        }
2426

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

2437
        /**
2438
         * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct
2439
         * Debit payment method options to pass to the invoice’s PaymentIntent.
2440
         */
2441
        public Builder setSepaDebit(EmptyParam sepaDebit) {
2442
          this.sepaDebit = sepaDebit;
×
2443
          return this;
×
2444
        }
2445

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

2456
        /**
2457
         * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
2458
         * debit payment method options to pass to the invoice’s PaymentIntent.
2459
         */
2460
        public Builder setUsBankAccount(EmptyParam usBankAccount) {
2461
          this.usBankAccount = usBankAccount;
×
2462
          return this;
×
2463
        }
2464
      }
2465

2466
      @Getter
2467
      public static class AcssDebit {
2468
        /**
2469
         * Map of extra parameters for custom features not available in this client library. The
2470
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2471
         * Instead, each key/value pair is serialized as if the key is a root-level field
2472
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2473
         * instance.
2474
         */
2475
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2476
        Map<String, Object> extraParams;
2477

2478
        /** Additional fields for Mandate creation. */
2479
        @SerializedName("mandate_options")
2480
        MandateOptions mandateOptions;
2481

2482
        /** Verification method for the intent. */
2483
        @SerializedName("verification_method")
2484
        VerificationMethod verificationMethod;
2485

2486
        private AcssDebit(
2487
            Map<String, Object> extraParams,
2488
            MandateOptions mandateOptions,
2489
            VerificationMethod verificationMethod) {
×
2490
          this.extraParams = extraParams;
×
2491
          this.mandateOptions = mandateOptions;
×
2492
          this.verificationMethod = verificationMethod;
×
2493
        }
×
2494

2495
        public static Builder builder() {
2496
          return new Builder();
×
2497
        }
2498

2499
        public static class Builder {
×
2500
          private Map<String, Object> extraParams;
2501

2502
          private MandateOptions mandateOptions;
2503

2504
          private VerificationMethod verificationMethod;
2505

2506
          /** Finalize and obtain parameter instance from this builder. */
2507
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit build() {
2508
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit(
×
2509
                this.extraParams, this.mandateOptions, this.verificationMethod);
2510
          }
2511

2512
          /**
2513
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2514
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2515
           * map. See {@link
2516
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit#extraParams} for the
2517
           * field documentation.
2518
           */
2519
          public Builder putExtraParam(String key, Object value) {
2520
            if (this.extraParams == null) {
×
2521
              this.extraParams = new HashMap<>();
×
2522
            }
2523
            this.extraParams.put(key, value);
×
2524
            return this;
×
2525
          }
2526

2527
          /**
2528
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2529
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2530
           * map. See {@link
2531
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit#extraParams} for the
2532
           * field documentation.
2533
           */
2534
          public Builder putAllExtraParam(Map<String, Object> map) {
2535
            if (this.extraParams == null) {
×
2536
              this.extraParams = new HashMap<>();
×
2537
            }
2538
            this.extraParams.putAll(map);
×
2539
            return this;
×
2540
          }
2541

2542
          /** Additional fields for Mandate creation. */
2543
          public Builder setMandateOptions(
2544
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2545
                  mandateOptions) {
2546
            this.mandateOptions = mandateOptions;
×
2547
            return this;
×
2548
          }
2549

2550
          /** Verification method for the intent. */
2551
          public Builder setVerificationMethod(
2552
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.VerificationMethod
2553
                  verificationMethod) {
2554
            this.verificationMethod = verificationMethod;
×
2555
            return this;
×
2556
          }
2557
        }
2558

2559
        @Getter
2560
        public static class MandateOptions {
2561
          /**
2562
           * Map of extra parameters for custom features not available in this client library. The
2563
           * content in this map is not serialized under this field's {@code @SerializedName} value.
2564
           * Instead, each key/value pair is serialized as if the key is a root-level field
2565
           * (serialized) name in this param object. Effectively, this map is flattened to its
2566
           * parent instance.
2567
           */
2568
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2569
          Map<String, Object> extraParams;
2570

2571
          /** Transaction type of the mandate. */
2572
          @SerializedName("transaction_type")
2573
          TransactionType transactionType;
2574

2575
          private MandateOptions(Map<String, Object> extraParams, TransactionType transactionType) {
×
2576
            this.extraParams = extraParams;
×
2577
            this.transactionType = transactionType;
×
2578
          }
×
2579

2580
          public static Builder builder() {
2581
            return new Builder();
×
2582
          }
2583

2584
          public static class Builder {
×
2585
            private Map<String, Object> extraParams;
2586

2587
            private TransactionType transactionType;
2588

2589
            /** Finalize and obtain parameter instance from this builder. */
2590
            public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2591
                build() {
2592
              return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit
×
2593
                  .MandateOptions(this.extraParams, this.transactionType);
2594
            }
2595

2596
            /**
2597
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
2598
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2599
             * original map. See {@link
2600
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions#extraParams}
2601
             * for the field documentation.
2602
             */
2603
            public Builder putExtraParam(String key, Object value) {
2604
              if (this.extraParams == null) {
×
2605
                this.extraParams = new HashMap<>();
×
2606
              }
2607
              this.extraParams.put(key, value);
×
2608
              return this;
×
2609
            }
2610

2611
            /**
2612
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2613
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2614
             * original map. See {@link
2615
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions#extraParams}
2616
             * for the field documentation.
2617
             */
2618
            public Builder putAllExtraParam(Map<String, Object> map) {
2619
              if (this.extraParams == null) {
×
2620
                this.extraParams = new HashMap<>();
×
2621
              }
2622
              this.extraParams.putAll(map);
×
2623
              return this;
×
2624
            }
2625

2626
            /** Transaction type of the mandate. */
2627
            public Builder setTransactionType(
2628
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions
2629
                        .TransactionType
2630
                    transactionType) {
2631
              this.transactionType = transactionType;
×
2632
              return this;
×
2633
            }
2634
          }
2635

2636
          public enum TransactionType implements ApiRequestParams.EnumParam {
×
2637
            @SerializedName("business")
×
2638
            BUSINESS("business"),
2639

2640
            @SerializedName("personal")
×
2641
            PERSONAL("personal");
2642

2643
            @Getter(onMethod_ = {@Override})
2644
            private final String value;
2645

2646
            TransactionType(String value) {
×
2647
              this.value = value;
×
2648
            }
×
2649
          }
2650
        }
2651

2652
        public enum VerificationMethod implements ApiRequestParams.EnumParam {
×
2653
          @SerializedName("automatic")
×
2654
          AUTOMATIC("automatic"),
2655

2656
          @SerializedName("instant")
×
2657
          INSTANT("instant"),
2658

2659
          @SerializedName("microdeposits")
×
2660
          MICRODEPOSITS("microdeposits");
2661

2662
          @Getter(onMethod_ = {@Override})
2663
          private final String value;
2664

2665
          VerificationMethod(String value) {
×
2666
            this.value = value;
×
2667
          }
×
2668
        }
2669
      }
2670

2671
      @Getter
2672
      public static class Bancontact {
2673
        /**
2674
         * Map of extra parameters for custom features not available in this client library. The
2675
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2676
         * Instead, each key/value pair is serialized as if the key is a root-level field
2677
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2678
         * instance.
2679
         */
2680
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2681
        Map<String, Object> extraParams;
2682

2683
        /**
2684
         * Preferred language of the Bancontact authorization page that the customer is redirected
2685
         * to.
2686
         */
2687
        @SerializedName("preferred_language")
2688
        PreferredLanguage preferredLanguage;
2689

2690
        private Bancontact(Map<String, Object> extraParams, PreferredLanguage preferredLanguage) {
×
2691
          this.extraParams = extraParams;
×
2692
          this.preferredLanguage = preferredLanguage;
×
2693
        }
×
2694

2695
        public static Builder builder() {
2696
          return new Builder();
×
2697
        }
2698

2699
        public static class Builder {
×
2700
          private Map<String, Object> extraParams;
2701

2702
          private PreferredLanguage preferredLanguage;
2703

2704
          /** Finalize and obtain parameter instance from this builder. */
2705
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact build() {
2706
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact(
×
2707
                this.extraParams, this.preferredLanguage);
2708
          }
2709

2710
          /**
2711
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2712
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2713
           * map. See {@link
2714
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for
2715
           * the field documentation.
2716
           */
2717
          public Builder putExtraParam(String key, Object value) {
2718
            if (this.extraParams == null) {
×
2719
              this.extraParams = new HashMap<>();
×
2720
            }
2721
            this.extraParams.put(key, value);
×
2722
            return this;
×
2723
          }
2724

2725
          /**
2726
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2727
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2728
           * map. See {@link
2729
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact#extraParams} for
2730
           * the field documentation.
2731
           */
2732
          public Builder putAllExtraParam(Map<String, Object> map) {
2733
            if (this.extraParams == null) {
×
2734
              this.extraParams = new HashMap<>();
×
2735
            }
2736
            this.extraParams.putAll(map);
×
2737
            return this;
×
2738
          }
2739

2740
          /**
2741
           * Preferred language of the Bancontact authorization page that the customer is redirected
2742
           * to.
2743
           */
2744
          public Builder setPreferredLanguage(
2745
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Bancontact.PreferredLanguage
2746
                  preferredLanguage) {
2747
            this.preferredLanguage = preferredLanguage;
×
2748
            return this;
×
2749
          }
2750
        }
2751

2752
        public enum PreferredLanguage implements ApiRequestParams.EnumParam {
×
2753
          @SerializedName("de")
×
2754
          DE("de"),
2755

2756
          @SerializedName("en")
×
2757
          EN("en"),
2758

2759
          @SerializedName("fr")
×
2760
          FR("fr"),
2761

2762
          @SerializedName("nl")
×
2763
          NL("nl");
2764

2765
          @Getter(onMethod_ = {@Override})
2766
          private final String value;
2767

2768
          PreferredLanguage(String value) {
×
2769
            this.value = value;
×
2770
          }
×
2771
        }
2772
      }
2773

2774
      @Getter
2775
      public static class Card {
2776
        /**
2777
         * Map of extra parameters for custom features not available in this client library. The
2778
         * content in this map is not serialized under this field's {@code @SerializedName} value.
2779
         * Instead, each key/value pair is serialized as if the key is a root-level field
2780
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
2781
         * instance.
2782
         */
2783
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2784
        Map<String, Object> extraParams;
2785

2786
        /**
2787
         * Installment configuration for payments attempted on this invoice (Mexico Only).
2788
         *
2789
         * <p>For more information, see the <a
2790
         * href="https://stripe.com/docs/payments/installments">installments integration guide</a>.
2791
         */
2792
        @SerializedName("installments")
2793
        Installments installments;
2794

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

2808
        private Card(
2809
            Map<String, Object> extraParams,
2810
            Installments installments,
2811
            RequestThreeDSecure requestThreeDSecure) {
×
2812
          this.extraParams = extraParams;
×
2813
          this.installments = installments;
×
2814
          this.requestThreeDSecure = requestThreeDSecure;
×
2815
        }
×
2816

2817
        public static Builder builder() {
2818
          return new Builder();
×
2819
        }
2820

2821
        public static class Builder {
×
2822
          private Map<String, Object> extraParams;
2823

2824
          private Installments installments;
2825

2826
          private RequestThreeDSecure requestThreeDSecure;
2827

2828
          /** Finalize and obtain parameter instance from this builder. */
2829
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card build() {
2830
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card(
×
2831
                this.extraParams, this.installments, this.requestThreeDSecure);
2832
          }
2833

2834
          /**
2835
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
2836
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2837
           * map. See {@link
2838
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card#extraParams} for the
2839
           * field documentation.
2840
           */
2841
          public Builder putExtraParam(String key, Object value) {
2842
            if (this.extraParams == null) {
×
2843
              this.extraParams = new HashMap<>();
×
2844
            }
2845
            this.extraParams.put(key, value);
×
2846
            return this;
×
2847
          }
2848

2849
          /**
2850
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2851
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
2852
           * map. See {@link
2853
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card#extraParams} for the
2854
           * field documentation.
2855
           */
2856
          public Builder putAllExtraParam(Map<String, Object> map) {
2857
            if (this.extraParams == null) {
×
2858
              this.extraParams = new HashMap<>();
×
2859
            }
2860
            this.extraParams.putAll(map);
×
2861
            return this;
×
2862
          }
2863

2864
          /**
2865
           * Installment configuration for payments attempted on this invoice (Mexico Only).
2866
           *
2867
           * <p>For more information, see the <a
2868
           * href="https://stripe.com/docs/payments/installments">installments integration
2869
           * guide</a>.
2870
           */
2871
          public Builder setInstallments(
2872
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments
2873
                  installments) {
2874
            this.installments = installments;
×
2875
            return this;
×
2876
          }
2877

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

2896
        @Getter
2897
        public static class Installments {
2898
          /**
2899
           * Setting to true enables installments for this invoice. Setting to false will prevent
2900
           * any selected plan from applying to a payment.
2901
           */
2902
          @SerializedName("enabled")
2903
          Boolean enabled;
2904

2905
          /**
2906
           * Map of extra parameters for custom features not available in this client library. The
2907
           * content in this map is not serialized under this field's {@code @SerializedName} value.
2908
           * Instead, each key/value pair is serialized as if the key is a root-level field
2909
           * (serialized) name in this param object. Effectively, this map is flattened to its
2910
           * parent instance.
2911
           */
2912
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2913
          Map<String, Object> extraParams;
2914

2915
          /** The selected installment plan to use for this invoice. */
2916
          @SerializedName("plan")
2917
          Object plan;
2918

2919
          private Installments(Boolean enabled, Map<String, Object> extraParams, Object plan) {
×
2920
            this.enabled = enabled;
×
2921
            this.extraParams = extraParams;
×
2922
            this.plan = plan;
×
2923
          }
×
2924

2925
          public static Builder builder() {
2926
            return new Builder();
×
2927
          }
2928

2929
          public static class Builder {
×
2930
            private Boolean enabled;
2931

2932
            private Map<String, Object> extraParams;
2933

2934
            private Object plan;
2935

2936
            /** Finalize and obtain parameter instance from this builder. */
2937
            public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments
2938
                build() {
2939
              return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments(
×
2940
                  this.enabled, this.extraParams, this.plan);
2941
            }
2942

2943
            /**
2944
             * Setting to true enables installments for this invoice. Setting to false will prevent
2945
             * any selected plan from applying to a payment.
2946
             */
2947
            public Builder setEnabled(Boolean enabled) {
2948
              this.enabled = enabled;
×
2949
              return this;
×
2950
            }
2951

2952
            /**
2953
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
2954
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2955
             * original map. See {@link
2956
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments#extraParams}
2957
             * for the field documentation.
2958
             */
2959
            public Builder putExtraParam(String key, Object value) {
2960
              if (this.extraParams == null) {
×
2961
                this.extraParams = new HashMap<>();
×
2962
              }
2963
              this.extraParams.put(key, value);
×
2964
              return this;
×
2965
            }
2966

2967
            /**
2968
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
2969
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
2970
             * original map. See {@link
2971
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments#extraParams}
2972
             * for the field documentation.
2973
             */
2974
            public Builder putAllExtraParam(Map<String, Object> map) {
2975
              if (this.extraParams == null) {
×
2976
                this.extraParams = new HashMap<>();
×
2977
              }
2978
              this.extraParams.putAll(map);
×
2979
              return this;
×
2980
            }
2981

2982
            /** The selected installment plan to use for this invoice. */
2983
            public Builder setPlan(
2984
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
2985
                    plan) {
2986
              this.plan = plan;
×
2987
              return this;
×
2988
            }
2989

2990
            /** The selected installment plan to use for this invoice. */
2991
            public Builder setPlan(EmptyParam plan) {
2992
              this.plan = plan;
×
2993
              return this;
×
2994
            }
2995
          }
2996

2997
          @Getter
2998
          public static class Plan {
2999
            /**
3000
             * For {@code fixed_count} installment plans, this is required. It represents the number
3001
             * of installment payments your customer will make to their credit card.
3002
             */
3003
            @SerializedName("count")
3004
            Long count;
3005

3006
            /**
3007
             * Map of extra parameters for custom features not available in this client library. The
3008
             * content in this map is not serialized under this field's {@code @SerializedName}
3009
             * value. Instead, each key/value pair is serialized as if the key is a root-level field
3010
             * (serialized) name in this param object. Effectively, this map is flattened to its
3011
             * parent instance.
3012
             */
3013
            @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3014
            Map<String, Object> extraParams;
3015

3016
            /**
3017
             * For {@code fixed_count} installment plans, this is required. It represents the
3018
             * interval between installment payments your customer will make to their credit card.
3019
             * One of {@code month}.
3020
             */
3021
            @SerializedName("interval")
3022
            Interval interval;
3023

3024
            /** <strong>Required.</strong> Type of installment plan, one of {@code fixed_count}. */
3025
            @SerializedName("type")
3026
            Type type;
3027

3028
            private Plan(
3029
                Long count, Map<String, Object> extraParams, Interval interval, Type type) {
×
3030
              this.count = count;
×
3031
              this.extraParams = extraParams;
×
3032
              this.interval = interval;
×
3033
              this.type = type;
×
3034
            }
×
3035

3036
            public static Builder builder() {
3037
              return new Builder();
×
3038
            }
3039

3040
            public static class Builder {
×
3041
              private Long count;
3042

3043
              private Map<String, Object> extraParams;
3044

3045
              private Interval interval;
3046

3047
              private Type type;
3048

3049
              /** Finalize and obtain parameter instance from this builder. */
3050
              public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3051
                  build() {
3052
                return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card
×
3053
                    .Installments.Plan(this.count, this.extraParams, this.interval, this.type);
3054
              }
3055

3056
              /**
3057
               * For {@code fixed_count} installment plans, this is required. It represents the
3058
               * number of installment payments your customer will make to their credit card.
3059
               */
3060
              public Builder setCount(Long count) {
3061
                this.count = count;
×
3062
                return this;
×
3063
              }
3064

3065
              /**
3066
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3067
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3068
               * original map. See {@link
3069
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan#extraParams}
3070
               * for the field documentation.
3071
               */
3072
              public Builder putExtraParam(String key, Object value) {
3073
                if (this.extraParams == null) {
×
3074
                  this.extraParams = new HashMap<>();
×
3075
                }
3076
                this.extraParams.put(key, value);
×
3077
                return this;
×
3078
              }
3079

3080
              /**
3081
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
3082
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
3083
               * original map. See {@link
3084
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan#extraParams}
3085
               * for the field documentation.
3086
               */
3087
              public Builder putAllExtraParam(Map<String, Object> map) {
3088
                if (this.extraParams == null) {
×
3089
                  this.extraParams = new HashMap<>();
×
3090
                }
3091
                this.extraParams.putAll(map);
×
3092
                return this;
×
3093
              }
3094

3095
              /**
3096
               * For {@code fixed_count} installment plans, this is required. It represents the
3097
               * interval between installment payments your customer will make to their credit card.
3098
               * One of {@code month}.
3099
               */
3100
              public Builder setInterval(
3101
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3102
                          .Interval
3103
                      interval) {
3104
                this.interval = interval;
×
3105
                return this;
×
3106
              }
3107

3108
              /**
3109
               * <strong>Required.</strong> Type of installment plan, one of {@code fixed_count}.
3110
               */
3111
              public Builder setType(
3112
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan
3113
                          .Type
3114
                      type) {
3115
                this.type = type;
×
3116
                return this;
×
3117
              }
3118
            }
3119

3120
            public enum Interval implements ApiRequestParams.EnumParam {
×
3121
              @SerializedName("month")
×
3122
              MONTH("month");
3123

3124
              @Getter(onMethod_ = {@Override})
3125
              private final String value;
3126

3127
              Interval(String value) {
×
3128
                this.value = value;
×
3129
              }
×
3130
            }
3131

3132
            public enum Type implements ApiRequestParams.EnumParam {
×
3133
              @SerializedName("fixed_count")
×
3134
              FIXED_COUNT("fixed_count");
3135

3136
              @Getter(onMethod_ = {@Override})
3137
              private final String value;
3138

3139
              Type(String value) {
×
3140
                this.value = value;
×
3141
              }
×
3142
            }
3143
          }
3144
        }
3145

3146
        public enum RequestThreeDSecure implements ApiRequestParams.EnumParam {
×
3147
          @SerializedName("any")
×
3148
          ANY("any"),
3149

3150
          @SerializedName("automatic")
×
3151
          AUTOMATIC("automatic"),
3152

3153
          @SerializedName("challenge")
×
3154
          CHALLENGE("challenge");
3155

3156
          @Getter(onMethod_ = {@Override})
3157
          private final String value;
3158

3159
          RequestThreeDSecure(String value) {
×
3160
            this.value = value;
×
3161
          }
×
3162
        }
3163
      }
3164

3165
      @Getter
3166
      public static class CustomerBalance {
3167
        /**
3168
         * Configuration for the bank transfer funding type, if the {@code funding_type} is set to
3169
         * {@code bank_transfer}.
3170
         */
3171
        @SerializedName("bank_transfer")
3172
        BankTransfer bankTransfer;
3173

3174
        /**
3175
         * Map of extra parameters for custom features not available in this client library. The
3176
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3177
         * Instead, each key/value pair is serialized as if the key is a root-level field
3178
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3179
         * instance.
3180
         */
3181
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3182
        Map<String, Object> extraParams;
3183

3184
        /**
3185
         * The funding method type to be used when there are not enough funds in the customer
3186
         * balance. Permitted values include: {@code bank_transfer}.
3187
         */
3188
        @SerializedName("funding_type")
3189
        Object fundingType;
3190

3191
        private CustomerBalance(
3192
            BankTransfer bankTransfer, Map<String, Object> extraParams, Object fundingType) {
×
3193
          this.bankTransfer = bankTransfer;
×
3194
          this.extraParams = extraParams;
×
3195
          this.fundingType = fundingType;
×
3196
        }
×
3197

3198
        public static Builder builder() {
3199
          return new Builder();
×
3200
        }
3201

3202
        public static class Builder {
×
3203
          private BankTransfer bankTransfer;
3204

3205
          private Map<String, Object> extraParams;
3206

3207
          private Object fundingType;
3208

3209
          /** Finalize and obtain parameter instance from this builder. */
3210
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance build() {
3211
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance(
×
3212
                this.bankTransfer, this.extraParams, this.fundingType);
3213
          }
3214

3215
          /**
3216
           * Configuration for the bank transfer funding type, if the {@code funding_type} is set to
3217
           * {@code bank_transfer}.
3218
           */
3219
          public Builder setBankTransfer(
3220
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer
3221
                  bankTransfer) {
3222
            this.bankTransfer = bankTransfer;
×
3223
            return this;
×
3224
          }
3225

3226
          /**
3227
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3228
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3229
           * map. See {@link
3230
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance#extraParams}
3231
           * for the field documentation.
3232
           */
3233
          public Builder putExtraParam(String key, Object value) {
3234
            if (this.extraParams == null) {
×
3235
              this.extraParams = new HashMap<>();
×
3236
            }
3237
            this.extraParams.put(key, value);
×
3238
            return this;
×
3239
          }
3240

3241
          /**
3242
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3243
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3244
           * map. See {@link
3245
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance#extraParams}
3246
           * for the field documentation.
3247
           */
3248
          public Builder putAllExtraParam(Map<String, Object> map) {
3249
            if (this.extraParams == null) {
×
3250
              this.extraParams = new HashMap<>();
×
3251
            }
3252
            this.extraParams.putAll(map);
×
3253
            return this;
×
3254
          }
3255

3256
          /**
3257
           * The funding method type to be used when there are not enough funds in the customer
3258
           * balance. Permitted values include: {@code bank_transfer}.
3259
           */
3260
          public Builder setFundingType(String fundingType) {
3261
            this.fundingType = fundingType;
×
3262
            return this;
×
3263
          }
3264

3265
          /**
3266
           * The funding method type to be used when there are not enough funds in the customer
3267
           * balance. Permitted values include: {@code bank_transfer}.
3268
           */
3269
          public Builder setFundingType(EmptyParam fundingType) {
3270
            this.fundingType = fundingType;
×
3271
            return this;
×
3272
          }
3273
        }
3274

3275
        @Getter
3276
        public static class BankTransfer {
3277
          /** Configuration for eu_bank_transfer funding type. */
3278
          @SerializedName("eu_bank_transfer")
3279
          EuBankTransfer euBankTransfer;
3280

3281
          /**
3282
           * Map of extra parameters for custom features not available in this client library. The
3283
           * content in this map is not serialized under this field's {@code @SerializedName} value.
3284
           * Instead, each key/value pair is serialized as if the key is a root-level field
3285
           * (serialized) name in this param object. Effectively, this map is flattened to its
3286
           * parent instance.
3287
           */
3288
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3289
          Map<String, Object> extraParams;
3290

3291
          /**
3292
           * The bank transfer type that can be used for funding. Permitted values include: {@code
3293
           * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3294
           * mx_bank_transfer}, or {@code us_bank_transfer}.
3295
           */
3296
          @SerializedName("type")
3297
          Object type;
3298

3299
          private BankTransfer(
3300
              EuBankTransfer euBankTransfer, Map<String, Object> extraParams, Object type) {
×
3301
            this.euBankTransfer = euBankTransfer;
×
3302
            this.extraParams = extraParams;
×
3303
            this.type = type;
×
3304
          }
×
3305

3306
          public static Builder builder() {
3307
            return new Builder();
×
3308
          }
3309

3310
          public static class Builder {
×
3311
            private EuBankTransfer euBankTransfer;
3312

3313
            private Map<String, Object> extraParams;
3314

3315
            private Object type;
3316

3317
            /** Finalize and obtain parameter instance from this builder. */
3318
            public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3319
                    .BankTransfer
3320
                build() {
3321
              return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
×
3322
                  .BankTransfer(this.euBankTransfer, this.extraParams, this.type);
3323
            }
3324

3325
            /** Configuration for eu_bank_transfer funding type. */
3326
            public Builder setEuBankTransfer(
3327
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3328
                        .BankTransfer.EuBankTransfer
3329
                    euBankTransfer) {
3330
              this.euBankTransfer = euBankTransfer;
×
3331
              return this;
×
3332
            }
3333

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

3349
            /**
3350
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3351
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3352
             * original map. See {@link
3353
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer#extraParams}
3354
             * for the field documentation.
3355
             */
3356
            public Builder putAllExtraParam(Map<String, Object> map) {
3357
              if (this.extraParams == null) {
×
3358
                this.extraParams = new HashMap<>();
×
3359
              }
3360
              this.extraParams.putAll(map);
×
3361
              return this;
×
3362
            }
3363

3364
            /**
3365
             * The bank transfer type that can be used for funding. Permitted values include: {@code
3366
             * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3367
             * mx_bank_transfer}, or {@code us_bank_transfer}.
3368
             */
3369
            public Builder setType(String type) {
3370
              this.type = type;
×
3371
              return this;
×
3372
            }
3373

3374
            /**
3375
             * The bank transfer type that can be used for funding. Permitted values include: {@code
3376
             * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
3377
             * mx_bank_transfer}, or {@code us_bank_transfer}.
3378
             */
3379
            public Builder setType(EmptyParam type) {
3380
              this.type = type;
×
3381
              return this;
×
3382
            }
3383
          }
3384

3385
          @Getter
3386
          public static class EuBankTransfer {
3387
            /**
3388
             * <strong>Required.</strong> The desired country code of the bank account information.
3389
             * Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE},
3390
             * or {@code NL}.
3391
             */
3392
            @SerializedName("country")
3393
            Object country;
3394

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

3405
            private EuBankTransfer(Object country, Map<String, Object> extraParams) {
×
3406
              this.country = country;
×
3407
              this.extraParams = extraParams;
×
3408
            }
×
3409

3410
            public static Builder builder() {
3411
              return new Builder();
×
3412
            }
3413

3414
            public static class Builder {
×
3415
              private Object country;
3416

3417
              private Map<String, Object> extraParams;
3418

3419
              /** Finalize and obtain parameter instance from this builder. */
3420
              public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
3421
                      .BankTransfer.EuBankTransfer
3422
                  build() {
3423
                return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance
×
3424
                    .BankTransfer.EuBankTransfer(this.country, this.extraParams);
3425
              }
3426

3427
              /**
3428
               * <strong>Required.</strong> The desired country code of the bank account
3429
               * information. Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code
3430
               * FR}, {@code IE}, or {@code NL}.
3431
               */
3432
              public Builder setCountry(String country) {
3433
                this.country = country;
×
3434
                return this;
×
3435
              }
3436

3437
              /**
3438
               * <strong>Required.</strong> The desired country code of the bank account
3439
               * information. Permitted values include: {@code BE}, {@code DE}, {@code ES}, {@code
3440
               * FR}, {@code IE}, or {@code NL}.
3441
               */
3442
              public Builder setCountry(EmptyParam country) {
3443
                this.country = country;
×
3444
                return this;
×
3445
              }
3446

3447
              /**
3448
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
3449
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3450
               * original map. See {@link
3451
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams}
3452
               * for the field documentation.
3453
               */
3454
              public Builder putExtraParam(String key, Object value) {
3455
                if (this.extraParams == null) {
×
3456
                  this.extraParams = new HashMap<>();
×
3457
                }
3458
                this.extraParams.put(key, value);
×
3459
                return this;
×
3460
              }
3461

3462
              /**
3463
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
3464
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
3465
               * original map. See {@link
3466
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer#extraParams}
3467
               * for the field documentation.
3468
               */
3469
              public Builder putAllExtraParam(Map<String, Object> map) {
3470
                if (this.extraParams == null) {
×
3471
                  this.extraParams = new HashMap<>();
×
3472
                }
3473
                this.extraParams.putAll(map);
×
3474
                return this;
×
3475
              }
3476
            }
3477
          }
3478
        }
3479
      }
3480

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

NEW
3493
        private IdBankTransfer(Map<String, Object> extraParams) {
×
NEW
3494
          this.extraParams = extraParams;
×
NEW
3495
        }
×
3496

3497
        public static Builder builder() {
NEW
3498
          return new Builder();
×
3499
        }
3500

NEW
3501
        public static class Builder {
×
3502
          private Map<String, Object> extraParams;
3503

3504
          /** Finalize and obtain parameter instance from this builder. */
3505
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.IdBankTransfer build() {
NEW
3506
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.IdBankTransfer(
×
3507
                this.extraParams);
3508
          }
3509

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

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

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

3554
        private Konbini(Map<String, Object> extraParams) {
×
3555
          this.extraParams = extraParams;
×
3556
        }
×
3557

3558
        public static Builder builder() {
3559
          return new Builder();
×
3560
        }
3561

3562
        public static class Builder {
×
3563
          private Map<String, Object> extraParams;
3564

3565
          /** Finalize and obtain parameter instance from this builder. */
3566
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini build() {
3567
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini(
×
3568
                this.extraParams);
3569
          }
3570

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

3586
          /**
3587
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3588
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3589
           * map. See {@link
3590
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Konbini#extraParams} for the
3591
           * field documentation.
3592
           */
3593
          public Builder putAllExtraParam(Map<String, Object> map) {
3594
            if (this.extraParams == null) {
×
3595
              this.extraParams = new HashMap<>();
×
3596
            }
3597
            this.extraParams.putAll(map);
×
3598
            return this;
×
3599
          }
3600
        }
3601
      }
3602

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

3615
        private SepaDebit(Map<String, Object> extraParams) {
×
3616
          this.extraParams = extraParams;
×
3617
        }
×
3618

3619
        public static Builder builder() {
3620
          return new Builder();
×
3621
        }
3622

3623
        public static class Builder {
×
3624
          private Map<String, Object> extraParams;
3625

3626
          /** Finalize and obtain parameter instance from this builder. */
3627
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.SepaDebit build() {
3628
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.SepaDebit(
×
3629
                this.extraParams);
3630
          }
3631

3632
          /**
3633
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3634
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3635
           * map. See {@link
3636
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.SepaDebit#extraParams} for the
3637
           * field documentation.
3638
           */
3639
          public Builder putExtraParam(String key, Object value) {
3640
            if (this.extraParams == null) {
×
3641
              this.extraParams = new HashMap<>();
×
3642
            }
3643
            this.extraParams.put(key, value);
×
3644
            return this;
×
3645
          }
3646

3647
          /**
3648
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3649
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3650
           * map. See {@link
3651
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.SepaDebit#extraParams} for the
3652
           * field documentation.
3653
           */
3654
          public Builder putAllExtraParam(Map<String, Object> map) {
3655
            if (this.extraParams == null) {
×
3656
              this.extraParams = new HashMap<>();
×
3657
            }
3658
            this.extraParams.putAll(map);
×
3659
            return this;
×
3660
          }
3661
        }
3662
      }
3663

3664
      @Getter
3665
      public static class UsBankAccount {
3666
        /**
3667
         * Map of extra parameters for custom features not available in this client library. The
3668
         * content in this map is not serialized under this field's {@code @SerializedName} value.
3669
         * Instead, each key/value pair is serialized as if the key is a root-level field
3670
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
3671
         * instance.
3672
         */
3673
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3674
        Map<String, Object> extraParams;
3675

3676
        /** Additional fields for Financial Connections Session creation. */
3677
        @SerializedName("financial_connections")
3678
        FinancialConnections financialConnections;
3679

3680
        /** Verification method for the intent. */
3681
        @SerializedName("verification_method")
3682
        VerificationMethod verificationMethod;
3683

3684
        private UsBankAccount(
3685
            Map<String, Object> extraParams,
3686
            FinancialConnections financialConnections,
3687
            VerificationMethod verificationMethod) {
×
3688
          this.extraParams = extraParams;
×
3689
          this.financialConnections = financialConnections;
×
3690
          this.verificationMethod = verificationMethod;
×
3691
        }
×
3692

3693
        public static Builder builder() {
3694
          return new Builder();
×
3695
        }
3696

3697
        public static class Builder {
×
3698
          private Map<String, Object> extraParams;
3699

3700
          private FinancialConnections financialConnections;
3701

3702
          private VerificationMethod verificationMethod;
3703

3704
          /** Finalize and obtain parameter instance from this builder. */
3705
          public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount build() {
3706
            return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount(
×
3707
                this.extraParams, this.financialConnections, this.verificationMethod);
3708
          }
3709

3710
          /**
3711
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
3712
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
3713
           * map. See {@link
3714
           * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount#extraParams} for
3715
           * the field documentation.
3716
           */
3717
          public Builder putExtraParam(String key, Object value) {
3718
            if (this.extraParams == null) {
×
3719
              this.extraParams = new HashMap<>();
×
3720
            }
3721
            this.extraParams.put(key, value);
×
3722
            return this;
×
3723
          }
3724

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

3740
          /** Additional fields for Financial Connections Session creation. */
3741
          public Builder setFinancialConnections(
3742
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3743
                      .FinancialConnections
3744
                  financialConnections) {
3745
            this.financialConnections = financialConnections;
×
3746
            return this;
×
3747
          }
3748

3749
          /** Verification method for the intent. */
3750
          public Builder setVerificationMethod(
3751
              InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3752
                      .VerificationMethod
3753
                  verificationMethod) {
3754
            this.verificationMethod = verificationMethod;
×
3755
            return this;
×
3756
          }
3757
        }
3758

3759
        @Getter
3760
        public static class FinancialConnections {
3761
          /**
3762
           * Map of extra parameters for custom features not available in this client library. The
3763
           * content in this map is not serialized under this field's {@code @SerializedName} value.
3764
           * Instead, each key/value pair is serialized as if the key is a root-level field
3765
           * (serialized) name in this param object. Effectively, this map is flattened to its
3766
           * parent instance.
3767
           */
3768
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3769
          Map<String, Object> extraParams;
3770

3771
          /**
3772
           * Provide filters for the linked accounts that the customer can select for the payment
3773
           * method.
3774
           */
3775
          @SerializedName("filters")
3776
          Filters filters;
3777

3778
          /**
3779
           * The list of permissions to request. If this parameter is passed, the {@code
3780
           * payment_method} permission must be included. Valid permissions include: {@code
3781
           * balances}, {@code ownership}, {@code payment_method}, and {@code transactions}.
3782
           */
3783
          @SerializedName("permissions")
3784
          List<
3785
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3786
                      .FinancialConnections.Permission>
3787
              permissions;
3788

3789
          /** List of data features that you would like to retrieve upon account creation. */
3790
          @SerializedName("prefetch")
3791
          List<
3792
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3793
                      .FinancialConnections.Prefetch>
3794
              prefetch;
3795

3796
          private FinancialConnections(
3797
              Map<String, Object> extraParams,
3798
              Filters filters,
3799
              List<
3800
                      InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3801
                          .FinancialConnections.Permission>
3802
                  permissions,
3803
              List<
3804
                      InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3805
                          .FinancialConnections.Prefetch>
3806
                  prefetch) {
×
3807
            this.extraParams = extraParams;
×
3808
            this.filters = filters;
×
3809
            this.permissions = permissions;
×
3810
            this.prefetch = prefetch;
×
3811
          }
×
3812

3813
          public static Builder builder() {
3814
            return new Builder();
×
3815
          }
3816

3817
          public static class Builder {
×
3818
            private Map<String, Object> extraParams;
3819

3820
            private Filters filters;
3821

3822
            private List<
3823
                    InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3824
                        .FinancialConnections.Permission>
3825
                permissions;
3826

3827
            private List<
3828
                    InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3829
                        .FinancialConnections.Prefetch>
3830
                prefetch;
3831

3832
            /** Finalize and obtain parameter instance from this builder. */
3833
            public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3834
                    .FinancialConnections
3835
                build() {
3836
              return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
×
3837
                  .FinancialConnections(
3838
                  this.extraParams, this.filters, this.permissions, this.prefetch);
3839
            }
3840

3841
            /**
3842
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
3843
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3844
             * original map. See {@link
3845
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams}
3846
             * for the field documentation.
3847
             */
3848
            public Builder putExtraParam(String key, Object value) {
3849
              if (this.extraParams == null) {
×
3850
                this.extraParams = new HashMap<>();
×
3851
              }
3852
              this.extraParams.put(key, value);
×
3853
              return this;
×
3854
            }
3855

3856
            /**
3857
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
3858
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
3859
             * original map. See {@link
3860
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#extraParams}
3861
             * for the field documentation.
3862
             */
3863
            public Builder putAllExtraParam(Map<String, Object> map) {
3864
              if (this.extraParams == null) {
×
3865
                this.extraParams = new HashMap<>();
×
3866
              }
3867
              this.extraParams.putAll(map);
×
3868
              return this;
×
3869
            }
3870

3871
            /**
3872
             * Provide filters for the linked accounts that the customer can select for the payment
3873
             * method.
3874
             */
3875
            public Builder setFilters(
3876
                InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3877
                        .FinancialConnections.Filters
3878
                    filters) {
3879
              this.filters = filters;
×
3880
              return this;
×
3881
            }
3882

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

3901
            /**
3902
             * Add all elements to `permissions` 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#permissions}
3906
             * for the field documentation.
3907
             */
3908
            public Builder addAllPermission(
3909
                List<
3910
                        InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3911
                            .FinancialConnections.Permission>
3912
                    elements) {
3913
              if (this.permissions == null) {
×
3914
                this.permissions = new ArrayList<>();
×
3915
              }
3916
              this.permissions.addAll(elements);
×
3917
              return this;
×
3918
            }
3919

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

3937
            /**
3938
             * Add all elements to `prefetch` list. A list is initialized for the first `add/addAll`
3939
             * call, and subsequent calls adds additional elements to the original list. See {@link
3940
             * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections#prefetch}
3941
             * for the field documentation.
3942
             */
3943
            public Builder addAllPrefetch(
3944
                List<
3945
                        InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3946
                            .FinancialConnections.Prefetch>
3947
                    elements) {
3948
              if (this.prefetch == null) {
×
3949
                this.prefetch = new ArrayList<>();
×
3950
              }
3951
              this.prefetch.addAll(elements);
×
3952
              return this;
×
3953
            }
3954
          }
3955

3956
          @Getter
3957
          public static class Filters {
3958
            /**
3959
             * The account subcategories to use to filter for selectable accounts. Valid
3960
             * subcategories are {@code checking} and {@code savings}.
3961
             */
3962
            @SerializedName("account_subcategories")
3963
            List<
3964
                    InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3965
                        .FinancialConnections.Filters.AccountSubcategory>
3966
                accountSubcategories;
3967

3968
            /**
3969
             * Map of extra parameters for custom features not available in this client library. The
3970
             * content in this map is not serialized under this field's {@code @SerializedName}
3971
             * value. Instead, each key/value pair is serialized as if the key is a root-level field
3972
             * (serialized) name in this param object. Effectively, this map is flattened to its
3973
             * parent instance.
3974
             */
3975
            @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3976
            Map<String, Object> extraParams;
3977

3978
            /** ID of the institution to use to filter for selectable accounts. */
3979
            @SerializedName("institution")
3980
            Object institution;
3981

3982
            private Filters(
3983
                List<
3984
                        InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
3985
                            .FinancialConnections.Filters.AccountSubcategory>
3986
                    accountSubcategories,
3987
                Map<String, Object> extraParams,
3988
                Object institution) {
×
3989
              this.accountSubcategories = accountSubcategories;
×
3990
              this.extraParams = extraParams;
×
3991
              this.institution = institution;
×
3992
            }
×
3993

3994
            public static Builder builder() {
3995
              return new Builder();
×
3996
            }
3997

3998
            public static class Builder {
×
3999
              private List<
4000
                      InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
4001
                          .FinancialConnections.Filters.AccountSubcategory>
4002
                  accountSubcategories;
4003

4004
              private Map<String, Object> extraParams;
4005

4006
              private Object institution;
4007

4008
              /** Finalize and obtain parameter instance from this builder. */
4009
              public InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
4010
                      .FinancialConnections.Filters
4011
                  build() {
4012
                return new InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
×
4013
                    .FinancialConnections.Filters(
4014
                    this.accountSubcategories, this.extraParams, this.institution);
4015
              }
4016

4017
              /**
4018
               * Add an element to `accountSubcategories` list. A list is initialized for the first
4019
               * `add/addAll` call, and subsequent calls adds additional elements to the original
4020
               * list. See {@link
4021
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories}
4022
               * for the field documentation.
4023
               */
4024
              public Builder addAccountSubcategory(
4025
                  InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
4026
                          .FinancialConnections.Filters.AccountSubcategory
4027
                      element) {
4028
                if (this.accountSubcategories == null) {
×
4029
                  this.accountSubcategories = new ArrayList<>();
×
4030
                }
4031
                this.accountSubcategories.add(element);
×
4032
                return this;
×
4033
              }
4034

4035
              /**
4036
               * Add all elements to `accountSubcategories` list. A list is initialized for the
4037
               * first `add/addAll` call, and subsequent calls adds additional elements to the
4038
               * original list. See {@link
4039
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#accountSubcategories}
4040
               * for the field documentation.
4041
               */
4042
              public Builder addAllAccountSubcategory(
4043
                  List<
4044
                          InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount
4045
                              .FinancialConnections.Filters.AccountSubcategory>
4046
                      elements) {
4047
                if (this.accountSubcategories == null) {
×
4048
                  this.accountSubcategories = new ArrayList<>();
×
4049
                }
4050
                this.accountSubcategories.addAll(elements);
×
4051
                return this;
×
4052
              }
4053

4054
              /**
4055
               * Add a key/value pair to `extraParams` map. A map is initialized for the first
4056
               * `put/putAll` call, and subsequent calls add additional key/value pairs to the
4057
               * original map. See {@link
4058
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams}
4059
               * for the field documentation.
4060
               */
4061
              public Builder putExtraParam(String key, Object value) {
4062
                if (this.extraParams == null) {
×
4063
                  this.extraParams = new HashMap<>();
×
4064
                }
4065
                this.extraParams.put(key, value);
×
4066
                return this;
×
4067
              }
4068

4069
              /**
4070
               * Add all map key/value pairs to `extraParams` map. A map is initialized for the
4071
               * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
4072
               * original map. See {@link
4073
               * InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters#extraParams}
4074
               * for the field documentation.
4075
               */
4076
              public Builder putAllExtraParam(Map<String, Object> map) {
4077
                if (this.extraParams == null) {
×
4078
                  this.extraParams = new HashMap<>();
×
4079
                }
4080
                this.extraParams.putAll(map);
×
4081
                return this;
×
4082
              }
4083

4084
              /** ID of the institution to use to filter for selectable accounts. */
4085
              public Builder setInstitution(String institution) {
4086
                this.institution = institution;
×
4087
                return this;
×
4088
              }
4089

4090
              /** ID of the institution to use to filter for selectable accounts. */
4091
              public Builder setInstitution(EmptyParam institution) {
4092
                this.institution = institution;
×
4093
                return this;
×
4094
              }
4095
            }
4096

4097
            public enum AccountSubcategory implements ApiRequestParams.EnumParam {
×
4098
              @SerializedName("checking")
×
4099
              CHECKING("checking"),
4100

4101
              @SerializedName("savings")
×
4102
              SAVINGS("savings");
4103

4104
              @Getter(onMethod_ = {@Override})
4105
              private final String value;
4106

4107
              AccountSubcategory(String value) {
×
4108
                this.value = value;
×
4109
              }
×
4110
            }
4111
          }
4112

4113
          public enum Permission implements ApiRequestParams.EnumParam {
×
4114
            @SerializedName("balances")
×
4115
            BALANCES("balances"),
4116

4117
            @SerializedName("ownership")
×
4118
            OWNERSHIP("ownership"),
4119

4120
            @SerializedName("payment_method")
×
4121
            PAYMENT_METHOD("payment_method"),
4122

4123
            @SerializedName("transactions")
×
4124
            TRANSACTIONS("transactions");
4125

4126
            @Getter(onMethod_ = {@Override})
4127
            private final String value;
4128

4129
            Permission(String value) {
×
4130
              this.value = value;
×
4131
            }
×
4132
          }
4133

4134
          public enum Prefetch implements ApiRequestParams.EnumParam {
×
4135
            @SerializedName("balances")
×
4136
            BALANCES("balances"),
4137

4138
            @SerializedName("inferred_balances")
×
4139
            INFERRED_BALANCES("inferred_balances"),
4140

4141
            @SerializedName("ownership")
×
4142
            OWNERSHIP("ownership"),
4143

4144
            @SerializedName("transactions")
×
4145
            TRANSACTIONS("transactions");
4146

4147
            @Getter(onMethod_ = {@Override})
4148
            private final String value;
4149

4150
            Prefetch(String value) {
×
4151
              this.value = value;
×
4152
            }
×
4153
          }
4154
        }
4155

4156
        public enum VerificationMethod implements ApiRequestParams.EnumParam {
×
4157
          @SerializedName("automatic")
×
4158
          AUTOMATIC("automatic"),
4159

4160
          @SerializedName("instant")
×
4161
          INSTANT("instant"),
4162

4163
          @SerializedName("microdeposits")
×
4164
          MICRODEPOSITS("microdeposits");
4165

4166
          @Getter(onMethod_ = {@Override})
4167
          private final String value;
4168

4169
          VerificationMethod(String value) {
×
4170
            this.value = value;
×
4171
          }
×
4172
        }
4173
      }
4174
    }
4175

4176
    public enum PaymentMethodType implements ApiRequestParams.EnumParam {
×
4177
      @SerializedName("ach_credit_transfer")
×
4178
      ACH_CREDIT_TRANSFER("ach_credit_transfer"),
4179

4180
      @SerializedName("ach_debit")
×
4181
      ACH_DEBIT("ach_debit"),
4182

4183
      @SerializedName("acss_debit")
×
4184
      ACSS_DEBIT("acss_debit"),
4185

4186
      @SerializedName("amazon_pay")
×
4187
      AMAZON_PAY("amazon_pay"),
4188

4189
      @SerializedName("au_becs_debit")
×
4190
      AU_BECS_DEBIT("au_becs_debit"),
4191

4192
      @SerializedName("bacs_debit")
×
4193
      BACS_DEBIT("bacs_debit"),
4194

4195
      @SerializedName("bancontact")
×
4196
      BANCONTACT("bancontact"),
4197

4198
      @SerializedName("boleto")
×
4199
      BOLETO("boleto"),
4200

4201
      @SerializedName("card")
×
4202
      CARD("card"),
4203

4204
      @SerializedName("cashapp")
×
4205
      CASHAPP("cashapp"),
4206

4207
      @SerializedName("customer_balance")
×
4208
      CUSTOMER_BALANCE("customer_balance"),
4209

4210
      @SerializedName("eps")
×
4211
      EPS("eps"),
4212

4213
      @SerializedName("fpx")
×
4214
      FPX("fpx"),
4215

4216
      @SerializedName("giropay")
×
4217
      GIROPAY("giropay"),
4218

4219
      @SerializedName("grabpay")
×
4220
      GRABPAY("grabpay"),
4221

NEW
4222
      @SerializedName("id_bank_transfer")
×
4223
      ID_BANK_TRANSFER("id_bank_transfer"),
4224

UNCOV
4225
      @SerializedName("ideal")
×
4226
      IDEAL("ideal"),
4227

4228
      @SerializedName("jp_credit_transfer")
×
4229
      JP_CREDIT_TRANSFER("jp_credit_transfer"),
4230

4231
      @SerializedName("kakao_pay")
×
4232
      KAKAO_PAY("kakao_pay"),
4233

4234
      @SerializedName("konbini")
×
4235
      KONBINI("konbini"),
4236

4237
      @SerializedName("kr_card")
×
4238
      KR_CARD("kr_card"),
4239

4240
      @SerializedName("link")
×
4241
      LINK("link"),
4242

4243
      @SerializedName("multibanco")
×
4244
      MULTIBANCO("multibanco"),
4245

4246
      @SerializedName("naver_pay")
×
4247
      NAVER_PAY("naver_pay"),
4248

4249
      @SerializedName("p24")
×
4250
      P24("p24"),
4251

4252
      @SerializedName("payco")
×
4253
      PAYCO("payco"),
4254

4255
      @SerializedName("paynow")
×
4256
      PAYNOW("paynow"),
4257

4258
      @SerializedName("paypal")
×
4259
      PAYPAL("paypal"),
4260

4261
      @SerializedName("promptpay")
×
4262
      PROMPTPAY("promptpay"),
4263

4264
      @SerializedName("revolut_pay")
×
4265
      REVOLUT_PAY("revolut_pay"),
4266

4267
      @SerializedName("sepa_credit_transfer")
×
4268
      SEPA_CREDIT_TRANSFER("sepa_credit_transfer"),
4269

4270
      @SerializedName("sepa_debit")
×
4271
      SEPA_DEBIT("sepa_debit"),
4272

4273
      @SerializedName("sofort")
×
4274
      SOFORT("sofort"),
4275

4276
      @SerializedName("swish")
×
4277
      SWISH("swish"),
4278

4279
      @SerializedName("us_bank_account")
×
4280
      US_BANK_ACCOUNT("us_bank_account"),
4281

4282
      @SerializedName("wechat_pay")
×
4283
      WECHAT_PAY("wechat_pay");
4284

4285
      @Getter(onMethod_ = {@Override})
4286
      private final String value;
4287

4288
      PaymentMethodType(String value) {
×
4289
        this.value = value;
×
4290
      }
×
4291
    }
4292
  }
4293

4294
  @Getter
4295
  public static class Rendering {
4296
    /**
4297
     * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4298
     * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4299
     * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code exclude_tax}
4300
     * will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4301
     */
4302
    @SerializedName("amount_tax_display")
4303
    ApiRequestParams.EnumParam amountTaxDisplay;
4304

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

4314
    /** Invoice pdf rendering options. */
4315
    @SerializedName("pdf")
4316
    Pdf pdf;
4317

4318
    /** ID of the invoice rendering template to use for this invoice. */
4319
    @SerializedName("template")
4320
    Object template;
4321

4322
    /** The specific version of invoice rendering template to use for this invoice. */
4323
    @SerializedName("template_version")
4324
    Object templateVersion;
4325

4326
    private Rendering(
4327
        ApiRequestParams.EnumParam amountTaxDisplay,
4328
        Map<String, Object> extraParams,
4329
        Pdf pdf,
4330
        Object template,
4331
        Object templateVersion) {
×
4332
      this.amountTaxDisplay = amountTaxDisplay;
×
4333
      this.extraParams = extraParams;
×
4334
      this.pdf = pdf;
×
4335
      this.template = template;
×
4336
      this.templateVersion = templateVersion;
×
4337
    }
×
4338

4339
    public static Builder builder() {
4340
      return new Builder();
×
4341
    }
4342

4343
    public static class Builder {
×
4344
      private ApiRequestParams.EnumParam amountTaxDisplay;
4345

4346
      private Map<String, Object> extraParams;
4347

4348
      private Pdf pdf;
4349

4350
      private Object template;
4351

4352
      private Object templateVersion;
4353

4354
      /** Finalize and obtain parameter instance from this builder. */
4355
      public InvoiceUpdateParams.Rendering build() {
4356
        return new InvoiceUpdateParams.Rendering(
×
4357
            this.amountTaxDisplay, this.extraParams, this.pdf, this.template, this.templateVersion);
4358
      }
4359

4360
      /**
4361
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4362
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4363
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4364
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4365
       */
4366
      public Builder setAmountTaxDisplay(
4367
          InvoiceUpdateParams.Rendering.AmountTaxDisplay amountTaxDisplay) {
4368
        this.amountTaxDisplay = amountTaxDisplay;
×
4369
        return this;
×
4370
      }
4371

4372
      /**
4373
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
4374
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
4375
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
4376
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
4377
       */
4378
      public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
4379
        this.amountTaxDisplay = amountTaxDisplay;
×
4380
        return this;
×
4381
      }
4382

4383
      /**
4384
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
4385
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4386
       * InvoiceUpdateParams.Rendering#extraParams} for the field documentation.
4387
       */
4388
      public Builder putExtraParam(String key, Object value) {
4389
        if (this.extraParams == null) {
×
4390
          this.extraParams = new HashMap<>();
×
4391
        }
4392
        this.extraParams.put(key, value);
×
4393
        return this;
×
4394
      }
4395

4396
      /**
4397
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4398
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
4399
       * See {@link InvoiceUpdateParams.Rendering#extraParams} for the field documentation.
4400
       */
4401
      public Builder putAllExtraParam(Map<String, Object> map) {
4402
        if (this.extraParams == null) {
×
4403
          this.extraParams = new HashMap<>();
×
4404
        }
4405
        this.extraParams.putAll(map);
×
4406
        return this;
×
4407
      }
4408

4409
      /** Invoice pdf rendering options. */
4410
      public Builder setPdf(InvoiceUpdateParams.Rendering.Pdf pdf) {
4411
        this.pdf = pdf;
×
4412
        return this;
×
4413
      }
4414

4415
      /** ID of the invoice rendering template to use for this invoice. */
4416
      public Builder setTemplate(String template) {
4417
        this.template = template;
×
4418
        return this;
×
4419
      }
4420

4421
      /** ID of the invoice rendering template to use for this invoice. */
4422
      public Builder setTemplate(EmptyParam template) {
4423
        this.template = template;
×
4424
        return this;
×
4425
      }
4426

4427
      /** The specific version of invoice rendering template to use for this invoice. */
4428
      public Builder setTemplateVersion(Long templateVersion) {
4429
        this.templateVersion = templateVersion;
×
4430
        return this;
×
4431
      }
4432

4433
      /** The specific version of invoice rendering template to use for this invoice. */
4434
      public Builder setTemplateVersion(EmptyParam templateVersion) {
4435
        this.templateVersion = templateVersion;
×
4436
        return this;
×
4437
      }
4438
    }
4439

4440
    @Getter
4441
    public static class Pdf {
4442
      /**
4443
       * Map of extra parameters for custom features not available in this client library. The
4444
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4445
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4446
       * name in this param object. Effectively, this map is flattened to its parent instance.
4447
       */
4448
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4449
      Map<String, Object> extraParams;
4450

4451
      /**
4452
       * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4453
       * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4454
       * Japanese locale and {@code letter} for customers with other locales.
4455
       */
4456
      @SerializedName("page_size")
4457
      PageSize pageSize;
4458

4459
      private Pdf(Map<String, Object> extraParams, PageSize pageSize) {
×
4460
        this.extraParams = extraParams;
×
4461
        this.pageSize = pageSize;
×
4462
      }
×
4463

4464
      public static Builder builder() {
4465
        return new Builder();
×
4466
      }
4467

4468
      public static class Builder {
×
4469
        private Map<String, Object> extraParams;
4470

4471
        private PageSize pageSize;
4472

4473
        /** Finalize and obtain parameter instance from this builder. */
4474
        public InvoiceUpdateParams.Rendering.Pdf build() {
4475
          return new InvoiceUpdateParams.Rendering.Pdf(this.extraParams, this.pageSize);
×
4476
        }
4477

4478
        /**
4479
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
4480
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4481
         * map. See {@link InvoiceUpdateParams.Rendering.Pdf#extraParams} for the field
4482
         * documentation.
4483
         */
4484
        public Builder putExtraParam(String key, Object value) {
4485
          if (this.extraParams == null) {
×
4486
            this.extraParams = new HashMap<>();
×
4487
          }
4488
          this.extraParams.put(key, value);
×
4489
          return this;
×
4490
        }
4491

4492
        /**
4493
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
4494
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4495
         * map. See {@link InvoiceUpdateParams.Rendering.Pdf#extraParams} for the field
4496
         * documentation.
4497
         */
4498
        public Builder putAllExtraParam(Map<String, Object> map) {
4499
          if (this.extraParams == null) {
×
4500
            this.extraParams = new HashMap<>();
×
4501
          }
4502
          this.extraParams.putAll(map);
×
4503
          return this;
×
4504
        }
4505

4506
        /**
4507
         * Page size for invoice PDF. Can be set to {@code a4}, {@code letter}, or {@code auto}. If
4508
         * set to {@code auto}, invoice PDF page size defaults to {@code a4} for customers with
4509
         * Japanese locale and {@code letter} for customers with other locales.
4510
         */
4511
        public Builder setPageSize(InvoiceUpdateParams.Rendering.Pdf.PageSize pageSize) {
4512
          this.pageSize = pageSize;
×
4513
          return this;
×
4514
        }
4515
      }
4516

4517
      public enum PageSize implements ApiRequestParams.EnumParam {
×
4518
        @SerializedName("a4")
×
4519
        A4("a4"),
4520

4521
        @SerializedName("auto")
×
4522
        AUTO("auto"),
4523

4524
        @SerializedName("letter")
×
4525
        LETTER("letter");
4526

4527
        @Getter(onMethod_ = {@Override})
4528
        private final String value;
4529

4530
        PageSize(String value) {
×
4531
          this.value = value;
×
4532
        }
×
4533
      }
4534
    }
4535

4536
    public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
4537
      @SerializedName("exclude_tax")
×
4538
      EXCLUDE_TAX("exclude_tax"),
4539

4540
      @SerializedName("include_inclusive_tax")
×
4541
      INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
4542

4543
      @Getter(onMethod_ = {@Override})
4544
      private final String value;
4545

4546
      AmountTaxDisplay(String value) {
×
4547
        this.value = value;
×
4548
      }
×
4549
    }
4550
  }
4551

4552
  @Getter
4553
  public static class ShippingCost {
4554
    /**
4555
     * Map of extra parameters for custom features not available in this client library. The content
4556
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
4557
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
4558
     * param object. Effectively, this map is flattened to its parent instance.
4559
     */
4560
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4561
    Map<String, Object> extraParams;
4562

4563
    /** The ID of the shipping rate to use for this order. */
4564
    @SerializedName("shipping_rate")
4565
    Object shippingRate;
4566

4567
    /** Parameters to create a new ad-hoc shipping rate for this order. */
4568
    @SerializedName("shipping_rate_data")
4569
    ShippingRateData shippingRateData;
4570

4571
    private ShippingCost(
4572
        Map<String, Object> extraParams, Object shippingRate, ShippingRateData shippingRateData) {
×
4573
      this.extraParams = extraParams;
×
4574
      this.shippingRate = shippingRate;
×
4575
      this.shippingRateData = shippingRateData;
×
4576
    }
×
4577

4578
    public static Builder builder() {
4579
      return new Builder();
×
4580
    }
4581

4582
    public static class Builder {
×
4583
      private Map<String, Object> extraParams;
4584

4585
      private Object shippingRate;
4586

4587
      private ShippingRateData shippingRateData;
4588

4589
      /** Finalize and obtain parameter instance from this builder. */
4590
      public InvoiceUpdateParams.ShippingCost build() {
4591
        return new InvoiceUpdateParams.ShippingCost(
×
4592
            this.extraParams, this.shippingRate, this.shippingRateData);
4593
      }
4594

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

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

4621
      /** The ID of the shipping rate to use for this order. */
4622
      public Builder setShippingRate(String shippingRate) {
4623
        this.shippingRate = shippingRate;
×
4624
        return this;
×
4625
      }
4626

4627
      /** The ID of the shipping rate to use for this order. */
4628
      public Builder setShippingRate(EmptyParam shippingRate) {
4629
        this.shippingRate = shippingRate;
×
4630
        return this;
×
4631
      }
4632

4633
      /** Parameters to create a new ad-hoc shipping rate for this order. */
4634
      public Builder setShippingRateData(
4635
          InvoiceUpdateParams.ShippingCost.ShippingRateData shippingRateData) {
4636
        this.shippingRateData = shippingRateData;
×
4637
        return this;
×
4638
      }
4639
    }
4640

4641
    @Getter
4642
    public static class ShippingRateData {
4643
      /**
4644
       * The estimated range for how long shipping will take, meant to be displayable to the
4645
       * customer. This will appear on CheckoutSessions.
4646
       */
4647
      @SerializedName("delivery_estimate")
4648
      DeliveryEstimate deliveryEstimate;
4649

4650
      /**
4651
       * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4652
       * customer. This will appear on CheckoutSessions.
4653
       */
4654
      @SerializedName("display_name")
4655
      Object displayName;
4656

4657
      /**
4658
       * Map of extra parameters for custom features not available in this client library. The
4659
       * content in this map is not serialized under this field's {@code @SerializedName} value.
4660
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
4661
       * name in this param object. Effectively, this map is flattened to its parent instance.
4662
       */
4663
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4664
      Map<String, Object> extraParams;
4665

4666
      /**
4667
       * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4668
       * fixed_amount}.
4669
       */
4670
      @SerializedName("fixed_amount")
4671
      FixedAmount fixedAmount;
4672

4673
      /**
4674
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
4675
       * attach to an object. This can be useful for storing additional information about the object
4676
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
4677
       * keys can be unset by posting an empty value to {@code metadata}.
4678
       */
4679
      @SerializedName("metadata")
4680
      Map<String, String> metadata;
4681

4682
      /**
4683
       * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4684
       * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4685
       */
4686
      @SerializedName("tax_behavior")
4687
      TaxBehavior taxBehavior;
4688

4689
      /**
4690
       * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4691
       * code is {@code txcd_92010001}.
4692
       */
4693
      @SerializedName("tax_code")
4694
      Object taxCode;
4695

4696
      /** The type of calculation to use on the shipping rate. */
4697
      @SerializedName("type")
4698
      Type type;
4699

4700
      private ShippingRateData(
4701
          DeliveryEstimate deliveryEstimate,
4702
          Object displayName,
4703
          Map<String, Object> extraParams,
4704
          FixedAmount fixedAmount,
4705
          Map<String, String> metadata,
4706
          TaxBehavior taxBehavior,
4707
          Object taxCode,
4708
          Type type) {
×
4709
        this.deliveryEstimate = deliveryEstimate;
×
4710
        this.displayName = displayName;
×
4711
        this.extraParams = extraParams;
×
4712
        this.fixedAmount = fixedAmount;
×
4713
        this.metadata = metadata;
×
4714
        this.taxBehavior = taxBehavior;
×
4715
        this.taxCode = taxCode;
×
4716
        this.type = type;
×
4717
      }
×
4718

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

4723
      public static class Builder {
×
4724
        private DeliveryEstimate deliveryEstimate;
4725

4726
        private Object displayName;
4727

4728
        private Map<String, Object> extraParams;
4729

4730
        private FixedAmount fixedAmount;
4731

4732
        private Map<String, String> metadata;
4733

4734
        private TaxBehavior taxBehavior;
4735

4736
        private Object taxCode;
4737

4738
        private Type type;
4739

4740
        /** Finalize and obtain parameter instance from this builder. */
4741
        public InvoiceUpdateParams.ShippingCost.ShippingRateData build() {
4742
          return new InvoiceUpdateParams.ShippingCost.ShippingRateData(
×
4743
              this.deliveryEstimate,
4744
              this.displayName,
4745
              this.extraParams,
4746
              this.fixedAmount,
4747
              this.metadata,
4748
              this.taxBehavior,
4749
              this.taxCode,
4750
              this.type);
4751
        }
4752

4753
        /**
4754
         * The estimated range for how long shipping will take, meant to be displayable to the
4755
         * customer. This will appear on CheckoutSessions.
4756
         */
4757
        public Builder setDeliveryEstimate(
4758
            InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate deliveryEstimate) {
4759
          this.deliveryEstimate = deliveryEstimate;
×
4760
          return this;
×
4761
        }
4762

4763
        /**
4764
         * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4765
         * customer. This will appear on CheckoutSessions.
4766
         */
4767
        public Builder setDisplayName(String displayName) {
4768
          this.displayName = displayName;
×
4769
          return this;
×
4770
        }
4771

4772
        /**
4773
         * <strong>Required.</strong> The name of the shipping rate, meant to be displayable to the
4774
         * customer. This will appear on CheckoutSessions.
4775
         */
4776
        public Builder setDisplayName(EmptyParam displayName) {
4777
          this.displayName = displayName;
×
4778
          return this;
×
4779
        }
4780

4781
        /**
4782
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
4783
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4784
         * map. See {@link InvoiceUpdateParams.ShippingCost.ShippingRateData#extraParams} for the
4785
         * field documentation.
4786
         */
4787
        public Builder putExtraParam(String key, Object value) {
4788
          if (this.extraParams == null) {
×
4789
            this.extraParams = new HashMap<>();
×
4790
          }
4791
          this.extraParams.put(key, value);
×
4792
          return this;
×
4793
        }
4794

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

4809
        /**
4810
         * Describes a fixed amount to charge for shipping. Must be present if type is {@code
4811
         * fixed_amount}.
4812
         */
4813
        public Builder setFixedAmount(
4814
            InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount fixedAmount) {
4815
          this.fixedAmount = fixedAmount;
×
4816
          return this;
×
4817
        }
4818

4819
        /**
4820
         * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
4821
         * call, and subsequent calls add additional key/value pairs to the original map. See {@link
4822
         * InvoiceUpdateParams.ShippingCost.ShippingRateData#metadata} for the field documentation.
4823
         */
4824
        public Builder putMetadata(String key, String value) {
4825
          if (this.metadata == null) {
×
4826
            this.metadata = new HashMap<>();
×
4827
          }
4828
          this.metadata.put(key, value);
×
4829
          return this;
×
4830
        }
4831

4832
        /**
4833
         * Add all map key/value pairs to `metadata` map. A map is initialized for the first
4834
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
4835
         * map. See {@link InvoiceUpdateParams.ShippingCost.ShippingRateData#metadata} for the field
4836
         * documentation.
4837
         */
4838
        public Builder putAllMetadata(Map<String, String> map) {
4839
          if (this.metadata == null) {
×
4840
            this.metadata = new HashMap<>();
×
4841
          }
4842
          this.metadata.putAll(map);
×
4843
          return this;
×
4844
        }
4845

4846
        /**
4847
         * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
4848
         * {@code inclusive}, {@code exclusive}, or {@code unspecified}.
4849
         */
4850
        public Builder setTaxBehavior(
4851
            InvoiceUpdateParams.ShippingCost.ShippingRateData.TaxBehavior taxBehavior) {
4852
          this.taxBehavior = taxBehavior;
×
4853
          return this;
×
4854
        }
4855

4856
        /**
4857
         * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4858
         * code is {@code txcd_92010001}.
4859
         */
4860
        public Builder setTaxCode(String taxCode) {
4861
          this.taxCode = taxCode;
×
4862
          return this;
×
4863
        }
4864

4865
        /**
4866
         * A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. The Shipping tax
4867
         * code is {@code txcd_92010001}.
4868
         */
4869
        public Builder setTaxCode(EmptyParam taxCode) {
4870
          this.taxCode = taxCode;
×
4871
          return this;
×
4872
        }
4873

4874
        /** The type of calculation to use on the shipping rate. */
4875
        public Builder setType(InvoiceUpdateParams.ShippingCost.ShippingRateData.Type type) {
4876
          this.type = type;
×
4877
          return this;
×
4878
        }
4879
      }
4880

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

4893
        /**
4894
         * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4895
         * infinite.
4896
         */
4897
        @SerializedName("maximum")
4898
        Maximum maximum;
4899

4900
        /** The lower bound of the estimated range. If empty, represents no lower bound. */
4901
        @SerializedName("minimum")
4902
        Minimum minimum;
4903

4904
        private DeliveryEstimate(
4905
            Map<String, Object> extraParams, Maximum maximum, Minimum minimum) {
×
4906
          this.extraParams = extraParams;
×
4907
          this.maximum = maximum;
×
4908
          this.minimum = minimum;
×
4909
        }
×
4910

4911
        public static Builder builder() {
4912
          return new Builder();
×
4913
        }
4914

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

4918
          private Maximum maximum;
4919

4920
          private Minimum minimum;
4921

4922
          /** Finalize and obtain parameter instance from this builder. */
4923
          public InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate build() {
4924
            return new InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate(
×
4925
                this.extraParams, this.maximum, this.minimum);
4926
          }
4927

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

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

4958
          /**
4959
           * The upper bound of the estimated range. If empty, represents no upper bound i.e.,
4960
           * infinite.
4961
           */
4962
          public Builder setMaximum(
4963
              InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum maximum) {
4964
            this.maximum = maximum;
×
4965
            return this;
×
4966
          }
4967

4968
          /** The lower bound of the estimated range. If empty, represents no lower bound. */
4969
          public Builder setMinimum(
4970
              InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum minimum) {
4971
            this.minimum = minimum;
×
4972
            return this;
×
4973
          }
4974
        }
4975

4976
        @Getter
4977
        public static class Maximum {
4978
          /**
4979
           * Map of extra parameters for custom features not available in this client library. The
4980
           * content in this map is not serialized under this field's {@code @SerializedName} value.
4981
           * Instead, each key/value pair is serialized as if the key is a root-level field
4982
           * (serialized) name in this param object. Effectively, this map is flattened to its
4983
           * parent instance.
4984
           */
4985
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
4986
          Map<String, Object> extraParams;
4987

4988
          /** <strong>Required.</strong> A unit of time. */
4989
          @SerializedName("unit")
4990
          Unit unit;
4991

4992
          /** <strong>Required.</strong> Must be greater than 0. */
4993
          @SerializedName("value")
4994
          Long value;
4995

4996
          private Maximum(Map<String, Object> extraParams, Unit unit, Long value) {
×
4997
            this.extraParams = extraParams;
×
4998
            this.unit = unit;
×
4999
            this.value = value;
×
5000
          }
×
5001

5002
          public static Builder builder() {
5003
            return new Builder();
×
5004
          }
5005

5006
          public static class Builder {
×
5007
            private Map<String, Object> extraParams;
5008

5009
            private Unit unit;
5010

5011
            private Long value;
5012

5013
            /** Finalize and obtain parameter instance from this builder. */
5014
            public InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum
5015
                build() {
5016
              return new InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum(
×
5017
                  this.extraParams, this.unit, this.value);
5018
            }
5019

5020
            /**
5021
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
5022
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5023
             * original map. See {@link
5024
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum#extraParams}
5025
             * for the field documentation.
5026
             */
5027
            public Builder putExtraParam(String key, Object value) {
5028
              if (this.extraParams == null) {
×
5029
                this.extraParams = new HashMap<>();
×
5030
              }
5031
              this.extraParams.put(key, value);
×
5032
              return this;
×
5033
            }
5034

5035
            /**
5036
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5037
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5038
             * original map. See {@link
5039
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum#extraParams}
5040
             * for the field documentation.
5041
             */
5042
            public Builder putAllExtraParam(Map<String, Object> map) {
5043
              if (this.extraParams == null) {
×
5044
                this.extraParams = new HashMap<>();
×
5045
              }
5046
              this.extraParams.putAll(map);
×
5047
              return this;
×
5048
            }
5049

5050
            /** <strong>Required.</strong> A unit of time. */
5051
            public Builder setUnit(
5052
                InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Maximum.Unit
5053
                    unit) {
5054
              this.unit = unit;
×
5055
              return this;
×
5056
            }
5057

5058
            /** <strong>Required.</strong> Must be greater than 0. */
5059
            public Builder setValue(Long value) {
5060
              this.value = value;
×
5061
              return this;
×
5062
            }
5063
          }
5064

5065
          public enum Unit implements ApiRequestParams.EnumParam {
×
5066
            @SerializedName("business_day")
×
5067
            BUSINESS_DAY("business_day"),
5068

5069
            @SerializedName("day")
×
5070
            DAY("day"),
5071

5072
            @SerializedName("hour")
×
5073
            HOUR("hour"),
5074

5075
            @SerializedName("month")
×
5076
            MONTH("month"),
5077

5078
            @SerializedName("week")
×
5079
            WEEK("week");
5080

5081
            @Getter(onMethod_ = {@Override})
5082
            private final String value;
5083

5084
            Unit(String value) {
×
5085
              this.value = value;
×
5086
            }
×
5087
          }
5088
        }
5089

5090
        @Getter
5091
        public static class Minimum {
5092
          /**
5093
           * Map of extra parameters for custom features not available in this client library. The
5094
           * content in this map is not serialized under this field's {@code @SerializedName} value.
5095
           * Instead, each key/value pair is serialized as if the key is a root-level field
5096
           * (serialized) name in this param object. Effectively, this map is flattened to its
5097
           * parent instance.
5098
           */
5099
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5100
          Map<String, Object> extraParams;
5101

5102
          /** <strong>Required.</strong> A unit of time. */
5103
          @SerializedName("unit")
5104
          Unit unit;
5105

5106
          /** <strong>Required.</strong> Must be greater than 0. */
5107
          @SerializedName("value")
5108
          Long value;
5109

5110
          private Minimum(Map<String, Object> extraParams, Unit unit, Long value) {
×
5111
            this.extraParams = extraParams;
×
5112
            this.unit = unit;
×
5113
            this.value = value;
×
5114
          }
×
5115

5116
          public static Builder builder() {
5117
            return new Builder();
×
5118
          }
5119

5120
          public static class Builder {
×
5121
            private Map<String, Object> extraParams;
5122

5123
            private Unit unit;
5124

5125
            private Long value;
5126

5127
            /** Finalize and obtain parameter instance from this builder. */
5128
            public InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum
5129
                build() {
5130
              return new InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum(
×
5131
                  this.extraParams, this.unit, this.value);
5132
            }
5133

5134
            /**
5135
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
5136
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5137
             * original map. See {@link
5138
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
5139
             * for the field documentation.
5140
             */
5141
            public Builder putExtraParam(String key, Object value) {
5142
              if (this.extraParams == null) {
×
5143
                this.extraParams = new HashMap<>();
×
5144
              }
5145
              this.extraParams.put(key, value);
×
5146
              return this;
×
5147
            }
5148

5149
            /**
5150
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5151
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5152
             * original map. See {@link
5153
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum#extraParams}
5154
             * for the field documentation.
5155
             */
5156
            public Builder putAllExtraParam(Map<String, Object> map) {
5157
              if (this.extraParams == null) {
×
5158
                this.extraParams = new HashMap<>();
×
5159
              }
5160
              this.extraParams.putAll(map);
×
5161
              return this;
×
5162
            }
5163

5164
            /** <strong>Required.</strong> A unit of time. */
5165
            public Builder setUnit(
5166
                InvoiceUpdateParams.ShippingCost.ShippingRateData.DeliveryEstimate.Minimum.Unit
5167
                    unit) {
5168
              this.unit = unit;
×
5169
              return this;
×
5170
            }
5171

5172
            /** <strong>Required.</strong> Must be greater than 0. */
5173
            public Builder setValue(Long value) {
5174
              this.value = value;
×
5175
              return this;
×
5176
            }
5177
          }
5178

5179
          public enum Unit implements ApiRequestParams.EnumParam {
×
5180
            @SerializedName("business_day")
×
5181
            BUSINESS_DAY("business_day"),
5182

5183
            @SerializedName("day")
×
5184
            DAY("day"),
5185

5186
            @SerializedName("hour")
×
5187
            HOUR("hour"),
5188

5189
            @SerializedName("month")
×
5190
            MONTH("month"),
5191

5192
            @SerializedName("week")
×
5193
            WEEK("week");
5194

5195
            @Getter(onMethod_ = {@Override})
5196
            private final String value;
5197

5198
            Unit(String value) {
×
5199
              this.value = value;
×
5200
            }
×
5201
          }
5202
        }
5203
      }
5204

5205
      @Getter
5206
      public static class FixedAmount {
5207
        /**
5208
         * <strong>Required.</strong> A non-negative integer in cents representing how much to
5209
         * charge.
5210
         */
5211
        @SerializedName("amount")
5212
        Long amount;
5213

5214
        /**
5215
         * <strong>Required.</strong> Three-letter <a
5216
         * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5217
         * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
5218
         */
5219
        @SerializedName("currency")
5220
        Object currency;
5221

5222
        /**
5223
         * Shipping rates defined in each available currency option. Each key must be a three-letter
5224
         * <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> and a <a
5225
         * href="https://stripe.com/docs/currencies">supported currency</a>.
5226
         */
5227
        @SerializedName("currency_options")
5228
        Map<String, InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5229
            currencyOptions;
5230

5231
        /**
5232
         * Map of extra parameters for custom features not available in this client library. The
5233
         * content in this map is not serialized under this field's {@code @SerializedName} value.
5234
         * Instead, each key/value pair is serialized as if the key is a root-level field
5235
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
5236
         * instance.
5237
         */
5238
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5239
        Map<String, Object> extraParams;
5240

5241
        private FixedAmount(
5242
            Long amount,
5243
            Object currency,
5244
            Map<
5245
                    String,
5246
                    InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5247
                currencyOptions,
5248
            Map<String, Object> extraParams) {
×
5249
          this.amount = amount;
×
5250
          this.currency = currency;
×
5251
          this.currencyOptions = currencyOptions;
×
5252
          this.extraParams = extraParams;
×
5253
        }
×
5254

5255
        public static Builder builder() {
5256
          return new Builder();
×
5257
        }
5258

5259
        public static class Builder {
×
5260
          private Long amount;
5261

5262
          private Object currency;
5263

5264
          private Map<
5265
                  String,
5266
                  InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5267
              currencyOptions;
5268

5269
          private Map<String, Object> extraParams;
5270

5271
          /** Finalize and obtain parameter instance from this builder. */
5272
          public InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount build() {
5273
            return new InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount(
×
5274
                this.amount, this.currency, this.currencyOptions, this.extraParams);
5275
          }
5276

5277
          /**
5278
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5279
           * charge.
5280
           */
5281
          public Builder setAmount(Long amount) {
5282
            this.amount = amount;
×
5283
            return this;
×
5284
          }
5285

5286
          /**
5287
           * <strong>Required.</strong> Three-letter <a
5288
           * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5289
           * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
5290
           * currency</a>.
5291
           */
5292
          public Builder setCurrency(String currency) {
5293
            this.currency = currency;
×
5294
            return this;
×
5295
          }
5296

5297
          /**
5298
           * <strong>Required.</strong> Three-letter <a
5299
           * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
5300
           * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
5301
           * currency</a>.
5302
           */
5303
          public Builder setCurrency(EmptyParam currency) {
5304
            this.currency = currency;
×
5305
            return this;
×
5306
          }
5307

5308
          /**
5309
           * Add a key/value pair to `currencyOptions` map. A map is initialized for the first
5310
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5311
           * map. See {@link
5312
           * InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the
5313
           * field documentation.
5314
           */
5315
          public Builder putCurrencyOption(
5316
              String key,
5317
              InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption value) {
5318
            if (this.currencyOptions == null) {
×
5319
              this.currencyOptions = new HashMap<>();
×
5320
            }
5321
            this.currencyOptions.put(key, value);
×
5322
            return this;
×
5323
          }
5324

5325
          /**
5326
           * Add all map key/value pairs to `currencyOptions` map. A map is initialized for the
5327
           * first `put/putAll` call, and subsequent calls add additional key/value pairs to the
5328
           * original map. See {@link
5329
           * InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount#currencyOptions} for the
5330
           * field documentation.
5331
           */
5332
          public Builder putAllCurrencyOption(
5333
              Map<
5334
                      String,
5335
                      InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5336
                  map) {
5337
            if (this.currencyOptions == null) {
×
5338
              this.currencyOptions = new HashMap<>();
×
5339
            }
5340
            this.currencyOptions.putAll(map);
×
5341
            return this;
×
5342
          }
5343

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

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

5375
        @Getter
5376
        public static class CurrencyOption {
5377
          /**
5378
           * <strong>Required.</strong> A non-negative integer in cents representing how much to
5379
           * charge.
5380
           */
5381
          @SerializedName("amount")
5382
          Long amount;
5383

5384
          /**
5385
           * Map of extra parameters for custom features not available in this client library. The
5386
           * content in this map is not serialized under this field's {@code @SerializedName} value.
5387
           * Instead, each key/value pair is serialized as if the key is a root-level field
5388
           * (serialized) name in this param object. Effectively, this map is flattened to its
5389
           * parent instance.
5390
           */
5391
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5392
          Map<String, Object> extraParams;
5393

5394
          /**
5395
           * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One
5396
           * of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5397
           */
5398
          @SerializedName("tax_behavior")
5399
          TaxBehavior taxBehavior;
5400

5401
          private CurrencyOption(
5402
              Long amount, Map<String, Object> extraParams, TaxBehavior taxBehavior) {
×
5403
            this.amount = amount;
×
5404
            this.extraParams = extraParams;
×
5405
            this.taxBehavior = taxBehavior;
×
5406
          }
×
5407

5408
          public static Builder builder() {
5409
            return new Builder();
×
5410
          }
5411

5412
          public static class Builder {
×
5413
            private Long amount;
5414

5415
            private Map<String, Object> extraParams;
5416

5417
            private TaxBehavior taxBehavior;
5418

5419
            /** Finalize and obtain parameter instance from this builder. */
5420
            public InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5421
                build() {
5422
              return new InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount
×
5423
                  .CurrencyOption(this.amount, this.extraParams, this.taxBehavior);
5424
            }
5425

5426
            /**
5427
             * <strong>Required.</strong> A non-negative integer in cents representing how much to
5428
             * charge.
5429
             */
5430
            public Builder setAmount(Long amount) {
5431
              this.amount = amount;
×
5432
              return this;
×
5433
            }
5434

5435
            /**
5436
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
5437
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
5438
             * original map. See {@link
5439
             * InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption#extraParams}
5440
             * for the field documentation.
5441
             */
5442
            public Builder putExtraParam(String key, Object value) {
5443
              if (this.extraParams == null) {
×
5444
                this.extraParams = new HashMap<>();
×
5445
              }
5446
              this.extraParams.put(key, value);
×
5447
              return this;
×
5448
            }
5449

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

5465
            /**
5466
             * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
5467
             * One of {@code inclusive}, {@code exclusive}, or {@code unspecified}.
5468
             */
5469
            public Builder setTaxBehavior(
5470
                InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption
5471
                        .TaxBehavior
5472
                    taxBehavior) {
5473
              this.taxBehavior = taxBehavior;
×
5474
              return this;
×
5475
            }
5476
          }
5477

5478
          public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5479
            @SerializedName("exclusive")
×
5480
            EXCLUSIVE("exclusive"),
5481

5482
            @SerializedName("inclusive")
×
5483
            INCLUSIVE("inclusive"),
5484

5485
            @SerializedName("unspecified")
×
5486
            UNSPECIFIED("unspecified");
5487

5488
            @Getter(onMethod_ = {@Override})
5489
            private final String value;
5490

5491
            TaxBehavior(String value) {
×
5492
              this.value = value;
×
5493
            }
×
5494
          }
5495
        }
5496
      }
5497

5498
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5499
        @SerializedName("exclusive")
×
5500
        EXCLUSIVE("exclusive"),
5501

5502
        @SerializedName("inclusive")
×
5503
        INCLUSIVE("inclusive"),
5504

5505
        @SerializedName("unspecified")
×
5506
        UNSPECIFIED("unspecified");
5507

5508
        @Getter(onMethod_ = {@Override})
5509
        private final String value;
5510

5511
        TaxBehavior(String value) {
×
5512
          this.value = value;
×
5513
        }
×
5514
      }
5515

5516
      public enum Type implements ApiRequestParams.EnumParam {
×
5517
        @SerializedName("fixed_amount")
×
5518
        FIXED_AMOUNT("fixed_amount");
5519

5520
        @Getter(onMethod_ = {@Override})
5521
        private final String value;
5522

5523
        Type(String value) {
×
5524
          this.value = value;
×
5525
        }
×
5526
      }
5527
    }
5528
  }
5529

5530
  @Getter
5531
  public static class ShippingDetails {
5532
    /** <strong>Required.</strong> Shipping address */
5533
    @SerializedName("address")
5534
    Address address;
5535

5536
    /**
5537
     * Map of extra parameters for custom features not available in this client library. The content
5538
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5539
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5540
     * param object. Effectively, this map is flattened to its parent instance.
5541
     */
5542
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5543
    Map<String, Object> extraParams;
5544

5545
    /** <strong>Required.</strong> Recipient name. */
5546
    @SerializedName("name")
5547
    Object name;
5548

5549
    /** Recipient phone (including extension). */
5550
    @SerializedName("phone")
5551
    Object phone;
5552

5553
    private ShippingDetails(
5554
        Address address, Map<String, Object> extraParams, Object name, Object phone) {
×
5555
      this.address = address;
×
5556
      this.extraParams = extraParams;
×
5557
      this.name = name;
×
5558
      this.phone = phone;
×
5559
    }
×
5560

5561
    public static Builder builder() {
5562
      return new Builder();
×
5563
    }
5564

5565
    public static class Builder {
×
5566
      private Address address;
5567

5568
      private Map<String, Object> extraParams;
5569

5570
      private Object name;
5571

5572
      private Object phone;
5573

5574
      /** Finalize and obtain parameter instance from this builder. */
5575
      public InvoiceUpdateParams.ShippingDetails build() {
5576
        return new InvoiceUpdateParams.ShippingDetails(
×
5577
            this.address, this.extraParams, this.name, this.phone);
5578
      }
5579

5580
      /** <strong>Required.</strong> Shipping address */
5581
      public Builder setAddress(InvoiceUpdateParams.ShippingDetails.Address address) {
5582
        this.address = address;
×
5583
        return this;
×
5584
      }
5585

5586
      /**
5587
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5588
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5589
       * InvoiceUpdateParams.ShippingDetails#extraParams} for the field documentation.
5590
       */
5591
      public Builder putExtraParam(String key, Object value) {
5592
        if (this.extraParams == null) {
×
5593
          this.extraParams = new HashMap<>();
×
5594
        }
5595
        this.extraParams.put(key, value);
×
5596
        return this;
×
5597
      }
5598

5599
      /**
5600
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5601
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5602
       * See {@link InvoiceUpdateParams.ShippingDetails#extraParams} for the field documentation.
5603
       */
5604
      public Builder putAllExtraParam(Map<String, Object> map) {
5605
        if (this.extraParams == null) {
×
5606
          this.extraParams = new HashMap<>();
×
5607
        }
5608
        this.extraParams.putAll(map);
×
5609
        return this;
×
5610
      }
5611

5612
      /** <strong>Required.</strong> Recipient name. */
5613
      public Builder setName(String name) {
5614
        this.name = name;
×
5615
        return this;
×
5616
      }
5617

5618
      /** <strong>Required.</strong> Recipient name. */
5619
      public Builder setName(EmptyParam name) {
5620
        this.name = name;
×
5621
        return this;
×
5622
      }
5623

5624
      /** Recipient phone (including extension). */
5625
      public Builder setPhone(String phone) {
5626
        this.phone = phone;
×
5627
        return this;
×
5628
      }
5629

5630
      /** Recipient phone (including extension). */
5631
      public Builder setPhone(EmptyParam phone) {
5632
        this.phone = phone;
×
5633
        return this;
×
5634
      }
5635
    }
5636

5637
    @Getter
5638
    public static class Address {
5639
      /** City, district, suburb, town, or village. */
5640
      @SerializedName("city")
5641
      Object city;
5642

5643
      /**
5644
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5645
       * 3166-1 alpha-2</a>).
5646
       */
5647
      @SerializedName("country")
5648
      Object country;
5649

5650
      /**
5651
       * Map of extra parameters for custom features not available in this client library. The
5652
       * content in this map is not serialized under this field's {@code @SerializedName} value.
5653
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
5654
       * name in this param object. Effectively, this map is flattened to its parent instance.
5655
       */
5656
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5657
      Map<String, Object> extraParams;
5658

5659
      /** Address line 1 (e.g., street, PO Box, or company name). */
5660
      @SerializedName("line1")
5661
      Object line1;
5662

5663
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
5664
      @SerializedName("line2")
5665
      Object line2;
5666

5667
      /** ZIP or postal code. */
5668
      @SerializedName("postal_code")
5669
      Object postalCode;
5670

5671
      /** State, county, province, or region. */
5672
      @SerializedName("state")
5673
      Object state;
5674

5675
      private Address(
5676
          Object city,
5677
          Object country,
5678
          Map<String, Object> extraParams,
5679
          Object line1,
5680
          Object line2,
5681
          Object postalCode,
5682
          Object state) {
×
5683
        this.city = city;
×
5684
        this.country = country;
×
5685
        this.extraParams = extraParams;
×
5686
        this.line1 = line1;
×
5687
        this.line2 = line2;
×
5688
        this.postalCode = postalCode;
×
5689
        this.state = state;
×
5690
      }
×
5691

5692
      public static Builder builder() {
5693
        return new Builder();
×
5694
      }
5695

5696
      public static class Builder {
×
5697
        private Object city;
5698

5699
        private Object country;
5700

5701
        private Map<String, Object> extraParams;
5702

5703
        private Object line1;
5704

5705
        private Object line2;
5706

5707
        private Object postalCode;
5708

5709
        private Object state;
5710

5711
        /** Finalize and obtain parameter instance from this builder. */
5712
        public InvoiceUpdateParams.ShippingDetails.Address build() {
5713
          return new InvoiceUpdateParams.ShippingDetails.Address(
×
5714
              this.city,
5715
              this.country,
5716
              this.extraParams,
5717
              this.line1,
5718
              this.line2,
5719
              this.postalCode,
5720
              this.state);
5721
        }
5722

5723
        /** City, district, suburb, town, or village. */
5724
        public Builder setCity(String city) {
5725
          this.city = city;
×
5726
          return this;
×
5727
        }
5728

5729
        /** City, district, suburb, town, or village. */
5730
        public Builder setCity(EmptyParam city) {
5731
          this.city = city;
×
5732
          return this;
×
5733
        }
5734

5735
        /**
5736
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5737
         * 3166-1 alpha-2</a>).
5738
         */
5739
        public Builder setCountry(String country) {
5740
          this.country = country;
×
5741
          return this;
×
5742
        }
5743

5744
        /**
5745
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
5746
         * 3166-1 alpha-2</a>).
5747
         */
5748
        public Builder setCountry(EmptyParam country) {
5749
          this.country = country;
×
5750
          return this;
×
5751
        }
5752

5753
        /**
5754
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
5755
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5756
         * map. See {@link InvoiceUpdateParams.ShippingDetails.Address#extraParams} for the field
5757
         * documentation.
5758
         */
5759
        public Builder putExtraParam(String key, Object value) {
5760
          if (this.extraParams == null) {
×
5761
            this.extraParams = new HashMap<>();
×
5762
          }
5763
          this.extraParams.put(key, value);
×
5764
          return this;
×
5765
        }
5766

5767
        /**
5768
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5769
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
5770
         * map. See {@link InvoiceUpdateParams.ShippingDetails.Address#extraParams} for the field
5771
         * documentation.
5772
         */
5773
        public Builder putAllExtraParam(Map<String, Object> map) {
5774
          if (this.extraParams == null) {
×
5775
            this.extraParams = new HashMap<>();
×
5776
          }
5777
          this.extraParams.putAll(map);
×
5778
          return this;
×
5779
        }
5780

5781
        /** Address line 1 (e.g., street, PO Box, or company name). */
5782
        public Builder setLine1(String line1) {
5783
          this.line1 = line1;
×
5784
          return this;
×
5785
        }
5786

5787
        /** Address line 1 (e.g., street, PO Box, or company name). */
5788
        public Builder setLine1(EmptyParam line1) {
5789
          this.line1 = line1;
×
5790
          return this;
×
5791
        }
5792

5793
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
5794
        public Builder setLine2(String line2) {
5795
          this.line2 = line2;
×
5796
          return this;
×
5797
        }
5798

5799
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
5800
        public Builder setLine2(EmptyParam line2) {
5801
          this.line2 = line2;
×
5802
          return this;
×
5803
        }
5804

5805
        /** ZIP or postal code. */
5806
        public Builder setPostalCode(String postalCode) {
5807
          this.postalCode = postalCode;
×
5808
          return this;
×
5809
        }
5810

5811
        /** ZIP or postal code. */
5812
        public Builder setPostalCode(EmptyParam postalCode) {
5813
          this.postalCode = postalCode;
×
5814
          return this;
×
5815
        }
5816

5817
        /** State, county, province, or region. */
5818
        public Builder setState(String state) {
5819
          this.state = state;
×
5820
          return this;
×
5821
        }
5822

5823
        /** State, county, province, or region. */
5824
        public Builder setState(EmptyParam state) {
5825
          this.state = state;
×
5826
          return this;
×
5827
        }
5828
      }
5829
    }
5830
  }
5831

5832
  @Getter
5833
  public static class TransferData {
5834
    /**
5835
     * The amount that will be transferred automatically when the invoice is paid. If no amount is
5836
     * set, the full amount is transferred.
5837
     */
5838
    @SerializedName("amount")
5839
    Long amount;
5840

5841
    /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5842
    @SerializedName("destination")
5843
    Object destination;
5844

5845
    /**
5846
     * Map of extra parameters for custom features not available in this client library. The content
5847
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
5848
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
5849
     * param object. Effectively, this map is flattened to its parent instance.
5850
     */
5851
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
5852
    Map<String, Object> extraParams;
5853

5854
    private TransferData(Long amount, Object destination, Map<String, Object> extraParams) {
×
5855
      this.amount = amount;
×
5856
      this.destination = destination;
×
5857
      this.extraParams = extraParams;
×
5858
    }
×
5859

5860
    public static Builder builder() {
5861
      return new Builder();
×
5862
    }
5863

5864
    public static class Builder {
×
5865
      private Long amount;
5866

5867
      private Object destination;
5868

5869
      private Map<String, Object> extraParams;
5870

5871
      /** Finalize and obtain parameter instance from this builder. */
5872
      public InvoiceUpdateParams.TransferData build() {
5873
        return new InvoiceUpdateParams.TransferData(
×
5874
            this.amount, this.destination, this.extraParams);
5875
      }
5876

5877
      /**
5878
       * The amount that will be transferred automatically when the invoice is paid. If no amount is
5879
       * set, the full amount is transferred.
5880
       */
5881
      public Builder setAmount(Long amount) {
5882
        this.amount = amount;
×
5883
        return this;
×
5884
      }
5885

5886
      /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5887
      public Builder setDestination(String destination) {
5888
        this.destination = destination;
×
5889
        return this;
×
5890
      }
5891

5892
      /** <strong>Required.</strong> ID of an existing, connected Stripe account. */
5893
      public Builder setDestination(EmptyParam destination) {
5894
        this.destination = destination;
×
5895
        return this;
×
5896
      }
5897

5898
      /**
5899
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
5900
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
5901
       * InvoiceUpdateParams.TransferData#extraParams} for the field documentation.
5902
       */
5903
      public Builder putExtraParam(String key, Object value) {
5904
        if (this.extraParams == null) {
×
5905
          this.extraParams = new HashMap<>();
×
5906
        }
5907
        this.extraParams.put(key, value);
×
5908
        return this;
×
5909
      }
5910

5911
      /**
5912
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
5913
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
5914
       * See {@link InvoiceUpdateParams.TransferData#extraParams} for the field documentation.
5915
       */
5916
      public Builder putAllExtraParam(Map<String, Object> map) {
5917
        if (this.extraParams == null) {
×
5918
          this.extraParams = new HashMap<>();
×
5919
        }
5920
        this.extraParams.putAll(map);
×
5921
        return this;
×
5922
      }
5923
    }
5924
  }
5925

5926
  public enum CollectionMethod implements ApiRequestParams.EnumParam {
×
5927
    @SerializedName("charge_automatically")
×
5928
    CHARGE_AUTOMATICALLY("charge_automatically"),
5929

5930
    @SerializedName("send_invoice")
×
5931
    SEND_INVOICE("send_invoice");
5932

5933
    @Getter(onMethod_ = {@Override})
5934
    private final String value;
5935

5936
    CollectionMethod(String value) {
×
5937
      this.value = value;
×
5938
    }
×
5939
  }
5940
}
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