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

stripe / stripe-java / #16493

03 Oct 2024 07:15PM UTC coverage: 12.942% (+0.08%) from 12.864%
#16493

push

github

web-flow
Merge Stripe-java v27.0.0 to beta branch (#1888)

409 of 1651 new or added lines in 88 files covered. (24.77%)

31 existing lines in 7 files now uncovered.

18773 of 145050 relevant lines covered (12.94%)

0.13 hits per line

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

8.39
/src/main/java/com/stripe/model/InvoiceLineItem.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.billing.CreditBalanceTransaction;
7
import com.stripe.net.ApiRequest;
8
import com.stripe.net.ApiRequestParams;
9
import com.stripe.net.ApiResource;
10
import com.stripe.net.BaseAddress;
11
import com.stripe.net.RequestOptions;
12
import com.stripe.net.StripeResponseGetter;
13
import com.stripe.param.InvoiceLineItemUpdateParams;
14
import java.math.BigDecimal;
15
import java.util.List;
16
import java.util.Map;
17
import java.util.stream.Collectors;
18
import lombok.EqualsAndHashCode;
19
import lombok.Getter;
20
import lombok.Setter;
21

22
/**
23
 * Invoice Line Items represent the individual lines within an <a
24
 * href="https://stripe.com/docs/api/invoices">invoice</a> and only exist within the context of an
25
 * invoice.
26
 *
27
 * <p>Each line item is backed by either an <a
28
 * href="https://stripe.com/docs/api/invoiceitems">invoice item</a> or a <a
29
 * href="https://stripe.com/docs/api/subscription_items">subscription item</a>.
30
 */
31
@Getter
32
@Setter
33
@EqualsAndHashCode(callSuper = false)
34
public class InvoiceLineItem extends ApiResource implements HasId, MetadataStore<InvoiceLineItem> {
1✔
35
  /** The amount, in cents (or local equivalent). */
36
  @SerializedName("amount")
37
  Long amount;
38

39
  /**
40
   * The integer amount in cents (or local equivalent) representing the amount for this line item,
41
   * excluding all tax and discounts.
42
   */
43
  @SerializedName("amount_excluding_tax")
44
  Long amountExcludingTax;
45

46
  /**
47
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
48
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
49
   */
50
  @SerializedName("currency")
51
  String currency;
52

53
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
54
  @SerializedName("description")
55
  String description;
56

57
  /** The amount of discount calculated per discount for this line item. */
58
  @SerializedName("discount_amounts")
59
  List<InvoiceLineItem.DiscountAmount> discountAmounts;
60

61
  /** If true, discounts will apply to this line item. Always false for prorations. */
62
  @SerializedName("discountable")
63
  Boolean discountable;
64

65
  /**
66
   * The discounts applied to the invoice line item. Line item discounts are applied before invoice
67
   * discounts. Use {@code expand[]=discounts} to expand each discount.
68
   */
69
  @SerializedName("discounts")
70
  List<ExpandableField<Discount>> discounts;
71

72
  /** Unique identifier for the object. */
73
  @Getter(onMethod_ = {@Override})
74
  @SerializedName("id")
75
  String id;
76

77
  /** The ID of the invoice that contains this line item. */
78
  @SerializedName("invoice")
79
  String invoice;
80

81
  /**
82
   * The ID of the <a href="https://stripe.com/docs/api/invoiceitems">invoice item</a> associated
83
   * with this line item if any.
84
   */
85
  @SerializedName("invoice_item")
86
  @Getter(lombok.AccessLevel.NONE)
87
  @Setter(lombok.AccessLevel.NONE)
88
  ExpandableField<InvoiceItem> invoiceItem;
89

90
  /**
91
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
92
   * object exists in test mode.
93
   */
94
  @SerializedName("livemode")
95
  Boolean livemode;
96

97
  /** The amount of margin calculated per margin for this line item. */
98
  @SerializedName("margin_amounts")
99
  List<InvoiceLineItem.MarginAmount> marginAmounts;
100

101
  /**
102
   * The margins applied to the line item. When set, the {@code default_margins} on the invoice do
103
   * not apply to the line item. Use {@code expand[]=margins} to expand each margin.
104
   */
105
  @SerializedName("margins")
106
  List<ExpandableField<Margin>> margins;
107

108
  /**
109
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
110
   * to an object. This can be useful for storing additional information about the object in a
111
   * structured format. Note that for line items with {@code type=subscription}, {@code metadata}
112
   * reflects the current metadata from the subscription associated with the line item, unless the
113
   * invoice line was directly updated with different metadata after creation.
114
   */
115
  @Getter(onMethod_ = {@Override})
116
  @SerializedName("metadata")
117
  Map<String, String> metadata;
118

119
  /**
120
   * String representing the object's type. Objects of the same type share the same value.
121
   *
122
   * <p>Equal to {@code line_item}.
123
   */
124
  @SerializedName("object")
125
  String object;
126

127
  @SerializedName("period")
128
  Period period;
129

130
  /** The plan of the subscription, if the line item is a subscription or a proration. */
131
  @SerializedName("plan")
132
  Plan plan;
133

134
  @SerializedName("pretax_credit_amounts")
135
  List<InvoiceLineItem.PretaxCreditAmount> pretaxCreditAmounts;
136

137
  /** The price of the line item. */
138
  @SerializedName("price")
139
  Price price;
140

141
  /** Whether this is a proration. */
142
  @SerializedName("proration")
143
  Boolean proration;
144

145
  /** Additional details for proration line items. */
146
  @SerializedName("proration_details")
147
  ProrationDetails prorationDetails;
148

149
  /** The quantity of the subscription, if the line item is a subscription or a proration. */
150
  @SerializedName("quantity")
151
  Long quantity;
152

153
  /** The subscription that the invoice item pertains to, if any. */
154
  @SerializedName("subscription")
155
  @Getter(lombok.AccessLevel.NONE)
156
  @Setter(lombok.AccessLevel.NONE)
157
  ExpandableField<Subscription> subscription;
158

159
  /**
160
   * The subscription item that generated this line item. Left empty if the line item is not an
161
   * explicit result of a subscription.
162
   */
163
  @SerializedName("subscription_item")
164
  @Getter(lombok.AccessLevel.NONE)
165
  @Setter(lombok.AccessLevel.NONE)
166
  ExpandableField<SubscriptionItem> subscriptionItem;
167

168
  /** The amount of tax calculated per tax rate for this line item. */
169
  @SerializedName("tax_amounts")
170
  List<InvoiceLineItem.TaxAmount> taxAmounts;
171

172
  /** The tax rates which apply to the line item. */
173
  @SerializedName("tax_rates")
174
  List<TaxRate> taxRates;
175

176
  /**
177
   * A string identifying the type of the source of this line item, either an {@code invoiceitem} or
178
   * a {@code subscription}.
179
   *
180
   * <p>One of {@code invoiceitem}, or {@code subscription}.
181
   */
182
  @SerializedName("type")
183
  String type;
184

185
  /**
186
   * The amount in cents (or local equivalent) representing the unit amount for this line item,
187
   * excluding all tax and discounts.
188
   */
189
  @SerializedName("unit_amount_excluding_tax")
190
  BigDecimal unitAmountExcludingTax;
191

192
  /** Get ID of expandable {@code invoiceItem} object. */
193
  public String getInvoiceItem() {
194
    return (this.invoiceItem != null) ? this.invoiceItem.getId() : null;
×
195
  }
196

197
  public void setInvoiceItem(String id) {
198
    this.invoiceItem = ApiResource.setExpandableFieldId(id, this.invoiceItem);
×
199
  }
×
200

201
  /** Get expanded {@code invoiceItem}. */
202
  public InvoiceItem getInvoiceItemObject() {
203
    return (this.invoiceItem != null) ? this.invoiceItem.getExpanded() : null;
×
204
  }
205

206
  public void setInvoiceItemObject(InvoiceItem expandableObject) {
207
    this.invoiceItem = new ExpandableField<InvoiceItem>(expandableObject.getId(), expandableObject);
×
208
  }
×
209

210
  /** Get ID of expandable {@code subscription} object. */
211
  public String getSubscription() {
212
    return (this.subscription != null) ? this.subscription.getId() : null;
×
213
  }
214

215
  public void setSubscription(String id) {
216
    this.subscription = ApiResource.setExpandableFieldId(id, this.subscription);
×
217
  }
×
218

219
  /** Get expanded {@code subscription}. */
220
  public Subscription getSubscriptionObject() {
221
    return (this.subscription != null) ? this.subscription.getExpanded() : null;
×
222
  }
223

224
  public void setSubscriptionObject(Subscription expandableObject) {
225
    this.subscription =
×
226
        new ExpandableField<Subscription>(expandableObject.getId(), expandableObject);
×
227
  }
×
228

229
  /** Get ID of expandable {@code subscriptionItem} object. */
230
  public String getSubscriptionItem() {
231
    return (this.subscriptionItem != null) ? this.subscriptionItem.getId() : null;
×
232
  }
233

234
  public void setSubscriptionItem(String id) {
235
    this.subscriptionItem = ApiResource.setExpandableFieldId(id, this.subscriptionItem);
×
236
  }
×
237

238
  /** Get expanded {@code subscriptionItem}. */
239
  public SubscriptionItem getSubscriptionItemObject() {
240
    return (this.subscriptionItem != null) ? this.subscriptionItem.getExpanded() : null;
×
241
  }
242

243
  public void setSubscriptionItemObject(SubscriptionItem expandableObject) {
244
    this.subscriptionItem =
×
245
        new ExpandableField<SubscriptionItem>(expandableObject.getId(), expandableObject);
×
246
  }
×
247

248
  /** Get IDs of expandable {@code discounts} object list. */
249
  public List<String> getDiscounts() {
250
    return (this.discounts != null)
×
251
        ? this.discounts.stream().map(x -> x.getId()).collect(Collectors.toList())
×
252
        : null;
×
253
  }
254

255
  public void setDiscounts(List<String> ids) {
256
    if (ids == null) {
×
257
      this.discounts = null;
×
258
      return;
×
259
    }
260
    if (this.discounts != null
×
261
        && this.discounts.stream().map(x -> x.getId()).collect(Collectors.toList()).equals(ids)) {
×
262
      // noop if the ids are equal to what are already present
263
      return;
×
264
    }
265
    this.discounts =
×
266
        (ids != null)
×
267
            ? ids.stream()
×
268
                .map(id -> new ExpandableField<Discount>(id, null))
×
269
                .collect(Collectors.toList())
×
270
            : null;
×
271
  }
×
272

273
  /** Get expanded {@code discounts}. */
274
  public List<Discount> getDiscountObjects() {
275
    return (this.discounts != null)
×
276
        ? this.discounts.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
277
        : null;
×
278
  }
279

280
  public void setDiscountObjects(List<Discount> objs) {
281
    this.discounts =
×
282
        objs != null
×
283
            ? objs.stream()
×
284
                .map(x -> new ExpandableField<Discount>(x.getId(), x))
×
285
                .collect(Collectors.toList())
×
286
            : null;
×
287
  }
×
288

289
  /** Get IDs of expandable {@code margins} object list. */
290
  public List<String> getMargins() {
291
    return (this.margins != null)
×
292
        ? this.margins.stream().map(x -> x.getId()).collect(Collectors.toList())
×
293
        : null;
×
294
  }
295

296
  public void setMargins(List<String> ids) {
297
    if (ids == null) {
×
298
      this.margins = null;
×
299
      return;
×
300
    }
301
    if (this.margins != null
×
302
        && this.margins.stream().map(x -> x.getId()).collect(Collectors.toList()).equals(ids)) {
×
303
      // noop if the ids are equal to what are already present
304
      return;
×
305
    }
306
    this.margins =
×
307
        (ids != null)
×
308
            ? ids.stream()
×
309
                .map(id -> new ExpandableField<Margin>(id, null))
×
310
                .collect(Collectors.toList())
×
311
            : null;
×
312
  }
×
313

314
  /** Get expanded {@code margins}. */
315
  public List<Margin> getMarginObjects() {
316
    return (this.margins != null)
×
317
        ? this.margins.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
318
        : null;
×
319
  }
320

321
  public void setMarginObjects(List<Margin> objs) {
322
    this.margins =
×
323
        objs != null
×
324
            ? objs.stream()
×
325
                .map(x -> new ExpandableField<Margin>(x.getId(), x))
×
326
                .collect(Collectors.toList())
×
327
            : null;
×
328
  }
×
329

330
  /**
331
   * Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
332
   * invoice line item, so they can only be updated through this endpoint. Other fields, such as
333
   * {@code amount}, live on both the invoice item and the invoice line item, so updates on this
334
   * endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
335
   * possible before the invoice is finalized.
336
   */
337
  @Override
338
  public InvoiceLineItem update(Map<String, Object> params) throws StripeException {
339
    return update(params, (RequestOptions) null);
×
340
  }
341

342
  /**
343
   * Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
344
   * invoice line item, so they can only be updated through this endpoint. Other fields, such as
345
   * {@code amount}, live on both the invoice item and the invoice line item, so updates on this
346
   * endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
347
   * possible before the invoice is finalized.
348
   */
349
  @Override
350
  public InvoiceLineItem update(Map<String, Object> params, RequestOptions options)
351
      throws StripeException {
352
    String path =
×
353
        String.format(
×
354
            "/v1/invoices/%s/lines/%s",
355
            ApiResource.urlEncodeId(this.getInvoice()), ApiResource.urlEncodeId(this.getId()));
×
356
    ApiRequest request =
×
357
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
358
    return getResponseGetter().request(request, InvoiceLineItem.class);
×
359
  }
360

361
  /**
362
   * Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
363
   * invoice line item, so they can only be updated through this endpoint. Other fields, such as
364
   * {@code amount}, live on both the invoice item and the invoice line item, so updates on this
365
   * endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
366
   * possible before the invoice is finalized.
367
   */
368
  public InvoiceLineItem update(InvoiceLineItemUpdateParams params) throws StripeException {
369
    return update(params, (RequestOptions) null);
×
370
  }
371

372
  /**
373
   * Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
374
   * invoice line item, so they can only be updated through this endpoint. Other fields, such as
375
   * {@code amount}, live on both the invoice item and the invoice line item, so updates on this
376
   * endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
377
   * possible before the invoice is finalized.
378
   */
379
  public InvoiceLineItem update(InvoiceLineItemUpdateParams params, RequestOptions options)
380
      throws StripeException {
381
    String path =
×
382
        String.format(
×
383
            "/v1/invoices/%s/lines/%s",
384
            ApiResource.urlEncodeId(this.getInvoice()), ApiResource.urlEncodeId(this.getId()));
×
385
    ApiResource.checkNullTypedParams(path, params);
×
386
    ApiRequest request =
×
387
        new ApiRequest(
388
            BaseAddress.API,
389
            ApiResource.RequestMethod.POST,
390
            path,
391
            ApiRequestParams.paramsToMap(params),
×
392
            options);
393
    return getResponseGetter().request(request, InvoiceLineItem.class);
×
394
  }
395

396
  @Getter
397
  @Setter
398
  @EqualsAndHashCode(callSuper = false)
399
  public static class DiscountAmount extends StripeObject {
×
400
    /** The amount, in cents (or local equivalent), of the discount. */
401
    @SerializedName("amount")
402
    Long amount;
403

404
    /** The discount that was applied to get this discount amount. */
405
    @SerializedName("discount")
406
    @Getter(lombok.AccessLevel.NONE)
407
    @Setter(lombok.AccessLevel.NONE)
408
    ExpandableField<Discount> discount;
409

410
    /** Get ID of expandable {@code discount} object. */
411
    public String getDiscount() {
412
      return (this.discount != null) ? this.discount.getId() : null;
×
413
    }
414

415
    public void setDiscount(String id) {
416
      this.discount = ApiResource.setExpandableFieldId(id, this.discount);
×
417
    }
×
418

419
    /** Get expanded {@code discount}. */
420
    public Discount getDiscountObject() {
421
      return (this.discount != null) ? this.discount.getExpanded() : null;
×
422
    }
423

424
    public void setDiscountObject(Discount expandableObject) {
425
      this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
×
426
    }
×
427
  }
428

429
  @Getter
430
  @Setter
431
  @EqualsAndHashCode(callSuper = false)
432
  public static class MarginAmount extends StripeObject {
×
433
    /** The amount, in cents (or local equivalent), of the reduction in line item amount. */
434
    @SerializedName("amount")
435
    Long amount;
436

437
    /** The margin that was applied to get this margin amount. */
438
    @SerializedName("margin")
439
    @Getter(lombok.AccessLevel.NONE)
440
    @Setter(lombok.AccessLevel.NONE)
441
    ExpandableField<Margin> margin;
442

443
    /** Get ID of expandable {@code margin} object. */
444
    public String getMargin() {
445
      return (this.margin != null) ? this.margin.getId() : null;
×
446
    }
447

448
    public void setMargin(String id) {
449
      this.margin = ApiResource.setExpandableFieldId(id, this.margin);
×
450
    }
×
451

452
    /** Get expanded {@code margin}. */
453
    public Margin getMarginObject() {
454
      return (this.margin != null) ? this.margin.getExpanded() : null;
×
455
    }
456

457
    public void setMarginObject(Margin expandableObject) {
458
      this.margin = new ExpandableField<Margin>(expandableObject.getId(), expandableObject);
×
459
    }
×
460
  }
461

462
  @Getter
463
  @Setter
464
  @EqualsAndHashCode(callSuper = false)
465
  public static class Period extends StripeObject {
1✔
466
    /**
467
     * The end of the period, which must be greater than or equal to the start. This value is
468
     * inclusive.
469
     */
470
    @SerializedName("end")
471
    Long end;
472

473
    /** The start of the period. This value is inclusive. */
474
    @SerializedName("start")
475
    Long start;
476
  }
477

478
  @Getter
479
  @Setter
480
  @EqualsAndHashCode(callSuper = false)
NEW
481
  public static class PretaxCreditAmount extends StripeObject {
×
482
    /** The amount, in cents (or local equivalent), of the pretax credit amount. */
483
    @SerializedName("amount")
484
    Long amount;
485

486
    /** The credit balance transaction that was applied to get this pretax credit amount. */
487
    @SerializedName("credit_balance_transaction")
488
    @Getter(lombok.AccessLevel.NONE)
489
    @Setter(lombok.AccessLevel.NONE)
490
    ExpandableField<CreditBalanceTransaction> creditBalanceTransaction;
491

492
    /** The discount that was applied to get this pretax credit amount. */
493
    @SerializedName("discount")
494
    @Getter(lombok.AccessLevel.NONE)
495
    @Setter(lombok.AccessLevel.NONE)
496
    ExpandableField<Discount> discount;
497

498
    /** The margin that was applied to get this pretax credit amount. */
499
    @SerializedName("margin")
500
    @Getter(lombok.AccessLevel.NONE)
501
    @Setter(lombok.AccessLevel.NONE)
502
    ExpandableField<Margin> margin;
503

504
    /**
505
     * Type of the pretax credit amount referenced.
506
     *
507
     * <p>One of {@code credit_balance_transaction}, {@code discount}, or {@code margin}.
508
     */
509
    @SerializedName("type")
510
    String type;
511

512
    /** Get ID of expandable {@code creditBalanceTransaction} object. */
513
    public String getCreditBalanceTransaction() {
NEW
514
      return (this.creditBalanceTransaction != null) ? this.creditBalanceTransaction.getId() : null;
×
515
    }
516

517
    public void setCreditBalanceTransaction(String id) {
NEW
518
      this.creditBalanceTransaction =
×
NEW
519
          ApiResource.setExpandableFieldId(id, this.creditBalanceTransaction);
×
NEW
520
    }
×
521

522
    /** Get expanded {@code creditBalanceTransaction}. */
523
    public CreditBalanceTransaction getCreditBalanceTransactionObject() {
NEW
524
      return (this.creditBalanceTransaction != null)
×
NEW
525
          ? this.creditBalanceTransaction.getExpanded()
×
NEW
526
          : null;
×
527
    }
528

529
    public void setCreditBalanceTransactionObject(CreditBalanceTransaction expandableObject) {
NEW
530
      this.creditBalanceTransaction =
×
NEW
531
          new ExpandableField<CreditBalanceTransaction>(expandableObject.getId(), expandableObject);
×
NEW
532
    }
×
533

534
    /** Get ID of expandable {@code discount} object. */
535
    public String getDiscount() {
NEW
536
      return (this.discount != null) ? this.discount.getId() : null;
×
537
    }
538

539
    public void setDiscount(String id) {
NEW
540
      this.discount = ApiResource.setExpandableFieldId(id, this.discount);
×
NEW
541
    }
×
542

543
    /** Get expanded {@code discount}. */
544
    public Discount getDiscountObject() {
NEW
545
      return (this.discount != null) ? this.discount.getExpanded() : null;
×
546
    }
547

548
    public void setDiscountObject(Discount expandableObject) {
NEW
549
      this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
×
NEW
550
    }
×
551

552
    /** Get ID of expandable {@code margin} object. */
553
    public String getMargin() {
NEW
554
      return (this.margin != null) ? this.margin.getId() : null;
×
555
    }
556

557
    public void setMargin(String id) {
NEW
558
      this.margin = ApiResource.setExpandableFieldId(id, this.margin);
×
NEW
559
    }
×
560

561
    /** Get expanded {@code margin}. */
562
    public Margin getMarginObject() {
NEW
563
      return (this.margin != null) ? this.margin.getExpanded() : null;
×
564
    }
565

566
    public void setMarginObject(Margin expandableObject) {
NEW
567
      this.margin = new ExpandableField<Margin>(expandableObject.getId(), expandableObject);
×
NEW
568
    }
×
569
  }
570

571
  @Getter
572
  @Setter
573
  @EqualsAndHashCode(callSuper = false)
574
  public static class ProrationDetails extends StripeObject {
1✔
575
    /**
576
     * For a credit proration {@code line_item}, the original debit line_items to which the credit
577
     * proration applies.
578
     */
579
    @SerializedName("credited_items")
580
    CreditedItems creditedItems;
581

582
    @Getter
583
    @Setter
584
    @EqualsAndHashCode(callSuper = false)
585
    public static class CreditedItems extends StripeObject {
×
586
      /** Invoice containing the credited invoice line items. */
587
      @SerializedName("invoice")
588
      String invoice;
589

590
      /** Credited invoice line items. */
591
      @SerializedName("invoice_line_items")
592
      List<String> invoiceLineItems;
593
    }
594
  }
595

596
  @Getter
597
  @Setter
598
  @EqualsAndHashCode(callSuper = false)
599
  public static class TaxAmount extends StripeObject {
×
600
    /** The amount, in cents (or local equivalent), of the tax. */
601
    @SerializedName("amount")
602
    Long amount;
603

604
    /** Whether this tax amount is inclusive or exclusive. */
605
    @SerializedName("inclusive")
606
    Boolean inclusive;
607

608
    /** The tax rate that was applied to get this tax amount. */
609
    @SerializedName("tax_rate")
610
    @Getter(lombok.AccessLevel.NONE)
611
    @Setter(lombok.AccessLevel.NONE)
612
    ExpandableField<TaxRate> taxRate;
613

614
    /**
615
     * The reasoning behind this tax, for example, if the product is tax exempt. The possible values
616
     * for this field may be extended as new tax rules are supported.
617
     *
618
     * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax}, {@code
619
     * not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated}, {@code
620
     * portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday}, {@code
621
     * proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code standard_rated},
622
     * {@code taxable_basis_reduced}, or {@code zero_rated}.
623
     */
624
    @SerializedName("taxability_reason")
625
    String taxabilityReason;
626

627
    /** The amount on which tax is calculated, in cents (or local equivalent). */
628
    @SerializedName("taxable_amount")
629
    Long taxableAmount;
630

631
    /** Get ID of expandable {@code taxRate} object. */
632
    public String getTaxRate() {
633
      return (this.taxRate != null) ? this.taxRate.getId() : null;
×
634
    }
635

636
    public void setTaxRate(String id) {
637
      this.taxRate = ApiResource.setExpandableFieldId(id, this.taxRate);
×
638
    }
×
639

640
    /** Get expanded {@code taxRate}. */
641
    public TaxRate getTaxRateObject() {
642
      return (this.taxRate != null) ? this.taxRate.getExpanded() : null;
×
643
    }
644

645
    public void setTaxRateObject(TaxRate expandableObject) {
646
      this.taxRate = new ExpandableField<TaxRate>(expandableObject.getId(), expandableObject);
×
647
    }
×
648
  }
649

650
  @Override
651
  public void setResponseGetter(StripeResponseGetter responseGetter) {
652
    super.setResponseGetter(responseGetter);
1✔
653
    trySetResponseGetter(invoiceItem, responseGetter);
1✔
654
    trySetResponseGetter(period, responseGetter);
1✔
655
    trySetResponseGetter(plan, responseGetter);
1✔
656
    trySetResponseGetter(price, responseGetter);
1✔
657
    trySetResponseGetter(prorationDetails, responseGetter);
1✔
658
    trySetResponseGetter(subscription, responseGetter);
1✔
659
    trySetResponseGetter(subscriptionItem, responseGetter);
1✔
660
  }
1✔
661
}
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