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

stripe / stripe-java / #16562

18 Oct 2024 07:00PM UTC coverage: 12.614% (-0.1%) from 12.74%
#16562

push

github

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

Update generated code for beta

49 of 1978 new or added lines in 47 files covered. (2.48%)

68 existing lines in 20 files now uncovered.

18798 of 149026 relevant lines covered (12.61%)

0.13 hits per line

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

7.52
/src/main/java/com/stripe/param/CustomerUpdateParams.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 CustomerUpdateParams extends ApiRequestParams {
15
  /** The customer's address. */
16
  @SerializedName("address")
17
  Object address;
18

19
  /**
20
   * An integer amount in cents (or local equivalent) that represents the customer's current
21
   * balance, which affect the customer's future invoices. A negative amount represents a credit
22
   * that decreases the amount due on an invoice; a positive amount increases the amount due on an
23
   * invoice.
24
   */
25
  @SerializedName("balance")
26
  Long balance;
27

28
  /** Balance information and default balance settings for this customer. */
29
  @SerializedName("cash_balance")
30
  CashBalance cashBalance;
31

32
  @SerializedName("coupon")
33
  Object coupon;
34

35
  /**
36
   * If you are using payment methods created via the PaymentMethods API, see the <a
37
   * href="https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a>
38
   * parameter.
39
   *
40
   * <p>Provide the ID of a payment source already attached to this customer to make it this
41
   * customer's default payment source.
42
   *
43
   * <p>If you want to add a new payment source and make it the default, see the <a
44
   * href="https://stripe.com/docs/api/customers/update#update_customer-source">source</a> property.
45
   */
46
  @SerializedName("default_source")
47
  Object defaultSource;
48

49
  /**
50
   * An arbitrary string that you can attach to a customer object. It is displayed alongside the
51
   * customer in the dashboard.
52
   */
53
  @SerializedName("description")
54
  Object description;
55

56
  /**
57
   * Customer's email address. It's displayed alongside the customer in your dashboard and can be
58
   * useful for searching and tracking. This may be up to <em>512 characters</em>.
59
   */
60
  @SerializedName("email")
61
  Object email;
62

63
  /** Specifies which fields in the response should be expanded. */
64
  @SerializedName("expand")
65
  List<String> expand;
66

67
  /**
68
   * Map of extra parameters for custom features not available in this client library. The content
69
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
70
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
71
   * param object. Effectively, this map is flattened to its parent instance.
72
   */
73
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
74
  Map<String, Object> extraParams;
75

76
  /**
77
   * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase
78
   * letters or numbers.
79
   */
80
  @SerializedName("invoice_prefix")
81
  Object invoicePrefix;
82

83
  /** Default invoice settings for this customer. */
84
  @SerializedName("invoice_settings")
85
  InvoiceSettings invoiceSettings;
86

87
  /**
88
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
89
   * to an object. This can be useful for storing additional information about the object in a
90
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
91
   * be unset by posting an empty value to {@code metadata}.
92
   */
93
  @SerializedName("metadata")
94
  Object metadata;
95

96
  /** The customer's full name or business name. */
97
  @SerializedName("name")
98
  Object name;
99

100
  /** The sequence to be used on the customer's next invoice. Defaults to 1. */
101
  @SerializedName("next_invoice_sequence")
102
  Long nextInvoiceSequence;
103

104
  /** The customer's phone number. */
105
  @SerializedName("phone")
106
  Object phone;
107

108
  /** Customer's preferred languages, ordered by preference. */
109
  @SerializedName("preferred_locales")
110
  List<String> preferredLocales;
111

112
  /**
113
   * The ID of a promotion code to apply to the customer. The customer will have a discount applied
114
   * on all recurring payments. Charges you create through the API will not have the discount.
115
   */
116
  @SerializedName("promotion_code")
117
  Object promotionCode;
118

119
  /** The customer's shipping information. Appears on invoices emailed to this customer. */
120
  @SerializedName("shipping")
121
  Object shipping;
122

123
  @SerializedName("source")
124
  Object source;
125

126
  /** Tax details about the customer. */
127
  @SerializedName("tax")
128
  Tax tax;
129

130
  /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */
131
  @SerializedName("tax_exempt")
132
  ApiRequestParams.EnumParam taxExempt;
133

134
  @SerializedName("validate")
135
  Boolean validate;
136

137
  private CustomerUpdateParams(
138
      Object address,
139
      Long balance,
140
      CashBalance cashBalance,
141
      Object coupon,
142
      Object defaultSource,
143
      Object description,
144
      Object email,
145
      List<String> expand,
146
      Map<String, Object> extraParams,
147
      Object invoicePrefix,
148
      InvoiceSettings invoiceSettings,
149
      Object metadata,
150
      Object name,
151
      Long nextInvoiceSequence,
152
      Object phone,
153
      List<String> preferredLocales,
154
      Object promotionCode,
155
      Object shipping,
156
      Object source,
157
      Tax tax,
158
      ApiRequestParams.EnumParam taxExempt,
159
      Boolean validate) {
1✔
160
    this.address = address;
1✔
161
    this.balance = balance;
1✔
162
    this.cashBalance = cashBalance;
1✔
163
    this.coupon = coupon;
1✔
164
    this.defaultSource = defaultSource;
1✔
165
    this.description = description;
1✔
166
    this.email = email;
1✔
167
    this.expand = expand;
1✔
168
    this.extraParams = extraParams;
1✔
169
    this.invoicePrefix = invoicePrefix;
1✔
170
    this.invoiceSettings = invoiceSettings;
1✔
171
    this.metadata = metadata;
1✔
172
    this.name = name;
1✔
173
    this.nextInvoiceSequence = nextInvoiceSequence;
1✔
174
    this.phone = phone;
1✔
175
    this.preferredLocales = preferredLocales;
1✔
176
    this.promotionCode = promotionCode;
1✔
177
    this.shipping = shipping;
1✔
178
    this.source = source;
1✔
179
    this.tax = tax;
1✔
180
    this.taxExempt = taxExempt;
1✔
181
    this.validate = validate;
1✔
182
  }
1✔
183

184
  public static Builder builder() {
185
    return new Builder();
1✔
186
  }
187

188
  public static class Builder {
1✔
189
    private Object address;
190

191
    private Long balance;
192

193
    private CashBalance cashBalance;
194

195
    private Object coupon;
196

197
    private Object defaultSource;
198

199
    private Object description;
200

201
    private Object email;
202

203
    private List<String> expand;
204

205
    private Map<String, Object> extraParams;
206

207
    private Object invoicePrefix;
208

209
    private InvoiceSettings invoiceSettings;
210

211
    private Object metadata;
212

213
    private Object name;
214

215
    private Long nextInvoiceSequence;
216

217
    private Object phone;
218

219
    private List<String> preferredLocales;
220

221
    private Object promotionCode;
222

223
    private Object shipping;
224

225
    private Object source;
226

227
    private Tax tax;
228

229
    private ApiRequestParams.EnumParam taxExempt;
230

231
    private Boolean validate;
232

233
    /** Finalize and obtain parameter instance from this builder. */
234
    public CustomerUpdateParams build() {
235
      return new CustomerUpdateParams(
1✔
236
          this.address,
237
          this.balance,
238
          this.cashBalance,
239
          this.coupon,
240
          this.defaultSource,
241
          this.description,
242
          this.email,
243
          this.expand,
244
          this.extraParams,
245
          this.invoicePrefix,
246
          this.invoiceSettings,
247
          this.metadata,
248
          this.name,
249
          this.nextInvoiceSequence,
250
          this.phone,
251
          this.preferredLocales,
252
          this.promotionCode,
253
          this.shipping,
254
          this.source,
255
          this.tax,
256
          this.taxExempt,
257
          this.validate);
258
    }
259

260
    /** The customer's address. */
261
    public Builder setAddress(CustomerUpdateParams.Address address) {
262
      this.address = address;
×
263
      return this;
×
264
    }
265

266
    /** The customer's address. */
267
    public Builder setAddress(EmptyParam address) {
268
      this.address = address;
×
269
      return this;
×
270
    }
271

272
    /**
273
     * An integer amount in cents (or local equivalent) that represents the customer's current
274
     * balance, which affect the customer's future invoices. A negative amount represents a credit
275
     * that decreases the amount due on an invoice; a positive amount increases the amount due on an
276
     * invoice.
277
     */
278
    public Builder setBalance(Long balance) {
279
      this.balance = balance;
×
280
      return this;
×
281
    }
282

283
    /** Balance information and default balance settings for this customer. */
284
    public Builder setCashBalance(CustomerUpdateParams.CashBalance cashBalance) {
285
      this.cashBalance = cashBalance;
×
286
      return this;
×
287
    }
288

289
    public Builder setCoupon(String coupon) {
290
      this.coupon = coupon;
×
291
      return this;
×
292
    }
293

294
    public Builder setCoupon(EmptyParam coupon) {
295
      this.coupon = coupon;
×
296
      return this;
×
297
    }
298

299
    /**
300
     * If you are using payment methods created via the PaymentMethods API, see the <a
301
     * href="https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a>
302
     * parameter.
303
     *
304
     * <p>Provide the ID of a payment source already attached to this customer to make it this
305
     * customer's default payment source.
306
     *
307
     * <p>If you want to add a new payment source and make it the default, see the <a
308
     * href="https://stripe.com/docs/api/customers/update#update_customer-source">source</a>
309
     * property.
310
     */
311
    public Builder setDefaultSource(String defaultSource) {
312
      this.defaultSource = defaultSource;
×
313
      return this;
×
314
    }
315

316
    /**
317
     * If you are using payment methods created via the PaymentMethods API, see the <a
318
     * href="https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a>
319
     * parameter.
320
     *
321
     * <p>Provide the ID of a payment source already attached to this customer to make it this
322
     * customer's default payment source.
323
     *
324
     * <p>If you want to add a new payment source and make it the default, see the <a
325
     * href="https://stripe.com/docs/api/customers/update#update_customer-source">source</a>
326
     * property.
327
     */
328
    public Builder setDefaultSource(EmptyParam defaultSource) {
329
      this.defaultSource = defaultSource;
×
330
      return this;
×
331
    }
332

333
    /**
334
     * An arbitrary string that you can attach to a customer object. It is displayed alongside the
335
     * customer in the dashboard.
336
     */
337
    public Builder setDescription(String description) {
338
      this.description = description;
×
339
      return this;
×
340
    }
341

342
    /**
343
     * An arbitrary string that you can attach to a customer object. It is displayed alongside the
344
     * customer in the dashboard.
345
     */
346
    public Builder setDescription(EmptyParam description) {
347
      this.description = description;
×
348
      return this;
×
349
    }
350

351
    /**
352
     * Customer's email address. It's displayed alongside the customer in your dashboard and can be
353
     * useful for searching and tracking. This may be up to <em>512 characters</em>.
354
     */
355
    public Builder setEmail(String email) {
356
      this.email = email;
×
357
      return this;
×
358
    }
359

360
    /**
361
     * Customer's email address. It's displayed alongside the customer in your dashboard and can be
362
     * useful for searching and tracking. This may be up to <em>512 characters</em>.
363
     */
364
    public Builder setEmail(EmptyParam email) {
365
      this.email = email;
×
366
      return this;
×
367
    }
368

369
    /**
370
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
371
     * subsequent calls adds additional elements to the original list. See {@link
372
     * CustomerUpdateParams#expand} for the field documentation.
373
     */
374
    public Builder addExpand(String element) {
375
      if (this.expand == null) {
×
376
        this.expand = new ArrayList<>();
×
377
      }
378
      this.expand.add(element);
×
379
      return this;
×
380
    }
381

382
    /**
383
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
384
     * subsequent calls adds additional elements to the original list. See {@link
385
     * CustomerUpdateParams#expand} for the field documentation.
386
     */
387
    public Builder addAllExpand(List<String> elements) {
388
      if (this.expand == null) {
×
389
        this.expand = new ArrayList<>();
×
390
      }
391
      this.expand.addAll(elements);
×
392
      return this;
×
393
    }
394

395
    /**
396
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
397
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
398
     * CustomerUpdateParams#extraParams} for the field documentation.
399
     */
400
    public Builder putExtraParam(String key, Object value) {
401
      if (this.extraParams == null) {
×
402
        this.extraParams = new HashMap<>();
×
403
      }
404
      this.extraParams.put(key, value);
×
405
      return this;
×
406
    }
407

408
    /**
409
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
410
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
411
     * See {@link CustomerUpdateParams#extraParams} for the field documentation.
412
     */
413
    public Builder putAllExtraParam(Map<String, Object> map) {
414
      if (this.extraParams == null) {
×
415
        this.extraParams = new HashMap<>();
×
416
      }
417
      this.extraParams.putAll(map);
×
418
      return this;
×
419
    }
420

421
    /**
422
     * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase
423
     * letters or numbers.
424
     */
425
    public Builder setInvoicePrefix(String invoicePrefix) {
426
      this.invoicePrefix = invoicePrefix;
×
427
      return this;
×
428
    }
429

430
    /**
431
     * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase
432
     * letters or numbers.
433
     */
434
    public Builder setInvoicePrefix(EmptyParam invoicePrefix) {
435
      this.invoicePrefix = invoicePrefix;
×
436
      return this;
×
437
    }
438

439
    /** Default invoice settings for this customer. */
440
    public Builder setInvoiceSettings(CustomerUpdateParams.InvoiceSettings invoiceSettings) {
441
      this.invoiceSettings = invoiceSettings;
×
442
      return this;
×
443
    }
444

445
    /**
446
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
447
     * and subsequent calls add additional key/value pairs to the original map. See {@link
448
     * CustomerUpdateParams#metadata} for the field documentation.
449
     */
450
    @SuppressWarnings("unchecked")
451
    public Builder putMetadata(String key, String value) {
452
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
1✔
453
        this.metadata = new HashMap<String, String>();
1✔
454
      }
455
      ((Map<String, String>) this.metadata).put(key, value);
1✔
456
      return this;
1✔
457
    }
458

459
    /**
460
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
461
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
462
     * See {@link CustomerUpdateParams#metadata} for the field documentation.
463
     */
464
    @SuppressWarnings("unchecked")
465
    public Builder putAllMetadata(Map<String, String> map) {
466
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
467
        this.metadata = new HashMap<String, String>();
×
468
      }
469
      ((Map<String, String>) this.metadata).putAll(map);
×
470
      return this;
×
471
    }
