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

stripe / stripe-java / #16624

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

push

github

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

Update generated code for beta

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

33 existing lines in 29 files now uncovered.

18855 of 151828 relevant lines covered (12.42%)

0.12 hits per line

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

0.0
/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.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.math.BigDecimal;
8
import java.util.ArrayList;
9
import java.util.HashMap;
10
import java.util.List;
11
import java.util.Map;
12
import lombok.Getter;
13

14
@Getter
15
public class InvoiceUpdateLinesParams extends ApiRequestParams {
16
  /** Specifies which fields in the response should be expanded. */
17
  @SerializedName("expand")
18
  List<String> expand;
19

20
  /**
21
   * Map of extra parameters for custom features not available in this client library. The content
22
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
23
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
24
   * param object. Effectively, this map is flattened to its parent instance.
25
   */
26
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
27
  Map<String, Object> extraParams;
28

29
  /**
30
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
31
   * to an object. This can be useful for storing additional information about the object in a
32
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
33
   * be unset by posting an empty value to {@code metadata}. For <a
34
   * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type">type=subscription</a>
35
   * line items, the incoming metadata specified on the request is directly used to set this value,
36
   * in contrast to <a
37
   * href="api/invoices/line_item#invoice_line_item_object-type">type=invoiceitem</a> line items,
38
   * where any existing metadata on the invoice line is merged with the incoming data.
39
   */
40
  @SerializedName("invoice_metadata")
41
  Object invoiceMetadata;
42

43
  /** <strong>Required.</strong> The line items to update. */
44
  @SerializedName("lines")
45
  List<InvoiceUpdateLinesParams.Line> lines;
46

47
  private InvoiceUpdateLinesParams(
48
      List<String> expand,
49
      Map<String, Object> extraParams,
50
      Object invoiceMetadata,
51
      List<InvoiceUpdateLinesParams.Line> lines) {
×
52
    this.expand = expand;
×
53
    this.extraParams = extraParams;
×
54
    this.invoiceMetadata = invoiceMetadata;
×
55
    this.lines = lines;
×
56
  }
×
57

58
  public static Builder builder() {
59
    return new Builder();
×
60
  }
61

62
  public static class Builder {
×
63
    private List<String> expand;
64

65
    private Map<String, Object> extraParams;
66

67
    private Object invoiceMetadata;
68

69
    private List<InvoiceUpdateLinesParams.Line> lines;
70

71
    /** Finalize and obtain parameter instance from this builder. */
72
    public InvoiceUpdateLinesParams build() {
73
      return new InvoiceUpdateLinesParams(
×
74
          this.expand, this.extraParams, this.invoiceMetadata, this.lines);
75
    }
76

77
    /**
78
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
79
     * subsequent calls adds additional elements to the original list. See {@link
80
     * InvoiceUpdateLinesParams#expand} for the field documentation.
81
     */
82
    public Builder addExpand(String element) {
83
      if (this.expand == null) {
×
84
        this.expand = new ArrayList<>();
×
85
      }
86
      this.expand.add(element);
×
87
      return this;
×
88
    }
89

90
    /**
91
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
92
     * subsequent calls adds additional elements to the original list. See {@link
93
     * InvoiceUpdateLinesParams#expand} for the field documentation.
94
     */
95
    public Builder addAllExpand(List<String> elements) {
96
      if (this.expand == null) {
×
97
        this.expand = new ArrayList<>();
×
98
      }
99
      this.expand.addAll(elements);
×
100
      return this;
×
101
    }
102

103
    /**
104
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
105
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
106
     * InvoiceUpdateLinesParams#extraParams} for the field documentation.
107
     */
108
    public Builder putExtraParam(String key, Object value) {
109
      if (this.extraParams == null) {
×
110
        this.extraParams = new HashMap<>();
×
111
      }
112
      this.extraParams.put(key, value);
×
113
      return this;
×
114
    }
115

116
    /**
117
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
118
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
119
     * See {@link InvoiceUpdateLinesParams#extraParams} for the field documentation.
120
     */
121
    public Builder putAllExtraParam(Map<String, Object> map) {
122
      if (this.extraParams == null) {
×
123
        this.extraParams = new HashMap<>();
×
124
      }
125
      this.extraParams.putAll(map);
×
126
      return this;
×
127
    }
128

129
    /**
130
     * Add a key/value pair to `invoiceMetadata` map. A map is initialized for the first
131
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
132
     * See {@link InvoiceUpdateLinesParams#invoiceMetadata} for the field documentation.
133
     */
134
    @SuppressWarnings("unchecked")
135
    public Builder putInvoiceMetadata(String key, String value) {
136
      if (this.invoiceMetadata == null || this.invoiceMetadata instanceof EmptyParam) {
×
137
        this.invoiceMetadata = new HashMap<String, String>();
×
138
      }
139
      ((Map<String, String>) this.invoiceMetadata).put(key, value);
×
140
      return this;
×
141
    }
142

143
    /**
144
     * Add all map key/value pairs to `invoiceMetadata` map. A map is initialized for the first
145
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
146
     * See {@link InvoiceUpdateLinesParams#invoiceMetadata} for the field documentation.
147
     */
148
    @SuppressWarnings("unchecked")
149
    public Builder putAllInvoiceMetadata(Map<String, String> map) {
150
      if (this.invoiceMetadata == null || this.invoiceMetadata instanceof EmptyParam) {
×
151
        this.invoiceMetadata = new HashMap<String, String>();
×
152
      }
153
      ((Map<String, String>) this.invoiceMetadata).putAll(map);
×
154
      return this;
×
155
    }
156

157
    /**
158
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
159
     * to an object. This can be useful for storing additional information about the object in a
160
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
161
     * can be unset by posting an empty value to {@code metadata}. For <a
162
     * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type">type=subscription</a>
163
     * line items, the incoming metadata specified on the request is directly used to set this
164
     * value, in contrast to <a
165
     * href="api/invoices/line_item#invoice_line_item_object-type">type=invoiceitem</a> line items,
166
     * where any existing metadata on the invoice line is merged with the incoming data.
167
     */
168
    public Builder setInvoiceMetadata(EmptyParam invoiceMetadata) {
169
      this.invoiceMetadata = invoiceMetadata;
×
170
      return this;
×
171
    }
172

173
    /**
174
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
175
     * to an object. This can be useful for storing additional information about the object in a
176
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
177
     * can be unset by posting an empty value to {@code metadata}. For <a
178
     * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type">type=subscription</a>
179
     * line items, the incoming metadata specified on the request is directly used to set this
180
     * value, in contrast to <a
181
     * href="api/invoices/line_item#invoice_line_item_object-type">type=invoiceitem</a> line items,
182
     * where any existing metadata on the invoice line is merged with the incoming data.
183
     */
184
    public Builder setInvoiceMetadata(Map<String, String> invoiceMetadata) {
185
      this.invoiceMetadata = invoiceMetadata;
×
186
      return this;
×
187
    }
188

189
    /**
190
     * Add an element to `lines` list. A list is initialized for the first `add/addAll` call, and
191
     * subsequent calls adds additional elements to the original list. See {@link
192
     * InvoiceUpdateLinesParams#lines} for the field documentation.
193
     */
194
    public Builder addLine(InvoiceUpdateLinesParams.Line element) {
195
      if (this.lines == null) {
×
196
        this.lines = new ArrayList<>();
×
197
      }
198
      this.lines.add(element);
×
199
      return this;
×
200
    }
201

202
    /**
203
     * Add all elements to `lines` list. A list is initialized for the first `add/addAll` call, and
204
     * subsequent calls adds additional elements to the original list. See {@link
205
     * InvoiceUpdateLinesParams#lines} for the field documentation.
206
     */
207
    public Builder addAllLine(List<InvoiceUpdateLinesParams.Line> elements) {
208
      if (this.lines == null) {
×
209
        this.lines = new ArrayList<>();
×
210
      }
211
      this.lines.addAll(elements);
×
212
      return this;
×
213
    }
214
  }
215

216
  @Getter
217
  public static class Line {
218
    /**
219
     * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming
220
     * invoice. If you want to apply a credit to the customer's account, pass a negative amount.
221
     */
222
    @SerializedName("amount")
223
    Long amount;
224

225
    /**
226
     * An arbitrary string which you can attach to the invoice item. The description is displayed in
227
     * the invoice for easy tracking.
228
     */
229
    @SerializedName("description")
230
    String description;
231

232
    /**
233
     * Controls whether discounts apply to this line item. Defaults to false for prorations or
234
     * negative line items, and true for all other line items. Cannot be set to true for prorations.
235
     */
236
    @SerializedName("discountable")
237
    Boolean discountable;
238

239
    /**
240
     * The coupons, promotion codes &amp; existing discounts which apply to the line item. Item
241
     * discounts are applied before invoice discounts. Pass an empty string to remove
242
     * previously-defined discounts.
243
     */
244
    @SerializedName("discounts")
245
    Object discounts;
246

247
    /**
248
     * Map of extra parameters for custom features not available in this client library. The content
249
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
250
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
251
     * param object. Effectively, this map is flattened to its parent instance.
252
     */
253
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
254
    Map<String, Object> extraParams;
255

256
    /** <strong>Required.</strong> ID of an existing line item on the invoice. */
257
    @SerializedName("id")
258
    String id;
259

260
    /**
261
     * The IDs of the margins to apply to the line item. When set, the {@code default_margins} on
262
     * the invoice do not apply to this line item.
263
     */
264
    @SerializedName("margins")
265
    Object margins;
266

267
    /**
268
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
269
     * to an object. This can be useful for storing additional information about the object in a
270
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
271
     * can be unset by posting an empty value to {@code metadata}. For <a
272
     * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type">type=subscription</a>
273
     * line items, the incoming metadata specified on the request is directly used to set this
274
     * value, in contrast to <a
275
     * href="api/invoices/line_item#invoice_line_item_object-type">type=invoiceitem</a> line items,
276
     * where any existing metadata on the invoice line is merged with the incoming data.
277
     */
278
    @SerializedName("metadata")
279
    Object metadata;
280

281
    /**
282
     * The period associated with this invoice item. When set to different values, the period will
283
     * be rendered on the invoice. If you have <a
284
     * href="https://stripe.com/docs/revenue-recognition">Stripe Revenue Recognition</a> enabled,
285
     * the period will be used to recognize and defer revenue. See the <a
286
     * href="https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing">Revenue
287
     * Recognition documentation</a> for details.
288
     */
289
    @SerializedName("period")
290
    Period period;
291

292
    /** The ID of the price object. One of {@code price} or {@code price_data} is required. */
293
    @SerializedName("price")
294
    String price;
295

296
    /**
297
     * Data used to generate a new <a href="https://stripe.com/docs/api/prices">Price</a> object
298
     * inline. One of {@code price} or {@code price_data} is required.
299
     */
300
    @SerializedName("price_data")
301
    PriceData priceData;
302

303
    /** Non-negative integer. The quantity of units for the line item. */
304
    @SerializedName("quantity")
305
    Long quantity;
306

307
    /**
308
     * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes
309
     * on your own or use a third-party to calculate them. You cannot set tax amounts if any line
310
     * item has <a
311
     * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates">tax_rates</a>
312
     * or if the invoice has <a
313
     * href="https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates">default_tax_rates</a>
314
     * or uses <a href="https://stripe.com/docs/tax/invoicing">automatic tax</a>. Pass an empty
315
     * string to remove previously defined tax amounts.
316
     */
317
    @SerializedName("tax_amounts")
318
    Object taxAmounts;
319

320
    /**
321
     * The tax rates which apply to the line item. When set, the {@code default_tax_rates} on the
322
     * invoice do not apply to this line item. Pass an empty string to remove previously-defined tax
323
     * rates.
324
     */
325
    @SerializedName("tax_rates")
326
    Object taxRates;
327

328
    private Line(
329
        Long amount,
330
        String description,
331
        Boolean discountable,
332
        Object discounts,
333
        Map<String, Object> extraParams,
334
        String id,
335
        Object margins,
336
        Object metadata,
337
        Period period,
338
        String price,
339
        PriceData priceData,
340
        Long quantity,
341
        Object taxAmounts,
342
        Object taxRates) {
×
343
      this.amount = amount;
×
344
      this.description = description;
×
345
      this.discountable = discountable;
×
346
      this.discounts = discounts;
×
347
      this.extraParams = extraParams;
×
348
      this.id = id;
×
349
      this.margins = margins;
×
350
      this.metadata = metadata;
×
351
      this.period = period;
×
352
      this.price = price;
×
353
      this.priceData = priceData;
×
354
      this.quantity = quantity;
×
355
      this.taxAmounts = taxAmounts;
×
356
      this.taxRates = taxRates;
×
357
    }
×
358

359
    public static Builder builder() {
360
      return new Builder();
×
361
    }
362

363
    public static class Builder {
×
364
      private Long amount;
365

366
      private String description;
367

368
      private Boolean discountable;
369

370
      private Object discounts;
371

372
      private Map<String, Object> extraParams;
373

374
      private String id;
375

376
      private Object margins;
377

378
      private Object metadata;
379

380
      private Period period;
381

382
      private String price;
383

384
      private PriceData priceData;
385

386
      private Long quantity;
387

388
      private Object taxAmounts;
389

390
      private Object taxRates;
391

392
      /** Finalize and obtain parameter instance from this builder. */
393
      public InvoiceUpdateLinesParams.Line build() {
394
        return new InvoiceUpdateLinesParams.Line(
×
395
            this.amount,
396
            this.description,
397
            this.discountable,
398
            this.discounts,
399
            this.extraParams,
400
            this.id,
401
            this.margins,
402
            this.metadata,
403
            this.period,
404
            this.price,
405
            this.priceData,
406
            this.quantity,
407
            this.taxAmounts,
408
            this.taxRates);
409
      }
410

411
      /**
412
       * The integer amount in cents (or local equivalent) of the charge to be applied to the
413
       * upcoming invoice. If you want to apply a credit to the customer's account, pass a negative
414
       * amount.
415
       */
416
      public Builder setAmount(Long amount) {
417
        this.amount = amount;
×
418
        return this;
×
419
      }
420

421
      /**
422
       * An arbitrary string which you can attach to the invoice item. The description is displayed
423
       * in the invoice for easy tracking.
424
       */
425
      public Builder setDescription(String description) {
426
        this.description = description;
×
427
        return this;
×
428
      }
429

430
      /**
431
       * Controls whether discounts apply to this line item. Defaults to false for prorations or
432
       * negative line items, and true for all other line items. Cannot be set to true for
433
       * prorations.
434
       */
435
      public Builder setDiscountable(Boolean discountable) {
436
        this.discountable = discountable;
×
437
        return this;
×
438
      }
439

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

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

468
      /**
469
       * The coupons, promotion codes &amp; existing discounts which apply to the line item. Item
470
       * discounts are applied before invoice discounts. Pass an empty string to remove
471
       * previously-defined discounts.
472
       */
473
      public Builder setDiscounts(EmptyParam discounts) {
474
        this.discounts = discounts;
×
475
        return this;
×
476
      }
477

478
      /**
479
       * The coupons, promotion codes &amp; existing discounts which apply to the line item. Item
480
       * discounts are applied before invoice discounts. Pass an empty string to remove
481
       * previously-defined discounts.
482
       */
483
      public Builder setDiscounts(List<InvoiceUpdateLinesParams.Line.Discount> discounts) {
484
        this.discounts = discounts;
×
485
        return this;
×
486
      }
487

488
      /**
489
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
490
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
491
       * InvoiceUpdateLinesParams.Line#extraParams} for the field documentation.
492
       */
493
      public Builder putExtraParam(String key, Object value) {
494
        if (this.extraParams == null) {
×
495
          this.extraParams = new HashMap<>();
×
496
        }
497
        this.extraParams.put(key, value);
×
498
        return this;
×
499
      }
500

501
      /**
502
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
503
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
504
       * See {@link InvoiceUpdateLinesParams.Line#extraParams} for the field documentation.
505
       */
506
      public Builder putAllExtraParam(Map<String, Object> map) {
507
        if (this.extraParams == null) {
×
508
          this.extraParams = new HashMap<>();
×
509
        }
510
        this.extraParams.putAll(map);
×
511
        return this;
×
512
      }
513

514
      /** <strong>Required.</strong> ID of an existing line item on the invoice. */
515
      public Builder setId(String id) {
516
        this.id = id;
×
517
        return this;
×
518
      }
519

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

534
      /**
535
       * Add all elements to `margins` list. A list is initialized for the first `add/addAll` call,
536
       * and subsequent calls adds additional elements to the original list. See {@link
537
       * InvoiceUpdateLinesParams.Line#margins} for the field documentation.
538
       */
539
      @SuppressWarnings("unchecked")
540
      public Builder addAllMargin(List<String> elements) {
541
        if (this.margins == null || this.margins instanceof EmptyParam) {
×
542
          this.margins = new ArrayList<String>();
×
543
        }
544
        ((List<String>) this.margins).addAll(elements);
×
545
        return this;
×
546
      }
547

548
      /**
549
       * The IDs of the margins to apply to the line item. When set, the {@code default_margins} on
550
       * the invoice do not apply to this line item.
551
       */
552
      public Builder setMargins(EmptyParam margins) {
553
        this.margins = margins;
×
554
        return this;
×
555
      }
556

557
      /**
558
       * The IDs of the margins to apply to the line item. When set, the {@code default_margins} on
559
       * the invoice do not apply to this line item.
560
       */
561
      public Builder setMargins(List<String> margins) {
562
        this.margins = margins;
×
563
        return this;
×
564
      }
565

566
      /**
567
       * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
568
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
569
       * InvoiceUpdateLinesParams.Line#metadata} for the field documentation.
570
       */
571
      @SuppressWarnings("unchecked")
572
      public Builder putMetadata(String key, String value) {
573
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
574
          this.metadata = new HashMap<String, String>();
×
575
        }
576
        ((Map<String, String>) this.metadata).put(key, value);
×
577
        return this;
×
578
      }
579

580
      /**
581
       * Add all map key/value pairs to `metadata` map. A map is initialized for the first
582
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
583
       * See {@link InvoiceUpdateLinesParams.Line#metadata} for the field documentation.
584
       */
585
      @SuppressWarnings("unchecked")
586
      public Builder putAllMetadata(Map<String, String> map) {
587
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
588
          this.metadata = new HashMap<String, String>();
×
589
        }
590
        ((Map<String, String>) this.metadata).putAll(map);
×
591
        return this;
×
592
      }
593

594
      /**
595
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
596
       * attach to an object. This can be useful for storing additional information about the object
597
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
598
       * keys can be unset by posting an empty value to {@code metadata}. For <a
599
       * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type">type=subscription</a>
600
       * line items, the incoming metadata specified on the request is directly used to set this
601
       * value, in contrast to <a
602
       * href="api/invoices/line_item#invoice_line_item_object-type">type=invoiceitem</a> line
603
       * items, where any existing metadata on the invoice line is merged with the incoming data.
604
       */
605
      public Builder setMetadata(EmptyParam metadata) {
606
        this.metadata = metadata;
×
607
        return this;
×
608
      }
609

610
      /**
611
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
612
       * attach to an object. This can be useful for storing additional information about the object
613
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
614
       * keys can be unset by posting an empty value to {@code metadata}. For <a
615
       * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type">type=subscription</a>
616
       * line items, the incoming metadata specified on the request is directly used to set this
617
       * value, in contrast to <a
618
       * href="api/invoices/line_item#invoice_line_item_object-type">type=invoiceitem</a> line
619
       * items, where any existing metadata on the invoice line is merged with the incoming data.
620
       */
621
      public Builder setMetadata(Map<String, String> metadata) {
622
        this.metadata = metadata;
×
623
        return this;
×
624
      }
625

626
      /**
627
       * The period associated with this invoice item. When set to different values, the period will
628
       * be rendered on the invoice. If you have <a
629
       * href="https://stripe.com/docs/revenue-recognition">Stripe Revenue Recognition</a> enabled,
630
       * the period will be used to recognize and defer revenue. See the <a
631
       * href="https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing">Revenue
632
       * Recognition documentation</a> for details.
633
       */
634
      public Builder setPeriod(InvoiceUpdateLinesParams.Line.Period period) {
635
        this.period = period;
×
636
        return this;
×
637
      }
638

639
      /** The ID of the price object. One of {@code price} or {@code price_data} is required. */
640
      public Builder setPrice(String price) {
641
        this.price = price;
×
642
        return this;
×
643
      }
644

645
      /**
646
       * Data used to generate a new <a href="https://stripe.com/docs/api/prices">Price</a> object
647
       * inline. One of {@code price} or {@code price_data} is required.
648
       */
649
      public Builder setPriceData(InvoiceUpdateLinesParams.Line.PriceData priceData) {
650
        this.priceData = priceData;
×
651
        return this;
×
652
      }
653

654
      /** Non-negative integer. The quantity of units for the line item. */
655
      public Builder setQuantity(Long quantity) {
656
        this.quantity = quantity;
×
657
        return this;
×
658
      }
659

660
      /**
661
       * Add an element to `taxAmounts` list. A list is initialized for the first `add/addAll` call,
662
       * and subsequent calls adds additional elements to the original list. See {@link
663
       * InvoiceUpdateLinesParams.Line#taxAmounts} for the field documentation.
664
       */
665
      @SuppressWarnings("unchecked")
666
      public Builder addTaxAmount(InvoiceUpdateLinesParams.Line.TaxAmount element) {
667
        if (this.taxAmounts == null || this.taxAmounts instanceof EmptyParam) {
×
668
          this.taxAmounts = new ArrayList<InvoiceUpdateLinesParams.Line.TaxAmount>();
×
669
        }
670
        ((List<InvoiceUpdateLinesParams.Line.TaxAmount>) this.taxAmounts).add(element);
×
671
        return this;
×
672
      }
673

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

688
      /**
689
       * A list of up to 10 tax amounts for this line item. This can be useful if you calculate
690
       * taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any
691
       * line item has <a
692
       * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates">tax_rates</a>
693
       * or if the invoice has <a
694
       * href="https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates">default_tax_rates</a>
695
       * or uses <a href="https://stripe.com/docs/tax/invoicing">automatic tax</a>. Pass an empty
696
       * string to remove previously defined tax amounts.
697
       */
698
      public Builder setTaxAmounts(EmptyParam taxAmounts) {
699
        this.taxAmounts = taxAmounts;
×
700
        return this;
×
701
      }
702

703
      /**
704
       * A list of up to 10 tax amounts for this line item. This can be useful if you calculate
705
       * taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any
706
       * line item has <a
707
       * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates">tax_rates</a>
708
       * or if the invoice has <a
709
       * href="https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates">default_tax_rates</a>
710
       * or uses <a href="https://stripe.com/docs/tax/invoicing">automatic tax</a>. Pass an empty
711
       * string to remove previously defined tax amounts.
712
       */
713
      public Builder setTaxAmounts(List<InvoiceUpdateLinesParams.Line.TaxAmount> taxAmounts) {
714
        this.taxAmounts = taxAmounts;
×
715
        return this;
×
716
      }
717

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

732
      /**
733
       * Add all elements to `taxRates` list. A list is initialized for the first `add/addAll` call,
734
       * and subsequent calls adds additional elements to the original list. See {@link
735
       * InvoiceUpdateLinesParams.Line#taxRates} for the field documentation.
736
       */
737
      @SuppressWarnings("unchecked")
738
      public Builder addAllTaxRate(List<String> elements) {
739
        if (this.taxRates == null || this.taxRates instanceof EmptyParam) {
×
740
          this.taxRates = new ArrayList<String>();
×
741
        }
742
        ((List<String>) this.taxRates).addAll(elements);
×
743
        return this;
×
744
      }
745

746
      /**
747
       * The tax rates which apply to the line item. When set, the {@code default_tax_rates} on the
748
       * invoice do not apply to this line item. Pass an empty string to remove previously-defined
749
       * tax rates.
750
       */
751
      public Builder setTaxRates(EmptyParam taxRates) {
752
        this.taxRates = taxRates;
×
753
        return this;
×
754
      }
755

756
      /**
757
       * The tax rates which apply to the line item. When set, the {@code default_tax_rates} on the
758
       * invoice do not apply to this line item. Pass an empty string to remove previously-defined
759
       * tax rates.
760
       */
761
      public Builder setTaxRates(List<String> taxRates) {
762
        this.taxRates = taxRates;
×
763
        return this;
×
764
      }
765
    }
