• 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/InvoiceAddLinesParams.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 InvoiceAddLinesParams 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}.
34
   */
35
  @SerializedName("invoice_metadata")
36
  Object invoiceMetadata;
37

38
  /** <strong>Required.</strong> The line items to add. */
39
  @SerializedName("lines")
40
  List<InvoiceAddLinesParams.Line> lines;
41

42
  private InvoiceAddLinesParams(
43
      List<String> expand,
44
      Map<String, Object> extraParams,
45
      Object invoiceMetadata,
46
      List<InvoiceAddLinesParams.Line> lines) {
×
47
    this.expand = expand;
×
48
    this.extraParams = extraParams;
×
49
    this.invoiceMetadata = invoiceMetadata;
×
50
    this.lines = lines;
×
51
  }
×
52

53
  public static Builder builder() {
54
    return new Builder();
×
55
  }
56

57
  public static class Builder {
×
58
    private List<String> expand;
59

60
    private Map<String, Object> extraParams;
61

62
    private Object invoiceMetadata;
63

64
    private List<InvoiceAddLinesParams.Line> lines;
65

66
    /** Finalize and obtain parameter instance from this builder. */
67
    public InvoiceAddLinesParams build() {
68
      return new InvoiceAddLinesParams(
×
69
          this.expand, this.extraParams, this.invoiceMetadata, this.lines);
70
    }
71

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

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

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

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

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

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

152
    /**
153
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
154
     * to an object. This can be useful for storing additional information about the object in a
155
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
156
     * can be unset by posting an empty value to {@code metadata}.
157
     */
158
    public Builder setInvoiceMetadata(EmptyParam invoiceMetadata) {
159
      this.invoiceMetadata = invoiceMetadata;
×
160
      return this;
×
161
    }
162

163
    /**
164
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
165
     * to an object. This can be useful for storing additional information about the object in a
166
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
167
     * can be unset by posting an empty value to {@code metadata}.
168
     */
169
    public Builder setInvoiceMetadata(Map<String, String> invoiceMetadata) {
170
      this.invoiceMetadata = invoiceMetadata;
×
171
      return this;
×
172
    }
173

174
    /**
175
     * Add an element to `lines` list. A list is initialized for the first `add/addAll` call, and
176
     * subsequent calls adds additional elements to the original list. See {@link
177
     * InvoiceAddLinesParams#lines} for the field documentation.
178
     */
179
    public Builder addLine(InvoiceAddLinesParams.Line element) {
180
      if (this.lines == null) {
×
181
        this.lines = new ArrayList<>();
×
182
      }
183
      this.lines.add(element);
×
184
      return this;
×
185
    }
186

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

201
  @Getter
202
  public static class Line {
203
    /**
204
     * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming
205
     * invoice. If you want to apply a credit to the customer's account, pass a negative amount.
206
     */
207
    @SerializedName("amount")
208
    Long amount;
209

210
    /**
211
     * An arbitrary string which you can attach to the invoice item. The description is displayed in
212
     * the invoice for easy tracking.
213
     */
214
    @SerializedName("description")
215
    String description;
216

217
    /**
218
     * Controls whether discounts apply to this line item. Defaults to false for prorations or
219
     * negative line items, and true for all other line items. Cannot be set to true for prorations.
220
     */
221
    @SerializedName("discountable")
222
    Boolean discountable;
223

224
    /**
225
     * The coupons, promotion codes &amp; existing discounts which apply to the line item. Item
226
     * discounts are applied before invoice discounts. Pass an empty string to remove
227
     * previously-defined discounts.
228
     */
229
    @SerializedName("discounts")
230
    Object discounts;
231

232
    /**
233
     * Map of extra parameters for custom features not available in this client library. The content
234
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
235
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
236
     * param object. Effectively, this map is flattened to its parent instance.
237
     */
238
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
239
    Map<String, Object> extraParams;
240

241
    /**
242
     * ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will
243
     * be created.
244
     */
245
    @SerializedName("invoice_item")
246
    String invoiceItem;
247

248
    /**
249
     * The IDs of the margins to apply to the line item. When set, the {@code default_margins} on
250
     * the invoice do not apply to this line item.
251
     */
252
    @SerializedName("margins")
253
    Object margins;
254

255
    /**
256
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
257
     * to an object. This can be useful for storing additional information about the object in a
258
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
259
     * can be unset by posting an empty value to {@code metadata}.
260
     */
261
    @SerializedName("metadata")
262
    Object metadata;
263

264
    /**
265
     * The period associated with this invoice item. When set to different values, the period will
266
     * be rendered on the invoice. If you have <a
267
     * href="https://stripe.com/docs/revenue-recognition">Stripe Revenue Recognition</a> enabled,
268
     * the period will be used to recognize and defer revenue. See the <a
269
     * href="https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing">Revenue
270
     * Recognition documentation</a> for details.
271
     */
272
    @SerializedName("period")
273
    Period period;
274

275
    /** The ID of the price object. One of {@code price} or {@code price_data} is required. */
276
    @SerializedName("price")
277
    String price;
278

279
    /**
280
     * Data used to generate a new <a href="https://stripe.com/docs/api/prices">Price</a> object
281
     * inline. One of {@code price} or {@code price_data} is required.
282
     */
283
    @SerializedName("price_data")
284
    PriceData priceData;
285

286
    /** Non-negative integer. The quantity of units for the line item. */
287
    @SerializedName("quantity")
288
    Long quantity;
289

290
    /**
291
     * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes
292
     * on your own or use a third-party to calculate them. You cannot set tax amounts if any line
293
     * item has <a
294
     * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates">tax_rates</a>
295
     * or if the invoice has <a
296
     * href="https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates">default_tax_rates</a>
297
     * or uses <a href="https://stripe.com/docs/tax/invoicing">automatic tax</a>. Pass an empty
298
     * string to remove previously defined tax amounts.
299
     */
300
    @SerializedName("tax_amounts")
301
    Object taxAmounts;
302

303
    /**
304
     * The tax rates which apply to the line item. When set, the {@code default_tax_rates} on the
305
     * invoice do not apply to this line item. Pass an empty string to remove previously-defined tax
306
     * rates.
307
     */
308
    @SerializedName("tax_rates")
309
    Object taxRates;
310

311
    private Line(
312
        Long amount,
313
        String description,
314
        Boolean discountable,
315
        Object discounts,
316
        Map<String, Object> extraParams,
317
        String invoiceItem,
318
        Object margins,
319
        Object metadata,
320
        Period period,
321
        String price,
322
        PriceData priceData,
323
        Long quantity,
324
        Object taxAmounts,
325
        Object taxRates) {
×
326
      this.amount = amount;
×
327
      this.description = description;
×
328
      this.discountable = discountable;
×
329
      this.discounts = discounts;
×
330
      this.extraParams = extraParams;
×
331
      this.invoiceItem = invoiceItem;
×
332
      this.margins = margins;
×
333
      this.metadata = metadata;
×
334
      this.period = period;
×
335
      this.price = price;
×
336
      this.priceData = priceData;
×
337
      this.quantity = quantity;
×
338
      this.taxAmounts = taxAmounts;
×
339
      this.taxRates = taxRates;
×
340
    }
×
341

342
    public static Builder builder() {
343
      return new Builder();
×
344
    }
345

346
    public static class Builder {
×
347
      private Long amount;
348

349
      private String description;
350

351
      private Boolean discountable;
352

353
      private Object discounts;
354

355
      private Map<String, Object> extraParams;
356

357
      private String invoiceItem;
358

359
      private Object margins;
360

361
      private Object metadata;
362

363
      private Period period;
364

365
      private String price;
366

367
      private PriceData priceData;
368

369
      private Long quantity;
370

371
      private Object taxAmounts;
372

373
      private Object taxRates;
374

375
      /** Finalize and obtain parameter instance from this builder. */
376
      public InvoiceAddLinesParams.Line build() {
377
        return new InvoiceAddLinesParams.Line(
×
378
            this.amount,
379
            this.description,
380
            this.discountable,
381
            this.discounts,
382
            this.extraParams,
383
            this.invoiceItem,
384
            this.margins,
385
            this.metadata,
386
            this.period,
387
            this.price,
388
            this.priceData,
389
            this.quantity,
390
            this.taxAmounts,
391
            this.taxRates);
392
      }
393

394
      /**
395
       * The integer amount in cents (or local equivalent) of the charge to be applied to the
396
       * upcoming invoice. If you want to apply a credit to the customer's account, pass a negative
397
       * amount.
398
       */
399
      public Builder setAmount(Long amount) {
400
        this.amount = amount;
×
401
        return this;
×
402
      }
403

404
      /**
405
       * An arbitrary string which you can attach to the invoice item. The description is displayed
406
       * in the invoice for easy tracking.
407
       */
408
      public Builder setDescription(String description) {
409
        this.description = description;
×
410
        return this;
×
411
      }
412

413
      /**
414
       * Controls whether discounts apply to this line item. Defaults to false for prorations or
415
       * negative line items, and true for all other line items. Cannot be set to true for
416
       * prorations.
417
       */
418
      public Builder setDiscountable(Boolean discountable) {
419
        this.discountable = discountable;
×
420
        return this;
×
421
      }
422

423
      /**
424
       * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call,
425
       * and subsequent calls adds additional elements to the original list. See {@link
426
       * InvoiceAddLinesParams.Line#discounts} for the field documentation.
427
       */
428
      @SuppressWarnings("unchecked")
429
      public Builder addDiscount(InvoiceAddLinesParams.Line.Discount element) {
430
        if (this.discounts == null || this.discounts instanceof EmptyParam) {
×
431
          this.discounts = new ArrayList<InvoiceAddLinesParams.Line.Discount>();
×
432
        }
433
        ((List<InvoiceAddLinesParams.Line.Discount>) this.discounts).add(element);
×
434
        return this;
×
435
      }
436

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

451
      /**
452
       * The coupons, promotion codes &amp; existing discounts which apply to the line item. Item
453
       * discounts are applied before invoice discounts. Pass an empty string to remove
454
       * previously-defined discounts.
455
       */
456
      public Builder setDiscounts(EmptyParam discounts) {
457
        this.discounts = discounts;
×
458
        return this;
×
459
      }
460

461
      /**
462
       * The coupons, promotion codes &amp; existing discounts which apply to the line item. Item
463
       * discounts are applied before invoice discounts. Pass an empty string to remove
464
       * previously-defined discounts.
465
       */
466
      public Builder setDiscounts(List<InvoiceAddLinesParams.Line.Discount> discounts) {
467
        this.discounts = discounts;
×
468
        return this;
×
469
      }
470

471
      /**
472
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
473
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
474
       * InvoiceAddLinesParams.Line#extraParams} for the field documentation.
475
       */
476
      public Builder putExtraParam(String key, Object value) {
477
        if (this.extraParams == null) {
×
478
          this.extraParams = new HashMap<>();
×
479
        }
480
        this.extraParams.put(key, value);
×
481
        return this;
×
482
      }
483

484
      /**
485
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
486
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
487
       * See {@link InvoiceAddLinesParams.Line#extraParams} for the field documentation.
488
       */
489
      public Builder putAllExtraParam(Map<String, Object> map) {
490
        if (this.extraParams == null) {
×
491
          this.extraParams = new HashMap<>();
×
492
        }
493
        this.extraParams.putAll(map);
×
494
        return this;
×
495
      }
496

497
      /**
498
       * ID of an unassigned invoice item to assign to this invoice. If not provided, a new item
499
       * will be created.
500
       */
501
      public Builder setInvoiceItem(String invoiceItem) {
502
        this.invoiceItem = invoiceItem;
×
503
        return this;
×
504
      }
505

506
      /**
507
       * Add an element to `margins` list. A list is initialized for the first `add/addAll` call,
508
       * and subsequent calls adds additional elements to the original list. See {@link
509
       * InvoiceAddLinesParams.Line#margins} for the field documentation.
510
       */
511
      @SuppressWarnings("unchecked")
512
      public Builder addMargin(String element) {
513
        if (this.margins == null || this.margins instanceof EmptyParam) {
×
514
          this.margins = new ArrayList<String>();
×
515
        }
516
        ((List<String>) this.margins).add(element);
×
517
        return this;
×
518
      }
519

520
      /**
521
       * Add all elements 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
       * InvoiceAddLinesParams.Line#margins} for the field documentation.
524
       */
525
      @SuppressWarnings("unchecked")
526
      public Builder addAllMargin(List<String> elements) {
527
        if (this.margins == null || this.margins instanceof EmptyParam) {
×
528
          this.margins = new ArrayList<String>();
×
529
        }
530
        ((List<String>) this.margins).addAll(elements);
×
531
        return this;
×
532
      }
533

534
      /**
535
       * The IDs of the margins to apply to the line item. When set, the {@code default_margins} on
536
       * the invoice do not apply to this line item.
537
       */
538
      public Builder setMargins(EmptyParam margins) {
539
        this.margins = margins;
×
540
        return this;
×
541
      }
542

543
      /**
544
       * The IDs of the margins to apply to the line item. When set, the {@code default_margins} on
545
       * the invoice do not apply to this line item.
546
       */
547
      public Builder setMargins(List<String> margins) {
548
        this.margins = margins;
×
549
        return this;
×
550
      }
551

552
      /**
553
       * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
554
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
555
       * InvoiceAddLinesParams.Line#metadata} for the field documentation.
556
       */
557
      @SuppressWarnings("unchecked")
558
      public Builder putMetadata(String key, String value) {
559
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
560
          this.metadata = new HashMap<String, String>();
×
561
        }
562
        ((Map<String, String>) this.metadata).put(key, value);
×
563
        return this;
×
564
      }
565

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

580
      /**
581
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
582
       * attach to an object. This can be useful for storing additional information about the object
583
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
584
       * keys can be unset by posting an empty value to {@code metadata}.
585
       */
586
      public Builder setMetadata(EmptyParam metadata) {
587
        this.metadata = metadata;
×
588
        return this;
×
589
      }
590

591
      /**
592
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
593
       * attach to an object. This can be useful for storing additional information about the object
594
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
595
       * keys can be unset by posting an empty value to {@code metadata}.
596
       */
597
      public Builder setMetadata(Map<String, String> metadata) {
598
        this.metadata = metadata;
×
599
        return this;
×
600
      }
601

602
      /**
603
       * The period associated with this invoice item. When set to different values, the period will
604
       * be rendered on the invoice. If you have <a
605
       * href="https://stripe.com/docs/revenue-recognition">Stripe Revenue Recognition</a> enabled,
606
       * the period will be used to recognize and defer revenue. See the <a
607
       * href="https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing">Revenue
608
       * Recognition documentation</a> for details.
609
       */
610
      public Builder setPeriod(InvoiceAddLinesParams.Line.Period period) {
611
        this.period = period;
×
612
        return this;
×
613
      }
614

615
      /** The ID of the price object. One of {@code price} or {@code price_data} is required. */
616
      public Builder setPrice(String price) {
617
        this.price = price;
×
618
        return this;
×
619
      }
620

621
      /**
622
       * Data used to generate a new <a href="https://stripe.com/docs/api/prices">Price</a> object
623
       * inline. One of {@code price} or {@code price_data} is required.
624
       */
625
      public Builder setPriceData(InvoiceAddLinesParams.Line.PriceData priceData) {
626
        this.priceData = priceData;
×
627
        return this;
×
628
      }
629

630
      /** Non-negative integer. The quantity of units for the line item. */
631
      public Builder setQuantity(Long quantity) {
632
        this.quantity = quantity;
×
633
        return this;
×
634
      }
635

636
      /**
637
       * Add an element to `taxAmounts` list. A list is initialized for the first `add/addAll` call,
638
       * and subsequent calls adds additional elements to the original list. See {@link
639
       * InvoiceAddLinesParams.Line#taxAmounts} for the field documentation.
640
       */
641
      @SuppressWarnings("unchecked")
642
      public Builder addTaxAmount(InvoiceAddLinesParams.Line.TaxAmount element) {
643
        if (this.taxAmounts == null || this.taxAmounts instanceof EmptyParam) {
×
644
          this.taxAmounts = new ArrayList<InvoiceAddLinesParams.Line.TaxAmount>();
×
645
        }
646
        ((List<InvoiceAddLinesParams.Line.TaxAmount>) this.taxAmounts).add(element);
×
647
        return this;
×
648
      }
649

650
      /**
651
       * Add all elements to `taxAmounts` list. A list is initialized for the first `add/addAll`
652
       * call, and subsequent calls adds additional elements to the original list. See {@link
653
       * InvoiceAddLinesParams.Line#taxAmounts} for the field documentation.
654
       */
655
      @SuppressWarnings("unchecked")
656
      public Builder addAllTaxAmount(List<InvoiceAddLinesParams.Line.TaxAmount> elements) {
657
        if (this.taxAmounts == null || this.taxAmounts instanceof EmptyParam) {
×
658
          this.taxAmounts = new ArrayList<InvoiceAddLinesParams.Line.TaxAmount>();
×
659
        }
660
        ((List<InvoiceAddLinesParams.Line.TaxAmount>) this.taxAmounts).addAll(elements);
×
661
        return this;
×
662
      }
663

664
      /**
665
       * A list of up to 10 tax amounts for this line item. This can be useful if you calculate
666
       * taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any
667
       * line item has <a
668
       * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates">tax_rates</a>
669
       * or if the invoice has <a
670
       * href="https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates">default_tax_rates</a>
671
       * or uses <a href="https://stripe.com/docs/tax/invoicing">automatic tax</a>. Pass an empty
672
       * string to remove previously defined tax amounts.
673
       */
674
      public Builder setTaxAmounts(EmptyParam taxAmounts) {
675
        this.taxAmounts = taxAmounts;
×
676
        return this;
×
677
      }
678

679
      /**
680
       * A list of up to 10 tax amounts for this line item. This can be useful if you calculate
681
       * taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any
682
       * line item has <a
683
       * href="https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates">tax_rates</a>
684
       * or if the invoice has <a
685
       * href="https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates">default_tax_rates</a>
686
       * or uses <a href="https://stripe.com/docs/tax/invoicing">automatic tax</a>. Pass an empty
687
       * string to remove previously defined tax amounts.
688
       */
689
      public Builder setTaxAmounts(List<InvoiceAddLinesParams.Line.TaxAmount> taxAmounts) {
690
        this.taxAmounts = taxAmounts;
×
691
        return this;
×
692
      }
693

694
      /**
695
       * Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call,
696
       * and subsequent calls adds additional elements to the original list. See {@link
697
       * InvoiceAddLinesParams.Line#taxRates} for the field documentation.
698
       */
699
      @SuppressWarnings("unchecked")
700
      public Builder addTaxRate(String element) {
701
        if (this.taxRates == null || this.taxRates instanceof EmptyParam) {
×
702
          this.taxRates = new ArrayList<String>();
×
703
        }
704
        ((List<String>) this.taxRates).add(element);
×
705
        return this;
×
706
      }
707

708
      /**
709
       * Add all elements to `taxRates` list. A list is initialized for the first `add/addAll` call,
710
       * and subsequent calls adds additional elements to the original list. See {@link
711
       * InvoiceAddLinesParams.Line#taxRates} for the field documentation.
712
       */
713
      @SuppressWarnings("unchecked")
714
      public Builder addAllTaxRate(List<String> elements) {
715
        if (this.taxRates == null || this.taxRates instanceof EmptyParam) {
×
716
          this.taxRates = new ArrayList<String>();
×
717
        }
718
        ((List<String>) this.taxRates).addAll(elements);
×
719
        return this;
×
720
      }
721

722
      /**
723
       * The tax rates which apply to the line item. When set, the {@code default_tax_rates} on the
724
       * invoice do not apply to this line item. Pass an empty string to remove previously-defined
725
       * tax rates.
726
       */
727
      public Builder setTaxRates(EmptyParam taxRates) {
728
        this.taxRates = taxRates;
×
729
        return this;
×
730
      }
731

732
      /**
733
       * The tax rates which apply to the line item. When set, the {@code default_tax_rates} on the
734
       * invoice do not apply to this line item. Pass an empty string to remove previously-defined
735
       * tax rates.
736
       */
737
      public Builder setTaxRates(List<String> taxRates) {
738
        this.taxRates = taxRates;
×
739
        return this;
×
740
      }
741
    }
742

743
    @Getter
744
    public static class Discount {
745
      /** ID of the coupon to create a new discount for. */
746
      @SerializedName("coupon")
747
      String coupon;
748

749
      /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
750
      @SerializedName("discount")
751
      String discount;
752

753
      /** Details to determine how long the discount should be applied for. */
754
      @SerializedName("discount_end")
755
      DiscountEnd discountEnd;
756

757
      /**
758
       * Map of extra parameters for custom features not available in this client library. The
759
       * content in this map is not serialized under this field's {@code @SerializedName} value.
760
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
761
       * name in this param object. Effectively, this map is flattened to its parent instance.
762
       */
763
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
764
      Map<String, Object> extraParams;
765

766
      /** ID of the promotion code to create a new discount for. */
767
      @SerializedName("promotion_code")
768
      String promotionCode;
769

770
      private Discount(
771
          String coupon,
772
          String discount,
773
          DiscountEnd discountEnd,
774
          Map<String, Object> extraParams,
775
          String promotionCode) {
×
776
        this.coupon = coupon;
×
777
        this.discount = discount;
×
778
        this.discountEnd = discountEnd;
×
779
        this.extraParams = extraParams;
×
780
        this.promotionCode = promotionCode;
×
781
      }
×
782

783
      public static Builder builder() {
784
        return new Builder();
×
785
      }
786

787
      public static class Builder {
×
788
        private String coupon;
789

790
        private String discount;
791

792
        private DiscountEnd discountEnd;
793

794
        private Map<String, Object> extraParams;
795

796
        private String promotionCode;
797

798
        /** Finalize and obtain parameter instance from this builder. */
799
        public InvoiceAddLinesParams.Line.Discount build() {
800
          return new InvoiceAddLinesParams.Line.Discount(
×
801
              this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode);
802
        }
803

804
        /** ID of the coupon to create a new discount for. */
805
        public Builder setCoupon(String coupon) {
806
          this.coupon = coupon;
×
807
          return this;
×
808
        }
809

810
        /** ID of an existing discount on the object (or one of its ancestors) to reuse. */
811
        public Builder setDiscount(String discount) {
812
          this.discount = discount;
×
813
          return this;
×
814
        }
815

816
        /** Details to determine how long the discount should be applied for. */
817
        public Builder setDiscountEnd(InvoiceAddLinesParams.Line.Discount.DiscountEnd discountEnd) {
818
          this.discountEnd = discountEnd;
×
819
          return this;
×
820
        }
821

822
        /**
823
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
824
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
825
         * map. See {@link InvoiceAddLinesParams.Line.Discount#extraParams} for the field
826
         * documentation.
827
         */
828
        public Builder putExtraParam(String key, Object value) {
829
          if (this.extraParams == null) {
×
830
            this.extraParams = new HashMap<>();
×
831
          }
832
          this.extraParams.put(key, value);
×
833
          return this;
×
834
        }
835

836
        /**
837
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
838
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
839
         * map. See {@link InvoiceAddLinesParams.Line.Discount#extraParams} for the field
840
         * documentation.
841
         */
842
        public Builder putAllExtraParam(Map<String, Object> map) {
843
          if (this.extraParams == null) {
×
844
            this.extraParams = new HashMap<>();
×
845
          }
846
          this.extraParams.putAll(map);
×
847
          return this;
×
848
        }
849

850
        /** ID of the promotion code to create a new discount for. */
851
        public Builder setPromotionCode(String promotionCode) {
852
          this.promotionCode = promotionCode;
×
853
          return this;
×
854
        }
855
      }
856

857
      @Getter
858
      public static class DiscountEnd {
859
        /** Time span for the redeemed discount. */
860
        @SerializedName("duration")
861
        Duration duration;
862

863
        /**
864
         * Map of extra parameters for custom features not available in this client library. The
865
         * content in this map is not serialized under this field's {@code @SerializedName} value.
866
         * Instead, each key/value pair is serialized as if the key is a root-level field
867
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
868
         * instance.
869
         */
870
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
871
        Map<String, Object> extraParams;
872

873
        /** A precise Unix timestamp for the discount to end. Must be in the future. */
874
        @SerializedName("timestamp")
875
        Long timestamp;
876

877
        /**
878
         * <strong>Required.</strong> The type of calculation made to determine when the discount
879
         * ends.
880
         */
881
        @SerializedName("type")
882
        Type type;
883

884
        private DiscountEnd(
885
            Duration duration, Map<String, Object> extraParams, Long timestamp, Type type) {
×
886
          this.duration = duration;
×
887
          this.extraParams = extraParams;
×
888
          this.timestamp = timestamp;
×
889
          this.type = type;
×
890
        }
×
891

892
        public static Builder builder() {
893
          return new Builder();
×
894
        }
895

896
        public static class Builder {
×
897
          private Duration duration;
898

899
          private Map<String, Object> extraParams;
900

901
          private Long timestamp;
902

903
          private Type type;
904

905
          /** Finalize and obtain parameter instance from this builder. */
906
          public InvoiceAddLinesParams.Line.Discount.DiscountEnd build() {
907
            return new InvoiceAddLinesParams.Line.Discount.DiscountEnd(
×
908
                this.duration, this.extraParams, this.timestamp, this.type);
909
          }
910

911
          /** Time span for the redeemed discount. */
912
          public Builder setDuration(
913
              InvoiceAddLinesParams.Line.Discount.DiscountEnd.Duration duration) {
914
            this.duration = duration;
×
915
            return this;
×
916
          }
917

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

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

946
          /** A precise Unix timestamp for the discount to end. Must be in the future. */
947
          public Builder setTimestamp(Long timestamp) {
948
            this.timestamp = timestamp;
×
949
            return this;
×
950
          }
951

952
          /**
953
           * <strong>Required.</strong> The type of calculation made to determine when the discount
954
           * ends.
955
           */
956
          public Builder setType(InvoiceAddLinesParams.Line.Discount.DiscountEnd.Type type) {
957
            this.type = type;
×
958
            return this;
×
959
          }
960
        }
961

962
        @Getter
963
        public static class Duration {
964
          /**
965
           * Map of extra parameters for custom features not available in this client library. The
966
           * content in this map is not serialized under this field's {@code @SerializedName} value.
967
           * Instead, each key/value pair is serialized as if the key is a root-level field
968
           * (serialized) name in this param object. Effectively, this map is flattened to its
969
           * parent instance.
970
           */
971
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
972
          Map<String, Object> extraParams;
973

974
          /**
975
           * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day},
976
           * {@code week}, {@code month} or {@code year}.
977
           */
978
          @SerializedName("interval")
979
          Interval interval;
980

981
          /**
982
           * <strong>Required.</strong> The number of intervals, as an whole number greater than 0.
983
           * Stripe multiplies this by the interval type to get the overall duration.
984
           */
985
          @SerializedName("interval_count")
986
          Long intervalCount;
987

988
          private Duration(Map<String, Object> extraParams, Interval interval, Long intervalCount) {
×
989
            this.extraParams = extraParams;
×
990
            this.interval = interval;
×
991
            this.intervalCount = intervalCount;
×
992
          }
×
993

994
          public static Builder builder() {
995
            return new Builder();
×
996
          }
997

998
          public static class Builder {
×
999
            private Map<String, Object> extraParams;
1000

1001
            private Interval interval;
1002

1003
            private Long intervalCount;
1004

1005
            /** Finalize and obtain parameter instance from this builder. */
1006
            public InvoiceAddLinesParams.Line.Discount.DiscountEnd.Duration build() {
1007
              return new InvoiceAddLinesParams.Line.Discount.DiscountEnd.Duration(
×
1008
                  this.extraParams, this.interval, this.intervalCount);
1009
            }
1010

1011
            /**
1012
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
1013
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
1014
             * original map. See {@link
1015
             * InvoiceAddLinesParams.Line.Discount.DiscountEnd.Duration#extraParams} for the field
1016
             * documentation.
1017
             */
1018
            public Builder putExtraParam(String key, Object value) {
1019
              if (this.extraParams == null) {
×
1020
                this.extraParams = new HashMap<>();
×
1021
              }
1022
              this.extraParams.put(key, value);
×
1023
              return this;
×
1024
            }
1025

1026
            /**
1027
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1028
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
1029
             * original map. See {@link
1030
             * InvoiceAddLinesParams.Line.Discount.DiscountEnd.Duration#extraParams} for the field
1031
             * documentation.
1032
             */
1033
            public Builder putAllExtraParam(Map<String, Object> map) {
1034
              if (this.extraParams == null) {
×
1035
                this.extraParams = new HashMap<>();
×
1036
              }
1037
              this.extraParams.putAll(map);
×
1038
              return this;
×
1039
            }
1040

1041
            /**
1042
             * <strong>Required.</strong> Specifies a type of interval unit. Either {@code day},
1043
             * {@code week}, {@code month} or {@code year}.
1044
             */
1045
            public Builder setInterval(
1046
                InvoiceAddLinesParams.Line.Discount.DiscountEnd.Duration.Interval interval) {
1047
              this.interval = interval;
×
1048
              return this;
×
1049
            }
1050

1051
            /**
1052
             * <strong>Required.</strong> The number of intervals, as an whole number greater than
1053
             * 0. Stripe multiplies this by the interval type to get the overall duration.
1054
             */
1055
            public Builder setIntervalCount(Long intervalCount) {
1056
              this.intervalCount = intervalCount;
×
1057
              return this;
×
1058
            }
1059
          }
1060

1061
          public enum Interval implements ApiRequestParams.EnumParam {
×
1062
            @SerializedName("day")
×
1063
            DAY("day"),
1064

1065
            @SerializedName("month")
×
1066
            MONTH("month"),
1067

1068
            @SerializedName("week")
×
1069
            WEEK("week"),
1070

1071
            @SerializedName("year")
×
1072
            YEAR("year");
1073

1074
            @Getter(onMethod_ = {@Override})
1075
            private final String value;
1076

1077
            Interval(String value) {
×
1078
              this.value = value;
×
1079
            }
×
1080
          }
1081
        }
1082

1083
        public enum Type implements ApiRequestParams.EnumParam {
×
1084
          @SerializedName("duration")
×
1085
          DURATION("duration"),
1086

1087
          @SerializedName("timestamp")
×
1088
          TIMESTAMP("timestamp");
1089

1090
          @Getter(onMethod_ = {@Override})
1091
          private final String value;
1092

1093
          Type(String value) {
×
1094
            this.value = value;
×
1095
          }
×
1096
        }
1097
      }
1098
    }
1099

1100
    @Getter
1101
    public static class Period {
1102
      /**
1103
       * <strong>Required.</strong> The end of the period, which must be greater than or equal to
1104
       * the start. This value is inclusive.
1105
       */
1106
      @SerializedName("end")
1107
      Long end;
1108

1109
      /**
1110
       * Map of extra parameters for custom features not available in this client library. The
1111
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1112
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1113
       * name in this param object. Effectively, this map is flattened to its parent instance.
1114
       */
1115
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1116
      Map<String, Object> extraParams;
1117

1118
      /** <strong>Required.</strong> The start of the period. This value is inclusive. */
1119
      @SerializedName("start")
1120
      Long start;
1121

1122
      private Period(Long end, Map<String, Object> extraParams, Long start) {
×
1123
        this.end = end;
×
1124
        this.extraParams = extraParams;
×
1125
        this.start = start;
×
1126
      }
×
1127

1128
      public static Builder builder() {
1129
        return new Builder();
×
1130
      }
1131

1132
      public static class Builder {
×
1133
        private Long end;
1134

1135
        private Map<String, Object> extraParams;
1136

1137
        private Long start;
1138

1139
        /** Finalize and obtain parameter instance from this builder. */
1140
        public InvoiceAddLinesParams.Line.Period build() {
1141
          return new InvoiceAddLinesParams.Line.Period(this.end, this.extraParams, this.start);
×
1142
        }
1143

1144
        /**
1145
         * <strong>Required.</strong> The end of the period, which must be greater than or equal to
1146
         * the start. This value is inclusive.
1147
         */
1148
        public Builder setEnd(Long end) {
1149
          this.end = end;
×
1150
          return this;
×
1151
        }
1152

1153
        /**
1154
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1155
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1156
         * map. See {@link InvoiceAddLinesParams.Line.Period#extraParams} for the field
1157
         * documentation.
1158
         */
1159
        public Builder putExtraParam(String key, Object value) {
1160
          if (this.extraParams == null) {
×
1161
            this.extraParams = new HashMap<>();
×
1162
          }
1163
          this.extraParams.put(key, value);
×
1164
          return this;
×
1165
        }
1166

1167
        /**
1168
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1169
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1170
         * map. See {@link InvoiceAddLinesParams.Line.Period#extraParams} for the field
1171
         * documentation.
1172
         */
1173
        public Builder putAllExtraParam(Map<String, Object> map) {
1174
          if (this.extraParams == null) {
×
1175
            this.extraParams = new HashMap<>();
×
1176
          }
1177
          this.extraParams.putAll(map);
×
1178
          return this;
×
1179
        }
1180

1181
        /** <strong>Required.</strong> The start of the period. This value is inclusive. */
1182
        public Builder setStart(Long start) {
1183
          this.start = start;
×
1184
          return this;
×
1185
        }
1186
      }
1187
    }
1188

1189
    @Getter
1190
    public static class PriceData {
1191
      /**
1192
       * <strong>Required.</strong> Three-letter <a
1193
       * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
1194
       * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
1195
       */
1196
      @SerializedName("currency")
1197
      String currency;
1198

1199
      /**
1200
       * Map of extra parameters for custom features not available in this client library. The
1201
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1202
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1203
       * name in this param object. Effectively, this map is flattened to its parent instance.
1204
       */
1205
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1206
      Map<String, Object> extraParams;
1207

1208
      /**
1209
       * The ID of the product that this price will belong to. One of {@code product} or {@code
1210
       * product_data} is required.
1211
       */
1212
      @SerializedName("product")
1213
      String product;
1214

1215
      /**
1216
       * Data used to generate a new product object inline. One of {@code product} or {@code
1217
       * product_data} is required.
1218
       */
1219
      @SerializedName("product_data")
1220
      ProductData productData;
1221

1222
      /**
1223
       * Only required if a <a
1224
       * href="https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)">default
1225
       * tax behavior</a> was not provided in the Stripe Tax settings. Specifies whether the price
1226
       * is considered inclusive of taxes or exclusive of taxes. One of {@code inclusive}, {@code
1227
       * exclusive}, or {@code unspecified}. Once specified as either {@code inclusive} or {@code
1228
       * exclusive}, it cannot be changed.
1229
       */
1230
      @SerializedName("tax_behavior")
1231
      TaxBehavior taxBehavior;
1232

1233
      /**
1234
       * A non-negative integer in cents (or local equivalent) representing how much to charge. One
1235
       * of {@code unit_amount} or {@code unit_amount_decimal} is required.
1236
       */
1237
      @SerializedName("unit_amount")
1238
      Long unitAmount;
1239

1240
      /**
1241
       * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent)
1242
       * with at most 12 decimal places. Only one of {@code unit_amount} and {@code
1243
       * unit_amount_decimal} can be set.
1244
       */
1245
      @SerializedName("unit_amount_decimal")
1246
      BigDecimal unitAmountDecimal;
1247

1248
      private PriceData(
1249
          String currency,
1250
          Map<String, Object> extraParams,
1251
          String product,
1252
          ProductData productData,
1253
          TaxBehavior taxBehavior,
1254
          Long unitAmount,
1255
          BigDecimal unitAmountDecimal) {
×
1256
        this.currency = currency;
×
1257
        this.extraParams = extraParams;
×
1258
        this.product = product;
×
1259
        this.productData = productData;
×
1260
        this.taxBehavior = taxBehavior;
×
1261
        this.unitAmount = unitAmount;
×
1262
        this.unitAmountDecimal = unitAmountDecimal;
×
1263
      }
×
1264

1265
      public static Builder builder() {
1266
        return new Builder();
×
1267
      }
1268

1269
      public static class Builder {
×
1270
        private String currency;
1271

1272
        private Map<String, Object> extraParams;
1273

1274
        private String product;
1275

1276
        private ProductData productData;
1277

1278
        private TaxBehavior taxBehavior;
1279

1280
        private Long unitAmount;
1281

1282
        private BigDecimal unitAmountDecimal;
1283

1284
        /** Finalize and obtain parameter instance from this builder. */
1285
        public InvoiceAddLinesParams.Line.PriceData build() {
1286
          return new InvoiceAddLinesParams.Line.PriceData(
×
1287
              this.currency,
1288
              this.extraParams,
1289
              this.product,
1290
              this.productData,
1291
              this.taxBehavior,
1292
              this.unitAmount,
1293
              this.unitAmountDecimal);
1294
        }
1295

1296
        /**
1297
         * <strong>Required.</strong> Three-letter <a
1298
         * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in
1299
         * lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
1300
         */
1301
        public Builder setCurrency(String currency) {
1302
          this.currency = currency;
×
1303
          return this;
×
1304
        }
1305

1306
        /**
1307
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1308
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1309
         * map. See {@link InvoiceAddLinesParams.Line.PriceData#extraParams} for the field
1310
         * documentation.
1311
         */
1312
        public Builder putExtraParam(String key, Object value) {
1313
          if (this.extraParams == null) {
×
1314
            this.extraParams = new HashMap<>();
×
1315
          }
1316
          this.extraParams.put(key, value);
×
1317
          return this;
×
1318
        }
1319

1320
        /**
1321
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1322
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1323
         * map. See {@link InvoiceAddLinesParams.Line.PriceData#extraParams} for the field
1324
         * documentation.
1325
         */
1326
        public Builder putAllExtraParam(Map<String, Object> map) {
1327
          if (this.extraParams == null) {
×
1328
            this.extraParams = new HashMap<>();
×
1329
          }
1330
          this.extraParams.putAll(map);
×
1331
          return this;
×
1332
        }
1333

1334
        /**
1335
         * The ID of the product that this price will belong to. One of {@code product} or {@code
1336
         * product_data} is required.
1337
         */
1338
        public Builder setProduct(String product) {
1339
          this.product = product;
×
1340
          return this;
×
1341
        }
1342

1343
        /**
1344
         * Data used to generate a new product object inline. One of {@code product} or {@code
1345
         * product_data} is required.
1346
         */
1347
        public Builder setProductData(
1348
            InvoiceAddLinesParams.Line.PriceData.ProductData productData) {
1349
          this.productData = productData;
×
1350
          return this;
×
1351
        }
1352

1353
        /**
1354
         * Only required if a <a
1355
         * href="https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)">default
1356
         * tax behavior</a> was not provided in the Stripe Tax settings. Specifies whether the price
1357
         * is considered inclusive of taxes or exclusive of taxes. One of {@code inclusive}, {@code
1358
         * exclusive}, or {@code unspecified}. Once specified as either {@code inclusive} or {@code
1359
         * exclusive}, it cannot be changed.
1360
         */
1361
        public Builder setTaxBehavior(
1362
            InvoiceAddLinesParams.Line.PriceData.TaxBehavior taxBehavior) {
1363
          this.taxBehavior = taxBehavior;
×
1364
          return this;
×
1365
        }
1366

1367
        /**
1368
         * A non-negative integer in cents (or local equivalent) representing how much to charge.
1369
         * One of {@code unit_amount} or {@code unit_amount_decimal} is required.
1370
         */
1371
        public Builder setUnitAmount(Long unitAmount) {
1372
          this.unitAmount = unitAmount;
×
1373
          return this;
×
1374
        }
1375

1376
        /**
1377
         * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent)
1378
         * with at most 12 decimal places. Only one of {@code unit_amount} and {@code
1379
         * unit_amount_decimal} can be set.
1380
         */
1381
        public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) {
1382
          this.unitAmountDecimal = unitAmountDecimal;
×
1383
          return this;
×
1384
        }
1385
      }
1386

1387
      @Getter
1388
      public static class ProductData {
1389
        /**
1390
         * The product's description, meant to be displayable to the customer. Use this field to
1391
         * optionally store a long form explanation of the product being sold for your own rendering
1392
         * purposes.
1393
         */
1394
        @SerializedName("description")
1395
        String description;
1396

1397
        /**
1398
         * Map of extra parameters for custom features not available in this client library. The
1399
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1400
         * Instead, each key/value pair is serialized as if the key is a root-level field
1401
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1402
         * instance.
1403
         */
1404
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1405
        Map<String, Object> extraParams;
1406

1407
        /**
1408
         * A list of up to 8 URLs of images for this product, meant to be displayable to the
1409
         * customer.
1410
         */
1411
        @SerializedName("images")
1412
        List<String> images;
1413

1414
        /**
1415
         * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
1416
         * attach to an object. This can be useful for storing additional information about the
1417
         * object in a structured format. Individual keys can be unset by posting an empty value to
1418
         * them. All keys can be unset by posting an empty value to {@code metadata}.
1419
         */
1420
        @SerializedName("metadata")
1421
        Map<String, String> metadata;
1422

1423
        /**
1424
         * <strong>Required.</strong> The product's name, meant to be displayable to the customer.
1425
         */
1426
        @SerializedName("name")
1427
        String name;
1428

1429
        /** A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. */
1430
        @SerializedName("tax_code")
1431
        String taxCode;
1432

1433
        private ProductData(
1434
            String description,
1435
            Map<String, Object> extraParams,
1436
            List<String> images,
1437
            Map<String, String> metadata,
1438
            String name,
1439
            String taxCode) {
×
1440
          this.description = description;
×
1441
          this.extraParams = extraParams;
×
1442
          this.images = images;
×
1443
          this.metadata = metadata;
×
1444
          this.name = name;
×
1445
          this.taxCode = taxCode;
×
1446
        }
×
1447

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

1452
        public static class Builder {
×
1453
          private String description;
1454

1455
          private Map<String, Object> extraParams;
1456

1457
          private List<String> images;
1458

1459
          private Map<String, String> metadata;
1460

1461
          private String name;
1462

1463
          private String taxCode;
1464

1465
          /** Finalize and obtain parameter instance from this builder. */
1466
          public InvoiceAddLinesParams.Line.PriceData.ProductData build() {
1467
            return new InvoiceAddLinesParams.Line.PriceData.ProductData(
×
1468
                this.description,
1469
                this.extraParams,
1470
                this.images,
1471
                this.metadata,
1472
                this.name,
1473
                this.taxCode);
1474
          }
1475

1476
          /**
1477
           * The product's description, meant to be displayable to the customer. Use this field to
1478
           * optionally store a long form explanation of the product being sold for your own
1479
           * rendering purposes.
1480
           */
1481
          public Builder setDescription(String description) {
1482
            this.description = description;
×
1483
            return this;
×
1484
          }
1485

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

1500
          /**
1501
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1502
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1503
           * map. See {@link InvoiceAddLinesParams.Line.PriceData.ProductData#extraParams} for the
1504
           * field documentation.
1505
           */
1506
          public Builder putAllExtraParam(Map<String, Object> map) {
1507
            if (this.extraParams == null) {
×
1508
              this.extraParams = new HashMap<>();
×
1509
            }
1510
            this.extraParams.putAll(map);
×
1511
            return this;
×
1512
          }
1513

1514
          /**
1515
           * Add an element to `images` list. A list is initialized for the first `add/addAll` call,
1516
           * and subsequent calls adds additional elements to the original list. See {@link
1517
           * InvoiceAddLinesParams.Line.PriceData.ProductData#images} for the field documentation.
1518
           */
1519
          public Builder addImage(String element) {
1520
            if (this.images == null) {
×
1521
              this.images = new ArrayList<>();
×
1522
            }
1523
            this.images.add(element);
×
1524
            return this;
×
1525
          }
1526

1527
          /**
1528
           * Add all elements to `images` list. A list is initialized for the first `add/addAll`
1529
           * call, and subsequent calls adds additional elements to the original list. See {@link
1530
           * InvoiceAddLinesParams.Line.PriceData.ProductData#images} for the field documentation.
1531
           */
1532
          public Builder addAllImage(List<String> elements) {
1533
            if (this.images == null) {
×
1534
              this.images = new ArrayList<>();
×
1535
            }
1536
            this.images.addAll(elements);
×
1537
            return this;
×
1538
          }
1539

1540
          /**
1541
           * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
1542
           * call, and subsequent calls add additional key/value pairs to the original map. See
1543
           * {@link InvoiceAddLinesParams.Line.PriceData.ProductData#metadata} for the field
1544
           * documentation.
1545
           */
1546
          public Builder putMetadata(String key, String value) {
1547
            if (this.metadata == null) {
×
1548
              this.metadata = new HashMap<>();
×
1549
            }
1550
            this.metadata.put(key, value);
×
1551
            return this;
×
1552
          }
1553

1554
          /**
1555
           * Add all map key/value pairs to `metadata` map. A map is initialized for the first
1556
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1557
           * map. See {@link InvoiceAddLinesParams.Line.PriceData.ProductData#metadata} for the
1558
           * field documentation.
1559
           */
1560
          public Builder putAllMetadata(Map<String, String> map) {
1561
            if (this.metadata == null) {
×
1562
              this.metadata = new HashMap<>();
×
1563
            }
1564
            this.metadata.putAll(map);
×
1565
            return this;
×
1566
          }
1567

1568
          /**
1569
           * <strong>Required.</strong> The product's name, meant to be displayable to the customer.
1570
           */
1571
          public Builder setName(String name) {
1572
            this.name = name;
×
1573
            return this;
×
1574
          }
1575

1576
          /** A <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID. */
1577
          public Builder setTaxCode(String taxCode) {
1578
            this.taxCode = taxCode;
×
1579
            return this;
×
1580
          }
1581
        }
1582
      }
1583

1584
      public enum TaxBehavior implements ApiRequestParams.EnumParam {
×
1585
        @SerializedName("exclusive")
×
1586
        EXCLUSIVE("exclusive"),
1587

1588
        @SerializedName("inclusive")
×
1589
        INCLUSIVE("inclusive"),
1590

1591
        @SerializedName("unspecified")
×
1592
        UNSPECIFIED("unspecified");
1593

1594
        @Getter(onMethod_ = {@Override})
1595
        private final String value;
1596

1597
        TaxBehavior(String value) {
×
1598
          this.value = value;
×
1599
        }
×
1600
      }
1601
    }