472

473
    /**
474
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
475
     * to an object. This can be useful for storing additional information about the object in a
476
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
477
     * can be unset by posting an empty value to {@code metadata}.
478
     */
479
    public Builder setMetadata(EmptyParam metadata) {
480
      this.metadata = metadata;
×
481
      return this;
×
482
    }
483

484
    /**
485
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
486
     * to an object. This can be useful for storing additional information about the object in a
487
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
488
     * can be unset by posting an empty value to {@code metadata}.
489
     */
490
    public Builder setMetadata(Map<String, String> metadata) {
491
      this.metadata = metadata;
×
492
      return this;
×
493
    }
494

495
    /** The customer's full name or business name. */
496
    public Builder setName(String name) {
497
      this.name = name;
×
498
      return this;
×
499
    }
500

501
    /** The customer's full name or business name. */
502
    public Builder setName(EmptyParam name) {
503
      this.name = name;
×
504
      return this;
×
505
    }
506

507
    /** The sequence to be used on the customer's next invoice. Defaults to 1. */
508
    public Builder setNextInvoiceSequence(Long nextInvoiceSequence) {
509
      this.nextInvoiceSequence = nextInvoiceSequence;
×
510
      return this;
×
511
    }
512

513
    /** The customer's phone number. */
514
    public Builder setPhone(String phone) {
515
      this.phone = phone;
×
516
      return this;
×
517
    }