766

767
    @Getter
768
    public static class Discount {
769
      /** ID of the coupon to create a new discount for. */
770
      @SerializedName("coupon")
771
      String coupon;
772

773
      /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
774
      @SerializedName("discount")
775
      String discount;
776

777
      /** Details to determine how long the discount should be applied for. */
778
      @SerializedName("discount_end")
779
      DiscountEnd discountEnd;
780

781
      /**
782
       * Map of extra parameters for custom features not available in this client library. The
783
       * content in this map is not serialized under this field's {@code @SerializedName} value.
784
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
785
       * name in this param object. Effectively, this map is flattened to its parent instance.
786
       */
787
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
788
      Map<String, Object> extraParams;
789

790
      /** ID of the promotion code to create a new discount for. */
791
      @SerializedName("promotion_code")
792
      String promotionCode;
793

794
      private Discount(
795
          String coupon,
796
          String discount,
797
          DiscountEnd discountEnd,
798
          Map<String, Object> extraParams,
799
          String promotionCode) {
×
800
        this.coupon = coupon;
×
801
        this.discount = discount;
×
802
        this.discountEnd = discountEnd;
×
803
        this.extraParams = extraParams;
×
804
        this.promotionCode = promotionCode;
×
805
      }
×
806

807
      public static Builder builder() {
808
        return new Builder();
×
809
      }
810

811
      public static class Builder {
×
812
        private String coupon;
813

814
        private String discount;
815

816
        private DiscountEnd discountEnd;
817

818
        private Map<String, Object> extraParams;
819

820
        private String promotionCode;
821

822
        /** Finalize and obtain parameter instance from this builder. */
823
        public InvoiceUpdateLinesParams.Line.Discount build() {
824
          return new InvoiceUpdateLinesParams.Line.Discount(
×
825
              this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode);
826
        }
827

828
        /** ID of the coupon to create a new discount for. */
829
        public Builder setCoupon(String coupon) {
830
          this.coupon = coupon;
×
831
          return this;
×
832
        }
833

834
        /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
835
        public Builder setDiscount(String discount) {
836
          this.discount = discount;
×
837
          return this;
×
838
        }
839

840
        /** Details to determine how long the discount should be applied for. */
841
        public Builder setDiscountEnd(
842
            InvoiceUpdateLinesParams.Line.Discount.DiscountEnd discountEnd) {
843
          this.discountEnd = discountEnd;
×
844
          return this;
×
845
        }
846

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

861
        /**
862
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
863
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
864
         * map. See {@link InvoiceUpdateLinesParams.Line.Discount#extraParams} for the field
865
         * 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
        /** ID of the promotion code to create a new discount for. */
876
        public Builder setPromotionCode(String promotionCode) {
877
          this.promotionCode = promotionCode;
×
878
          return this;
×
879
        }
880
      }
881

882
      @Getter
883
      public static class DiscountEnd {
884
        /** Time span for the redeemed discount. */
885
        @SerializedName("duration")
886
        Duration duration;
887

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

898
        /** A precise Unix timestamp for the discount to end. Must be in the future. */
899
        @SerializedName("timestamp")
900
        Long timestamp;
901

902
        /**
903
         * <strong>Required.</strong> The type of calculation made to determine when the discount
904
         * ends.
905
         */
906
        @SerializedName("type")
907
        Type type;
908

909
        private DiscountEnd(
910
            Duration duration, Map<String, Object> extraParams, Long timestamp, Type type) {
×
911
          this.duration = duration;
×
912
          this.extraParams = extraParams;
×
913
          this.timestamp = timestamp;
×
914
          this.type = type;
×
915
        }
×
916

917
        public static Builder builder() {
918
          return new Builder();
×
919
        }
920

921
        public static class Builder {
×
922
          private Duration duration;
923

924
          private Map<String, Object> extraParams;
925

926
          private Long timestamp;
927

928
          private Type type;
929

930
          /** Finalize and obtain parameter instance from this builder. */
931
          public InvoiceUpdateLinesParams.Line.Discount.DiscountEnd build() {
932
            return new InvoiceUpdateLinesParams.Line.Discount.DiscountEnd(
×
933
                this.duration, this.extraParams, this.timestamp, this.type);
934
          }
935

936
          /** Time span for the redeemed discount. */
937
          public Builder setDuration(
938
              InvoiceUpdateLinesParams.Line.Discount.DiscountEnd.Duration duration) {
939
            this.duration = duration;
×
940
            return this;
×
941
          }
942

943
          /**
944
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
945
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
946
           * map. See {@link InvoiceUpdateLinesParams.Line.Discount.DiscountEnd#extraParams} for the
947
           * field documentation.
948
           */
949
          public Builder putExtraParam(String key, Object value) {
950
            if (this.extraParams == null) {
×
951
              this.extraParams = new HashMap<>();
×
952
            }
953
            this.extraParams.put(key, value);
×
954
            return this;
×
955
          }
956

957
          /**
958
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
959
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
960
           * map. See {@link InvoiceUpdateLinesParams.Line.Discount.DiscountEnd#extraParams} for the
961
           * field documentation.
962
           */
963
          public Builder putAllExtraParam(Map<String, Object> map) {
964
            if (this.extraParams == null) {
×
965
              this.extraParams = new HashMap<>();
×
966
            }
967
            this.extraParams.putAll(map);
×
968
            return this;
×
969
          }
970

971
          /** A precise Unix timestamp for the discount to end. Must be in the future. */
972
          public Builder setTimestamp(Long timestamp) {
973
            this.timestamp = timestamp;
×
974
            return this;
×
975
          }
976

977
          /**
978
           * <strong>Required.</strong> The type of calculation made to determine when the discount
979
           * ends.
980
           */
981
          public Builder setType(InvoiceUpdateLinesParams.Line.Discount.DiscountEnd.Type type) {
982
            this.type = type;
×
983
            return this;
×
984
          }
985
        }
986

987
        @Getter
988
        public static class Duration {
989
          /**
990
           * Map of extra parameters for custom features not available in this client library. The
991
           * content in this map is not serialized under this field's {@code @SerializedName} value.
992
           * Instead, each key/value pair is serialized as if the key is a root-level field
993
           * (serialized) name in this param object. Effectively, this map is flattened to its
994
           * parent instance.
995
           */
996
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
997
          Map<String, Object> extraParams;
998

999
          /**
1000
           * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day},
1001
           * {@code week}, {@code month} or {@code year}.
1002
           */
1003
          @SerializedName("interval")
1004
          Interval interval;
1005

1006
          /**
1007
           * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
1008
           * Stripe multiplies this by the interval type to get the overall duration.
1009
           */
1010
          @SerializedName("interval_count")
1011
          Long intervalCount;
1012

1013
          private Duration(Map<String, Object> extraParams, Interval interval, Long intervalCount) {
×
1014
            this.extraParams = extraParams;
×
1015
            this.interval = interval;
×
1016
            this.intervalCount = intervalCount;
×
1017
          }
×
1018

1019
          public static Builder builder() {
1020
            return new Builder();
×
1021
          }
1022

1023
          public static class Builder {
×
1024
            private Map<String, Object> extraParams;
1025

1026
            private Interval interval;
1027

1028
            private Long intervalCount;
1029

1030
            /** Finalize and obtain parameter instance from this builder. */
1031
            public InvoiceUpdateLinesParams.Line.Discount.DiscountEnd.Duration build() {
1032
              return new InvoiceUpdateLinesParams.Line.Discount.DiscountEnd.Duration(
×
1033
                  this.extraParams, this.interval, this.intervalCount);
1034
            }
1035

1036
            /**
1037
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
1038
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
1039
             * original map. See {@link
1040
             * InvoiceUpdateLinesParams.Line.Discount.DiscountEnd.Duration#extraParams} for the
1041
             * field documentation.
1042
             */
1043
            public Builder putExtraParam(String key, Object value) {
1044
              if (this.extraParams == null) {
×
1045
                this.extraParams = new HashMap<>();
×
1046
              }
1047
              this.extraParams.put(key, value);
×
1048
              return this;
×
1049
            }
1050

1051
            /**
1052
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1053
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
1054
             * original map. See {@link
1055
             * InvoiceUpdateLinesParams.Line.Discount.DiscountEnd.Duration#extraParams} for the
1056
             * field documentation.
1057
             */
1058
            public Builder putAllExtraParam(Map<String, Object> map) {
1059
              if (this.extraParams == null) {
×
1060
                this.extraParams = new HashMap<>();
×
1061
              }
1062
              this.extraParams.putAll(map);
×
1063
              return this;
×
1064
            }
1065

1066
            /**
1067
             * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day},
1068
             * {@code week}, {@code month} or {@code year}.
1069
             */
1070
            public Builder setInterval(
1071
                InvoiceUpdateLinesParams.Line.Discount.DiscountEnd.Duration.Interval interval) {
1072
              this.interval = interval;
×
1073
              return this;
×
1074
            }
1075

1076
            /**
1077
             * <strong>Required.</strong> The number of intervals, as an whole number greater than
1078
             * 0. Stripe multiplies this by the interval type to get the overall duration.
1079
             */
1080
            public Builder setIntervalCount(Long intervalCount) {
1081
              this.intervalCount = intervalCount;
×
1082
              return this;
×
1083
            }
1084
          }
1085

1086
          public enum Interval implements ApiRequestParams.EnumParam {
×
1087
            @SerializedName("day")
×
1088
            DAY("day"),
1089

1090
            @SerializedName("month")
×
1091
            MONTH("month"),
1092

1093
            @SerializedName("week")
×
1094
            WEEK("week"),
1095

1096
            @SerializedName("year")
×
1097
            YEAR("year");
1098

1099
            @Getter(onMethod_ = {@Override})
1100
            private final String value;
1101

1102
            Interval(String value) {
×
1103
              this.value = value;
×
1104
            }
×
1105
          }
1106
        }
1107

1108
        public enum Type implements ApiRequestParams.EnumParam {
×
1109
          @SerializedName("duration")
×
1110
          DURATION("duration"),
1111

1112
          @SerializedName("timestamp")
×
1113
          TIMESTAMP("timestamp");
1114

1115
          @Getter(onMethod_ = {@Override})
1116
          private final String value;
1117

1118
          Type(String value) {
×
1119
            this.value = value;
×
1120
          }
×
1121
        }
1122
      }
1123
    }