1602

1603
    @Getter
1604
    public static class TaxAmount {
1605
      /** <strong>Required.</strong> The amount, in cents (or local equivalent), of the tax. */
1606
      @SerializedName("amount")
1607
      Long amount;
1608

1609
      /**
1610
       * Map of extra parameters for custom features not available in this client library. The
1611
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1612
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1613
       * name in this param object. Effectively, this map is flattened to its parent instance.
1614
       */
1615
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1616
      Map<String, Object> extraParams;
1617

1618
      /**
1619
       * <strong>Required.</strong> Data to find or create a TaxRate object.
1620
       *
1621
       * <p>Stripe automatically creates or reuses a TaxRate object for each tax amount. If the
1622
       * {@code tax_rate_data} exactly matches a previous value, Stripe will reuse the TaxRate
1623
       * object. TaxRate objects created automatically by Stripe are immediately archived, do not
1624
       * appear in the line item’s {@code tax_rates}, and cannot be directly added to invoices,
1625
       * payments, or line items.
1626
       */
1627
      @SerializedName("tax_rate_data")
1628
      TaxRateData taxRateData;
1629

1630
      /**
1631
       * <strong>Required.</strong> The amount on which tax is calculated, in cents (or local
1632
       * equivalent).
1633
       */
1634
      @SerializedName("taxable_amount")
1635
      Long taxableAmount;
1636

1637
      private TaxAmount(
1638
          Long amount,
1639
          Map<String, Object> extraParams,
1640
          TaxRateData taxRateData,
1641
          Long taxableAmount) {
×
1642
        this.amount = amount;
×
1643
        this.extraParams = extraParams;
×
1644
        this.taxRateData = taxRateData;
×
1645
        this.taxableAmount = taxableAmount;
×
1646
      }
×
1647

1648
      public static Builder builder() {
1649
        return new Builder();
×
1650
      }
1651

1652
      public static class Builder {
×
1653
        private Long amount;
1654

1655
        private Map<String, Object> extraParams;
1656

1657
        private TaxRateData taxRateData;
1658

1659
        private Long taxableAmount;
1660

1661
        /** Finalize and obtain parameter instance from this builder. */
1662
        public InvoiceAddLinesParams.Line.TaxAmount build() {
1663
          return new InvoiceAddLinesParams.Line.TaxAmount(
×
1664
              this.amount, this.extraParams, this.taxRateData, this.taxableAmount);
1665
        }
1666

1667
        /** <strong>Required.</strong> The amount, in cents (or local equivalent), of the tax. */
1668
        public Builder setAmount(Long amount) {
1669
          this.amount = amount;
×
1670
          return this;
×
1671
        }
1672

1673
        /**
1674
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1675
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1676
         * map. See {@link InvoiceAddLinesParams.Line.TaxAmount#extraParams} for the field
1677
         * documentation.
1678
         */
1679
        public Builder putExtraParam(String key, Object value) {
1680
          if (this.extraParams == null) {
×
1681
            this.extraParams = new HashMap<>();
×
1682
          }
1683
          this.extraParams.put(key, value);
×
1684
          return this;
×
1685
        }
1686

1687
        /**
1688
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1689
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1690
         * map. See {@link InvoiceAddLinesParams.Line.TaxAmount#extraParams} for the field
1691
         * documentation.
1692
         */
1693
        public Builder putAllExtraParam(Map<String, Object> map) {
1694
          if (this.extraParams == null) {
×
1695
            this.extraParams = new HashMap<>();
×
1696
          }
1697
          this.extraParams.putAll(map);
×
1698
          return this;
×
1699
        }
1700

1701
        /**
1702
         * <strong>Required.</strong> Data to find or create a TaxRate object.
1703
         *
1704
         * <p>Stripe automatically creates or reuses a TaxRate object for each tax amount. If the
1705
         * {@code tax_rate_data} exactly matches a previous value, Stripe will reuse the TaxRate
1706
         * object. TaxRate objects created automatically by Stripe are immediately archived, do not
1707
         * appear in the line item’s {@code tax_rates}, and cannot be directly added to invoices,
1708
         * payments, or line items.
1709
         */
1710
        public Builder setTaxRateData(
1711
            InvoiceAddLinesParams.Line.TaxAmount.TaxRateData taxRateData) {
1712
          this.taxRateData = taxRateData;
×
1713
          return this;
×
1714
        }
1715

1716
        /**
1717
         * <strong>Required.</strong> The amount on which tax is calculated, in cents (or local
1718
         * equivalent).
1719
         */
1720
        public Builder setTaxableAmount(Long taxableAmount) {
1721
          this.taxableAmount = taxableAmount;
×
1722
          return this;
×
1723
        }
1724
      }
1725

1726
      @Getter
1727
      public static class TaxRateData {
1728
        /**
1729
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
1730
         * 3166-1 alpha-2</a>).
1731
         */
1732
        @SerializedName("country")
1733
        String country;
1734

1735
        /**
1736
         * An arbitrary string attached to the tax rate for your internal use only. It will not be
1737
         * visible to your customers.
1738
         */
1739
        @SerializedName("description")
1740
        String description;
1741

1742
        /**
1743
         * <strong>Required.</strong> The display name of the tax rate, which will be shown to
1744
         * users.
1745
         */
1746
        @SerializedName("display_name")
1747
        String displayName;
1748

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

1759
        /** <strong>Required.</strong> This specifies if the tax rate is inclusive or exclusive. */
1760
        @SerializedName("inclusive")
1761
        Boolean inclusive;
1762

1763
        /**
1764
         * The jurisdiction for the tax rate. You can use this label field for tax reporting
1765
         * purposes. It also appears on your customer’s invoice.
1766
         */
1767
        @SerializedName("jurisdiction")
1768
        String jurisdiction;
1769

1770
        /**
1771
         * <strong>Required.</strong> The statutory tax rate percent. This field accepts decimal
1772
         * values between 0 and 100 inclusive with at most 4 decimal places. To accommodate
1773
         * fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages
1774
         * on the invoice unless the {@code amount} of the tax is also zero.
1775
         */
1776
        @SerializedName("percentage")
1777
        BigDecimal percentage;
1778

1779
        /**
1780
         * <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>,
1781
         * without country prefix. For example, &quot;NY&quot; for New York, United States.
1782
         */
1783
        @SerializedName("state")
1784
        String state;
1785

1786
        /** The high-level tax type, such as {@code vat} or {@code sales_tax}. */
1787
        @SerializedName("tax_type")
1788
        TaxType taxType;
1789

1790
        private TaxRateData(
1791
            String country,
1792
            String description,
1793
            String displayName,
1794
            Map<String, Object> extraParams,
1795
            Boolean inclusive,
1796
            String jurisdiction,
1797
            BigDecimal percentage,
1798
            String state,
1799
            TaxType taxType) {
×
1800
          this.country = country;
×
1801
          this.description = description;
×
1802
          this.displayName = displayName;
×
1803
          this.extraParams = extraParams;
×
1804
          this.inclusive = inclusive;
×
1805
          this.jurisdiction = jurisdiction;
×
1806
          this.percentage = percentage;
×
1807
          this.state = state;
×
1808
          this.taxType = taxType;
×
1809
        }
×
1810

1811
        public static Builder builder() {
1812
          return new Builder();
×
1813
        }
1814

1815
        public static class Builder {
×
1816
          private String country;
1817

1818
          private String description;
1819

1820
          private String displayName;
1821

1822
          private Map<String, Object> extraParams;
1823

1824
          private Boolean inclusive;
1825

1826
          private String jurisdiction;
1827

1828
          private BigDecimal percentage;
1829

1830
          private String state;
1831

1832
          private TaxType taxType;
1833

1834
          /** Finalize and obtain parameter instance from this builder. */
1835
          public InvoiceAddLinesParams.Line.TaxAmount.TaxRateData build() {
1836
            return new InvoiceAddLinesParams.Line.TaxAmount.TaxRateData(
×
1837
                this.country,
1838
                this.description,
1839
                this.displayName,
1840
                this.extraParams,
1841
                this.inclusive,
1842
                this.jurisdiction,
1843
                this.percentage,
1844
                this.state,
1845
                this.taxType);
1846
          }
1847

1848
          /**
1849
           * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
1850
           * 3166-1 alpha-2</a>).
1851
           */
1852
          public Builder setCountry(String country) {
1853
            this.country = country;
×
1854
            return this;
×
1855
          }
1856

1857
          /**
1858
           * An arbitrary string attached to the tax rate for your internal use only. It will not be
1859
           * visible to your customers.
1860
           */
1861
          public Builder setDescription(String description) {
1862
            this.description = description;
×
1863
            return this;
×
1864
          }
1865

1866
          /**
1867
           * <strong>Required.</strong> The display name of the tax rate, which will be shown to
1868
           * users.
1869
           */
1870
          public Builder setDisplayName(String displayName) {
1871
            this.displayName = displayName;
×
1872
            return this;
×
1873
          }
1874

1875
          /**
1876
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1877
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1878
           * map. See {@link InvoiceAddLinesParams.Line.TaxAmount.TaxRateData#extraParams} for the
1879
           * field documentation.
1880
           */
1881
          public Builder putExtraParam(String key, Object value) {
1882
            if (this.extraParams == null) {
×
1883
              this.extraParams = new HashMap<>();
×
1884
            }
1885
            this.extraParams.put(key, value);
×
1886
            return this;
×
1887
          }
1888

1889
          /**
1890
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1891
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1892
           * map. See {@link InvoiceAddLinesParams.Line.TaxAmount.TaxRateData#extraParams} for the
1893
           * field documentation.
1894
           */
1895
          public Builder putAllExtraParam(Map<String, Object> map) {
1896
            if (this.extraParams == null) {
×
1897
              this.extraParams = new HashMap<>();
×
1898
            }
1899
            this.extraParams.putAll(map);
×
1900
            return this;
×
1901
          }
1902

1903
          /**
1904
           * <strong>Required.</strong> This specifies if the tax rate is inclusive or exclusive.
1905
           */
1906
          public Builder setInclusive(Boolean inclusive) {
1907
            this.inclusive = inclusive;
×
1908
            return this;
×
1909
          }
1910

1911
          /**
1912
           * The jurisdiction for the tax rate. You can use this label field for tax reporting
1913
           * purposes. It also appears on your customer’s invoice.
1914
           */
1915
          public Builder setJurisdiction(String jurisdiction) {
1916
            this.jurisdiction = jurisdiction;
×
1917
            return this;
×
1918
          }
1919

1920
          /**
1921
           * <strong>Required.</strong> The statutory tax rate percent. This field accepts decimal
1922
           * values between 0 and 100 inclusive with at most 4 decimal places. To accommodate
1923
           * fixed-amount taxes, set the percentage to zero. Stripe will not display zero
1924
           * percentages on the invoice unless the {@code amount} of the tax is also zero.
1925
           */
1926
          public Builder setPercentage(BigDecimal percentage) {
1927
            this.percentage = percentage;
×
1928
            return this;
×
1929
          }
1930

1931
          /**
1932
           * <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>,
1933
           * without country prefix. For example, &quot;NY&quot; for New York, United States.
1934
           */
1935
          public Builder setState(String state) {
1936
            this.state = state;
×
1937
            return this;
×
1938
          }
1939

1940
          /** The high-level tax type, such as {@code vat} or {@code sales_tax}. */
1941
          public Builder setTaxType(
1942
              InvoiceAddLinesParams.Line.TaxAmount.TaxRateData.TaxType taxType) {
1943
            this.taxType = taxType;
×
1944
            return this;
×
1945
          }
1946
        }
1947

1948
        public enum TaxType implements ApiRequestParams.EnumParam {
×
1949
          @SerializedName("amusement_tax")
×
1950
          AMUSEMENT_TAX("amusement_tax"),
1951

1952
          @SerializedName("communications_tax")
×
1953
          COMMUNICATIONS_TAX("communications_tax"),
1954

1955
          @SerializedName("gst")
×
1956
          GST("gst"),
1957

1958
          @SerializedName("hst")
×
1959
          HST("hst"),
1960

1961
          @SerializedName("igst")
×
1962
          IGST("igst"),
1963

1964
          @SerializedName("jct")
×
1965
          JCT("jct"),
1966

1967
          @SerializedName("lease_tax")
×
1968
          LEASE_TAX("lease_tax"),
1969

1970
          @SerializedName("pst")
×
1971
          PST("pst"),
1972

1973
          @SerializedName("qst")
×
1974
          QST("qst"),
1975

1976
          @SerializedName("retail_delivery_fee")
×
1977
          RETAIL_DELIVERY_FEE("retail_delivery_fee"),
1978

1979
          @SerializedName("rst")
×
1980
          RST("rst"),
1981

1982
          @SerializedName("sales_tax")
×
1983
          SALES_TAX("sales_tax"),
1984

NEW
1985
          @SerializedName("service_tax")
×
1986
          SERVICE_TAX("service_tax"),
1987

UNCOV
1988
          @SerializedName("vat")
×
1989
          VAT("vat");
1990

1991
          @Getter(onMethod_ = {@Override})
1992
          private final String value;
1993

1994
          TaxType(String value) {
×
1995
            this.value = value;
×
1996
          }
×
1997
        }
1998
      }
1999
    }
2000
  }
2001
}
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