518

519
    /** The customer's phone number. */
520
    public Builder setPhone(EmptyParam phone) {
521
      this.phone = phone;
×
522
      return this;
×
523
    }
524

525
    /**
526
     * Add an element to `preferredLocales` list. A list is initialized for the first `add/addAll`
527
     * call, and subsequent calls adds additional elements to the original list. See {@link
528
     * CustomerUpdateParams#preferredLocales} for the field documentation.
529
     */
530
    public Builder addPreferredLocale(String element) {
531
      if (this.preferredLocales == null) {
×
532
        this.preferredLocales = new ArrayList<>();
×
533
      }
534
      this.preferredLocales.add(element);
×
535
      return this;
×
536
    }
537

538
    /**
539
     * Add all elements to `preferredLocales` list. A list is initialized for the first `add/addAll`
540
     * call, and subsequent calls adds additional elements to the original list. See {@link
541
     * CustomerUpdateParams#preferredLocales} for the field documentation.
542
     */
543
    public Builder addAllPreferredLocale(List<String> elements) {
544
      if (this.preferredLocales == null) {
×
545
        this.preferredLocales = new ArrayList<>();
×
546
      }
547
      this.preferredLocales.addAll(elements);
×
548
      return this;
×
549
    }
550

551
    /**
552
     * The ID of a promotion code to apply to the customer. The customer will have a discount
553
     * applied on all recurring payments. Charges you create through the API will not have the
554
     * discount.
555
     */
556
    public Builder setPromotionCode(String promotionCode) {
557
      this.promotionCode = promotionCode;
×
558
      return this;
×
559
    }
560

561
    /**
562
     * The ID of a promotion code to apply to the customer. The customer will have a discount
563
     * applied on all recurring payments. Charges you create through the API will not have the
564
     * discount.
565
     */
566
    public Builder setPromotionCode(EmptyParam promotionCode) {
567
      this.promotionCode = promotionCode;
×
568
      return this;
×
569
    }
570

571
    /** The customer's shipping information. Appears on invoices emailed to this customer. */
572
    public Builder setShipping(CustomerUpdateParams.Shipping shipping) {
573
      this.shipping = shipping;
×
574
      return this;
×
575
    }
576

577
    /** The customer's shipping information. Appears on invoices emailed to this customer. */
578
    public Builder setShipping(EmptyParam shipping) {
579
      this.shipping = shipping;
×
580
      return this;
×
581
    }
582

583
    public Builder setSource(String source) {
584
      this.source = source;
×
585
      return this;
×
586
    }
587

588
    public Builder setSource(EmptyParam source) {
589
      this.source = source;
×
590
      return this;
×
591
    }
592

593
    /** Tax details about the customer. */
594
    public Builder setTax(CustomerUpdateParams.Tax tax) {
595
      this.tax = tax;
×
596
      return this;
×
597
    }
598

599
    /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */
600
    public Builder setTaxExempt(CustomerUpdateParams.TaxExempt taxExempt) {
601
      this.taxExempt = taxExempt;
×
602
      return this;
×
603
    }
604

605
    /** The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}. */
606
    public Builder setTaxExempt(EmptyParam taxExempt) {
607
      this.taxExempt = taxExempt;
×
608
      return this;
×
609
    }
610

611
    public Builder setValidate(Boolean validate) {
612
      this.validate = validate;
×
613
      return this;
×
614
    }
615
  }
616

617
  @Getter
618
  public static class Address {
619
    /** City, district, suburb, town, or village. */
620
    @SerializedName("city")
621
    Object city;
622

623
    /**
624
     * A freeform text field for the country. However, in order to activate some tax features, the
625
     * format should be a two-letter country code (<a
626
     * href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>).
627
     */
628
    @SerializedName("country")
629
    Object country;
630

631
    /**
632
     * Map of extra parameters for custom features not available in this client library. The content
633
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
634
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
635
     * param object. Effectively, this map is flattened to its parent instance.
636
     */
637
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
638
    Map<String, Object> extraParams;
639

640
    /** Address line 1 (e.g., street, PO Box, or company name). */
641
    @SerializedName("line1")
642
    Object line1;
643

644
    /** Address line 2 (e.g., apartment, suite, unit, or building). */
645
    @SerializedName("line2")
646
    Object line2;
647

648
    /** ZIP or postal code. */
649
    @SerializedName("postal_code")
650
    Object postalCode;
651

652
    /** State, county, province, or region. */
653
    @SerializedName("state")
654
    Object state;
655

656
    private Address(
657
        Object city,
658
        Object country,
659
        Map<String, Object> extraParams,
660
        Object line1,
661
        Object line2,
662
        Object postalCode,
663
        Object state) {
×
664
      this.city = city;
×
665
      this.country = country;
×
666
      this.extraParams = extraParams;
×
667
      this.line1 = line1;
×
668
      this.line2 = line2;
×
669
      this.postalCode = postalCode;
×
670
      this.state = state;
×
671
    }
×
672

673
    public static Builder builder() {
674
      return new Builder();
×
675
    }
676

677
    public static class Builder {
×
678
      private Object city;
679

680
      private Object country;
681

682
      private Map<String, Object> extraParams;
683

684
      private Object line1;
685

686
      private Object line2;
687

688
      private Object postalCode;
689

690
      private Object state;
691

692
      /** Finalize and obtain parameter instance from this builder. */
693
      public CustomerUpdateParams.Address build() {
694
        return new CustomerUpdateParams.Address(
×
695
            this.city,
696
            this.country,
697
            this.extraParams,
698
            this.line1,
699
            this.line2,
700
            this.postalCode,
701
            this.state);
702
      }
703

704
      /** City, district, suburb, town, or village. */
705
      public Builder setCity(String city) {
706
        this.city = city;
×
707
        return this;
×
708
      }
709

710
      /** City, district, suburb, town, or village. */
711
      public Builder setCity(EmptyParam city) {
712
        this.city = city;
×
713
        return this;
×
714
      }
715

716
      /**
717
       * A freeform text field for the country. However, in order to activate some tax features, the
718
       * format should be a two-letter country code (<a
719
       * href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>).
720
       */
721
      public Builder setCountry(String country) {
722
        this.country = country;
×
723
        return this;
×
724
      }
725

726
      /**
727
       * A freeform text field for the country. However, in order to activate some tax features, the
728
       * format should be a two-letter country code (<a
729
       * href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>).
730
       */
731
      public Builder setCountry(EmptyParam country) {
732
        this.country = country;
×
733
        return this;
×
734
      }
735

736
      /**
737
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
738
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
739
       * CustomerUpdateParams.Address#extraParams} for the field documentation.
740
       */
741
      public Builder putExtraParam(String key, Object value) {
742
        if (this.extraParams == null) {
×
743
          this.extraParams = new HashMap<>();
×
744
        }
745
        this.extraParams.put(key, value);
×
746
        return this;
×
747
      }
748

749
      /**
750
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
751
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
752
       * See {@link CustomerUpdateParams.Address#extraParams} for the field documentation.
753
       */
754
      public Builder putAllExtraParam(Map<String, Object> map) {
755
        if (this.extraParams == null) {
×
756
          this.extraParams = new HashMap<>();
×
757
        }
758
        this.extraParams.putAll(map);
×
759
        return this;
×
760
      }
761

762
      /** Address line 1 (e.g., street, PO Box, or company name). */
763
      public Builder setLine1(String line1) {
764
        this.line1 = line1;
×
765
        return this;
×
766
      }
767

768
      /** Address line 1 (e.g., street, PO Box, or company name). */
769
      public Builder setLine1(EmptyParam line1) {
770
        this.line1 = line1;
×
771
        return this;
×
772
      }
773

774
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
775
      public Builder setLine2(String line2) {
776
        this.line2 = line2;
×
777
        return this;
×
778
      }
779

780
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
781
      public Builder setLine2(EmptyParam line2) {
782
        this.line2 = line2;
×
783
        return this;
×
784
      }
785

786
      /** ZIP or postal code. */
787
      public Builder setPostalCode(String postalCode) {
788
        this.postalCode = postalCode;
×
789
        return this;
×
790
      }
791

792
      /** ZIP or postal code. */
793
      public Builder setPostalCode(EmptyParam postalCode) {
794
        this.postalCode = postalCode;
×
795
        return this;
×
796
      }
797

798
      /** State, county, province, or region. */
799
      public Builder setState(String state) {
800
        this.state = state;
×
801
        return this;
×
802
      }
803

804
      /** State, county, province, or region. */
805
      public Builder setState(EmptyParam state) {
806
        this.state = state;
×
807
        return this;
×
808
      }
809
    }
810
  }