1124

1125
    @Getter
1126
    public static class Period {
1127
      /**
1128
       * <strong>Required.</strong> The end of the period, which must be greater than or equal to
1129
       * the start. This value is inclusive.
1130
       */
1131
      @SerializedName("end")
1132
      Long end;
1133

1134
      /**
1135
       * Map of extra parameters for custom features not available in this client library. The
1136
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1137
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1138
       * name in this param object. Effectively, this map is flattened to its parent instance.
1139
       */
1140
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1141
      Map<String, Object> extraParams;
1142

1143
      /** <strong>Required.</strong> The start of the period. This value is inclusive. */
1144
      @SerializedName("start")
1145
      Long start;
1146

1147
      private Period(Long end, Map<String, Object> extraParams, Long start) {
×
1148
        this.end = end;
×
1149
        this.extraParams = extraParams;
×
1150
        this.start = start;
×
1151
      }
×
1152

1153
      public static Builder builder() {
1154
        return new Builder();
×
1155
      }
1156

1157
      public static class Builder {
×
1158
        private Long end;
1159

1160
        private Map<String, Object> extraParams;
1161

1162
        private Long start;
1163

1164
        /** Finalize and obtain parameter instance from this builder. */
1165
        public InvoiceUpdateLinesParams.Line.Period build() {
1166
          return new InvoiceUpdateLinesParams.Line.Period(this.end, this.extraParams, this.start);
×
1167
        }
1168

1169
        /**
1170
         * <strong>Required.</strong> The end of the period, which must be greater than or equal to
1171
         * the start. This value is inclusive.
1172
         */
1173
        public Builder setEnd(Long end) {
1174
          this.end = end;
×
1175
          return this;
×
1176
        }
1177

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

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

1206
        /** <strong>Required.</strong> The start of the period. This value is inclusive. */
1207
        public Builder setStart(Long start) {
1208
          this.start = start;
×
1209
          return this;
×
1210
        }
1211
      }
1212
    }
