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

stripe / stripe-java / #16624

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

push

github

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

Update generated code for beta

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

33 existing lines in 29 files now uncovered.

18855 of 151828 relevant lines covered (12.42%)

0.12 hits per line

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

4.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) {
518
      this.automaticallyFinalizesAt = automaticallyFinalizesAt;
×
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;
×
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) {
2395
          this.idBankTransfer = idBankTransfer;
×
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) {
2404
          this.idBankTransfer = idBankTransfer;
×
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

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

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

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() {
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) {
3518
            if (this.extraParams == null) {
×
3519
              this.extraParams = new HashMap<>();
×
3520
            }
3521
            this.extraParams.put(key, value);
×
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) {
3533
            if (this.extraParams == null) {
×
3534
              this.extraParams = new HashMap<>();
×
3535
            }
3536
            this.extraParams.putAll(map);
×
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

NEW
4207
      @SerializedName("custom")
×
4208
      CUSTOM("custom"),
4209

UNCOV
4210
      @SerializedName("customer_balance")
×
4211
      CUSTOMER_BALANCE("customer_balance"),
4212

4213
      @SerializedName("eps")
×
4214
      EPS("eps"),
4215

4216
      @SerializedName("fpx")
×
4217
      FPX("fpx"),
4218

4219
      @SerializedName("giropay")
×
4220
      GIROPAY("giropay"),
4221

4222
      @SerializedName("grabpay")
×
4223
      GRABPAY("grabpay"),
4224

4225
      @SerializedName("id_bank_transfer")
×
4226
      ID_BANK_TRANSFER("id_bank_transfer"),
4227

4228
      @SerializedName("ideal")
×
4229
      IDEAL("ideal"),
4230

4231
      @SerializedName("jp_credit_transfer")
×
4232
      JP_CREDIT_TRANSFER("jp_credit_transfer"),
4233

4234
      @SerializedName("kakao_pay")
×
4235
      KAKAO_PAY("kakao_pay"),
4236

4237
      @SerializedName("konbini")
×
4238
      KONBINI("konbini"),
4239

4240
      @SerializedName("kr_card")
×
4241
      KR_CARD("kr_card"),
4242

4243
      @SerializedName("link")
×
4244
      LINK("link"),
4245

4246
      @SerializedName("multibanco")
×
4247
      MULTIBANCO("multibanco"),
4248

4249
      @SerializedName("naver_pay")
×
4250
      NAVER_PAY("naver_pay"),
4251

4252
      @SerializedName("p24")
×
4253
      P24("p24"),
4254

4255
      @SerializedName("payco")
×
4256
      PAYCO("payco"),
4257

4258
      @SerializedName("paynow")
×
4259
      PAYNOW("paynow"),
4260

4261
      @SerializedName("paypal")
×
4262
      PAYPAL("paypal"),
4263

4264
      @SerializedName("promptpay")
×
4265
      PROMPTPAY("promptpay"),
4266

4267
      @SerializedName("revolut_pay")
×
4268
      REVOLUT_PAY("revolut_pay"),
4269

4270
      @SerializedName("sepa_credit_transfer")
×
4271
      SEPA_CREDIT_TRANSFER("sepa_credit_transfer"),
4272

4273
      @SerializedName("sepa_debit")
×
4274
      SEPA_DEBIT("sepa_debit"),
4275

4276
      @SerializedName("sofort")
×
4277
      SOFORT("sofort"),
4278

4279
      @SerializedName("swish")
×
4280
      SWISH("swish"),
4281

4282
      @SerializedName("us_bank_account")
×
4283
      US_BANK_ACCOUNT("us_bank_account"),
4284

4285
      @SerializedName("wechat_pay")
×
4286
      WECHAT_PAY("wechat_pay");
4287

4288
      @Getter(onMethod_ = {@Override})
4289
      private final String value;
4290

4291
      PaymentMethodType(String value) {
×
4292
        this.value = value;
×
4293
      }
×
4294
    }
4295
  }
4296

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

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

4317
    /** Invoice pdf rendering options. */
4318
    @SerializedName("pdf")
4319
    Pdf pdf;
4320

4321
    /** ID of the invoice rendering template to use for this invoice. */
4322
    @SerializedName("template")
4323
    Object template;
4324

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

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

4342
    public static Builder builder() {
4343
      return new Builder();
×
4344
    }
4345