811

812
  @Getter
813
  public static class CashBalance {
814
    /**
815
     * Map of extra parameters for custom features not available in this client library. The content
816
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
817
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
818
     * param object. Effectively, this map is flattened to its parent instance.
819
     */
820
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
821
    Map<String, Object> extraParams;
822

823
    /**
824
     * Settings controlling the behavior of the customer's cash balance, such as reconciliation of
825
     * funds received.
826
     */
827
    @SerializedName("settings")
828
    Settings settings;
829

830
    private CashBalance(Map<String, Object> extraParams, Settings settings) {
×
831
      this.extraParams = extraParams;
×
832
      this.settings = settings;
×
833
    }
×
834

835
    public static Builder builder() {
836
      return new Builder();
×
837
    }
838

839
    public static class Builder {
×
840
      private Map<String, Object> extraParams;
841

842
      private Settings settings;
843

844
      /** Finalize and obtain parameter instance from this builder. */
845
      public CustomerUpdateParams.CashBalance build() {
846
        return new CustomerUpdateParams.CashBalance(this.extraParams, this.settings);
×
847
      }
848

849
      /**
850
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
851
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
852
       * CustomerUpdateParams.CashBalance#extraParams} for the field documentation.
853
       */
854
      public Builder putExtraParam(String key, Object value) {
855
        if (this.extraParams == null) {
×
856
          this.extraParams = new HashMap<>();
×
857
        }
858
        this.extraParams.put(key, value);
×
859
        return this;
×
860
      }
861

862
      /**
863
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
864
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
865
       * See {@link CustomerUpdateParams.CashBalance#extraParams} for the field documentation.
866
       */
867
      public Builder putAllExtraParam(Map<String, Object> map) {
868
        if (this.extraParams == null) {
×
869
          this.extraParams = new HashMap<>();
×
870
        }
871
        this.extraParams.putAll(map);
×
872
        return this;
×
873
      }
874

875
      /**
876
       * Settings controlling the behavior of the customer's cash balance, such as reconciliation of
877
       * funds received.
878
       */
879
      public Builder setSettings(CustomerUpdateParams.CashBalance.Settings settings) {
880
        this.settings = settings;
×
881
        return this;
×
882
      }
883
    }
884

885
    @Getter
886
    public static class Settings {
887
      /**
888
       * Map of extra parameters for custom features not available in this client library. The
889
       * content in this map is not serialized under this field's {@code @SerializedName} value.
890
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
891
       * name in this param object. Effectively, this map is flattened to its parent instance.
892
       */
893
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
894
      Map<String, Object> extraParams;
895

896
      /**
897
       * Controls how funds transferred by the customer are applied to payment intents and invoices.
898
       * Valid options are {@code automatic}, {@code manual}, or {@code merchant_default}. For more
899
       * information about these reconciliation modes, see <a
900
       * href="https://stripe.com/docs/payments/customer-balance/reconciliation">Reconciliation</a>.
901
       */
902
      @SerializedName("reconciliation_mode")
903
      ReconciliationMode reconciliationMode;
904

905
      private Settings(Map<String, Object> extraParams, ReconciliationMode reconciliationMode) {
×
906
        this.extraParams = extraParams;
×
907
        this.reconciliationMode = reconciliationMode;
×
908
      }
×
909

910
      public static Builder builder() {
911
        return new Builder();
×
912
      }
913

914
      public static class Builder {
×
915
        private Map<String, Object> extraParams;
916

917
        private ReconciliationMode reconciliationMode;
918

919
        /** Finalize and obtain parameter instance from this builder. */
920
        public CustomerUpdateParams.CashBalance.Settings build() {
921
          return new CustomerUpdateParams.CashBalance.Settings(
×
922
              this.extraParams, this.reconciliationMode);
923
        }
924

925
        /**
926
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
927
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
928
         * map. See {@link CustomerUpdateParams.CashBalance.Settings#extraParams} for the field
929
         * documentation.
930
         */
931
        public Builder putExtraParam(String key, Object value) {
932
          if (this.extraParams == null) {
×
933
            this.extraParams = new HashMap<>();
×
934
          }
935
          this.extraParams.put(key, value);
×
936
          return this;
×
937
        }
938

939
        /**
940
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
941
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
942
         * map. See {@link CustomerUpdateParams.CashBalance.Settings#extraParams} for the field
943
         * documentation.
944
         */
945
        public Builder putAllExtraParam(Map<String, Object> map) {
946
          if (this.extraParams == null) {
×
947
            this.extraParams = new HashMap<>();
×
948
          }
949
          this.extraParams.putAll(map);
×
950
          return this;
×
951
        }
952

953
        /**
954
         * Controls how funds transferred by the customer are applied to payment intents and
955
         * invoices. Valid options are {@code automatic}, {@code manual}, or {@code
956
         * merchant_default}. For more information about these reconciliation modes, see <a
957
         * href="https://stripe.com/docs/payments/customer-balance/reconciliation">Reconciliation</a>.
958
         */
959
        public Builder setReconciliationMode(
960
            CustomerUpdateParams.CashBalance.Settings.ReconciliationMode reconciliationMode) {
961
          this.reconciliationMode = reconciliationMode;
×
962
          return this;
×
963
        }
964
      }
965

966
      public enum ReconciliationMode implements ApiRequestParams.EnumParam {
×
967
        @SerializedName("automatic")
×
968
        AUTOMATIC("automatic"),
969

970
        @SerializedName("manual")
×
971
        MANUAL("manual"),
972

973
        @SerializedName("merchant_default")
×
974
        MERCHANT_DEFAULT("merchant_default");
975

976
        @Getter(onMethod_ = {@Override})
977
        private final String value;
978

979
        ReconciliationMode(String value) {
×
980
          this.value = value;
×
981
        }
×
982
      }
983
    }
984
  }