1213

1214
    @Getter
1215
    public static class PriceData {
1216
      /**
1217
       * <strong>Required.</strong> Three-letter <a
1218
       * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
1219
       * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
1220
       */
1221
      @SerializedName("currency")
1222
      String currency;
1223

1224
      /**
1225
       * Map of extra parameters for custom features not available in this client library. The
1226
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1227
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1228
       * name in this param object. Effectively, this map is flattened to its parent instance.
1229
       */
1230
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1231
      Map<String, Object> extraParams;
1232

1233
      /**
1234
       * The ID of the product that this price will belong to. One of {@code product} or {@code
1235
       * product_data} is required.
1236
       */
1237
      @SerializedName("product")
1238
      String product;
1239

1240
      /**
1241
       * Data used to generate a new product object inline. One of {@code product} or {@code
1242
       * product_data} is required.
1243
       */
1244
      @SerializedName("product_data")
1245
      ProductData productData;
1246

1247
      /**
1248
       * Only required if a <a
1249
       * href="https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)">default
1250
       * tax behavior</a> was not provided in the Stripe Tax settings. Specifies whether the price
1251
       * is considered inclusive of taxes or exclusive of taxes. One of {@code inclusive}, {@code
1252
       * exclusive}, or {@code unspecified}. Once specified as either {@code inclusive} or {@code
1253
       * exclusive}, it cannot be changed.
1254
       */
1255
      @SerializedName("tax_behavior")
1256
      TaxBehavior taxBehavior;
1257

1258
      /**
1259
       * A non-negative integer in cents (or local equivalent) representing how much to charge. One
1260
       * of {@code unit_amount} or {@code unit_amount_decimal} is required.
1261
       */
1262
      @SerializedName("unit_amount")
1263
      Long unitAmount;
1264

1265
      /**
1266
       * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent)
1267
       * with at most 12 decimal places. Only one of {@code unit_amount} and {@code
1268
       * unit_amount_decimal} can be set.
1269
       */
1270
      @SerializedName("unit_amount_decimal")
1271
      BigDecimal unitAmountDecimal;
1272

1273
      private PriceData(
1274
          String currency,
1275
          Map<String, Object> extraParams,
1276
          String product,
1277
          ProductData productData,
1278
          TaxBehavior taxBehavior,
1279
          Long unitAmount,
1280
          BigDecimal unitAmountDecimal) {
×
1281
        this.currency = currency;
×
1282
        this.extraParams = extraParams;
×
1283
        this.product = product;
×
1284
        this.productData = productData;
×
1285
        this.taxBehavior = taxBehavior;
×
1286
        this.unitAmount = unitAmount;
×
1287
        this.unitAmountDecimal = unitAmountDecimal;
×
1288
      }
×
1289

1290
      public static Builder builder() {
1291
        return new Builder();
×
1292
      }
1293

1294
      public static class Builder {
×
1295
        private String currency;
1296

1297
        private Map<String, Object> extraParams;
1298

1299
        private String product;
1300

1301
        private ProductData productData;
1302

1303
        private TaxBehavior taxBehavior;
1304

1305
        private Long unitAmount;
1306

1307
        private BigDecimal unitAmountDecimal;
1308

1309
        /** Finalize and obtain parameter instance from this builder. */
1310
        public InvoiceUpdateLinesParams.Line.PriceData build() {
1311
          return new InvoiceUpdateLinesParams.Line.PriceData(
×
1312
              this.currency,
1313
              this.extraParams,
1314
              this.product,
1315
              this.productData,
1316
              this.taxBehavior,
1317
              this.unitAmount,
1318
              this.unitAmountDecimal);
1319
        }
1320

1321
        /**
1322
         * <strong>Required.</strong> Three-letter <a
1323
         * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
1324
         * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
1325
         */
1326
        public Builder setCurrency(String currency) {
1327
          this.currency = currency;
×
1328
          return this;
×
1329
        }
1330

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

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

1359
        /**
1360
         * The ID of the product that this price will belong to. One of {@code product} or {@code
1361
         * product_data} is required.
1362
         */
1363
        public Builder setProduct(String product) {
1364
          this.product = product;
×
1365
          return this;
×
1366
        }
1367

1368
        /**
1369
         * Data used to generate a new product object inline. One of {@code product} or {@code
1370
         * product_data} is required.
1371
         */
1372
        public Builder setProductData(
1373
            InvoiceUpdateLinesParams.Line.PriceData.ProductData productData) {
1374
          this.productData = productData;
×
1375
          return this;
×
1376
        }
1377

1378
        /**
1379
         * Only required if a <a
1380
         * href="https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)">default
1381
         * tax behavior</a> was not provided in the Stripe Tax settings. Specifies whether the price
1382
         * is considered inclusive of taxes or exclusive of taxes. One of {@code inclusive}, {@code
1383
         * exclusive}, or {@code unspecified}. Once specified as either {@code inclusive} or {@code
1384
         * exclusive}, it cannot be changed.
1385
         */
1386
        public Builder setTaxBehavior(
1387
            InvoiceUpdateLinesParams.Line.PriceData.TaxBehavior taxBehavior) {
1388
          this.taxBehavior = taxBehavior;
×
1389
          return this;
×
1390
        }
1391

1392
        /**
1393
         * A non-negative integer in cents (or local equivalent) representing how much to charge.
1394
         * One of {@code unit_amount} or {@code unit_amount_decimal} is required.
1395
         */
1396
        public Builder setUnitAmount(Long unitAmount) {
1397
          this.unitAmount = unitAmount;
×
1398
          return this;
×
1399
        }
1400

1401
        /**
1402
         * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent)
1403
         * with at most 12 decimal places. Only one of {@code unit_amount} and {@code
1404
         * unit_amount_decimal} can be set.
1405
         */
1406
        public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) {
1407
          this.unitAmountDecimal = unitAmountDecimal;
×
1408
          return this;
×
1409
        }
1410
      }
