diff --git a/API_VERSION b/API_VERSION index dffa3a76a26..50609624505 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -6d15a7f20cb77c2c22091a30e499cb89d7e3248c \ No newline at end of file +441c0fcde75bcbf836f1a1810d5b9cfe8e8a7da4 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index dfd2783f161..81ad24fd492 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2111 \ No newline at end of file +v2116 \ No newline at end of file diff --git a/README.md b/README.md index 03e6de2afe3..c8e1945acf7 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,8 @@ Stripe has features in the [private preview phase](https://docs.stripe.com/relea ### Custom requests +> This feature is only available from version 27 of this SDK. + If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `rawRequest` method on `StripeClient`. ```java diff --git a/src/main/java/com/stripe/ApiVersion.java b/src/main/java/com/stripe/ApiVersion.java index 89d335a0536..afd35346caf 100644 --- a/src/main/java/com/stripe/ApiVersion.java +++ b/src/main/java/com/stripe/ApiVersion.java @@ -2,5 +2,5 @@ package com.stripe; final class ApiVersion { - public static final String CURRENT = "2025-09-30.preview"; + public static final String CURRENT = "2025-10-29.preview"; } diff --git a/src/main/java/com/stripe/model/Person.java b/src/main/java/com/stripe/model/Person.java index 41fac02ab2e..3e5f16295e6 100644 --- a/src/main/java/com/stripe/model/Person.java +++ b/src/main/java/com/stripe/model/Person.java @@ -214,6 +214,12 @@ public class Person extends ApiResource implements HasId, MetadataStore @SerializedName("requirements") Requirements requirements; + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** * Whether the last four digits of the person's Social Security number have been provided (U.S. * only). @@ -836,6 +842,48 @@ public static class Errors extends StripeObject { } } + /** + * For more details about SelfReportedIncome, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome extends StripeObject { + /** Amount in the minor currency unit (e.g., cents for USD). */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + } + + /** + * For more details about SelfReportedMonthlyHousingPayment, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment extends StripeObject { + /** Amount in the minor currency unit (e.g., cents for USD). */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + } + /** * For more details about UsCfpbData, please refer to the API Reference. @@ -1116,6 +1164,8 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(registeredAddress, responseGetter); trySetResponseGetter(relationship, responseGetter); trySetResponseGetter(requirements, responseGetter); + trySetResponseGetter(selfReportedIncome, responseGetter); + trySetResponseGetter(selfReportedMonthlyHousingPayment, responseGetter); trySetResponseGetter(usCfpbData, responseGetter); trySetResponseGetter(verification, responseGetter); } diff --git a/src/main/java/com/stripe/model/Quote.java b/src/main/java/com/stripe/model/Quote.java index 5268742f7dc..38aa038ed2a 100644 --- a/src/main/java/com/stripe/model/Quote.java +++ b/src/main/java/com/stripe/model/Quote.java @@ -1977,6 +1977,13 @@ public static class SubscriptionData extends StripeObject { @SerializedName("billing_mode") BillingMode billingMode; + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * from this quote. + */ + @SerializedName("billing_schedules") + List billingSchedules; + /** * The subscription's description, meant to be displayable to the customer. Use this field to * optionally store an explanation of the subscription for rendering in Stripe surfaces and @@ -2019,6 +2026,19 @@ public static class SubscriptionData extends StripeObject { @SerializedName("metadata") Map metadata; + /** + * Configures how the subscription schedule handles billing for phase transitions. Possible + * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} + * bills based on the current state of the subscription, ignoring changes scheduled in future + * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within + * the current billing cycle, including pricing changes and service period adjustments that will + * occur before the next invoice. + * + *

One of {@code billing_period_start}, or {@code phase_start}. + */ + @SerializedName("phase_effective_at") + String phaseEffectiveAt; + /** * If specified, the invoicing for the given billing cycle iterations will be processed when the * quote is accepted. Cannot be used with {@code effective_date}. @@ -2230,6 +2250,226 @@ public static class Flexible extends StripeObject { } } + /** Sets the billing schedule for the subscription. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingSchedule extends StripeObject { + /** Specifies which subscription items the billing schedule applies to. */ + @SerializedName("applies_to") + List appliesTo; + + /** Specifies the start of the billing period. */ + @SerializedName("bill_from") + BillFrom billFrom; + + /** Specifies the billing period. */ + @SerializedName("bill_until") + BillUntil billUntil; + + /** Unique identifier for the billing schedule. */ + @SerializedName("key") + String key; + + /** Represents the entities that the billing schedule applies to. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AppliesTo extends StripeObject { + /** The billing schedule will apply to the subscription item with the given price ID. */ + @SerializedName("price") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField price; + + /** + * Controls which subscription items the billing schedule applies to. + * + *

Equal to {@code price}. + */ + @SerializedName("type") + String type; + + /** Get ID of expandable {@code price} object. */ + public String getPrice() { + return (this.price != null) ? this.price.getId() : null; + } + + public void setPrice(String id) { + this.price = ApiResource.setExpandableFieldId(id, this.price); + } + + /** Get expanded {@code price}. */ + public Price getPriceObject() { + return (this.price != null) ? this.price.getExpanded() : null; + } + + public void setPriceObject(Price expandableObject) { + this.price = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** Specifies the start of the billing period. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillFrom extends StripeObject { + /** Use an index to specify the position of an amendment to start prebilling with. */ + @SerializedName("amendment_start") + AmendmentStart amendmentStart; + + /** The time the billing schedule applies from. */ + @SerializedName("computed_timestamp") + Long computedTimestamp; + + /** Lets you bill the period starting from a particular Quote line. */ + @SerializedName("line_starts_at") + LineStartsAt lineStartsAt; + + /** Timestamp is calculated from the request time. */ + @SerializedName("relative") + Relative relative; + + /** + * Use a precise Unix timestamp for prebilling to start. Must be earlier than {@code + * bill_until}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Describes how the billing schedule determines the start date. Possible values are {@code + * timestamp}, {@code relative}, {@code amendment_start}, {@code now}, {@code + * quote_acceptance_date}, {@code line_starts_at}, or {@code pause_collection_start}. + * + *

One of {@code amendment_start}, {@code line_starts_at}, {@code now}, {@code + * pause_collection_start}, {@code quote_acceptance_date}, {@code relative}, or {@code + * timestamp}. + */ + @SerializedName("type") + String type; + + /** Use an index to specify the position of an amendment to start prebilling with. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmendmentStart extends StripeObject { + /** Use an index to specify the position of an amendment to start prebilling with. */ + @SerializedName("index") + Long index; + } + + /** The timestamp the given line starts at. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LineStartsAt extends StripeObject implements HasId { + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + } + + /** Timestamp is calculated from the request time. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Relative extends StripeObject { + /** + * Specifies billing duration. Possible values are {@code day}, {@code week}, {@code + * month}, or {@code year}. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** The multiplier applied to the interval. */ + @SerializedName("interval_count") + Long intervalCount; + } + } + + /** Specifies the billing period. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillUntil extends StripeObject { + /** Use an index to specify the position of an amendment to end prebilling with. */ + @SerializedName("amendment_end") + AmendmentEnd amendmentEnd; + + /** The timestamp the billing schedule will apply until. */ + @SerializedName("computed_timestamp") + Long computedTimestamp; + + /** Specifies the billing period. */ + @SerializedName("duration") + Duration duration; + + /** Lets you bill the period ending at a particular Quote line. */ + @SerializedName("line_ends_at") + LineEndsAt lineEndsAt; + + /** If specified, the billing schedule will apply until the specified timestamp. */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Describes how the billing schedule will determine the end date. Either {@code duration} + * or {@code timestamp}. + * + *

One of {@code amendment_end}, {@code duration}, {@code line_ends_at}, {@code + * schedule_end}, {@code timestamp}, or {@code upcoming_invoice}. + */ + @SerializedName("type") + String type; + + /** Use an index to specify the position of an amendment to end prebilling with. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmendmentEnd extends StripeObject { + /** Use an index to specify the position of an amendment to end prebilling with. */ + @SerializedName("index") + Long index; + } + + /** + * Configures the {@code bill_until} date based on the provided {@code interval} and {@code + * interval_count}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Duration extends StripeObject { + /** + * Specifies billing duration. Either {@code day}, {@code week}, {@code month} or {@code + * year}. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** The multiplier applied to the interval. */ + @SerializedName("interval_count") + Long intervalCount; + } + + /** The timestamp the given line ends at. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LineEndsAt extends StripeObject implements HasId { + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + } + } + } + /** * For more details about Prebilling, please refer to the API Reference. @@ -2270,6 +2510,13 @@ public static class SubscriptionDataOverride extends StripeObject { @SerializedName("billing_behavior") String billingBehavior; + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * from this quote. + */ + @SerializedName("billing_schedules") + List billingSchedules; + /** * The customer which this quote belongs to. A customer is required before finalizing the quote. * Once specified, it cannot be changed. @@ -2293,6 +2540,19 @@ public static class SubscriptionDataOverride extends StripeObject { @SerializedName("end_behavior") String endBehavior; + /** + * Configures how the subscription schedule handles billing for phase transitions. Possible + * values are {@code phase_start} (default) or {@code billing_period_start}. {@code phase_start} + * bills based on the current state of the subscription, ignoring changes scheduled in future + * phases. {@code billing_period_start} bills predictively for upcoming phase transitions within + * the current billing cycle, including pricing changes and service period adjustments that will + * occur before the next invoice. + * + *

One of {@code billing_period_start}, or {@code phase_start}. + */ + @SerializedName("phase_effective_at") + String phaseEffectiveAt; + /** * Determines how to handle prorations when the @@ -2465,6 +2725,226 @@ public static class LineEndsAt extends StripeObject implements HasId { } } } + + /** Sets the billing schedule for the subscription. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingSchedule extends StripeObject { + /** Specifies which subscription items the billing schedule applies to. */ + @SerializedName("applies_to") + List appliesTo; + + /** Specifies the start of the billing period. */ + @SerializedName("bill_from") + BillFrom billFrom; + + /** Specifies the billing period. */ + @SerializedName("bill_until") + BillUntil billUntil; + + /** Unique identifier for the billing schedule. */ + @SerializedName("key") + String key; + + /** Represents the entities that the billing schedule applies to. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AppliesTo extends StripeObject { + /** The billing schedule will apply to the subscription item with the given price ID. */ + @SerializedName("price") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField price; + + /** + * Controls which subscription items the billing schedule applies to. + * + *

Equal to {@code price}. + */ + @SerializedName("type") + String type; + + /** Get ID of expandable {@code price} object. */ + public String getPrice() { + return (this.price != null) ? this.price.getId() : null; + } + + public void setPrice(String id) { + this.price = ApiResource.setExpandableFieldId(id, this.price); + } + + /** Get expanded {@code price}. */ + public Price getPriceObject() { + return (this.price != null) ? this.price.getExpanded() : null; + } + + public void setPriceObject(Price expandableObject) { + this.price = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** Specifies the start of the billing period. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillFrom extends StripeObject { + /** Use an index to specify the position of an amendment to start prebilling with. */ + @SerializedName("amendment_start") + AmendmentStart amendmentStart; + + /** The time the billing schedule applies from. */ + @SerializedName("computed_timestamp") + Long computedTimestamp; + + /** Lets you bill the period starting from a particular Quote line. */ + @SerializedName("line_starts_at") + LineStartsAt lineStartsAt; + + /** Timestamp is calculated from the request time. */ + @SerializedName("relative") + Relative relative; + + /** + * Use a precise Unix timestamp for prebilling to start. Must be earlier than {@code + * bill_until}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Describes how the billing schedule determines the start date. Possible values are {@code + * timestamp}, {@code relative}, {@code amendment_start}, {@code now}, {@code + * quote_acceptance_date}, {@code line_starts_at}, or {@code pause_collection_start}. + * + *

One of {@code amendment_start}, {@code line_starts_at}, {@code now}, {@code + * pause_collection_start}, {@code quote_acceptance_date}, {@code relative}, or {@code + * timestamp}. + */ + @SerializedName("type") + String type; + + /** Use an index to specify the position of an amendment to start prebilling with. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmendmentStart extends StripeObject { + /** Use an index to specify the position of an amendment to start prebilling with. */ + @SerializedName("index") + Long index; + } + + /** The timestamp the given line starts at. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LineStartsAt extends StripeObject implements HasId { + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + } + + /** Timestamp is calculated from the request time. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Relative extends StripeObject { + /** + * Specifies billing duration. Possible values are {@code day}, {@code week}, {@code + * month}, or {@code year}. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** The multiplier applied to the interval. */ + @SerializedName("interval_count") + Long intervalCount; + } + } + + /** Specifies the billing period. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillUntil extends StripeObject { + /** Use an index to specify the position of an amendment to end prebilling with. */ + @SerializedName("amendment_end") + AmendmentEnd amendmentEnd; + + /** The timestamp the billing schedule will apply until. */ + @SerializedName("computed_timestamp") + Long computedTimestamp; + + /** Specifies the billing period. */ + @SerializedName("duration") + Duration duration; + + /** Lets you bill the period ending at a particular Quote line. */ + @SerializedName("line_ends_at") + LineEndsAt lineEndsAt; + + /** If specified, the billing schedule will apply until the specified timestamp. */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Describes how the billing schedule will determine the end date. Either {@code duration} + * or {@code timestamp}. + * + *

