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

stripe / stripe-java / #16418

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

push

github

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

Update generated code for beta

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

10 existing lines in 8 files now uncovered.

18470 of 143664 relevant lines covered (12.86%)

0.13 hits per line

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

7.54
/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
     * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
625
     * 3166-1 alpha-2</a>).
626
     */
627
    @SerializedName("country")
628
    Object country;
629

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

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

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

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

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

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

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

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

679
      private Object country;
680

681
      private Map<String, Object> extraParams;
682

683
      private Object line1;
684

685
      private Object line2;
686

687
      private Object postalCode;
688

689
      private Object state;
690

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

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

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

715
      /**
716
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
717
       * 3166-1 alpha-2</a>).
718
       */
719
      public Builder setCountry(String country) {
720
        this.country = country;
×
721
        return this;
×
722
      }
723

724
      /**
725
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
726
       * 3166-1 alpha-2</a>).
727
       */
728
      public Builder setCountry(EmptyParam country) {
729
        this.country = country;
×
730
        return this;
×
731
      }
732

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

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

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

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

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

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

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

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

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

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

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

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

827
    private CashBalance(Map<String, Object> extraParams, Settings settings) {
×
828
      this.extraParams = extraParams;
×
829
      this.settings = settings;
×
830
    }
×
831

832
    public static Builder builder() {
833
      return new Builder();
×
834
    }
835

836
    public static class Builder {
×
837
      private Map<String, Object> extraParams;
838

839
      private Settings settings;
840

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

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

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

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

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

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

902
      private Settings(Map<String, Object> extraParams, ReconciliationMode reconciliationMode) {
×
903
        this.extraParams = extraParams;
×
904
        this.reconciliationMode = reconciliationMode;
×
905
      }
×
906

907
      public static Builder builder() {
908
        return new Builder();
×
909
      }
910

911
      public static class Builder {
×
912
        private Map<String, Object> extraParams;
913

914
        private ReconciliationMode reconciliationMode;
915

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

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

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

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

963
      public enum ReconciliationMode implements ApiRequestParams.EnumParam {
×
964
        @SerializedName("automatic")
×
965
        AUTOMATIC("automatic"),
966

967
        @SerializedName("manual")
×
968
        MANUAL("manual"),
969

970
        @SerializedName("merchant_default")
×
971
        MERCHANT_DEFAULT("merchant_default");
972

973
        @Getter(onMethod_ = {@Override})
974
        private final String value;
975

976
        ReconciliationMode(String value) {
×
977
          this.value = value;
×
978
        }
×
979
      }
980
    }
981
  }
982

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

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

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

1008
    /** Default footer to be displayed on invoices for this customer. */
1009
    @SerializedName("footer")
1010
    Object footer;
1011

1012
    /** Default options for invoice PDF rendering for this customer. */
1013
    @SerializedName("rendering_options")
1014
    Object renderingOptions;
1015

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

1029
    public static Builder builder() {
1030
      return new Builder();
×
1031
    }
1032

