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

stripe / stripe-java / #16659

21 Nov 2024 07:24PM UTC coverage: 12.4% (-0.01%) from 12.414%
#16659

push

github

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

Update generated code for beta

3 of 189 new or added lines in 10 files covered. (1.59%)

1 existing line in 1 file now uncovered.

18860 of 152092 relevant lines covered (12.4%)

0.12 hits per line

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

9.09
/src/main/java/com/stripe/model/LineItem.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.net.ApiResource;
6
import java.util.List;
7
import java.util.Map;
8
import lombok.EqualsAndHashCode;
9
import lombok.Getter;
10
import lombok.Setter;
11

12
/** A line item. */
13
@Getter
14
@Setter
15
@EqualsAndHashCode(callSuper = false)
16
public class LineItem extends StripeObject implements HasId {
1✔
17
  @SerializedName("adjustable_quantity")
18
  AdjustableQuantity adjustableQuantity;
19

20
  /** Total discount amount applied. If no discounts were applied, defaults to 0. */
21
  @SerializedName("amount_discount")
22
  Long amountDiscount;
23

24
  /** Total before any discounts or taxes are applied. */
25
  @SerializedName("amount_subtotal")
26
  Long amountSubtotal;
27

28
  /** Total tax amount applied. If no tax was applied, defaults to 0. */
29
  @SerializedName("amount_tax")
30
  Long amountTax;
31

32
  /** Total after discounts and taxes. */
33
  @SerializedName("amount_total")
34
  Long amountTotal;
35

36
  /**
37
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
38
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
39
   */
40
  @SerializedName("currency")
41
  String currency;
42

43
  /**
44
   * An arbitrary string attached to the object. Often useful for displaying to users. Defaults to
45
   * product name.
46
   */
47
  @SerializedName("description")
48
  String description;
49

50
  /** The discounts applied to the line item. */
51
  @SerializedName("discounts")
52
  List<LineItem.Discount> discounts;
53

54
  @SerializedName("display")
55
  Display display;
56

57
  /** Unique identifier for the object. */
58
  @Getter(onMethod_ = {@Override})
59
  @SerializedName("id")
60
  String id;
61

62
  /**
63
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
64
   * to an object. This can be useful for storing additional information about the object in a
65
   * structured format.
66
   */
67
  @SerializedName("metadata")
68
  Map<String, String> metadata;
69

70
  /**
71
   * String representing the object's type. Objects of the same type share the same value.
72
   *
73
   * <p>Equal to {@code item}.
74
   */
75
  @SerializedName("object")
76
  String object;
77

78
  /** The price used to generate the line item. */
79
  @SerializedName("price")
80
  Price price;
81

82
  /**
83
   * The ID of the product for this line item.
84
   *
85
   * <p>This will always be the same as {@code price.product}.
86
   */
87
  @SerializedName("product")
88
  @Getter(lombok.AccessLevel.NONE)
89
  @Setter(lombok.AccessLevel.NONE)
90
  ExpandableField<Product> product;
91

92
  /** The quantity of products being purchased. */
93
  @SerializedName("quantity")
94
  Long quantity;
95

96
  /** The taxes applied to the line item. */
97
  @SerializedName("taxes")
98
  List<LineItem.Tax> taxes;
99

100
  /** Get ID of expandable {@code product} object. */
101
  public String getProduct() {
102
    return (this.product != null) ? this.product.getId() : null;
×
103
  }
104

105
  public void setProduct(String id) {
106
    this.product = ApiResource.setExpandableFieldId(id, this.product);
×
107
  }
×
108

109
  /** Get expanded {@code product}. */
110
  public Product getProductObject() {
111
    return (this.product != null) ? this.product.getExpanded() : null;
×
112
  }
113

114
  public void setProductObject(Product expandableObject) {
115
    this.product = new ExpandableField<Product>(expandableObject.getId(), expandableObject);
×
116
  }
×
117

118
  /**
119
   * For more details about AdjustableQuantity, please refer to the <a
120
   * href="https://docs.stripe.com/api">API Reference.</a>
121
   */
122
  @Getter
123
  @Setter
124
  @EqualsAndHashCode(callSuper = false)
NEW
125
  public static class AdjustableQuantity extends StripeObject {
×
126
    @SerializedName("enabled")
127
    Boolean enabled;
128

129
    @SerializedName("maximum")
130
    Long maximum;
131

132
    @SerializedName("minimum")
133
    Long minimum;
134
  }
135

136
  /**
137
   * For more details about Discount, please refer to the <a href="https://docs.stripe.com/api">API
138
   * Reference.</a>
139
   */
140
  @Getter
141
  @Setter
142
  @EqualsAndHashCode(callSuper = false)
143
  public static class Discount extends StripeObject {
×
144
    /** The amount discounted. */
145
    @SerializedName("amount")
146
    Long amount;
147

148
    /**
149
     * A discount represents the actual application of a <a
150
     * href="https://stripe.com/docs/api#coupons">coupon</a> or <a
151
     * href="https://stripe.com/docs/api#promotion_codes">promotion code</a>. It contains
152
     * information about when the discount began, when it will end, and what it is applied to.
153
     *
154
     * <p>Related guide: <a href="https://stripe.com/docs/billing/subscriptions/discounts">Applying
155
     * discounts to subscriptions</a>
156
     */
157
    @SerializedName("discount")
158
    com.stripe.model.Discount discount;
159
  }
160

161
  /**
162
   * For more details about Display, please refer to the <a href="https://docs.stripe.com/api">API
163
   * Reference.</a>
164
   */
165
  @Getter
166
  @Setter
167
  @EqualsAndHashCode(callSuper = false)
NEW
168
  public static class Display extends StripeObject {
×
169
    @SerializedName("description")
170
    String description;
171

172
    @SerializedName("images")
173
    List<String> images;
174

175
    @SerializedName("name")
176
    String name;
177
  }
178

179
  /**
180
   * For more details about Tax, please refer to the <a href="https://docs.stripe.com/api">API
181
   * Reference.</a>
182
   */
183
  @Getter
184
  @Setter
185
  @EqualsAndHashCode(callSuper = false)
186
  public static class Tax extends StripeObject {
×
187
    /** Amount of tax applied for this rate. */
188
    @SerializedName("amount")
189
    Long amount;
190

191
    /**
192
     * Tax rates can be applied to <a
193
     * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
194
     * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
195
     * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
196
     * Sessions</a> to collect tax.
197
     *
198
     * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
199
     */
200
    @SerializedName("rate")
201
    TaxRate rate;
202

203
    /**
204
     * The reasoning behind this tax, for example, if the product is tax exempt. The possible values
205
     * for this field may be extended as new tax rules are supported.
206
     *
207
     * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax}, {@code
208
     * not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated}, {@code
209
     * portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday}, {@code
210
     * proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code standard_rated},
211
     * {@code taxable_basis_reduced}, or {@code zero_rated}.
212
     */
213
    @SerializedName("taxability_reason")
214
    String taxabilityReason;
215

216
    /** The amount on which tax is calculated, in cents (or local equivalent). */
217
    @SerializedName("taxable_amount")
218
    Long taxableAmount;
219
  }
220
}
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

© 2025 Coveralls, Inc