One of {@code amendment_end}, {@code duration}, {@code line_ends_at}, {@code + * schedule_end}, {@code timestamp}, or {@code upcoming_invoice}. + */ + @SerializedName("type") + String type; + + /** Use an index to specify the position of an amendment to end prebilling with. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmendmentEnd extends StripeObject { + /** Use an index to specify the position of an amendment to end prebilling with. */ + @SerializedName("index") + Long index; + } + + /** + * Configures the {@code bill_until} date based on the provided {@code interval} and {@code + * interval_count}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Duration extends StripeObject { + /** + * Specifies billing duration. Either {@code day}, {@code week}, {@code month} or {@code + * year}. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** The multiplier applied to the interval. */ + @SerializedName("interval_count") + Long intervalCount; + } + + /** The timestamp the given line ends at. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LineEndsAt extends StripeObject implements HasId { + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + } + } + } } /** diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index 2dd79e05df7..62873f0c86f 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -1522,6 +1522,10 @@ public static class BillingSchedule extends StripeObject { @SerializedName("applies_to") List appliesTo; + /** Specifies the start of the billing period. */ + @SerializedName("bill_from") + BillFrom billFrom; + /** Specifies the billing period. */ @SerializedName("bill_until") BillUntil billUntil; @@ -1568,11 +1572,96 @@ public void setPriceObject(Price expandableObject) { } } + /** Specifies the start of the billing period. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillFrom extends StripeObject { + /** Use an index to specify the position of an amendment to start prebilling with. */ + @SerializedName("amendment_start") + AmendmentStart amendmentStart; + + /** The time the billing schedule applies from. */ + @SerializedName("computed_timestamp") + Long computedTimestamp; + + /** Lets you bill the period starting from a particular Quote line. */ + @SerializedName("line_starts_at") + LineStartsAt lineStartsAt; + + /** Timestamp is calculated from the request time. */ + @SerializedName("relative") + Relative relative; + + /** + * Use a precise Unix timestamp for prebilling to start. Must be earlier than {@code + * bill_until}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Describes how the billing schedule determines the start date. Possible values are {@code + * timestamp}, {@code relative}, {@code amendment_start}, {@code now}, {@code + * quote_acceptance_date}, {@code line_starts_at}, or {@code pause_collection_start}. + * + *

One of {@code amendment_start}, {@code line_starts_at}, {@code now}, {@code + * pause_collection_start}, {@code quote_acceptance_date}, {@code relative}, or {@code + * timestamp}. + */ + @SerializedName("type") + String type; + + /** Use an index to specify the position of an amendment to start prebilling with. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmendmentStart extends StripeObject { + /** Use an index to specify the position of an amendment to start prebilling with. */ + @SerializedName("index") + Long index; + } + + /** The timestamp the given line starts at. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LineStartsAt extends StripeObject implements HasId { + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + } + + /** Timestamp is calculated from the request time. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Relative extends StripeObject { + /** + * Specifies billing duration. Possible values are {@code day}, {@code week}, {@code month}, + * or {@code year}. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** The multiplier applied to the interval. */ + @SerializedName("interval_count") + Long intervalCount; + } + } + /** Specifies the billing period. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class BillUntil extends StripeObject { + /** Use an index to specify the position of an amendment to end prebilling with. */ + @SerializedName("amendment_end") + AmendmentEnd amendmentEnd; + /** The timestamp the billing schedule will apply until. */ @SerializedName("computed_timestamp") Long computedTimestamp; @@ -1581,6 +1670,10 @@ public static class BillUntil extends StripeObject { @SerializedName("duration") Duration duration; + /** Lets you bill the period ending at a particular Quote line. */ + @SerializedName("line_ends_at") + LineEndsAt lineEndsAt; + /** If specified, the billing schedule will apply until the specified timestamp. */ @SerializedName("timestamp") Long timestamp; @@ -1589,11 +1682,22 @@ public static class BillUntil extends StripeObject { * Describes how the billing schedule will determine the end date. Either {@code duration} or * {@code timestamp}. * - *

One of {@code duration}, or {@code timestamp}. + *

One of {@code amendment_end}, {@code duration}, {@code line_ends_at}, {@code + * schedule_end}, {@code timestamp}, or {@code upcoming_invoice}. */ @SerializedName("type") String type; + /** Use an index to specify the position of an amendment to end prebilling with. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmendmentEnd extends StripeObject { + /** Use an index to specify the position of an amendment to end prebilling with. */ + @SerializedName("index") + Long index; + } + /** * Configures the {@code bill_until} date based on the provided {@code interval} and {@code * interval_count}. @@ -1615,6 +1719,17 @@ public static class Duration extends StripeObject { @SerializedName("interval_count") Long intervalCount; } + + /** The timestamp the given line ends at. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LineEndsAt extends StripeObject implements HasId { + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + } } } diff --git a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java index 40f4b4e2317..4df791768e2 100644 --- a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java @@ -202,8 +202,6 @@ public final class EventDataClassLookup { classLookup.put("v2.reporting.report", com.stripe.model.v2.reporting.Report.class); classLookup.put("v2.reporting.report_run", com.stripe.model.v2.reporting.ReportRun.class); - classLookup.put("v2.tax.automatic_rule", com.stripe.model.v2.tax.AutomaticRule.class); - eventClassLookup.put("v1.account.updated", com.stripe.events.V1AccountUpdatedEvent.class); eventClassLookup.put( "v1.application_fee.created", com.stripe.events.V1ApplicationFeeCreatedEvent.class); diff --git a/src/main/java/com/stripe/model/v2/tax/AutomaticRule.java b/src/main/java/com/stripe/model/v2/tax/AutomaticRule.java deleted file mode 100644 index a0537de9048..00000000000 --- a/src/main/java/com/stripe/model/v2/tax/AutomaticRule.java +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.model.v2.tax; - -import com.google.gson.annotations.SerializedName; -import com.stripe.model.HasId; -import com.stripe.model.StripeObject; -import java.time.Instant; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; - -/** An AutomaticRule holds automatic Tax configuration for a BillableItem. */ -@Getter -@Setter -@EqualsAndHashCode(callSuper = false) -public class AutomaticRule extends StripeObject implements HasId { - /** The ID of the BillableItem. */ - @SerializedName("billable_item") - String billableItem; - - /** The time at which the AutomaticRule object was created. */ - @SerializedName("created") - Instant created; - - /** The ID of the AutomaticRule object. */ - @Getter(onMethod_ = {@Override}) - @SerializedName("id") - String id; - - /** - * Has the value {@code true} if the object exists in live mode or the value {@code false} if the - * object exists in test mode. - */ - @SerializedName("livemode") - Boolean livemode; - - /** - * String representing the object's type. Objects of the same type share the same value of the - * object field. - * - *

Equal to {@code v2.tax.automatic_rule}. - */ - @SerializedName("object") - String object; - - /** - * The status of the AutomaticRule object. - * - *

One of {@code active}, or {@code inactive}. - */ - @SerializedName("status") - String status; - - /** A TaxCode object that will be used for automatic tax calculations. */ - @SerializedName("tax_code") - String taxCode; -} diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index 1022f5aa67e..c59b48ab6bf 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -12138,6 +12138,14 @@ public static class Individual { @SerializedName("relationship") Relationship relationship; + /** The credit applicant's self-reported yearly income in minor units. */ + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** The last four digits of the individual's Social Security Number (U.S. only). */ @SerializedName("ssn_last_4") String ssnLast4; @@ -12169,6 +12177,8 @@ private Individual( PoliticalExposure politicalExposure, RegisteredAddress registeredAddress, Relationship relationship, + SelfReportedIncome selfReportedIncome, + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment, String ssnLast4, Verification verification) { this.address = address; @@ -12193,6 +12203,8 @@ private Individual( this.politicalExposure = politicalExposure; this.registeredAddress = registeredAddress; this.relationship = relationship; + this.selfReportedIncome = selfReportedIncome; + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; this.ssnLast4 = ssnLast4; this.verification = verification; } @@ -12246,6 +12258,10 @@ public static class Builder { private Relationship relationship; + private SelfReportedIncome selfReportedIncome; + + private SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + private String ssnLast4; private Verification verification; @@ -12275,6 +12291,8 @@ public AccountCreateParams.Individual build() { this.politicalExposure, this.registeredAddress, this.relationship, + this.selfReportedIncome, + this.selfReportedMonthlyHousingPayment, this.ssnLast4, this.verification); } @@ -12533,6 +12551,21 @@ public Builder setRelationship(AccountCreateParams.Individual.Relationship relat return this; } + /** The credit applicant's self-reported yearly income in minor units. */ + public Builder setSelfReportedIncome( + AccountCreateParams.Individual.SelfReportedIncome selfReportedIncome) { + this.selfReportedIncome = selfReportedIncome; + return this; + } + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + public Builder setSelfReportedMonthlyHousingPayment( + AccountCreateParams.Individual.SelfReportedMonthlyHousingPayment + selfReportedMonthlyHousingPayment) { + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; + return this; + } + /** The last four digits of the individual's Social Security Number (U.S. only). */ public Builder setSsnLast4(String ssnLast4) { this.ssnLast4 = ssnLast4; @@ -13453,6 +13486,179 @@ public Builder setTitle(String title) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedIncome(Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Individual.SelfReportedIncome build() { + return new AccountCreateParams.Individual.SelfReportedIncome( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Individual.SelfReportedIncome#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Individual.SelfReportedIncome#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedMonthlyHousingPayment( + Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Individual.SelfReportedMonthlyHousingPayment build() { + return new AccountCreateParams.Individual.SelfReportedMonthlyHousingPayment( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountCreateParams.Individual.SelfReportedMonthlyHousingPayment#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountCreateParams.Individual.SelfReportedMonthlyHousingPayment#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { diff --git a/src/main/java/com/stripe/param/AccountPersonCreateParams.java b/src/main/java/com/stripe/param/AccountPersonCreateParams.java index a9982ede685..0409f5607b4 100644 --- a/src/main/java/com/stripe/param/AccountPersonCreateParams.java +++ b/src/main/java/com/stripe/param/AccountPersonCreateParams.java @@ -160,6 +160,14 @@ public class AccountPersonCreateParams extends ApiRequestParams { @SerializedName("relationship") Relationship relationship; + /** The credit applicant's self-reported yearly income in minor units. */ + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** The last four digits of the person's Social Security number (U.S. only). */ @SerializedName("ssn_last_4") String ssnLast4; @@ -200,6 +208,8 @@ private AccountPersonCreateParams( PoliticalExposure politicalExposure, RegisteredAddress registeredAddress, Relationship relationship, + SelfReportedIncome selfReportedIncome, + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment, String ssnLast4, UsCfpbData usCfpbData, Verification verification) { @@ -230,6 +240,8 @@ private AccountPersonCreateParams( this.politicalExposure = politicalExposure; this.registeredAddress = registeredAddress; this.relationship = relationship; + this.selfReportedIncome = selfReportedIncome; + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; this.ssnLast4 = ssnLast4; this.usCfpbData = usCfpbData; this.verification = verification; @@ -294,6 +306,10 @@ public static class Builder { private Relationship relationship; + private SelfReportedIncome selfReportedIncome; + + private SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + private String ssnLast4; private UsCfpbData usCfpbData; @@ -330,6 +346,8 @@ public AccountPersonCreateParams build() { this.politicalExposure, this.registeredAddress, this.relationship, + this.selfReportedIncome, + this.selfReportedMonthlyHousingPayment, this.ssnLast4, this.usCfpbData, this.verification); @@ -651,6 +669,21 @@ public Builder setRelationship(AccountPersonCreateParams.Relationship relationsh return this; } + /** The credit applicant's self-reported yearly income in minor units. */ + public Builder setSelfReportedIncome( + AccountPersonCreateParams.SelfReportedIncome selfReportedIncome) { + this.selfReportedIncome = selfReportedIncome; + return this; + } + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + public Builder setSelfReportedMonthlyHousingPayment( + AccountPersonCreateParams.SelfReportedMonthlyHousingPayment + selfReportedMonthlyHousingPayment) { + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; + return this; + } + /** The last four digits of the person's Social Security number (U.S. only). */ public Builder setSsnLast4(String ssnLast4) { this.ssnLast4 = ssnLast4; @@ -2214,6 +2247,176 @@ public Builder setTitle(String title) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedIncome(Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountPersonCreateParams.SelfReportedIncome build() { + return new AccountPersonCreateParams.SelfReportedIncome( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * AccountPersonCreateParams.SelfReportedIncome#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link AccountPersonCreateParams.SelfReportedIncome#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedMonthlyHousingPayment( + Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountPersonCreateParams.SelfReportedMonthlyHousingPayment build() { + return new AccountPersonCreateParams.SelfReportedMonthlyHousingPayment( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * AccountPersonCreateParams.SelfReportedMonthlyHousingPayment#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link AccountPersonCreateParams.SelfReportedMonthlyHousingPayment#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsCfpbData { diff --git a/src/main/java/com/stripe/param/AccountPersonUpdateParams.java b/src/main/java/com/stripe/param/AccountPersonUpdateParams.java index ab515d80358..4769482777d 100644 --- a/src/main/java/com/stripe/param/AccountPersonUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountPersonUpdateParams.java @@ -160,6 +160,14 @@ public class AccountPersonUpdateParams extends ApiRequestParams { @SerializedName("relationship") Relationship relationship; + /** The credit applicant's self-reported yearly income in minor units. */ + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** The last four digits of the person's Social Security number (U.S. only). */ @SerializedName("ssn_last_4") Object ssnLast4; @@ -200,6 +208,8 @@ private AccountPersonUpdateParams( PoliticalExposure politicalExposure, RegisteredAddress registeredAddress, Relationship relationship, + SelfReportedIncome selfReportedIncome, + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment, Object ssnLast4, UsCfpbData usCfpbData, Verification verification) { @@ -230,6 +240,8 @@ private AccountPersonUpdateParams( this.politicalExposure = politicalExposure; this.registeredAddress = registeredAddress; this.relationship = relationship; + this.selfReportedIncome = selfReportedIncome; + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; this.ssnLast4 = ssnLast4; this.usCfpbData = usCfpbData; this.verification = verification; @@ -294,6 +306,10 @@ public static class Builder { private Relationship relationship; + private SelfReportedIncome selfReportedIncome; + + private SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + private Object ssnLast4; private UsCfpbData usCfpbData; @@ -330,6 +346,8 @@ public AccountPersonUpdateParams build() { this.politicalExposure, this.registeredAddress, this.relationship, + this.selfReportedIncome, + this.selfReportedMonthlyHousingPayment, this.ssnLast4, this.usCfpbData, this.verification); @@ -756,6 +774,21 @@ public Builder setRelationship(AccountPersonUpdateParams.Relationship relationsh return this; } + /** The credit applicant's self-reported yearly income in minor units. */ + public Builder setSelfReportedIncome( + AccountPersonUpdateParams.SelfReportedIncome selfReportedIncome) { + this.selfReportedIncome = selfReportedIncome; + return this; + } + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + public Builder setSelfReportedMonthlyHousingPayment( + AccountPersonUpdateParams.SelfReportedMonthlyHousingPayment + selfReportedMonthlyHousingPayment) { + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; + return this; + } + /** The last four digits of the person's Social Security number (U.S. only). */ public Builder setSsnLast4(String ssnLast4) { this.ssnLast4 = ssnLast4; @@ -2505,6 +2538,188 @@ public Builder setTitle(EmptyParam title) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + Object currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedIncome(Long amount, Object currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Object currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountPersonUpdateParams.SelfReportedIncome build() { + return new AccountPersonUpdateParams.SelfReportedIncome( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * AccountPersonUpdateParams.SelfReportedIncome#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link AccountPersonUpdateParams.SelfReportedIncome#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + Object currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedMonthlyHousingPayment( + Long amount, Object currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Object currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountPersonUpdateParams.SelfReportedMonthlyHousingPayment build() { + return new AccountPersonUpdateParams.SelfReportedMonthlyHousingPayment( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * AccountPersonUpdateParams.SelfReportedMonthlyHousingPayment#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link AccountPersonUpdateParams.SelfReportedMonthlyHousingPayment#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsCfpbData { diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index b8f79658e1e..536a0a7ab3f 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -11833,6 +11833,14 @@ public static class Individual { @SerializedName("relationship") Relationship relationship; + /** The credit applicant's self-reported yearly income in minor units. */ + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** The last four digits of the individual's Social Security Number (U.S. only). */ @SerializedName("ssn_last_4") Object ssnLast4; @@ -11864,6 +11872,8 @@ private Individual( PoliticalExposure politicalExposure, RegisteredAddress registeredAddress, Relationship relationship, + SelfReportedIncome selfReportedIncome, + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment, Object ssnLast4, Verification verification) { this.address = address; @@ -11888,6 +11898,8 @@ private Individual( this.politicalExposure = politicalExposure; this.registeredAddress = registeredAddress; this.relationship = relationship; + this.selfReportedIncome = selfReportedIncome; + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; this.ssnLast4 = ssnLast4; this.verification = verification; } @@ -11941,6 +11953,10 @@ public static class Builder { private Relationship relationship; + private SelfReportedIncome selfReportedIncome; + + private SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + private Object ssnLast4; private Verification verification; @@ -11970,6 +11986,8 @@ public AccountUpdateParams.Individual build() { this.politicalExposure, this.registeredAddress, this.relationship, + this.selfReportedIncome, + this.selfReportedMonthlyHousingPayment, this.ssnLast4, this.verification); } @@ -12312,6 +12330,21 @@ public Builder setRelationship(AccountUpdateParams.Individual.Relationship relat return this; } + /** The credit applicant's self-reported yearly income in minor units. */ + public Builder setSelfReportedIncome( + AccountUpdateParams.Individual.SelfReportedIncome selfReportedIncome) { + this.selfReportedIncome = selfReportedIncome; + return this; + } + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + public Builder setSelfReportedMonthlyHousingPayment( + AccountUpdateParams.Individual.SelfReportedMonthlyHousingPayment + selfReportedMonthlyHousingPayment) { + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; + return this; + } + /** The last four digits of the individual's Social Security Number (U.S. only). */ public Builder setSsnLast4(String ssnLast4) { this.ssnLast4 = ssnLast4; @@ -13412,6 +13445,191 @@ public Builder setTitle(EmptyParam title) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + Object currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedIncome(Long amount, Object currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Object currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Individual.SelfReportedIncome build() { + return new AccountUpdateParams.Individual.SelfReportedIncome( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Individual.SelfReportedIncome#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Individual.SelfReportedIncome#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + Object currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedMonthlyHousingPayment( + Long amount, Object currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Object currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Individual.SelfReportedMonthlyHousingPayment build() { + return new AccountUpdateParams.Individual.SelfReportedMonthlyHousingPayment( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountUpdateParams.Individual.SelfReportedMonthlyHousingPayment#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountUpdateParams.Individual.SelfReportedMonthlyHousingPayment#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 381206f1139..0a9d04b7185 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -14614,11 +14614,23 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("amendment_end") + AMENDMENT_END("amendment_end"), + @SerializedName("duration") DURATION("duration"), + @SerializedName("line_ends_at") + LINE_ENDS_AT("line_ends_at"), + + @SerializedName("schedule_end") + SCHEDULE_END("schedule_end"), + @SerializedName("timestamp") - TIMESTAMP("timestamp"); + TIMESTAMP("timestamp"), + + @SerializedName("upcoming_invoice") + UPCOMING_INVOICE("upcoming_invoice"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/PersonCollectionCreateParams.java b/src/main/java/com/stripe/param/PersonCollectionCreateParams.java index 0f874ddb3dd..6b924ec4066 100644 --- a/src/main/java/com/stripe/param/PersonCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/PersonCollectionCreateParams.java @@ -160,6 +160,14 @@ public class PersonCollectionCreateParams extends ApiRequestParams { @SerializedName("relationship") Relationship relationship; + /** The credit applicant's self-reported yearly income in minor units. */ + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** The last four digits of the person's Social Security number (U.S. only). */ @SerializedName("ssn_last_4") String ssnLast4; @@ -200,6 +208,8 @@ private PersonCollectionCreateParams( PoliticalExposure politicalExposure, RegisteredAddress registeredAddress, Relationship relationship, + SelfReportedIncome selfReportedIncome, + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment, String ssnLast4, UsCfpbData usCfpbData, Verification verification) { @@ -230,6 +240,8 @@ private PersonCollectionCreateParams( this.politicalExposure = politicalExposure; this.registeredAddress = registeredAddress; this.relationship = relationship; + this.selfReportedIncome = selfReportedIncome; + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; this.ssnLast4 = ssnLast4; this.usCfpbData = usCfpbData; this.verification = verification; @@ -294,6 +306,10 @@ public static class Builder { private Relationship relationship; + private SelfReportedIncome selfReportedIncome; + + private SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + private String ssnLast4; private UsCfpbData usCfpbData; @@ -330,6 +346,8 @@ public PersonCollectionCreateParams build() { this.politicalExposure, this.registeredAddress, this.relationship, + this.selfReportedIncome, + this.selfReportedMonthlyHousingPayment, this.ssnLast4, this.usCfpbData, this.verification); @@ -651,6 +669,21 @@ public Builder setRelationship(PersonCollectionCreateParams.Relationship relatio return this; } + /** The credit applicant's self-reported yearly income in minor units. */ + public Builder setSelfReportedIncome( + PersonCollectionCreateParams.SelfReportedIncome selfReportedIncome) { + this.selfReportedIncome = selfReportedIncome; + return this; + } + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + public Builder setSelfReportedMonthlyHousingPayment( + PersonCollectionCreateParams.SelfReportedMonthlyHousingPayment + selfReportedMonthlyHousingPayment) { + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; + return this; + } + /** The last four digits of the person's Social Security number (U.S. only). */ public Builder setSsnLast4(String ssnLast4) { this.ssnLast4 = ssnLast4; @@ -2220,6 +2253,176 @@ public Builder setTitle(String title) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedIncome(Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PersonCollectionCreateParams.SelfReportedIncome build() { + return new PersonCollectionCreateParams.SelfReportedIncome( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PersonCollectionCreateParams.SelfReportedIncome#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PersonCollectionCreateParams.SelfReportedIncome#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedMonthlyHousingPayment( + Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PersonCollectionCreateParams.SelfReportedMonthlyHousingPayment build() { + return new PersonCollectionCreateParams.SelfReportedMonthlyHousingPayment( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PersonCollectionCreateParams.SelfReportedMonthlyHousingPayment#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PersonCollectionCreateParams.SelfReportedMonthlyHousingPayment#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsCfpbData { diff --git a/src/main/java/com/stripe/param/PersonUpdateParams.java b/src/main/java/com/stripe/param/PersonUpdateParams.java index 72ac9d708e6..f2c243e941d 100644 --- a/src/main/java/com/stripe/param/PersonUpdateParams.java +++ b/src/main/java/com/stripe/param/PersonUpdateParams.java @@ -160,6 +160,14 @@ public class PersonUpdateParams extends ApiRequestParams { @SerializedName("relationship") Relationship relationship; + /** The credit applicant's self-reported yearly income in minor units. */ + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** The last four digits of the person's Social Security number (U.S. only). */ @SerializedName("ssn_last_4") Object ssnLast4; @@ -200,6 +208,8 @@ private PersonUpdateParams( PoliticalExposure politicalExposure, RegisteredAddress registeredAddress, Relationship relationship, + SelfReportedIncome selfReportedIncome, + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment, Object ssnLast4, UsCfpbData usCfpbData, Verification verification) { @@ -230,6 +240,8 @@ private PersonUpdateParams( this.politicalExposure = politicalExposure; this.registeredAddress = registeredAddress; this.relationship = relationship; + this.selfReportedIncome = selfReportedIncome; + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; this.ssnLast4 = ssnLast4; this.usCfpbData = usCfpbData; this.verification = verification; @@ -294,6 +306,10 @@ public static class Builder { private Relationship relationship; + private SelfReportedIncome selfReportedIncome; + + private SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + private Object ssnLast4; private UsCfpbData usCfpbData; @@ -330,6 +346,8 @@ public PersonUpdateParams build() { this.politicalExposure, this.registeredAddress, this.relationship, + this.selfReportedIncome, + this.selfReportedMonthlyHousingPayment, this.ssnLast4, this.usCfpbData, this.verification); @@ -754,6 +772,19 @@ public Builder setRelationship(PersonUpdateParams.Relationship relationship) { return this; } + /** The credit applicant's self-reported yearly income in minor units. */ + public Builder setSelfReportedIncome(PersonUpdateParams.SelfReportedIncome selfReportedIncome) { + this.selfReportedIncome = selfReportedIncome; + return this; + } + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + public Builder setSelfReportedMonthlyHousingPayment( + PersonUpdateParams.SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment) { + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; + return this; + } + /** The last four digits of the person's Social Security number (U.S. only). */ public Builder setSsnLast4(String ssnLast4) { this.ssnLast4 = ssnLast4; @@ -2497,6 +2528,187 @@ public Builder setTitle(EmptyParam title) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + Object currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedIncome(Long amount, Object currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Object currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PersonUpdateParams.SelfReportedIncome build() { + return new PersonUpdateParams.SelfReportedIncome( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PersonUpdateParams.SelfReportedIncome#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PersonUpdateParams.SelfReportedIncome#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + Object currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedMonthlyHousingPayment( + Long amount, Object currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Object currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PersonUpdateParams.SelfReportedMonthlyHousingPayment build() { + return new PersonUpdateParams.SelfReportedMonthlyHousingPayment( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PersonUpdateParams.SelfReportedMonthlyHousingPayment#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PersonUpdateParams.SelfReportedMonthlyHousingPayment#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsCfpbData { diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index a4732031f50..38f4080dd9c 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -6481,6 +6481,13 @@ public static class SubscriptionData { @SerializedName("billing_mode") BillingMode billingMode; + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + @SerializedName("billing_schedules") + Object billingSchedules; + /** * The subscription's description, meant to be displayable to the customer. Use this field to * optionally store an explanation of the subscription for rendering in Stripe surfaces and @@ -6532,6 +6539,17 @@ public static class SubscriptionData { @SerializedName("metadata") Map metadata; + /** + * Configures how the subscription schedule handles billing for phase transitions when the quote + * is accepted. Possible values are {@code phase_start} (default) or {@code + * billing_period_start}. {@code phase_start} bills based on the current state of the + * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} bills + * predictively for upcoming phase transitions within the current billing cycle, including + * pricing changes and service period adjustments that will occur before the next invoice. + */ + @SerializedName("phase_effective_at") + PhaseEffectiveAt phaseEffectiveAt; + /** * If specified, the invoicing for the given billing cycle iterations will be processed when the * quote is accepted. Cannot be used with {@code effective_date}. @@ -6570,12 +6588,14 @@ private SubscriptionData( BillingBehavior billingBehavior, ApiRequestParams.EnumParam billingCycleAnchor, BillingMode billingMode, + Object billingSchedules, String description, Object effectiveDate, EndBehavior endBehavior, Map extraParams, String fromSubscription, Map metadata, + PhaseEffectiveAt phaseEffectiveAt, Object prebilling, ProrationBehavior prorationBehavior, Object trialPeriodDays) { @@ -6583,12 +6603,14 @@ private SubscriptionData( this.billingBehavior = billingBehavior; this.billingCycleAnchor = billingCycleAnchor; this.billingMode = billingMode; + this.billingSchedules = billingSchedules; this.description = description; this.effectiveDate = effectiveDate; this.endBehavior = endBehavior; this.extraParams = extraParams; this.fromSubscription = fromSubscription; this.metadata = metadata; + this.phaseEffectiveAt = phaseEffectiveAt; this.prebilling = prebilling; this.prorationBehavior = prorationBehavior; this.trialPeriodDays = trialPeriodDays; @@ -6607,6 +6629,8 @@ public static class Builder { private BillingMode billingMode; + private Object billingSchedules; + private String description; private Object effectiveDate; @@ -6619,6 +6643,8 @@ public static class Builder { private Map metadata; + private PhaseEffectiveAt phaseEffectiveAt; + private Object prebilling; private ProrationBehavior prorationBehavior; @@ -6632,12 +6658,14 @@ public QuoteCreateParams.SubscriptionData build() { this.billingBehavior, this.billingCycleAnchor, this.billingMode, + this.billingSchedules, this.description, this.effectiveDate, this.endBehavior, this.extraParams, this.fromSubscription, this.metadata, + this.phaseEffectiveAt, this.prebilling, this.prorationBehavior, this.trialPeriodDays); @@ -6688,6 +6716,59 @@ public Builder setBillingMode(QuoteCreateParams.SubscriptionData.BillingMode bil return this; } + /** + * Add an element to `billingSchedules` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteCreateParams.SubscriptionData#billingSchedules} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addBillingSchedule( + QuoteCreateParams.SubscriptionData.BillingSchedule element) { + if (this.billingSchedules == null || this.billingSchedules instanceof EmptyParam) { + this.billingSchedules = + new ArrayList(); + } + ((List) this.billingSchedules) + .add(element); + return this; + } + + /** + * Add all elements to `billingSchedules` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link QuoteCreateParams.SubscriptionData#billingSchedules} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllBillingSchedule( + List elements) { + if (this.billingSchedules == null || this.billingSchedules instanceof EmptyParam) { + this.billingSchedules = + new ArrayList(); + } + ((List) this.billingSchedules) + .addAll(elements); + return this; + } + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + public Builder setBillingSchedules(EmptyParam billingSchedules) { + this.billingSchedules = billingSchedules; + return this; + } + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + public Builder setBillingSchedules( + List billingSchedules) { + this.billingSchedules = billingSchedules; + return this; + } + /** * The subscription's description, meant to be displayable to the customer. Use this field to * optionally store an explanation of the subscription for rendering in Stripe surfaces and @@ -6806,6 +6887,21 @@ public Builder putAllMetadata(Map map) { return this; } + /** + * Configures how the subscription schedule handles billing for phase transitions when the + * quote is accepted. Possible values are {@code phase_start} (default) or {@code + * billing_period_start}. {@code phase_start} bills based on the current state of the + * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} + * bills predictively for upcoming phase transitions within the current billing cycle, + * including pricing changes and service period adjustments that will occur before the next + * invoice. + */ + public Builder setPhaseEffectiveAt( + QuoteCreateParams.SubscriptionData.PhaseEffectiveAt phaseEffectiveAt) { + this.phaseEffectiveAt = phaseEffectiveAt; + return this; + } + /** * If specified, the invoicing for the given billing cycle iterations will be processed when * the quote is accepted. Cannot be used with {@code effective_date}. @@ -7752,7 +7848,23 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Prebilling { + public static class BillingSchedule { + /** Configure billing schedule differently for individual subscription items. */ + @SerializedName("applies_to") + List appliesTo; + + /** + * Required. The start of the period to bill from when the Quote is accepted. + */ + @SerializedName("bill_from") + BillFrom billFrom; + + /** + * Required. The end of the period to bill until when the Quote is accepted. + */ + @SerializedName("bill_until") + BillUntil billUntil; + /** * Map of extra parameters for custom features not available in this client library. The * content in this map is not serialized under this field's {@code @SerializedName} value. @@ -7763,15 +7875,23 @@ public static class Prebilling { Map extraParams; /** - * Required. This is used to determine the number of billing cycles to - * prebill. + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and up + * to 200 characters. If not provided, a unique key will be generated. */ - @SerializedName("iterations") - Long iterations; + @SerializedName("key") + String key; - private Prebilling(Map extraParams, Long iterations) { + private BillingSchedule( + List appliesTo, + BillFrom billFrom, + BillUntil billUntil, + Map extraParams, + String key) { + this.appliesTo = appliesTo; + this.billFrom = billFrom; + this.billUntil = billUntil; this.extraParams = extraParams; - this.iterations = iterations; + this.key = key; } public static Builder builder() { @@ -7779,21 +7899,77 @@ public static Builder builder() { } public static class Builder { + private List appliesTo; + + private BillFrom billFrom; + + private BillUntil billUntil; + private Map extraParams; - private Long iterations; + private String key; /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionData.Prebilling build() { - return new QuoteCreateParams.SubscriptionData.Prebilling( - this.extraParams, this.iterations); + public QuoteCreateParams.SubscriptionData.BillingSchedule build() { + return new QuoteCreateParams.SubscriptionData.BillingSchedule( + this.appliesTo, this.billFrom, this.billUntil, this.extraParams, this.key); + } + + /** + * Add an element to `appliesTo` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule#appliesTo} for the field + * documentation. + */ + public Builder addAppliesTo( + QuoteCreateParams.SubscriptionData.BillingSchedule.AppliesTo element) { + if (this.appliesTo == null) { + this.appliesTo = new ArrayList<>(); + } + this.appliesTo.add(element); + return this; + } + + /** + * Add all elements to `appliesTo` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule#appliesTo} for the field + * documentation. + */ + public Builder addAllAppliesTo( + List elements) { + if (this.appliesTo == null) { + this.appliesTo = new ArrayList<>(); + } + this.appliesTo.addAll(elements); + return this; + } + + /** + * Required. The start of the period to bill from when the Quote is + * accepted. + */ + public Builder setBillFrom( + QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom billFrom) { + this.billFrom = billFrom; + return this; + } + + /** + * Required. The end of the period to bill until when the Quote is + * accepted. + */ + public Builder setBillUntil( + QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil billUntil) { + this.billUntil = billUntil; + return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteCreateParams.SubscriptionData.Prebilling#extraParams} for the field - * documentation. + * map. See {@link QuoteCreateParams.SubscriptionData.BillingSchedule#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -7806,8 +7982,8 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteCreateParams.SubscriptionData.Prebilling#extraParams} for the field - * documentation. + * map. See {@link QuoteCreateParams.SubscriptionData.BillingSchedule#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -7818,457 +7994,2045 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. This is used to determine the number of billing cycles to - * prebill. + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and + * up to 200 characters. If not provided, a unique key will be generated. */ - public Builder setIterations(Long iterations) { - this.iterations = iterations; + public Builder setKey(String key) { + this.key = key; return this; } } - } - public enum BillingBehavior implements ApiRequestParams.EnumParam { - @SerializedName("prorate_on_next_phase") - PRORATE_ON_NEXT_PHASE("prorate_on_next_phase"), + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AppliesTo { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; - @SerializedName("prorate_up_front") - PRORATE_UP_FRONT("prorate_up_front"); + /** The ID of the price object. */ + @SerializedName("price") + String price; - @Getter(onMethod_ = {@Override}) - private final String value; + /** + * Required. Controls which subscription items the billing schedule applies + * to. + */ + @SerializedName("type") + Type type; - BillingBehavior(String value) { - this.value = value; - } - } + private AppliesTo(Map extraParams, String price, Type type) { + this.extraParams = extraParams; + this.price = price; + this.type = type; + } - public enum BillingCycleAnchor implements ApiRequestParams.EnumParam { - @SerializedName("reset") - RESET("reset"); + public static Builder builder() { + return new Builder(); + } - @Getter(onMethod_ = {@Override}) - private final String value; + public static class Builder { + private Map extraParams; - BillingCycleAnchor(String value) { - this.value = value; - } - } + private String price; - public enum EffectiveDate implements ApiRequestParams.EnumParam { - @SerializedName("current_period_end") - CURRENT_PERIOD_END("current_period_end"); + private Type type; - @Getter(onMethod_ = {@Override}) - private final String value; + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionData.BillingSchedule.AppliesTo build() { + return new QuoteCreateParams.SubscriptionData.BillingSchedule.AppliesTo( + this.extraParams, this.price, this.type); + } - EffectiveDate(String value) { - this.value = value; - } - } + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.AppliesTo#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } - public enum EndBehavior implements ApiRequestParams.EnumParam { - @SerializedName("cancel") - CANCEL("cancel"), + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.AppliesTo#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } - @SerializedName("release") - RELEASE("release"); + /** The ID of the price object. */ + public Builder setPrice(String price) { + this.price = price; + return this; + } - @Getter(onMethod_ = {@Override}) - private final String value; + /** + * Required. Controls which subscription items the billing schedule + * applies to. + */ + public Builder setType( + QuoteCreateParams.SubscriptionData.BillingSchedule.AppliesTo.Type type) { + this.type = type; + return this; + } + } - EndBehavior(String value) { - this.value = value; + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("price") + PRICE("price"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } } - } - public enum ProrationBehavior implements ApiRequestParams.EnumParam { - @SerializedName("always_invoice") - ALWAYS_INVOICE("always_invoice"), + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillFrom { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; - @SerializedName("create_prorations") - CREATE_PRORATIONS("create_prorations"), + /** Details of a Quote line to start the bill period from. */ + @SerializedName("line_starts_at") + LineStartsAt lineStartsAt; - @SerializedName("none") - NONE("none"); + /** A precise Unix timestamp. */ + @SerializedName("timestamp") + Long timestamp; - @Getter(onMethod_ = {@Override}) - private final String value; + /** Required. The type of method to specify the {@code bill_from} time. */ + @SerializedName("type") + Type type; - ProrationBehavior(String value) { - this.value = value; - } - } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class SubscriptionDataOverride { - /** - * Required. Whether the override applies to an existing Subscription Schedule - * or a new Subscription Schedule. - */ - @SerializedName("applies_to") - AppliesTo appliesTo; + private BillFrom( + Map extraParams, LineStartsAt lineStartsAt, Long timestamp, Type type) { + this.extraParams = extraParams; + this.lineStartsAt = lineStartsAt; + this.timestamp = timestamp; + this.type = type; + } - /** Describes the period to bill for upon accepting the quote. */ - @SerializedName("bill_on_acceptance") - BillOnAcceptance billOnAcceptance; + public static Builder builder() { + return new Builder(); + } - /** - * Configures when the subscription schedule generates prorations for phase transitions. - * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the - * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase - * changes and generate prorations at transition time. {@code prorate_up_front} will bill for - * all phases within the current billing cycle up front. - */ - @SerializedName("billing_behavior") - BillingBehavior billingBehavior; + public static class Builder { + private Map extraParams; - /** - * The customer the Subscription Data override applies to. This is only relevant when {@code - * applies_to.type=new_reference}. - */ - @SerializedName("customer") - String customer; + private LineStartsAt lineStartsAt; - /** - * The subscription's description, meant to be displayable to the customer. Use this field to - * optionally store an explanation of the subscription for rendering in Stripe surfaces and - * certain local payment methods UIs. - */ - @SerializedName("description") - String description; + private Long timestamp; - /** Behavior of the subscription schedule and underlying subscription when it ends. */ - @SerializedName("end_behavior") - EndBehavior endBehavior; + private Type type; - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom build() { + return new QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom( + this.extraParams, this.lineStartsAt, this.timestamp, this.type); + } - /** - * Determines how to handle prorations. When - * creating a subscription, valid values are {@code create_prorations} or {@code none}. - * - *

When updating a subscription, valid values are {@code create_prorations}, {@code none}, or - * {@code always_invoice}. - * - *

Passing {@code create_prorations} will cause proration invoice items to be created when - * applicable. These proration items will only be invoiced immediately under certain - * conditions. In order to always invoice immediately for prorations, pass {@code - * always_invoice}. - * - *

Prorations can be disabled by passing {@code none}. - */ - @SerializedName("proration_behavior") - ProrationBehavior prorationBehavior; + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } - private SubscriptionDataOverride( - AppliesTo appliesTo, - BillOnAcceptance billOnAcceptance, - BillingBehavior billingBehavior, - String customer, - String description, - EndBehavior endBehavior, - Map extraParams, - ProrationBehavior prorationBehavior) { - this.appliesTo = appliesTo; - this.billOnAcceptance = billOnAcceptance; - this.billingBehavior = billingBehavior; - this.customer = customer; - this.description = description; - this.endBehavior = endBehavior; - this.extraParams = extraParams; - this.prorationBehavior = prorationBehavior; - } + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } - public static Builder builder() { - return new Builder(); - } + /** Details of a Quote line to start the bill period from. */ + public Builder setLineStartsAt( + QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt + lineStartsAt) { + this.lineStartsAt = lineStartsAt; + return this; + } - public static class Builder { - private AppliesTo appliesTo; + /** A precise Unix timestamp. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } - private BillOnAcceptance billOnAcceptance; + /** + * Required. The type of method to specify the {@code bill_from} time. + */ + public Builder setType( + QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom.Type type) { + this.type = type; + return this; + } + } - private BillingBehavior billingBehavior; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineStartsAt { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; - private String customer; + /** The ID of a quote line. */ + @SerializedName("id") + String id; - private String description; + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the current + * line in the array. + */ + @SerializedName("index") + Long index; - private EndBehavior endBehavior; + private LineStartsAt(Map extraParams, String id, Long index) { + this.extraParams = extraParams; + this.id = id; + this.index = index; + } - private Map extraParams; + public static Builder builder() { + return new Builder(); + } - private ProrationBehavior prorationBehavior; + public static class Builder { + private Map extraParams; - /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionDataOverride build() { - return new QuoteCreateParams.SubscriptionDataOverride( - this.appliesTo, - this.billOnAcceptance, - this.billingBehavior, - this.customer, - this.description, - this.endBehavior, - this.extraParams, - this.prorationBehavior); - } + private String id; - /** - * Required. Whether the override applies to an existing Subscription - * Schedule or a new Subscription Schedule. - */ - public Builder setAppliesTo(QuoteCreateParams.SubscriptionDataOverride.AppliesTo appliesTo) { - this.appliesTo = appliesTo; - return this; - } + private Long index; - /** Describes the period to bill for upon accepting the quote. */ - public Builder setBillOnAcceptance( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance billOnAcceptance) { - this.billOnAcceptance = billOnAcceptance; - return this; - } + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt + build() { + return new QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt( + this.extraParams, this.id, this.index); + } - /** - * Configures when the subscription schedule generates prorations for phase transitions. - * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the - * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase - * changes and generate prorations at transition time. {@code prorate_up_front} will bill for - * all phases within the current billing cycle up front. - */ - public Builder setBillingBehavior( - QuoteCreateParams.SubscriptionDataOverride.BillingBehavior billingBehavior) { - this.billingBehavior = billingBehavior; - return this; - } + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } - /** - * The customer the Subscription Data override applies to. This is only relevant when {@code - * applies_to.type=new_reference}. - */ - public Builder setCustomer(String customer) { - this.customer = customer; - return this; - } - - /** - * The subscription's description, meant to be displayable to the customer. Use this field to - * optionally store an explanation of the subscription for rendering in Stripe surfaces and - * certain local payment methods UIs. - */ - public Builder setDescription(String description) { - this.description = description; - return this; - } + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } - /** Behavior of the subscription schedule and underlying subscription when it ends. */ - public Builder setEndBehavior( - QuoteCreateParams.SubscriptionDataOverride.EndBehavior endBehavior) { - this.endBehavior = endBehavior; - return this; - } + /** The ID of a quote line. */ + public Builder setId(String id) { + this.id = id; + return this; + } - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` - * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * QuoteCreateParams.SubscriptionDataOverride#extraParams} for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the + * current line in the array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } + } } - this.extraParams.put(key, value); - return this; - } - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link QuoteCreateParams.SubscriptionDataOverride#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("line_starts_at") + LINE_STARTS_AT("line_starts_at"), - /** - * Determines how to handle prorations. When - * creating a subscription, valid values are {@code create_prorations} or {@code none}. - * - *

When updating a subscription, valid values are {@code create_prorations}, {@code none}, - * or {@code always_invoice}. - * - *

Passing {@code create_prorations} will cause proration invoice items to be created when - * applicable. These proration items will only be invoiced immediately under certain - * conditions. In order to always invoice immediately for prorations, pass {@code - * always_invoice}. - * - *

Prorations can be disabled by passing {@code none}. - */ - public Builder setProrationBehavior( - QuoteCreateParams.SubscriptionDataOverride.ProrationBehavior prorationBehavior) { - this.prorationBehavior = prorationBehavior; - return this; - } - } + @SerializedName("now") + NOW("now"), - @Getter - @EqualsAndHashCode(callSuper = false) - public static class AppliesTo { - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) - * name in this param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; + @SerializedName("pause_collection_start") + PAUSE_COLLECTION_START("pause_collection_start"), - /** - * A custom string that identifies a new subscription schedule being created upon quote - * acceptance. All quote lines with the same {@code new_reference} field will be applied to - * the creation of a new subscription schedule. - */ - @SerializedName("new_reference") - String newReference; + @SerializedName("quote_acceptance_date") + QUOTE_ACCEPTANCE_DATE("quote_acceptance_date"), - /** The ID of the schedule the line applies to. */ - @SerializedName("subscription_schedule") - String subscriptionSchedule; + @SerializedName("timestamp") + TIMESTAMP("timestamp"); - /** - * Required. Describes whether the quote line is affecting a new schedule or - * an existing schedule. - */ - @SerializedName("type") - Type type; + @Getter(onMethod_ = {@Override}) + private final String value; - private AppliesTo( - Map extraParams, - String newReference, - String subscriptionSchedule, - Type type) { - this.extraParams = extraParams; - this.newReference = newReference; - this.subscriptionSchedule = subscriptionSchedule; - this.type = type; + Type(String value) { + this.value = value; + } + } } - public static Builder builder() { - return new Builder(); - } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillUntil { + /** Details of the duration over which to bill. */ + @SerializedName("duration") + Duration duration; - public static class Builder { - private Map extraParams; + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; - private String newReference; + /** Details of a Quote line item from which to bill until. */ + @SerializedName("line_ends_at") + LineEndsAt lineEndsAt; - private String subscriptionSchedule; + /** A precise Unix timestamp. */ + @SerializedName("timestamp") + Long timestamp; - private Type type; + /** Required. The type of method to specify the {@code bill_until} time. */ + @SerializedName("type") + Type type; - /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionDataOverride.AppliesTo build() { - return new QuoteCreateParams.SubscriptionDataOverride.AppliesTo( - this.extraParams, this.newReference, this.subscriptionSchedule, this.type); + private BillUntil( + Duration duration, + Map extraParams, + LineEndsAt lineEndsAt, + Long timestamp, + Type type) { + this.duration = duration; + this.extraParams = extraParams; + this.lineEndsAt = lineEndsAt; + this.timestamp = timestamp; + this.type = type; } - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteCreateParams.SubscriptionDataOverride.AppliesTo#extraParams} for the - * field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; + public static Builder builder() { + return new Builder(); } - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteCreateParams.SubscriptionDataOverride.AppliesTo#extraParams} for the - * field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + public static class Builder { + private Duration duration; + + private Map extraParams; + + private LineEndsAt lineEndsAt; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil build() { + return new QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil( + this.duration, this.extraParams, this.lineEndsAt, this.timestamp, this.type); + } + + /** Details of the duration over which to bill. */ + public Builder setDuration( + QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.Duration duration) { + this.duration = duration; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Details of a Quote line item from which to bill until. */ + public Builder setLineEndsAt( + QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt lineEndsAt) { + this.lineEndsAt = lineEndsAt; + return this; + } + + /** A precise Unix timestamp. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. The type of method to specify the {@code bill_until} time. + */ + public Builder setType( + QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Duration { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; + + /** + * Required. The number of intervals, as an whole number greater than 0. + * Stripe multiplies this by the interval type to get the overall duration. + */ + @SerializedName("interval_count") + Long intervalCount; + + private Duration(Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.Duration build() { + return new QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.Duration( + this.extraParams, this.interval, this.intervalCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.Duration#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.Duration#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + public Builder setInterval( + QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.Duration.Interval + interval) { + this.interval = interval; + return this; + } + + /** + * Required. The number of intervals, as an whole number greater than + * 0. Stripe multiplies this by the interval type to get the overall duration. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineEndsAt { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The ID of a quote line. */ + @SerializedName("id") + String id; + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the current + * line in the array. + */ + @SerializedName("index") + Long index; + + private LineEndsAt(Map extraParams, String id, Long index) { + this.extraParams = extraParams; + this.id = id; + this.index = index; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String id; + + private Long index; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt build() { + return new QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt( + this.extraParams, this.id, this.index); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The ID of a quote line. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the + * current line in the array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), + + @SerializedName("line_ends_at") + LINE_ENDS_AT("line_ends_at"), + + @SerializedName("schedule_end") + SCHEDULE_END("schedule_end"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"), + + @SerializedName("upcoming_invoice") + UPCOMING_INVOICE("upcoming_invoice"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Prebilling { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. This is used to determine the number of billing cycles to + * prebill. + */ + @SerializedName("iterations") + Long iterations; + + private Prebilling(Map extraParams, Long iterations) { + this.extraParams = extraParams; + this.iterations = iterations; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long iterations; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionData.Prebilling build() { + return new QuoteCreateParams.SubscriptionData.Prebilling( + this.extraParams, this.iterations); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteCreateParams.SubscriptionData.Prebilling#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteCreateParams.SubscriptionData.Prebilling#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. This is used to determine the number of billing cycles to + * prebill. + */ + public Builder setIterations(Long iterations) { + this.iterations = iterations; + return this; + } + } + } + + public enum BillingBehavior implements ApiRequestParams.EnumParam { + @SerializedName("prorate_on_next_phase") + PRORATE_ON_NEXT_PHASE("prorate_on_next_phase"), + + @SerializedName("prorate_up_front") + PRORATE_UP_FRONT("prorate_up_front"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + BillingBehavior(String value) { + this.value = value; + } + } + + public enum BillingCycleAnchor implements ApiRequestParams.EnumParam { + @SerializedName("reset") + RESET("reset"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + BillingCycleAnchor(String value) { + this.value = value; + } + } + + public enum EffectiveDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EffectiveDate(String value) { + this.value = value; + } + } + + public enum EndBehavior implements ApiRequestParams.EnumParam { + @SerializedName("cancel") + CANCEL("cancel"), + + @SerializedName("release") + RELEASE("release"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EndBehavior(String value) { + this.value = value; + } + } + + public enum PhaseEffectiveAt implements ApiRequestParams.EnumParam { + @SerializedName("billing_period_start") + BILLING_PERIOD_START("billing_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PhaseEffectiveAt(String value) { + this.value = value; + } + } + + public enum ProrationBehavior implements ApiRequestParams.EnumParam { + @SerializedName("always_invoice") + ALWAYS_INVOICE("always_invoice"), + + @SerializedName("create_prorations") + CREATE_PRORATIONS("create_prorations"), + + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ProrationBehavior(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SubscriptionDataOverride { + /** + * Required. Whether the override applies to an existing Subscription Schedule + * or a new Subscription Schedule. + */ + @SerializedName("applies_to") + AppliesTo appliesTo; + + /** Describes the period to bill for upon accepting the quote. */ + @SerializedName("bill_on_acceptance") + BillOnAcceptance billOnAcceptance; + + /** + * Configures when the subscription schedule generates prorations for phase transitions. + * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the + * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase + * changes and generate prorations at transition time. {@code prorate_up_front} will bill for + * all phases within the current billing cycle up front. + */ + @SerializedName("billing_behavior") + BillingBehavior billingBehavior; + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + @SerializedName("billing_schedules") + Object billingSchedules; + + /** + * The customer the Subscription Data override applies to. This is only relevant when {@code + * applies_to.type=new_reference}. + */ + @SerializedName("customer") + String customer; + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription for rendering in Stripe surfaces and + * certain local payment methods UIs. + */ + @SerializedName("description") + String description; + + /** Behavior of the subscription schedule and underlying subscription when it ends. */ + @SerializedName("end_behavior") + EndBehavior endBehavior; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Configures how the subscription schedule handles billing for phase transitions when the quote + * is accepted. Possible values are {@code phase_start} (default) or {@code + * billing_period_start}. {@code phase_start} bills based on the current state of the + * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} bills + * predictively for upcoming phase transitions within the current billing cycle, including + * pricing changes and service period adjustments that will occur before the next invoice. + */ + @SerializedName("phase_effective_at") + PhaseEffectiveAt phaseEffectiveAt; + + /** + * Determines how to handle prorations. When + * creating a subscription, valid values are {@code create_prorations} or {@code none}. + * + *

When updating a subscription, valid values are {@code create_prorations}, {@code none}, or + * {@code always_invoice}. + * + *

Passing {@code create_prorations} will cause proration invoice items to be created when + * applicable. These proration items will only be invoiced immediately under certain + * conditions. In order to always invoice immediately for prorations, pass {@code + * always_invoice}. + * + *

Prorations can be disabled by passing {@code none}. + */ + @SerializedName("proration_behavior") + ProrationBehavior prorationBehavior; + + private SubscriptionDataOverride( + AppliesTo appliesTo, + BillOnAcceptance billOnAcceptance, + BillingBehavior billingBehavior, + Object billingSchedules, + String customer, + String description, + EndBehavior endBehavior, + Map extraParams, + PhaseEffectiveAt phaseEffectiveAt, + ProrationBehavior prorationBehavior) { + this.appliesTo = appliesTo; + this.billOnAcceptance = billOnAcceptance; + this.billingBehavior = billingBehavior; + this.billingSchedules = billingSchedules; + this.customer = customer; + this.description = description; + this.endBehavior = endBehavior; + this.extraParams = extraParams; + this.phaseEffectiveAt = phaseEffectiveAt; + this.prorationBehavior = prorationBehavior; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AppliesTo appliesTo; + + private BillOnAcceptance billOnAcceptance; + + private BillingBehavior billingBehavior; + + private Object billingSchedules; + + private String customer; + + private String description; + + private EndBehavior endBehavior; + + private Map extraParams; + + private PhaseEffectiveAt phaseEffectiveAt; + + private ProrationBehavior prorationBehavior; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride build() { + return new QuoteCreateParams.SubscriptionDataOverride( + this.appliesTo, + this.billOnAcceptance, + this.billingBehavior, + this.billingSchedules, + this.customer, + this.description, + this.endBehavior, + this.extraParams, + this.phaseEffectiveAt, + this.prorationBehavior); + } + + /** + * Required. Whether the override applies to an existing Subscription + * Schedule or a new Subscription Schedule. + */ + public Builder setAppliesTo(QuoteCreateParams.SubscriptionDataOverride.AppliesTo appliesTo) { + this.appliesTo = appliesTo; + return this; + } + + /** Describes the period to bill for upon accepting the quote. */ + public Builder setBillOnAcceptance( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance billOnAcceptance) { + this.billOnAcceptance = billOnAcceptance; + return this; + } + + /** + * Configures when the subscription schedule generates prorations for phase transitions. + * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the + * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase + * changes and generate prorations at transition time. {@code prorate_up_front} will bill for + * all phases within the current billing cycle up front. + */ + public Builder setBillingBehavior( + QuoteCreateParams.SubscriptionDataOverride.BillingBehavior billingBehavior) { + this.billingBehavior = billingBehavior; + return this; + } + + /** + * Add an element to `billingSchedules` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteCreateParams.SubscriptionDataOverride#billingSchedules} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addBillingSchedule( + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule element) { + if (this.billingSchedules == null || this.billingSchedules instanceof EmptyParam) { + this.billingSchedules = + new ArrayList(); + } + ((List) this.billingSchedules) + .add(element); + return this; + } + + /** + * Add all elements to `billingSchedules` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link QuoteCreateParams.SubscriptionDataOverride#billingSchedules} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllBillingSchedule( + List elements) { + if (this.billingSchedules == null || this.billingSchedules instanceof EmptyParam) { + this.billingSchedules = + new ArrayList(); + } + ((List) this.billingSchedules) + .addAll(elements); + return this; + } + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + public Builder setBillingSchedules(EmptyParam billingSchedules) { + this.billingSchedules = billingSchedules; + return this; + } + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + public Builder setBillingSchedules( + List billingSchedules) { + this.billingSchedules = billingSchedules; + return this; + } + + /** + * The customer the Subscription Data override applies to. This is only relevant when {@code + * applies_to.type=new_reference}. + */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription for rendering in Stripe surfaces and + * certain local payment methods UIs. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** Behavior of the subscription schedule and underlying subscription when it ends. */ + public Builder setEndBehavior( + QuoteCreateParams.SubscriptionDataOverride.EndBehavior endBehavior) { + this.endBehavior = endBehavior; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * QuoteCreateParams.SubscriptionDataOverride#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link QuoteCreateParams.SubscriptionDataOverride#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Configures how the subscription schedule handles billing for phase transitions when the + * quote is accepted. Possible values are {@code phase_start} (default) or {@code + * billing_period_start}. {@code phase_start} bills based on the current state of the + * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} + * bills predictively for upcoming phase transitions within the current billing cycle, + * including pricing changes and service period adjustments that will occur before the next + * invoice. + */ + public Builder setPhaseEffectiveAt( + QuoteCreateParams.SubscriptionDataOverride.PhaseEffectiveAt phaseEffectiveAt) { + this.phaseEffectiveAt = phaseEffectiveAt; + return this; + } + + /** + * Determines how to handle prorations. When + * creating a subscription, valid values are {@code create_prorations} or {@code none}. + * + *

When updating a subscription, valid values are {@code create_prorations}, {@code none}, + * or {@code always_invoice}. + * + *

Passing {@code create_prorations} will cause proration invoice items to be created when + * applicable. These proration items will only be invoiced immediately under certain + * conditions. In order to always invoice immediately for prorations, pass {@code + * always_invoice}. + * + *

Prorations can be disabled by passing {@code none}. + */ + public Builder setProrationBehavior( + QuoteCreateParams.SubscriptionDataOverride.ProrationBehavior prorationBehavior) { + this.prorationBehavior = prorationBehavior; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AppliesTo { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A custom string that identifies a new subscription schedule being created upon quote + * acceptance. All quote lines with the same {@code new_reference} field will be applied to + * the creation of a new subscription schedule. + */ + @SerializedName("new_reference") + String newReference; + + /** The ID of the schedule the line applies to. */ + @SerializedName("subscription_schedule") + String subscriptionSchedule; + + /** + * Required. Describes whether the quote line is affecting a new schedule or + * an existing schedule. + */ + @SerializedName("type") + Type type; + + private AppliesTo( + Map extraParams, + String newReference, + String subscriptionSchedule, + Type type) { + this.extraParams = extraParams; + this.newReference = newReference; + this.subscriptionSchedule = subscriptionSchedule; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String newReference; + + private String subscriptionSchedule; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride.AppliesTo build() { + return new QuoteCreateParams.SubscriptionDataOverride.AppliesTo( + this.extraParams, this.newReference, this.subscriptionSchedule, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteCreateParams.SubscriptionDataOverride.AppliesTo#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteCreateParams.SubscriptionDataOverride.AppliesTo#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A custom string that identifies a new subscription schedule being created upon quote + * acceptance. All quote lines with the same {@code new_reference} field will be applied to + * the creation of a new subscription schedule. + */ + public Builder setNewReference(String newReference) { + this.newReference = newReference; + return this; + } + + /** The ID of the schedule the line applies to. */ + public Builder setSubscriptionSchedule(String subscriptionSchedule) { + this.subscriptionSchedule = subscriptionSchedule; + return this; + } + + /** + * Required. Describes whether the quote line is affecting a new schedule + * or an existing schedule. + */ + public Builder setType(QuoteCreateParams.SubscriptionDataOverride.AppliesTo.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("new_reference") + NEW_REFERENCE("new_reference"), + + @SerializedName("subscription_schedule") + SUBSCRIPTION_SCHEDULE("subscription_schedule"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillOnAcceptance { + /** The start of the period to bill from when the Quote is accepted. */ + @SerializedName("bill_from") + BillFrom billFrom; + + /** The end of the period to bill until when the Quote is accepted. */ + @SerializedName("bill_until") + BillUntil billUntil; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private BillOnAcceptance( + BillFrom billFrom, BillUntil billUntil, Map extraParams) { + this.billFrom = billFrom; + this.billUntil = billUntil; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillFrom billFrom; + + private BillUntil billUntil; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance( + this.billFrom, this.billUntil, this.extraParams); + } + + /** The start of the period to bill from when the Quote is accepted. */ + public Builder setBillFrom( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom billFrom) { + this.billFrom = billFrom; + return this; + } + + /** The end of the period to bill until when the Quote is accepted. */ + public Builder setBillUntil( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil billUntil) { + this.billUntil = billUntil; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillFrom { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Details of a Quote line to start the bill period from. */ + @SerializedName("line_starts_at") + LineStartsAt lineStartsAt; + + /** A precise Unix timestamp. */ + @SerializedName("timestamp") + Long timestamp; + + /** Required. The type of method to specify the {@code bill_from} time. */ + @SerializedName("type") + Type type; + + private BillFrom( + Map extraParams, LineStartsAt lineStartsAt, Long timestamp, Type type) { + this.extraParams = extraParams; + this.lineStartsAt = lineStartsAt; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private LineStartsAt lineStartsAt; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom( + this.extraParams, this.lineStartsAt, this.timestamp, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Details of a Quote line to start the bill period from. */ + public Builder setLineStartsAt( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt + lineStartsAt) { + this.lineStartsAt = lineStartsAt; + return this; + } + + /** A precise Unix timestamp. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. The type of method to specify the {@code bill_from} time. + */ + public Builder setType( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineStartsAt { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The ID of a quote line. */ + @SerializedName("id") + String id; + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the current + * line in the array. + */ + @SerializedName("index") + Long index; + + private LineStartsAt(Map extraParams, String id, Long index) { + this.extraParams = extraParams; + this.id = id; + this.index = index; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String id; + + private Long index; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt + build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom + .LineStartsAt(this.extraParams, this.id, this.index); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The ID of a quote line. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the + * current line in the array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("line_starts_at") + LINE_STARTS_AT("line_starts_at"), + + @SerializedName("now") + NOW("now"), + + @SerializedName("pause_collection_start") + PAUSE_COLLECTION_START("pause_collection_start"), + + @SerializedName("quote_acceptance_date") + QUOTE_ACCEPTANCE_DATE("quote_acceptance_date"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillUntil { + /** Details of the duration over which to bill. */ + @SerializedName("duration") + Duration duration; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Details of a Quote line item from which to bill until. */ + @SerializedName("line_ends_at") + LineEndsAt lineEndsAt; + + /** A precise Unix timestamp. */ + @SerializedName("timestamp") + Long timestamp; + + /** Required. The type of method to specify the {@code bill_until} time. */ + @SerializedName("type") + Type type; + + private BillUntil( + Duration duration, + Map extraParams, + LineEndsAt lineEndsAt, + Long timestamp, + Type type) { + this.duration = duration; + this.extraParams = extraParams; + this.lineEndsAt = lineEndsAt; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Duration duration; + + private Map extraParams; + + private LineEndsAt lineEndsAt; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil( + this.duration, this.extraParams, this.lineEndsAt, this.timestamp, this.type); + } + + /** Details of the duration over which to bill. */ + public Builder setDuration( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + duration) { + this.duration = duration; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Details of a Quote line item from which to bill until. */ + public Builder setLineEndsAt( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt + lineEndsAt) { + this.lineEndsAt = lineEndsAt; + return this; + } + + /** A precise Unix timestamp. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. The type of method to specify the {@code bill_until} time. + */ + public Builder setType( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Duration { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; + + /** + * Required. The number of intervals, as an whole number greater than 0. + * Stripe multiplies this by the interval type to get the overall duration. + */ + @SerializedName("interval_count") + Long intervalCount; + + private Duration(Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil + .Duration(this.extraParams, this.interval, this.intervalCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + public Builder setInterval( + QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + .Interval + interval) { + this.interval = interval; + return this; + } + + /** + * Required. The number of intervals, as an whole number greater than + * 0. Stripe multiplies this by the interval type to get the overall duration. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineEndsAt { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The ID of a quote line. */ + @SerializedName("id") + String id; + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the current + * line in the array. + */ + @SerializedName("index") + Long index; + + private LineEndsAt(Map extraParams, String id, Long index) { + this.extraParams = extraParams; + this.id = id; + this.index = index; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String id; + + private Long index; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt + build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil + .LineEndsAt(this.extraParams, this.id, this.index); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The ID of a quote line. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the + * current line in the array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } } - this.extraParams.putAll(map); - return this; } - /** - * A custom string that identifies a new subscription schedule being created upon quote - * acceptance. All quote lines with the same {@code new_reference} field will be applied to - * the creation of a new subscription schedule. - */ - public Builder setNewReference(String newReference) { - this.newReference = newReference; - return this; - } + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), - /** The ID of the schedule the line applies to. */ - public Builder setSubscriptionSchedule(String subscriptionSchedule) { - this.subscriptionSchedule = subscriptionSchedule; - return this; - } + @SerializedName("line_ends_at") + LINE_ENDS_AT("line_ends_at"), - /** - * Required. Describes whether the quote line is affecting a new schedule - * or an existing schedule. - */ - public Builder setType(QuoteCreateParams.SubscriptionDataOverride.AppliesTo.Type type) { - this.type = type; - return this; - } - } + @SerializedName("schedule_end") + SCHEDULE_END("schedule_end"), - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("new_reference") - NEW_REFERENCE("new_reference"), + @SerializedName("timestamp") + TIMESTAMP("timestamp"), - @SerializedName("subscription_schedule") - SUBSCRIPTION_SCHEDULE("subscription_schedule"); + @SerializedName("upcoming_invoice") + UPCOMING_INVOICE("upcoming_invoice"); - @Getter(onMethod_ = {@Override}) - private final String value; + @Getter(onMethod_ = {@Override}) + private final String value; - Type(String value) { - this.value = value; + Type(String value) { + this.value = value; + } } } } @Getter @EqualsAndHashCode(callSuper = false) - public static class BillOnAcceptance { - /** The start of the period to bill from when the Quote is accepted. */ + public static class BillingSchedule { + /** Configure billing schedule differently for individual subscription items. */ + @SerializedName("applies_to") + List appliesTo; + + /** + * Required. The start of the period to bill from when the Quote is accepted. + */ @SerializedName("bill_from") BillFrom billFrom; - /** The end of the period to bill until when the Quote is accepted. */ + /** + * Required. The end of the period to bill until when the Quote is accepted. + */ @SerializedName("bill_until") BillUntil billUntil; @@ -8281,11 +10045,24 @@ public static class BillOnAcceptance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private BillOnAcceptance( - BillFrom billFrom, BillUntil billUntil, Map extraParams) { + /** + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and up + * to 200 characters. If not provided, a unique key will be generated. + */ + @SerializedName("key") + String key; + + private BillingSchedule( + List appliesTo, + BillFrom billFrom, + BillUntil billUntil, + Map extraParams, + String key) { + this.appliesTo = appliesTo; this.billFrom = billFrom; this.billUntil = billUntil; this.extraParams = extraParams; + this.key = key; } public static Builder builder() { @@ -8293,28 +10070,69 @@ public static Builder builder() { } public static class Builder { + private List + appliesTo; + private BillFrom billFrom; private BillUntil billUntil; private Map extraParams; + private String key; + /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance build() { - return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance( - this.billFrom, this.billUntil, this.extraParams); + public QuoteCreateParams.SubscriptionDataOverride.BillingSchedule build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillingSchedule( + this.appliesTo, this.billFrom, this.billUntil, this.extraParams, this.key); } - /** The start of the period to bill from when the Quote is accepted. */ + /** + * Add an element to `appliesTo` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule#appliesTo} for the field + * documentation. + */ + public Builder addAppliesTo( + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo element) { + if (this.appliesTo == null) { + this.appliesTo = new ArrayList<>(); + } + this.appliesTo.add(element); + return this; + } + + /** + * Add all elements to `appliesTo` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule#appliesTo} for the field + * documentation. + */ + public Builder addAllAppliesTo( + List elements) { + if (this.appliesTo == null) { + this.appliesTo = new ArrayList<>(); + } + this.appliesTo.addAll(elements); + return this; + } + + /** + * Required. The start of the period to bill from when the Quote is + * accepted. + */ public Builder setBillFrom( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom billFrom) { + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom billFrom) { this.billFrom = billFrom; return this; } - /** The end of the period to bill until when the Quote is accepted. */ + /** + * Required. The end of the period to bill until when the Quote is + * accepted. + */ public Builder setBillUntil( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil billUntil) { + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil billUntil) { this.billUntil = billUntil; return this; } @@ -8322,7 +10140,7 @@ public Builder setBillUntil( /** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance#extraParams} + * map. See {@link QuoteCreateParams.SubscriptionDataOverride.BillingSchedule#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8336,7 +10154,7 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance#extraParams} + * map. See {@link QuoteCreateParams.SubscriptionDataOverride.BillingSchedule#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8346,6 +10164,122 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and + * up to 200 characters. If not provided, a unique key will be generated. + */ + public Builder setKey(String key) { + this.key = key; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AppliesTo { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The ID of the price object. */ + @SerializedName("price") + String price; + + /** + * Required. Controls which subscription items the billing schedule applies + * to. + */ + @SerializedName("type") + Type type; + + private AppliesTo(Map extraParams, String price, Type type) { + this.extraParams = extraParams; + this.price = price; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String price; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo( + this.extraParams, this.price, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The ID of the price object. */ + public Builder setPrice(String price) { + this.price = price; + return this; + } + + /** + * Required. Controls which subscription items the billing schedule + * applies to. + */ + public Builder setType( + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("price") + PRICE("price"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } } @Getter @@ -8395,8 +10329,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom build() { - return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom( + public QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom( this.extraParams, this.lineStartsAt, this.timestamp, this.type); } @@ -8404,7 +10338,7 @@ public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom buil * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom#extraParams} for + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom#extraParams} for * the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8419,7 +10353,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom#extraParams} for + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom#extraParams} for * the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8432,7 +10366,7 @@ public Builder putAllExtraParam(Map map) { /** Details of a Quote line to start the bill period from. */ public Builder setLineStartsAt( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.LineStartsAt lineStartsAt) { this.lineStartsAt = lineStartsAt; return this; @@ -8448,7 +10382,7 @@ public Builder setTimestamp(Long timestamp) { * Required. The type of method to specify the {@code bill_from} time. */ public Builder setType( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.Type type) { + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.Type type) { this.type = type; return this; } @@ -8497,9 +10431,9 @@ public static class Builder { private Long index; /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt + public QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.LineStartsAt build() { - return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom + return new QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom .LineStartsAt(this.extraParams, this.id, this.index); } @@ -8507,7 +10441,7 @@ public static class Builder { * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt#extraParams} + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.LineStartsAt#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8522,7 +10456,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt#extraParams} + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.LineStartsAt#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8634,14 +10568,14 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil build() { - return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil( + public QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil build() { + return new QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil( this.duration, this.extraParams, this.lineEndsAt, this.timestamp, this.type); } /** Details of the duration over which to bill. */ public Builder setDuration( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration duration) { this.duration = duration; return this; @@ -8651,7 +10585,7 @@ public Builder setDuration( * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil#extraParams} for + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil#extraParams} for * the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8666,7 +10600,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil#extraParams} for + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil#extraParams} for * the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8679,7 +10613,7 @@ public Builder putAllExtraParam(Map map) { /** Details of a Quote line item from which to bill until. */ public Builder setLineEndsAt( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.LineEndsAt lineEndsAt) { this.lineEndsAt = lineEndsAt; return this; @@ -8695,7 +10629,7 @@ public Builder setTimestamp(Long timestamp) { * Required. The type of method to specify the {@code bill_until} time. */ public Builder setType( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Type type) { + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Type type) { this.type = type; return this; } @@ -8746,9 +10680,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + public QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration build() { - return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil + return new QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil .Duration(this.extraParams, this.interval, this.intervalCount); } @@ -8756,7 +10690,7 @@ public static class Builder { * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration#extraParams} + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8771,7 +10705,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration#extraParams} + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8787,7 +10721,7 @@ public Builder putAllExtraParam(Map map) { * {@code week}, {@code month} or {@code year}. */ public Builder setInterval( - QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration .Interval interval) { this.interval = interval; @@ -8869,9 +10803,9 @@ public static class Builder { private Long index; /** Finalize and obtain parameter instance from this builder. */ - public QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt + public QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.LineEndsAt build() { - return new QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil + return new QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil .LineEndsAt(this.extraParams, this.id, this.index); } @@ -8879,7 +10813,7 @@ public static class Builder { * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt#extraParams} + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.LineEndsAt#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8894,7 +10828,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteCreateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt#extraParams} + * QuoteCreateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.LineEndsAt#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8979,6 +10913,21 @@ public enum EndBehavior implements ApiRequestParams.EnumParam { } } + public enum PhaseEffectiveAt implements ApiRequestParams.EnumParam { + @SerializedName("billing_period_start") + BILLING_PERIOD_START("billing_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PhaseEffectiveAt(String value) { + this.value = value; + } + } + public enum ProrationBehavior implements ApiRequestParams.EnumParam { @SerializedName("always_invoice") ALWAYS_INVOICE("always_invoice"), diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index 19e831f3621..e5d0bb67025 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -6642,6 +6642,13 @@ public static class SubscriptionData { @SerializedName("billing_cycle_anchor") ApiRequestParams.EnumParam billingCycleAnchor; + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + @SerializedName("billing_schedules") + Object billingSchedules; + /** * The subscription's description, meant to be displayable to the customer. Use this field to * optionally store an explanation of the subscription for rendering in Stripe surfaces and @@ -6685,6 +6692,17 @@ public static class SubscriptionData { @SerializedName("metadata") Map metadata; + /** + * Configures how the subscription schedule handles billing for phase transitions when the quote + * is accepted. Possible values are {@code phase_start} (default) or {@code + * billing_period_start}. {@code phase_start} bills based on the current state of the + * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} bills + * predictively for upcoming phase transitions within the current billing cycle, including + * pricing changes and service period adjustments that will occur before the next invoice. + */ + @SerializedName("phase_effective_at") + PhaseEffectiveAt phaseEffectiveAt; + /** * If specified, the invoicing for the given billing cycle iterations will be processed when the * quote is accepted. Cannot be used with {@code effective_date}. @@ -6722,22 +6740,26 @@ private SubscriptionData( Object billOnAcceptance, BillingBehavior billingBehavior, ApiRequestParams.EnumParam billingCycleAnchor, + Object billingSchedules, Object description, Object effectiveDate, EndBehavior endBehavior, Map extraParams, Map metadata, + PhaseEffectiveAt phaseEffectiveAt, Object prebilling, ProrationBehavior prorationBehavior, Object trialPeriodDays) { this.billOnAcceptance = billOnAcceptance; this.billingBehavior = billingBehavior; this.billingCycleAnchor = billingCycleAnchor; + this.billingSchedules = billingSchedules; this.description = description; this.effectiveDate = effectiveDate; this.endBehavior = endBehavior; this.extraParams = extraParams; this.metadata = metadata; + this.phaseEffectiveAt = phaseEffectiveAt; this.prebilling = prebilling; this.prorationBehavior = prorationBehavior; this.trialPeriodDays = trialPeriodDays; @@ -6754,6 +6776,8 @@ public static class Builder { private ApiRequestParams.EnumParam billingCycleAnchor; + private Object billingSchedules; + private Object description; private Object effectiveDate; @@ -6764,6 +6788,8 @@ public static class Builder { private Map metadata; + private PhaseEffectiveAt phaseEffectiveAt; + private Object prebilling; private ProrationBehavior prorationBehavior; @@ -6776,11 +6802,13 @@ public QuoteUpdateParams.SubscriptionData build() { this.billOnAcceptance, this.billingBehavior, this.billingCycleAnchor, + this.billingSchedules, this.description, this.effectiveDate, this.endBehavior, this.extraParams, this.metadata, + this.phaseEffectiveAt, this.prebilling, this.prorationBehavior, this.trialPeriodDays); @@ -6831,6 +6859,59 @@ public Builder setBillingCycleAnchor(EmptyParam billingCycleAnchor) { return this; } + /** + * Add an element to `billingSchedules` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteUpdateParams.SubscriptionData#billingSchedules} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addBillingSchedule( + QuoteUpdateParams.SubscriptionData.BillingSchedule element) { + if (this.billingSchedules == null || this.billingSchedules instanceof EmptyParam) { + this.billingSchedules = + new ArrayList(); + } + ((List) this.billingSchedules) + .add(element); + return this; + } + + /** + * Add all elements to `billingSchedules` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link QuoteUpdateParams.SubscriptionData#billingSchedules} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllBillingSchedule( + List elements) { + if (this.billingSchedules == null || this.billingSchedules instanceof EmptyParam) { + this.billingSchedules = + new ArrayList(); + } + ((List) this.billingSchedules) + .addAll(elements); + return this; + } + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + public Builder setBillingSchedules(EmptyParam billingSchedules) { + this.billingSchedules = billingSchedules; + return this; + } + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + public Builder setBillingSchedules( + List billingSchedules) { + this.billingSchedules = billingSchedules; + return this; + } + /** * The subscription's description, meant to be displayable to the customer. Use this field to * optionally store an explanation of the subscription for rendering in Stripe surfaces and @@ -6949,6 +7030,21 @@ public Builder putAllMetadata(Map map) { return this; } + /** + * Configures how the subscription schedule handles billing for phase transitions when the + * quote is accepted. Possible values are {@code phase_start} (default) or {@code + * billing_period_start}. {@code phase_start} bills based on the current state of the + * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} + * bills predictively for upcoming phase transitions within the current billing cycle, + * including pricing changes and service period adjustments that will occur before the next + * invoice. + */ + public Builder setPhaseEffectiveAt( + QuoteUpdateParams.SubscriptionData.PhaseEffectiveAt phaseEffectiveAt) { + this.phaseEffectiveAt = phaseEffectiveAt; + return this; + } + /** * If specified, the invoicing for the given billing cycle iterations will be processed when * the quote is accepted. Cannot be used with {@code effective_date}. @@ -7706,7 +7802,19 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Prebilling { + public static class BillingSchedule { + /** Configure billing schedule differently for individual subscription items. */ + @SerializedName("applies_to") + List appliesTo; + + /** The start of the period to bill from when the Quote is accepted. */ + @SerializedName("bill_from") + BillFrom billFrom; + + /** The end of the period to bill until when the Quote is accepted. */ + @SerializedName("bill_until") + BillUntil billUntil; + /** * Map of extra parameters for custom features not available in this client library. The * content in this map is not serialized under this field's {@code @SerializedName} value. @@ -7717,15 +7825,23 @@ public static class Prebilling { Map extraParams; /** - * Required. This is used to determine the number of billing cycles to - * prebill. + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and up + * to 200 characters. If not provided, a unique key will be generated. */ - @SerializedName("iterations") - Long iterations; + @SerializedName("key") + Object key; - private Prebilling(Map extraParams, Long iterations) { + private BillingSchedule( + List appliesTo, + BillFrom billFrom, + BillUntil billUntil, + Map extraParams, + Object key) { + this.appliesTo = appliesTo; + this.billFrom = billFrom; + this.billUntil = billUntil; this.extraParams = extraParams; - this.iterations = iterations; + this.key = key; } public static Builder builder() { @@ -7733,21 +7849,71 @@ public static Builder builder() { } public static class Builder { + private List appliesTo; + + private BillFrom billFrom; + + private BillUntil billUntil; + private Map extraParams; - private Long iterations; + private Object key; /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionData.Prebilling build() { - return new QuoteUpdateParams.SubscriptionData.Prebilling( - this.extraParams, this.iterations); + public QuoteUpdateParams.SubscriptionData.BillingSchedule build() { + return new QuoteUpdateParams.SubscriptionData.BillingSchedule( + this.appliesTo, this.billFrom, this.billUntil, this.extraParams, this.key); + } + + /** + * Add an element to `appliesTo` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule#appliesTo} for the field + * documentation. + */ + public Builder addAppliesTo( + QuoteUpdateParams.SubscriptionData.BillingSchedule.AppliesTo element) { + if (this.appliesTo == null) { + this.appliesTo = new ArrayList<>(); + } + this.appliesTo.add(element); + return this; + } + + /** + * Add all elements to `appliesTo` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule#appliesTo} for the field + * documentation. + */ + public Builder addAllAppliesTo( + List elements) { + if (this.appliesTo == null) { + this.appliesTo = new ArrayList<>(); + } + this.appliesTo.addAll(elements); + return this; + } + + /** The start of the period to bill from when the Quote is accepted. */ + public Builder setBillFrom( + QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom billFrom) { + this.billFrom = billFrom; + return this; + } + + /** The end of the period to bill until when the Quote is accepted. */ + public Builder setBillUntil( + QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil billUntil) { + this.billUntil = billUntil; + return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteUpdateParams.SubscriptionData.Prebilling#extraParams} for the field - * documentation. + * map. See {@link QuoteUpdateParams.SubscriptionData.BillingSchedule#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -7760,8 +7926,8 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteUpdateParams.SubscriptionData.Prebilling#extraParams} for the field - * documentation. + * map. See {@link QuoteUpdateParams.SubscriptionData.BillingSchedule#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -7772,484 +7938,2107 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. This is used to determine the number of billing cycles to - * prebill. + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and + * up to 200 characters. If not provided, a unique key will be generated. */ - public Builder setIterations(Long iterations) { - this.iterations = iterations; + public Builder setKey(String key) { + this.key = key; return this; } - } - } - - public enum BillingBehavior implements ApiRequestParams.EnumParam { - @SerializedName("prorate_on_next_phase") - PRORATE_ON_NEXT_PHASE("prorate_on_next_phase"), - @SerializedName("prorate_up_front") - PRORATE_UP_FRONT("prorate_up_front"); + /** + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and + * up to 200 characters. If not provided, a unique key will be generated. + */ + public Builder setKey(EmptyParam key) { + this.key = key; + return this; + } + } - @Getter(onMethod_ = {@Override}) - private final String value; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AppliesTo { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; - BillingBehavior(String value) { - this.value = value; - } - } + /** The ID of the price object. */ + @SerializedName("price") + Object price; - public enum BillingCycleAnchor implements ApiRequestParams.EnumParam { - @SerializedName("reset") - RESET("reset"); + /** + * Required. Controls which subscription items the billing schedule applies + * to. + */ + @SerializedName("type") + Type type; - @Getter(onMethod_ = {@Override}) - private final String value; + private AppliesTo(Map extraParams, Object price, Type type) { + this.extraParams = extraParams; + this.price = price; + this.type = type; + } - BillingCycleAnchor(String value) { - this.value = value; - } - } + public static Builder builder() { + return new Builder(); + } - public enum EffectiveDate implements ApiRequestParams.EnumParam { - @SerializedName("current_period_end") - CURRENT_PERIOD_END("current_period_end"); + public static class Builder { + private Map extraParams; - @Getter(onMethod_ = {@Override}) - private final String value; + private Object price; - EffectiveDate(String value) { - this.value = value; - } - } + private Type type; - public enum EndBehavior implements ApiRequestParams.EnumParam { - @SerializedName("cancel") - CANCEL("cancel"), + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionData.BillingSchedule.AppliesTo build() { + return new QuoteUpdateParams.SubscriptionData.BillingSchedule.AppliesTo( + this.extraParams, this.price, this.type); + } - @SerializedName("release") - RELEASE("release"); + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.AppliesTo#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } - @Getter(onMethod_ = {@Override}) - private final String value; + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.AppliesTo#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } - EndBehavior(String value) { - this.value = value; - } - } + /** The ID of the price object. */ + public Builder setPrice(String price) { + this.price = price; + return this; + } - public enum ProrationBehavior implements ApiRequestParams.EnumParam { - @SerializedName("always_invoice") - ALWAYS_INVOICE("always_invoice"), + /** The ID of the price object. */ + public Builder setPrice(EmptyParam price) { + this.price = price; + return this; + } - @SerializedName("create_prorations") - CREATE_PRORATIONS("create_prorations"), + /** + * Required. Controls which subscription items the billing schedule + * applies to. + */ + public Builder setType( + QuoteUpdateParams.SubscriptionData.BillingSchedule.AppliesTo.Type type) { + this.type = type; + return this; + } + } - @SerializedName("none") - NONE("none"); + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("price") + PRICE("price"); - @Getter(onMethod_ = {@Override}) - private final String value; + @Getter(onMethod_ = {@Override}) + private final String value; - ProrationBehavior(String value) { - this.value = value; + Type(String value) { + this.value = value; + } + } } - } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class SubscriptionDataOverride { - /** - * Required. Whether the override applies to an existing Subscription Schedule - * or a new Subscription Schedule. - */ - @SerializedName("applies_to") - AppliesTo appliesTo; - /** Describes the period to bill for upon accepting the quote. */ - @SerializedName("bill_on_acceptance") - Object billOnAcceptance; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillFrom { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; - /** - * Configures when the subscription schedule generates prorations for phase transitions. - * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the - * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase - * changes and generate prorations at transition time. {@code prorate_up_front} will bill for - * all phases within the current billing cycle up front. - */ - @SerializedName("billing_behavior") - BillingBehavior billingBehavior; + /** Details of a Quote line to start the bill period from. */ + @SerializedName("line_starts_at") + LineStartsAt lineStartsAt; - /** The customer the Subscription Data override applies to. */ - @SerializedName("customer") - Object customer; + /** A precise Unix timestamp. */ + @SerializedName("timestamp") + Long timestamp; - /** - * The subscription's description, meant to be displayable to the customer. Use this field to - * optionally store an explanation of the subscription for rendering in Stripe surfaces and - * certain local payment methods UIs. - */ - @SerializedName("description") - Object description; + /** Required. The type of method to specify the {@code bill_from} time. */ + @SerializedName("type") + Type type; - /** Behavior of the subscription schedule and underlying subscription when it ends. */ - @SerializedName("end_behavior") - EndBehavior endBehavior; + private BillFrom( + Map extraParams, LineStartsAt lineStartsAt, Long timestamp, Type type) { + this.extraParams = extraParams; + this.lineStartsAt = lineStartsAt; + this.timestamp = timestamp; + this.type = type; + } - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; + public static Builder builder() { + return new Builder(); + } - /** - * Determines how to handle prorations. When - * creating a subscription, valid values are {@code create_prorations} or {@code none}. - * - *

When updating a subscription, valid values are {@code create_prorations}, {@code none}, or - * {@code always_invoice}. - * - *

Passing {@code create_prorations} will cause proration invoice items to be created when - * applicable. These proration items will only be invoiced immediately under certain - * conditions. In order to always invoice immediately for prorations, pass {@code - * always_invoice}. - * - *

Prorations can be disabled by passing {@code none}. - */ - @SerializedName("proration_behavior") - ProrationBehavior prorationBehavior; + public static class Builder { + private Map extraParams; - private SubscriptionDataOverride( - AppliesTo appliesTo, - Object billOnAcceptance, - BillingBehavior billingBehavior, - Object customer, - Object description, - EndBehavior endBehavior, - Map extraParams, - ProrationBehavior prorationBehavior) { - this.appliesTo = appliesTo; - this.billOnAcceptance = billOnAcceptance; - this.billingBehavior = billingBehavior; - this.customer = customer; - this.description = description; - this.endBehavior = endBehavior; - this.extraParams = extraParams; - this.prorationBehavior = prorationBehavior; - } + private LineStartsAt lineStartsAt; - public static Builder builder() { - return new Builder(); - } + private Long timestamp; - public static class Builder { - private AppliesTo appliesTo; + private Type type; - private Object billOnAcceptance; + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom build() { + return new QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom( + this.extraParams, this.lineStartsAt, this.timestamp, this.type); + } - private BillingBehavior billingBehavior; + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } - private Object customer; + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } - private Object description; + /** Details of a Quote line to start the bill period from. */ + public Builder setLineStartsAt( + QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt + lineStartsAt) { + this.lineStartsAt = lineStartsAt; + return this; + } - private EndBehavior endBehavior; + /** A precise Unix timestamp. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } - private Map extraParams; + /** + * Required. The type of method to specify the {@code bill_from} time. + */ + public Builder setType( + QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom.Type type) { + this.type = type; + return this; + } + } - private ProrationBehavior prorationBehavior; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineStartsAt { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; - /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionDataOverride build() { - return new QuoteUpdateParams.SubscriptionDataOverride( - this.appliesTo, - this.billOnAcceptance, - this.billingBehavior, - this.customer, - this.description, - this.endBehavior, - this.extraParams, - this.prorationBehavior); - } + /** The ID of a quote line. */ + @SerializedName("id") + Object id; - /** - * Required. Whether the override applies to an existing Subscription - * Schedule or a new Subscription Schedule. - */ - public Builder setAppliesTo(QuoteUpdateParams.SubscriptionDataOverride.AppliesTo appliesTo) { - this.appliesTo = appliesTo; - return this; - } + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the current + * line in the array. + */ + @SerializedName("index") + Long index; - /** Describes the period to bill for upon accepting the quote. */ - public Builder setBillOnAcceptance( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance billOnAcceptance) { - this.billOnAcceptance = billOnAcceptance; - return this; - } + private LineStartsAt(Map extraParams, Object id, Long index) { + this.extraParams = extraParams; + this.id = id; + this.index = index; + } - /** Describes the period to bill for upon accepting the quote. */ - public Builder setBillOnAcceptance(EmptyParam billOnAcceptance) { - this.billOnAcceptance = billOnAcceptance; - return this; - } + public static Builder builder() { + return new Builder(); + } - /** - * Configures when the subscription schedule generates prorations for phase transitions. - * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the - * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase - * changes and generate prorations at transition time. {@code prorate_up_front} will bill for - * all phases within the current billing cycle up front. - */ - public Builder setBillingBehavior( - QuoteUpdateParams.SubscriptionDataOverride.BillingBehavior billingBehavior) { - this.billingBehavior = billingBehavior; - return this; - } + public static class Builder { + private Map extraParams; - /** The customer the Subscription Data override applies to. */ - public Builder setCustomer(String customer) { - this.customer = customer; - return this; - } + private Object id; - /** The customer the Subscription Data override applies to. */ - public Builder setCustomer(EmptyParam customer) { - this.customer = customer; - return this; - } + private Long index; - /** - * The subscription's description, meant to be displayable to the customer. Use this field to - * optionally store an explanation of the subscription for rendering in Stripe surfaces and - * certain local payment methods UIs. - */ - public Builder setDescription(String description) { - this.description = description; - return this; - } + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt + build() { + return new QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt( + this.extraParams, this.id, this.index); + } - /** - * The subscription's description, meant to be displayable to the customer. Use this field to - * optionally store an explanation of the subscription for rendering in Stripe surfaces and - * certain local payment methods UIs. - */ - public Builder setDescription(EmptyParam description) { - this.description = description; - return this; - } + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } - /** Behavior of the subscription schedule and underlying subscription when it ends. */ - public Builder setEndBehavior( - QuoteUpdateParams.SubscriptionDataOverride.EndBehavior endBehavior) { - this.endBehavior = endBehavior; - return this; - } + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillFrom.LineStartsAt#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` - * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride#extraParams} for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } + /** The ID of a quote line. */ + public Builder setId(String id) { + this.id = id; + return this; + } - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link QuoteUpdateParams.SubscriptionDataOverride#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + /** The ID of a quote line. */ + public Builder setId(EmptyParam id) { + this.id = id; + return this; + } + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the + * current line in the array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } + } } - this.extraParams.putAll(map); - return this; - } - /** - * Determines how to handle prorations. When - * creating a subscription, valid values are {@code create_prorations} or {@code none}. - * - *

When updating a subscription, valid values are {@code create_prorations}, {@code none}, - * or {@code always_invoice}. - * - *

Passing {@code create_prorations} will cause proration invoice items to be created when - * applicable. These proration items will only be invoiced immediately under certain - * conditions. In order to always invoice immediately for prorations, pass {@code - * always_invoice}. - * - *

Prorations can be disabled by passing {@code none}. - */ - public Builder setProrationBehavior( - QuoteUpdateParams.SubscriptionDataOverride.ProrationBehavior prorationBehavior) { - this.prorationBehavior = prorationBehavior; - return this; - } - } + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("line_starts_at") + LINE_STARTS_AT("line_starts_at"), - @Getter - @EqualsAndHashCode(callSuper = false) - public static class AppliesTo { - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) - * name in this param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; + @SerializedName("now") + NOW("now"), - /** - * A custom string that identifies a new subscription schedule being created upon quote - * acceptance. All quote lines with the same {@code new_reference} field will be applied to - * the creation of a new subscription schedule. - */ - @SerializedName("new_reference") - Object newReference; + @SerializedName("pause_collection_start") + PAUSE_COLLECTION_START("pause_collection_start"), - /** The ID of the schedule the line applies to. */ - @SerializedName("subscription_schedule") - Object subscriptionSchedule; + @SerializedName("quote_acceptance_date") + QUOTE_ACCEPTANCE_DATE("quote_acceptance_date"), - /** - * Required. Describes whether the quote line is affecting a new schedule or - * an existing schedule. - */ - @SerializedName("type") - Type type; + @SerializedName("timestamp") + TIMESTAMP("timestamp"); - private AppliesTo( - Map extraParams, - Object newReference, - Object subscriptionSchedule, - Type type) { - this.extraParams = extraParams; - this.newReference = newReference; - this.subscriptionSchedule = subscriptionSchedule; - this.type = type; - } + @Getter(onMethod_ = {@Override}) + private final String value; - public static Builder builder() { - return new Builder(); + Type(String value) { + this.value = value; + } + } } - public static class Builder { - private Map extraParams; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillUntil { + /** Details of the duration over which to bill. */ + @SerializedName("duration") + Duration duration; - private Object newReference; + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; - private Object subscriptionSchedule; + /** Details of a Quote line item from which to bill until. */ + @SerializedName("line_ends_at") + LineEndsAt lineEndsAt; - private Type type; + /** A precise Unix timestamp. */ + @SerializedName("timestamp") + Long timestamp; - /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionDataOverride.AppliesTo build() { - return new QuoteUpdateParams.SubscriptionDataOverride.AppliesTo( - this.extraParams, this.newReference, this.subscriptionSchedule, this.type); + /** Required. The type of method to specify the {@code bill_until} time. */ + @SerializedName("type") + Type type; + + private BillUntil( + Duration duration, + Map extraParams, + LineEndsAt lineEndsAt, + Long timestamp, + Type type) { + this.duration = duration; + this.extraParams = extraParams; + this.lineEndsAt = lineEndsAt; + this.timestamp = timestamp; + this.type = type; } - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.AppliesTo#extraParams} for the - * field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; + public static Builder builder() { + return new Builder(); } - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.AppliesTo#extraParams} for the - * field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + public static class Builder { + private Duration duration; + + private Map extraParams; + + private LineEndsAt lineEndsAt; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil build() { + return new QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil( + this.duration, this.extraParams, this.lineEndsAt, this.timestamp, this.type); } - this.extraParams.putAll(map); - return this; - } - /** - * A custom string that identifies a new subscription schedule being created upon quote - * acceptance. All quote lines with the same {@code new_reference} field will be applied to - * the creation of a new subscription schedule. - */ - public Builder setNewReference(String newReference) { - this.newReference = newReference; - return this; - } + /** Details of the duration over which to bill. */ + public Builder setDuration( + QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.Duration duration) { + this.duration = duration; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Details of a Quote line item from which to bill until. */ + public Builder setLineEndsAt( + QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt lineEndsAt) { + this.lineEndsAt = lineEndsAt; + return this; + } + + /** A precise Unix timestamp. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. The type of method to specify the {@code bill_until} time. + */ + public Builder setType( + QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Duration { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; + + /** + * Required. The number of intervals, as an whole number greater than 0. + * Stripe multiplies this by the interval type to get the overall duration. + */ + @SerializedName("interval_count") + Long intervalCount; + + private Duration(Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.Duration build() { + return new QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.Duration( + this.extraParams, this.interval, this.intervalCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.Duration#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.Duration#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + public Builder setInterval( + QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.Duration.Interval + interval) { + this.interval = interval; + return this; + } + + /** + * Required. The number of intervals, as an whole number greater than + * 0. Stripe multiplies this by the interval type to get the overall duration. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineEndsAt { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The ID of a quote line. */ + @SerializedName("id") + Object id; + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the current + * line in the array. + */ + @SerializedName("index") + Long index; + + private LineEndsAt(Map extraParams, Object id, Long index) { + this.extraParams = extraParams; + this.id = id; + this.index = index; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object id; + + private Long index; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt build() { + return new QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt( + this.extraParams, this.id, this.index); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionData.BillingSchedule.BillUntil.LineEndsAt#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The ID of a quote line. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** The ID of a quote line. */ + public Builder setId(EmptyParam id) { + this.id = id; + return this; + } + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the + * current line in the array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), + + @SerializedName("line_ends_at") + LINE_ENDS_AT("line_ends_at"), + + @SerializedName("schedule_end") + SCHEDULE_END("schedule_end"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"), + + @SerializedName("upcoming_invoice") + UPCOMING_INVOICE("upcoming_invoice"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Prebilling { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. This is used to determine the number of billing cycles to + * prebill. + */ + @SerializedName("iterations") + Long iterations; + + private Prebilling(Map extraParams, Long iterations) { + this.extraParams = extraParams; + this.iterations = iterations; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long iterations; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionData.Prebilling build() { + return new QuoteUpdateParams.SubscriptionData.Prebilling( + this.extraParams, this.iterations); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteUpdateParams.SubscriptionData.Prebilling#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteUpdateParams.SubscriptionData.Prebilling#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. This is used to determine the number of billing cycles to + * prebill. + */ + public Builder setIterations(Long iterations) { + this.iterations = iterations; + return this; + } + } + } + + public enum BillingBehavior implements ApiRequestParams.EnumParam { + @SerializedName("prorate_on_next_phase") + PRORATE_ON_NEXT_PHASE("prorate_on_next_phase"), + + @SerializedName("prorate_up_front") + PRORATE_UP_FRONT("prorate_up_front"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + BillingBehavior(String value) { + this.value = value; + } + } + + public enum BillingCycleAnchor implements ApiRequestParams.EnumParam { + @SerializedName("reset") + RESET("reset"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + BillingCycleAnchor(String value) { + this.value = value; + } + } + + public enum EffectiveDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EffectiveDate(String value) { + this.value = value; + } + } + + public enum EndBehavior implements ApiRequestParams.EnumParam { + @SerializedName("cancel") + CANCEL("cancel"), + + @SerializedName("release") + RELEASE("release"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EndBehavior(String value) { + this.value = value; + } + } + + public enum PhaseEffectiveAt implements ApiRequestParams.EnumParam { + @SerializedName("billing_period_start") + BILLING_PERIOD_START("billing_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PhaseEffectiveAt(String value) { + this.value = value; + } + } + + public enum ProrationBehavior implements ApiRequestParams.EnumParam { + @SerializedName("always_invoice") + ALWAYS_INVOICE("always_invoice"), + + @SerializedName("create_prorations") + CREATE_PRORATIONS("create_prorations"), + + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ProrationBehavior(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SubscriptionDataOverride { + /** + * Required. Whether the override applies to an existing Subscription Schedule + * or a new Subscription Schedule. + */ + @SerializedName("applies_to") + AppliesTo appliesTo; + + /** Describes the period to bill for upon accepting the quote. */ + @SerializedName("bill_on_acceptance") + Object billOnAcceptance; + + /** + * Configures when the subscription schedule generates prorations for phase transitions. + * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the + * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase + * changes and generate prorations at transition time. {@code prorate_up_front} will bill for + * all phases within the current billing cycle up front. + */ + @SerializedName("billing_behavior") + BillingBehavior billingBehavior; + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + @SerializedName("billing_schedules") + Object billingSchedules; + + /** The customer the Subscription Data override applies to. */ + @SerializedName("customer") + Object customer; + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription for rendering in Stripe surfaces and + * certain local payment methods UIs. + */ + @SerializedName("description") + Object description; + + /** Behavior of the subscription schedule and underlying subscription when it ends. */ + @SerializedName("end_behavior") + EndBehavior endBehavior; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Configures how the subscription schedule handles billing for phase transitions when the quote + * is accepted. Possible values are {@code phase_start} (default) or {@code + * billing_period_start}. {@code phase_start} bills based on the current state of the + * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} bills + * predictively for upcoming phase transitions within the current billing cycle, including + * pricing changes and service period adjustments that will occur before the next invoice. + */ + @SerializedName("phase_effective_at") + PhaseEffectiveAt phaseEffectiveAt; + + /** + * Determines how to handle prorations. When + * creating a subscription, valid values are {@code create_prorations} or {@code none}. + * + *

When updating a subscription, valid values are {@code create_prorations}, {@code none}, or + * {@code always_invoice}. + * + *

Passing {@code create_prorations} will cause proration invoice items to be created when + * applicable. These proration items will only be invoiced immediately under certain + * conditions. In order to always invoice immediately for prorations, pass {@code + * always_invoice}. + * + *

Prorations can be disabled by passing {@code none}. + */ + @SerializedName("proration_behavior") + ProrationBehavior prorationBehavior; + + private SubscriptionDataOverride( + AppliesTo appliesTo, + Object billOnAcceptance, + BillingBehavior billingBehavior, + Object billingSchedules, + Object customer, + Object description, + EndBehavior endBehavior, + Map extraParams, + PhaseEffectiveAt phaseEffectiveAt, + ProrationBehavior prorationBehavior) { + this.appliesTo = appliesTo; + this.billOnAcceptance = billOnAcceptance; + this.billingBehavior = billingBehavior; + this.billingSchedules = billingSchedules; + this.customer = customer; + this.description = description; + this.endBehavior = endBehavior; + this.extraParams = extraParams; + this.phaseEffectiveAt = phaseEffectiveAt; + this.prorationBehavior = prorationBehavior; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AppliesTo appliesTo; + + private Object billOnAcceptance; + + private BillingBehavior billingBehavior; + + private Object billingSchedules; + + private Object customer; + + private Object description; + + private EndBehavior endBehavior; + + private Map extraParams; + + private PhaseEffectiveAt phaseEffectiveAt; + + private ProrationBehavior prorationBehavior; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride build() { + return new QuoteUpdateParams.SubscriptionDataOverride( + this.appliesTo, + this.billOnAcceptance, + this.billingBehavior, + this.billingSchedules, + this.customer, + this.description, + this.endBehavior, + this.extraParams, + this.phaseEffectiveAt, + this.prorationBehavior); + } + + /** + * Required. Whether the override applies to an existing Subscription + * Schedule or a new Subscription Schedule. + */ + public Builder setAppliesTo(QuoteUpdateParams.SubscriptionDataOverride.AppliesTo appliesTo) { + this.appliesTo = appliesTo; + return this; + } + + /** Describes the period to bill for upon accepting the quote. */ + public Builder setBillOnAcceptance( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance billOnAcceptance) { + this.billOnAcceptance = billOnAcceptance; + return this; + } + + /** Describes the period to bill for upon accepting the quote. */ + public Builder setBillOnAcceptance(EmptyParam billOnAcceptance) { + this.billOnAcceptance = billOnAcceptance; + return this; + } + + /** + * Configures when the subscription schedule generates prorations for phase transitions. + * Possible values are {@code prorate_on_next_phase} or {@code prorate_up_front} with the + * default being {@code prorate_on_next_phase}. {@code prorate_on_next_phase} will apply phase + * changes and generate prorations at transition time. {@code prorate_up_front} will bill for + * all phases within the current billing cycle up front. + */ + public Builder setBillingBehavior( + QuoteUpdateParams.SubscriptionDataOverride.BillingBehavior billingBehavior) { + this.billingBehavior = billingBehavior; + return this; + } + + /** + * Add an element to `billingSchedules` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteUpdateParams.SubscriptionDataOverride#billingSchedules} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addBillingSchedule( + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule element) { + if (this.billingSchedules == null || this.billingSchedules instanceof EmptyParam) { + this.billingSchedules = + new ArrayList(); + } + ((List) this.billingSchedules) + .add(element); + return this; + } + + /** + * Add all elements to `billingSchedules` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link QuoteUpdateParams.SubscriptionDataOverride#billingSchedules} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllBillingSchedule( + List elements) { + if (this.billingSchedules == null || this.billingSchedules instanceof EmptyParam) { + this.billingSchedules = + new ArrayList(); + } + ((List) this.billingSchedules) + .addAll(elements); + return this; + } + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + public Builder setBillingSchedules(EmptyParam billingSchedules) { + this.billingSchedules = billingSchedules; + return this; + } + + /** + * Billing schedules that will be applied to the subscription or subscription schedule created + * when the quote is accepted. + */ + public Builder setBillingSchedules( + List billingSchedules) { + this.billingSchedules = billingSchedules; + return this; + } + + /** The customer the Subscription Data override applies to. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** The customer the Subscription Data override applies to. */ + public Builder setCustomer(EmptyParam customer) { + this.customer = customer; + return this; + } + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription for rendering in Stripe surfaces and + * certain local payment methods UIs. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to + * optionally store an explanation of the subscription for rendering in Stripe surfaces and + * certain local payment methods UIs. + */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** Behavior of the subscription schedule and underlying subscription when it ends. */ + public Builder setEndBehavior( + QuoteUpdateParams.SubscriptionDataOverride.EndBehavior endBehavior) { + this.endBehavior = endBehavior; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link QuoteUpdateParams.SubscriptionDataOverride#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Configures how the subscription schedule handles billing for phase transitions when the + * quote is accepted. Possible values are {@code phase_start} (default) or {@code + * billing_period_start}. {@code phase_start} bills based on the current state of the + * subscription, ignoring changes scheduled in future phases. {@code billing_period_start} + * bills predictively for upcoming phase transitions within the current billing cycle, + * including pricing changes and service period adjustments that will occur before the next + * invoice. + */ + public Builder setPhaseEffectiveAt( + QuoteUpdateParams.SubscriptionDataOverride.PhaseEffectiveAt phaseEffectiveAt) { + this.phaseEffectiveAt = phaseEffectiveAt; + return this; + } + + /** + * Determines how to handle prorations. When + * creating a subscription, valid values are {@code create_prorations} or {@code none}. + * + *

When updating a subscription, valid values are {@code create_prorations}, {@code none}, + * or {@code always_invoice}. + * + *

Passing {@code create_prorations} will cause proration invoice items to be created when + * applicable. These proration items will only be invoiced immediately under certain + * conditions. In order to always invoice immediately for prorations, pass {@code + * always_invoice}. + * + *

Prorations can be disabled by passing {@code none}. + */ + public Builder setProrationBehavior( + QuoteUpdateParams.SubscriptionDataOverride.ProrationBehavior prorationBehavior) { + this.prorationBehavior = prorationBehavior; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AppliesTo { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A custom string that identifies a new subscription schedule being created upon quote + * acceptance. All quote lines with the same {@code new_reference} field will be applied to + * the creation of a new subscription schedule. + */ + @SerializedName("new_reference") + Object newReference; + + /** The ID of the schedule the line applies to. */ + @SerializedName("subscription_schedule") + Object subscriptionSchedule; + + /** + * Required. Describes whether the quote line is affecting a new schedule or + * an existing schedule. + */ + @SerializedName("type") + Type type; + + private AppliesTo( + Map extraParams, + Object newReference, + Object subscriptionSchedule, + Type type) { + this.extraParams = extraParams; + this.newReference = newReference; + this.subscriptionSchedule = subscriptionSchedule; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object newReference; + + private Object subscriptionSchedule; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride.AppliesTo build() { + return new QuoteUpdateParams.SubscriptionDataOverride.AppliesTo( + this.extraParams, this.newReference, this.subscriptionSchedule, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.AppliesTo#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.AppliesTo#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A custom string that identifies a new subscription schedule being created upon quote + * acceptance. All quote lines with the same {@code new_reference} field will be applied to + * the creation of a new subscription schedule. + */ + public Builder setNewReference(String newReference) { + this.newReference = newReference; + return this; + } + + /** + * A custom string that identifies a new subscription schedule being created upon quote + * acceptance. All quote lines with the same {@code new_reference} field will be applied to + * the creation of a new subscription schedule. + */ + public Builder setNewReference(EmptyParam newReference) { + this.newReference = newReference; + return this; + } + + /** The ID of the schedule the line applies to. */ + public Builder setSubscriptionSchedule(String subscriptionSchedule) { + this.subscriptionSchedule = subscriptionSchedule; + return this; + } + + /** The ID of the schedule the line applies to. */ + public Builder setSubscriptionSchedule(EmptyParam subscriptionSchedule) { + this.subscriptionSchedule = subscriptionSchedule; + return this; + } + + /** + * Required. Describes whether the quote line is affecting a new schedule + * or an existing schedule. + */ + public Builder setType(QuoteUpdateParams.SubscriptionDataOverride.AppliesTo.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("new_reference") + NEW_REFERENCE("new_reference"), + + @SerializedName("subscription_schedule") + SUBSCRIPTION_SCHEDULE("subscription_schedule"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillOnAcceptance { + /** The start of the period to bill from when the Quote is accepted. */ + @SerializedName("bill_from") + BillFrom billFrom; + + /** The end of the period to bill until when the Quote is accepted. */ + @SerializedName("bill_until") + BillUntil billUntil; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private BillOnAcceptance( + BillFrom billFrom, BillUntil billUntil, Map extraParams) { + this.billFrom = billFrom; + this.billUntil = billUntil; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillFrom billFrom; + + private BillUntil billUntil; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance( + this.billFrom, this.billUntil, this.extraParams); + } + + /** The start of the period to bill from when the Quote is accepted. */ + public Builder setBillFrom( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom billFrom) { + this.billFrom = billFrom; + return this; + } + + /** The end of the period to bill until when the Quote is accepted. */ + public Builder setBillUntil( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil billUntil) { + this.billUntil = billUntil; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillFrom { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Details of a Quote line to start the bill period from. */ + @SerializedName("line_starts_at") + LineStartsAt lineStartsAt; + + /** A precise Unix timestamp. */ + @SerializedName("timestamp") + Long timestamp; + + /** Required. The type of method to specify the {@code bill_from} time. */ + @SerializedName("type") + Type type; + + private BillFrom( + Map extraParams, LineStartsAt lineStartsAt, Long timestamp, Type type) { + this.extraParams = extraParams; + this.lineStartsAt = lineStartsAt; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private LineStartsAt lineStartsAt; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom( + this.extraParams, this.lineStartsAt, this.timestamp, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Details of a Quote line to start the bill period from. */ + public Builder setLineStartsAt( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt + lineStartsAt) { + this.lineStartsAt = lineStartsAt; + return this; + } + + /** A precise Unix timestamp. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. The type of method to specify the {@code bill_from} time. + */ + public Builder setType( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineStartsAt { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The ID of a quote line. */ + @SerializedName("id") + Object id; + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the current + * line in the array. + */ + @SerializedName("index") + Long index; + + private LineStartsAt(Map extraParams, Object id, Long index) { + this.extraParams = extraParams; + this.id = id; + this.index = index; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object id; + + private Long index; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt + build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom + .LineStartsAt(this.extraParams, this.id, this.index); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The ID of a quote line. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** The ID of a quote line. */ + public Builder setId(EmptyParam id) { + this.id = id; + return this; + } + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the + * current line in the array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("line_starts_at") + LINE_STARTS_AT("line_starts_at"), + + @SerializedName("now") + NOW("now"), + + @SerializedName("pause_collection_start") + PAUSE_COLLECTION_START("pause_collection_start"), + + @SerializedName("quote_acceptance_date") + QUOTE_ACCEPTANCE_DATE("quote_acceptance_date"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillUntil { + /** Details of the duration over which to bill. */ + @SerializedName("duration") + Duration duration; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Details of a Quote line item from which to bill until. */ + @SerializedName("line_ends_at") + LineEndsAt lineEndsAt; + + /** A precise Unix timestamp. */ + @SerializedName("timestamp") + Long timestamp; + + /** Required. The type of method to specify the {@code bill_until} time. */ + @SerializedName("type") + Type type; + + private BillUntil( + Duration duration, + Map extraParams, + LineEndsAt lineEndsAt, + Long timestamp, + Type type) { + this.duration = duration; + this.extraParams = extraParams; + this.lineEndsAt = lineEndsAt; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Duration duration; + + private Map extraParams; + + private LineEndsAt lineEndsAt; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil( + this.duration, this.extraParams, this.lineEndsAt, this.timestamp, this.type); + } + + /** Details of the duration over which to bill. */ + public Builder setDuration( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + duration) { + this.duration = duration; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Details of a Quote line item from which to bill until. */ + public Builder setLineEndsAt( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt + lineEndsAt) { + this.lineEndsAt = lineEndsAt; + return this; + } + + /** A precise Unix timestamp. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. The type of method to specify the {@code bill_until} time. + */ + public Builder setType( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Duration { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; + + /** + * Required. The number of intervals, as an whole number greater than 0. + * Stripe multiplies this by the interval type to get the overall duration. + */ + @SerializedName("interval_count") + Long intervalCount; + + private Duration(Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil + .Duration(this.extraParams, this.interval, this.intervalCount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + public Builder setInterval( + QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + .Interval + interval) { + this.interval = interval; + return this; + } + + /** + * Required. The number of intervals, as an whole number greater than + * 0. Stripe multiplies this by the interval type to get the overall duration. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + } + + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineEndsAt { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The ID of a quote line. */ + @SerializedName("id") + Object id; + + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the current + * line in the array. + */ + @SerializedName("index") + Long index; + + private LineEndsAt(Map extraParams, Object id, Long index) { + this.extraParams = extraParams; + this.id = id; + this.index = index; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object id; + + private Long index; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt + build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil + .LineEndsAt(this.extraParams, this.id, this.index); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The ID of a quote line. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** The ID of a quote line. */ + public Builder setId(EmptyParam id) { + this.id = id; + return this; + } - /** - * A custom string that identifies a new subscription schedule being created upon quote - * acceptance. All quote lines with the same {@code new_reference} field will be applied to - * the creation of a new subscription schedule. - */ - public Builder setNewReference(EmptyParam newReference) { - this.newReference = newReference; - return this; + /** + * The position of the previous quote line in the {@code lines} array after which this + * line should begin. Indexes start from 0 and must be less than the index of the + * current line in the array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } + } } - /** The ID of the schedule the line applies to. */ - public Builder setSubscriptionSchedule(String subscriptionSchedule) { - this.subscriptionSchedule = subscriptionSchedule; - return this; - } + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), - /** The ID of the schedule the line applies to. */ - public Builder setSubscriptionSchedule(EmptyParam subscriptionSchedule) { - this.subscriptionSchedule = subscriptionSchedule; - return this; - } + @SerializedName("line_ends_at") + LINE_ENDS_AT("line_ends_at"), - /** - * Required. Describes whether the quote line is affecting a new schedule - * or an existing schedule. - */ - public Builder setType(QuoteUpdateParams.SubscriptionDataOverride.AppliesTo.Type type) { - this.type = type; - return this; - } - } + @SerializedName("schedule_end") + SCHEDULE_END("schedule_end"), - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("new_reference") - NEW_REFERENCE("new_reference"), + @SerializedName("timestamp") + TIMESTAMP("timestamp"), - @SerializedName("subscription_schedule") - SUBSCRIPTION_SCHEDULE("subscription_schedule"); + @SerializedName("upcoming_invoice") + UPCOMING_INVOICE("upcoming_invoice"); - @Getter(onMethod_ = {@Override}) - private final String value; + @Getter(onMethod_ = {@Override}) + private final String value; - Type(String value) { - this.value = value; + Type(String value) { + this.value = value; + } } } } @Getter @EqualsAndHashCode(callSuper = false) - public static class BillOnAcceptance { + public static class BillingSchedule { + /** Configure billing schedule differently for individual subscription items. */ + @SerializedName("applies_to") + List appliesTo; + /** The start of the period to bill from when the Quote is accepted. */ @SerializedName("bill_from") BillFrom billFrom; @@ -8267,11 +10056,24 @@ public static class BillOnAcceptance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private BillOnAcceptance( - BillFrom billFrom, BillUntil billUntil, Map extraParams) { + /** + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and up + * to 200 characters. If not provided, a unique key will be generated. + */ + @SerializedName("key") + Object key; + + private BillingSchedule( + List appliesTo, + BillFrom billFrom, + BillUntil billUntil, + Map extraParams, + Object key) { + this.appliesTo = appliesTo; this.billFrom = billFrom; this.billUntil = billUntil; this.extraParams = extraParams; + this.key = key; } public static Builder builder() { @@ -8279,28 +10081,63 @@ public static Builder builder() { } public static class Builder { + private List + appliesTo; + private BillFrom billFrom; private BillUntil billUntil; private Map extraParams; + private Object key; + /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance build() { - return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance( - this.billFrom, this.billUntil, this.extraParams); + public QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule( + this.appliesTo, this.billFrom, this.billUntil, this.extraParams, this.key); + } + + /** + * Add an element to `appliesTo` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule#appliesTo} for the field + * documentation. + */ + public Builder addAppliesTo( + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo element) { + if (this.appliesTo == null) { + this.appliesTo = new ArrayList<>(); + } + this.appliesTo.add(element); + return this; + } + + /** + * Add all elements to `appliesTo` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule#appliesTo} for the field + * documentation. + */ + public Builder addAllAppliesTo( + List elements) { + if (this.appliesTo == null) { + this.appliesTo = new ArrayList<>(); + } + this.appliesTo.addAll(elements); + return this; } /** The start of the period to bill from when the Quote is accepted. */ public Builder setBillFrom( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom billFrom) { + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom billFrom) { this.billFrom = billFrom; return this; } /** The end of the period to bill until when the Quote is accepted. */ public Builder setBillUntil( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil billUntil) { + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil billUntil) { this.billUntil = billUntil; return this; } @@ -8308,7 +10145,7 @@ public Builder setBillUntil( /** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance#extraParams} + * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8322,7 +10159,7 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance#extraParams} + * map. See {@link QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8332,6 +10169,137 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and + * up to 200 characters. If not provided, a unique key will be generated. + */ + public Builder setKey(String key) { + this.key = key; + return this; + } + + /** + * Specify a key for the billing schedule. Must be unique to this field, alphanumeric, and + * up to 200 characters. If not provided, a unique key will be generated. + */ + public Builder setKey(EmptyParam key) { + this.key = key; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AppliesTo { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The ID of the price object. */ + @SerializedName("price") + Object price; + + /** + * Required. Controls which subscription items the billing schedule applies + * to. + */ + @SerializedName("type") + Type type; + + private AppliesTo(Map extraParams, Object price, Type type) { + this.extraParams = extraParams; + this.price = price; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object price; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo( + this.extraParams, this.price, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The ID of the price object. */ + public Builder setPrice(String price) { + this.price = price; + return this; + } + + /** The ID of the price object. */ + public Builder setPrice(EmptyParam price) { + this.price = price; + return this; + } + + /** + * Required. Controls which subscription items the billing schedule + * applies to. + */ + public Builder setType( + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.AppliesTo.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("price") + PRICE("price"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } } @Getter @@ -8381,8 +10349,8 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom build() { - return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom( + public QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom( this.extraParams, this.lineStartsAt, this.timestamp, this.type); } @@ -8390,7 +10358,7 @@ public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom buil * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom#extraParams} for + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom#extraParams} for * the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8405,7 +10373,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom#extraParams} for + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom#extraParams} for * the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8418,7 +10386,7 @@ public Builder putAllExtraParam(Map map) { /** Details of a Quote line to start the bill period from. */ public Builder setLineStartsAt( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.LineStartsAt lineStartsAt) { this.lineStartsAt = lineStartsAt; return this; @@ -8434,7 +10402,7 @@ public Builder setTimestamp(Long timestamp) { * Required. The type of method to specify the {@code bill_from} time. */ public Builder setType( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.Type type) { + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.Type type) { this.type = type; return this; } @@ -8483,9 +10451,9 @@ public static class Builder { private Long index; /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt + public QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.LineStartsAt build() { - return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom + return new QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom .LineStartsAt(this.extraParams, this.id, this.index); } @@ -8493,7 +10461,7 @@ public static class Builder { * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt#extraParams} + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.LineStartsAt#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8508,7 +10476,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillFrom.LineStartsAt#extraParams} + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillFrom.LineStartsAt#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8626,14 +10594,14 @@ public static class Builder { private Type type; /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil build() { - return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil( + public QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil build() { + return new QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil( this.duration, this.extraParams, this.lineEndsAt, this.timestamp, this.type); } /** Details of the duration over which to bill. */ public Builder setDuration( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration duration) { this.duration = duration; return this; @@ -8643,7 +10611,7 @@ public Builder setDuration( * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil#extraParams} for + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil#extraParams} for * the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8658,7 +10626,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil#extraParams} for + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil#extraParams} for * the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8671,7 +10639,7 @@ public Builder putAllExtraParam(Map map) { /** Details of a Quote line item from which to bill until. */ public Builder setLineEndsAt( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.LineEndsAt lineEndsAt) { this.lineEndsAt = lineEndsAt; return this; @@ -8687,7 +10655,7 @@ public Builder setTimestamp(Long timestamp) { * Required. The type of method to specify the {@code bill_until} time. */ public Builder setType( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Type type) { + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Type type) { this.type = type; return this; } @@ -8738,9 +10706,9 @@ public static class Builder { private Long intervalCount; /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + public QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration build() { - return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil + return new QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil .Duration(this.extraParams, this.interval, this.intervalCount); } @@ -8748,7 +10716,7 @@ public static class Builder { * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration#extraParams} + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8763,7 +10731,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration#extraParams} + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8779,7 +10747,7 @@ public Builder putAllExtraParam(Map map) { * {@code week}, {@code month} or {@code year}. */ public Builder setInterval( - QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.Duration + QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.Duration .Interval interval) { this.interval = interval; @@ -8861,9 +10829,9 @@ public static class Builder { private Long index; /** Finalize and obtain parameter instance from this builder. */ - public QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt + public QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.LineEndsAt build() { - return new QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil + return new QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil .LineEndsAt(this.extraParams, this.id, this.index); } @@ -8871,7 +10839,7 @@ public static class Builder { * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt#extraParams} + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.LineEndsAt#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -8886,7 +10854,7 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the * original map. See {@link - * QuoteUpdateParams.SubscriptionDataOverride.BillOnAcceptance.BillUntil.LineEndsAt#extraParams} + * QuoteUpdateParams.SubscriptionDataOverride.BillingSchedule.BillUntil.LineEndsAt#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -8977,6 +10945,21 @@ public enum EndBehavior implements ApiRequestParams.EnumParam { } } + public enum PhaseEffectiveAt implements ApiRequestParams.EnumParam { + @SerializedName("billing_period_start") + BILLING_PERIOD_START("billing_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PhaseEffectiveAt(String value) { + this.value = value; + } + } + public enum ProrationBehavior implements ApiRequestParams.EnumParam { @SerializedName("always_invoice") ALWAYS_INVOICE("always_invoice"), diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 7853fd2996a..0daf0495ed7 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -3312,11 +3312,23 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("amendment_end") + AMENDMENT_END("amendment_end"), + @SerializedName("duration") DURATION("duration"), + @SerializedName("line_ends_at") + LINE_ENDS_AT("line_ends_at"), + + @SerializedName("schedule_end") + SCHEDULE_END("schedule_end"), + @SerializedName("timestamp") - TIMESTAMP("timestamp"); + TIMESTAMP("timestamp"), + + @SerializedName("upcoming_invoice") + UPCOMING_INVOICE("upcoming_invoice"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 30e37634f0a..1b1e338119e 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -3083,11 +3083,23 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("amendment_end") + AMENDMENT_END("amendment_end"), + @SerializedName("duration") DURATION("duration"), + @SerializedName("line_ends_at") + LINE_ENDS_AT("line_ends_at"), + + @SerializedName("schedule_end") + SCHEDULE_END("schedule_end"), + @SerializedName("timestamp") - TIMESTAMP("timestamp"); + TIMESTAMP("timestamp"), + + @SerializedName("upcoming_invoice") + UPCOMING_INVOICE("upcoming_invoice"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/TokenCreateParams.java b/src/main/java/com/stripe/param/TokenCreateParams.java index 857516bf055..08e88a9cd82 100644 --- a/src/main/java/com/stripe/param/TokenCreateParams.java +++ b/src/main/java/com/stripe/param/TokenCreateParams.java @@ -2242,6 +2242,14 @@ public static class Individual { @SerializedName("relationship") Relationship relationship; + /** The credit applicant's self-reported yearly income in minor units. */ + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** The last four digits of the individual's Social Security Number (U.S. only). */ @SerializedName("ssn_last_4") String ssnLast4; @@ -2273,6 +2281,8 @@ private Individual( PoliticalExposure politicalExposure, RegisteredAddress registeredAddress, Relationship relationship, + SelfReportedIncome selfReportedIncome, + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment, String ssnLast4, Verification verification) { this.address = address; @@ -2297,6 +2307,8 @@ private Individual( this.politicalExposure = politicalExposure; this.registeredAddress = registeredAddress; this.relationship = relationship; + this.selfReportedIncome = selfReportedIncome; + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; this.ssnLast4 = ssnLast4; this.verification = verification; } @@ -2350,6 +2362,10 @@ public static class Builder { private Relationship relationship; + private SelfReportedIncome selfReportedIncome; + + private SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + private String ssnLast4; private Verification verification; @@ -2379,6 +2395,8 @@ public TokenCreateParams.Account.Individual build() { this.politicalExposure, this.registeredAddress, this.relationship, + this.selfReportedIncome, + this.selfReportedMonthlyHousingPayment, this.ssnLast4, this.verification); } @@ -2646,6 +2664,21 @@ public Builder setRelationship( return this; } + /** The credit applicant's self-reported yearly income in minor units. */ + public Builder setSelfReportedIncome( + TokenCreateParams.Account.Individual.SelfReportedIncome selfReportedIncome) { + this.selfReportedIncome = selfReportedIncome; + return this; + } + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + public Builder setSelfReportedMonthlyHousingPayment( + TokenCreateParams.Account.Individual.SelfReportedMonthlyHousingPayment + selfReportedMonthlyHousingPayment) { + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; + return this; + } + /** The last four digits of the individual's Social Security Number (U.S. only). */ public Builder setSsnLast4(String ssnLast4) { this.ssnLast4 = ssnLast4; @@ -3573,6 +3606,181 @@ public Builder setTitle(String title) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedIncome(Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public TokenCreateParams.Account.Individual.SelfReportedIncome build() { + return new TokenCreateParams.Account.Individual.SelfReportedIncome( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link TokenCreateParams.Account.Individual.SelfReportedIncome#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link TokenCreateParams.Account.Individual.SelfReportedIncome#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedMonthlyHousingPayment( + Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public TokenCreateParams.Account.Individual.SelfReportedMonthlyHousingPayment build() { + return new TokenCreateParams.Account.Individual.SelfReportedMonthlyHousingPayment( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * TokenCreateParams.Account.Individual.SelfReportedMonthlyHousingPayment#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * TokenCreateParams.Account.Individual.SelfReportedMonthlyHousingPayment#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { @@ -4767,6 +4975,14 @@ public static class Person { @SerializedName("relationship") Relationship relationship; + /** The credit applicant's self-reported yearly income in minor units. */ + @SerializedName("self_reported_income") + SelfReportedIncome selfReportedIncome; + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + @SerializedName("self_reported_monthly_housing_payment") + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + /** The last four digits of the person's Social Security number (U.S. only). */ @SerializedName("ssn_last_4") String ssnLast4; @@ -4805,6 +5021,8 @@ private Person( PoliticalExposure politicalExposure, RegisteredAddress registeredAddress, Relationship relationship, + SelfReportedIncome selfReportedIncome, + SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment, String ssnLast4, UsCfpbData usCfpbData, Verification verification) { @@ -4833,6 +5051,8 @@ private Person( this.politicalExposure = politicalExposure; this.registeredAddress = registeredAddress; this.relationship = relationship; + this.selfReportedIncome = selfReportedIncome; + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; this.ssnLast4 = ssnLast4; this.usCfpbData = usCfpbData; this.verification = verification; @@ -4893,6 +5113,10 @@ public static class Builder { private Relationship relationship; + private SelfReportedIncome selfReportedIncome; + + private SelfReportedMonthlyHousingPayment selfReportedMonthlyHousingPayment; + private String ssnLast4; private UsCfpbData usCfpbData; @@ -4927,6 +5151,8 @@ public TokenCreateParams.Person build() { this.politicalExposure, this.registeredAddress, this.relationship, + this.selfReportedIncome, + this.selfReportedMonthlyHousingPayment, this.ssnLast4, this.usCfpbData, this.verification); @@ -5215,6 +5441,21 @@ public Builder setRelationship(TokenCreateParams.Person.Relationship relationshi return this; } + /** The credit applicant's self-reported yearly income in minor units. */ + public Builder setSelfReportedIncome( + TokenCreateParams.Person.SelfReportedIncome selfReportedIncome) { + this.selfReportedIncome = selfReportedIncome; + return this; + } + + /** The credit applicant's self-reported monthly housing payment in minor units. */ + public Builder setSelfReportedMonthlyHousingPayment( + TokenCreateParams.Person.SelfReportedMonthlyHousingPayment + selfReportedMonthlyHousingPayment) { + this.selfReportedMonthlyHousingPayment = selfReportedMonthlyHousingPayment; + return this; + } + /** The last four digits of the person's Social Security number (U.S. only). */ public Builder setSsnLast4(String ssnLast4) { this.ssnLast4 = ssnLast4; @@ -6799,6 +7040,177 @@ public Builder setTitle(String title) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedIncome { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedIncome(Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public TokenCreateParams.Person.SelfReportedIncome build() { + return new TokenCreateParams.Person.SelfReportedIncome( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link TokenCreateParams.Person.SelfReportedIncome#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link TokenCreateParams.Person.SelfReportedIncome#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelfReportedMonthlyHousingPayment { + /** Required. */ + @SerializedName("amount") + Long amount; + + /** Required. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private SelfReportedMonthlyHousingPayment( + Long amount, String currency, Map extraParams) { + this.amount = amount; + this.currency = currency; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public TokenCreateParams.Person.SelfReportedMonthlyHousingPayment build() { + return new TokenCreateParams.Person.SelfReportedMonthlyHousingPayment( + this.amount, this.currency, this.extraParams); + } + + /** Required. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Required. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link TokenCreateParams.Person.SelfReportedMonthlyHousingPayment#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link TokenCreateParams.Person.SelfReportedMonthlyHousingPayment#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsCfpbData { diff --git a/src/main/java/com/stripe/param/capital/FinancingOfferCreateParams.java b/src/main/java/com/stripe/param/capital/FinancingOfferCreateParams.java index 678587f3a70..b93ed5459d8 100644 --- a/src/main/java/com/stripe/param/capital/FinancingOfferCreateParams.java +++ b/src/main/java/com/stripe/param/capital/FinancingOfferCreateParams.java @@ -14,7 +14,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class FinancingOfferCreateParams extends ApiRequestParams { - /** Required. */ + /** + * Required. Amount of financing offered, in minor units. For example, 1,000 USD + * is represented as 100000. + */ @SerializedName("advance_amount") Long advanceAmount; @@ -31,18 +34,25 @@ public class FinancingOfferCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. */ + /** + * Required. Fixed fee amount, in minor units. For example, 100 USD is + * represented as 10000. + */ @SerializedName("fee_amount") Long feeAmount; - /** Required. */ + /** Required. The type of financing offer. */ @SerializedName("financing_type") FinancingType financingType; + /** The status of the financing offer. */ @SerializedName("status") Status status; - /** Required. */ + /** + * Required. Per-transaction rate at which Stripe withholds funds to repay the + * financing. + */ @SerializedName("withhold_rate") BigDecimal withholdRate; @@ -94,7 +104,10 @@ public FinancingOfferCreateParams build() { this.withholdRate); } - /** Required. */ + /** + * Required. Amount of financing offered, in minor units. For example, 1,000 + * USD is represented as 100000. + */ public Builder setAdvanceAmount(Long advanceAmount) { this.advanceAmount = advanceAmount; return this; @@ -152,24 +165,31 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. */ + /** + * Required. Fixed fee amount, in minor units. For example, 100 USD is + * represented as 10000. + */ public Builder setFeeAmount(Long feeAmount) { this.feeAmount = feeAmount; return this; } - /** Required. */ + /** Required. The type of financing offer. */ public Builder setFinancingType(FinancingOfferCreateParams.FinancingType financingType) { this.financingType = financingType; return this; } + /** The status of the financing offer. */ public Builder setStatus(FinancingOfferCreateParams.Status status) { this.status = status; return this; } - /** Required. */ + /** + * Required. Per-transaction rate at which Stripe withholds funds to repay the + * financing. + */ public Builder setWithholdRate(BigDecimal withholdRate) { this.withholdRate = withholdRate; return this; diff --git a/src/main/java/com/stripe/param/capital/FinancingOfferRefillParams.java b/src/main/java/com/stripe/param/capital/FinancingOfferRefillParams.java index d4da06f1e44..f004e081d25 100644 --- a/src/main/java/com/stripe/param/capital/FinancingOfferRefillParams.java +++ b/src/main/java/com/stripe/param/capital/FinancingOfferRefillParams.java @@ -14,7 +14,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class FinancingOfferRefillParams extends ApiRequestParams { - /** Required. */ + /** + * Required. Amount of financing offered, in minor units. For example, 1,000 USD + * is represented as 100000. + */ @SerializedName("advance_amount") Long advanceAmount; @@ -31,18 +34,25 @@ public class FinancingOfferRefillParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. */ + /** + * Required. Fixed fee amount, in minor units. For example, 100 USD is + * represented as 10000. + */ @SerializedName("fee_amount") Long feeAmount; - /** Required. */ + /** Required. The type of financing offer */ @SerializedName("financing_type") FinancingType financingType; + /** The status of the financing offer. */ @SerializedName("status") Status status; - /** Required. */ + /** + * Required. Per-transaction rate at which Stripe withholds funds to repay the + * financing. + */ @SerializedName("withhold_rate") BigDecimal withholdRate; @@ -94,7 +104,10 @@ public FinancingOfferRefillParams build() { this.withholdRate); } - /** Required. */ + /** + * Required. Amount of financing offered, in minor units. For example, 1,000 + * USD is represented as 100000. + */ public Builder setAdvanceAmount(Long advanceAmount) { this.advanceAmount = advanceAmount; return this; @@ -152,24 +165,31 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. */ + /** + * Required. Fixed fee amount, in minor units. For example, 100 USD is + * represented as 10000. + */ public Builder setFeeAmount(Long feeAmount) { this.feeAmount = feeAmount; return this; } - /** Required. */ + /** Required. The type of financing offer */ public Builder setFinancingType(FinancingOfferRefillParams.FinancingType financingType) { this.financingType = financingType; return this; } + /** The status of the financing offer. */ public Builder setStatus(FinancingOfferRefillParams.Status status) { this.status = status; return this; } - /** Required. */ + /** + * Required. Per-transaction rate at which Stripe withholds funds to repay the + * financing. + */ public Builder setWithholdRate(BigDecimal withholdRate) { this.withholdRate = withholdRate; return this; diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java index 7b1df872db4..9f7ec568cb1 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java @@ -319,6 +319,7 @@ public Builder putAllSharedMetadata(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class FulfillmentDetails { + /** The customer's address. */ @SerializedName("address") Address address; @@ -373,6 +374,7 @@ public RequestedSessionCreateParams.FulfillmentDetails build() { this.address, this.email, this.extraParams, this.name, this.phone); } + /** The customer's address. */ public Builder setAddress(RequestedSessionCreateParams.FulfillmentDetails.Address address) { this.address = address; return this; diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java index 946ecacda72..ab8ed42e08c 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java @@ -265,6 +265,7 @@ public Builder putAllSharedMetadata(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class FulfillmentDetails { + /** The customer's address. */ @SerializedName("address") Address address; @@ -336,6 +337,7 @@ public RequestedSessionUpdateParams.FulfillmentDetails build() { this.selectedFulfillmentOption); } + /** The customer's address. */ public Builder setAddress(RequestedSessionUpdateParams.FulfillmentDetails.Address address) { this.address = address; return this; diff --git a/src/main/java/com/stripe/param/v2/tax/AutomaticRuleCreateParams.java b/src/main/java/com/stripe/param/v2/tax/AutomaticRuleCreateParams.java deleted file mode 100644 index 47d1ed872f5..00000000000 --- a/src/main/java/com/stripe/param/v2/tax/AutomaticRuleCreateParams.java +++ /dev/null @@ -1,92 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.param.v2.tax; - -import com.google.gson.annotations.SerializedName; -import com.stripe.net.ApiRequestParams; -import java.util.HashMap; -import java.util.Map; -import lombok.EqualsAndHashCode; -import lombok.Getter; - -@Getter -@EqualsAndHashCode(callSuper = false) -public class AutomaticRuleCreateParams extends ApiRequestParams { - /** Required. The BillableItem ID to set automatic Tax configuration for. */ - @SerializedName("billable_item") - String billableItem; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** Required. The TaxCode object to be used for automatic tax calculations. */ - @SerializedName("tax_code") - String taxCode; - - private AutomaticRuleCreateParams( - String billableItem, Map extraParams, String taxCode) { - this.billableItem = billableItem; - this.extraParams = extraParams; - this.taxCode = taxCode; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String billableItem; - - private Map extraParams; - - private String taxCode; - - /** Finalize and obtain parameter instance from this builder. */ - public AutomaticRuleCreateParams build() { - return new AutomaticRuleCreateParams(this.billableItem, this.extraParams, this.taxCode); - } - - /** Required. The BillableItem ID to set automatic Tax configuration for. */ - public Builder setBillableItem(String billableItem) { - this.billableItem = billableItem; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` - * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * AutomaticRuleCreateParams#extraParams} for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link AutomaticRuleCreateParams#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** Required. The TaxCode object to be used for automatic tax calculations. */ - public Builder setTaxCode(String taxCode) { - this.taxCode = taxCode; - return this; - } - } -} diff --git a/src/main/java/com/stripe/param/v2/tax/AutomaticRuleFindParams.java b/src/main/java/com/stripe/param/v2/tax/AutomaticRuleFindParams.java deleted file mode 100644 index 666bd7c5c95..00000000000 --- a/src/main/java/com/stripe/param/v2/tax/AutomaticRuleFindParams.java +++ /dev/null @@ -1,78 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.param.v2.tax; - -import com.google.gson.annotations.SerializedName; -import com.stripe.net.ApiRequestParams; -import java.util.HashMap; -import java.util.Map; -import lombok.EqualsAndHashCode; -import lombok.Getter; - -@Getter -@EqualsAndHashCode(callSuper = false) -public class AutomaticRuleFindParams extends ApiRequestParams { - /** Required. The BillableItem ID to search by. */ - @SerializedName("billable_item") - String billableItem; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - private AutomaticRuleFindParams(String billableItem, Map extraParams) { - this.billableItem = billableItem; - this.extraParams = extraParams; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String billableItem; - - private Map extraParams; - - /** Finalize and obtain parameter instance from this builder. */ - public AutomaticRuleFindParams build() { - return new AutomaticRuleFindParams(this.billableItem, this.extraParams); - } - - /** Required. The BillableItem ID to search by. */ - public Builder setBillableItem(String billableItem) { - this.billableItem = billableItem; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` - * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * AutomaticRuleFindParams#extraParams} for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link AutomaticRuleFindParams#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - } -} diff --git a/src/main/java/com/stripe/param/v2/tax/AutomaticRuleUpdateParams.java b/src/main/java/com/stripe/param/v2/tax/AutomaticRuleUpdateParams.java deleted file mode 100644 index fd2319fa14b..00000000000 --- a/src/main/java/com/stripe/param/v2/tax/AutomaticRuleUpdateParams.java +++ /dev/null @@ -1,85 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.param.v2.tax; - -import com.google.gson.annotations.SerializedName; -import com.stripe.net.ApiRequestParams; -import com.stripe.param.common.EmptyParam; -import java.util.HashMap; -import java.util.Map; -import lombok.EqualsAndHashCode; -import lombok.Getter; - -@Getter -@EqualsAndHashCode(callSuper = false) -public class AutomaticRuleUpdateParams extends ApiRequestParams { - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** Required. The TaxCode object to be used for automatic tax calculations. */ - @SerializedName("tax_code") - Object taxCode; - - private AutomaticRuleUpdateParams(Map extraParams, Object taxCode) { - this.extraParams = extraParams; - this.taxCode = taxCode; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Map extraParams; - - private Object taxCode; - - /** Finalize and obtain parameter instance from this builder. */ - public AutomaticRuleUpdateParams build() { - return new AutomaticRuleUpdateParams(this.extraParams, this.taxCode); - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` - * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * AutomaticRuleUpdateParams#extraParams} for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link AutomaticRuleUpdateParams#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** Required. The TaxCode object to be used for automatic tax calculations. */ - public Builder setTaxCode(String taxCode) { - this.taxCode = taxCode; - return this; - } - - /** Required. The TaxCode object to be used for automatic tax calculations. */ - public Builder setTaxCode(EmptyParam taxCode) { - this.taxCode = taxCode; - return this; - } - } -} diff --git a/src/main/java/com/stripe/service/V2Services.java b/src/main/java/com/stripe/service/V2Services.java index c08dd0210c6..de7d06b52e2 100644 --- a/src/main/java/com/stripe/service/V2Services.java +++ b/src/main/java/com/stripe/service/V2Services.java @@ -29,10 +29,6 @@ public com.stripe.service.v2.ReportingService reporting() { return new com.stripe.service.v2.ReportingService(this.getResponseGetter()); } - public com.stripe.service.v2.TaxService tax() { - return new com.stripe.service.v2.TaxService(this.getResponseGetter()); - } - public com.stripe.service.v2.TestHelperService testHelpers() { return new com.stripe.service.v2.TestHelperService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/v2/TaxService.java b/src/main/java/com/stripe/service/v2/TaxService.java deleted file mode 100644 index 3b695c4bc92..00000000000 --- a/src/main/java/com/stripe/service/v2/TaxService.java +++ /dev/null @@ -1,15 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.service.v2; - -import com.stripe.net.ApiService; -import com.stripe.net.StripeResponseGetter; - -public final class TaxService extends ApiService { - public TaxService(StripeResponseGetter responseGetter) { - super(responseGetter); - } - - public com.stripe.service.v2.tax.AutomaticRuleService automaticRules() { - return new com.stripe.service.v2.tax.AutomaticRuleService(this.getResponseGetter()); - } -} diff --git a/src/main/java/com/stripe/service/v2/tax/AutomaticRuleService.java b/src/main/java/com/stripe/service/v2/tax/AutomaticRuleService.java deleted file mode 100644 index cf4797de21d..00000000000 --- a/src/main/java/com/stripe/service/v2/tax/AutomaticRuleService.java +++ /dev/null @@ -1,102 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.service.v2.tax; - -import com.stripe.exception.StripeException; -import com.stripe.model.v2.tax.AutomaticRule; -import com.stripe.net.ApiRequest; -import com.stripe.net.ApiRequestParams; -import com.stripe.net.ApiResource; -import com.stripe.net.ApiService; -import com.stripe.net.BaseAddress; -import com.stripe.net.RequestOptions; -import com.stripe.net.StripeResponseGetter; -import com.stripe.param.v2.tax.AutomaticRuleCreateParams; -import com.stripe.param.v2.tax.AutomaticRuleFindParams; -import com.stripe.param.v2.tax.AutomaticRuleUpdateParams; - -public final class AutomaticRuleService extends ApiService { - public AutomaticRuleService(StripeResponseGetter responseGetter) { - super(responseGetter); - } - - /** Creates an AutomaticRule object. */ - public AutomaticRule create(AutomaticRuleCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - /** Creates an AutomaticRule object. */ - public AutomaticRule create(AutomaticRuleCreateParams params, RequestOptions options) - throws StripeException { - String path = "/v2/tax/automatic_rules"; - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - path, - ApiRequestParams.paramsToMap(params), - options); - return this.request(request, AutomaticRule.class); - } - /** Finds an AutomaticRule object by BillableItem ID. */ - public AutomaticRule find(AutomaticRuleFindParams params) throws StripeException { - return find(params, (RequestOptions) null); - } - /** Finds an AutomaticRule object by BillableItem ID. */ - public AutomaticRule find(AutomaticRuleFindParams params, RequestOptions options) - throws StripeException { - String path = "/v2/tax/automatic_rules/find"; - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - path, - ApiRequestParams.paramsToMap(params), - options); - return this.request(request, AutomaticRule.class); - } - /** Retrieves an AutomaticRule object by ID. */ - public AutomaticRule retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); - } - /** Retrieves an AutomaticRule object by ID. */ - public AutomaticRule retrieve(String id, RequestOptions options) throws StripeException { - String path = String.format("/v2/tax/automatic_rules/%s", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); - return this.request(request, AutomaticRule.class); - } - /** Updates the automatic Tax configuration for an AutomaticRule object. */ - public AutomaticRule update(String id, AutomaticRuleUpdateParams params) throws StripeException { - return update(id, params, (RequestOptions) null); - } - /** Updates the automatic Tax configuration for an AutomaticRule object. */ - public AutomaticRule update(String id, AutomaticRuleUpdateParams params, RequestOptions options) - throws StripeException { - String path = String.format("/v2/tax/automatic_rules/%s", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - path, - ApiRequestParams.paramsToMap(params), - options); - return this.request(request, AutomaticRule.class); - } - /** - * Deactivates an AutomaticRule object. Deactivated AutomaticRule objects are ignored in future - * tax calculations. - */ - public AutomaticRule deactivate(String id) throws StripeException { - return deactivate(id, (RequestOptions) null); - } - /** - * Deactivates an AutomaticRule object. Deactivated AutomaticRule objects are ignored in future - * tax calculations. - */ - public AutomaticRule deactivate(String id, RequestOptions options) throws StripeException { - String path = - String.format("/v2/tax/automatic_rules/%s/deactivate", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); - return this.request(request, AutomaticRule.class); - } -} diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 0ecd3a47b85..20de5b714ed 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -29190,135 +29190,6 @@ public void testV2ReportingReportRunGetServices() throws StripeException { null); } - @Test - public void testV2TaxAutomaticRulePostServices() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/tax/automatic_rules", - null, - null, - com.stripe.model.v2.tax.AutomaticRule.class, - "{\"billable_item\":\"billable_item\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.automatic_rule\",\"status\":\"active\",\"tax_code\":\"tax_code\",\"livemode\":true}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.param.v2.tax.AutomaticRuleCreateParams params = - com.stripe.param.v2.tax.AutomaticRuleCreateParams.builder() - .setBillableItem("billable_item") - .setTaxCode("tax_code") - .build(); - - com.stripe.model.v2.tax.AutomaticRule automaticRule = - client.v2().tax().automaticRules().create(params); - assertNotNull(automaticRule); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/tax/automatic_rules", - params.toMap(), - null); - } - - @Test - public void testV2TaxAutomaticRuleGetServices() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/tax/automatic_rules/find", - null, - null, - com.stripe.model.v2.tax.AutomaticRule.class, - "{\"billable_item\":\"billable_item\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.automatic_rule\",\"status\":\"active\",\"tax_code\":\"tax_code\",\"livemode\":true}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.param.v2.tax.AutomaticRuleFindParams params = - com.stripe.param.v2.tax.AutomaticRuleFindParams.builder() - .setBillableItem("billable_item") - .build(); - - com.stripe.model.v2.tax.AutomaticRule automaticRule = - client.v2().tax().automaticRules().find(params); - assertNotNull(automaticRule); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/tax/automatic_rules/find", - params.toMap(), - null); - } - - @Test - public void testV2TaxAutomaticRuleGet2Services() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/tax/automatic_rules/id_123", - null, - null, - com.stripe.model.v2.tax.AutomaticRule.class, - "{\"billable_item\":\"billable_item\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.automatic_rule\",\"status\":\"active\",\"tax_code\":\"tax_code\",\"livemode\":true}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.model.v2.tax.AutomaticRule automaticRule = - client.v2().tax().automaticRules().retrieve("id_123"); - assertNotNull(automaticRule); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/tax/automatic_rules/id_123", - null, - null); - } - - @Test - public void testV2TaxAutomaticRulePost2Services() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/tax/automatic_rules/id_123", - null, - null, - com.stripe.model.v2.tax.AutomaticRule.class, - "{\"billable_item\":\"billable_item\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.automatic_rule\",\"status\":\"active\",\"tax_code\":\"tax_code\",\"livemode\":true}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.param.v2.tax.AutomaticRuleUpdateParams params = - com.stripe.param.v2.tax.AutomaticRuleUpdateParams.builder().setTaxCode("tax_code").build(); - - com.stripe.model.v2.tax.AutomaticRule automaticRule = - client.v2().tax().automaticRules().update("id_123", params); - assertNotNull(automaticRule); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/tax/automatic_rules/id_123", - params.toMap(), - null); - } - - @Test - public void testV2TaxAutomaticRulePost3Services() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/tax/automatic_rules/id_123/deactivate", - null, - null, - com.stripe.model.v2.tax.AutomaticRule.class, - "{\"billable_item\":\"billable_item\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.automatic_rule\",\"status\":\"active\",\"tax_code\":\"tax_code\",\"livemode\":true}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.model.v2.tax.AutomaticRule automaticRule = - client.v2().tax().automaticRules().deactivate("id_123"); - assertNotNull(automaticRule); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/tax/automatic_rules/id_123/deactivate", - null, - null); - } - @Test public void testV2TestHelpersFinancialAddressPostServices() throws StripeException { stubRequest(