1033
    public static class Builder {
×
1034
      private Object customFields;
1035

1036
      private Object defaultPaymentMethod;
1037

1038
      private Map<String, Object> extraParams;
1039

1040
      private Object footer;
1041

1042
      private Object renderingOptions;
1043

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1196
      private CustomField(Map<String, Object> extraParams, Object name, Object value) {
×
1197
        this.extraParams = extraParams;
×
1198
        this.name = name;
×
1199
        this.value = value;
×
1200
      }
×
1201

1202
      public static Builder builder() {
1203
        return new Builder();
×
1204
      }
1205

1206
      public static class Builder {
×
1207
        private Map<String, Object> extraParams;
1208

1209
        private Object name;
1210

1211
        private Object value;
1212

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

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

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

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

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

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

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

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

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

1303
      /** ID of the invoice rendering template to use for future invoices. */
1304
      @SerializedName("template")
1305
      Object template;
1306

1307
      private RenderingOptions(
1308
          ApiRequestParams.EnumParam amountTaxDisplay,
1309
          Map<String, Object> extraParams,
NEW
1310
          Object template) {
×
1311
        this.amountTaxDisplay = amountTaxDisplay;
×
1312
        this.extraParams = extraParams;
×
NEW
1313
        this.template = template;
×
UNCOV
1314
      }
×
1315

1316
      public static Builder builder() {
1317
        return new Builder();
×
1318
      }
1319

1320
      public static class Builder {
×
1321
        private ApiRequestParams.EnumParam amountTaxDisplay;
1322

1323
        private Map<String, Object> extraParams;
1324

1325
        private Object template;
1326

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

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

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

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

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

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

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

1400
      public enum AmountTaxDisplay implements ApiRequestParams.EnumParam {
×
1401
        @SerializedName("exclude_tax")
×
1402
        EXCLUDE_TAX("exclude_tax"),
1403

1404
        @SerializedName("include_inclusive_tax")
×
1405
        INCLUDE_INCLUSIVE_TAX("include_inclusive_tax");
1406

1407
        @Getter(onMethod_ = {@Override})
1408
        private final String value;
1409

1410
        AmountTaxDisplay(String value) {
×
1411
          this.value = value;
×
1412
        }
×
1413
      }
1414
    }
1415
  }
1416

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

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

1432
    /** <strong>Required.</strong> Customer name. */
1433
    @SerializedName("name")
1434
    Object name;
1435

1436
    /** Customer phone (including extension). */
1437
    @SerializedName("phone")
1438
    Object phone;
1439

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

1447
    public static Builder builder() {
1448
      return new Builder();
×
1449
    }
1450

1451
    public static class Builder {
×
1452
      private Address address;
1453

1454
      private Map<String, Object> extraParams;
1455

1456
      private Object name;
1457

1458
      private Object phone;
1459

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

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

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

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

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

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

1510
      /** Customer phone (including extension). */
1511
      public Builder setPhone(String phone) {
1512
        this.phone = phone;
×
1513
        return this;
×
1514
      }
1515

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

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

1529
      /**
1530
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
1531
       * 3166-1 alpha-2</a>).
1532
       */
1533
      @SerializedName("country")
1534
      Object country;
1535

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

1545
      /** Address line 1 (e.g., street, PO Box, or company name). */
1546
      @SerializedName("line1")
1547
      Object line1;
1548

1549
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
1550
      @SerializedName("line2")
1551
      Object line2;
1552

1553
      /** ZIP or postal code. */
1554
      @SerializedName("postal_code")
1555
      Object postalCode;
1556

1557
      /** State, county, province, or region. */
1558
      @SerializedName("state")
1559
      Object state;
1560

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

1578
      public static Builder builder() {
1579
        return new Builder();
×
1580
      }
1581

1582
      public static class Builder {
×
1583
        private Object city;
1584

1585
        private Object country;
1586

1587
        private Map<String, Object> extraParams;
1588

1589
        private Object line1;
1590

1591
        private Object line2;
1592

1593
        private Object postalCode;
1594

1595
        private Object state;
1596

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

1609
        /** City, district, suburb, town, or village. */
1610
        public Builder setCity(String city) {
1611
          this.city = city;
×
1612
          return this;
×
1613
        }
1614

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

1621
        /**
1622
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
1623
         * 3166-1 alpha-2</a>).
1624
         */
1625
        public Builder setCountry(String country) {
1626
          this.country = country;
×
1627
          return this;
×
1628
        }
1629

1630
        /**
1631
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
1632
         * 3166-1 alpha-2</a>).
1633
         */
1634
        public Builder setCountry(EmptyParam country) {
1635
          this.country = country;
×
1636
          return this;
×
1637
        }
1638

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

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

1667
        /** Address line 1 (e.g., street, PO Box, or company name). */
1668
        public Builder setLine1(String line1) {
1669
          this.line1 = line1;
×
1670
          return this;
×
1671
        }
1672

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

1679
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
1680
        public Builder setLine2(String line2) {
1681
          this.line2 = line2;
×
1682
          return this;
×
1683
        }
1684

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

1691
        /** ZIP or postal code. */
1692
        public Builder setPostalCode(String postalCode) {
1693
          this.postalCode = postalCode;
×
1694
          return this;
×
1695
        }
1696

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

1703
        /** State, county, province, or region. */
1704
        public Builder setState(String state) {
1705
          this.state = state;
×
1706
          return this;
×
1707
        }
1708

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

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

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

1738
    /**
1739
     * A flag that indicates when Stripe should validate the customer tax location. Defaults to
1740
     * {@code deferred}.
1741
     */
1742
    @SerializedName("validate_location")
1743
    ValidateLocation validateLocation;
1744

1745
    private Tax(
1746
        Map<String, Object> extraParams, Object ipAddress, ValidateLocation validateLocation) {
×
1747
      this.extraParams = extraParams;
×
1748
      this.ipAddress = ipAddress;
×
1749
      this.validateLocation = validateLocation;
×
1750
    }
×
1751

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

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

1759
      private Object ipAddress;
1760

1761
      private ValidateLocation validateLocation;
1762

1763
      /** Finalize and obtain parameter instance from this builder. */
1764
      public CustomerUpdateParams.Tax build() {
1765
        return new CustomerUpdateParams.Tax(
×
1766
            this.extraParams, this.ipAddress, this.validateLocation);
1767
      }
1768

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

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

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

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

1817
      /**
1818
       * A flag that indicates when Stripe should validate the customer tax location. Defaults to
1819
       * {@code deferred}.
1820
       */
1821
      public Builder setValidateLocation(
1822
          CustomerUpdateParams.Tax.ValidateLocation validateLocation) {
1823
        this.validateLocation = validateLocation;
×
1824
        return this;
×
1825
      }
1826
    }
1827

1828
    public enum ValidateLocation implements ApiRequestParams.EnumParam {
×
1829
      @SerializedName("deferred")
×
1830
      DEFERRED("deferred"),
1831

1832
      @SerializedName("immediately")
×
1833
      IMMEDIATELY("immediately");
1834

1835
      @Getter(onMethod_ = {@Override})
1836
      private final String value;
1837

1838
      ValidateLocation(String value) {
×
1839
        this.value = value;
×
1840
      }
×
1841
    }
1842
  }
1843

1844
  public enum TaxExempt implements ApiRequestParams.EnumParam {
×
1845
    @SerializedName("exempt")
×
1846
    EXEMPT("exempt"),
1847

1848
    @SerializedName("none")
×
1849
    NONE("none"),
1850

1851
    @SerializedName("reverse")
×
1852
    REVERSE("reverse");
1853

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

1857
    TaxExempt(String value) {
×
1858
      this.value = value;
×
1859
    }
×
1860
  }
1861
}
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