1411

1412
      @Getter
1413
      public static class ProductData {
1414
        /**
1415
         * The product's description, meant to be displayable to the customer. Use this field to
1416
         * optionally store a long form explanation of the product being sold for your own rendering
1417
         * purposes.
1418
         */
1419
        @SerializedName("description")
1420
        String description;
1421

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

1432
        /**
1433
         * A list of up to 8 URLs of images for this product, meant to be displayable to the
1434
         * customer.
1435
         */
1436
        @SerializedName("images")
1437
        List<String> images;
1438

1439
        /**
1440
         * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
1441
         * attach to an object. This can be useful for storing additional information about the
1442
         * object in a structured format. Individual keys can be unset by posting an empty value to
1443
         * them. All keys can be unset by posting an empty value to {@code metadata}.
1444
         */
1445
        @SerializedName("metadata")
1446
        Map<String, String> metadata;
1447

1448
        /**
1449
         * <strong>Required.</strong> The product's name, meant to be displayable to the customer.
1450
         */
1451
        @SerializedName("name")
1452
        String name;
1453

1454
        /** A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. */
1455
        @SerializedName("tax_code")
1456
        String taxCode;
1457

1458
        private ProductData(
1459
            String description,
1460
            Map<String, Object> extraParams,
1461
            List<String> images,
1462
            Map<String, String> metadata,
1463
            String name,
1464
            String taxCode) {
×
1465
          this.description = description;
×
1466
          this.extraParams = extraParams;
×
1467
          this.images = images;
×
1468
          this.metadata = metadata;
×
1469
          this.name = name;
×
1470
          this.taxCode = taxCode;
×
1471
        }
×
1472

1473
        public static Builder builder() {
1474
          return new Builder();
×
1475
        }
1476

1477
        public static class Builder {
×
1478
          private String description;
1479

1480
          private Map<String, Object> extraParams;
1481

1482
          private List<String> images;
1483

1484
          private Map<String, String> metadata;
1485

1486
          private String name;
1487

1488
          private String taxCode;
1489

1490
          /** Finalize and obtain parameter instance from this builder. */
1491
          public InvoiceUpdateLinesParams.Line.PriceData.ProductData build() {
1492
            return new InvoiceUpdateLinesParams.Line.PriceData.ProductData(
×
1493
                this.description,
1494
                this.extraParams,
1495
                this.images,
1496
                this.metadata,
1497
                this.name,
1498
                this.taxCode);
1499
          }
1500

1501
          /**
1502
           * The product's description, meant to be displayable to the customer. Use this field to
1503
           * optionally store a long form explanation of the product being sold for your own
1504
           * rendering purposes.
1505
           */
1506
          public Builder setDescription(String description) {
1507
            this.description = description;
×
1508
            return this;
×
1509
          }
1510

1511
          /**
1512
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1513
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1514
           * map. See {@link InvoiceUpdateLinesParams.Line.PriceData.ProductData#extraParams} for
1515
           * the field documentation.
1516
           */
1517
          public Builder putExtraParam(String key, Object value) {
1518
            if (this.extraParams == null) {
×
1519
              this.extraParams = new HashMap<>();
×
1520
            }
1521
            this.extraParams.put(key, value);
×
1522
            return this;
×
1523
          }
1524

1525
          /**
1526
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1527
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1528
           * map. See {@link InvoiceUpdateLinesParams.Line.PriceData.ProductData#extraParams} for
1529
           * the field documentation.
1530
           */
1531
          public Builder putAllExtraParam(Map<String, Object> map) {
1532
            if (this.extraParams == null) {
×
1533
              this.extraParams = new HashMap<>();
×
1534
            }
1535
            this.extraParams.putAll(map);
×
1536
            return this;
×
1537
          }
1538

1539
          /**
1540
           * Add an element to `images` list. A list is initialized for the first `add/addAll` call,
1541
           * and subsequent calls adds additional elements to the original list. See {@link
1542
           * InvoiceUpdateLinesParams.Line.PriceData.ProductData#images} for the field
1543
           * documentation.
1544
           */
1545
          public Builder addImage(String element) {
1546
            if (this.images == null) {
×
1547
              this.images = new ArrayList<>();
×
1548
            }
1549
            this.images.add(element);
×
1550
            return this;
×
1551
          }
1552

1553
          /**
1554
           * Add all elements to `images` list. A list is initialized for the first `add/addAll`
1555
           * call, and subsequent calls adds additional elements to the original list. See {@link
1556
           * InvoiceUpdateLinesParams.Line.PriceData.ProductData#images} for the field
1557
           * documentation.
1558
           */
1559
          public Builder addAllImage(List<String> elements) {
1560
            if (this.images == null) {
×
1561
              this.images = new ArrayList<>();
×
1562
            }
1563
            this.images.addAll(elements);
×
1564
            return this;
×
1565
          }
1566

1567
          /**
1568
           * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
1569
           * call, and subsequent calls add additional key/value pairs to the original map. See
1570
           * {@link InvoiceUpdateLinesParams.Line.PriceData.ProductData#metadata} for the field
1571
           * documentation.
1572
           */
1573
          public Builder putMetadata(String key, String value) {
1574
            if (this.metadata == null) {
×
1575
              this.metadata = new HashMap<>();
×
1576
            }
1577
            this.metadata.put(key, value);
×
1578
            return this;
×
1579
          }
1580

1581
          /**
1582
           * Add all map key/value pairs to `metadata` map. A map is initialized for the first
1583
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1584
           * map. See {@link InvoiceUpdateLinesParams.Line.PriceData.ProductData#metadata} for the
1585
           * field documentation.
1586
           */
1587
          public Builder putAllMetadata(Map<String, String> map) {
1588
            if (this.metadata == null) {
×
1589
              this.metadata = new HashMap<>();
×
1590
            }
1591
            this.metadata.putAll(map);
×
1592
            return this;
×
1593
          }
1594

1595
          /**
1596
           * <strong>Required.</strong> The product's name, meant to be displayable to the customer.
1597
           */
1598
          public Builder setName(String name) {
1599
            this.name = name;
×
1600
            return this;
×
1601
          }
1602

1603
          /** A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. */
1604
          public Builder setTaxCode(String taxCode) {
1605
            this.taxCode = taxCode;
×
1606
            return this;
×
1607
          }
1608
        }
1609
      }