985

986
  @Getter
987
  public static class InvoiceSettings {
988
    /**
989
     * The list of up to 4 default custom fields to be displayed on invoices for this customer. When
990
     * updating, pass an empty string to remove previously-defined fields.
991
     */
992
    @SerializedName("custom_fields")
993
    Object customFields;
994

995
    /**
996
     * ID of a payment method that's attached to the customer, to be used as the customer's default
997
     * payment method for subscriptions and invoices.
998
     */
999
    @SerializedName("default_payment_method")
1000
    Object defaultPaymentMethod;
1001

1002
    /**
1003
     * Map of extra parameters for custom features not available in this client library. The content
1004
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1005
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1006
     * param object. Effectively, this map is flattened to its parent instance.
1007
     */
1008
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1009
    Map<String, Object> extraParams;
1010

1011
    /** Default footer to be displayed on invoices for this customer. */
1012
    @SerializedName("footer")
1013
    Object footer;
1014

1015
    /** Default options for invoice PDF rendering for this customer. */
1016
    @SerializedName("rendering_options")
1017
    Object renderingOptions;
1018

1019
    private InvoiceSettings(
1020
        Object customFields,
1021
        Object defaultPaymentMethod,
1022
        Map<String, Object> extraParams,
1023
        Object footer,
1024
        Object renderingOptions) {
×
1025
      this.customFields = customFields;
×
1026
      this.defaultPaymentMethod = defaultPaymentMethod;
×
1027
      this.extraParams = extraParams;
×
1028
      this.footer = footer;
×
1029
      this.renderingOptions = renderingOptions;
×
1030
    }
×
1031

1032
    public static Builder builder() {
1033
      return new Builder();
×
1034
    }
1035

1036
    public static class Builder {
×
1037
      private Object customFields;
1038

1039
      private Object defaultPaymentMethod;
1040

1041
      private Map<String, Object> extraParams;
1042

1043
      private Object footer;
1044

1045
      private Object renderingOptions;
1046

1047
      /** Finalize and obtain parameter instance from this builder. */
1048
      public CustomerUpdateParams.InvoiceSettings build() {
1049
        return new CustomerUpdateParams.InvoiceSettings(
×
1050
            this.customFields,
1051
            this.defaultPaymentMethod,
1052
            this.extraParams,
1053
            this.footer,
1054
            this.renderingOptions);
1055
      }
1056

1057
      /**
1058
       * Add an element to `customFields` list. A list is initialized for the first `add/addAll`
1059
       * call, and subsequent calls adds additional elements to the original list. See {@link
1060
       * CustomerUpdateParams.InvoiceSettings#customFields} for the field documentation.
1061
       */
1062
      @SuppressWarnings("unchecked")
1063
      public Builder addCustomField(CustomerUpdateParams.InvoiceSettings.CustomField element) {
1064
        if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
1065
          this.customFields = new ArrayList<CustomerUpdateParams.InvoiceSettings.CustomField>();
×
1066
        }
1067
        ((List<CustomerUpdateParams.InvoiceSettings.CustomField>) this.customFields).add(element);
×
1068
        return this;
×
1069
      }
1070

1071
      /**
1072
       * Add all elements to `customFields` list. A list is initialized for the first `add/addAll`
1073
       * call, and subsequent calls adds additional elements to the original list. See {@link
1074
       * CustomerUpdateParams.InvoiceSettings#customFields} for the field documentation.
1075
       */
1076
      @SuppressWarnings("unchecked")
1077
      public Builder addAllCustomField(
1078
          List<CustomerUpdateParams.InvoiceSettings.CustomField> elements) {
1079
        if (this.customFields == null || this.customFields instanceof EmptyParam) {
×
1080
          this.customFields = new ArrayList<CustomerUpdateParams.InvoiceSettings.CustomField>();
×
1081
        }
1082
        ((List<CustomerUpdateParams.InvoiceSettings.CustomField>) this.customFields)
×
1083
            .addAll(elements);
×
1084
        return this;
×
1085
      }
1086

1087
      /**
1088
       * The list of up to 4 default custom fields to be displayed on invoices for this customer.
1089
       * When updating, pass an empty string to remove previously-defined fields.
1090
       */
1091
      public Builder setCustomFields(EmptyParam customFields) {
1092
        this.customFields = customFields;
×
1093
        return this;
×
1094
      }
1095

1096
      /**
1097
       * The list of up to 4 default custom fields to be displayed on invoices for this customer.
1098
       * When updating, pass an empty string to remove previously-defined fields.
1099
       */
1100
      public Builder setCustomFields(
1101
          List<CustomerUpdateParams.InvoiceSettings.CustomField> customFields) {
1102
        this.customFields = customFields;
×
1103
        return this;
×
1104
      }
1105

1106
      /**
1107
       * ID of a payment method that's attached to the customer, to be used as the customer's
1108
       * default payment method for subscriptions and invoices.
1109
       */
1110
      public Builder setDefaultPaymentMethod(String defaultPaymentMethod) {
1111
        this.defaultPaymentMethod = defaultPaymentMethod;
×
1112
        return this;
×
1113
      }
1114

1115
      /**
1116
       * ID of a payment method that's attached to the customer, to be used as the customer's
1117
       * default payment method for subscriptions and invoices.
1118
       */
1119
      public Builder setDefaultPaymentMethod(EmptyParam defaultPaymentMethod) {
1120
        this.defaultPaymentMethod = defaultPaymentMethod;
×
1121
        return this;
×
1122
      }
1123

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

1137
      /**
1138
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1139
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1140
       * See {@link CustomerUpdateParams.InvoiceSettings#extraParams} for the field documentation.
1141
       */
1142
      public Builder putAllExtraParam(Map<String, Object> map) {
1143
        if (this.extraParams == null) {
×
1144
          this.extraParams = new HashMap<>();
×
1145
        }
1146
        this.extraParams.putAll(map);
×
1147
        return this;
×
1148
      }
1149

1150
      /** Default footer to be displayed on invoices for this customer. */
1151
      public Builder setFooter(String footer) {
1152
        this.footer = footer;
×
1153
        return this;
×
1154
      }
1155

1156
      /** Default footer to be displayed on invoices for this customer. */
1157
      public Builder setFooter(EmptyParam footer) {
1158
        this.footer = footer;
×
1159
        return this;
×
1160
      }
1161

1162
      /** Default options for invoice PDF rendering for this customer. */
1163
      public Builder setRenderingOptions(
1164
          CustomerUpdateParams.InvoiceSettings.RenderingOptions renderingOptions) {
1165
        this.renderingOptions = renderingOptions;
×
1166
        return this;
×
1167
      }
1168

1169
      /** Default options for invoice PDF rendering for this customer. */
1170
      public Builder setRenderingOptions(EmptyParam renderingOptions) {
1171
        this.renderingOptions = renderingOptions;
×
1172
        return this;
×
1173
      }
1174
    }
