• 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

3.13
/src/main/java/com/stripe/model/CreditNoteLineItem.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.model.billing.CreditBalanceTransaction;
6
import com.stripe.net.ApiResource;
7
import java.math.BigDecimal;
8
import java.util.List;
9
import lombok.EqualsAndHashCode;
10
import lombok.Getter;
11
import lombok.Setter;
12

13
/** The credit note line item object. */
14
@Getter
15
@Setter
16
@EqualsAndHashCode(callSuper = false)
17
public class CreditNoteLineItem extends StripeObject implements HasId {
1✔
18
  /**
19
   * The integer amount in cents (or local equivalent) representing the gross amount being credited
20
   * for this line item, excluding (exclusive) tax and discounts.
21
   */
22
  @SerializedName("amount")
23
  Long amount;
24

25
  /**
26
   * The integer amount in cents (or local equivalent) representing the amount being credited for
27
   * this line item, excluding all tax and discounts.
28
   */
29
  @SerializedName("amount_excluding_tax")
30
  Long amountExcludingTax;
31

32
  /** Description of the item being credited. */
33
  @SerializedName("description")
34
  String description;
35

36
  /**
37
   * The integer amount in cents (or local equivalent) representing the discount being credited for
38
   * this line item.
39
   */
40
  @SerializedName("discount_amount")
41
  Long discountAmount;
42

43
  /** The amount of discount calculated per discount for this line item. */
44
  @SerializedName("discount_amounts")
45
  List<CreditNoteLineItem.DiscountAmount> discountAmounts;
46

47
  /** Unique identifier for the object. */
48
  @Getter(onMethod_ = {@Override})
49
  @SerializedName("id")
50
  String id;
51

52
  /** ID of the invoice line item being credited. */
53
  @SerializedName("invoice_line_item")
54
  String invoiceLineItem;
55

56
  /**
57
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
58
   * object exists in test mode.
59
   */
60
  @SerializedName("livemode")
61
  Boolean livemode;
62

63
  /**
64
   * String representing the object's type. Objects of the same type share the same value.
65
   *
66
   * <p>Equal to {@code credit_note_line_item}.
67
   */
68
  @SerializedName("object")
69
  String object;
70

71
  @SerializedName("pretax_credit_amounts")
72
  List<CreditNoteLineItem.PretaxCreditAmount> pretaxCreditAmounts;
73

74
  /** The number of units of product being credited. */
75
  @SerializedName("quantity")
76
  Long quantity;
77

78
  /** The amount of tax calculated per tax rate for this line item. */
79
  @SerializedName("tax_amounts")
80
  List<CreditNoteLineItem.TaxAmount> taxAmounts;
81

82
  /** The tax rates which apply to the line item. */
83
  @SerializedName("tax_rates")
84
  List<TaxRate> taxRates;
85

86
  /**
87
   * The type of the credit note line item, one of {@code invoice_line_item} or {@code
88
   * custom_line_item}. When the type is {@code invoice_line_item} there is an additional {@code
89
   * invoice_line_item} property on the resource the value of which is the id of the credited line
90
   * item on the invoice.
91
   */
92
  @SerializedName("type")
93
  String type;
94

95
  /** The cost of each unit of product being credited. */
96
  @SerializedName("unit_amount")
97
  Long unitAmount;
98

99
  /** Same as {@code unit_amount}, but contains a decimal value with at most 12 decimal places. */
100
  @SerializedName("unit_amount_decimal")
101
  BigDecimal unitAmountDecimal;
102

103
  /**
104
   * The amount in cents (or local equivalent) representing the unit amount being credited for this
105
   * line item, excluding all tax and discounts.
106
   */
107
  @SerializedName("unit_amount_excluding_tax")
108
  BigDecimal unitAmountExcludingTax;
109

110
  @Getter
111
  @Setter
112
  @EqualsAndHashCode(callSuper = false)
113
  public static class DiscountAmount extends StripeObject {
×
114
    /** The amount, in cents (or local equivalent), of the discount. */
115
    @SerializedName("amount")
116
    Long amount;
117

118
    /** The discount that was applied to get this discount amount. */
119
    @SerializedName("discount")
120
    @Getter(lombok.AccessLevel.NONE)
121
    @Setter(lombok.AccessLevel.NONE)
122
    ExpandableField<Discount> discount;
123

124
    /** Get ID of expandable {@code discount} object. */
125
    public String getDiscount() {
126
      return (this.discount != null) ? this.discount.getId() : null;
×
127
    }
128

129
    public void setDiscount(String id) {
130
      this.discount = ApiResource.setExpandableFieldId(id, this.discount);
×
131
    }
×
132

133
    /** Get expanded {@code discount}. */
134
    public Discount getDiscountObject() {
135
      return (this.discount != null) ? this.discount.getExpanded() : null;
×
136
    }
137

138
    public void setDiscountObject(Discount expandableObject) {
139
      this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
×
140
    }
×
141
  }
142

143
  @Getter
144
  @Setter
145
  @EqualsAndHashCode(callSuper = false)
NEW
146
  public static class PretaxCreditAmount extends StripeObject {
×
147
    /** The amount, in cents (or local equivalent), of the pretax credit amount. */
148
    @SerializedName("amount")
149
    Long amount;
150

151
    /** The credit balance transaction that was applied to get this pretax credit amount. */
152
    @SerializedName("credit_balance_transaction")
153
    @Getter(lombok.AccessLevel.NONE)
154
    @Setter(lombok.AccessLevel.NONE)
155
    ExpandableField<CreditBalanceTransaction> creditBalanceTransaction;
156

157
    /** The discount that was applied to get this pretax credit amount. */
158
    @SerializedName("discount")
159
    @Getter(lombok.AccessLevel.NONE)
160
    @Setter(lombok.AccessLevel.NONE)
161
    ExpandableField<Discount> discount;
162

163
    /**
164
     * Type of the pretax credit amount referenced.
165
     *
166
     * <p>One of {@code credit_balance_transaction}, or {@code discount}.
167
     */
168
    @SerializedName("type")
169
    String type;
170

171
    /** Get ID of expandable {@code creditBalanceTransaction} object. */
172
    public String getCreditBalanceTransaction() {
NEW
173
      return (this.creditBalanceTransaction != null) ? this.creditBalanceTransaction.getId() : null;
×
174
    }
175

176
    public void setCreditBalanceTransaction(String id) {
NEW
177
      this.creditBalanceTransaction =
×
NEW
178
          ApiResource.setExpandableFieldId(id, this.creditBalanceTransaction);
×
NEW
179
    }
×
180

181
    /** Get expanded {@code creditBalanceTransaction}. */
182
    public CreditBalanceTransaction getCreditBalanceTransactionObject() {
NEW
183
      return (this.creditBalanceTransaction != null)
×
NEW
184
          ? this.creditBalanceTransaction.getExpanded()
×
NEW
185
          : null;
×
186
    }
187

188
    public void setCreditBalanceTransactionObject(CreditBalanceTransaction expandableObject) {
NEW
189
      this.creditBalanceTransaction =
×
NEW
190
          new ExpandableField<CreditBalanceTransaction>(expandableObject.getId(), expandableObject);
×
NEW
191
    }
×
192

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

198
    public void setDiscount(String id) {
NEW
199
      this.discount = ApiResource.setExpandableFieldId(id, this.discount);
×
NEW
200
    }
×
201

202
    /** Get expanded {@code discount}. */
203
    public Discount getDiscountObject() {
NEW
204
      return (this.discount != null) ? this.discount.getExpanded() : null;
×
205
    }
206

207
    public void setDiscountObject(Discount expandableObject) {
NEW
208
      this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
×
NEW
209
    }
×
210
  }
211

212
  @Getter
213
  @Setter
214
  @EqualsAndHashCode(callSuper = false)
215
  public static class TaxAmount extends StripeObject {
×
216
    /** The amount, in cents (or local equivalent), of the tax. */
217
    @SerializedName("amount")
218
    Long amount;
219

220
    /** Whether this tax amount is inclusive or exclusive. */
221
    @SerializedName("inclusive")
222
    Boolean inclusive;
223

224
    /** The tax rate that was applied to get this tax amount. */
225
    @SerializedName("tax_rate")
226
    @Getter(lombok.AccessLevel.NONE)
227
    @Setter(lombok.AccessLevel.NONE)
228
    ExpandableField<TaxRate> taxRate;
229

230
    /**
231
     * The reasoning behind this tax, for example, if the product is tax exempt. The possible values
232
     * for this field may be extended as new tax rules are supported.
233
     *
234
     * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax}, {@code
235
     * not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated}, {@code
236
     * portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday}, {@code
237
     * proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code standard_rated},
238
     * {@code taxable_basis_reduced}, or {@code zero_rated}.
239
     */
240
    @SerializedName("taxability_reason")
241
    String taxabilityReason;
242

243
    /** The amount on which tax is calculated, in cents (or local equivalent). */
244
    @SerializedName("taxable_amount")
245
    Long taxableAmount;
246

247
    /** Get ID of expandable {@code taxRate} object. */
248
    public String getTaxRate() {
249
      return (this.taxRate != null) ? this.taxRate.getId() : null;
×
250
    }
251

252
    public void setTaxRate(String id) {
253
      this.taxRate = ApiResource.setExpandableFieldId(id, this.taxRate);
×
254
    }
×
255

256
    /** Get expanded {@code taxRate}. */
257
    public TaxRate getTaxRateObject() {
258
      return (this.taxRate != null) ? this.taxRate.getExpanded() : null;
×
259
    }
260

261
    public void setTaxRateObject(TaxRate expandableObject) {
262
      this.taxRate = new ExpandableField<TaxRate>(expandableObject.getId(), expandableObject);
×
263
    }
×
264
  }
265
}
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