1610

1611
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
1612
        @SerializedName("exclusive")
×
1613
        EXCLUSIVE("exclusive"),
1614

1615
        @SerializedName("inclusive")
×
1616
        INCLUSIVE("inclusive"),
1617

1618
        @SerializedName("unspecified")
×
1619
        UNSPECIFIED("unspecified");
1620

1621
        @Getter(onMethod_ = {@Override})
1622
        private final String value;
1623

1624
        TaxBehavior(String value) {
×
1625
          this.value = value;
×
1626
        }
×
1627
      }
1628
    }
1629

1630
    @Getter
1631
    public static class TaxAmount {
1632
      /** <strong>Required.</strong> The amount, in cents (or local equivalent), of the tax. */
1633
      @SerializedName("amount")
1634
      Long amount;
1635

1636
      /**
1637
       * Map of extra parameters for custom features not available in this client library. The
1638
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1639
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1640
       * name in this param object. Effectively, this map is flattened to its parent instance.
1641
       */
1642
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1643
      Map<String, Object> extraParams;
1644

1645
      /**
1646
       * <strong>Required.</strong> Data to find or create a TaxRate object.
1647
       *
1648
       * <p>Stripe automatically creates or reuses a TaxRate object for each tax amount. If the
1649
       * {@code tax_rate_data} exactly matches a previous value, Stripe will reuse the TaxRate
1650
       * object. TaxRate objects created automatically by Stripe are immediately archived, do not
1651
       * appear in the line item’s {@code tax_rates}, and cannot be directly added to invoices,
1652
       * payments, or line items.
1653
       */
1654
      @SerializedName("tax_rate_data")
1655
      TaxRateData taxRateData;
1656

1657
      /**
1658
       * <strong>Required.</strong> The amount on which tax is calculated, in cents (or local
1659
       * equivalent).
1660
       */
1661
      @SerializedName("taxable_amount")
1662
      Long taxableAmount;
1663

1664
      private TaxAmount(
1665
          Long amount,
1666
          Map<String, Object> extraParams,
1667
          TaxRateData taxRateData,
1668
          Long taxableAmount) {
×
1669
        this.amount = amount;
×
1670
        this.extraParams = extraParams;
×
1671
        this.taxRateData = taxRateData;
×
1672
        this.taxableAmount = taxableAmount;
×
1673
      }
×
1674

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

1679
      public static class Builder {
×
1680
        private Long amount;
1681

1682
        private Map<String, Object> extraParams;
1683

1684
        private TaxRateData taxRateData;
1685

1686
        private Long taxableAmount;
1687

1688
        /** Finalize and obtain parameter instance from this builder. */
1689
        public InvoiceUpdateLinesParams.Line.TaxAmount build() {
1690
          return new InvoiceUpdateLinesParams.Line.TaxAmount(
×
1691
              this.amount, this.extraParams, this.taxRateData, this.taxableAmount);
1692
        }
1693

1694
        /** <strong>Required.</strong> The amount, in cents (or local equivalent), of the tax. */
1695
        public Builder setAmount(Long amount) {
1696
          this.amount = amount;
×
1697
          return this;
×
1698
        }
1699

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

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

1728
        /**
1729
         * <strong>Required.</strong> Data to find or create a TaxRate object.
1730
         *
1731
         * <p>Stripe automatically creates or reuses a TaxRate object for each tax amount. If the
1732
         * {@code tax_rate_data} exactly matches a previous value, Stripe will reuse the TaxRate
1733
         * object. TaxRate objects created automatically by Stripe are immediately archived, do not
1734
         * appear in the line item’s {@code tax_rates}, and cannot be directly added to invoices,
1735
         * payments, or line items.
1736
         */
1737
        public Builder setTaxRateData(
1738
            InvoiceUpdateLinesParams.Line.TaxAmount.TaxRateData taxRateData) {
1739
          this.taxRateData = taxRateData;
×
1740
          return this;
×
1741
        }
1742

1743
        /**
1744
         * <strong>Required.</strong> The amount on which tax is calculated, in cents (or local
1745
         * equivalent).
1746
         */
1747
        public Builder setTaxableAmount(Long taxableAmount) {
1748
          this.taxableAmount = taxableAmount;
×
1749
          return this;
×
1750
        }
1751
      }
1752

1753
      @Getter
1754
      public static class TaxRateData {
1755
        /**
1756
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
1757
         * 3166-1 alpha-2</a>).
1758
         */
1759
        @SerializedName("country")
1760
        String country;
1761

1762
        /**
1763
         * An arbitrary string attached to the tax rate for your internal use only. It will not be
1764
         * visible to your customers.
1765
         */
1766
        @SerializedName("description")
1767
        String description;
1768

1769
        /**
1770
         * <strong>Required.</strong> The display name of the tax rate, which will be shown to
1771
         * users.
1772
         */
1773
        @SerializedName("display_name")
1774
        String displayName;
1775

1776
        /**
1777
         * Map of extra parameters for custom features not available in this client library. The
1778
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1779
         * Instead, each key/value pair is serialized as if the key is a root-level field
1780
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1781
         * instance.
1782
         */
1783
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1784
        Map<String, Object> extraParams;
1785

1786
        /** <strong>Required.</strong> This specifies if the tax rate is inclusive or exclusive. */
1787
        @SerializedName("inclusive")
1788
        Boolean inclusive;
1789

1790
        /**
1791
         * The jurisdiction for the tax rate. You can use this label field for tax reporting
1792
         * purposes. It also appears on your customer’s invoice.
1793
         */
1794
        @SerializedName("jurisdiction")
1795
        String jurisdiction;
1796

1797
        /**
1798
         * <strong>Required.</strong> The statutory tax rate percent. This field accepts decimal
1799
         * values between 0 and 100 inclusive with at most 4 decimal places. To accommodate
1800
         * fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages
1801
         * on the invoice unless the {@code amount} of the tax is also zero.
1802
         */
1803
        @SerializedName("percentage")
1804
        BigDecimal percentage;
1805

1806
        /**
1807
         * <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>,
1808
         * without country prefix. For example, &quot;NY&quot; for New York, United States.
1809
         */
1810
        @SerializedName("state")
1811
        String state;
1812

1813
        /** The high-level tax type, such as {@code vat} or {@code sales_tax}. */
1814
        @SerializedName("tax_type")
1815
        TaxType taxType;
1816

1817
        private TaxRateData(
1818
            String country,
1819
            String description,
1820
            String displayName,
1821
            Map<String, Object> extraParams,
1822
            Boolean inclusive,
1823
            String jurisdiction,
1824
            BigDecimal percentage,
1825
            String state,
1826
            TaxType taxType) {
×
1827
          this.country = country;
×
1828
          this.description = description;
×
1829
          this.displayName = displayName;
×
1830
          this.extraParams = extraParams;
×
1831
          this.inclusive = inclusive;
×
1832
          this.jurisdiction = jurisdiction;
×
1833
          this.percentage = percentage;
×
1834
          this.state = state;
×
1835
          this.taxType = taxType;
×
1836
        }
×
1837

1838
        public static Builder builder() {
1839
          return new Builder();
×
1840
        }
1841

1842
        public static class Builder {
×
1843
          private String country;
1844

1845
          private String description;
1846

1847
          private String displayName;
1848

1849
          private Map<String, Object> extraParams;
1850

1851
          private Boolean inclusive;
1852

1853
          private String jurisdiction;
1854

1855
          private BigDecimal percentage;
1856

1857
          private String state;
1858

1859
          private TaxType taxType;
1860

1861
          /** Finalize and obtain parameter instance from this builder. */
1862
          public InvoiceUpdateLinesParams.Line.TaxAmount.TaxRateData build() {
1863
            return new InvoiceUpdateLinesParams.Line.TaxAmount.TaxRateData(
×
1864
                this.country,
1865
                this.description,
1866
                this.displayName,
1867
                this.extraParams,
1868
                this.inclusive,
1869
                this.jurisdiction,
1870
                this.percentage,
1871
                this.state,
1872
                this.taxType);
1873
          }
1874

1875
          /**
1876
           * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
1877
           * 3166-1 alpha-2</a>).
1878
           */
1879
          public Builder setCountry(String country) {
1880
            this.country = country;
×
1881
            return this;
×
1882
          }
1883

1884
          /**
1885
           * An arbitrary string attached to the tax rate for your internal use only. It will not be
1886
           * visible to your customers.
1887
           */
1888
          public Builder setDescription(String description) {
1889
            this.description = description;
×
1890
            return this;
×
1891
          }
1892

1893
          /**
1894
           * <strong>Required.</strong> The display name of the tax rate, which will be shown to
1895
           * users.
1896
           */
1897
          public Builder setDisplayName(String displayName) {
1898
            this.displayName = displayName;
×
1899
            return this;
×
1900
          }
1901

1902
          /**
1903
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1904
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1905
           * map. See {@link InvoiceUpdateLinesParams.Line.TaxAmount.TaxRateData#extraParams} for
1906
           * the field documentation.
1907
           */
1908
          public Builder putExtraParam(String key, Object value) {
1909
            if (this.extraParams == null) {
×
1910
              this.extraParams = new HashMap<>();
×
1911
            }
1912
            this.extraParams.put(key, value);
×
1913
            return this;
×
1914
          }
1915

1916
          /**
1917
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1918
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1919
           * map. See {@link InvoiceUpdateLinesParams.Line.TaxAmount.TaxRateData#extraParams} for
1920
           * the field documentation.
1921
           */
1922
          public Builder putAllExtraParam(Map<String, Object> map) {
1923
            if (this.extraParams == null) {
×
1924
              this.extraParams = new HashMap<>();
×
1925
            }
1926
            this.extraParams.putAll(map);
×
1927
            return this;
×
1928
          }
1929

1930
          /**
1931
           * <strong>Required.</strong> This specifies if the tax rate is inclusive or exclusive.
1932
           */
1933
          public Builder setInclusive(Boolean inclusive) {
1934
            this.inclusive = inclusive;
×
1935
            return this;
×
1936
          }
1937

1938
          /**
1939
           * The jurisdiction for the tax rate. You can use this label field for tax reporting
1940
           * purposes. It also appears on your customer’s invoice.
1941
           */
1942
          public Builder setJurisdiction(String jurisdiction) {
1943
            this.jurisdiction = jurisdiction;
×
1944
            return this;
×
1945
          }
1946

1947
          /**
1948
           * <strong>Required.</strong> The statutory tax rate percent. This field accepts decimal
1949
           * values between 0 and 100 inclusive with at most 4 decimal places. To accommodate
1950
           * fixed-amount taxes, set the percentage to zero. Stripe will not display zero
1951
           * percentages on the invoice unless the {@code amount} of the tax is also zero.
1952
           */
1953
          public Builder setPercentage(BigDecimal percentage) {
1954
            this.percentage = percentage;
×
1955
            return this;
×
1956
          }
1957

1958
          /**
1959
           * <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>,
1960
           * without country prefix. For example, &quot;NY&quot; for New York, United States.
1961
           */
1962
          public Builder setState(String state) {
1963
            this.state = state;
×
1964
            return this;
×
1965
          }
1966

1967
          /** The high-level tax type, such as {@code vat} or {@code sales_tax}. */
1968
          public Builder setTaxType(
1969
              InvoiceUpdateLinesParams.Line.TaxAmount.TaxRateData.TaxType taxType) {
1970
            this.taxType = taxType;
×
1971
            return this;
×
1972
          }
1973
        }
1974

1975
        public enum TaxType implements ApiRequestParams.EnumParam {
×
1976
          @SerializedName("amusement_tax")
×
1977
          AMUSEMENT_TAX("amusement_tax"),
1978

1979
          @SerializedName("communications_tax")
×
1980
          COMMUNICATIONS_TAX("communications_tax"),
1981

1982
          @SerializedName("gst")
×
1983
          GST("gst"),
1984

1985
          @SerializedName("hst")
×
1986
          HST("hst"),
1987

1988
          @SerializedName("igst")
×
1989
          IGST("igst"),
1990

1991
          @SerializedName("jct")
×
1992
          JCT("jct"),
1993

1994
          @SerializedName("lease_tax")
×
1995
          LEASE_TAX("lease_tax"),
1996

1997
          @SerializedName("pst")
×
1998
          PST("pst"),
1999

2000
          @SerializedName("qst")
×
2001
          QST("qst"),
2002

2003
          @SerializedName("retail_delivery_fee")
×
2004
          RETAIL_DELIVERY_FEE("retail_delivery_fee"),
2005

2006
          @SerializedName("rst")
×
2007
          RST("rst"),
2008

2009
          @SerializedName("sales_tax")
×
2010
          SALES_TAX("sales_tax"),
2011

NEW
2012
          @SerializedName("service_tax")
×
2013
          SERVICE_TAX("service_tax"),
2014

UNCOV
2015
          @SerializedName("vat")
×
2016
          VAT("vat");
2017

2018
          @Getter(onMethod_ = {@Override})
2019
          private final String value;
2020

2021
          TaxType(String value) {
×
2022
            this.value = value;
×
2023
          }
×
2024
        }
2025
      }
2026
    }
2027
  }
2028
}
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