1175

1176
    @Getter
1177
    public static class CustomField {
1178
      /**
1179
       * Map of extra parameters for custom features not available in this client library. The
1180
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1181
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1182
       * name in this param object. Effectively, this map is flattened to its parent instance.
1183
       */
1184
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1185
      Map<String, Object> extraParams;
1186

1187
      /**
1188
       * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1189
       */
1190
      @SerializedName("name")
1191
      Object name;
1192

1193
      /**
1194
       * <strong>Required.</strong> The value of the custom field. This may be up to 140 characters.
1195
       */
1196
      @SerializedName("value")
1197
      Object value;
1198

1199
      private CustomField(Map<String, Object> extraParams, Object name, Object value) {
×
1200
        this.extraParams = extraParams;
×
1201
        this.name = name;
×
1202
        this.value = value;
×
1203
      }
×
1204

1205
      public static Builder builder() {
1206
        return new Builder();
×
1207
      }
1208

1209
      public static class Builder {
×
1210
        private Map<String, Object> extraParams;
1211

1212
        private Object name;
1213

1214
        private Object value;
1215

1216
        /** Finalize and obtain parameter instance from this builder. */
1217
        public CustomerUpdateParams.InvoiceSettings.CustomField build() {
1218
          return new CustomerUpdateParams.InvoiceSettings.CustomField(
×
1219
              this.extraParams, this.name, this.value);
1220
        }
1221

1222
        /**
1223
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1224
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1225
         * map. See {@link CustomerUpdateParams.InvoiceSettings.CustomField#extraParams} for the
1226
         * field documentation.
1227
         */
1228
        public Builder putExtraParam(String key, Object value) {
1229
          if (this.extraParams == null) {
×
1230
            this.extraParams = new HashMap<>();
×
1231
          }
1232
          this.extraParams.put(key, value);
×
1233
          return this;
×
1234
        }
1235

1236
        /**
1237
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1238
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1239
         * map. See {@link CustomerUpdateParams.InvoiceSettings.CustomField#extraParams} for the
1240
         * field documentation.
1241
         */
1242
        public Builder putAllExtraParam(Map<String, Object> map) {
1243
          if (this.extraParams == null) {
×
1244
            this.extraParams = new HashMap<>();
×
1245
          }
1246
          this.extraParams.putAll(map);
×
1247
          return this;
×
1248
        }
1249

1250
        /**
1251
         * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1252
         */
1253
        public Builder setName(String name) {
1254
          this.name = name;
×
1255
          return this;
×
1256
        }
1257

1258
        /**
1259
         * <strong>Required.</strong> The name of the custom field. This may be up to 40 characters.
1260
         */
1261
        public Builder setName(EmptyParam name) {
1262
          this.name = name;
×
1263
          return this;
×
1264
        }
1265

1266
        /**
1267
         * <strong>Required.</strong> The value of the custom field. This may be up to 140
1268
         * characters.
1269
         */
1270
        public Builder setValue(String value) {
1271
          this.value = value;
×
1272
          return this;
×
1273
        }
1274

1275
        /**
1276
         * <strong>Required.</strong> The value of the custom field. This may be up to 140
1277
         * characters.
1278
         */
1279
        public Builder setValue(EmptyParam value) {
1280
          this.value = value;
×
1281
          return this;
×
1282
        }
1283
      }
1284
    }
1285

1286
    @Getter
1287
    public static class RenderingOptions {
1288
      /**
1289
       * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One
1290
       * of {@code exclude_tax} or {@code include_inclusive_tax}. {@code include_inclusive_tax} will
1291
       * include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. {@code
1292
       * exclude_tax} will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
1293
       */
1294
      @SerializedName("amount_tax_display")
1295
      ApiRequestParams.EnumParam amountTaxDisplay;
1296

1297
      /**
1298
       * Map of extra parameters for custom features not available in this client library. The
1299
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1300
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1301
       * name in this param object. Effectively, this map is flattened to its parent instance.
1302
       */
1303
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1304
      Map<String, Object> extraParams;
1305

1306
      /** ID of the invoice rendering template to use for future invoices. */
1307
      @SerializedName("template")
1308
      Object template;
1309

1310
      private RenderingOptions(
1311
          ApiRequestParams.EnumParam amountTaxDisplay,
1312
          Map<String, Object> extraParams,
1313
          Object template) {
×
1314
        this.amountTaxDisplay = amountTaxDisplay;
×
1315
        this.extraParams = extraParams;
×
1316
        this.template = template;
×
1317
      }
×
1318

1319
      public static Builder builder() {
1320
        return new Builder();
×
1321
      }
1322

1323
      public static class Builder {
×
1324
        private ApiRequestParams.EnumParam amountTaxDisplay;
1325

1326
        private Map<String, Object> extraParams;
1327

1328
        private Object template;
1329

1330
        /** Finalize and obtain parameter instance from this builder. */
1331
        public CustomerUpdateParams.InvoiceSettings.RenderingOptions build() {
1332
          return new CustomerUpdateParams.InvoiceSettings.RenderingOptions(
×
1333
              this.amountTaxDisplay, this.extraParams, this.template);
1334
        }
1335

1336
        /**
1337
         * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
1338
         * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
1339
         * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in invoice
1340
         * PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive alike)
1341
         * from invoice PDF amounts.
1342
         */
1343
        public Builder setAmountTaxDisplay(
1344
            CustomerUpdateParams.InvoiceSettings.RenderingOptions.AmountTaxDisplay
1345
                amountTaxDisplay) {
1346
          this.amountTaxDisplay = amountTaxDisplay;
×
1347
          return this;
×
1348
        }
1349

1350
        /**
1351
         * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
1352
         * One of {@code exclude_tax} or {@code include_inclusive_tax}. {@code
1353
         * include_inclusive_tax} will include inclusive tax (and exclude exclusive tax) in invoice
1354
         * PDF amounts. {@code exclude_tax} will exclude all tax (inclusive and exclusive alike)
1355
         * from invoice PDF amounts.
1356
         */
1357
        public Builder setAmountTaxDisplay(EmptyParam amountTaxDisplay) {
1358
          this.amountTaxDisplay = amountTaxDisplay;
×
1359
          return this;
×
1360
        }
1361

1362
        /**
1363
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1364
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1365
         * map. See {@link CustomerUpdateParams.InvoiceSettings.RenderingOptions#extraParams} for
1366
         * the field documentation.
1367
         */
1368
        public Builder putExtraParam(String key, Object value) {
1369
          if (this.extraParams == null) {
×
1370
            this.extraParams = new HashMap<>();
×
1371
          }
1372
          this.extraParams.put(key, value);
×
1373
          return this;
×
1374
        }
1375

1376
        /**
1377
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1378
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1379
         * map. See {@link CustomerUpdateParams.InvoiceSettings.RenderingOptions#extraParams} for
1380
         * the field documentation.
1381
         */
1382
        public Builder putAllExtraParam(Map<String, Object> map) {
1383
          if (this.extraParams == null) {
×
1384
            this.extraParams = new HashMap<>();
×
1385
          }
1386
          this.extraParams.putAll(map);
×
1387
          return this;
×
1388
        }
1389

1390
        /** ID of the invoice rendering template to use for future invoices. */
1391
        public Builder setTemplate(String template) {
1392
          this.template = template;
×
1393
          return this;
×
1394
        }
1395

1396
        /** ID of the invoice rendering template to use for future invoices. */
1397
        public Builder setTemplate(EmptyParam template) {
1398
          this.template = template;
×
1399
          return this;
×
1400
        }
1401
      }
1402

1403
      public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
1404
        @SerializedName("exclude_tax")
×
1405
        EXCLUDE_TAX("exclude_tax"),
1406

1407
        @SerializedName("include_inclusive_tax")
×
1408
        INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
1409

1410
        @Getter(onMethod_ = {@Override})
1411
        private final String value;
1412

1413
        AmountTaxDisplay(String value) {
×
1414
          this.value = value;
×
1415
        }
×
1416
      }