4346
    public static class Builder {
×
4347
      private ApiRequestParams.EnumParam amountTaxDisplay;
4348

4349
      private Map<String, Object> extraParams;
4350

4351
      private Pdf pdf;
4352

4353
      private Object template;
4354

4355
      private Object templateVersion;
4356

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

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

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

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

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

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

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

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

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

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

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

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

4462
      private Pdf(Map<String, Object> extraParams, PageSize pageSize) {
×
4463
        this.extraParams = extraParams;
×
4464
        this.pageSize = pageSize;
×
4465
      }
×
4466

4467
      public static Builder builder() {
4468
        return new Builder();
×
4469
      }
4470

4471
      public static class Builder {
×
4472
        private Map<String, Object> extraParams;
4473

4474
        private PageSize pageSize;
4475

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

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

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

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

4520
      public enum PageSize implements ApiRequestParams.EnumParam {
×
4521
        @SerializedName("a4")
×
4522
        A4("a4"),
4523

4524
        @SerializedName("auto")
×
4525
        AUTO("auto"),
4526

4527
        @SerializedName("letter")
×
4528
        LETTER("letter");
4529

4530
        @Getter(onMethod_ = {@Override})
4531
        private final String value;
4532

4533
        PageSize(String value) {
×
4534
          this.value = value;
×
4535
        }
×
4536
      }
4537
    }
4538

4539
    public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
4540
      @SerializedName("exclude_tax")
×
4541
      EXCLUDE_TAX("exclude_tax"),
4542

4543
      @SerializedName("include_inclusive_tax")
×
4544
      INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
4545

4546
      @Getter(onMethod_ = {@Override})
4547
      private final String value;
4548

4549
      AmountTaxDisplay(String value) {
×
4550
        this.value = value;
×
4551
      }
×
4552
    }
4553
  }
4554

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

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

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

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

4581
    public static Builder builder() {
4582
      return new Builder();
×
4583
    }
4584

4585
    public static class Builder {
×
4586
      private Map<String, Object> extraParams;
4587

4588
      private Object shippingRate;
4589

4590
      private ShippingRateData shippingRateData;
4591

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

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

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

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

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

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

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

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

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

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

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

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

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

4699
      /** The type of calculation to use on the shipping rate. */
4700
      @SerializedName("type")
4701
      Type type;
4702

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

4722
      public static Builder builder() {
4723
        return new Builder();
×
4724
      }
4725

4726
      public static class Builder {
×
4727
        private DeliveryEstimate deliveryEstimate;
4728

4729
        private Object displayName;
4730

4731
        private Map<String, Object> extraParams;
4732

4733
        private FixedAmount fixedAmount;
4734

4735
        private Map<String, String> metadata;
4736

4737
        private TaxBehavior taxBehavior;
4738

4739
        private Object taxCode;
4740

4741
        private Type type;
4742

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4914
        public static Builder builder() {
4915
          return new Builder();
×
4916
        }
4917

4918
        public static class Builder {
×
4919
          private Map<String, Object> extraParams;
4920

4921
          private Maximum maximum;
4922

4923
          private Minimum minimum;
4924

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

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

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

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

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

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

4991
          /** <strong>Required.</strong> A unit of time. */
4992
          @SerializedName("unit")
4993
          Unit unit;
4994

4995
          /** <strong>Required.</strong> Must be greater than 0. */
4996
          @SerializedName("value")
4997
          Long value;
4998

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

5005
          public static Builder builder() {
5006
            return new Builder();
×
5007
          }
5008

5009
          public static class Builder {
×
5010
            private Map<String, Object> extraParams;
5011

5012
            private Unit unit;
5013

5014
            private Long value;
5015

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

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

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

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

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

5068
          public enum Unit implements ApiRequestParams.EnumParam {
×
5069
            @SerializedName("business_day")
×
5070
            BUSINESS_DAY("business_day"),
5071

5072
            @SerializedName("day")
×
5073
            DAY("day"),
5074

5075
            @SerializedName("hour")
×
5076
            HOUR("hour"),
5077

5078
            @SerializedName("month")
×
5079
            MONTH("month"),
5080

5081
            @SerializedName("week")
×
5082
            WEEK("week");
5083

5084
            @Getter(onMethod_ = {@Override})
5085
            private final String value;
5086

5087
            Unit(String value) {
×
5088
              this.value = value;
×
5089
            }
×
5090
          }
5091
        }
5092

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

5105
          /** <strong>Required.</strong> A unit of time. */
5106
          @SerializedName("unit")
5107
          Unit unit;
5108

5109
          /** <strong>Required.</strong> Must be greater than 0. */
5110
          @SerializedName("value")
5111
          Long value;
5112

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

5119
          public static Builder builder() {
5120
            return new Builder();
×
5121
          }
5122

5123
          public static class Builder {
×
5124
            private Map<String, Object> extraParams;
5125

5126
            private Unit unit;
5127

5128
            private Long value;
5129

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

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

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

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

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

5182
          public enum Unit implements ApiRequestParams.EnumParam {
×
5183
            @SerializedName("business_day")
×
5184
            BUSINESS_DAY("business_day"),
5185

5186
            @SerializedName("day")
×
5187
            DAY("day"),
5188

5189
            @SerializedName("hour")
×
5190
            HOUR("hour"),
5191

5192
            @SerializedName("month")
×
5193
            MONTH("month"),
5194

5195
            @SerializedName("week")
×
5196
            WEEK("week");
5197

5198
            @Getter(onMethod_ = {@Override})
5199
            private final String value;
5200

5201
            Unit(String value) {
×
5202
              this.value = value;
×
5203
            }
×
5204
          }
5205
        }
5206
      }
5207

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

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

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

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

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

5258
        public static Builder builder() {
5259
          return new Builder();
×
5260
        }
5261

5262
        public static class Builder {
×
5263
          private Long amount;
5264

5265
          private Object currency;
5266

5267
          private Map<
5268
                  String,
5269
                  InvoiceUpdateParams.ShippingCost.ShippingRateData.FixedAmount.CurrencyOption>
5270
              currencyOptions;
5271

5272
          private Map<String, Object> extraParams;
5273

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

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

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

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

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

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

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

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

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

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

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

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

5411
          public static Builder builder() {
5412
            return new Builder();
×
5413
          }
5414

5415
          public static class Builder {
×
5416
            private Long amount;
5417

5418
            private Map<String, Object> extraParams;
5419

5420
            private TaxBehavior taxBehavior;
5421

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

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

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

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

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

5481
          public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5482
            @SerializedName("exclusive")
×
5483
            EXCLUSIVE("exclusive"),
5484

5485
            @SerializedName("inclusive")
×
5486
            INCLUSIVE("inclusive"),
5487

5488
            @SerializedName("unspecified")
×
5489
            UNSPECIFIED("unspecified");
5490

5491
            @Getter(onMethod_ = {@Override})
5492
            private final String value;
5493

5494
            TaxBehavior(String value) {
×
5495
              this.value = value;
×
5496
            }
×
5497
          }
5498
        }
5499
      }
5500

5501
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
5502
        @SerializedName("exclusive")
×
5503
        EXCLUSIVE("exclusive"),
5504

5505
        @SerializedName("inclusive")
×
5506
        INCLUSIVE("inclusive"),
5507

5508
        @SerializedName("unspecified")
×
5509
        UNSPECIFIED("unspecified");
5510

5511
        @Getter(onMethod_ = {@Override})
5512
        private final String value;
5513

5514
        TaxBehavior(String value) {
×
5515
          this.value = value;
×
5516
        }
×
5517
      }
