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

stripe / stripe-java / #16380

30 Aug 2024 07:54PM UTC coverage: 12.882% (-0.004%) from 12.886%
#16380

push

github

web-flow
Merge from master after the changes to not pass api_mode from individual methods (#1857)

* Generate SDK for OpenAPI spec version 1230 (#1856)

* Bump version to 26.9.0

* No need for APIMode to be passed around from individual API methods (#1855)

* Generated code

* Update the code around raw request

* Update the v2 tests to use v2 path

16 of 23 new or added lines in 7 files covered. (69.57%)

706 existing lines in 213 files now uncovered.

18468 of 143365 relevant lines covered (12.88%)

0.13 hits per line

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

32.55
/src/main/java/com/stripe/model/Quote.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.testhelpers.TestClock;
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.QuoteAcceptParams;
14
import com.stripe.param.QuoteCancelParams;
15
import com.stripe.param.QuoteCreateParams;
16
import com.stripe.param.QuoteFinalizeQuoteParams;
17
import com.stripe.param.QuoteListComputedUpfrontLineItemsParams;
18
import com.stripe.param.QuoteListLineItemsParams;
19
import com.stripe.param.QuoteListLinesParams;
20
import com.stripe.param.QuoteListParams;
21
import com.stripe.param.QuoteListPreviewInvoiceLinesParams;
22
import com.stripe.param.QuoteMarkDraftParams;
23
import com.stripe.param.QuoteMarkStaleParams;
24
import com.stripe.param.QuotePdfParams;
25
import com.stripe.param.QuoteReestimateParams;
26
import com.stripe.param.QuoteRetrieveParams;
27
import com.stripe.param.QuoteUpdateParams;
28
import java.io.InputStream;
29
import java.math.BigDecimal;
30
import java.util.List;
31
import java.util.Map;
32
import java.util.stream.Collectors;
33
import lombok.EqualsAndHashCode;
34
import lombok.Getter;
35
import lombok.Setter;
36

37
/**
38
 * A Quote is a way to model prices that you'd like to provide to a customer. Once accepted, it will
39
 * automatically create an invoice, subscription or subscription schedule.
40
 */
41
@Getter
42
@Setter
43
@EqualsAndHashCode(callSuper = false)
44
public class Quote extends ApiResource implements HasId, MetadataStore<Quote> {
1✔
45
  /**
46
   * Allow quote lines to have {@code starts_at} in the past if collection is paused between {@code
47
   * starts_at} and now.
48
   */
49
  @SerializedName("allow_backdated_lines")
50
  Boolean allowBackdatedLines;
51

52
  /** Total before any discounts or taxes are applied. */
53
  @SerializedName("amount_subtotal")
54
  Long amountSubtotal;
55

56
  /** Total after discounts and taxes are applied. */
57
  @SerializedName("amount_total")
58
  Long amountTotal;
59

60
  /** ID of the Connect Application that created the quote. */
61
  @SerializedName("application")
62
  @Getter(lombok.AccessLevel.NONE)
63
  @Setter(lombok.AccessLevel.NONE)
64
  ExpandableField<Application> application;
65

66
  /**
67
   * The amount of the application fee (if any) that will be requested to be applied to the payment
68
   * and transferred to the application owner's Stripe account. Only applicable if there are no line
69
   * items with recurring prices on the quote.
70
   */
71
  @SerializedName("application_fee_amount")
72
  Long applicationFeeAmount;
73

74
  /**
75
   * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the
76
   * percentage of the subscription invoice total that will be transferred to the application
77
   * owner's Stripe account. Only applicable if there are line items with recurring prices on the
78
   * quote.
79
   */
80
  @SerializedName("application_fee_percent")
81
  BigDecimal applicationFeePercent;
82

83
  @SerializedName("automatic_tax")
84
  AutomaticTax automaticTax;
85

86
  /**
87
   * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
88
   * Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization
89
   * using the default payment method attached to the subscription or customer. When sending an
90
   * invoice, Stripe will email your customer an invoice with payment instructions and mark the
91
   * subscription as {@code active}. Defaults to {@code charge_automatically}.
92
   *
93
   * <p>One of {@code charge_automatically}, or {@code send_invoice}.
94
   */
95
  @SerializedName("collection_method")
96
  String collectionMethod;
97

98
  @SerializedName("computed")
99
  Computed computed;
100

101
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
102
  @SerializedName("created")
103
  Long created;
104

105
  /**
106
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
107
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
108
   */
109
  @SerializedName("currency")
110
  String currency;
111

112
  /**
113
   * The customer which this quote belongs to. A customer is required before finalizing the quote.
114
   * Once specified, it cannot be changed.
115
   */
116
  @SerializedName("customer")
117
  @Getter(lombok.AccessLevel.NONE)
118
  @Setter(lombok.AccessLevel.NONE)
119
  ExpandableField<Customer> customer;
120

121
  /** The tax rates applied to this quote. */
122
  @SerializedName("default_tax_rates")
123
  List<ExpandableField<TaxRate>> defaultTaxRates;
124

125
  /** A description that will be displayed on the quote PDF. */
126
  @SerializedName("description")
127
  String description;
128

129
  /** The discounts applied to this quote. */
130
  @SerializedName("discounts")
131
  List<ExpandableField<com.stripe.model.Discount>> discounts;
132

133
  /**
134
   * The date on which the quote will be canceled if in {@code open} or {@code draft} status.
135
   * Measured in seconds since the Unix epoch.
136
   */
137
  @SerializedName("expires_at")
138
  Long expiresAt;
139

140
  /** A footer that will be displayed on the quote PDF. */
141
  @SerializedName("footer")
142
  String footer;
143

144
  /**
145
   * Details of the quote that was cloned. See the <a
146
   * href="https://stripe.com/docs/quotes/clone">cloning documentation</a> for more details.
147
   */
148
  @SerializedName("from_quote")
149
  FromQuote fromQuote;
150

151
  /** A header that will be displayed on the quote PDF. */
152
  @SerializedName("header")
153
  String header;
154

155
  /** Unique identifier for the object. */
156
  @Getter(onMethod_ = {@Override})
157
  @SerializedName("id")
158
  String id;
159

160
  /** The invoice that was created from this quote. */
161
  @SerializedName("invoice")
162
  @Getter(lombok.AccessLevel.NONE)
163
  @Setter(lombok.AccessLevel.NONE)
164
  ExpandableField<Invoice> invoice;
165

166
  @SerializedName("invoice_settings")
167
  InvoiceSettings invoiceSettings;
168

169
  /** A list of items the customer is being quoted for. */
170
  @SerializedName("line_items")
171
  LineItemCollection lineItems;
172

173
  /**
174
   * A list of <a href="https://docs.stripe.com/api/quote_lines">quote lines</a> on the quote. These
175
   * lines describe changes, in the order provided, that will be used to create new subscription
176
   * schedules or update existing subscription schedules when the quote is accepted.
177
   */
178
  @SerializedName("lines")
179
  List<String> lines;
180

181
  /**
182
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
183
   * object exists in test mode.
184
   */
185
  @SerializedName("livemode")
186
  Boolean livemode;
187

188
  /**
189
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
190
   * to an object. This can be useful for storing additional information about the object in a
191
   * structured format.
192
   */
193
  @Getter(onMethod_ = {@Override})
194
  @SerializedName("metadata")
195
  Map<String, String> metadata;
196

197
  /**
198
   * A unique number that identifies this particular quote. This number is assigned once the quote
199
   * is <a href="https://stripe.com/docs/quotes/overview#finalize">finalized</a>.
200
   */
201
  @SerializedName("number")
202
  String number;
203

204
  /**
205
   * String representing the object's type. Objects of the same type share the same value.
206
   *
207
   * <p>Equal to {@code quote}.
208
   */
209
  @SerializedName("object")
210
  String object;
211

212
  /**
213
   * The account on behalf of which to charge. See the <a
214
   * href="https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts">Connect
215
   * documentation</a> for details.
216
   */
217
  @SerializedName("on_behalf_of")
218
  @Getter(lombok.AccessLevel.NONE)
219
  @Setter(lombok.AccessLevel.NONE)
220
  ExpandableField<Account> onBehalfOf;
221

222
  /**
223
   * The status of the quote.
224
   *
225
   * <p>One of {@code accepted}, {@code accepting}, {@code canceled}, {@code draft}, {@code open},
226
   * or {@code stale}.
227
   */
228
  @SerializedName("status")
229
  String status;
230

231
  /** Details on when and why a quote has been marked as stale or canceled. */
232
  @SerializedName("status_details")
233
  StatusDetails statusDetails;
234

235
  @SerializedName("status_transitions")
236
  StatusTransitions statusTransitions;
237

238
  /** The subscription that was created or updated from this quote. */
239
  @SerializedName("subscription")
240
  @Getter(lombok.AccessLevel.NONE)
241
  @Setter(lombok.AccessLevel.NONE)
242
  ExpandableField<Subscription> subscription;
243

244
  @SerializedName("subscription_data")
245
  SubscriptionData subscriptionData;
246

247
  /**
248
   * List representing overrides for {@code subscription_data} configurations for specific
249
   * subscription schedules.
250
   */
251
  @SerializedName("subscription_data_overrides")
252
  List<Quote.SubscriptionDataOverride> subscriptionDataOverrides;
253

254
  /** The subscription schedule that was created or updated from this quote. */
255
  @SerializedName("subscription_schedule")
256
  @Getter(lombok.AccessLevel.NONE)
257
  @Setter(lombok.AccessLevel.NONE)
258
  ExpandableField<com.stripe.model.SubscriptionSchedule> subscriptionSchedule;
259

260
  /** The subscription schedules that were created or updated from this quote. */
261
  @SerializedName("subscription_schedules")
262
  List<Quote.SubscriptionSchedule> subscriptionSchedules;
263

264
  /** ID of the test clock this quote belongs to. */
265
  @SerializedName("test_clock")
266
  @Getter(lombok.AccessLevel.NONE)
267
  @Setter(lombok.AccessLevel.NONE)
268
  ExpandableField<TestClock> testClock;
269

270
  @SerializedName("total_details")
271
  TotalDetails totalDetails;
272

273
  /**
274
   * The account (if any) the payments will be attributed to for tax reporting, and where funds from
275
   * each payment will be transferred to for each of the invoices.
276
   */
277
  @SerializedName("transfer_data")
278
  TransferData transferData;
279

280
  /** Get ID of expandable {@code application} object. */
281
  public String getApplication() {
282
    return (this.application != null) ? this.application.getId() : null;
×
283
  }
284

285
  public void setApplication(String id) {
286
    this.application = ApiResource.setExpandableFieldId(id, this.application);
×
287
  }
×
288

289
  /** Get expanded {@code application}. */
290
  public Application getApplicationObject() {
291
    return (this.application != null) ? this.application.getExpanded() : null;
×
292
  }
293

294
  public void setApplicationObject(Application expandableObject) {
295
    this.application = new ExpandableField<Application>(expandableObject.getId(), expandableObject);
×
296
  }
×
297

298
  /** Get ID of expandable {@code customer} object. */
299
  public String getCustomer() {
300
    return (this.customer != null) ? this.customer.getId() : null;
×
301
  }
302

303
  public void setCustomer(String id) {
304
    this.customer = ApiResource.setExpandableFieldId(id, this.customer);
×
305
  }
×
306

307
  /** Get expanded {@code customer}. */
308
  public Customer getCustomerObject() {
309
    return (this.customer != null) ? this.customer.getExpanded() : null;
×
310
  }
311

312
  public void setCustomerObject(Customer expandableObject) {
313
    this.customer = new ExpandableField<Customer>(expandableObject.getId(), expandableObject);
×
314
  }
×
315

316
  /** Get ID of expandable {@code invoice} object. */
317
  public String getInvoice() {
318
    return (this.invoice != null) ? this.invoice.getId() : null;
×
319
  }
320

321
  public void setInvoice(String id) {
322
    this.invoice = ApiResource.setExpandableFieldId(id, this.invoice);
×
323
  }
×
324

325
  /** Get expanded {@code invoice}. */
326
  public Invoice getInvoiceObject() {
327
    return (this.invoice != null) ? this.invoice.getExpanded() : null;
×
328
  }
329

330
  public void setInvoiceObject(Invoice expandableObject) {
331
    this.invoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
×
332
  }
×
333

334
  /** Get ID of expandable {@code onBehalfOf} object. */
335
  public String getOnBehalfOf() {
336
    return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;
×
337
  }
338

339
  public void setOnBehalfOf(String id) {
340
    this.onBehalfOf = ApiResource.setExpandableFieldId(id, this.onBehalfOf);
×
341
  }
×
342

343
  /** Get expanded {@code onBehalfOf}. */
344
  public Account getOnBehalfOfObject() {
345
    return (this.onBehalfOf != null) ? this.onBehalfOf.getExpanded() : null;
×
346
  }
347

348
  public void setOnBehalfOfObject(Account expandableObject) {
349
    this.onBehalfOf = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
350
  }
×
351

352
  /** Get ID of expandable {@code subscription} object. */
353
  public String getSubscription() {
354
    return (this.subscription != null) ? this.subscription.getId() : null;
×
355
  }
356

357
  public void setSubscription(String id) {
358
    this.subscription = ApiResource.setExpandableFieldId(id, this.subscription);
×
359
  }
×
360

361
  /** Get expanded {@code subscription}. */
362
  public Subscription getSubscriptionObject() {
363
    return (this.subscription != null) ? this.subscription.getExpanded() : null;
×
364
  }
365

366
  public void setSubscriptionObject(Subscription expandableObject) {
367
    this.subscription =
×
368
        new ExpandableField<Subscription>(expandableObject.getId(), expandableObject);
×
369
  }
×
370

371
  /** Get ID of expandable {@code subscriptionSchedule} object. */
372
  public String getSubscriptionSchedule() {
373
    return (this.subscriptionSchedule != null) ? this.subscriptionSchedule.getId() : null;
×
374
  }
375

376
  public void setSubscriptionSchedule(String id) {
377
    this.subscriptionSchedule = ApiResource.setExpandableFieldId(id, this.subscriptionSchedule);
×
378
  }
×
379

380
  /** Get expanded {@code subscriptionSchedule}. */
381
  public com.stripe.model.SubscriptionSchedule getSubscriptionScheduleObject() {
382
    return (this.subscriptionSchedule != null) ? this.subscriptionSchedule.getExpanded() : null;
×
383
  }
384

385
  public void setSubscriptionScheduleObject(
386
      com.stripe.model.SubscriptionSchedule expandableObject) {
387
    this.subscriptionSchedule =
×
388
        new ExpandableField<com.stripe.model.SubscriptionSchedule>(
389
            expandableObject.getId(), expandableObject);
×
390
  }
×
391

392
  /** Get ID of expandable {@code testClock} object. */
393
  public String getTestClock() {
394
    return (this.testClock != null) ? this.testClock.getId() : null;
×
395
  }
396

397
  public void setTestClock(String id) {
398
    this.testClock = ApiResource.setExpandableFieldId(id, this.testClock);
×
399
  }
×
400

401
  /** Get expanded {@code testClock}. */
402
  public TestClock getTestClockObject() {
403
    return (this.testClock != null) ? this.testClock.getExpanded() : null;
×
404
  }
405

406
  public void setTestClockObject(TestClock expandableObject) {
407
    this.testClock = new ExpandableField<TestClock>(expandableObject.getId(), expandableObject);
×
408
  }
×
409

410
  /** Get IDs of expandable {@code defaultTaxRates} object list. */
411
  public List<String> getDefaultTaxRates() {
412
    return (this.defaultTaxRates != null)
×
413
        ? this.defaultTaxRates.stream().map(x -> x.getId()).collect(Collectors.toList())
×
414
        : null;
×
415
  }
416

417
  public void setDefaultTaxRates(List<String> ids) {
418
    if (ids == null) {
×
419
      this.defaultTaxRates = null;
×
420
      return;
×
421
    }
422
    if (this.defaultTaxRates != null
×
423
        && this.defaultTaxRates.stream()
×
424
            .map(x -> x.getId())
×
425
            .collect(Collectors.toList())
×
426
            .equals(ids)) {
×
427
      // noop if the ids are equal to what are already present
428
      return;
×
429
    }
430
    this.defaultTaxRates =
×
431
        (ids != null)
×
432
            ? ids.stream()
×
433
                .map(id -> new ExpandableField<TaxRate>(id, null))
×
434
                .collect(Collectors.toList())
×
435
            : null;
×
436
  }
×
437

438
  /** Get expanded {@code defaultTaxRates}. */
439
  public List<TaxRate> getDefaultTaxRateObjects() {
440
    return (this.defaultTaxRates != null)
×
441
        ? this.defaultTaxRates.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
442
        : null;
×
443
  }
444

445
  public void setDefaultTaxRateObjects(List<TaxRate> objs) {
446
    this.defaultTaxRates =
×
447
        objs != null
×
448
            ? objs.stream()
×
449
                .map(x -> new ExpandableField<TaxRate>(x.getId(), x))
×
450
                .collect(Collectors.toList())
×
451
            : null;
×
452
  }
×
453

454
  /** Get IDs of expandable {@code discounts} object list. */
455
  public List<String> getDiscounts() {
456
    return (this.discounts != null)
×
457
        ? this.discounts.stream().map(x -> x.getId()).collect(Collectors.toList())
×
458
        : null;
×
459
  }
460

461
  public void setDiscounts(List<String> ids) {
462
    if (ids == null) {
×
463
      this.discounts = null;
×
464
      return;
×
465
    }
466
    if (this.discounts != null
×
467
        && this.discounts.stream().map(x -> x.getId()).collect(Collectors.toList()).equals(ids)) {
×
468
      // noop if the ids are equal to what are already present
469
      return;
×
470
    }
471
    this.discounts =
×
472
        (ids != null)
×
473
            ? ids.stream()
×
474
                .map(id -> new ExpandableField<com.stripe.model.Discount>(id, null))
×
475
                .collect(Collectors.toList())
×
476
            : null;
×
477
  }
×
478

479
  /** Get expanded {@code discounts}. */
480
  public List<com.stripe.model.Discount> getDiscountObjects() {
481
    return (this.discounts != null)
×
482
        ? this.discounts.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
483
        : null;
×
484
  }
485

486
  public void setDiscountObjects(List<com.stripe.model.Discount> objs) {
487
    this.discounts =
×
488
        objs != null
×
489
            ? objs.stream()
×
490
                .map(x -> new ExpandableField<com.stripe.model.Discount>(x.getId(), x))
×
491
                .collect(Collectors.toList())
×
492
            : null;
×
493
  }
×
494

495
  /** Accepts the specified quote. */
496
  public Quote accept() throws StripeException {
497
    return accept((Map<String, Object>) null, (RequestOptions) null);
1✔
498
  }
499

500
  /** Accepts the specified quote. */
501
  public Quote accept(RequestOptions options) throws StripeException {
502
    return accept((Map<String, Object>) null, options);
×
503
  }
504

505
  /** Accepts the specified quote. */
506
  public Quote accept(Map<String, Object> params) throws StripeException {
507
    return accept(params, (RequestOptions) null);
×
508
  }
509

510
  /** Accepts the specified quote. */
511
  public Quote accept(Map<String, Object> params, RequestOptions options) throws StripeException {
512
    String path = String.format("/v1/quotes/%s/accept", ApiResource.urlEncodeId(this.getId()));
1✔
513
    ApiRequest request =
1✔
514
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
515
    return getResponseGetter().request(request, Quote.class);
1✔
516
  }
517

518
  /** Accepts the specified quote. */
519
  public Quote accept(QuoteAcceptParams params) throws StripeException {
520
    return accept(params, (RequestOptions) null);
1✔
521
  }
522

523
  /** Accepts the specified quote. */
524
  public Quote accept(QuoteAcceptParams params, RequestOptions options) throws StripeException {
525
    String path = String.format("/v1/quotes/%s/accept", ApiResource.urlEncodeId(this.getId()));
1✔
526
    ApiResource.checkNullTypedParams(path, params);
1✔
527
    ApiRequest request =
1✔
528
        new ApiRequest(
529
            BaseAddress.API,
530
            ApiResource.RequestMethod.POST,
531
            path,
532
            ApiRequestParams.paramsToMap(params),
1✔
533
            options);
534
    return getResponseGetter().request(request, Quote.class);
1✔
535
  }
536

537
  /** Cancels the quote. */
538
  public Quote cancel() throws StripeException {
539
    return cancel((Map<String, Object>) null, (RequestOptions) null);
1✔
540
  }
541

542
  /** Cancels the quote. */
543
  public Quote cancel(RequestOptions options) throws StripeException {
544
    return cancel((Map<String, Object>) null, options);
×
545
  }
546

547
  /** Cancels the quote. */
548
  public Quote cancel(Map<String, Object> params) throws StripeException {
549
    return cancel(params, (RequestOptions) null);
×
550
  }
551

552
  /** Cancels the quote. */
553
  public Quote cancel(Map<String, Object> params, RequestOptions options) throws StripeException {
554
    String path = String.format("/v1/quotes/%s/cancel", ApiResource.urlEncodeId(this.getId()));
1✔
555
    ApiRequest request =
1✔
556
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
557
    return getResponseGetter().request(request, Quote.class);
1✔
558
  }
559

560
  /** Cancels the quote. */
561
  public Quote cancel(QuoteCancelParams params) throws StripeException {
562
    return cancel(params, (RequestOptions) null);
1✔
563
  }
564

565
  /** Cancels the quote. */
566
  public Quote cancel(QuoteCancelParams params, RequestOptions options) throws StripeException {
567
    String path = String.format("/v1/quotes/%s/cancel", ApiResource.urlEncodeId(this.getId()));
1✔
568
    ApiResource.checkNullTypedParams(path, params);
1✔
569
    ApiRequest request =
1✔
570
        new ApiRequest(
571
            BaseAddress.API,
572
            ApiResource.RequestMethod.POST,
573
            path,
574
            ApiRequestParams.paramsToMap(params),
1✔
575
            options);
576
    return getResponseGetter().request(request, Quote.class);
1✔
577
  }
578

579
  /**
580
   * A quote models prices and services for a customer. Default options for {@code header}, {@code
581
   * description}, {@code footer}, and {@code expires_at} can be set in the dashboard via the <a
582
   * href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
583
   */
584
  public static Quote create(Map<String, Object> params) throws StripeException {
585
    return create(params, (RequestOptions) null);
1✔
586
  }
587

588
  /**
589
   * A quote models prices and services for a customer. Default options for {@code header}, {@code
590
   * description}, {@code footer}, and {@code expires_at} can be set in the dashboard via the <a
591
   * href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
592
   */
593
  public static Quote create(Map<String, Object> params, RequestOptions options)
594
      throws StripeException {
595
    String path = "/v1/quotes";
1✔
596
    ApiRequest request =
1✔
597
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
598
    return getGlobalResponseGetter().request(request, Quote.class);
1✔
599
  }
600

601
  /**
602
   * A quote models prices and services for a customer. Default options for {@code header}, {@code
603
   * description}, {@code footer}, and {@code expires_at} can be set in the dashboard via the <a
604
   * href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
605
   */
606
  public static Quote create(QuoteCreateParams params) throws StripeException {
607
    return create(params, (RequestOptions) null);
1✔
608
  }
609

610
  /**
611
   * A quote models prices and services for a customer. Default options for {@code header}, {@code
612
   * description}, {@code footer}, and {@code expires_at} can be set in the dashboard via the <a
613
   * href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
614
   */
615
  public static Quote create(QuoteCreateParams params, RequestOptions options)
616
      throws StripeException {
617
    String path = "/v1/quotes";
1✔
618
    ApiResource.checkNullTypedParams(path, params);
1✔
619
    ApiRequest request =
1✔
620
        new ApiRequest(
621
            BaseAddress.API,
622
            ApiResource.RequestMethod.POST,
623
            path,
624
            ApiRequestParams.paramsToMap(params),
1✔
625
            options);
626
    return getGlobalResponseGetter().request(request, Quote.class);
1✔
627
  }
628

629
  /** Finalizes the quote. */
630
  public Quote finalizeQuote() throws StripeException {
631
    return finalizeQuote((Map<String, Object>) null, (RequestOptions) null);
1✔
632
  }
633

634
  /** Finalizes the quote. */
635
  public Quote finalizeQuote(RequestOptions options) throws StripeException {
636
    return finalizeQuote((Map<String, Object>) null, options);
×
637
  }
638

639
  /** Finalizes the quote. */
640
  public Quote finalizeQuote(Map<String, Object> params) throws StripeException {
641
    return finalizeQuote(params, (RequestOptions) null);
×
642
  }
643

644
  /** Finalizes the quote. */
645
  public Quote finalizeQuote(Map<String, Object> params, RequestOptions options)
646
      throws StripeException {
647
    String path = String.format("/v1/quotes/%s/finalize", ApiResource.urlEncodeId(this.getId()));
1✔
648
    ApiRequest request =
1✔
649
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
650
    return getResponseGetter().request(request, Quote.class);
1✔
651
  }
652

653
  /** Finalizes the quote. */
654
  public Quote finalizeQuote(QuoteFinalizeQuoteParams params) throws StripeException {
655
    return finalizeQuote(params, (RequestOptions) null);
1✔
656
  }
657

658
  /** Finalizes the quote. */
659
  public Quote finalizeQuote(QuoteFinalizeQuoteParams params, RequestOptions options)
660
      throws StripeException {
661
    String path = String.format("/v1/quotes/%s/finalize", ApiResource.urlEncodeId(this.getId()));
1✔
662
    ApiResource.checkNullTypedParams(path, params);
1✔
663
    ApiRequest request =
1✔
664
        new ApiRequest(
665
            BaseAddress.API,
666
            ApiResource.RequestMethod.POST,
667
            path,
668
            ApiRequestParams.paramsToMap(params),
1✔
669
            options);
670
    return getResponseGetter().request(request, Quote.class);
1✔
671
  }
672

673
  /** Returns a list of your quotes. */
674
  public static QuoteCollection list(Map<String, Object> params) throws StripeException {
675
    return list(params, (RequestOptions) null);
1✔
676
  }
677

678
  /** Returns a list of your quotes. */
679
  public static QuoteCollection list(Map<String, Object> params, RequestOptions options)
680
      throws StripeException {
681
    String path = "/v1/quotes";
1✔
682
    ApiRequest request =
1✔
683
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
684
    return getGlobalResponseGetter().request(request, QuoteCollection.class);
1✔
685
  }
686

687
  /** Returns a list of your quotes. */
688
  public static QuoteCollection list(QuoteListParams params) throws StripeException {
689
    return list(params, (RequestOptions) null);
1✔
690
  }
691

692
  /** Returns a list of your quotes. */
693
  public static QuoteCollection list(QuoteListParams params, RequestOptions options)
694
      throws StripeException {
695
    String path = "/v1/quotes";
1✔
696
    ApiResource.checkNullTypedParams(path, params);
1✔
697
    ApiRequest request =
1✔
698
        new ApiRequest(
699
            BaseAddress.API,
700
            ApiResource.RequestMethod.GET,
701
            path,
702
            ApiRequestParams.paramsToMap(params),
1✔
703
            options);
704
    return getGlobalResponseGetter().request(request, QuoteCollection.class);
1✔
705
  }
706

707
  /**
708
   * When retrieving a quote, there is an includable <a
709
   * href="https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items"><strong>computed.upfront.line_items</strong></a>
710
   * property containing the first handful of those items. There is also a URL where you can
711
   * retrieve the full (paginated) list of upfront line items.
712
   */
713
  public LineItemCollection listComputedUpfrontLineItems() throws StripeException {
714
    return listComputedUpfrontLineItems((Map<String, Object>) null, (RequestOptions) null);
×
715
  }
716

717
  /**
718
   * When retrieving a quote, there is an includable <a
719
   * href="https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items"><strong>computed.upfront.line_items</strong></a>
720
   * property containing the first handful of those items. There is also a URL where you can
721
   * retrieve the full (paginated) list of upfront line items.
722
   */
723
  public LineItemCollection listComputedUpfrontLineItems(Map<String, Object> params)
724
      throws StripeException {
725
    return listComputedUpfrontLineItems(params, (RequestOptions) null);
1✔
726
  }
727

728
  /**
729
   * When retrieving a quote, there is an includable <a
730
   * href="https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items"><strong>computed.upfront.line_items</strong></a>
731
   * property containing the first handful of those items. There is also a URL where you can
732
   * retrieve the full (paginated) list of upfront line items.
733
   */
734
  public LineItemCollection listComputedUpfrontLineItems(
735
      Map<String, Object> params, RequestOptions options) throws StripeException {
736
    String path =
1✔
737
        String.format(
1✔
738
            "/v1/quotes/%s/computed_upfront_line_items", ApiResource.urlEncodeId(this.getId()));
1✔
739
    ApiRequest request =
1✔
740
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
741
    return getResponseGetter().request(request, LineItemCollection.class);
1✔
742
  }
743

744
  /**
745
   * When retrieving a quote, there is an includable <a
746
   * href="https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items"><strong>computed.upfront.line_items</strong></a>
747
   * property containing the first handful of those items. There is also a URL where you can
748
   * retrieve the full (paginated) list of upfront line items.
749
   */
750
  public LineItemCollection listComputedUpfrontLineItems(
751
      QuoteListComputedUpfrontLineItemsParams params) throws StripeException {
752
    return listComputedUpfrontLineItems(params, (RequestOptions) null);
×
753
  }
754

755
  /**
756
   * When retrieving a quote, there is an includable <a
757
   * href="https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items"><strong>computed.upfront.line_items</strong></a>
758
   * property containing the first handful of those items. There is also a URL where you can
759
   * retrieve the full (paginated) list of upfront line items.
760
   */
761
  public LineItemCollection listComputedUpfrontLineItems(
762
      QuoteListComputedUpfrontLineItemsParams params, RequestOptions options)
763
      throws StripeException {
764
    String path =
×
765
        String.format(
×
766
            "/v1/quotes/%s/computed_upfront_line_items", ApiResource.urlEncodeId(this.getId()));
×
767
    ApiResource.checkNullTypedParams(path, params);
×
768
    ApiRequest request =
×
769
        new ApiRequest(
770
            BaseAddress.API,
771
            ApiResource.RequestMethod.GET,
772
            path,
773
            ApiRequestParams.paramsToMap(params),
×
774
            options);
UNCOV
775
    return getResponseGetter().request(request, LineItemCollection.class);
×
776
  }
777

778
  /**
779
   * When retrieving a quote, there is an includable <strong>line_items</strong> property containing
780
   * the first handful of those items. There is also a URL where you can retrieve the full
781
   * (paginated) list of line items.
782
   */
783
  public LineItemCollection listLineItems() throws StripeException {
784
    return listLineItems((Map<String, Object>) null, (RequestOptions) null);
×
785
  }
786

787
  /**
788
   * When retrieving a quote, there is an includable <strong>line_items</strong> property containing
789
   * the first handful of those items. There is also a URL where you can retrieve the full
790
   * (paginated) list of line items.
791
   */
792
  public LineItemCollection listLineItems(Map<String, Object> params) throws StripeException {
793
    return listLineItems(params, (RequestOptions) null);
1✔
794
  }
795

796
  /**
797
   * When retrieving a quote, there is an includable <strong>line_items</strong> property containing
798
   * the first handful of those items. There is also a URL where you can retrieve the full
799
   * (paginated) list of line items.
800
   */
801
  public LineItemCollection listLineItems(Map<String, Object> params, RequestOptions options)
802
      throws StripeException {
803
    String path = String.format("/v1/quotes/%s/line_items", ApiResource.urlEncodeId(this.getId()));
1✔
804
    ApiRequest request =
1✔
805
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
806
    return getResponseGetter().request(request, LineItemCollection.class);
1✔
807
  }
808

809
  /**
810
   * When retrieving a quote, there is an includable <strong>line_items</strong> property containing
811
   * the first handful of those items. There is also a URL where you can retrieve the full
812
   * (paginated) list of line items.
813
   */
814
  public LineItemCollection listLineItems(QuoteListLineItemsParams params) throws StripeException {
815
    return listLineItems(params, (RequestOptions) null);
1✔
816
  }
817

818
  /**
819
   * When retrieving a quote, there is an includable <strong>line_items</strong> property containing
820
   * the first handful of those items. There is also a URL where you can retrieve the full
821
   * (paginated) list of line items.
822
   */
823
  public LineItemCollection listLineItems(QuoteListLineItemsParams params, RequestOptions options)
824
      throws StripeException {
825
    String path = String.format("/v1/quotes/%s/line_items", ApiResource.urlEncodeId(this.getId()));
1✔
826
    ApiResource.checkNullTypedParams(path, params);
1✔
827
    ApiRequest request =
1✔
828
        new ApiRequest(
829
            BaseAddress.API,
830
            ApiResource.RequestMethod.GET,
831
            path,
832
            ApiRequestParams.paramsToMap(params),
1✔
833
            options);
834
    return getResponseGetter().request(request, LineItemCollection.class);
1✔
835
  }
836

837
  /**
838
   * Retrieves a paginated list of lines for a quote. These lines describe changes that will be used
839
   * to create new subscription schedules or update existing subscription schedules when the quote
840
   * is accepted.
841
   */
842
  public QuoteLineCollection listLines() throws StripeException {
843
    return listLines((Map<String, Object>) null, (RequestOptions) null);
×
844
  }
845

846
  /**
847
   * Retrieves a paginated list of lines for a quote. These lines describe changes that will be used
848
   * to create new subscription schedules or update existing subscription schedules when the quote
849
   * is accepted.
850
   */
851
  public QuoteLineCollection listLines(Map<String, Object> params) throws StripeException {
852
    return listLines(params, (RequestOptions) null);
×
853
  }
854

855
  /**
856
   * Retrieves a paginated list of lines for a quote. These lines describe changes that will be used
857
   * to create new subscription schedules or update existing subscription schedules when the quote
858
   * is accepted.
859
   */
860
  public QuoteLineCollection listLines(Map<String, Object> params, RequestOptions options)
861
      throws StripeException {
862
    String path = String.format("/v1/quotes/%s/lines", ApiResource.urlEncodeId(this.getId()));
×
863
    ApiRequest request =
×
864
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
UNCOV
865
    return getResponseGetter().request(request, QuoteLineCollection.class);
×
866
  }
867

868
  /**
869
   * Retrieves a paginated list of lines for a quote. These lines describe changes that will be used
870
   * to create new subscription schedules or update existing subscription schedules when the quote
871
   * is accepted.
872
   */
873
  public QuoteLineCollection listLines(QuoteListLinesParams params) throws StripeException {
874
    return listLines(params, (RequestOptions) null);
×
875
  }
876

877
  /**
878
   * Retrieves a paginated list of lines for a quote. These lines describe changes that will be used
879
   * to create new subscription schedules or update existing subscription schedules when the quote
880
   * is accepted.
881
   */
882
  public QuoteLineCollection listLines(QuoteListLinesParams params, RequestOptions options)
883
      throws StripeException {
884
    String path = String.format("/v1/quotes/%s/lines", ApiResource.urlEncodeId(this.getId()));
×
885
    ApiResource.checkNullTypedParams(path, params);
×
886
    ApiRequest request =
×
887
        new ApiRequest(
888
            BaseAddress.API,
889
            ApiResource.RequestMethod.GET,
890
            path,
891
            ApiRequestParams.paramsToMap(params),
×
892
            options);
UNCOV
893
    return getResponseGetter().request(request, QuoteLineCollection.class);
×
894
  }
895

896
  /** Preview the invoice line items that would be generated by accepting the quote. */
897
  public InvoiceLineItemCollection listPreviewInvoiceLines(String previewInvoice)
898
      throws StripeException {
899
    return listPreviewInvoiceLines(
×
900
        previewInvoice, (Map<String, Object>) null, (RequestOptions) null);
901
  }
902

903
  /** Preview the invoice line items that would be generated by accepting the quote. */
904
  public InvoiceLineItemCollection listPreviewInvoiceLines(
905
      String previewInvoice, Map<String, Object> params) throws StripeException {
906
    return listPreviewInvoiceLines(previewInvoice, params, (RequestOptions) null);
×
907
  }
908

909
  /** Preview the invoice line items that would be generated by accepting the quote. */
910
  public InvoiceLineItemCollection listPreviewInvoiceLines(
911
      String previewInvoice, Map<String, Object> params, RequestOptions options)
912
      throws StripeException {
913
    String path =
1✔
914
        String.format(
1✔
915
            "/v1/quotes/%s/preview_invoices/%s/lines",
916
            ApiResource.urlEncodeId(this.getId()), ApiResource.urlEncodeId(previewInvoice));
1✔
917
    ApiRequest request =
1✔
918
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
919
    return getResponseGetter().request(request, InvoiceLineItemCollection.class);
1✔
920
  }
921

922
  /** Preview the invoice line items that would be generated by accepting the quote. */
923
  public InvoiceLineItemCollection listPreviewInvoiceLines(
924
      String previewInvoice, QuoteListPreviewInvoiceLinesParams params) throws StripeException {
925
    return listPreviewInvoiceLines(previewInvoice, params, (RequestOptions) null);
×
926
  }
927

928
  /** Preview the invoice line items that would be generated by accepting the quote. */
929
  public InvoiceLineItemCollection listPreviewInvoiceLines(
930
      String previewInvoice, QuoteListPreviewInvoiceLinesParams params, RequestOptions options)
931
      throws StripeException {
932
    String path =
×
933
        String.format(
×
934
            "/v1/quotes/%s/preview_invoices/%s/lines",
935
            ApiResource.urlEncodeId(this.getId()), ApiResource.urlEncodeId(previewInvoice));
×
936
    ApiResource.checkNullTypedParams(path, params);
×
937
    ApiRequest request =
×
938
        new ApiRequest(
939
            BaseAddress.API,
940
            ApiResource.RequestMethod.GET,
941
            path,
942
            ApiRequestParams.paramsToMap(params),
×
943
            options);
UNCOV
944
    return getResponseGetter().request(request, InvoiceLineItemCollection.class);
×
945
  }
946

947
  /** Converts a stale quote to draft. */
948
  public Quote markDraft() throws StripeException {
949
    return markDraft((Map<String, Object>) null, (RequestOptions) null);
×
950
  }
951

952
  /** Converts a stale quote to draft. */
953
  public Quote markDraft(RequestOptions options) throws StripeException {
954
    return markDraft((Map<String, Object>) null, options);
×
955
  }
956

957
  /** Converts a stale quote to draft. */
958
  public Quote markDraft(Map<String, Object> params) throws StripeException {
959
    return markDraft(params, (RequestOptions) null);
×
960
  }
961

962
  /** Converts a stale quote to draft. */
963
  public Quote markDraft(Map<String, Object> params, RequestOptions options)
964
      throws StripeException {
965
    String path = String.format("/v1/quotes/%s/mark_draft", ApiResource.urlEncodeId(this.getId()));
×
966
    ApiRequest request =
×
967
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
968
    return getResponseGetter().request(request, Quote.class);
×
969
  }
970

971
  /** Converts a stale quote to draft. */
972
  public Quote markDraft(QuoteMarkDraftParams params) throws StripeException {
973
    return markDraft(params, (RequestOptions) null);
×
974
  }
975

976
  /** Converts a stale quote to draft. */
977
  public Quote markDraft(QuoteMarkDraftParams params, RequestOptions options)
978
      throws StripeException {
979
    String path = String.format("/v1/quotes/%s/mark_draft", ApiResource.urlEncodeId(this.getId()));
×
980
    ApiResource.checkNullTypedParams(path, params);
×
981
    ApiRequest request =
×
982
        new ApiRequest(
983
            BaseAddress.API,
984
            ApiResource.RequestMethod.POST,
985
            path,
986
            ApiRequestParams.paramsToMap(params),
×
987
            options);
UNCOV
988
    return getResponseGetter().request(request, Quote.class);
×
989
  }
990

991
  /** Converts a draft or open quote to stale. */
992
  public Quote markStale() throws StripeException {
993
    return markStale((Map<String, Object>) null, (RequestOptions) null);
×
994
  }
995

996
  /** Converts a draft or open quote to stale. */
997
  public Quote markStale(RequestOptions options) throws StripeException {
998
    return markStale((Map<String, Object>) null, options);
×
999
  }
1000

1001
  /** Converts a draft or open quote to stale. */
1002
  public Quote markStale(Map<String, Object> params) throws StripeException {
1003
    return markStale(params, (RequestOptions) null);
×
1004
  }
1005

1006
  /** Converts a draft or open quote to stale. */
1007
  public Quote markStale(Map<String, Object> params, RequestOptions options)
1008
      throws StripeException {
1009
    String path = String.format("/v1/quotes/%s/mark_stale", ApiResource.urlEncodeId(this.getId()));
×
1010
    ApiRequest request =
×
1011
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
1012
    return getResponseGetter().request(request, Quote.class);
×
1013
  }
1014

1015
  /** Converts a draft or open quote to stale. */
1016
  public Quote markStale(QuoteMarkStaleParams params) throws StripeException {
1017
    return markStale(params, (RequestOptions) null);
×
1018
  }
1019

1020
  /** Converts a draft or open quote to stale. */
1021
  public Quote markStale(QuoteMarkStaleParams params, RequestOptions options)
1022
      throws StripeException {
1023
    String path = String.format("/v1/quotes/%s/mark_stale", ApiResource.urlEncodeId(this.getId()));
×
1024
    ApiResource.checkNullTypedParams(path, params);
×
1025
    ApiRequest request =
×
1026
        new ApiRequest(
1027
            BaseAddress.API,
1028
            ApiResource.RequestMethod.POST,
1029
            path,
1030
            ApiRequestParams.paramsToMap(params),
×
1031
            options);
UNCOV
1032
    return getResponseGetter().request(request, Quote.class);
×
1033
  }
1034

1035
  /**
1036
   * Download the PDF for a finalized quote. Explanation for special handling can be found <a
1037
   * href="https://docs.stripe.com/quotes/overview#quote_pdf">here</a>
1038
   */
1039
  public InputStream pdf() throws StripeException {
1040
    return pdf((Map<String, Object>) null, (RequestOptions) null);
1✔
1041
  }
1042

1043
  /**
1044
   * Download the PDF for a finalized quote. Explanation for special handling can be found <a
1045
   * href="https://docs.stripe.com/quotes/overview#quote_pdf">here</a>
1046
   */
1047
  public InputStream pdf(Map<String, Object> params) throws StripeException {
1048
    return pdf(params, (RequestOptions) null);
×
1049
  }
1050

1051
  /**
1052
   * Download the PDF for a finalized quote. Explanation for special handling can be found <a
1053
   * href="https://docs.stripe.com/quotes/overview#quote_pdf">here</a>
1054
   */
1055
  public InputStream pdf(Map<String, Object> params, RequestOptions options)
1056
      throws StripeException {
1057
    String path = String.format("/v1/quotes/%s/pdf", ApiResource.urlEncodeId(this.getId()));
1✔
1058
    ApiRequest request =
1✔
1059
        new ApiRequest(BaseAddress.FILES, ApiResource.RequestMethod.GET, path, params, options);
1060
    return getResponseGetter().requestStream(request);
1✔
1061
  }
1062

1063
  /**
1064
   * Download the PDF for a finalized quote. Explanation for special handling can be found <a
1065
   * href="https://docs.stripe.com/quotes/overview#quote_pdf">here</a>
1066
   */
1067
  public InputStream pdf(QuotePdfParams params) throws StripeException {
1068
    return pdf(params, (RequestOptions) null);
1✔
1069
  }
1070

1071
  /**
1072
   * Download the PDF for a finalized quote. Explanation for special handling can be found <a
1073
   * href="https://docs.stripe.com/quotes/overview#quote_pdf">here</a>
1074
   */
1075
  public InputStream pdf(QuotePdfParams params, RequestOptions options) throws StripeException {
1076
    String path = String.format("/v1/quotes/%s/pdf", ApiResource.urlEncodeId(this.getId()));
1✔
1077
    ApiResource.checkNullTypedParams(path, params);
1✔
1078
    ApiRequest request =
1✔
1079
        new ApiRequest(
1080
            BaseAddress.FILES,
1081
            ApiResource.RequestMethod.GET,
1082
            path,
1083
            ApiRequestParams.paramsToMap(params),
1✔
1084
            options);
1085
    return getResponseGetter().requestStream(request);
1✔
1086
  }
1087

1088
  /** Recompute the upcoming invoice estimate for the quote. */
1089
  public Quote reestimate() throws StripeException {
1090
    return reestimate((Map<String, Object>) null, (RequestOptions) null);
×
1091
  }
1092

1093
  /** Recompute the upcoming invoice estimate for the quote. */
1094
  public Quote reestimate(RequestOptions options) throws StripeException {
1095
    return reestimate((Map<String, Object>) null, options);
×
1096
  }
1097

1098
  /** Recompute the upcoming invoice estimate for the quote. */
1099
  public Quote reestimate(Map<String, Object> params) throws StripeException {
1100
    return reestimate(params, (RequestOptions) null);
×
1101
  }
1102

1103
  /** Recompute the upcoming invoice estimate for the quote. */
1104
  public Quote reestimate(Map<String, Object> params, RequestOptions options)
1105
      throws StripeException {
1106
    String path = String.format("/v1/quotes/%s/reestimate", ApiResource.urlEncodeId(this.getId()));
×
1107
    ApiRequest request =
×
1108
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
1109
    return getResponseGetter().request(request, Quote.class);
×
1110
  }
1111

1112
  /** Recompute the upcoming invoice estimate for the quote. */
1113
  public Quote reestimate(QuoteReestimateParams params) throws StripeException {
1114
    return reestimate(params, (RequestOptions) null);
×
1115
  }
1116

1117
  /** Recompute the upcoming invoice estimate for the quote. */
1118
  public Quote reestimate(QuoteReestimateParams params, RequestOptions options)
1119
      throws StripeException {
1120
    String path = String.format("/v1/quotes/%s/reestimate", ApiResource.urlEncodeId(this.getId()));
×
1121
    ApiResource.checkNullTypedParams(path, params);
×
1122
    ApiRequest request =
×
1123
        new ApiRequest(
1124
            BaseAddress.API,
1125
            ApiResource.RequestMethod.POST,
1126
            path,
1127
            ApiRequestParams.paramsToMap(params),
×
1128
            options);
UNCOV
1129
    return getResponseGetter().request(request, Quote.class);
×
1130
  }
1131

1132
  /** Retrieves the quote with the given ID. */
1133
  public static Quote retrieve(String quote) throws StripeException {
1134
    return retrieve(quote, (Map<String, Object>) null, (RequestOptions) null);
1✔
1135
  }
1136

1137
  /** Retrieves the quote with the given ID. */
1138
  public static Quote retrieve(String quote, RequestOptions options) throws StripeException {
1139
    return retrieve(quote, (Map<String, Object>) null, options);
×
1140
  }
1141

1142
  /** Retrieves the quote with the given ID. */
1143
  public static Quote retrieve(String quote, Map<String, Object> params, RequestOptions options)
1144
      throws StripeException {
1145
    String path = String.format("/v1/quotes/%s", ApiResource.urlEncodeId(quote));
1✔
1146
    ApiRequest request =
1✔
1147
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
1148
    return getGlobalResponseGetter().request(request, Quote.class);
1✔
1149
  }
1150

1151
  /** Retrieves the quote with the given ID. */
1152
  public static Quote retrieve(String quote, QuoteRetrieveParams params, RequestOptions options)
1153
      throws StripeException {
1154
    String path = String.format("/v1/quotes/%s", ApiResource.urlEncodeId(quote));
×
1155
    ApiResource.checkNullTypedParams(path, params);
×
1156
    ApiRequest request =
×
1157
        new ApiRequest(
1158
            BaseAddress.API,
1159
            ApiResource.RequestMethod.GET,
1160
            path,
1161
            ApiRequestParams.paramsToMap(params),
×
1162
            options);
UNCOV
1163
    return getGlobalResponseGetter().request(request, Quote.class);
×
1164
  }
1165

1166
  /** A quote models prices and services for a customer. */
1167
  @Override
1168
  public Quote update(Map<String, Object> params) throws StripeException {
1169
    return update(params, (RequestOptions) null);
1✔
1170
  }
1171

1172
  /** A quote models prices and services for a customer. */
1173
  @Override
1174
  public Quote update(Map<String, Object> params, RequestOptions options) throws StripeException {
1175
    String path = String.format("/v1/quotes/%s", ApiResource.urlEncodeId(this.getId()));
1✔
1176
    ApiRequest request =
1✔
1177
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
1178
    return getResponseGetter().request(request, Quote.class);
1✔
1179
  }
1180

1181
  /** A quote models prices and services for a customer. */
1182
  public Quote update(QuoteUpdateParams params) throws StripeException {
1183
    return update(params, (RequestOptions) null);
1✔
1184
  }
1185

1186
  /** A quote models prices and services for a customer. */
1187
  public Quote update(QuoteUpdateParams params, RequestOptions options) throws StripeException {
1188
    String path = String.format("/v1/quotes/%s", ApiResource.urlEncodeId(this.getId()));
1✔
1189
    ApiResource.checkNullTypedParams(path, params);
1✔
1190
    ApiRequest request =
1✔
1191
        new ApiRequest(
1192
            BaseAddress.API,
1193
            ApiResource.RequestMethod.POST,
1194
            path,
1195
            ApiRequestParams.paramsToMap(params),
1✔
1196
            options);
1197
    return getResponseGetter().request(request, Quote.class);
1✔
1198
  }
1199

1200
  @Getter
1201
  @Setter
1202
  @EqualsAndHashCode(callSuper = false)
1203
  public static class AutomaticTax extends StripeObject {
1✔
1204
    /** Automatically calculate taxes. */
1205
    @SerializedName("enabled")
1206
    Boolean enabled;
1207

1208
    /**
1209
     * The account that's liable for tax. If set, the business address and tax registrations
1210
     * required to perform the tax calculation are loaded from this account. The tax transaction is
1211
     * returned in the report of the connected account.
1212
     */
1213
    @SerializedName("liability")
1214
    Liability liability;
1215

1216
    /**
1217
     * The status of the most recent automated tax calculation for this quote.
1218
     *
1219
     * <p>One of {@code complete}, {@code failed}, or {@code requires_location_inputs}.
1220
     */
1221
    @SerializedName("status")
1222
    String status;
1223

1224
    @Getter
1225
    @Setter
1226
    @EqualsAndHashCode(callSuper = false)
1227
    public static class Liability extends StripeObject {
×
1228
      /** The connected account being referenced when {@code type} is {@code account}. */
1229
      @SerializedName("account")
1230
      @Getter(lombok.AccessLevel.NONE)
1231
      @Setter(lombok.AccessLevel.NONE)
1232
      ExpandableField<Account> account;
1233

1234
      /**
1235
       * Type of the account referenced.
1236
       *
1237
       * <p>One of {@code account}, or {@code self}.
1238
       */
1239
      @SerializedName("type")
1240
      String type;
1241

1242
      /** Get ID of expandable {@code account} object. */
1243
      public String getAccount() {
1244
        return (this.account != null) ? this.account.getId() : null;
×
1245
      }
1246

1247
      public void setAccount(String id) {
1248
        this.account = ApiResource.setExpandableFieldId(id, this.account);
×
1249
      }
×
1250

1251
      /** Get expanded {@code account}. */
1252
      public Account getAccountObject() {
1253
        return (this.account != null) ? this.account.getExpanded() : null;
×
1254
      }
1255

1256
      public void setAccountObject(Account expandableObject) {
1257
        this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
1258
      }
×
1259
    }
1260
  }
1261

1262
  @Getter
1263
  @Setter
1264
  @EqualsAndHashCode(callSuper = false)
1265
  public static class Computed extends StripeObject {
1✔
1266
    /**
1267
     * Details of the most recent reestimate of the quote's preview schedules and upcoming invoices,
1268
     * including the status of Stripe's calculation.
1269
     */
1270
    @SerializedName("last_reestimation_details")
1271
    LastReestimationDetails lastReestimationDetails;
1272

1273
    /**
1274
     * The definitive totals and line items the customer will be charged on a recurring basis. Takes
1275
     * into account the line items with recurring prices and discounts with {@code duration=forever}
1276
     * coupons only. Defaults to {@code null} if no inputted line items with recurring prices.
1277
     */
1278
    @SerializedName("recurring")
1279
    Recurring recurring;
1280

1281
    /** The time at which the quote's estimated schedules and upcoming invoices were generated. */
1282
    @SerializedName("updated_at")
1283
    Long updatedAt;
1284

1285
    @SerializedName("upfront")
1286
    Upfront upfront;
1287

1288
    @Getter
1289
    @Setter
1290
    @EqualsAndHashCode(callSuper = false)
1291
    public static class LastReestimationDetails extends StripeObject {
×
1292
      /**
1293
       * When {@code status} is {@code failed}, provides details about the quote reestimation
1294
       * failure.
1295
       */
1296
      @SerializedName("failed")
1297
      Failed failed;
1298

1299
      /**
1300
       * Latest status of the reestimation.
1301
       *
1302
       * <p>One of {@code failed}, {@code in_progress}, or {@code succeeded}.
1303
       */
1304
      @SerializedName("status")
1305
      String status;
1306

1307
      @Getter
1308
      @Setter
1309
      @EqualsAndHashCode(callSuper = false)
1310
      public static class Failed extends StripeObject {
×
1311
        /**
1312
         * The failure {@code code} is more granular than the {@code reason} provided and may
1313
         * correspond to a Stripe error code. For automation errors, this field is one of: {@code
1314
         * reverse_api_failure}, {@code reverse_api_deadline_exceeeded}, or {@code
1315
         * reverse_api_response_validation_error}, which are Stripe error codes and map to the error
1316
         * {@code message} field.
1317
         */
1318
        @SerializedName("failure_code")
1319
        String failureCode;
1320

1321
        /**
1322
         * Information derived from the {@code failure_code} or a freeform message that explains the
1323
         * error as a human-readable English string. For example, &quot;margin ID is not a valid
1324
         * ID&quot;.
1325
         */
1326
        @SerializedName("message")
1327
        String message;
1328

1329
        /**
1330
         * The reason the reestimation failed.
1331
         *
1332
         * <p>One of {@code automation_failure}, or {@code internal_error}.
1333
         */
1334
        @SerializedName("reason")
1335
        String reason;
1336
      }
1337
    }
1338

1339
    @Getter
1340
    @Setter
1341
    @EqualsAndHashCode(callSuper = false)
1342
    public static class Recurring extends StripeObject {
×
1343
      /** Total before any discounts or taxes are applied. */
1344
      @SerializedName("amount_subtotal")
1345
      Long amountSubtotal;
1346

1347
      /** Total after discounts and taxes are applied. */
1348
      @SerializedName("amount_total")
1349
      Long amountTotal;
1350

1351
      /**
1352
       * The frequency at which a subscription is billed. One of {@code day}, {@code week}, {@code
1353
       * month} or {@code year}.
1354
       */
1355
      @SerializedName("interval")
1356
      String interval;
1357

1358
      /**
1359
       * The number of intervals (specified in the {@code interval} attribute) between subscription
1360
       * billings. For example, {@code interval=month} and {@code interval_count=3} bills every 3
1361
       * months.
1362
       */
1363
      @SerializedName("interval_count")
1364
      Long intervalCount;
1365

1366
      @SerializedName("total_details")
1367
      TotalDetails totalDetails;
1368

1369
      @Getter
1370
      @Setter
1371
      @EqualsAndHashCode(callSuper = false)
1372
      public static class TotalDetails extends StripeObject {
×
1373
        /** This is the sum of all the discounts. */
1374
        @SerializedName("amount_discount")
1375
        Long amountDiscount;
1376

1377
        /** This is the sum of all the shipping amounts. */
1378
        @SerializedName("amount_shipping")
1379
        Long amountShipping;
1380

1381
        /** This is the sum of all the tax amounts. */
1382
        @SerializedName("amount_tax")
1383
        Long amountTax;
1384

1385
        @SerializedName("breakdown")
1386
        Breakdown breakdown;
1387

1388
        @Getter
1389
        @Setter
1390
        @EqualsAndHashCode(callSuper = false)
1391
        public static class Breakdown extends StripeObject {
×
1392
          /** The aggregated discounts. */
1393
          @SerializedName("discounts")
1394
          List<Quote.Computed.Recurring.TotalDetails.Breakdown.Discount> discounts;
1395

1396
          /** The aggregated tax amounts by rate. */
1397
          @SerializedName("taxes")
1398
          List<Quote.Computed.Recurring.TotalDetails.Breakdown.Tax> taxes;
1399

1400
          @Getter
1401
          @Setter
1402
          @EqualsAndHashCode(callSuper = false)
1403
          public static class Discount extends StripeObject {
×
1404
            /** The amount discounted. */
1405
            @SerializedName("amount")
1406
            Long amount;
1407

1408
            /**
1409
             * A discount represents the actual application of a <a
1410
             * href="https://stripe.com/docs/api#coupons">coupon</a> or <a
1411
             * href="https://stripe.com/docs/api#promotion_codes">promotion code</a>. It contains
1412
             * information about when the discount began, when it will end, and what it is applied
1413
             * to.
1414
             *
1415
             * <p>Related guide: <a
1416
             * href="https://stripe.com/docs/billing/subscriptions/discounts">Applying discounts to
1417
             * subscriptions</a>
1418
             */
1419
            @SerializedName("discount")
1420
            com.stripe.model.Discount discount;
1421
          }
1422

1423
          @Getter
1424
          @Setter
1425
          @EqualsAndHashCode(callSuper = false)
1426
          public static class Tax extends StripeObject {
×
1427
            /** Amount of tax applied for this rate. */
1428
            @SerializedName("amount")
1429
            Long amount;
1430

1431
            /**
1432
             * Tax rates can be applied to <a
1433
             * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
1434
             * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
1435
             * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
1436
             * Sessions</a> to collect tax.
1437
             *
1438
             * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax
1439
             * rates</a>
1440
             */
1441
            @SerializedName("rate")
1442
            TaxRate rate;
1443

1444
            /**
1445
             * The reasoning behind this tax, for example, if the product is tax exempt. The
1446
             * possible values for this field may be extended as new tax rules are supported.
1447
             *
1448
             * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code
1449
             * not_subject_to_tax}, {@code not_supported}, {@code portion_product_exempt}, {@code
1450
             * portion_reduced_rated}, {@code portion_standard_rated}, {@code product_exempt},
1451
             * {@code product_exempt_holiday}, {@code proportionally_rated}, {@code reduced_rated},
1452
             * {@code reverse_charge}, {@code standard_rated}, {@code taxable_basis_reduced}, or
1453
             * {@code zero_rated}.
1454
             */
1455
            @SerializedName("taxability_reason")
1456
            String taxabilityReason;
1457

1458
            /** The amount on which tax is calculated, in cents (or local equivalent). */
1459
            @SerializedName("taxable_amount")
1460
            Long taxableAmount;
1461
          }
1462
        }
1463
      }
1464
    }
1465

1466
    @Getter
1467
    @Setter
1468
    @EqualsAndHashCode(callSuper = false)
1469
    public static class Upfront extends StripeObject {
1✔
1470
      /** Total before any discounts or taxes are applied. */
1471
      @SerializedName("amount_subtotal")
1472
      Long amountSubtotal;
1473

1474
      /** Total after discounts and taxes are applied. */
1475
      @SerializedName("amount_total")
1476
      Long amountTotal;
1477

1478
      /**
1479
       * The line items that will appear on the next invoice after this quote is accepted. This does
1480
       * not include pending invoice items that exist on the customer but may still be included in
1481
       * the next invoice.
1482
       */
1483
      @SerializedName("line_items")
1484
      LineItemCollection lineItems;
1485

1486
      @SerializedName("total_details")
1487
      TotalDetails totalDetails;
1488

1489
      @Getter
1490
      @Setter
1491
      @EqualsAndHashCode(callSuper = false)
1492
      public static class TotalDetails extends StripeObject {
1✔
1493
        /** This is the sum of all the discounts. */
1494
        @SerializedName("amount_discount")
1495
        Long amountDiscount;
1496

1497
        /** This is the sum of all the shipping amounts. */
1498
        @SerializedName("amount_shipping")
1499
        Long amountShipping;
1500

1501
        /** This is the sum of all the tax amounts. */
1502
        @SerializedName("amount_tax")
1503
        Long amountTax;
1504

1505
        @SerializedName("breakdown")
1506
        Breakdown breakdown;
1507

1508
        @Getter
1509
        @Setter
1510
        @EqualsAndHashCode(callSuper = false)
1511
        public static class Breakdown extends StripeObject {
×
1512
          /** The aggregated discounts. */
1513
          @SerializedName("discounts")
1514
          List<Quote.Computed.Upfront.TotalDetails.Breakdown.Discount> discounts;
1515

1516
          /** The aggregated tax amounts by rate. */
1517
          @SerializedName("taxes")
1518
          List<Quote.Computed.Upfront.TotalDetails.Breakdown.Tax> taxes;
1519

1520
          @Getter
1521
          @Setter
1522
          @EqualsAndHashCode(callSuper = false)
1523
          public static class Discount extends StripeObject {
×
1524
            /** The amount discounted. */
1525
            @SerializedName("amount")
1526
            Long amount;
1527

1528
            /**
1529
             * A discount represents the actual application of a <a
1530
             * href="https://stripe.com/docs/api#coupons">coupon</a> or <a
1531
             * href="https://stripe.com/docs/api#promotion_codes">promotion code</a>. It contains
1532
             * information about when the discount began, when it will end, and what it is applied
1533
             * to.
1534
             *
1535
             * <p>Related guide: <a
1536
             * href="https://stripe.com/docs/billing/subscriptions/discounts">Applying discounts to
1537
             * subscriptions</a>
1538
             */
1539
            @SerializedName("discount")
1540
            com.stripe.model.Discount discount;
1541
          }
1542

1543
          @Getter
1544
          @Setter
1545
          @EqualsAndHashCode(callSuper = false)
1546
          public static class Tax extends StripeObject {
×
1547
            /** Amount of tax applied for this rate. */
1548
            @SerializedName("amount")
1549
            Long amount;
1550

1551
            /**
1552
             * Tax rates can be applied to <a
1553
             * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
1554
             * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
1555
             * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
1556
             * Sessions</a> to collect tax.
1557
             *
1558
             * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax
1559
             * rates</a>
1560
             */
1561
            @SerializedName("rate")
1562
            TaxRate rate;
1563

1564
            /**
1565
             * The reasoning behind this tax, for example, if the product is tax exempt. The
1566
             * possible values for this field may be extended as new tax rules are supported.
1567
             *
1568
             * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code
1569
             * not_subject_to_tax}, {@code not_supported}, {@code portion_product_exempt}, {@code
1570
             * portion_reduced_rated}, {@code portion_standard_rated}, {@code product_exempt},
1571
             * {@code product_exempt_holiday}, {@code proportionally_rated}, {@code reduced_rated},
1572
             * {@code reverse_charge}, {@code standard_rated}, {@code taxable_basis_reduced}, or
1573
             * {@code zero_rated}.
1574
             */
1575
            @SerializedName("taxability_reason")
1576
            String taxabilityReason;
1577

1578
            /** The amount on which tax is calculated, in cents (or local equivalent). */
1579
            @SerializedName("taxable_amount")
1580
            Long taxableAmount;
1581
          }
1582
        }
1583
      }
1584
    }
1585
  }
1586

1587
  @Getter
1588
  @Setter
1589
  @EqualsAndHashCode(callSuper = false)
1590
  public static class FromQuote extends StripeObject {
×
1591
    /** Whether this quote is a revision of a different quote. */
1592
    @SerializedName("is_revision")
1593
    Boolean isRevision;
1594

1595
    /** The quote that was cloned. */
1596
    @SerializedName("quote")
1597
    @Getter(lombok.AccessLevel.NONE)
1598
    @Setter(lombok.AccessLevel.NONE)
1599
    ExpandableField<Quote> quote;
1600

1601
    /** Get ID of expandable {@code quote} object. */
1602
    public String getQuote() {
1603
      return (this.quote != null) ? this.quote.getId() : null;
×
1604
    }
1605

1606
    public void setQuote(String id) {
1607
      this.quote = ApiResource.setExpandableFieldId(id, this.quote);
×
1608
    }
×
1609

1610
    /** Get expanded {@code quote}. */
1611
    public Quote getQuoteObject() {
1612
      return (this.quote != null) ? this.quote.getExpanded() : null;
×
1613
    }
1614

1615
    public void setQuoteObject(Quote expandableObject) {
1616
      this.quote = new ExpandableField<Quote>(expandableObject.getId(), expandableObject);
×
1617
    }
×
1618
  }
1619

1620
  @Getter
1621
  @Setter
1622
  @EqualsAndHashCode(callSuper = false)
1623
  public static class InvoiceSettings extends StripeObject {
1✔
1624
    /**
1625
     * Number of days within which a customer must pay invoices generated by this quote. This value
1626
     * will be {@code null} for quotes where {@code collection_method=charge_automatically}.
1627
     */
1628
    @SerializedName("days_until_due")
1629
    Long daysUntilDue;
1630

1631
    @SerializedName("issuer")
1632
    Issuer issuer;
1633

1634
    @Getter
1635
    @Setter
1636
    @EqualsAndHashCode(callSuper = false)
1637
    public static class Issuer extends StripeObject {
1✔
1638
      /** The connected account being referenced when {@code type} is {@code account}. */
1639
      @SerializedName("account")
1640
      @Getter(lombok.AccessLevel.NONE)
1641
      @Setter(lombok.AccessLevel.NONE)
1642
      ExpandableField<Account> account;
1643

1644
      /**
1645
       * Type of the account referenced.
1646
       *
1647
       * <p>One of {@code account}, or {@code self}.
1648
       */
1649
      @SerializedName("type")
1650
      String type;
1651

1652
      /** Get ID of expandable {@code account} object. */
1653
      public String getAccount() {
1654
        return (this.account != null) ? this.account.getId() : null;
×
1655
      }
1656

1657
      public void setAccount(String id) {
1658
        this.account = ApiResource.setExpandableFieldId(id, this.account);
×
1659
      }
×
1660

1661
      /** Get expanded {@code account}. */
1662
      public Account getAccountObject() {
1663
        return (this.account != null) ? this.account.getExpanded() : null;
×
1664
      }
1665

1666
      public void setAccountObject(Account expandableObject) {
1667
        this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
1668
      }
×
1669
    }
1670
  }
1671

1672
  @Getter
1673
  @Setter
1674
  @EqualsAndHashCode(callSuper = false)
1675
  public static class StatusDetails extends StripeObject {
×
1676
    @SerializedName("canceled")
1677
    Canceled canceled;
1678

1679
    @SerializedName("stale")
1680
    Stale stale;
1681

1682
    @Getter
1683
    @Setter
1684
    @EqualsAndHashCode(callSuper = false)
1685
    public static class Canceled extends StripeObject {
×
1686
      /**
1687
       * The reason this quote was marked as canceled.
1688
       *
1689
       * <p>One of {@code canceled}, {@code quote_accepted}, {@code quote_expired}, {@code
1690
       * quote_superseded}, or {@code subscription_canceled}.
1691
       */
1692
      @SerializedName("reason")
1693
      String reason;
1694

1695
      /**
1696
       * Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch.
1697
       */
1698
      @SerializedName("transitioned_at")
1699
      Long transitionedAt;
1700
    }
1701

1702
    @Getter
1703
    @Setter
1704
    @EqualsAndHashCode(callSuper = false)
1705
    public static class Stale extends StripeObject {
×
1706
      /** Time at which the quote expires. Measured in seconds since the Unix epoch. */
1707
      @SerializedName("expires_at")
1708
      Long expiresAt;
1709

1710
      /** The most recent reason this quote was marked as stale. */
1711
      @SerializedName("last_reason")
1712
      LastReason lastReason;
1713

1714
      /** Time at which the stale reason was updated. Measured in seconds since the Unix epoch. */
1715
      @SerializedName("last_updated_at")
1716
      Long lastUpdatedAt;
1717

1718
      /** Time at which the quote was marked as stale. Measured in seconds since the Unix epoch. */
1719
      @SerializedName("transitioned_at")
1720
      Long transitionedAt;
1721

1722
      @Getter
1723
      @Setter
1724
      @EqualsAndHashCode(callSuper = false)
1725
      public static class LastReason extends StripeObject {
×
1726
        /** The ID of the line that is invalid if the stale reason type is {@code line_invalid}. */
1727
        @SerializedName("line_invalid")
1728
        String lineInvalid;
1729

1730
        /**
1731
         * The IDs of the lines that are invalid if the stale reason type is {@code lines_invalid}.
1732
         */
1733
        @SerializedName("lines_invalid")
1734
        List<Quote.StatusDetails.Stale.LastReason.LinesInvalid> linesInvalid;
1735

1736
        /** The user supplied mark stale reason. */
1737
        @SerializedName("marked_stale")
1738
        String markedStale;
1739

1740
        /** The ID of the subscription that was canceled. */
1741
        @SerializedName("subscription_canceled")
1742
        String subscriptionCanceled;
1743

1744
        @SerializedName("subscription_changed")
1745
        SubscriptionChanged subscriptionChanged;
1746

1747
        /** The ID of the subscription that was expired. */
1748
        @SerializedName("subscription_expired")
1749
        String subscriptionExpired;
1750

1751
        /** The ID of the subscription schedule that was canceled. */
1752
        @SerializedName("subscription_schedule_canceled")
1753
        String subscriptionScheduleCanceled;
1754

1755
        @SerializedName("subscription_schedule_changed")
1756
        SubscriptionScheduleChanged subscriptionScheduleChanged;
1757

1758
        /** The ID of the subscription schedule that was released. */
1759
        @SerializedName("subscription_schedule_released")
1760
        String subscriptionScheduleReleased;
1761

1762
        /**
1763
         * The reason the quote was marked as stale.
1764
         *
1765
         * <p>One of {@code accept_failed_validations}, {@code bill_on_acceptance_invalid}, {@code
1766
         * line_invalid}, {@code lines_invalid}, {@code marked_stale}, {@code
1767
         * subscription_canceled}, {@code subscription_changed}, {@code subscription_expired},
1768
         * {@code subscription_schedule_canceled}, {@code subscription_schedule_changed}, or {@code
1769
         * subscription_schedule_released}.
1770
         */
1771
        @SerializedName("type")
1772
        String type;
1773

1774
        @Getter
1775
        @Setter
1776
        @EqualsAndHashCode(callSuper = false)
1777
        public static class LinesInvalid extends StripeObject {
×
1778
          /** The timestamp at which the lines were marked as invalid. */
1779
          @SerializedName("invalid_at")
1780
          Long invalidAt;
1781

1782
          /** The list of lines that became invalid at the given timestamp. */
1783
          @SerializedName("lines")
1784
          List<String> lines;
1785
        }
1786

1787
        @Getter
1788
        @Setter
1789
        @EqualsAndHashCode(callSuper = false)
1790
        public static class SubscriptionChanged extends StripeObject {
×
1791
          /** The subscription's state before the quote was marked as stale. */
1792
          @SerializedName("previous_subscription")
1793
          Subscription previousSubscription;
1794
        }
1795

1796
        @Getter
1797
        @Setter
1798
        @EqualsAndHashCode(callSuper = false)
1799
        public static class SubscriptionScheduleChanged extends StripeObject {
×
1800
          /** The subscription schedule's state before the quote was marked as stale. */
1801
          @SerializedName("previous_subscription_schedule")
1802
          com.stripe.model.SubscriptionSchedule previousSubscriptionSchedule;
1803
        }
1804
      }
1805
    }
1806
  }
1807

1808
  @Getter
1809
  @Setter
1810
  @EqualsAndHashCode(callSuper = false)
1811
  public static class StatusTransitions extends StripeObject {
1✔
1812
    /** The time that the quote was accepted. Measured in seconds since Unix epoch. */
1813
    @SerializedName("accepted_at")
1814
    Long acceptedAt;
1815

1816
    /** The time that the quote was canceled. Measured in seconds since Unix epoch. */
1817
    @SerializedName("canceled_at")
1818
    Long canceledAt;
1819

1820
    /** The time that the quote was finalized. Measured in seconds since Unix epoch. */
1821
    @SerializedName("finalized_at")
1822
    Long finalizedAt;
1823
  }
1824

1825
  @Getter
1826
  @Setter
1827
  @EqualsAndHashCode(callSuper = false)
1828
  public static class SubscriptionData extends StripeObject {
1✔
1829
    /** Describes the period to bill for upon accepting the quote. */
1830
    @SerializedName("bill_on_acceptance")
1831
    BillOnAcceptance billOnAcceptance;
1832

1833
    /**
1834
     * Configures when the subscription schedule generates prorations for phase transitions.
1835
     * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the
1836
     * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase
1837
     * changes and generate prorations at transition time. {@code prorate_up_front} will bill for
1838
     * all phases within the current billing cycle up front.
1839
     *
1840
     * <p>One of {@code prorate_on_next_phase}, or {@code prorate_up_front}.
1841
     */
1842
    @SerializedName("billing_behavior")
1843
    String billingBehavior;
1844

1845
    /**
1846
     * Whether the subscription will always start a new billing period when the quote is accepted.
1847
     *
1848
     * <p>Equal to {@code reset}.
1849
     */
1850
    @SerializedName("billing_cycle_anchor")
1851
    String billingCycleAnchor;
1852

1853
    /**
1854
     * The subscription's description, meant to be displayable to the customer. Use this field to
1855
     * optionally store an explanation of the subscription for rendering in Stripe surfaces and
1856
     * certain local payment methods UIs.
1857
     */
1858
    @SerializedName("description")
1859
    String description;
1860

1861
    /**
1862
     * When creating a new subscription, the date of which the subscription schedule will start
1863
     * after the quote is accepted. This date is ignored if it is in the past when the quote is
1864
     * accepted. Measured in seconds since the Unix epoch.
1865
     */
1866
    @SerializedName("effective_date")
1867
    Long effectiveDate;
1868

1869
    /**
1870
     * Behavior of the subscription schedule and underlying subscription when it ends.
1871
     *
1872
     * <p>One of {@code cancel}, or {@code release}.
1873
     */
1874
    @SerializedName("end_behavior")
1875
    String endBehavior;
1876

1877
    /** The id of the subscription schedule that will be updated when the quote is accepted. */
1878
    @SerializedName("from_schedule")
1879
    @Getter(lombok.AccessLevel.NONE)
1880
    @Setter(lombok.AccessLevel.NONE)
1881
    ExpandableField<com.stripe.model.SubscriptionSchedule> fromSchedule;
1882

1883
    /** The id of the subscription that will be updated when the quote is accepted. */
1884
    @SerializedName("from_subscription")
1885
    @Getter(lombok.AccessLevel.NONE)
1886
    @Setter(lombok.AccessLevel.NONE)
1887
    ExpandableField<Subscription> fromSubscription;
1888

1889
    /**
1890
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will set
1891
     * metadata on the subscription or subscription schedule when the quote is accepted. If a
1892
     * recurring price is included in {@code line_items}, this field will be passed to the resulting
1893
     * subscription's {@code metadata} field. If {@code subscription_data.effective_date} is used,
1894
     * this field will be passed to the resulting subscription schedule's {@code phases.metadata}
1895
     * field. Unlike object-level metadata, this field is declarative. Updates will clear prior
1896
     * values.
1897
     */
1898
    @SerializedName("metadata")
1899
    Map<String, String> metadata;
1900

1901
    /**
1902
     * If specified, the invoicing for the given billing cycle iterations will be processed when the
1903
     * quote is accepted. Cannot be used with {@code effective_date}.
1904
     */
1905
    @SerializedName("prebilling")
1906
    Prebilling prebilling;
1907

1908
    /**
1909
     * Determines how to handle <a
1910
     * href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a> when the
1911
     * quote is accepted.
1912
     *
1913
     * <p>One of {@code always_invoice}, {@code create_prorations}, or {@code none}.
1914
     */
1915
    @SerializedName("proration_behavior")
1916
    String prorationBehavior;
1917

1918
    /**
1919
     * Integer representing the number of trial period days before the customer is charged for the
1920
     * first time.
1921
     */
1922
    @SerializedName("trial_period_days")
1923
    Long trialPeriodDays;
1924

1925
    /** Get ID of expandable {@code fromSchedule} object. */
1926
    public String getFromSchedule() {
1927
      return (this.fromSchedule != null) ? this.fromSchedule.getId() : null;
×
1928
    }
1929

1930
    public void setFromSchedule(String id) {
1931
      this.fromSchedule = ApiResource.setExpandableFieldId(id, this.fromSchedule);
×
1932
    }
×
1933

1934
    /** Get expanded {@code fromSchedule}. */
1935
    public com.stripe.model.SubscriptionSchedule getFromScheduleObject() {
1936
      return (this.fromSchedule != null) ? this.fromSchedule.getExpanded() : null;
×
1937
    }
1938

1939
    public void setFromScheduleObject(com.stripe.model.SubscriptionSchedule expandableObject) {
1940
      this.fromSchedule =
×
1941
          new ExpandableField<com.stripe.model.SubscriptionSchedule>(
1942
              expandableObject.getId(), expandableObject);
×
1943
    }
×
1944

1945
    /** Get ID of expandable {@code fromSubscription} object. */
1946
    public String getFromSubscription() {
1947
      return (this.fromSubscription != null) ? this.fromSubscription.getId() : null;
×
1948
    }
1949

1950
    public void setFromSubscription(String id) {
1951
      this.fromSubscription = ApiResource.setExpandableFieldId(id, this.fromSubscription);
×
1952
    }
×
1953

1954
    /** Get expanded {@code fromSubscription}. */
1955
    public Subscription getFromSubscriptionObject() {
1956
      return (this.fromSubscription != null) ? this.fromSubscription.getExpanded() : null;
×
1957
    }
1958

1959
    public void setFromSubscriptionObject(Subscription expandableObject) {
1960
      this.fromSubscription =
×
1961
          new ExpandableField<Subscription>(expandableObject.getId(), expandableObject);
×
1962
    }
×
1963

1964
    @Getter
1965
    @Setter
1966
    @EqualsAndHashCode(callSuper = false)
1967
    public static class BillOnAcceptance extends StripeObject {
×
1968
      /** The start of the period to bill from when the Quote is accepted. */
1969
      @SerializedName("bill_from")
1970
      BillFrom billFrom;
1971

1972
      /** The end of the period to bill until when the Quote is accepted. */
1973
      @SerializedName("bill_until")
1974
      BillUntil billUntil;
1975

1976
      @Getter
1977
      @Setter
1978
      @EqualsAndHashCode(callSuper = false)
1979
      public static class BillFrom extends StripeObject {
×
1980
        /** The materialized time. */
1981
        @SerializedName("computed")
1982
        Long computed;
1983

1984
        /** The timestamp the given line starts at. */
1985
        @SerializedName("line_starts_at")
1986
        LineStartsAt lineStartsAt;
1987

1988
        /** A precise Unix timestamp. */
1989
        @SerializedName("timestamp")
1990
        Long timestamp;
1991

1992
        /**
1993
         * The type of method to specify the {@code bill_from} time.
1994
         *
1995
         * <p>One of {@code line_starts_at}, {@code now}, {@code pause_collection_start}, {@code
1996
         * quote_acceptance_date}, or {@code timestamp}.
1997
         */
1998
        @SerializedName("type")
1999
        String type;
2000

2001
        @Getter
2002
        @Setter
2003
        @EqualsAndHashCode(callSuper = false)
2004
        public static class LineStartsAt extends StripeObject implements HasId {
×
2005
          /** Unique identifier for the object. */
2006
          @Getter(onMethod_ = {@Override})
2007
          @SerializedName("id")
2008
          String id;
2009
        }
2010
      }
2011

2012
      @Getter
2013
      @Setter
2014
      @EqualsAndHashCode(callSuper = false)
2015
      public static class BillUntil extends StripeObject {
×
2016
        /** The materialized time. */
2017
        @SerializedName("computed")
2018
        Long computed;
2019

2020
        /** Time span for the quote line starting from the {@code starts_at} date. */
2021
        @SerializedName("duration")
2022
        Duration duration;
2023

2024
        /** The timestamp the given line ends at. */
2025
        @SerializedName("line_ends_at")
2026
        LineEndsAt lineEndsAt;
2027

2028
        /** A precise Unix timestamp. */
2029
        @SerializedName("timestamp")
2030
        Long timestamp;
2031

2032
        /**
2033
         * The type of method to specify the {@code bill_until} time.
2034
         *
2035
         * <p>One of {@code duration}, {@code line_ends_at}, {@code schedule_end}, {@code
2036
         * timestamp}, or {@code upcoming_invoice}.
2037
         */
2038
        @SerializedName("type")
2039
        String type;
2040

2041
        @Getter
2042
        @Setter
2043
        @EqualsAndHashCode(callSuper = false)
2044
        public static class Duration extends StripeObject {
×
2045
          /**
2046
           * Specifies a type of interval unit. Either {@code day}, {@code week}, {@code month} or
2047
           * {@code year}.
2048
           *
2049
           * <p>One of {@code day}, {@code month}, {@code week}, or {@code year}.
2050
           */
2051
          @SerializedName("interval")
2052
          String interval;
2053

2054
          /**
2055
           * The number of intervals, as an whole number greater than 0. Stripe multiplies this by
2056
           * the interval type to get the overall duration.
2057
           */
2058
          @SerializedName("interval_count")
2059
          Long intervalCount;
2060
        }
2061

2062
        @Getter
2063
        @Setter
2064
        @EqualsAndHashCode(callSuper = false)
2065
        public static class LineEndsAt extends StripeObject implements HasId {
×
2066
          /** Unique identifier for the object. */
2067
          @Getter(onMethod_ = {@Override})
2068
          @SerializedName("id")
2069
          String id;
2070
        }
2071
      }
2072
    }
2073

2074
    @Getter
2075
    @Setter
2076
    @EqualsAndHashCode(callSuper = false)
2077
    public static class Prebilling extends StripeObject {
×
2078
      @SerializedName("iterations")
2079
      Long iterations;
2080
    }
2081
  }
2082

2083
  @Getter
2084
  @Setter
2085
  @EqualsAndHashCode(callSuper = false)
2086
  public static class SubscriptionDataOverride extends StripeObject {
×
2087
    @SerializedName("applies_to")
2088
    AppliesTo appliesTo;
2089

2090
    /** Describes the period to bill for upon accepting the quote. */
2091
    @SerializedName("bill_on_acceptance")
2092
    BillOnAcceptance billOnAcceptance;
2093

2094
    /**
2095
     * Configures when the subscription schedule generates prorations for phase transitions.
2096
     * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the
2097
     * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase
2098
     * changes and generate prorations at transition time. {@code prorate_up_front} will bill for
2099
     * all phases within the current billing cycle up front.
2100
     *
2101
     * <p>One of {@code prorate_on_next_phase}, or {@code prorate_up_front}.
2102
     */
2103
    @SerializedName("billing_behavior")
2104
    String billingBehavior;
2105

2106
    /**
2107
     * The customer which this quote belongs to. A customer is required before finalizing the quote.
2108
     * Once specified, it cannot be changed.
2109
     */
2110
    @SerializedName("customer")
2111
    String customer;
2112

2113
    /**
2114
     * The subscription's description, meant to be displayable to the customer. Use this field to
2115
     * optionally store an explanation of the subscription for rendering in Stripe surfaces and
2116
     * certain local payment methods UIs.
2117
     */
2118
    @SerializedName("description")
2119
    String description;
2120

2121
    /**
2122
     * Behavior of the subscription schedule and underlying subscription when it ends.
2123
     *
2124
     * <p>One of {@code cancel}, or {@code release}.
2125
     */
2126
    @SerializedName("end_behavior")
2127
    String endBehavior;
2128

2129
    /**
2130
     * Determines how to handle <a
2131
     * href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a> when the
2132
     * quote is accepted.
2133
     *
2134
     * <p>One of {@code always_invoice}, {@code create_prorations}, or {@code none}.
2135
     */
2136
    @SerializedName("proration_behavior")
2137
    String prorationBehavior;
2138

2139
    @Getter
2140
    @Setter
2141
    @EqualsAndHashCode(callSuper = false)
2142
    public static class AppliesTo extends StripeObject {
×
2143
      /**
2144
       * A custom string that identifies a new subscription schedule being created upon quote
2145
       * acceptance. All quote lines with the same {@code new_reference} field will be applied to
2146
       * the creation of a new subscription schedule.
2147
       */
2148
      @SerializedName("new_reference")
2149
      String newReference;
2150

2151
      /** The ID of the schedule the line applies to. */
2152
      @SerializedName("subscription_schedule")
2153
      String subscriptionSchedule;
2154

2155
      /**
2156
       * Describes whether the quote line is affecting a new schedule or an existing schedule.
2157
       *
2158
       * <p>One of {@code new_reference}, or {@code subscription_schedule}.
2159
       */
2160
      @SerializedName("type")
2161
      String type;
2162
    }
2163

2164
    @Getter
2165
    @Setter
2166
    @EqualsAndHashCode(callSuper = false)
2167
    public static class BillOnAcceptance extends StripeObject {
×
2168
      /** The start of the period to bill from when the Quote is accepted. */
2169
      @SerializedName("bill_from")
2170
      BillFrom billFrom;
2171

2172
      /** The end of the period to bill until when the Quote is accepted. */
2173
      @SerializedName("bill_until")
2174
      BillUntil billUntil;
2175

2176
      @Getter
2177
      @Setter
2178
      @EqualsAndHashCode(callSuper = false)
2179
      public static class BillFrom extends StripeObject {
×
2180
        /** The materialized time. */
2181
        @SerializedName("computed")
2182
        Long computed;
2183

2184
        /** The timestamp the given line starts at. */
2185
        @SerializedName("line_starts_at")
2186
        LineStartsAt lineStartsAt;
2187

2188
        /** A precise Unix timestamp. */
2189
        @SerializedName("timestamp")
2190
        Long timestamp;
2191

2192
        /**
2193
         * The type of method to specify the {@code bill_from} time.
2194
         *
2195
         * <p>One of {@code line_starts_at}, {@code now}, {@code pause_collection_start}, {@code
2196
         * quote_acceptance_date}, or {@code timestamp}.
2197
         */
2198
        @SerializedName("type")
2199
        String type;
2200

2201
        @Getter
2202
        @Setter
2203
        @EqualsAndHashCode(callSuper = false)
2204
        public static class LineStartsAt extends StripeObject implements HasId {
×
2205
          /** Unique identifier for the object. */
2206
          @Getter(onMethod_ = {@Override})
2207
          @SerializedName("id")
2208
          String id;
2209
        }
2210
      }
2211

2212
      @Getter
2213
      @Setter
2214
      @EqualsAndHashCode(callSuper = false)
2215
      public static class BillUntil extends StripeObject {
×
2216
        /** The materialized time. */
2217
        @SerializedName("computed")
2218
        Long computed;
2219

2220
        /** Time span for the quote line starting from the {@code starts_at} date. */
2221
        @SerializedName("duration")
2222
        Duration duration;
2223

2224
        /** The timestamp the given line ends at. */
2225
        @SerializedName("line_ends_at")
2226
        LineEndsAt lineEndsAt;
2227

2228
        /** A precise Unix timestamp. */
2229
        @SerializedName("timestamp")
2230
        Long timestamp;
2231

2232
        /**
2233
         * The type of method to specify the {@code bill_until} time.
2234
         *
2235
         * <p>One of {@code duration}, {@code line_ends_at}, {@code schedule_end}, {@code
2236
         * timestamp}, or {@code upcoming_invoice}.
2237
         */
2238
        @SerializedName("type")
2239
        String type;
2240

2241
        @Getter
2242
        @Setter
2243
        @EqualsAndHashCode(callSuper = false)
2244
        public static class Duration extends StripeObject {
×
2245
          /**
2246
           * Specifies a type of interval unit. Either {@code day}, {@code week}, {@code month} or
2247
           * {@code year}.
2248
           *
2249
           * <p>One of {@code day}, {@code month}, {@code week}, or {@code year}.
2250
           */
2251
          @SerializedName("interval")
2252
          String interval;
2253

2254
          /**
2255
           * The number of intervals, as an whole number greater than 0. Stripe multiplies this by
2256
           * the interval type to get the overall duration.
2257
           */
2258
          @SerializedName("interval_count")
2259
          Long intervalCount;
2260
        }
2261

2262
        @Getter
2263
        @Setter
2264
        @EqualsAndHashCode(callSuper = false)
2265
        public static class LineEndsAt extends StripeObject implements HasId {
×
2266
          /** Unique identifier for the object. */
2267
          @Getter(onMethod_ = {@Override})
2268
          @SerializedName("id")
2269
          String id;
2270
        }
2271
      }
2272
    }
2273
  }
2274

2275
  @Getter
2276
  @Setter
2277
  @EqualsAndHashCode(callSuper = false)
2278
  public static class SubscriptionSchedule extends StripeObject {
×
2279
    @SerializedName("applies_to")
2280
    AppliesTo appliesTo;
2281

2282
    /** The subscription schedule that was created or updated from this quote. */
2283
    @SerializedName("subscription_schedule")
2284
    String subscriptionSchedule;
2285

2286
    @Getter
2287
    @Setter
2288
    @EqualsAndHashCode(callSuper = false)
2289
    public static class AppliesTo extends StripeObject {
×
2290
      /**
2291
       * A custom string that identifies a new subscription schedule being created upon quote
2292
       * acceptance. All quote lines with the same {@code new_reference} field will be applied to
2293
       * the creation of a new subscription schedule.
2294
       */
2295
      @SerializedName("new_reference")
2296
      String newReference;
2297

2298
      /** The ID of the schedule the line applies to. */
2299
      @SerializedName("subscription_schedule")
2300
      String subscriptionSchedule;
2301

2302
      /**
2303
       * Describes whether the quote line is affecting a new schedule or an existing schedule.
2304
       *
2305
       * <p>One of {@code new_reference}, or {@code subscription_schedule}.
2306
       */
2307
      @SerializedName("type")
2308
      String type;
2309
    }
2310
  }
2311

2312
  @Getter
2313
  @Setter
2314
  @EqualsAndHashCode(callSuper = false)
2315
  public static class TotalDetails extends StripeObject {
1✔
2316
    /** This is the sum of all the discounts. */
2317
    @SerializedName("amount_discount")
2318
    Long amountDiscount;
2319

2320
    /** This is the sum of all the shipping amounts. */
2321
    @SerializedName("amount_shipping")
2322
    Long amountShipping;
2323

2324
    /** This is the sum of all the tax amounts. */
2325
    @SerializedName("amount_tax")
2326
    Long amountTax;
2327

2328
    @SerializedName("breakdown")
2329
    Breakdown breakdown;
2330

2331
    @Getter
2332
    @Setter
2333
    @EqualsAndHashCode(callSuper = false)
2334
    public static class Breakdown extends StripeObject {
×
2335
      /** The aggregated discounts. */
2336
      @SerializedName("discounts")
2337
      List<Quote.TotalDetails.Breakdown.Discount> discounts;
2338

2339
      /** The aggregated tax amounts by rate. */
2340
      @SerializedName("taxes")
2341
      List<Quote.TotalDetails.Breakdown.Tax> taxes;
2342

2343
      @Getter
2344
      @Setter
2345
      @EqualsAndHashCode(callSuper = false)
2346
      public static class Discount extends StripeObject {
×
2347
        /** The amount discounted. */
2348
        @SerializedName("amount")
2349
        Long amount;
2350

2351
        /**
2352
         * A discount represents the actual application of a <a
2353
         * href="https://stripe.com/docs/api#coupons">coupon</a> or <a
2354
         * href="https://stripe.com/docs/api#promotion_codes">promotion code</a>. It contains
2355
         * information about when the discount began, when it will end, and what it is applied to.
2356
         *
2357
         * <p>Related guide: <a
2358
         * href="https://stripe.com/docs/billing/subscriptions/discounts">Applying discounts to
2359
         * subscriptions</a>
2360
         */
2361
        @SerializedName("discount")
2362
        com.stripe.model.Discount discount;
2363
      }
2364

2365
      @Getter
2366
      @Setter
2367
      @EqualsAndHashCode(callSuper = false)
2368
      public static class Tax extends StripeObject {
×
2369
        /** Amount of tax applied for this rate. */
2370
        @SerializedName("amount")
2371
        Long amount;
2372

2373
        /**
2374
         * Tax rates can be applied to <a
2375
         * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
2376
         * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
2377
         * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
2378
         * Sessions</a> to collect tax.
2379
         *
2380
         * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
2381
         */
2382
        @SerializedName("rate")
2383
        TaxRate rate;
2384

2385
        /**
2386
         * The reasoning behind this tax, for example, if the product is tax exempt. The possible
2387
         * values for this field may be extended as new tax rules are supported.
2388
         *
2389
         * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
2390
         * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
2391
         * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
2392
         * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
2393
         * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
2394
         */
2395
        @SerializedName("taxability_reason")
2396
        String taxabilityReason;
2397

2398
        /** The amount on which tax is calculated, in cents (or local equivalent). */
2399
        @SerializedName("taxable_amount")
2400
        Long taxableAmount;
2401
      }
2402
    }
2403
  }
2404

2405
  @Getter
2406
  @Setter
2407
  @EqualsAndHashCode(callSuper = false)
2408
  public static class TransferData extends StripeObject {
×
2409
    /**
2410
     * The amount in cents (or local equivalent) that will be transferred to the destination account
2411
     * when the invoice is paid. By default, the entire amount is transferred to the destination.
2412
     */
2413
    @SerializedName("amount")
2414
    Long amount;
2415

2416
    /**
2417
     * A non-negative decimal between 0 and 100, with at most two decimal places. This represents
2418
     * the percentage of the subscription invoice total that will be transferred to the destination
2419
     * account. By default, the entire amount will be transferred to the destination.
2420
     */
2421
    @SerializedName("amount_percent")
2422
    BigDecimal amountPercent;
2423

2424
    /** The account where funds from the payment will be transferred to upon payment success. */
2425
    @SerializedName("destination")
2426
    @Getter(lombok.AccessLevel.NONE)
2427
    @Setter(lombok.AccessLevel.NONE)
2428
    ExpandableField<Account> destination;
2429

2430
    /** Get ID of expandable {@code destination} object. */
2431
    public String getDestination() {
2432
      return (this.destination != null) ? this.destination.getId() : null;
×
2433
    }
2434

2435
    public void setDestination(String id) {
2436
      this.destination = ApiResource.setExpandableFieldId(id, this.destination);
×
2437
    }
×
2438

2439
    /** Get expanded {@code destination}. */
2440
    public Account getDestinationObject() {
2441
      return (this.destination != null) ? this.destination.getExpanded() : null;
×
2442
    }
2443

2444
    public void setDestinationObject(Account expandableObject) {
2445
      this.destination = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
2446
    }
×
2447
  }
2448

2449
  @Override
2450
  public void setResponseGetter(StripeResponseGetter responseGetter) {
2451
    super.setResponseGetter(responseGetter);
1✔
2452
    trySetResponseGetter(application, responseGetter);
1✔
2453
    trySetResponseGetter(automaticTax, responseGetter);
1✔
2454
    trySetResponseGetter(computed, responseGetter);
1✔
2455
    trySetResponseGetter(customer, responseGetter);
1✔
2456
    trySetResponseGetter(fromQuote, responseGetter);
1✔
2457
    trySetResponseGetter(invoice, responseGetter);
1✔
2458
    trySetResponseGetter(invoiceSettings, responseGetter);
1✔
2459
    trySetResponseGetter(lineItems, responseGetter);
1✔
2460
    trySetResponseGetter(onBehalfOf, responseGetter);
1✔
2461
    trySetResponseGetter(statusDetails, responseGetter);
1✔
2462
    trySetResponseGetter(statusTransitions, responseGetter);
1✔
2463
    trySetResponseGetter(subscription, responseGetter);
1✔
2464
    trySetResponseGetter(subscriptionData, responseGetter);
1✔
2465
    trySetResponseGetter(subscriptionSchedule, responseGetter);
1✔
2466
    trySetResponseGetter(testClock, responseGetter);
1✔
2467
    trySetResponseGetter(totalDetails, responseGetter);
1✔
2468
    trySetResponseGetter(transferData, responseGetter);
1✔
2469
  }
1✔
2470
}
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