1417
    }
1418
  }
1419

1420
  @Getter
1421
  public static class Shipping {
1422
    /** <strong>Required.</strong> Customer shipping address. */
1423
    @SerializedName("address")
1424
    Address address;
1425

1426
    /**
1427
     * Map of extra parameters for custom features not available in this client library. The content
1428
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1429
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1430
     * param object. Effectively, this map is flattened to its parent instance.
1431
     */
1432
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1433
    Map<String, Object> extraParams;
1434

1435
    /** <strong>Required.</strong> Customer name. */
1436
    @SerializedName("name")
1437
    Object name;
1438

1439
    /** Customer phone (including extension). */
1440
    @SerializedName("phone")
1441
    Object phone;
1442

1443
    private Shipping(Address address, Map<String, Object> extraParams, Object name, Object phone) {
×
1444
      this.address = address;
×
1445
      this.extraParams = extraParams;
×
1446
      this.name = name;
×
1447
      this.phone = phone;
×
1448
    }
×
1449

1450
    public static Builder builder() {
1451
      return new Builder();
×
1452
    }
1453

1454
    public static class Builder {
×
1455
      private Address address;
1456

1457
      private Map<String, Object> extraParams;
1458

1459
      private Object name;
1460

1461
      private Object phone;
1462

1463
      /** Finalize and obtain parameter instance from this builder. */
1464
      public CustomerUpdateParams.Shipping build() {
1465
        return new CustomerUpdateParams.Shipping(
×
1466
            this.address, this.extraParams, this.name, this.phone);
1467
      }
1468

1469
      /** <strong>Required.</strong> Customer shipping address. */
1470
      public Builder setAddress(CustomerUpdateParams.Shipping.Address address) {
1471
        this.address = address;
×
1472
        return this;
×
1473
      }
1474

1475
      /**
1476
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1477
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1478
       * CustomerUpdateParams.Shipping#extraParams} for the field documentation.
1479
       */
1480
      public Builder putExtraParam(String key, Object value) {
1481
        if (this.extraParams == null) {
×
1482
          this.extraParams = new HashMap<>();
×
1483
        }
1484
        this.extraParams.put(key, value);
×
1485
        return this;
×
1486
      }
1487

1488
      /**
1489
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1490
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1491
       * See {@link CustomerUpdateParams.Shipping#extraParams} for the field documentation.
1492
       */
1493
      public Builder putAllExtraParam(Map<String, Object> map) {
1494
        if (this.extraParams == null) {
×
1495
          this.extraParams = new HashMap<>();
×
1496
        }
1497
        this.extraParams.putAll(map);
×
1498
        return this;
×
1499
      }
1500

1501
      /** <strong>Required.</strong> Customer name. */
1502
      public Builder setName(String name) {
1503
        this.name = name;
×
1504
        return this;
×
1505
      }
1506

1507
      /** <strong>Required.</strong> Customer name. */
1508
      public Builder setName(EmptyParam name) {
1509
        this.name = name;
×
1510
        return this;
×
1511
      }
1512

1513
      /** Customer phone (including extension). */
1514
      public Builder setPhone(String phone) {
1515
        this.phone = phone;
×
1516
        return this;
×
1517
      }
1518

1519
      /** Customer phone (including extension). */
1520
      public Builder setPhone(EmptyParam phone) {
1521
        this.phone = phone;
×
1522
        return this;
×
1523
      }
1524
    }
1525

1526
    @Getter
1527
    public static class Address {
1528
      /** City, district, suburb, town, or village. */
1529
      @SerializedName("city")
1530
      Object city;
1531

1532
      /**
1533
       * A freeform text field for the country. However, in order to activate some tax features, the
1534
       * format should be a two-letter country code (<a
1535
       * href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>).
1536
       */
1537
      @SerializedName("country")
1538
      Object country;
1539

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

1549
      /** Address line 1 (e.g., street, PO Box, or company name). */
1550
      @SerializedName("line1")
1551
      Object line1;
1552

1553
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
1554
      @SerializedName("line2")
1555
      Object line2;
1556

1557
      /** ZIP or postal code. */
1558
      @SerializedName("postal_code")
1559
      Object postalCode;
1560

1561
      /** State, county, province, or region. */
1562
      @SerializedName("state")
1563
      Object state;
1564

1565
      private Address(
1566
          Object city,
1567
          Object country,
1568
          Map<String, Object> extraParams,
1569
          Object line1,
1570
          Object line2,
1571
          Object postalCode,
1572
          Object state) {
×
1573
        this.city = city;
×
1574
        this.country = country;
×
1575
        this.extraParams = extraParams;
×
1576
        this.line1 = line1;
×
1577
        this.line2 = line2;
×
1578
        this.postalCode = postalCode;
×
1579
        this.state = state;
×
1580
      }
×
1581

1582
      public static Builder builder() {
1583
        return new Builder();
×
1584
      }
1585

1586
      public static class Builder {
×
1587
        private Object city;
1588

1589
        private Object country;
1590

1591
        private Map<String, Object> extraParams;
1592

1593
        private Object line1;
1594

1595
        private Object line2;
1596

1597
        private Object postalCode;
1598

1599
        private Object state;
1600

1601
        /** Finalize and obtain parameter instance from this builder. */
1602
        public CustomerUpdateParams.Shipping.Address build() {
1603
          return new CustomerUpdateParams.Shipping.Address(
×
1604
              this.city,
1605
              this.country,
1606
              this.extraParams,
1607
              this.line1,
1608
              this.line2,
1609
              this.postalCode,
1610
              this.state);
1611
        }
1612

1613
        /** City, district, suburb, town, or village. */
1614
        public Builder setCity(String city) {
1615
          this.city = city;
×
1616
          return this;
×
1617
        }
1618

1619
        /** City, district, suburb, town, or village. */
1620
        public Builder setCity(EmptyParam city) {
1621
          this.city = city;
×
1622
          return this;
×
1623
        }
1624

1625
        /**
1626
         * A freeform text field for the country. However, in order to activate some tax features,
1627
         * the format should be a two-letter country code (<a
1628
         * href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>).
1629
         */
1630
        public Builder setCountry(String country) {
1631
          this.country = country;
×
1632
          return this;
×
1633
        }
1634

1635
        /**
1636
         * A freeform text field for the country. However, in order to activate some tax features,
1637
         * the format should be a two-letter country code (<a
1638
         * href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>).
1639
         */
1640
        public Builder setCountry(EmptyParam country) {
1641
          this.country = country;
×
1642
          return this;
×
1643
        }
1644

1645
        /**
1646
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1647
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1648
         * map. See {@link CustomerUpdateParams.Shipping.Address#extraParams} for the field
1649
         * documentation.
1650
         */
1651
        public Builder putExtraParam(String key, Object value) {
1652
          if (this.extraParams == null) {
×
1653
            this.extraParams = new HashMap<>();
×
1654
          }
1655
          this.extraParams.put(key, value);
×
1656
          return this;
×
1657
        }
1658

1659
        /**
1660
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1661
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1662
         * map. See {@link CustomerUpdateParams.Shipping.Address#extraParams} for the field
1663
         * documentation.
1664
         */
1665
        public Builder putAllExtraParam(Map<String, Object> map) {
1666
          if (this.extraParams == null) {
×
1667
            this.extraParams = new HashMap<>();
×
1668
          }
1669
          this.extraParams.putAll(map);
×
1670
          return this;
×
1671
        }
1672

1673
        /** Address line 1 (e.g., street, PO Box, or company name). */
1674
        public Builder setLine1(String line1) {
1675
          this.line1 = line1;
×
1676
          return this;
×
1677
        }
1678

1679
        /** Address line 1 (e.g., street, PO Box, or company name). */
1680
        public Builder setLine1(EmptyParam line1) {
1681
          this.line1 = line1;
×
1682
          return this;
×
1683
        }
1684

1685
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
1686
        public Builder setLine2(String line2) {
1687
          this.line2 = line2;
×
1688
          return this;
×
1689
        }
1690

1691
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
1692
        public Builder setLine2(EmptyParam line2) {
1693
          this.line2 = line2;
×
1694
          return this;
×
1695
        }
1696

1697
        /** ZIP or postal code. */
1698
        public Builder setPostalCode(String postalCode) {
1699
          this.postalCode = postalCode;
×
1700
          return this;
×
1701
        }
1702

1703
        /** ZIP or postal code. */
1704
        public Builder setPostalCode(EmptyParam postalCode) {
1705
          this.postalCode = postalCode;
×
1706
          return this;
×
1707
        }
1708

1709
        /** State, county, province, or region. */
1710
        public Builder setState(String state) {
1711
          this.state = state;
×
1712
          return this;
×
1713
        }
1714

1715
        /** State, county, province, or region. */
1716
        public Builder setState(EmptyParam state) {
1717
          this.state = state;
×
1718
          return this;
×
1719
        }
1720
      }
1721
    }
1722
  }