5518

5519
      public enum Type implements ApiRequestParams.EnumParam {
×
5520
        @SerializedName("fixed_amount")
×
5521
        FIXED_AMOUNT("fixed_amount");
5522

5523
        @Getter(onMethod_ = {@Override})
5524
        private final String value;
5525

5526
        Type(String value) {
×
5527
          this.value = value;
×
5528
        }
×
5529
      }
5530
    }
5531
  }
5532

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

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

5548
    /** <strong>Required.</strong> Recipient name. */
5549
    @SerializedName("name")
5550
    Object name;
5551

5552
    /** Recipient phone (including extension). */
5553
    @SerializedName("phone")
5554
    Object phone;
5555

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

5564
    public static Builder builder() {
5565
      return new Builder();
×
5566
    }
5567

5568
    public static class Builder {
×
5569
      private Address address;
5570

5571
      private Map<String, Object> extraParams;
5572

5573
      private Object name;
5574

5575
      private Object phone;
5576

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

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

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

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

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

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

5627
      /** Recipient phone (including extension). */
5628
      public Builder setPhone(String phone) {
5629
        this.phone = phone;
×
5630
        return this;
×
5631
      }
5632

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

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

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

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

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

5666
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
5667
      @SerializedName("line2")
5668
      Object line2;
5669

5670
      /** ZIP or postal code. */
5671
      @SerializedName("postal_code")
5672
      Object postalCode;
5673

5674
      /** State, county, province, or region. */
5675
      @SerializedName("state")
5676
      Object state;
5677

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

5695
      public static Builder builder() {
5696
        return new Builder();
×
5697
      }
5698

5699
      public static class Builder {
×
5700
        private Object city;
5701

5702
        private Object country;
5703

5704
        private Map<String, Object> extraParams;
5705

5706
        private Object line1;
5707

5708
        private Object line2;
5709

5710
        private Object postalCode;
5711

5712
        private Object state;
5713

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5863
    public static Builder builder() {
5864
      return new Builder();
×
5865
    }
5866

5867
    public static class Builder {
×
5868
      private Long amount;
5869

5870
      private Object destination;
5871

5872
      private Map<String, Object> extraParams;
5873

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

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

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

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

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

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

5929
  public enum CollectionMethod implements ApiRequestParams.EnumParam {
×
5930
    @SerializedName("charge_automatically")
×
5931
    CHARGE_AUTOMATICALLY("charge_automatically"),
5932

5933
    @SerializedName("send_invoice")
×
5934
    SEND_INVOICE("send_invoice");
5935

5936
    @Getter(onMethod_ = {@Override})
5937
    private final String value;
5938

5939
    CollectionMethod(String value) {
×
5940
      this.value = value;
×
5941
    }
×
5942
  }
5943
}
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