1723

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

1735
    /**
1736
     * A recent IP address of the customer used for tax reporting and tax location inference. Stripe
1737
     * recommends updating the IP address when a new PaymentMethod is attached or the address field
1738
     * on the customer is updated. We recommend against updating this field more frequently since it
1739
     * could result in unexpected tax location/reporting outcomes.
1740
     */
1741
    @SerializedName("ip_address")
1742
    Object ipAddress;
1743

1744
    /**
1745
     * A flag that indicates when Stripe should validate the customer tax location. Defaults to
1746
     * {@code deferred}.
1747
     */
1748
    @SerializedName("validate_location")
1749
    ValidateLocation validateLocation;
1750

1751
    private Tax(
1752
        Map<String, Object> extraParams, Object ipAddress, ValidateLocation validateLocation) {
×
1753
      this.extraParams = extraParams;
×
1754
      this.ipAddress = ipAddress;
×
1755
      this.validateLocation = validateLocation;
×
1756
    }
×
1757

1758
    public static Builder builder() {
1759
      return new Builder();
×
1760
    }
1761

1762
    public static class Builder {
×
1763
      private Map<String, Object> extraParams;
1764

1765
      private Object ipAddress;
1766

1767
      private ValidateLocation validateLocation;
1768

1769
      /** Finalize and obtain parameter instance from this builder. */
1770
      public CustomerUpdateParams.Tax build() {
1771
        return new CustomerUpdateParams.Tax(
×
1772
            this.extraParams, this.ipAddress, this.validateLocation);
1773
      }
1774

1775
      /**
1776
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1777
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1778
       * CustomerUpdateParams.Tax#extraParams} for the field documentation.
1779
       */
1780
      public Builder putExtraParam(String key, Object value) {
1781
        if (this.extraParams == null) {
×
1782
          this.extraParams = new HashMap<>();
×
1783
        }
1784
        this.extraParams.put(key, value);
×
1785
        return this;
×
1786
      }
1787

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

1801
      /**
1802
       * A recent IP address of the customer used for tax reporting and tax location inference.
1803
       * Stripe recommends updating the IP address when a new PaymentMethod is attached or the
1804
       * address field on the customer is updated. We recommend against updating this field more
1805
       * frequently since it could result in unexpected tax location/reporting outcomes.
1806
       */
1807
      public Builder setIpAddress(String ipAddress) {
1808
        this.ipAddress = ipAddress;
×
1809
        return this;
×
1810
      }
1811

1812
      /**
1813
       * A recent IP address of the customer used for tax reporting and tax location inference.
1814
       * Stripe recommends updating the IP address when a new PaymentMethod is attached or the
1815
       * address field on the customer is updated. We recommend against updating this field more
1816
       * frequently since it could result in unexpected tax location/reporting outcomes.
1817
       */
1818
      public Builder setIpAddress(EmptyParam ipAddress) {
1819
        this.ipAddress = ipAddress;
×
1820
        return this;
×
1821
      }
1822

1823
      /**
1824
       * A flag that indicates when Stripe should validate the customer tax location. Defaults to
1825
       * {@code deferred}.
1826
       */
1827
      public Builder setValidateLocation(
1828
          CustomerUpdateParams.Tax.ValidateLocation validateLocation) {
1829
        this.validateLocation = validateLocation;
×
1830
        return this;
×
1831
      }
1832
    }
1833

1834
    public enum ValidateLocation implements ApiRequestParams.EnumParam {
×
NEW
1835
      @SerializedName("auto")
×
1836
      AUTO("auto"),
1837

UNCOV
1838
      @SerializedName("deferred")
×
1839
      DEFERRED("deferred"),
1840

1841
      @SerializedName("immediately")
×
1842
      IMMEDIATELY("immediately");
1843

1844
      @Getter(onMethod_ = {@Override})
1845
      private final String value;
1846

1847
      ValidateLocation(String value) {
×
1848
        this.value = value;
×
1849
      }
×
1850
    }
1851
  }
1852

1853
  public enum TaxExempt implements ApiRequestParams.EnumParam {
×
1854
    @SerializedName("exempt")
×
1855
    EXEMPT("exempt"),
1856

1857
    @SerializedName("none")
×
1858
    NONE("none"),
1859

1860
    @SerializedName("reverse")
×
1861
    REVERSE("reverse");
1862

1863
    @Getter(onMethod_ = {@Override})
1864
    private final String value;
1865

1866
    TaxExempt(String value) {
×
1867
      this.value = value;
×
1868
    }
×
1869
  }
1870
}
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