From 12069194c93cc8cc781f0977645a261274367b1e Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:22:57 +0000 Subject: [PATCH 1/6] Update generated code for v2155 and --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/StripeClient.java | 12 + src/main/java/com/stripe/model/Coupon.java | 19 + src/main/java/com/stripe/model/Discount.java | 20 + .../stripe/model/EventDataClassLookup.java | 1 + .../model/FrMealVouchersOnboarding.java | 337 ++ .../FrMealVouchersOnboardingCollection.java | 5 + .../com/stripe/param/CouponCreateParams.java | 136 +- .../FrMealVouchersOnboardingCreateParams.java | 197 + .../FrMealVouchersOnboardingListParams.java | 171 + ...rMealVouchersOnboardingRetrieveParams.java | 101 + .../FrMealVouchersOnboardingUpdateParams.java | 122 + .../param/InvoiceCreatePreviewParams.java | 4813 ++++++++++++++--- .../com/stripe/param/QuoteCreateParams.java | 1678 +++++- .../com/stripe/param/QuoteUpdateParams.java | 1700 +++++- .../param/SubscriptionCreateParams.java | 1221 ++++- .../param/SubscriptionItemCreateParams.java | 397 +- .../param/SubscriptionItemUpdateParams.java | 397 +- .../SubscriptionScheduleAmendParams.java | 1754 +++++- .../SubscriptionScheduleCreateParams.java | 809 ++- .../SubscriptionScheduleUpdateParams.java | 809 ++- .../param/SubscriptionUpdateParams.java | 1225 ++++- .../param/checkout/SessionCreateParams.java | 5 +- .../param/checkout/SessionUpdateParams.java | 5 +- .../FrMealVouchersOnboardingService.java | 124 + .../java/com/stripe/service/V1Services.java | 4 + 27 files changed, 14680 insertions(+), 1386 deletions(-) create mode 100644 src/main/java/com/stripe/model/FrMealVouchersOnboarding.java create mode 100644 src/main/java/com/stripe/model/FrMealVouchersOnboardingCollection.java create mode 100644 src/main/java/com/stripe/param/FrMealVouchersOnboardingCreateParams.java create mode 100644 src/main/java/com/stripe/param/FrMealVouchersOnboardingListParams.java create mode 100644 src/main/java/com/stripe/param/FrMealVouchersOnboardingRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/FrMealVouchersOnboardingUpdateParams.java create mode 100644 src/main/java/com/stripe/service/FrMealVouchersOnboardingService.java diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 81e38dd3bef..f0d8c5cf5ee 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -c250368ba89214c80bc8de3e4fc5d2094c5502cc \ No newline at end of file +8989becedb2153519066ec2233cbf5880b938188 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4c7a9ad2bfe..8d0138b868d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2153 \ No newline at end of file +v2155 \ No newline at end of file diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index db693313ca1..c4d64a10786 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -520,6 +520,18 @@ public com.stripe.service.ForwardingService forwarding() { return new com.stripe.service.ForwardingService(this.getResponseGetter()); } + /** + * @deprecated StripeClient.frMealVouchersOnboardings() is deprecated, use + * StripeClient.v1().frMealVouchersOnboardings() instead. All functionality under it has been + * copied over to StripeClient.v1().frMealVouchersOnboardings(). See migration + * guide for more on this and tips on migrating to the new v1 namespace. + */ + @Deprecated + public com.stripe.service.FrMealVouchersOnboardingService frMealVouchersOnboardings() { + return new com.stripe.service.FrMealVouchersOnboardingService(this.getResponseGetter()); + } + /** * @deprecated StripeClient.fxQuotes() is deprecated, use StripeClient.v1().fxQuotes() instead. * All functionality under it has been copied over to StripeClient.v1().fxQuotes(). See @SerializedName("script") Script script; + @SerializedName("service_period") + ServicePeriod servicePeriod; + /** Number of times this coupon has been applied to a customer. */ @SerializedName("times_redeemed") Long timesRedeemed; @@ -444,10 +447,26 @@ public static class Script extends StripeObject implements HasId { String id; } + /** + * For more details about ServicePeriod, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriod extends StripeObject { + @SerializedName("interval") + String interval; + + @SerializedName("interval_count") + Long intervalCount; + } + @Override public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(appliesTo, responseGetter); trySetResponseGetter(script, responseGetter); + trySetResponseGetter(servicePeriod, responseGetter); } } diff --git a/src/main/java/com/stripe/model/Discount.java b/src/main/java/com/stripe/model/Discount.java index 6b71a8bdab2..b1b4069da7a 100644 --- a/src/main/java/com/stripe/model/Discount.java +++ b/src/main/java/com/stripe/model/Discount.java @@ -92,6 +92,9 @@ public class Discount extends StripeObject implements HasId { @SerializedName("schedule") String schedule; + @SerializedName("service_period_details") + ServicePeriodDetails servicePeriodDetails; + @SerializedName("source") Source source; @@ -149,6 +152,23 @@ public void setPromotionCodeObject(PromotionCode expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } + /** + * For more details about ServicePeriodDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodDetails extends StripeObject { + /** The date that the service period was anchored to. */ + @SerializedName("service_period_anchored_at") + Long servicePeriodAnchoredAt; + + /** The date that the service period started. */ + @SerializedName("start_date") + Long startDate; + } + /** * For more details about Source, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 28c12348ab1..d664409e727 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -51,6 +51,7 @@ public final class EventDataClassLookup { classLookup.put("fee_refund", com.stripe.model.FeeRefund.class); classLookup.put("file", com.stripe.model.File.class); classLookup.put("file_link", com.stripe.model.FileLink.class); + classLookup.put("fr_meal_vouchers_onboarding", com.stripe.model.FrMealVouchersOnboarding.class); classLookup.put("funding_instructions", com.stripe.model.FundingInstructions.class); classLookup.put("fx_quote", com.stripe.model.FxQuote.class); classLookup.put("invoice", com.stripe.model.Invoice.class); diff --git a/src/main/java/com/stripe/model/FrMealVouchersOnboarding.java b/src/main/java/com/stripe/model/FrMealVouchersOnboarding.java new file mode 100644 index 00000000000..98458534aee --- /dev/null +++ b/src/main/java/com/stripe/model/FrMealVouchersOnboarding.java @@ -0,0 +1,337 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.FrMealVouchersOnboardingCreateParams; +import com.stripe.param.FrMealVouchersOnboardingListParams; +import com.stripe.param.FrMealVouchersOnboardingRetrieveParams; +import com.stripe.param.FrMealVouchersOnboardingUpdateParams; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * The French Meal Vouchers Onboarding resource encapsulates the onboarding status and other related + * information for a single restaurant (SIRET number) in the context of the French Meal Vouchers + * program. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class FrMealVouchersOnboarding extends ApiResource + implements HasId, MetadataStore { + /** Unique identifier for the 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @Getter(onMethod_ = {@Override}) + @SerializedName("metadata") + Map metadata; + + /** Name of the restaurant. */ + @SerializedName("name") + String name; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code fr_meal_vouchers_onboarding}. + */ + @SerializedName("object") + String object; + + /** Postal code of the restaurant. */ + @SerializedName("postal_code") + String postalCode; + + /** This represents the onboarding state of the restaurant on different providers. */ + @SerializedName("providers") + Providers providers; + + /** SIRET number associated with the restaurant. */ + @SerializedName("siret") + String siret; + + /** + * Creates a French Meal Vouchers Onboarding object that represents a restaurant’s onboarding + * status and starts the onboarding process. + */ + public static FrMealVouchersOnboarding create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a French Meal Vouchers Onboarding object that represents a restaurant’s onboarding + * status and starts the onboarding process. + */ + public static FrMealVouchersOnboarding create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/fr_meal_vouchers_onboardings"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, FrMealVouchersOnboarding.class); + } + + /** + * Creates a French Meal Vouchers Onboarding object that represents a restaurant’s onboarding + * status and starts the onboarding process. + */ + public static FrMealVouchersOnboarding create(FrMealVouchersOnboardingCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Creates a French Meal Vouchers Onboarding object that represents a restaurant’s onboarding + * status and starts the onboarding process. + */ + public static FrMealVouchersOnboarding create( + FrMealVouchersOnboardingCreateParams params, RequestOptions options) throws StripeException { + String path = "/v1/fr_meal_vouchers_onboardings"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, FrMealVouchersOnboarding.class); + } + + /** Lists French Meal Vouchers Onboarding objects. */ + public static FrMealVouchersOnboardingCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Lists French Meal Vouchers Onboarding objects. */ + public static FrMealVouchersOnboardingCollection list( + Map params, RequestOptions options) throws StripeException { + String path = "/v1/fr_meal_vouchers_onboardings"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, FrMealVouchersOnboardingCollection.class); + } + + /** Lists French Meal Vouchers Onboarding objects. */ + public static FrMealVouchersOnboardingCollection list(FrMealVouchersOnboardingListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** Lists French Meal Vouchers Onboarding objects. */ + public static FrMealVouchersOnboardingCollection list( + FrMealVouchersOnboardingListParams params, RequestOptions options) throws StripeException { + String path = "/v1/fr_meal_vouchers_onboardings"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, FrMealVouchersOnboardingCollection.class); + } + + /** Retrieves the details of a French Meal Vouchers Onboarding object. */ + public static FrMealVouchersOnboarding retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** Retrieves the details of a French Meal Vouchers Onboarding object. */ + public static FrMealVouchersOnboarding retrieve(String id, RequestOptions options) + throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieves the details of a French Meal Vouchers Onboarding object. */ + public static FrMealVouchersOnboarding retrieve( + String id, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/fr_meal_vouchers_onboardings/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, FrMealVouchersOnboarding.class); + } + + /** Retrieves the details of a French Meal Vouchers Onboarding object. */ + public static FrMealVouchersOnboarding retrieve( + String id, FrMealVouchersOnboardingRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/fr_meal_vouchers_onboardings/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, FrMealVouchersOnboarding.class); + } + + /** Updates the details of a restaurant’s French Meal Vouchers Onboarding object. */ + @Override + public FrMealVouchersOnboarding update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates the details of a restaurant’s French Meal Vouchers Onboarding object. */ + @Override + public FrMealVouchersOnboarding update(Map params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/fr_meal_vouchers_onboardings/%s", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, FrMealVouchersOnboarding.class); + } + + /** Updates the details of a restaurant’s French Meal Vouchers Onboarding object. */ + public FrMealVouchersOnboarding update(FrMealVouchersOnboardingUpdateParams params) + throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Updates the details of a restaurant’s French Meal Vouchers Onboarding object. */ + public FrMealVouchersOnboarding update( + FrMealVouchersOnboardingUpdateParams params, RequestOptions options) throws StripeException { + String path = + String.format("/v1/fr_meal_vouchers_onboardings/%s", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, FrMealVouchersOnboarding.class); + } + + /** This represents the onboarding state of the restaurant on different providers. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Providers extends StripeObject { + /** This represents the onboarding state of the restaurant on Conecs. */ + @SerializedName("conecs") + Conecs conecs; + + /** This represents the onboarding state of the restaurant on Conecs. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Conecs extends StripeObject { + /** This represents information which issuers are available to this restaurant via Conecs. */ + @SerializedName("issuers") + Issuers issuers; + + /** + * This represents information about outstanding requirements for this restaurant to onboard + * to Conecs. + */ + @SerializedName("requirements") + Requirements requirements; + + /** + * Status of the restaurant's onboarding to Conecs + * + *

One of {@code action_required}, {@code active}, {@code disentitled}, or {@code pending}. + */ + @SerializedName("status") + String status; + + /** This represents information which issuers are available to this restaurant via Conecs. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Issuers extends StripeObject { + /** + * Issuers are available to this restaurant via Conecs, will be blank if the onboarding to + * Conecs is not complete or unsuccessful. + */ + @SerializedName("available") + List available; + } + + /** + * This represents information about outstanding requirements for this restaurant to onboard + * to Conecs. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Requirements extends StripeObject { + /** + * Information any errors that are preventing the onboarding to Conecs from being completed. + */ + @SerializedName("errors") + List errors; + + /** Fields that need to be provided to complete the onboarding to Conecs. */ + @SerializedName("past_due") + List pastDue; + + /** + * For more details about Errors, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Errors extends StripeObject { + /** + * The code for the type of error. + * + *

One of {@code postal_code_invalid}, or {@code siret_invalid}. + */ + @SerializedName("code") + String code; + + /** An informative message that provides additional details about the error. */ + @SerializedName("message") + String message; + + /** + * The specific onboarding requirement field (in the requirements hash) that needs to be + * resolved. + * + *

One of {@code postal_code}, or {@code siret}. + */ + @SerializedName("requirement") + String requirement; + } + } + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(providers, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/FrMealVouchersOnboardingCollection.java b/src/main/java/com/stripe/model/FrMealVouchersOnboardingCollection.java new file mode 100644 index 00000000000..6f89fc46248 --- /dev/null +++ b/src/main/java/com/stripe/model/FrMealVouchersOnboardingCollection.java @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +public class FrMealVouchersOnboardingCollection + extends StripeCollection {} diff --git a/src/main/java/com/stripe/param/CouponCreateParams.java b/src/main/java/com/stripe/param/CouponCreateParams.java index ed8abfde592..cb37db49957 100644 --- a/src/main/java/com/stripe/param/CouponCreateParams.java +++ b/src/main/java/com/stripe/param/CouponCreateParams.java @@ -123,6 +123,10 @@ public class CouponCreateParams extends ApiRequestParams { @SerializedName("script") Script script; + /** A hash specifying the service period for the coupon. */ + @SerializedName("service_period") + ServicePeriod servicePeriod; + private CouponCreateParams( Long amountOff, AppliesTo appliesTo, @@ -138,7 +142,8 @@ private CouponCreateParams( String name, BigDecimal percentOff, Long redeemBy, - Script script) { + Script script, + ServicePeriod servicePeriod) { this.amountOff = amountOff; this.appliesTo = appliesTo; this.currency = currency; @@ -154,6 +159,7 @@ private CouponCreateParams( this.percentOff = percentOff; this.redeemBy = redeemBy; this.script = script; + this.servicePeriod = servicePeriod; } public static Builder builder() { @@ -191,6 +197,8 @@ public static class Builder { private Script script; + private ServicePeriod servicePeriod; + /** Finalize and obtain parameter instance from this builder. */ public CouponCreateParams build() { return new CouponCreateParams( @@ -208,7 +216,8 @@ public CouponCreateParams build() { this.name, this.percentOff, this.redeemBy, - this.script); + this.script, + this.servicePeriod); } /** @@ -437,6 +446,12 @@ public Builder setScript(CouponCreateParams.Script script) { this.script = script; return this; } + + /** A hash specifying the service period for the coupon. */ + public Builder setServicePeriod(CouponCreateParams.ServicePeriod servicePeriod) { + this.servicePeriod = servicePeriod; + return this; + } } @Getter @@ -708,6 +723,118 @@ public Builder setId(String id) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriod { + /** + * 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 coupon frequency. Either {@code day}, {@code week}, + * {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; + + /** Required. The number of intervals for which the coupon will be applied. */ + @SerializedName("interval_count") + Long intervalCount; + + private ServicePeriod(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 CouponCreateParams.ServicePeriod build() { + return new CouponCreateParams.ServicePeriod( + 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 + * CouponCreateParams.ServicePeriod#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 CouponCreateParams.ServicePeriod#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 coupon frequency. Either {@code day}, {@code week}, + * {@code month} or {@code year}. + */ + public Builder setInterval(CouponCreateParams.ServicePeriod.Interval interval) { + this.interval = interval; + return this; + } + + /** + * Required. The number of intervals for which the coupon will be applied. + */ + 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; + } + } + } + public enum Duration implements ApiRequestParams.EnumParam { @SerializedName("forever") FOREVER("forever"), @@ -716,7 +843,10 @@ public enum Duration implements ApiRequestParams.EnumParam { ONCE("once"), @SerializedName("repeating") - REPEATING("repeating"); + REPEATING("repeating"), + + @SerializedName("service_period") + SERVICE_PERIOD("service_period"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/FrMealVouchersOnboardingCreateParams.java b/src/main/java/com/stripe/param/FrMealVouchersOnboardingCreateParams.java new file mode 100644 index 00000000000..0bdcc4ca922 --- /dev/null +++ b/src/main/java/com/stripe/param/FrMealVouchersOnboardingCreateParams.java @@ -0,0 +1,197 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class FrMealVouchersOnboardingCreateParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. This cannot be changed after creation + * of this object. + */ + @SerializedName("metadata") + Map metadata; + + /** + * Required. Name of the restaurant. This cannot be changed after creation of + * this object. + */ + @SerializedName("name") + String name; + + /** Required. Postal code of the restaurant. */ + @SerializedName("postal_code") + String postalCode; + + /** + * Required. SIRET number associated with the restaurant. This cannot be changed + * after creation of this object. + */ + @SerializedName("siret") + String siret; + + private FrMealVouchersOnboardingCreateParams( + List expand, + Map extraParams, + Map metadata, + String name, + String postalCode, + String siret) { + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + this.name = name; + this.postalCode = postalCode; + this.siret = siret; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Map metadata; + + private String name; + + private String postalCode; + + private String siret; + + /** Finalize and obtain parameter instance from this builder. */ + public FrMealVouchersOnboardingCreateParams build() { + return new FrMealVouchersOnboardingCreateParams( + this.expand, this.extraParams, this.metadata, this.name, this.postalCode, this.siret); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FrMealVouchersOnboardingCreateParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FrMealVouchersOnboardingCreateParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FrMealVouchersOnboardingCreateParams#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 FrMealVouchersOnboardingCreateParams#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 `metadata` 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 + * FrMealVouchersOnboardingCreateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 FrMealVouchersOnboardingCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** + * Required. Name of the restaurant. This cannot be changed after creation of + * this object. + */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Required. Postal code of the restaurant. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Required. SIRET number associated with the restaurant. This cannot be + * changed after creation of this object. + */ + public Builder setSiret(String siret) { + this.siret = siret; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/FrMealVouchersOnboardingListParams.java b/src/main/java/com/stripe/param/FrMealVouchersOnboardingListParams.java new file mode 100644 index 00000000000..4f2b91c6975 --- /dev/null +++ b/src/main/java/com/stripe/param/FrMealVouchersOnboardingListParams.java @@ -0,0 +1,171 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class FrMealVouchersOnboardingListParams extends ApiRequestParams { + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + private FrMealVouchersOnboardingListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String endingBefore; + + private List expand; + + private Map extraParams; + + private Long limit; + + private String startingAfter; + + /** Finalize and obtain parameter instance from this builder. */ + public FrMealVouchersOnboardingListParams build() { + return new FrMealVouchersOnboardingListParams( + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FrMealVouchersOnboardingListParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FrMealVouchersOnboardingListParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FrMealVouchersOnboardingListParams#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 FrMealVouchersOnboardingListParams#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 limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/FrMealVouchersOnboardingRetrieveParams.java b/src/main/java/com/stripe/param/FrMealVouchersOnboardingRetrieveParams.java new file mode 100644 index 00000000000..141cb16d6be --- /dev/null +++ b/src/main/java/com/stripe/param/FrMealVouchersOnboardingRetrieveParams.java @@ -0,0 +1,101 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class FrMealVouchersOnboardingRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 FrMealVouchersOnboardingRetrieveParams( + List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public FrMealVouchersOnboardingRetrieveParams build() { + return new FrMealVouchersOnboardingRetrieveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FrMealVouchersOnboardingRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FrMealVouchersOnboardingRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FrMealVouchersOnboardingRetrieveParams#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 FrMealVouchersOnboardingRetrieveParams#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/FrMealVouchersOnboardingUpdateParams.java b/src/main/java/com/stripe/param/FrMealVouchersOnboardingUpdateParams.java new file mode 100644 index 00000000000..af349bd472a --- /dev/null +++ b/src/main/java/com/stripe/param/FrMealVouchersOnboardingUpdateParams.java @@ -0,0 +1,122 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class FrMealVouchersOnboardingUpdateParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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. Corrected Postal code of the restaurant. */ + @SerializedName("postal_code") + Object postalCode; + + private FrMealVouchersOnboardingUpdateParams( + List expand, Map extraParams, Object postalCode) { + this.expand = expand; + this.extraParams = extraParams; + this.postalCode = postalCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Object postalCode; + + /** Finalize and obtain parameter instance from this builder. */ + public FrMealVouchersOnboardingUpdateParams build() { + return new FrMealVouchersOnboardingUpdateParams( + this.expand, this.extraParams, this.postalCode); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FrMealVouchersOnboardingUpdateParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FrMealVouchersOnboardingUpdateParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * FrMealVouchersOnboardingUpdateParams#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 FrMealVouchersOnboardingUpdateParams#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. Corrected Postal code of the restaurant. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** Required. Corrected Postal code of the restaurant. */ + public Builder setPostalCode(EmptyParam postalCode) { + this.postalCode = postalCode; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 8b16f4d7a96..32028352253 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -1919,17 +1919,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -1947,10 +1953,17 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.Discount build() { return new InvoiceCreatePreviewParams.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -2002,6 +2015,12 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(InvoiceCreatePreviewParams.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -2244,361 +2263,735 @@ public enum Type implements ApiRequestParams.EnumParam { } } } - } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class InvoiceItem { - /** The integer amount in cents (or local equivalent) of previewed invoice item. */ - @SerializedName("amount") - Long amount; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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; - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. Only applicable to new invoice items. - */ - @SerializedName("currency") - String currency; + /** Configures service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; - /** - * An arbitrary string which you can attach to the invoice item. The description is displayed in - * the invoice for easy tracking. - */ - @SerializedName("description") - String description; + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; - /** - * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except - * for negative invoice items. - */ - @SerializedName("discountable") - Boolean discountable; + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } - /** The coupons to redeem into discounts for the invoice item in the preview. */ - @SerializedName("discounts") - Object discounts; + public static Builder builder() { + return new Builder(); + } - /** - * 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 class Builder { + private Map extraParams; - /** - * The ID of the invoice item to update in preview. If not specified, a new invoice item will be - * added to the preview of the upcoming invoice. - */ - @SerializedName("invoiceitem") - String invoiceitem; + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; - /** - * Set of key-value pairs that you can attach - * to an object. This can be useful for storing additional information about the object in a - * structured format. Individual keys can be unset by posting an empty value to them. All keys - * can be unset by posting an empty value to {@code metadata}. - */ - @SerializedName("metadata") - Object metadata; + private StartDate startDate; - /** - * The period associated with this invoice item. When set to different values, the period will - * be rendered on the invoice. If you have Stripe Revenue Recognition enabled, - * the period will be used to recognize and defer revenue. See the Revenue - * Recognition documentation for details. - */ - @SerializedName("period") - Period period; + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.Discount.Settings build() { + return new InvoiceCreatePreviewParams.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } - /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ - @SerializedName("price") - String price; + /** + * 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 InvoiceCreatePreviewParams.Discount.Settings#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; + } - /** - * Data used to generate a new Price object - * inline. One of {@code price} or {@code price_data} is required. - */ - @SerializedName("price_data") - PriceData priceData; + /** + * 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 InvoiceCreatePreviewParams.Discount.Settings#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } - /** Non-negative integer. The quantity of units for the invoice item. */ - @SerializedName("quantity") - Long quantity; + /** Configures service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } - /** - * Only required if a default - * tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is - * considered inclusive of taxes or exclusive of taxes. One of {@code inclusive}, {@code - * exclusive}, or {@code unspecified}. Once specified as either {@code inclusive} or {@code - * exclusive}, it cannot be changed. - */ - @SerializedName("tax_behavior") - TaxBehavior taxBehavior; + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + public Builder setStartDate( + InvoiceCreatePreviewParams.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } - /** A tax code ID. */ - @SerializedName("tax_code") - Object taxCode; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; - /** - * The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply to - * this item. - */ - @SerializedName("tax_rates") - Object taxRates; + /** + * 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 integer unit amount in cents (or local equivalent) of the charge to be applied to the - * upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. - * If you want to apply a credit to the customer's account, pass a negative unit_amount. - */ - @SerializedName("unit_amount") - Long unitAmount; + /** + * The type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + @SerializedName("type") + Type type; - /** - * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent) with - * at most 12 decimal places. Only one of {@code unit_amount} and {@code unit_amount_decimal} - * can be set. - */ - @SerializedName("unit_amount_decimal") - BigDecimal unitAmountDecimal; + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } - private InvoiceItem( - Long amount, - String currency, - String description, - Boolean discountable, - Object discounts, - Map extraParams, - String invoiceitem, - Object metadata, - Period period, - String price, - PriceData priceData, - Long quantity, - TaxBehavior taxBehavior, - Object taxCode, - Object taxRates, - Long unitAmount, - BigDecimal unitAmountDecimal) { - this.amount = amount; - this.currency = currency; - this.description = description; - this.discountable = discountable; - this.discounts = discounts; - this.extraParams = extraParams; - this.invoiceitem = invoiceitem; - this.metadata = metadata; - this.period = period; - this.price = price; - this.priceData = priceData; - this.quantity = quantity; - this.taxBehavior = taxBehavior; - this.taxCode = taxCode; - this.taxRates = taxRates; - this.unitAmount = unitAmount; - this.unitAmountDecimal = unitAmountDecimal; - } + public static Builder builder() { + return new Builder(); + } - public static Builder builder() { - return new Builder(); - } + public static class Builder { + private Custom custom; - public static class Builder { - private Long amount; + private Map extraParams; - private String currency; + private Type type; - private String description; + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig build() { + return new InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.type); + } - private Boolean discountable; + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + public Builder setCustom( + InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + return this; + } - private Object discounts; + /** + * 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 + * InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig#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 Map extraParams; + /** + * 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 + * InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig#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 String invoiceitem; + /** + * The type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + public Builder setType( + InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig.Type type) { + this.type = type; + return this; + } + } - private Object metadata; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 to + * 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; - private Period period; + /** + * 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 price; + /** The hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; - private PriceData priceData; + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; - private Long quantity; + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; - private TaxBehavior taxBehavior; + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; - private Object taxCode; + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } - private Object taxRates; + public static Builder builder() { + return new Builder(); + } - private Long unitAmount; + public static class Builder { + private Long dayOfMonth; - private BigDecimal unitAmountDecimal; + private Map extraParams; - /** Finalize and obtain parameter instance from this builder. */ - public InvoiceCreatePreviewParams.InvoiceItem build() { - return new InvoiceCreatePreviewParams.InvoiceItem( - this.amount, - this.currency, - this.description, - this.discountable, - this.discounts, - this.extraParams, - this.invoiceitem, - this.metadata, - this.period, - this.price, - this.priceData, - this.quantity, - this.taxBehavior, - this.taxCode, - this.taxRates, - this.unitAmount, - this.unitAmountDecimal); - } + private Long hour; - /** The integer amount in cents (or local equivalent) of previewed invoice item. */ - public Builder setAmount(Long amount) { - this.amount = amount; - return this; - } + private Long minute; - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. Only applicable to new invoice items. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } + private Long month; - /** - * An arbitrary string which you can attach to the invoice item. The description is displayed - * in the invoice for easy tracking. - */ - public Builder setDescription(String description) { - this.description = description; - return this; - } + private Long second; - /** - * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except - * for negative invoice items. - */ - public Builder setDiscountable(Boolean discountable) { - this.discountable = discountable; - return this; - } + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig.Custom + build() { + return new InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig + .Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } - /** - * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, - * and subsequent calls adds additional elements to the original list. See {@link - * InvoiceCreatePreviewParams.InvoiceItem#discounts} for the field documentation. - */ - @SuppressWarnings("unchecked") - public Builder addDiscount(InvoiceCreatePreviewParams.InvoiceItem.Discount element) { - if (this.discounts == null || this.discounts instanceof EmptyParam) { - this.discounts = new ArrayList(); - } - ((List) this.discounts).add(element); - return this; - } + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + return this; + } - /** - * Add all elements to `discounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * InvoiceCreatePreviewParams.InvoiceItem#discounts} for the field documentation. - */ - @SuppressWarnings("unchecked") - public Builder addAllDiscount( - List elements) { - if (this.discounts == null || this.discounts instanceof EmptyParam) { - this.discounts = new ArrayList(); - } - ((List) this.discounts).addAll(elements); - 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 + * InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 coupons to redeem into discounts for the invoice item in the preview. */ - public Builder setDiscounts(EmptyParam discounts) { - this.discounts = discounts; - 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 + * InvoiceCreatePreviewParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 coupons to redeem into discounts for the invoice item in the preview. */ - public Builder setDiscounts(List discounts) { - this.discounts = discounts; - return this; - } + /** The hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + 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 - * InvoiceCreatePreviewParams.InvoiceItem#extraParams} for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + 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 InvoiceCreatePreviewParams.InvoiceItem#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("subscription_service_cycle_anchor") + SUBSCRIPTION_SERVICE_CYCLE_ANCHOR("subscription_service_cycle_anchor"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } - this.extraParams.putAll(map); - return this; } - /** - * The ID of the invoice item to update in preview. If not specified, a new invoice item will - * be added to the preview of the upcoming invoice. - */ - public Builder setInvoiceitem(String invoiceitem) { - this.invoiceitem = invoiceitem; - return this; - } + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), - /** - * Add a key/value pair to `metadata` 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 - * InvoiceCreatePreviewParams.InvoiceItem#metadata} for the field documentation. - */ - @SuppressWarnings("unchecked") - public Builder putMetadata(String key, String value) { - if (this.metadata == null || this.metadata instanceof EmptyParam) { - this.metadata = new HashMap(); + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; } - ((Map) this.metadata).put(key, value); - return this; } + } + } - /** - * Add all map key/value pairs to `metadata` 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 InvoiceCreatePreviewParams.InvoiceItem#metadata} for the field documentation. - */ - @SuppressWarnings("unchecked") - public Builder putAllMetadata(Map map) { - if (this.metadata == null || this.metadata instanceof EmptyParam) { - this.metadata = new HashMap(); + @Getter + @EqualsAndHashCode(callSuper = false) + public static class InvoiceItem { + /** The integer amount in cents (or local equivalent) of previewed invoice item. */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. Only applicable to new invoice items. + */ + @SerializedName("currency") + String currency; + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed in + * the invoice for easy tracking. + */ + @SerializedName("description") + String description; + + /** + * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except + * for negative invoice items. + */ + @SerializedName("discountable") + Boolean discountable; + + /** The coupons to redeem into discounts for the invoice item in the preview. */ + @SerializedName("discounts") + Object discounts; + + /** + * 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 invoice item to update in preview. If not specified, a new invoice item will be + * added to the preview of the upcoming invoice. + */ + @SerializedName("invoiceitem") + String invoiceitem; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + /** + * The period associated with this invoice item. When set to different values, the period will + * be rendered on the invoice. If you have Stripe Revenue Recognition enabled, + * the period will be used to recognize and defer revenue. See the Revenue + * Recognition documentation for details. + */ + @SerializedName("period") + Period period; + + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ + @SerializedName("price") + String price; + + /** + * Data used to generate a new Price object + * inline. One of {@code price} or {@code price_data} is required. + */ + @SerializedName("price_data") + PriceData priceData; + + /** Non-negative integer. The quantity of units for the invoice item. */ + @SerializedName("quantity") + Long quantity; + + /** + * Only required if a default + * tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is + * considered inclusive of taxes or exclusive of taxes. One of {@code inclusive}, {@code + * exclusive}, or {@code unspecified}. Once specified as either {@code inclusive} or {@code + * exclusive}, it cannot be changed. + */ + @SerializedName("tax_behavior") + TaxBehavior taxBehavior; + + /** A tax code ID. */ + @SerializedName("tax_code") + Object taxCode; + + /** + * The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply to + * this item. + */ + @SerializedName("tax_rates") + Object taxRates; + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the + * upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. + * If you want to apply a credit to the customer's account, pass a negative unit_amount. + */ + @SerializedName("unit_amount") + Long unitAmount; + + /** + * Same as {@code unit_amount}, but accepts a decimal value in cents (or local equivalent) with + * at most 12 decimal places. Only one of {@code unit_amount} and {@code unit_amount_decimal} + * can be set. + */ + @SerializedName("unit_amount_decimal") + BigDecimal unitAmountDecimal; + + private InvoiceItem( + Long amount, + String currency, + String description, + Boolean discountable, + Object discounts, + Map extraParams, + String invoiceitem, + Object metadata, + Period period, + String price, + PriceData priceData, + Long quantity, + TaxBehavior taxBehavior, + Object taxCode, + Object taxRates, + Long unitAmount, + BigDecimal unitAmountDecimal) { + this.amount = amount; + this.currency = currency; + this.description = description; + this.discountable = discountable; + this.discounts = discounts; + this.extraParams = extraParams; + this.invoiceitem = invoiceitem; + this.metadata = metadata; + this.period = period; + this.price = price; + this.priceData = priceData; + this.quantity = quantity; + this.taxBehavior = taxBehavior; + this.taxCode = taxCode; + this.taxRates = taxRates; + this.unitAmount = unitAmount; + this.unitAmountDecimal = unitAmountDecimal; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private String description; + + private Boolean discountable; + + private Object discounts; + + private Map extraParams; + + private String invoiceitem; + + private Object metadata; + + private Period period; + + private String price; + + private PriceData priceData; + + private Long quantity; + + private TaxBehavior taxBehavior; + + private Object taxCode; + + private Object taxRates; + + private Long unitAmount; + + private BigDecimal unitAmountDecimal; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.InvoiceItem build() { + return new InvoiceCreatePreviewParams.InvoiceItem( + this.amount, + this.currency, + this.description, + this.discountable, + this.discounts, + this.extraParams, + this.invoiceitem, + this.metadata, + this.period, + this.price, + this.priceData, + this.quantity, + this.taxBehavior, + this.taxCode, + this.taxRates, + this.unitAmount, + this.unitAmountDecimal); + } + + /** The integer amount in cents (or local equivalent) of previewed invoice item. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. Only applicable to new invoice items. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed + * in the invoice for easy tracking. + */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except + * for negative invoice items. + */ + public Builder setDiscountable(Boolean discountable) { + this.discountable = discountable; + return this; + } + + /** + * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * InvoiceCreatePreviewParams.InvoiceItem#discounts} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addDiscount(InvoiceCreatePreviewParams.InvoiceItem.Discount element) { + if (this.discounts == null || this.discounts instanceof EmptyParam) { + this.discounts = new ArrayList(); + } + ((List) this.discounts).add(element); + return this; + } + + /** + * Add all elements to `discounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * InvoiceCreatePreviewParams.InvoiceItem#discounts} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllDiscount( + List elements) { + if (this.discounts == null || this.discounts instanceof EmptyParam) { + this.discounts = new ArrayList(); + } + ((List) this.discounts).addAll(elements); + return this; + } + + /** The coupons to redeem into discounts for the invoice item in the preview. */ + public Builder setDiscounts(EmptyParam discounts) { + this.discounts = discounts; + return this; + } + + /** The coupons to redeem into discounts for the invoice item in the preview. */ + public Builder setDiscounts(List discounts) { + this.discounts = discounts; + 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 + * InvoiceCreatePreviewParams.InvoiceItem#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 InvoiceCreatePreviewParams.InvoiceItem#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 invoice item to update in preview. If not specified, a new invoice item will + * be added to the preview of the upcoming invoice. + */ + public Builder setInvoiceitem(String invoiceitem) { + this.invoiceitem = invoiceitem; + return this; + } + + /** + * Add a key/value pair to `metadata` 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 + * InvoiceCreatePreviewParams.InvoiceItem#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 InvoiceCreatePreviewParams.InvoiceItem#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); } ((Map) this.metadata).putAll(map); return this; @@ -5368,19 +5761,25 @@ public static class Add { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Add( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, Long index, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.index = index; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -5400,6 +5799,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add( @@ -5408,7 +5809,8 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add b this.discountEnd, this.extraParams, this.index, - this.promotionCode); + this.promotionCode, + this.settings); } /** The coupon code to redeem. */ @@ -5442,44 +5844,150 @@ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } - this.extraParams.put(key, value); - 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add#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 index, starting at 0, at which to position the new discount. When not supplied, + * Stripe defaults to appending the discount to the end of the {@code discounts} array. + */ + public Builder setIndex(Long index) { + this.index = index; + return this; + } + + /** The promotion code to redeem. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings + settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DiscountEnd { + /** + * 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 type of calculation made to determine when the + * discount ends. + */ + @SerializedName("type") + Type type; + + private DiscountEnd(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add + .DiscountEnd + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add + .DiscountEnd(this.extraParams, 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.DiscountEnd#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.DiscountEnd#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 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 - * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + /** + * Required. The type of calculation made to determine when the + * discount ends. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add + .DiscountEnd.Type + type) { + this.type = type; + return this; } - this.extraParams.putAll(map); - return this; } - /** - * The index, starting at 0, at which to position the new discount. When not supplied, - * Stripe defaults to appending the discount to the end of the {@code discounts} array. - */ - public Builder setIndex(Long index) { - this.index = index; - return this; - } + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("amendment_end") + AMENDMENT_END("amendment_end"); - /** The promotion code to redeem. */ - public Builder setPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } @Getter @EqualsAndHashCode(callSuper = false) - public static class DiscountEnd { + public static class Settings { /** * 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} @@ -5490,16 +5998,24 @@ public static class DiscountEnd { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Configures service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + /** - * Required. The type of calculation made to determine when the - * discount ends. + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if omitted. */ - @SerializedName("type") - Type type; + @SerializedName("start_date") + StartDate startDate; - private DiscountEnd(Map extraParams, Type type) { + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { this.extraParams = extraParams; - this.type = type; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; } public static Builder builder() { @@ -5509,21 +6025,23 @@ public static Builder builder() { public static class Builder { private Map extraParams; - private Type type; + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add - .DiscountEnd + .Settings build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add - .DiscountEnd(this.extraParams, this.type); + .Settings(this.extraParams, this.servicePeriodAnchorConfig, this.startDate); } /** * 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 - * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.DiscountEnd#extraParams} + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -5538,7 +6056,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 - * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.DiscountEnd#extraParams} + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -5549,27 +6067,311 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Configures service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + /** - * Required. The type of calculation made to determine when the - * discount ends. + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if + * omitted. */ - public Builder setType( - InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add - .DiscountEnd.Type - type) { - this.type = type; + public Builder setStartDate( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings + .StartDate + startDate) { + this.startDate = startDate; return this; } } - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("amendment_end") - AMENDMENT_END("amendment_end"); + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add + .Settings.ServicePeriodAnchorConfig + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add + .Settings.ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings.ServicePeriodAnchorConfig#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add + .Settings.ServicePeriodAnchorConfig.Custom + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction + .Add.Settings.ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings.ServicePeriodAnchorConfig.Custom#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Add.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("amendment_start") + AMENDMENT_START("amendment_start"), + + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"); @Getter(onMethod_ = {@Override}) private final String value; - Type(String value) { + StartDate(String value) { this.value = value; } } @@ -5707,15 +6509,21 @@ public static class Set { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Set( String coupon, String discount, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -5731,10 +6539,12 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set( - this.coupon, this.discount, this.extraParams, this.promotionCode); + this.coupon, this.discount, this.extraParams, this.promotionCode, this.settings); } /** The coupon code to replace the {@code discounts} array with. */ @@ -5775,14 +6585,414 @@ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } - this.extraParams.putAll(map); - return this; + this.extraParams.putAll(map); + return this; + } + + /** An ID of an existing promotion code to replace the {@code discounts} array with. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings + settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set + .Settings + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set + .Settings(this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if + * omitted. + */ + public Builder setStartDate( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings + .StartDate + startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set + .Settings.ServicePeriodAnchorConfig + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set + .Settings.ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings.ServicePeriodAnchorConfig#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set + .Settings.ServicePeriodAnchorConfig.Custom + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction + .Set.Settings.ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings.ServicePeriodAnchorConfig.Custom#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.DiscountAction.Set.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } } - /** An ID of an existing promotion code to replace the {@code discounts} array with. */ - public Builder setPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("amendment_start") + AMENDMENT_START("amendment_start"), + + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } } } } @@ -6225,17 +7435,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -6253,6 +7469,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount build() { @@ -6262,7 +7480,8 @@ public static class Builder { this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -6321,6 +7540,15 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount + .Settings + settings) { + this.settings = settings; + return this; + } } @Getter @@ -6535,50 +7763,447 @@ public Builder setInterval( 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; - } - } + /** + * 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; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if + * omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount + .Settings + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add + .Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount.Settings#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount + .Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or + * promotion code with a service period duration. Defaults to {@code + * amendment_start} if omitted. + */ + public Builder setStartDate( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount + .Settings.StartDate + startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add + .Discount.Settings.ServicePeriodAnchorConfig + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add + .Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount + .Settings.ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount.Settings.ServicePeriodAnchorConfig#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if + * omitted. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount + .Settings.ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add + .Discount.Settings.ServicePeriodAnchorConfig.Custom + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add + .Discount.Settings.ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Add.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } - public enum Interval implements ApiRequestParams.EnumParam { - @SerializedName("day") - DAY("day"), + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } - @SerializedName("month") - MONTH("month"), + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } - @SerializedName("week") - WEEK("week"), + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), - @SerializedName("year") - YEAR("year"); + @SerializedName("inherit") + INHERIT("inherit"); @Getter(onMethod_ = {@Override}) private final String value; - Interval(String value) { + Type(String value) { this.value = value; } } } - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("duration") - DURATION("duration"), + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("amendment_start") + AMENDMENT_START("amendment_start"), - @SerializedName("timestamp") - TIMESTAMP("timestamp"); + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"); @Getter(onMethod_ = {@Override}) private final String value; - Type(String value) { + StartDate(String value) { this.value = value; } } @@ -7102,17 +8727,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -7130,6 +8761,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount build() { @@ -7139,7 +8772,8 @@ public static class Builder { this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -7198,6 +8832,15 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount + .Settings + settings) { + this.settings = settings; + return this; + } } @Getter @@ -7423,39 +9066,436 @@ public Builder setIntervalCount(Long intervalCount) { } } - public enum Interval implements ApiRequestParams.EnumParam { - @SerializedName("day") - DAY("day"), + 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; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if + * omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount + .Settings + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set + .Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount.Settings#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount + .Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or + * promotion code with a service period duration. Defaults to {@code + * amendment_start} if omitted. + */ + public Builder setStartDate( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount + .Settings.StartDate + startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set + .Discount.Settings.ServicePeriodAnchorConfig + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set + .Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount + .Settings.ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount.Settings.ServicePeriodAnchorConfig#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if + * omitted. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount + .Settings.ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set + .Discount.Settings.ServicePeriodAnchorConfig.Custom + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set + .Discount.Settings.ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Amendment.ItemAction.Set.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } - @SerializedName("month") - MONTH("month"), + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } - @SerializedName("week") - WEEK("week"), + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } - @SerializedName("year") - YEAR("year"); + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); @Getter(onMethod_ = {@Override}) private final String value; - Interval(String value) { + Type(String value) { this.value = value; } } } - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("duration") - DURATION("duration"), + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("amendment_start") + AMENDMENT_START("amendment_start"), - @SerializedName("timestamp") - TIMESTAMP("timestamp"); + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"); @Getter(onMethod_ = {@Override}) private final String value; - Type(String value) { + StartDate(String value) { this.value = value; } } @@ -11275,197 +13315,465 @@ private BillingThresholds( this.resetBillingCycleAnchor = resetBillingCycleAnchor; } - public static Builder builder() { - return new Builder(); - } + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountGte; + + private Map extraParams; + + private Boolean resetBillingCycleAnchor; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); + } + + /** + * Monetary threshold that triggers the subscription to advance to a new billing period. + */ + public Builder setAmountGte(Long amountGte) { + this.amountGte = amountGte; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Indicates if the {@code billing_cycle_anchor} should be reset when a threshold is + * reached. If true, {@code billing_cycle_anchor} will be updated to the date/time the + * threshold was last reached; otherwise, the value will remain unchanged. + */ + public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Discount { + /** ID of the coupon to create a new discount for. */ + @SerializedName("coupon") + String coupon; + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + @SerializedName("discount") + String discount; + + /** Details to determine how long the discount should be applied for. */ + @SerializedName("discount_end") + DiscountEnd discountEnd; + + /** + * 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; + + /** ID of the promotion code to create a new discount for. */ + @SerializedName("promotion_code") + String promotionCode; + + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + + private Discount( + String coupon, + String discount, + DiscountEnd discountEnd, + Map extraParams, + String promotionCode, + Settings settings) { + this.coupon = coupon; + this.discount = discount; + this.discountEnd = discountEnd; + this.extraParams = extraParams; + this.promotionCode = promotionCode; + this.settings = settings; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String coupon; + + private String discount; + + private DiscountEnd discountEnd; + + private Map extraParams; + + private String promotionCode; + + private Settings settings; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount( + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); + } + + /** ID of the coupon to create a new discount for. */ + public Builder setCoupon(String coupon) { + this.coupon = coupon; + return this; + } + + /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ + public Builder setDiscount(String discount) { + this.discount = discount; + return this; + } + + /** Details to determine how long the discount should be applied for. */ + public Builder setDiscountEnd( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd discountEnd) { + this.discountEnd = discountEnd; + 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 InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount#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 InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** ID of the promotion code to create a new discount for. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DiscountEnd { + /** Time span for the redeemed discount. */ + @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; + + /** A precise Unix timestamp for the discount to end. Must be in the future. */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. The type of calculation made to determine when the discount + * ends. + */ + @SerializedName("type") + Type type; + + private DiscountEnd( + Duration duration, Map extraParams, Long timestamp, Type type) { + this.duration = duration; + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Duration duration; + + private Map extraParams; + + private Long timestamp; - public static class Builder { - private Long amountGte; + private Type type; - private Map extraParams; + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd( + this.duration, this.extraParams, this.timestamp, this.type); + } - private Boolean resetBillingCycleAnchor; + /** Time span for the redeemed discount. */ + public Builder setDuration( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Duration + duration) { + this.duration = duration; + return this; + } - /** Finalize and obtain parameter instance from this builder. */ - public InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds build() { - return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds( - this.amountGte, this.extraParams, this.resetBillingCycleAnchor); - } + /** + * 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd#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; + } - /** - * Monetary threshold that triggers the subscription to advance to a new billing period. - */ - public Builder setAmountGte(Long amountGte) { - this.amountGte = amountGte; - 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd#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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds#extraParams} for the - * field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + /** A precise Unix timestamp for the discount to end. Must be in the future. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + 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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds#extraParams} for the - * field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + /** + * Required. The type of calculation made to determine when the + * discount ends. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Type type) { + this.type = type; + return this; } - this.extraParams.putAll(map); - return this; } - /** - * Indicates if the {@code billing_cycle_anchor} should be reset when a threshold is - * reached. If true, {@code billing_cycle_anchor} will be updated to the date/time the - * threshold was last reached; otherwise, the value will remain unchanged. - */ - public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { - this.resetBillingCycleAnchor = resetBillingCycleAnchor; - 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; - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Discount { - /** ID of the coupon to create a new discount for. */ - @SerializedName("coupon") - String coupon; + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + @SerializedName("interval") + Interval interval; - /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ - @SerializedName("discount") - String discount; + /** + * 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; - /** Details to determine how long the discount should be applied for. */ - @SerializedName("discount_end") - DiscountEnd discountEnd; + private Duration( + Map extraParams, Interval interval, Long intervalCount) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + } - /** - * 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(); + } - /** ID of the promotion code to create a new discount for. */ - @SerializedName("promotion_code") - String promotionCode; + public static class Builder { + private Map extraParams; - private Discount( - String coupon, - String discount, - DiscountEnd discountEnd, - Map extraParams, - String promotionCode) { - this.coupon = coupon; - this.discount = discount; - this.discountEnd = discountEnd; - this.extraParams = extraParams; - this.promotionCode = promotionCode; - } + private Interval interval; - public static Builder builder() { - return new Builder(); - } + private Long intervalCount; - public static class Builder { - private String coupon; + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Duration + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd + .Duration(this.extraParams, this.interval, this.intervalCount); + } - private String discount; + /** + * 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.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; + } - private DiscountEnd discountEnd; + /** + * 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.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; + } - private Map extraParams; + /** + * Required. Specifies a type of interval unit. Either {@code day}, + * {@code week}, {@code month} or {@code year}. + */ + public Builder setInterval( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Duration + .Interval + interval) { + this.interval = interval; + return this; + } - private String promotionCode; + /** + * 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; + } + } - /** Finalize and obtain parameter instance from this builder. */ - public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount build() { - return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); - } + public enum Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), - /** ID of the coupon to create a new discount for. */ - public Builder setCoupon(String coupon) { - this.coupon = coupon; - return this; - } + @SerializedName("month") + MONTH("month"), - /** ID of an existing discount on the object (or one of its ancestors) to reuse. */ - public Builder setDiscount(String discount) { - this.discount = discount; - return this; - } + @SerializedName("week") + WEEK("week"), - /** Details to determine how long the discount should be applied for. */ - public Builder setDiscountEnd( - InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd discountEnd) { - this.discountEnd = discountEnd; - return this; - } + @SerializedName("year") + YEAR("year"); - /** - * 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 InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount#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 InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + Interval(String value) { + this.value = value; + } } - this.extraParams.putAll(map); - return this; } - /** ID of the promotion code to create a new discount for. */ - public Builder setPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } @Getter @EqualsAndHashCode(callSuper = false) - public static class DiscountEnd { - /** Time span for the redeemed discount. */ - @SerializedName("duration") - Duration duration; - + public static class Settings { /** * 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. @@ -11476,23 +13784,24 @@ public static class DiscountEnd { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** A precise Unix timestamp for the discount to end. Must be in the future. */ - @SerializedName("timestamp") - Long timestamp; + /** Configures service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; /** - * Required. The type of calculation made to determine when the discount - * ends. + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. */ - @SerializedName("type") - Type type; + @SerializedName("start_date") + StartDate startDate; - private DiscountEnd( - Duration duration, Map extraParams, Long timestamp, Type type) { - this.duration = duration; + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { this.extraParams = extraParams; - this.timestamp = timestamp; - this.type = type; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; } public static Builder builder() { @@ -11500,34 +13809,24 @@ public static Builder builder() { } public static class Builder { - private Duration duration; - private Map extraParams; - private Long timestamp; + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; - private Type type; + private StartDate startDate; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd build() { - return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd( - this.duration, this.extraParams, this.timestamp, this.type); - } - - /** Time span for the redeemed discount. */ - public Builder setDuration( - InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Duration - duration) { - this.duration = duration; - return this; + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); } /** * 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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd#extraParams} - * for the field documentation. + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings#extraParams} for + * the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -11541,8 +13840,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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd#extraParams} - * for the field documentation. + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings#extraParams} for + * the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -11552,26 +13851,36 @@ public Builder putAllExtraParam(Map map) { return this; } - /** A precise Unix timestamp for the discount to end. Must be in the future. */ - public Builder setTimestamp(Long timestamp) { - this.timestamp = timestamp; + /** Configures service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; return this; } /** - * Required. The type of calculation made to determine when the - * discount ends. + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. */ - public Builder setType( - InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Type type) { - this.type = type; + public Builder setStartDate( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings.StartDate + startDate) { + this.startDate = startDate; return this; } } @Getter @EqualsAndHashCode(callSuper = false) - public static class Duration { + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + /** * 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} @@ -11582,25 +13891,15 @@ public static class Duration { @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; + /** The type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; - private Duration( - Map extraParams, Interval interval, Long intervalCount) { + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; this.extraParams = extraParams; - this.interval = interval; - this.intervalCount = intervalCount; + this.type = type; } public static Builder builder() { @@ -11608,24 +13907,36 @@ public static Builder builder() { } public static class Builder { - private Map extraParams; + private Custom custom; - private Interval interval; + private Map extraParams; - private Long intervalCount; + private Type type; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Duration + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings + .ServicePeriodAnchorConfig build() { - return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd - .Duration(this.extraParams, this.interval, this.intervalCount); + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Duration#extraParams} + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings.ServicePeriodAnchorConfig#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -11640,7 +13951,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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Duration#extraParams} + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings.ServicePeriodAnchorConfig#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -11652,60 +13963,194 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. Specifies a type of interval unit. Either {@code day}, - * {@code week}, {@code month} or {@code year}. + * The type of service period anchor config. Defaults to {@code inherit} if omitted. */ - public Builder setInterval( - InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.DiscountEnd.Duration - .Interval - interval) { - this.interval = interval; + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; return this; } + } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { /** - * Required. The number of intervals, as an whole number greater than - * 0. Stripe multiplies this by the interval type to get the overall duration. + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. */ - public Builder setIntervalCount(Long intervalCount) { - this.intervalCount = intervalCount; - return this; - } - } + @SerializedName("day_of_month") + Long dayOfMonth; - public enum Interval implements ApiRequestParams.EnumParam { - @SerializedName("day") - DAY("day"), + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ @SerializedName("month") - MONTH("month"), + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } - @SerializedName("week") - WEEK("week"), + public static Builder builder() { + return new Builder(); + } - @SerializedName("year") - YEAR("year"); + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); @Getter(onMethod_ = {@Override}) private final String value; - Interval(String value) { + Type(String value) { this.value = value; } } } - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("duration") - DURATION("duration"), + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), - @SerializedName("timestamp") - TIMESTAMP("timestamp"); + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); @Getter(onMethod_ = {@Override}) private final String value; - Type(String value) { + StartDate(String value) { this.value = value; } } @@ -12587,17 +15032,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -12615,6 +15066,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount( @@ -12622,7 +15075,8 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount build() { this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -12656,39 +15110,298 @@ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } - this.extraParams.put(key, value); - 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** ID of the promotion code to create a new discount for. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DiscountEnd { + /** Time span for the redeemed discount. */ + @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; + + /** A precise Unix timestamp for the discount to end. Must be in the future. */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. The type of calculation made to determine when the + * discount ends. + */ + @SerializedName("type") + Type type; + + private DiscountEnd( + Duration duration, Map extraParams, Long timestamp, Type type) { + this.duration = duration; + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Duration duration; + + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount + .DiscountEnd(this.duration, this.extraParams, this.timestamp, this.type); + } + + /** Time span for the redeemed discount. */ + public Builder setDuration( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd + .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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd#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 precise Unix timestamp for the discount to end. Must be in the future. */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. The type of calculation made to determine when the + * discount ends. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd.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 InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd + .Duration + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount + .DiscountEnd.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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd.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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd.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( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd + .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; + } + } - /** - * 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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount#extraParams} for the - * field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + 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; + } } - this.extraParams.putAll(map); - return this; } - /** ID of the promotion code to create a new discount for. */ - public Builder setPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } @Getter @EqualsAndHashCode(callSuper = false) - public static class DiscountEnd { - /** Time span for the redeemed discount. */ - @SerializedName("duration") - Duration duration; - + public static class Settings { /** * 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} @@ -12699,23 +15412,24 @@ public static class DiscountEnd { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** A precise Unix timestamp for the discount to end. Must be in the future. */ - @SerializedName("timestamp") - Long timestamp; + /** Configures service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; /** - * Required. The type of calculation made to determine when the - * discount ends. + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. */ - @SerializedName("type") - Type type; + @SerializedName("start_date") + StartDate startDate; - private DiscountEnd( - Duration duration, Map extraParams, Long timestamp, Type type) { - this.duration = duration; + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { this.extraParams = extraParams; - this.timestamp = timestamp; - this.type = type; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; } public static Builder builder() { @@ -12723,35 +15437,24 @@ public static Builder builder() { } public static class Builder { - private Duration duration; - private Map extraParams; - private Long timestamp; + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; - private Type type; + private StartDate startDate; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings build() { - return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount - .DiscountEnd(this.duration, this.extraParams, this.timestamp, this.type); - } - - /** Time span for the redeemed discount. */ - public Builder setDuration( - InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd - .Duration - duration) { - this.duration = duration; - return this; + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); } /** * 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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd#extraParams} + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -12766,7 +15469,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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd#extraParams} + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -12777,27 +15480,36 @@ public Builder putAllExtraParam(Map map) { return this; } - /** A precise Unix timestamp for the discount to end. Must be in the future. */ - public Builder setTimestamp(Long timestamp) { - this.timestamp = timestamp; + /** Configures service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; return this; } /** - * Required. The type of calculation made to determine when the - * discount ends. + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. */ - public Builder setType( - InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd.Type - type) { - this.type = type; + public Builder setStartDate( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings.StartDate + startDate) { + this.startDate = startDate; return this; } } @Getter @EqualsAndHashCode(callSuper = false) - public static class Duration { + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + /** * 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 @@ -12809,24 +15521,16 @@ public static class Duration { 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. + * The type of service period anchor config. Defaults to {@code inherit} if omitted. */ - @SerializedName("interval_count") - Long intervalCount; + @SerializedName("type") + Type type; - private Duration( - Map extraParams, Interval interval, Long intervalCount) { + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; this.extraParams = extraParams; - this.interval = interval; - this.intervalCount = intervalCount; + this.type = type; } public static Builder builder() { @@ -12834,25 +15538,37 @@ public static Builder builder() { } public static class Builder { - private Map extraParams; + private Custom custom; - private Interval interval; + private Map extraParams; - private Long intervalCount; + private Type type; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd - .Duration + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig build() { - return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount - .DiscountEnd.Duration(this.extraParams, this.interval, this.intervalCount); + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd.Duration#extraParams} + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig#extraParams} * for the field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -12867,7 +15583,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 - * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd.Duration#extraParams} + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig#extraParams} * for the field documentation. */ public Builder putAllExtraParam(Map map) { @@ -12879,60 +15595,194 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. Specifies a type of interval unit. Either {@code day}, - * {@code week}, {@code month} or {@code year}. + * The type of service period anchor config. Defaults to {@code inherit} if omitted. */ - public Builder setInterval( - InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.DiscountEnd - .Duration.Interval - interval) { - this.interval = interval; + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; return this; } + } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { /** - * Required. The number of intervals, as an whole number greater - * than 0. Stripe multiplies this by the interval type to get the overall duration. + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. */ - public Builder setIntervalCount(Long intervalCount) { - this.intervalCount = intervalCount; - return this; - } - } + @SerializedName("day_of_month") + Long dayOfMonth; - public enum Interval implements ApiRequestParams.EnumParam { - @SerializedName("day") - DAY("day"), + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ @SerializedName("month") - MONTH("month"), + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } - @SerializedName("week") - WEEK("week"), + public static Builder builder() { + return new Builder(); + } - @SerializedName("year") - YEAR("year"); + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount + .Settings.ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); @Getter(onMethod_ = {@Override}) private final String value; - Interval(String value) { + Type(String value) { this.value = value; } } } - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("duration") - DURATION("duration"), + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), - @SerializedName("timestamp") - TIMESTAMP("timestamp"); + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); @Getter(onMethod_ = {@Override}) private final String value; - Type(String value) { + StartDate(String value) { this.value = value; } } @@ -16246,17 +19096,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -16274,10 +19130,17 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount build() { return new InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -16335,6 +19198,13 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -16591,6 +19461,395 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code now} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings build() { + return new InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings#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 + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code now} if omitted. + */ + public Builder setStartDate( + InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings.StartDate + startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings.ServicePeriodAnchorConfig#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 + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + public Builder setType( + InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("subscription_service_cycle_anchor") + SUBSCRIPTION_SERVICE_CYCLE_ANCHOR("subscription_service_cycle_anchor"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index 493d91ed975..776baffb886 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -2268,19 +2268,25 @@ public static class AddDiscount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private AddDiscount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, Long index, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.index = index; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -2300,6 +2306,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public QuoteCreateParams.Line.Action.AddDiscount build() { return new QuoteCreateParams.Line.Action.AddDiscount( @@ -2308,7 +2316,8 @@ public QuoteCreateParams.Line.Action.AddDiscount build() { this.discountEnd, this.extraParams, this.index, - this.promotionCode); + this.promotionCode, + this.settings); } /** The coupon code to redeem. */ @@ -2372,6 +2381,12 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(QuoteCreateParams.Line.Action.AddDiscount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -2467,6 +2482,387 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.AddDiscount.Settings build() { + return new QuoteCreateParams.Line.Action.AddDiscount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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.Line.Action.AddDiscount.Settings#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.Line.Action.AddDiscount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + QuoteCreateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + public Builder setStartDate( + QuoteCreateParams.Line.Action.AddDiscount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig + build() { + return new QuoteCreateParams.Line.Action.AddDiscount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + QuoteCreateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig + .Custom + custom) { + this.custom = custom; + 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.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig#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.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + QuoteCreateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig + .Custom + build() { + return new QuoteCreateParams.Line.Action.AddDiscount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig.Custom#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.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("line_start") + LINE_START("line_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter @@ -2736,17 +3132,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -2764,6 +3166,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public QuoteCreateParams.Line.Action.AddItem.Discount build() { return new QuoteCreateParams.Line.Action.AddItem.Discount( @@ -2771,7 +3175,8 @@ public QuoteCreateParams.Line.Action.AddItem.Discount build() { this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -2826,6 +3231,13 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + QuoteCreateParams.Line.Action.AddItem.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -3076,6 +3488,392 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.AddItem.Discount.Settings build() { + return new QuoteCreateParams.Line.Action.AddItem.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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.Line.Action.AddItem.Discount.Settings#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.Line.Action.AddItem.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + QuoteCreateParams.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + public Builder setStartDate( + QuoteCreateParams.Line.Action.AddItem.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new QuoteCreateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + QuoteCreateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig#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.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + QuoteCreateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new QuoteCreateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig.Custom#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.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("line_start") + LINE_START("line_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter @@ -3401,12 +4199,21 @@ public static class SetDiscount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private SetDiscount( - String coupon, String discount, Map extraParams, String promotionCode) { + String coupon, + String discount, + Map extraParams, + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -3422,10 +4229,12 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public QuoteCreateParams.Line.Action.SetDiscount build() { return new QuoteCreateParams.Line.Action.SetDiscount( - this.coupon, this.discount, this.extraParams, this.promotionCode); + this.coupon, this.discount, this.extraParams, this.promotionCode, this.settings); } /** The coupon code to replace the {@code discounts} array with. */ @@ -3434,44 +4243,431 @@ public Builder setCoupon(String coupon) { return this; } - /** An ID of an existing discount to replace the {@code discounts} array with. */ - public Builder setDiscount(String discount) { - this.discount = discount; - return this; - } + /** An ID of an existing discount to replace the {@code discounts} array with. */ + public Builder setDiscount(String discount) { + this.discount = discount; + 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.Line.Action.SetDiscount#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.Line.Action.SetDiscount#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** An ID of an existing promotion code to replace the {@code discounts} array with. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(QuoteCreateParams.Line.Action.SetDiscount.Settings settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.SetDiscount.Settings build() { + return new QuoteCreateParams.Line.Action.SetDiscount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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.Line.Action.SetDiscount.Settings#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.Line.Action.SetDiscount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + QuoteCreateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + public Builder setStartDate( + QuoteCreateParams.Line.Action.SetDiscount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig + build() { + return new QuoteCreateParams.Line.Action.SetDiscount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + QuoteCreateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig + .Custom + custom) { + this.custom = custom; + 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.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig#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.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + QuoteCreateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig + .Custom + build() { + return new QuoteCreateParams.Line.Action.SetDiscount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig.Custom#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.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + 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.Line.Action.SetDiscount#extraParams} for the field - * documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + 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.Line.Action.SetDiscount#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } - this.extraParams.putAll(map); - return this; } - /** An ID of an existing promotion code to replace the {@code discounts} array with. */ - public Builder setPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("line_start") + LINE_START("line_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } } } } @@ -3764,17 +4960,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -3792,6 +4994,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public QuoteCreateParams.Line.Action.SetItem.Discount build() { return new QuoteCreateParams.Line.Action.SetItem.Discount( @@ -3799,7 +5003,8 @@ public QuoteCreateParams.Line.Action.SetItem.Discount build() { this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -3854,6 +5059,13 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + QuoteCreateParams.Line.Action.SetItem.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -4104,6 +5316,392 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.SetItem.Discount.Settings build() { + return new QuoteCreateParams.Line.Action.SetItem.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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.Line.Action.SetItem.Discount.Settings#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.Line.Action.SetItem.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + QuoteCreateParams.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + public Builder setStartDate( + QuoteCreateParams.Line.Action.SetItem.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new QuoteCreateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + QuoteCreateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig#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.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + QuoteCreateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new QuoteCreateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig.Custom#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.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("line_start") + LINE_START("line_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index b1ad4ffd917..843147a2a82 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -2202,19 +2202,25 @@ public static class AddDiscount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private AddDiscount( Object coupon, Object discount, DiscountEnd discountEnd, Map extraParams, Long index, - Object promotionCode) { + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.index = index; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -2234,6 +2240,8 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public QuoteUpdateParams.Line.Action.AddDiscount build() { return new QuoteUpdateParams.Line.Action.AddDiscount( @@ -2242,7 +2250,8 @@ public QuoteUpdateParams.Line.Action.AddDiscount build() { this.discountEnd, this.extraParams, this.index, - this.promotionCode); + this.promotionCode, + this.settings); } /** The coupon code to redeem. */ @@ -2324,6 +2333,12 @@ public Builder setPromotionCode(EmptyParam promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(QuoteUpdateParams.Line.Action.AddDiscount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -2419,6 +2434,387 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.AddDiscount.Settings build() { + return new QuoteUpdateParams.Line.Action.AddDiscount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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.Line.Action.AddDiscount.Settings#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.Line.Action.AddDiscount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + QuoteUpdateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + public Builder setStartDate( + QuoteUpdateParams.Line.Action.AddDiscount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig + build() { + return new QuoteUpdateParams.Line.Action.AddDiscount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + QuoteUpdateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig + .Custom + custom) { + this.custom = custom; + 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.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig#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.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + QuoteUpdateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig + .Custom + build() { + return new QuoteUpdateParams.Line.Action.AddDiscount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig.Custom#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.Line.Action.AddDiscount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("line_start") + LINE_START("line_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter @@ -2700,17 +3096,23 @@ public static class Discount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( Object coupon, Object discount, DiscountEnd discountEnd, Map extraParams, - Object promotionCode) { + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -2728,6 +3130,8 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public QuoteUpdateParams.Line.Action.AddItem.Discount build() { return new QuoteUpdateParams.Line.Action.AddItem.Discount( @@ -2735,7 +3139,8 @@ public QuoteUpdateParams.Line.Action.AddItem.Discount build() { this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -2808,6 +3213,13 @@ public Builder setPromotionCode(EmptyParam promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + QuoteUpdateParams.Line.Action.AddItem.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -3058,6 +3470,392 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.AddItem.Discount.Settings build() { + return new QuoteUpdateParams.Line.Action.AddItem.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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.Line.Action.AddItem.Discount.Settings#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.Line.Action.AddItem.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + QuoteUpdateParams.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + public Builder setStartDate( + QuoteUpdateParams.Line.Action.AddItem.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new QuoteUpdateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + QuoteUpdateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig#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.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + QuoteUpdateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new QuoteUpdateParams.Line.Action.AddItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig.Custom#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.Line.Action.AddItem.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("line_start") + LINE_START("line_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter @@ -3407,12 +4205,21 @@ public static class SetDiscount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private SetDiscount( - Object coupon, Object discount, Map extraParams, Object promotionCode) { + Object coupon, + Object discount, + Map extraParams, + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -3428,10 +4235,12 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public QuoteUpdateParams.Line.Action.SetDiscount build() { return new QuoteUpdateParams.Line.Action.SetDiscount( - this.coupon, this.discount, this.extraParams, this.promotionCode); + this.coupon, this.discount, this.extraParams, this.promotionCode, this.settings); } /** The coupon code to replace the {@code discounts} array with. */ @@ -3446,56 +4255,443 @@ public Builder setCoupon(EmptyParam coupon) { return this; } - /** An ID of an existing discount to replace the {@code discounts} array with. */ - public Builder setDiscount(String discount) { - this.discount = discount; - return this; - } + /** An ID of an existing discount to replace the {@code discounts} array with. */ + public Builder setDiscount(String discount) { + this.discount = discount; + return this; + } + + /** An ID of an existing discount to replace the {@code discounts} array with. */ + public Builder setDiscount(EmptyParam discount) { + this.discount = discount; + 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.Line.Action.SetDiscount#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.Line.Action.SetDiscount#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** An ID of an existing promotion code to replace the {@code discounts} array with. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** An ID of an existing promotion code to replace the {@code discounts} array with. */ + public Builder setPromotionCode(EmptyParam promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(QuoteUpdateParams.Line.Action.SetDiscount.Settings settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.SetDiscount.Settings build() { + return new QuoteUpdateParams.Line.Action.SetDiscount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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.Line.Action.SetDiscount.Settings#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.Line.Action.SetDiscount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + QuoteUpdateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + public Builder setStartDate( + QuoteUpdateParams.Line.Action.SetDiscount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig + build() { + return new QuoteUpdateParams.Line.Action.SetDiscount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + QuoteUpdateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig + .Custom + custom) { + this.custom = custom; + 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.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig#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.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + QuoteUpdateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig + .Custom + build() { + return new QuoteUpdateParams.Line.Action.SetDiscount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig.Custom#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.Line.Action.SetDiscount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); - /** An ID of an existing discount to replace the {@code discounts} array with. */ - public Builder setDiscount(EmptyParam discount) { - this.discount = discount; - return this; - } + @Getter(onMethod_ = {@Override}) + private final String 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 QuoteUpdateParams.Line.Action.SetDiscount#extraParams} for the field - * documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + Type(String value) { + this.value = value; + } } - 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.Line.Action.SetDiscount#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 StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), - /** An ID of an existing promotion code to replace the {@code discounts} array with. */ - public Builder setPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; - } + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), - /** An ID of an existing promotion code to replace the {@code discounts} array with. */ - public Builder setPromotionCode(EmptyParam promotionCode) { - this.promotionCode = promotionCode; - return this; + @SerializedName("line_start") + LINE_START("line_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } } } } @@ -3800,17 +4996,23 @@ public static class Discount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( Object coupon, Object discount, DiscountEnd discountEnd, Map extraParams, - Object promotionCode) { + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -3828,6 +5030,8 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public QuoteUpdateParams.Line.Action.SetItem.Discount build() { return new QuoteUpdateParams.Line.Action.SetItem.Discount( @@ -3835,7 +5039,8 @@ public QuoteUpdateParams.Line.Action.SetItem.Discount build() { this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -3908,6 +5113,13 @@ public Builder setPromotionCode(EmptyParam promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + QuoteUpdateParams.Line.Action.SetItem.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -4158,6 +5370,392 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.SetItem.Discount.Settings build() { + return new QuoteUpdateParams.Line.Action.SetItem.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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.Line.Action.SetItem.Discount.Settings#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.Line.Action.SetItem.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + QuoteUpdateParams.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code line_start} if omitted. + */ + public Builder setStartDate( + QuoteUpdateParams.Line.Action.SetItem.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new QuoteUpdateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + QuoteUpdateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig#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.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + QuoteUpdateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteUpdateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new QuoteUpdateParams.Line.Action.SetItem.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig.Custom#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.Line.Action.SetItem.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("line_start") + LINE_START("line_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index f16792a604f..295575637ae 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -3449,17 +3449,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -3477,10 +3483,17 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionCreateParams.Discount build() { return new SubscriptionCreateParams.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -3532,6 +3545,12 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(SubscriptionCreateParams.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -3774,147 +3793,10 @@ public enum Type implements ApiRequestParams.EnumParam { } } } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class InvoiceSettings { - /** - * The account tax IDs associated with the subscription. Will be set on invoices generated by - * the subscription. - */ - @SerializedName("account_tax_ids") - Object accountTaxIds; - - /** - * 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 connected account that issues the invoice. The invoice is presented with the branding and - * support information of the specified account. - */ - @SerializedName("issuer") - Issuer issuer; - - private InvoiceSettings(Object accountTaxIds, Map extraParams, Issuer issuer) { - this.accountTaxIds = accountTaxIds; - this.extraParams = extraParams; - this.issuer = issuer; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object accountTaxIds; - - private Map extraParams; - - private Issuer issuer; - - /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionCreateParams.InvoiceSettings build() { - return new SubscriptionCreateParams.InvoiceSettings( - this.accountTaxIds, this.extraParams, this.issuer); - } - - /** - * Add an element to `accountTaxIds` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * SubscriptionCreateParams.InvoiceSettings#accountTaxIds} for the field documentation. - */ - @SuppressWarnings("unchecked") - public Builder addAccountTaxId(String element) { - if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) { - this.accountTaxIds = new ArrayList(); - } - ((List) this.accountTaxIds).add(element); - return this; - } - - /** - * Add all elements to `accountTaxIds` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * SubscriptionCreateParams.InvoiceSettings#accountTaxIds} for the field documentation. - */ - @SuppressWarnings("unchecked") - public Builder addAllAccountTaxId(List elements) { - if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) { - this.accountTaxIds = new ArrayList(); - } - ((List) this.accountTaxIds).addAll(elements); - return this; - } - - /** - * The account tax IDs associated with the subscription. Will be set on invoices generated by - * the subscription. - */ - public Builder setAccountTaxIds(EmptyParam accountTaxIds) { - this.accountTaxIds = accountTaxIds; - return this; - } - - /** - * The account tax IDs associated with the subscription. Will be set on invoices generated by - * the subscription. - */ - public Builder setAccountTaxIds(List accountTaxIds) { - this.accountTaxIds = accountTaxIds; - 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 - * SubscriptionCreateParams.InvoiceSettings#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 SubscriptionCreateParams.InvoiceSettings#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 connected account that issues the invoice. The invoice is presented with the branding - * and support information of the specified account. - */ - public Builder setIssuer(SubscriptionCreateParams.InvoiceSettings.Issuer issuer) { - this.issuer = issuer; - return this; - } - } @Getter @EqualsAndHashCode(callSuper = false) - public static class Issuer { - /** The connected account being referenced when {@code type} is {@code account}. */ - @SerializedName("account") - String account; - + public static class Settings { /** * 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. @@ -3924,14 +3806,24 @@ public static class Issuer { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. Type of the account referenced in the request. */ - @SerializedName("type") - Type type; + /** Configures service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; - private Issuer(String account, Map extraParams, Type type) { - this.account = account; + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { this.extraParams = extraParams; - this.type = type; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; } public static Builder builder() { @@ -3939,29 +3831,23 @@ public static Builder builder() { } public static class Builder { - private String account; - private Map extraParams; - private Type type; + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; - /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionCreateParams.InvoiceSettings.Issuer build() { - return new SubscriptionCreateParams.InvoiceSettings.Issuer( - this.account, this.extraParams, this.type); - } + private StartDate startDate; - /** The connected account being referenced when {@code type} is {@code account}. */ - public Builder setAccount(String account) { - this.account = account; - return this; + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.Discount.Settings build() { + return new SubscriptionCreateParams.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); } /** * 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 SubscriptionCreateParams.InvoiceSettings.Issuer#extraParams} for the - * field documentation. + * map. See {@link SubscriptionCreateParams.Discount.Settings#extraParams} for the field + * documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -3974,8 +3860,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 SubscriptionCreateParams.InvoiceSettings.Issuer#extraParams} for the - * field documentation. + * map. See {@link SubscriptionCreateParams.Discount.Settings#extraParams} for the field + * documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -3985,72 +3871,578 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. Type of the account referenced in the request. */ - public Builder setType(SubscriptionCreateParams.InvoiceSettings.Issuer.Type type) { - this.type = type; + /** Configures service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + public Builder setStartDate( + SubscriptionCreateParams.Discount.Settings.StartDate startDate) { + this.startDate = startDate; return this; } } - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("account") - ACCOUNT("account"), + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; - @SerializedName("self") - SELF("self"); + /** + * 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; - @Getter(onMethod_ = {@Override}) - private final String value; + /** + * The type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + @SerializedName("type") + Type type; - Type(String value) { - this.value = value; + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; } - } - } - } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Item { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new - * billing period. Pass an empty string to remove previously-defined thresholds. - */ - @SerializedName("billing_thresholds") - Object billingThresholds; + public static Builder builder() { + return new Builder(); + } - /** The trial offer to apply to this subscription item. */ - @SerializedName("current_trial") - CurrentTrial currentTrial; + public static class Builder { + private Custom custom; - /** The coupons to redeem into discounts for the subscription item. */ - @SerializedName("discounts") - Object discounts; + 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 Type type; - /** - * Set of key-value pairs that you can attach - * to an object. This can be useful for storing additional information about the object in a - * structured format. Individual keys can be unset by posting an empty value to them. All keys - * can be unset by posting an empty value to {@code metadata}. - */ - @SerializedName("metadata") - Map metadata; + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig build() { + return new SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.type); + } - /** Plan ID for this item, as a string. */ - @SerializedName("plan") - String plan; + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + public Builder setCustom( + SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom custom) { + this.custom = custom; + return this; + } - /** The ID of the price object. */ - @SerializedName("price") + /** + * 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 + * SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + public Builder setType( + SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 to + * 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig + .Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("subscription_service_cycle_anchor") + SUBSCRIPTION_SERVICE_CYCLE_ANCHOR("subscription_service_cycle_anchor"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class InvoiceSettings { + /** + * The account tax IDs associated with the subscription. Will be set on invoices generated by + * the subscription. + */ + @SerializedName("account_tax_ids") + Object accountTaxIds; + + /** + * 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 connected account that issues the invoice. The invoice is presented with the branding and + * support information of the specified account. + */ + @SerializedName("issuer") + Issuer issuer; + + private InvoiceSettings(Object accountTaxIds, Map extraParams, Issuer issuer) { + this.accountTaxIds = accountTaxIds; + this.extraParams = extraParams; + this.issuer = issuer; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object accountTaxIds; + + private Map extraParams; + + private Issuer issuer; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.InvoiceSettings build() { + return new SubscriptionCreateParams.InvoiceSettings( + this.accountTaxIds, this.extraParams, this.issuer); + } + + /** + * Add an element to `accountTaxIds` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * SubscriptionCreateParams.InvoiceSettings#accountTaxIds} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAccountTaxId(String element) { + if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) { + this.accountTaxIds = new ArrayList(); + } + ((List) this.accountTaxIds).add(element); + return this; + } + + /** + * Add all elements to `accountTaxIds` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * SubscriptionCreateParams.InvoiceSettings#accountTaxIds} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllAccountTaxId(List elements) { + if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) { + this.accountTaxIds = new ArrayList(); + } + ((List) this.accountTaxIds).addAll(elements); + return this; + } + + /** + * The account tax IDs associated with the subscription. Will be set on invoices generated by + * the subscription. + */ + public Builder setAccountTaxIds(EmptyParam accountTaxIds) { + this.accountTaxIds = accountTaxIds; + return this; + } + + /** + * The account tax IDs associated with the subscription. Will be set on invoices generated by + * the subscription. + */ + public Builder setAccountTaxIds(List accountTaxIds) { + this.accountTaxIds = accountTaxIds; + 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 + * SubscriptionCreateParams.InvoiceSettings#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 SubscriptionCreateParams.InvoiceSettings#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 connected account that issues the invoice. The invoice is presented with the branding + * and support information of the specified account. + */ + public Builder setIssuer(SubscriptionCreateParams.InvoiceSettings.Issuer issuer) { + this.issuer = issuer; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Issuer { + /** The connected account being referenced when {@code type} is {@code account}. */ + @SerializedName("account") + String account; + + /** + * 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. Type of the account referenced in the request. */ + @SerializedName("type") + Type type; + + private Issuer(String account, Map extraParams, Type type) { + this.account = account; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String account; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.InvoiceSettings.Issuer build() { + return new SubscriptionCreateParams.InvoiceSettings.Issuer( + this.account, this.extraParams, this.type); + } + + /** The connected account being referenced when {@code type} is {@code account}. */ + public Builder setAccount(String account) { + this.account = account; + 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 SubscriptionCreateParams.InvoiceSettings.Issuer#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 SubscriptionCreateParams.InvoiceSettings.Issuer#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. Type of the account referenced in the request. */ + public Builder setType(SubscriptionCreateParams.InvoiceSettings.Issuer.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("account") + ACCOUNT("account"), + + @SerializedName("self") + SELF("self"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + + /** The trial offer to apply to this subscription item. */ + @SerializedName("current_trial") + CurrentTrial currentTrial; + + /** The coupons to redeem into discounts for the subscription item. */ + @SerializedName("discounts") + Object discounts; + + /** + * 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** Plan ID for this item, as a string. */ + @SerializedName("plan") + String plan; + + /** The ID of the price object. */ + @SerializedName("price") String price; /** @@ -4554,17 +4946,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -4582,10 +4980,17 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionCreateParams.Item.Discount build() { return new SubscriptionCreateParams.Item.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -4640,6 +5045,12 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(SubscriptionCreateParams.Item.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -4885,6 +5296,386 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.Item.Discount.Settings build() { + return new SubscriptionCreateParams.Item.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 SubscriptionCreateParams.Item.Discount.Settings#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 SubscriptionCreateParams.Item.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code now} if omitted. + */ + public Builder setStartDate( + SubscriptionCreateParams.Item.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig + build() { + return new SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + public Builder setType( + SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig + .Custom + build() { + return new SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig + .Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionCreateParams.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("subscription_service_cycle_anchor") + SUBSCRIPTION_SERVICE_CYCLE_ANCHOR("subscription_service_cycle_anchor"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java index a697b844bee..d0f25052d66 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java @@ -722,17 +722,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -750,10 +756,17 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionItemCreateParams.Discount build() { return new SubscriptionItemCreateParams.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -805,6 +818,12 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(SubscriptionItemCreateParams.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -1047,6 +1066,380 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemCreateParams.Discount.Settings build() { + return new SubscriptionItemCreateParams.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 SubscriptionItemCreateParams.Discount.Settings#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 SubscriptionItemCreateParams.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + public Builder setStartDate( + SubscriptionItemCreateParams.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig build() { + return new SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.type); + } + + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + public Builder setCustom( + SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + public Builder setType( + SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 to + * 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig + .Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionItemCreateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("subscription_service_cycle_anchor") + SUBSCRIPTION_SERVICE_CYCLE_ANCHOR("subscription_service_cycle_anchor"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java index a97da85a5e3..bb1f2c7a313 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java @@ -767,17 +767,23 @@ public static class Discount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( Object coupon, Object discount, DiscountEnd discountEnd, Map extraParams, - Object promotionCode) { + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -795,10 +801,17 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionItemUpdateParams.Discount build() { return new SubscriptionItemUpdateParams.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -868,6 +881,12 @@ public Builder setPromotionCode(EmptyParam promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(SubscriptionItemUpdateParams.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -1110,6 +1129,380 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemUpdateParams.Discount.Settings build() { + return new SubscriptionItemUpdateParams.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 SubscriptionItemUpdateParams.Discount.Settings#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 SubscriptionItemUpdateParams.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + public Builder setStartDate( + SubscriptionItemUpdateParams.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig build() { + return new SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.type); + } + + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + public Builder setCustom( + SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + public Builder setType( + SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 to + * 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig + .Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionItemUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("subscription_service_cycle_anchor") + SUBSCRIPTION_SERVICE_CYCLE_ANCHOR("subscription_service_cycle_anchor"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java index c612c898370..2cabe52d162 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleAmendParams.java @@ -1683,19 +1683,25 @@ public static class Add { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Add( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, Long index, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.index = index; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -1715,6 +1721,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add build() { return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add( @@ -1723,7 +1731,8 @@ public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add build() { this.discountEnd, this.extraParams, this.index, - this.promotionCode); + this.promotionCode, + this.settings); } /** The coupon code to redeem. */ @@ -1790,6 +1799,13 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -1887,6 +1903,391 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings#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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if omitted. + */ + public Builder setStartDate( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings.StartDate + startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig + build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Add.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("amendment_start") + AMENDMENT_START("amendment_start"), + + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter @@ -2016,12 +2417,21 @@ public static class Set { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Set( - String coupon, String discount, Map extraParams, String promotionCode) { + String coupon, + String discount, + Map extraParams, + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -2037,10 +2447,12 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set build() { return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set( - this.coupon, this.discount, this.extraParams, this.promotionCode); + this.coupon, this.discount, this.extraParams, this.promotionCode, this.settings); } /** The coupon code to replace the {@code discounts} array with. */ @@ -2049,46 +2461,438 @@ public Builder setCoupon(String coupon) { return this; } - /** An ID of an existing discount to replace the {@code discounts} array with. */ - public Builder setDiscount(String discount) { - this.discount = discount; - return this; - } + /** An ID of an existing discount to replace the {@code discounts} array with. */ + public Builder setDiscount(String discount) { + this.discount = discount; + 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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set#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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** An ID of an existing promotion code to replace the {@code discounts} array with. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings settings) { + this.settings = settings; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings#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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if omitted. + */ + public Builder setStartDate( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings.StartDate + startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig + build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); - /** - * 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 - * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set#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 - * SubscriptionScheduleAmendParams.Amendment.DiscountAction.Set#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + Type(String value) { + this.value = value; + } } - this.extraParams.putAll(map); - return this; } - /** An ID of an existing promotion code to replace the {@code discounts} array with. */ - public Builder setPromotionCode(String promotionCode) { - this.promotionCode = promotionCode; - return this; + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("amendment_start") + AMENDMENT_START("amendment_start"), + + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } } } } @@ -2514,17 +3318,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -2542,6 +3352,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount build() { return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount( @@ -2549,7 +3361,8 @@ public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount build() this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -2607,6 +3420,14 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings + settings) { + this.settings = settings; + return this; + } } @Getter @@ -2817,49 +3638,440 @@ public Builder setInterval( 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; + /** + * 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; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("duration") + DURATION("duration"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings + build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount + .Settings(this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings#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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if + * omitted. + */ + public Builder setStartDate( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings + .StartDate + startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount + .Settings.ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); } - } - public enum Interval implements ApiRequestParams.EnumParam { - @SerializedName("day") - DAY("day"), + public static class Builder { + private Long dayOfMonth; - @SerializedName("month") - MONTH("month"), + private Map extraParams; - @SerializedName("week") - WEEK("week"), + private Long hour; - @SerializedName("year") - YEAR("year"); + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount + .Settings.ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Add.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); @Getter(onMethod_ = {@Override}) private final String value; - Interval(String value) { + Type(String value) { this.value = value; } } } - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("duration") - DURATION("duration"), + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("amendment_start") + AMENDMENT_START("amendment_start"), - @SerializedName("timestamp") - TIMESTAMP("timestamp"); + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"); @Getter(onMethod_ = {@Override}) private final String value; - Type(String value) { + StartDate(String value) { this.value = value; } } @@ -3367,17 +4579,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -3395,6 +4613,8 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount build() { return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount( @@ -3402,7 +4622,8 @@ public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount build() this.discount, this.discountEnd, this.extraParams, - this.promotionCode); + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -3460,6 +4681,14 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings + settings) { + this.settings = settings; + return this; + } } @Getter @@ -3717,6 +4946,397 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings + build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount + .Settings(this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings#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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code amendment_start} if + * omitted. + */ + public Builder setStartDate( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings + .StartDate + startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount + .Settings.ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to + * specify. + */ + public Builder setCustom( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount + .Settings.ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges + * from 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionScheduleAmendParams.Amendment.ItemAction.Set.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("amendment_start") + AMENDMENT_START("amendment_start"), + + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index 3e5d3c216f3..2e4d810dd30 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -4421,17 +4421,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -4449,10 +4455,17 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleCreateParams.Phase.Discount build() { return new SubscriptionScheduleCreateParams.Phase.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -4507,6 +4520,13 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + SubscriptionScheduleCreateParams.Phase.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -4756,6 +4776,383 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code phase_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.Discount.Settings build() { + return new SubscriptionScheduleCreateParams.Phase.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 SubscriptionScheduleCreateParams.Phase.Discount.Settings#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 SubscriptionScheduleCreateParams.Phase.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionScheduleCreateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. + */ + public Builder setStartDate( + SubscriptionScheduleCreateParams.Phase.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new SubscriptionScheduleCreateParams.Phase.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + SubscriptionScheduleCreateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig + .Custom + custom) { + this.custom = custom; + 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 + * SubscriptionScheduleCreateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionScheduleCreateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + public Builder setType( + SubscriptionScheduleCreateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig + .Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionScheduleCreateParams.Phase.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionScheduleCreateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionScheduleCreateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter @@ -5610,17 +6007,23 @@ public static class Discount { @SerializedName("promotion_code") String promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( String coupon, String discount, DiscountEnd discountEnd, Map extraParams, - String promotionCode) { + String promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -5638,10 +6041,17 @@ public static class Builder { private String promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleCreateParams.Phase.Item.Discount build() { return new SubscriptionScheduleCreateParams.Phase.Item.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -5696,6 +6106,13 @@ public Builder setPromotionCode(String promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -5948,6 +6365,390 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings build() { + return new SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings#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 + * SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. + */ + public Builder setStartDate( + SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionScheduleCreateParams.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index a50e7ff074b..1267152fecb 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -4342,17 +4342,23 @@ public static class Discount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( Object coupon, Object discount, DiscountEnd discountEnd, Map extraParams, - Object promotionCode) { + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -4370,10 +4376,17 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleUpdateParams.Phase.Discount build() { return new SubscriptionScheduleUpdateParams.Phase.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -4446,6 +4459,13 @@ public Builder setPromotionCode(EmptyParam promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + SubscriptionScheduleUpdateParams.Phase.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -4695,6 +4715,383 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code phase_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.Discount.Settings build() { + return new SubscriptionScheduleUpdateParams.Phase.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 SubscriptionScheduleUpdateParams.Phase.Discount.Settings#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 SubscriptionScheduleUpdateParams.Phase.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionScheduleUpdateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. + */ + public Builder setStartDate( + SubscriptionScheduleUpdateParams.Phase.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new SubscriptionScheduleUpdateParams.Phase.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + SubscriptionScheduleUpdateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig + .Custom + custom) { + this.custom = custom; + 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 + * SubscriptionScheduleUpdateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionScheduleUpdateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + public Builder setType( + SubscriptionScheduleUpdateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig + .Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionScheduleUpdateParams.Phase.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionScheduleUpdateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionScheduleUpdateParams.Phase.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter @@ -5576,17 +5973,23 @@ public static class Discount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( Object coupon, Object discount, DiscountEnd discountEnd, Map extraParams, - Object promotionCode) { + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -5604,10 +6007,17 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleUpdateParams.Phase.Item.Discount build() { return new SubscriptionScheduleUpdateParams.Phase.Item.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -5680,6 +6090,13 @@ public Builder setPromotionCode(EmptyParam promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings( + SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -5932,6 +6349,390 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 + * SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings#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 + * SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code phase_start} if omitted. + */ + public Builder setStartDate( + SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code inherit} if omitted. */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig + build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig(this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code inherit} if omitted. + */ + public Builder setType( + SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings + .ServicePeriodAnchorConfig.Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from + * 1 to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionScheduleUpdateParams.Phase.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("inherit") + INHERIT("inherit"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 6a7d6ce9e85..ad6b1f11146 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -3368,17 +3368,23 @@ public static class Discount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( Object coupon, Object discount, DiscountEnd discountEnd, Map extraParams, - Object promotionCode) { + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -3396,10 +3402,17 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionUpdateParams.Discount build() { return new SubscriptionUpdateParams.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -3469,6 +3482,12 @@ public Builder setPromotionCode(EmptyParam promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(SubscriptionUpdateParams.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -3711,147 +3730,10 @@ public enum Type implements ApiRequestParams.EnumParam { } } } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class InvoiceSettings { - /** - * The account tax IDs associated with the subscription. Will be set on invoices generated by - * the subscription. - */ - @SerializedName("account_tax_ids") - Object accountTaxIds; - - /** - * 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 connected account that issues the invoice. The invoice is presented with the branding and - * support information of the specified account. - */ - @SerializedName("issuer") - Issuer issuer; - - private InvoiceSettings(Object accountTaxIds, Map extraParams, Issuer issuer) { - this.accountTaxIds = accountTaxIds; - this.extraParams = extraParams; - this.issuer = issuer; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object accountTaxIds; - - private Map extraParams; - - private Issuer issuer; - - /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionUpdateParams.InvoiceSettings build() { - return new SubscriptionUpdateParams.InvoiceSettings( - this.accountTaxIds, this.extraParams, this.issuer); - } - - /** - * Add an element to `accountTaxIds` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * SubscriptionUpdateParams.InvoiceSettings#accountTaxIds} for the field documentation. - */ - @SuppressWarnings("unchecked") - public Builder addAccountTaxId(String element) { - if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) { - this.accountTaxIds = new ArrayList(); - } - ((List) this.accountTaxIds).add(element); - return this; - } - - /** - * Add all elements to `accountTaxIds` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * SubscriptionUpdateParams.InvoiceSettings#accountTaxIds} for the field documentation. - */ - @SuppressWarnings("unchecked") - public Builder addAllAccountTaxId(List elements) { - if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) { - this.accountTaxIds = new ArrayList(); - } - ((List) this.accountTaxIds).addAll(elements); - return this; - } - - /** - * The account tax IDs associated with the subscription. Will be set on invoices generated by - * the subscription. - */ - public Builder setAccountTaxIds(EmptyParam accountTaxIds) { - this.accountTaxIds = accountTaxIds; - return this; - } - - /** - * The account tax IDs associated with the subscription. Will be set on invoices generated by - * the subscription. - */ - public Builder setAccountTaxIds(List accountTaxIds) { - this.accountTaxIds = accountTaxIds; - 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 - * SubscriptionUpdateParams.InvoiceSettings#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 SubscriptionUpdateParams.InvoiceSettings#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 connected account that issues the invoice. The invoice is presented with the branding - * and support information of the specified account. - */ - public Builder setIssuer(SubscriptionUpdateParams.InvoiceSettings.Issuer issuer) { - this.issuer = issuer; - return this; - } - } @Getter @EqualsAndHashCode(callSuper = false) - public static class Issuer { - /** The connected account being referenced when {@code type} is {@code account}. */ - @SerializedName("account") - Object account; - + public static class Settings { /** * 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. @@ -3861,14 +3743,24 @@ public static class Issuer { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. Type of the account referenced in the request. */ - @SerializedName("type") - Type type; + /** Configures service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; - private Issuer(Object account, Map extraParams, Type type) { - this.account = account; + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { this.extraParams = extraParams; - this.type = type; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; } public static Builder builder() { @@ -3876,35 +3768,23 @@ public static Builder builder() { } public static class Builder { - private Object account; - private Map extraParams; - private Type type; - - /** Finalize and obtain parameter instance from this builder. */ - public SubscriptionUpdateParams.InvoiceSettings.Issuer build() { - return new SubscriptionUpdateParams.InvoiceSettings.Issuer( - this.account, this.extraParams, this.type); - } + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; - /** The connected account being referenced when {@code type} is {@code account}. */ - public Builder setAccount(String account) { - this.account = account; - return this; - } + private StartDate startDate; - /** The connected account being referenced when {@code type} is {@code account}. */ - public Builder setAccount(EmptyParam account) { - this.account = account; - return this; + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.Discount.Settings build() { + return new SubscriptionUpdateParams.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); } /** * 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 SubscriptionUpdateParams.InvoiceSettings.Issuer#extraParams} for the - * field documentation. + * map. See {@link SubscriptionUpdateParams.Discount.Settings#extraParams} for the field + * documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -3917,8 +3797,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 SubscriptionUpdateParams.InvoiceSettings.Issuer#extraParams} for the - * field documentation. + * map. See {@link SubscriptionUpdateParams.Discount.Settings#extraParams} for the field + * documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -3928,67 +3808,579 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. Type of the account referenced in the request. */ - public Builder setType(SubscriptionUpdateParams.InvoiceSettings.Issuer.Type type) { - this.type = type; + /** Configures service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + public Builder setStartDate( + SubscriptionUpdateParams.Discount.Settings.StartDate startDate) { + this.startDate = startDate; return this; } } - public enum Type implements ApiRequestParams.EnumParam { - @SerializedName("account") - ACCOUNT("account"), + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; - @SerializedName("self") - SELF("self"); + /** + * 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; - @Getter(onMethod_ = {@Override}) - private final String value; + /** + * The type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + @SerializedName("type") + Type type; - Type(String value) { - this.value = value; + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; } - } - } - } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Item { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new - * billing period. Pass an empty string to remove previously-defined thresholds. - */ - @SerializedName("billing_thresholds") - Object billingThresholds; + public static Builder builder() { + return new Builder(); + } - /** - * Delete all usage for a given subscription item. You must pass this when deleting a usage - * records subscription item. {@code clear_usage} has no effect if the plan has a billing meter - * attached. - */ - @SerializedName("clear_usage") - Boolean clearUsage; + public static class Builder { + private Custom custom; - /** The trial offer to apply to this subscription item. */ - @SerializedName("current_trial") - CurrentTrial currentTrial; + private Map extraParams; - /** A flag that, if set to {@code true}, will delete the specified item. */ - @SerializedName("deleted") - Boolean deleted; + private Type type; - /** The coupons to redeem into discounts for the subscription item. */ - @SerializedName("discounts") - Object discounts; + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig build() { + return new SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.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) + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + public Builder setCustom( + SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom custom) { + this.custom = custom; + 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 + * SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + public Builder setType( + SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 to + * 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom + build() { + return new SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig + .Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionUpdateParams.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("subscription_service_cycle_anchor") + SUBSCRIPTION_SERVICE_CYCLE_ANCHOR("subscription_service_cycle_anchor"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class InvoiceSettings { + /** + * The account tax IDs associated with the subscription. Will be set on invoices generated by + * the subscription. + */ + @SerializedName("account_tax_ids") + Object accountTaxIds; + + /** + * 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 connected account that issues the invoice. The invoice is presented with the branding and + * support information of the specified account. + */ + @SerializedName("issuer") + Issuer issuer; + + private InvoiceSettings(Object accountTaxIds, Map extraParams, Issuer issuer) { + this.accountTaxIds = accountTaxIds; + this.extraParams = extraParams; + this.issuer = issuer; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object accountTaxIds; + + private Map extraParams; + + private Issuer issuer; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.InvoiceSettings build() { + return new SubscriptionUpdateParams.InvoiceSettings( + this.accountTaxIds, this.extraParams, this.issuer); + } + + /** + * Add an element to `accountTaxIds` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * SubscriptionUpdateParams.InvoiceSettings#accountTaxIds} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAccountTaxId(String element) { + if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) { + this.accountTaxIds = new ArrayList(); + } + ((List) this.accountTaxIds).add(element); + return this; + } + + /** + * Add all elements to `accountTaxIds` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * SubscriptionUpdateParams.InvoiceSettings#accountTaxIds} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllAccountTaxId(List elements) { + if (this.accountTaxIds == null || this.accountTaxIds instanceof EmptyParam) { + this.accountTaxIds = new ArrayList(); + } + ((List) this.accountTaxIds).addAll(elements); + return this; + } + + /** + * The account tax IDs associated with the subscription. Will be set on invoices generated by + * the subscription. + */ + public Builder setAccountTaxIds(EmptyParam accountTaxIds) { + this.accountTaxIds = accountTaxIds; + return this; + } + + /** + * The account tax IDs associated with the subscription. Will be set on invoices generated by + * the subscription. + */ + public Builder setAccountTaxIds(List accountTaxIds) { + this.accountTaxIds = accountTaxIds; + 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 + * SubscriptionUpdateParams.InvoiceSettings#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 SubscriptionUpdateParams.InvoiceSettings#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 connected account that issues the invoice. The invoice is presented with the branding + * and support information of the specified account. + */ + public Builder setIssuer(SubscriptionUpdateParams.InvoiceSettings.Issuer issuer) { + this.issuer = issuer; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Issuer { + /** The connected account being referenced when {@code type} is {@code account}. */ + @SerializedName("account") + Object account; + + /** + * 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. Type of the account referenced in the request. */ + @SerializedName("type") + Type type; + + private Issuer(Object account, Map extraParams, Type type) { + this.account = account; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object account; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.InvoiceSettings.Issuer build() { + return new SubscriptionUpdateParams.InvoiceSettings.Issuer( + this.account, this.extraParams, this.type); + } + + /** The connected account being referenced when {@code type} is {@code account}. */ + public Builder setAccount(String account) { + this.account = account; + return this; + } + + /** The connected account being referenced when {@code type} is {@code account}. */ + public Builder setAccount(EmptyParam account) { + this.account = account; + 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 SubscriptionUpdateParams.InvoiceSettings.Issuer#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 SubscriptionUpdateParams.InvoiceSettings.Issuer#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. Type of the account referenced in the request. */ + public Builder setType(SubscriptionUpdateParams.InvoiceSettings.Issuer.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("account") + ACCOUNT("account"), + + @SerializedName("self") + SELF("self"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + + /** + * Delete all usage for a given subscription item. You must pass this when deleting a usage + * records subscription item. {@code clear_usage} has no effect if the plan has a billing meter + * attached. + */ + @SerializedName("clear_usage") + Boolean clearUsage; + + /** The trial offer to apply to this subscription item. */ + @SerializedName("current_trial") + CurrentTrial currentTrial; + + /** A flag that, if set to {@code true}, will delete the specified item. */ + @SerializedName("deleted") + Boolean deleted; + + /** The coupons to redeem into discounts for the subscription item. */ + @SerializedName("discounts") + Object discounts; + + /** + * 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; /** Subscription item to update. */ @@ -4597,17 +4989,23 @@ public static class Discount { @SerializedName("promotion_code") Object promotionCode; + /** Settings for discount application including service period anchoring. */ + @SerializedName("settings") + Settings settings; + private Discount( Object coupon, Object discount, DiscountEnd discountEnd, Map extraParams, - Object promotionCode) { + Object promotionCode, + Settings settings) { this.coupon = coupon; this.discount = discount; this.discountEnd = discountEnd; this.extraParams = extraParams; this.promotionCode = promotionCode; + this.settings = settings; } public static Builder builder() { @@ -4625,10 +5023,17 @@ public static class Builder { private Object promotionCode; + private Settings settings; + /** Finalize and obtain parameter instance from this builder. */ public SubscriptionUpdateParams.Item.Discount build() { return new SubscriptionUpdateParams.Item.Discount( - this.coupon, this.discount, this.discountEnd, this.extraParams, this.promotionCode); + this.coupon, + this.discount, + this.discountEnd, + this.extraParams, + this.promotionCode, + this.settings); } /** ID of the coupon to create a new discount for. */ @@ -4701,6 +5106,12 @@ public Builder setPromotionCode(EmptyParam promotionCode) { this.promotionCode = promotionCode; return this; } + + /** Settings for discount application including service period anchoring. */ + public Builder setSettings(SubscriptionUpdateParams.Item.Discount.Settings settings) { + this.settings = settings; + return this; + } } @Getter @@ -4946,6 +5357,386 @@ public enum Type implements ApiRequestParams.EnumParam { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Settings { + /** + * 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 service period cycle anchoring. */ + @SerializedName("service_period_anchor_config") + ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + /** + * The start date of the discount's service period when applying a coupon or promotion code + * with a service period duration. Defaults to {@code now} if omitted. + */ + @SerializedName("start_date") + StartDate startDate; + + private Settings( + Map extraParams, + ServicePeriodAnchorConfig servicePeriodAnchorConfig, + StartDate startDate) { + this.extraParams = extraParams; + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + this.startDate = startDate; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private ServicePeriodAnchorConfig servicePeriodAnchorConfig; + + private StartDate startDate; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.Item.Discount.Settings build() { + return new SubscriptionUpdateParams.Item.Discount.Settings( + this.extraParams, this.servicePeriodAnchorConfig, this.startDate); + } + + /** + * 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 SubscriptionUpdateParams.Item.Discount.Settings#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 SubscriptionUpdateParams.Item.Discount.Settings#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 service period cycle anchoring. */ + public Builder setServicePeriodAnchorConfig( + SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig + servicePeriodAnchorConfig) { + this.servicePeriodAnchorConfig = servicePeriodAnchorConfig; + return this; + } + + /** + * The start date of the discount's service period when applying a coupon or promotion + * code with a service period duration. Defaults to {@code now} if omitted. + */ + public Builder setStartDate( + SubscriptionUpdateParams.Item.Discount.Settings.StartDate startDate) { + this.startDate = startDate; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ServicePeriodAnchorConfig { + /** Anchor the service period to a custom date. Type must be {@code custom} to specify. */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + @SerializedName("type") + Type type; + + private ServicePeriodAnchorConfig( + Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig + build() { + return new SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig( + this.custom, this.extraParams, this.type); + } + + /** + * Anchor the service period to a custom date. Type must be {@code custom} to specify. + */ + public Builder setCustom( + SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom + custom) { + this.custom = custom; + 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 + * SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig#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 + * SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig#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 type of service period anchor config. Defaults to {@code + * subscription_service_cycle_anchor} if omitted. + */ + public Builder setType( + SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig.Type + type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + @SerializedName("day_of_month") + Long dayOfMonth; + + /** + * 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 hour of the day the anchor should be. Ranges from 0 to 23. */ + @SerializedName("hour") + Long hour; + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + @SerializedName("minute") + Long minute; + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + @SerializedName("month") + Long month; + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + @SerializedName("second") + Long second; + + private Custom( + Long dayOfMonth, + Map extraParams, + Long hour, + Long minute, + Long month, + Long second) { + this.dayOfMonth = dayOfMonth; + this.extraParams = extraParams; + this.hour = hour; + this.minute = minute; + this.month = month; + this.second = second; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long dayOfMonth; + + private Map extraParams; + + private Long hour; + + private Long minute; + + private Long month; + + private Long second; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig + .Custom + build() { + return new SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig + .Custom( + this.dayOfMonth, + this.extraParams, + this.hour, + this.minute, + this.month, + this.second); + } + + /** + * Required. The day of the month the anchor should be. Ranges from 1 + * to 31. + */ + public Builder setDayOfMonth(Long dayOfMonth) { + this.dayOfMonth = dayOfMonth; + 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 + * SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 + * SubscriptionUpdateParams.Item.Discount.Settings.ServicePeriodAnchorConfig.Custom#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 hour of the day the anchor should be. Ranges from 0 to 23. */ + public Builder setHour(Long hour) { + this.hour = hour; + return this; + } + + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ + public Builder setMinute(Long minute) { + this.minute = minute; + return this; + } + + /** The month to start full cycle periods. Ranges from 1 to 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ + public Builder setSecond(Long second) { + this.second = second; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"), + + @SerializedName("subscription_service_cycle_anchor") + SUBSCRIPTION_SERVICE_CYCLE_ANCHOR("subscription_service_cycle_anchor"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum StartDate implements ApiRequestParams.EnumParam { + @SerializedName("current_period_end") + CURRENT_PERIOD_END("current_period_end"), + + @SerializedName("current_period_start") + CURRENT_PERIOD_START("current_period_start"), + + @SerializedName("now") + NOW("now"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + StartDate(String value) { + this.value = value; + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 513eb654202..532337be4be 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -4940,7 +4940,10 @@ public enum Duration implements ApiRequestParams.EnumParam { ONCE("once"), @SerializedName("repeating") - REPEATING("repeating"); + REPEATING("repeating"), + + @SerializedName("service_period") + SERVICE_PERIOD("service_period"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java b/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java index f984abc0368..afdedfc7d26 100644 --- a/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java @@ -1312,7 +1312,10 @@ public enum Duration implements ApiRequestParams.EnumParam { ONCE("once"), @SerializedName("repeating") - REPEATING("repeating"); + REPEATING("repeating"), + + @SerializedName("service_period") + SERVICE_PERIOD("service_period"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/service/FrMealVouchersOnboardingService.java b/src/main/java/com/stripe/service/FrMealVouchersOnboardingService.java new file mode 100644 index 00000000000..ba071f28ae6 --- /dev/null +++ b/src/main/java/com/stripe/service/FrMealVouchersOnboardingService.java @@ -0,0 +1,124 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.FrMealVouchersOnboarding; +import com.stripe.model.StripeCollection; +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.FrMealVouchersOnboardingCreateParams; +import com.stripe.param.FrMealVouchersOnboardingListParams; +import com.stripe.param.FrMealVouchersOnboardingRetrieveParams; +import com.stripe.param.FrMealVouchersOnboardingUpdateParams; + +public final class FrMealVouchersOnboardingService extends ApiService { + public FrMealVouchersOnboardingService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Lists French Meal Vouchers Onboarding objects. */ + public StripeCollection list(FrMealVouchersOnboardingListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** Lists French Meal Vouchers Onboarding objects. */ + public StripeCollection list(RequestOptions options) + throws StripeException { + return list((FrMealVouchersOnboardingListParams) null, options); + } + /** Lists French Meal Vouchers Onboarding objects. */ + public StripeCollection list() throws StripeException { + return list((FrMealVouchersOnboardingListParams) null, (RequestOptions) null); + } + /** Lists French Meal Vouchers Onboarding objects. */ + public StripeCollection list( + FrMealVouchersOnboardingListParams params, RequestOptions options) throws StripeException { + String path = "/v1/fr_meal_vouchers_onboardings"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request( + request, new TypeToken>() {}.getType()); + } + /** + * Creates a French Meal Vouchers Onboarding object that represents a restaurant’s onboarding + * status and starts the onboarding process. + */ + public FrMealVouchersOnboarding create(FrMealVouchersOnboardingCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); + } + /** + * Creates a French Meal Vouchers Onboarding object that represents a restaurant’s onboarding + * status and starts the onboarding process. + */ + public FrMealVouchersOnboarding create( + FrMealVouchersOnboardingCreateParams params, RequestOptions options) throws StripeException { + String path = "/v1/fr_meal_vouchers_onboardings"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, FrMealVouchersOnboarding.class); + } + /** Retrieves the details of a French Meal Vouchers Onboarding object. */ + public FrMealVouchersOnboarding retrieve(String id, FrMealVouchersOnboardingRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieves the details of a French Meal Vouchers Onboarding object. */ + public FrMealVouchersOnboarding retrieve(String id, RequestOptions options) + throws StripeException { + return retrieve(id, (FrMealVouchersOnboardingRetrieveParams) null, options); + } + /** Retrieves the details of a French Meal Vouchers Onboarding object. */ + public FrMealVouchersOnboarding retrieve(String id) throws StripeException { + return retrieve(id, (FrMealVouchersOnboardingRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves the details of a French Meal Vouchers Onboarding object. */ + public FrMealVouchersOnboarding retrieve( + String id, FrMealVouchersOnboardingRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/fr_meal_vouchers_onboardings/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, FrMealVouchersOnboarding.class); + } + /** Updates the details of a restaurant’s French Meal Vouchers Onboarding object. */ + public FrMealVouchersOnboarding update(String id, FrMealVouchersOnboardingUpdateParams params) + throws StripeException { + return update(id, params, (RequestOptions) null); + } + /** Updates the details of a restaurant’s French Meal Vouchers Onboarding object. */ + public FrMealVouchersOnboarding update( + String id, FrMealVouchersOnboardingUpdateParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/fr_meal_vouchers_onboardings/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, FrMealVouchersOnboarding.class); + } +} diff --git a/src/main/java/com/stripe/service/V1Services.java b/src/main/java/com/stripe/service/V1Services.java index 0540e4a1c39..b4e6baa77a5 100644 --- a/src/main/java/com/stripe/service/V1Services.java +++ b/src/main/java/com/stripe/service/V1Services.java @@ -145,6 +145,10 @@ public com.stripe.service.ForwardingService forwarding() { return new com.stripe.service.ForwardingService(this.getResponseGetter()); } + public com.stripe.service.FrMealVouchersOnboardingService frMealVouchersOnboardings() { + return new com.stripe.service.FrMealVouchersOnboardingService(this.getResponseGetter()); + } + public com.stripe.service.FxQuoteService fxQuotes() { return new com.stripe.service.FxQuoteService(this.getResponseGetter()); } From c21b10fbf8f743edb61e362f479e5dc3ad8a3b68 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:47:26 +0000 Subject: [PATCH 2/6] Update generated code for v2156 and --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Coupon.java | 18 +++ .../com/stripe/param/CouponCreateParams.java | 131 +++++++++++++++++- 4 files changed, 149 insertions(+), 4 deletions(-) diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index f0d8c5cf5ee..d0f436205d2 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -8989becedb2153519066ec2233cbf5880b938188 \ No newline at end of file +8c8709034677788a8c86b775cd16f40ecb5fb7db \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8d0138b868d..2af218b4480 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2155 \ No newline at end of file +v2156 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Coupon.java b/src/main/java/com/stripe/model/Coupon.java index a9625673df4..b5085568b02 100644 --- a/src/main/java/com/stripe/model/Coupon.java +++ b/src/main/java/com/stripe/model/Coupon.java @@ -460,6 +460,24 @@ public static class ServicePeriod extends StripeObject { @SerializedName("interval_count") Long intervalCount; + + @SerializedName("iterations") + Iterations iterations; + + /** + * For more details about Iterations, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Iterations extends StripeObject { + @SerializedName("count") + Long count; + + @SerializedName("type") + String type; + } } @Override diff --git a/src/main/java/com/stripe/param/CouponCreateParams.java b/src/main/java/com/stripe/param/CouponCreateParams.java index cb37db49957..ec609e4fc23 100644 --- a/src/main/java/com/stripe/param/CouponCreateParams.java +++ b/src/main/java/com/stripe/param/CouponCreateParams.java @@ -746,10 +746,19 @@ public static class ServicePeriod { @SerializedName("interval_count") Long intervalCount; - private ServicePeriod(Map extraParams, Interval interval, Long intervalCount) { + /** Specifies the number of times the coupon is contiguously applied. */ + @SerializedName("iterations") + Iterations iterations; + + private ServicePeriod( + Map extraParams, + Interval interval, + Long intervalCount, + Iterations iterations) { this.extraParams = extraParams; this.interval = interval; this.intervalCount = intervalCount; + this.iterations = iterations; } public static Builder builder() { @@ -763,10 +772,12 @@ public static class Builder { private Long intervalCount; + private Iterations iterations; + /** Finalize and obtain parameter instance from this builder. */ public CouponCreateParams.ServicePeriod build() { return new CouponCreateParams.ServicePeriod( - this.extraParams, this.interval, this.intervalCount); + this.extraParams, this.interval, this.intervalCount, this.iterations); } /** @@ -811,6 +822,122 @@ public Builder setIntervalCount(Long intervalCount) { this.intervalCount = intervalCount; return this; } + + /** Specifies the number of times the coupon is contiguously applied. */ + public Builder setIterations(CouponCreateParams.ServicePeriod.Iterations iterations) { + this.iterations = iterations; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Iterations { + /** + * The number of iterations the service period will repeat for. Only used when type is {@code + * count}, defaults to 1. + */ + @SerializedName("count") + Long count; + + /** + * 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 type of iterations, defaults to {@code count} if omitted. + */ + @SerializedName("type") + Type type; + + private Iterations(Long count, Map extraParams, Type type) { + this.count = count; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long count; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public CouponCreateParams.ServicePeriod.Iterations build() { + return new CouponCreateParams.ServicePeriod.Iterations( + this.count, this.extraParams, this.type); + } + + /** + * The number of iterations the service period will repeat for. Only used when type is + * {@code count}, defaults to 1. + */ + public Builder setCount(Long count) { + this.count = count; + 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 CouponCreateParams.ServicePeriod.Iterations#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 CouponCreateParams.ServicePeriod.Iterations#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 type of iterations, defaults to {@code count} if omitted. + */ + public Builder setType(CouponCreateParams.ServicePeriod.Iterations.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("count") + COUNT("count"), + + @SerializedName("forever") + FOREVER("forever"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } } public enum Interval implements ApiRequestParams.EnumParam { From 19f69fab4db8a08d9df44c8df232181d56d656c1 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 19:24:51 +0000 Subject: [PATCH 3/6] Update generated code for v2159 and --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- .../java/com/stripe/model/AccountSession.java | 33 +++++++++++++++++++ .../stripe/param/SubscriptionListParams.java | 15 +++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index d0f436205d2..98c90a80b8f 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -8c8709034677788a8c86b775cd16f40ecb5fb7db \ No newline at end of file +33b716b00fc929dc2174d85cf1b1f7f2d907e9e2 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2af218b4480..d88d05d5c9d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2156 \ No newline at end of file +v2159 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index 00b1c0ce956..396caf71d8d 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -132,6 +132,14 @@ public static class Components extends StripeObject { @SerializedName("account_onboarding") AccountOnboarding accountOnboarding; + /** + * Configuration for the agentic + * commerce settings embedded component. + */ + @SerializedName("agentic_commerce_settings") + AgenticCommerceSettings agenticCommerceSettings; + @SerializedName("balances") Balances balances; @@ -288,6 +296,31 @@ public static class Features extends StripeObject { } } + /** + * For more details about AgenticCommerceSettings, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AgenticCommerceSettings extends StripeObject { + /** Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("features") + Features features; + + /** + * For more details about Features, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject {} + } + /** * For more details about Balances, please refer to the API Reference. diff --git a/src/main/java/com/stripe/param/SubscriptionListParams.java b/src/main/java/com/stripe/param/SubscriptionListParams.java index 20fd3bbde7a..16313d5686f 100644 --- a/src/main/java/com/stripe/param/SubscriptionListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionListParams.java @@ -17,6 +17,10 @@ public class SubscriptionListParams extends ApiRequestParams { @SerializedName("automatic_tax") AutomaticTax automaticTax; + /** Filter for subscriptions that have the specified billing cadence. */ + @SerializedName("billing_cadence") + String billingCadence; + /** * The collection method of the subscriptions to retrieve. Either {@code charge_automatically} or * {@code send_invoice}. @@ -116,6 +120,7 @@ public class SubscriptionListParams extends ApiRequestParams { private SubscriptionListParams( AutomaticTax automaticTax, + String billingCadence, CollectionMethod collectionMethod, Object created, Object currentPeriodEnd, @@ -132,6 +137,7 @@ private SubscriptionListParams( Status status, String testClock) { this.automaticTax = automaticTax; + this.billingCadence = billingCadence; this.collectionMethod = collectionMethod; this.created = created; this.currentPeriodEnd = currentPeriodEnd; @@ -156,6 +162,8 @@ public static Builder builder() { public static class Builder { private AutomaticTax automaticTax; + private String billingCadence; + private CollectionMethod collectionMethod; private Object created; @@ -190,6 +198,7 @@ public static class Builder { public SubscriptionListParams build() { return new SubscriptionListParams( this.automaticTax, + this.billingCadence, this.collectionMethod, this.created, this.currentPeriodEnd, @@ -213,6 +222,12 @@ public Builder setAutomaticTax(SubscriptionListParams.AutomaticTax automaticTax) return this; } + /** Filter for subscriptions that have the specified billing cadence. */ + public Builder setBillingCadence(String billingCadence) { + this.billingCadence = billingCadence; + return this; + } + /** * The collection method of the subscriptions to retrieve. Either {@code charge_automatically} * or {@code send_invoice}. From ddcad15f28a59f12308bf26dfcecd43f972706ac Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 23:33:51 +0000 Subject: [PATCH 4/6] Update generated code for v2160 and --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/ApiVersion.java | 2 +- src/main/java/com/stripe/StripeClient.java | 11 + src/main/java/com/stripe/model/Account.java | 92 +- .../java/com/stripe/model/AccountSession.java | 18 +- .../com/stripe/model/BalanceTransaction.java | 24 +- src/main/java/com/stripe/model/Charge.java | 22 +- .../com/stripe/model/ConfirmationToken.java | 20 +- src/main/java/com/stripe/model/Customer.java | 48 +- src/main/java/com/stripe/model/Event.java | 30 +- .../stripe/model/EventDataClassLookup.java | 8 + src/main/java/com/stripe/model/Invoice.java | 93 +- .../java/com/stripe/model/InvoiceItem.java | 22 +- .../com/stripe/model/InvoiceLineItem.java | 28 +- src/main/java/com/stripe/model/Order.java | 174 +- .../stripe/model/PaymentAttemptRecord.java | 20 +- .../java/com/stripe/model/PaymentIntent.java | 1083 +++++++++++- .../java/com/stripe/model/PaymentLink.java | 2 +- .../java/com/stripe/model/PaymentMethod.java | 20 +- .../java/com/stripe/model/PaymentRecord.java | 20 +- .../com/stripe/model/QuotePreviewInvoice.java | 30 +- .../java/com/stripe/model/SetupAttempt.java | 22 +- .../java/com/stripe/model/StripeError.java | 10 +- .../java/com/stripe/model/Subscription.java | 58 +- src/main/java/com/stripe/model/TaxId.java | 14 +- .../com/stripe/model/checkout/Session.java | 74 +- .../model/financialconnections/Account.java | 46 + .../financialconnections/Authorization.java | 248 +++ .../model/financialconnections/Session.java | 55 + .../stripe/model/radar/PaymentEvaluation.java | 800 +++++++++ .../java/com/stripe/model/reserve/Hold.java | 267 +++ .../stripe/model/reserve/HoldCollection.java | 6 + .../java/com/stripe/model/reserve/Plan.java | 185 ++ .../com/stripe/model/reserve/Release.java | 303 ++++ .../model/reserve/ReleaseCollection.java | 6 + .../com/stripe/model/tax/Calculation.java | 28 +- .../com/stripe/model/tax/Transaction.java | 28 +- .../stripe/model/terminal/Configuration.java | 27 - .../stripe/model/treasury/ReceivedDebit.java | 7 + .../com/stripe/param/AccountCreateParams.java | 424 ++++- .../param/AccountSessionCreateParams.java | 36 +- .../com/stripe/param/AccountUpdateParams.java | 442 ++++- .../param/BalanceTransactionListParams.java | 23 +- .../param/ConfirmationTokenCreateParams.java | 3 + .../com/stripe/param/CouponCreateParams.java | 10 +- .../stripe/param/CustomerCreateParams.java | 26 +- .../param/CustomerTaxIdCreateParams.java | 25 +- .../param/InvoiceCreatePreviewParams.java | 26 +- .../param/InvoiceDetachPaymentParams.java | 114 ++ .../com/stripe/param/OrderCreateParams.java | 26 +- .../com/stripe/param/OrderUpdateParams.java | 26 +- .../param/PaymentIntentCaptureParams.java | 49 +- .../param/PaymentIntentConfirmParams.java | 72 +- .../param/PaymentIntentCreateParams.java | 72 +- ...entIntentIncrementAuthorizationParams.java | 49 +- .../param/PaymentIntentUpdateParams.java | 72 +- .../stripe/param/PaymentLinkCreateParams.java | 22 +- .../stripe/param/PaymentLinkUpdateParams.java | 26 +- ...aymentMethodConfigurationCreateParams.java | 8 +- ...aymentMethodConfigurationUpdateParams.java | 8 +- .../param/PaymentMethodCreateParams.java | 3 + .../param/SetupIntentConfirmParams.java | 11 +- .../stripe/param/SetupIntentCreateParams.java | 11 +- .../stripe/param/SetupIntentUpdateParams.java | 11 +- .../stripe/param/SubscriptionPauseParams.java | 274 +++ .../param/TaxIdCollectionCreateParams.java | 25 +- .../com/stripe/param/TaxIdCreateParams.java | 25 +- .../param/WebhookEndpointCreateParams.java | 9 +- .../param/WebhookEndpointUpdateParams.java | 4 + .../param/checkout/SessionCreateParams.java | 72 +- .../AuthorizationRetrieveParams.java | 100 ++ .../SessionCreateParams.java | 106 +- .../radar/PaymentEvaluationCreateParams.java | 1483 +++++++++++++++++ .../HoldListParams.java} | 144 +- .../HoldRetrieveParams.java} | 18 +- .../PlanRetrieveParams.java} | 18 +- .../ReleaseListParams.java} | 86 +- .../param/reserve/ReleaseRetrieveParams.java | 100 ++ .../param/tax/CalculationCreateParams.java | 26 +- .../terminal/ConfigurationCreateParams.java | 169 +- .../terminal/ConfigurationUpdateParams.java | 163 -- .../com/stripe/service/CustomerService.java | 48 +- .../service/FinancialConnectionsService.java | 5 + .../com/stripe/service/InvoiceService.java | 44 +- .../stripe/service/OrderLineItemService.java | 64 - .../java/com/stripe/service/OrderService.java | 56 - .../java/com/stripe/service/RadarService.java | 4 + .../com/stripe/service/ReserveService.java | 23 + .../stripe/service/SubscriptionService.java | 29 + .../java/com/stripe/service/V1Services.java | 4 + .../service/checkout/SessionService.java | 16 +- .../AuthorizationService.java | 50 + .../radar/PaymentEvaluationService.java | 43 + .../stripe/service/reserve/HoldService.java | 85 + .../stripe/service/reserve/PlanService.java | 45 + .../service/reserve/ReleaseService.java | 85 + 97 files changed, 7765 insertions(+), 1208 deletions(-) create mode 100644 src/main/java/com/stripe/model/financialconnections/Authorization.java create mode 100644 src/main/java/com/stripe/model/radar/PaymentEvaluation.java create mode 100644 src/main/java/com/stripe/model/reserve/Hold.java create mode 100644 src/main/java/com/stripe/model/reserve/HoldCollection.java create mode 100644 src/main/java/com/stripe/model/reserve/Plan.java create mode 100644 src/main/java/com/stripe/model/reserve/Release.java create mode 100644 src/main/java/com/stripe/model/reserve/ReleaseCollection.java create mode 100644 src/main/java/com/stripe/param/InvoiceDetachPaymentParams.java create mode 100644 src/main/java/com/stripe/param/SubscriptionPauseParams.java create mode 100644 src/main/java/com/stripe/param/financialconnections/AuthorizationRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/radar/PaymentEvaluationCreateParams.java rename src/main/java/com/stripe/param/{OrderLineItemListParams.java => reserve/HoldListParams.java} (57%) rename src/main/java/com/stripe/param/{OrderCancelParams.java => reserve/HoldRetrieveParams.java} (83%) rename src/main/java/com/stripe/param/{OrderReopenParams.java => reserve/PlanRetrieveParams.java} (83%) rename src/main/java/com/stripe/param/{OrderListLineItemsParams.java => reserve/ReleaseListParams.java} (67%) create mode 100644 src/main/java/com/stripe/param/reserve/ReleaseRetrieveParams.java delete mode 100644 src/main/java/com/stripe/service/OrderLineItemService.java create mode 100644 src/main/java/com/stripe/service/ReserveService.java create mode 100644 src/main/java/com/stripe/service/financialconnections/AuthorizationService.java create mode 100644 src/main/java/com/stripe/service/radar/PaymentEvaluationService.java create mode 100644 src/main/java/com/stripe/service/reserve/HoldService.java create mode 100644 src/main/java/com/stripe/service/reserve/PlanService.java create mode 100644 src/main/java/com/stripe/service/reserve/ReleaseService.java diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 98c90a80b8f..5a8d600ad16 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -33b716b00fc929dc2174d85cf1b1f7f2d907e9e2 \ No newline at end of file +45d723936ebab9668b6996394720dcf4a2436671 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d88d05d5c9d..469687e756a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2159 \ No newline at end of file +v2160 \ No newline at end of file diff --git a/src/main/java/com/stripe/ApiVersion.java b/src/main/java/com/stripe/ApiVersion.java index 6296456d824..ec6d77902b3 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-12-15.preview"; + public static final String CURRENT = "2026-01-28.preview"; } diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index c4d64a10786..ed34024675b 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -852,6 +852,17 @@ public com.stripe.service.ReportingService reporting() { return new com.stripe.service.ReportingService(this.getResponseGetter()); } + /** + * @deprecated StripeClient.reserve() is deprecated, use StripeClient.v1().reserve() instead. All + * functionality under it has been copied over to StripeClient.v1().reserve(). See migration + * guide for more on this and tips on migrating to the new v1 namespace. + */ + @Deprecated + public com.stripe.service.ReserveService reserve() { + return new com.stripe.service.ReserveService(this.getResponseGetter()); + } + /** * @deprecated StripeClient.reviews() is deprecated, use StripeClient.v1().reviews() instead. All * functionality under it has been copied over to StripeClient.v1().reviews(). See API - * Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Capital extends StripeObject { - /** Per-currency mapping of user-selected destination accounts used to pay out loans. */ - @SerializedName("payout_destination") - Map payoutDestination; - - /** Per-currency mapping of all destination accounts eligible to receive loan payouts. */ - @SerializedName("payout_destination_selector") - Map> payoutDestinationSelector; - } - /** * For more details about CardIssuing, please refer to the API Reference. @@ -3081,6 +3061,10 @@ public static class Schedule extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class PaypayPayments extends StripeObject { + /** Additional files that are required to support the onboarding process of your business. */ + @SerializedName("additional_files") + List additionalFiles; + /** * Whether your business sells digital content or not. * @@ -3088,6 +3072,74 @@ public static class PaypayPayments extends StripeObject { */ @SerializedName("goods_type") String goodsType; + + @SerializedName("site") + Site site; + + /** + * For more details about Site, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Site extends StripeObject { + @SerializedName("accessible") + Accessible accessible; + + @SerializedName("in_development") + InDevelopment inDevelopment; + + @SerializedName("restricted") + Restricted restricted; + + /** + * The status of your business's website. + * + *

One of {@code accessible}, {@code in_development}, or {@code restricted}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Accessible, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Accessible extends StripeObject {} + + /** + * For more details about InDevelopment, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InDevelopment extends StripeObject { + /** Field to indicate that the website password has been provided. */ + @SerializedName("password_provided") + Boolean passwordProvided; + + /** The username needed to access your business's website. */ + @SerializedName("username") + String username; + } + + /** + * For more details about Restricted, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Restricted extends StripeObject { + /** File explaining the payment flow for your business. */ + @SerializedName("payment_flow_file") + String paymentFlowFile; + } + } } /** diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index 396caf71d8d..e016166a5c1 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -372,9 +372,9 @@ public static class Features extends StripeObject { Boolean externalAccountCollection; /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. + * Whether to allow creation of instant payouts. The default value is {@code enabled} when + * Stripe is responsible for negative account balances, and {@code use_dashboard_rules} + * otherwise. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -688,9 +688,9 @@ public static class Features extends StripeObject { Boolean externalAccountCollection; /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. + * Whether to allow creation of instant payouts. The default value is {@code enabled} when + * Stripe is responsible for negative account balances, and {@code use_dashboard_rules} + * otherwise. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -1052,9 +1052,9 @@ public static class Features extends StripeObject { Boolean externalAccountCollection; /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. + * Whether to allow creation of instant payouts. The default value is {@code enabled} when + * Stripe is responsible for negative account balances, and {@code use_dashboard_rules} + * otherwise. */ @SerializedName("instant_payouts") Boolean instantPayouts; diff --git a/src/main/java/com/stripe/model/BalanceTransaction.java b/src/main/java/com/stripe/model/BalanceTransaction.java index 3d4063c691b..13729aef1d4 100644 --- a/src/main/java/com/stripe/model/BalanceTransaction.java +++ b/src/main/java/com/stripe/model/BalanceTransaction.java @@ -43,8 +43,8 @@ public class BalanceTransaction extends ApiResource implements HasId { /** * The balance that this transaction impacts. * - *

One of {@code issuing}, {@code payments}, {@code refund_and_dispute_prefunding}, or {@code - * transit}. + *

One of {@code issuing}, {@code payments}, {@code refund_and_dispute_prefunding}, {@code + * risk_reserved}, or {@code transit}. */ @SerializedName("balance_type") String balanceType; @@ -138,11 +138,11 @@ public class BalanceTransaction extends ApiResource implements HasId { * payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code * payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code * payout_minimum_balance_hold}, {@code payout_minimum_balance_release}, {@code refund}, {@code - * refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, - * {@code stripe_fx_fee}, {@code stripe_balance_payment_debit}, {@code - * stripe_balance_payment_debit_reversal}, {@code tax_fee}, {@code topup}, {@code topup_reversal}, - * {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or {@code - * transfer_refund}. Learn more about balance transaction types and * what they represent. To classify transactions for accounting purposes, consider {@code * reporting_category} instead. @@ -157,11 +157,11 @@ public class BalanceTransaction extends ApiResource implements HasId { * payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code * payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code * payout_minimum_balance_hold}, {@code payout_minimum_balance_release}, {@code refund}, {@code - * refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code - * stripe_balance_payment_debit}, {@code stripe_balance_payment_debit_reversal}, {@code - * stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code topup}, {@code topup_reversal}, - * {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or {@code - * transfer_refund}. + * refund_failure}, {@code reserve_hold}, {@code reserve_release}, {@code reserve_transaction}, + * {@code reserved_funds}, {@code stripe_balance_payment_debit}, {@code + * stripe_balance_payment_debit_reversal}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code + * tax_fee}, {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, + * {@code transfer_failure}, or {@code transfer_refund}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 0252c6ab450..15d5f4b1683 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -2313,7 +2313,7 @@ public static class ThreeDSecure extends StripeObject { /** * The version of 3D Secure that was used. * - *

One of {@code 1.0.2}, {@code 2.1.0}, or {@code 2.2.0}. + *

One of {@code 1.0.2}, {@code 2.1.0}, {@code 2.2.0}, {@code 2.3.0}, or {@code 2.3.1}. */ @SerializedName("version") String version; @@ -2991,11 +2991,11 @@ public static class IdBankTransfer extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code mollie}, - * {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code - * revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank. Can be one of {@code abn_amro}, {@code adyen}, {@code asn_bank}, + * {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code + * knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code + * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, + * or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -3003,11 +3003,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index 579a7e33452..dea58a218e9 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -1747,11 +1747,11 @@ public static class IdBankTransfer extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code asn_bank}, {@code - * bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, - * {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code - * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, - * or {@code yoursafe}. + * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code adyen}, {@code + * asn_bank}, {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, + * {@code knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, + * {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code + * van_lanschot}, or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -1759,11 +1759,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank, if the bank was provided. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java index efdf01ffd71..309c0dadb5d 100644 --- a/src/main/java/com/stripe/model/Customer.java +++ b/src/main/java/com/stripe/model/Customer.java @@ -787,14 +787,14 @@ public static CustomerSearchResult search(CustomerSearchParams params, RequestOp /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -806,14 +806,14 @@ public Customer update(Map params) throws StripeException { /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -829,14 +829,14 @@ public Customer update(Map params, RequestOptions options) /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -847,14 +847,14 @@ public Customer update(CustomerUpdateParams params) throws StripeException { /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index e16e30c7cad..65f3da54dda 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -120,20 +120,22 @@ public class Event extends ApiResource implements HasId { * capital.financing_offer.canceled}, {@code capital.financing_offer.created}, {@code * capital.financing_offer.expired}, {@code capital.financing_offer.fully_repaid}, {@code * capital.financing_offer.paid_out}, {@code capital.financing_offer.rejected}, {@code - * capital.financing_offer.replacement_created}, {@code capital.financing_transaction.created}, - * {@code cash_balance.funds_available}, {@code charge.captured}, {@code charge.dispute.closed}, - * {@code charge.dispute.created}, {@code charge.dispute.funds_reinstated}, {@code - * charge.dispute.funds_withdrawn}, {@code charge.dispute.updated}, {@code charge.expired}, {@code - * charge.failed}, {@code charge.pending}, {@code charge.refund.updated}, {@code charge.refunded}, - * {@code charge.succeeded}, {@code charge.updated}, {@code - * checkout.session.async_payment_failed}, {@code checkout.session.async_payment_succeeded}, - * {@code checkout.session.completed}, {@code checkout.session.expired}, {@code - * climate.order.canceled}, {@code climate.order.created}, {@code climate.order.delayed}, {@code - * climate.order.delivered}, {@code climate.order.product_substituted}, {@code - * climate.product.created}, {@code climate.product.pricing_updated}, {@code coupon.created}, - * {@code coupon.deleted}, {@code coupon.updated}, {@code credit_note.created}, {@code - * credit_note.updated}, {@code credit_note.voided}, {@code customer.created}, {@code - * customer.deleted}, {@code customer.discount.created}, {@code customer.discount.deleted}, {@code + * capital.financing_offer.replacement_created}, {@code + * capital.financing_summary.line_of_credit_update}, {@code + * capital.financing_transaction.created}, {@code cash_balance.funds_available}, {@code + * charge.captured}, {@code charge.dispute.closed}, {@code charge.dispute.created}, {@code + * charge.dispute.funds_reinstated}, {@code charge.dispute.funds_withdrawn}, {@code + * charge.dispute.updated}, {@code charge.expired}, {@code charge.failed}, {@code charge.pending}, + * {@code charge.refund.updated}, {@code charge.refunded}, {@code charge.succeeded}, {@code + * charge.updated}, {@code checkout.session.async_payment_failed}, {@code + * checkout.session.async_payment_succeeded}, {@code checkout.session.completed}, {@code + * checkout.session.expired}, {@code climate.order.canceled}, {@code climate.order.created}, + * {@code climate.order.delayed}, {@code climate.order.delivered}, {@code + * climate.order.product_substituted}, {@code climate.product.created}, {@code + * climate.product.pricing_updated}, {@code coupon.created}, {@code coupon.deleted}, {@code + * coupon.updated}, {@code credit_note.created}, {@code credit_note.updated}, {@code + * credit_note.voided}, {@code customer.created}, {@code customer.deleted}, {@code + * customer.discount.created}, {@code customer.discount.deleted}, {@code * customer.discount.updated}, {@code customer.source.created}, {@code customer.source.deleted}, * {@code customer.source.expiring}, {@code customer.source.updated}, {@code * customer.subscription.collection_paused}, {@code customer.subscription.collection_resumed}, diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index d664409e727..9a603ae7b19 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -173,6 +173,9 @@ public final class EventDataClassLookup { classLookup.put( "financial_connections.account_ownership", com.stripe.model.financialconnections.AccountOwnership.class); + classLookup.put( + "financial_connections.authorization", + com.stripe.model.financialconnections.Authorization.class); classLookup.put( "financial_connections.institution", com.stripe.model.financialconnections.Institution.class); @@ -220,12 +223,17 @@ public final class EventDataClassLookup { classLookup.put("radar.account_evaluation", com.stripe.model.radar.AccountEvaluation.class); classLookup.put("radar.early_fraud_warning", com.stripe.model.radar.EarlyFraudWarning.class); + classLookup.put("radar.payment_evaluation", com.stripe.model.radar.PaymentEvaluation.class); classLookup.put("radar.value_list", com.stripe.model.radar.ValueList.class); classLookup.put("radar.value_list_item", com.stripe.model.radar.ValueListItem.class); classLookup.put("reporting.report_run", com.stripe.model.reporting.ReportRun.class); classLookup.put("reporting.report_type", com.stripe.model.reporting.ReportType.class); + classLookup.put("reserve.hold", com.stripe.model.reserve.Hold.class); + classLookup.put("reserve.plan", com.stripe.model.reserve.Plan.class); + classLookup.put("reserve.release", com.stripe.model.reserve.Release.class); + classLookup.put("scheduled_query_run", com.stripe.model.sigma.ScheduledQueryRun.class); classLookup.put( diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index e2a960ab0c9..0c4a6a2e38a 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -15,6 +15,7 @@ import com.stripe.param.InvoiceAttachPaymentParams; import com.stripe.param.InvoiceCreateParams; import com.stripe.param.InvoiceCreatePreviewParams; +import com.stripe.param.InvoiceDetachPaymentParams; import com.stripe.param.InvoiceFinalizeInvoiceParams; import com.stripe.param.InvoiceListParams; import com.stripe.param.InvoiceMarkUncollectibleParams; @@ -1037,8 +1038,8 @@ public Invoice attachPayment(InvoiceAttachPaymentParams params, RequestOptions o /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public static Invoice create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -1047,8 +1048,8 @@ public static Invoice create(Map params) throws StripeException /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public static Invoice create(Map params, RequestOptions options) throws StripeException { @@ -1061,8 +1062,8 @@ public static Invoice create(Map params, RequestOptions options) /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public static Invoice create(InvoiceCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -1071,8 +1072,8 @@ public static Invoice create(InvoiceCreateParams params) throws StripeException /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public static Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException { @@ -1313,6 +1314,52 @@ public Invoice delete(Map params, RequestOptions options) throws return getResponseGetter().request(request, Invoice.class); } + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment() throws StripeException { + return detachPayment((Map) null, (RequestOptions) null); + } + + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment(RequestOptions options) throws StripeException { + return detachPayment((Map) null, options); + } + + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment(Map params) throws StripeException { + return detachPayment(params, (RequestOptions) null); + } + + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment(Map params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/invoices/%s/detach_payment", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Invoice.class); + } + + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment(InvoiceDetachPaymentParams params) throws StripeException { + return detachPayment(params, (RequestOptions) null); + } + + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment(InvoiceDetachPaymentParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/invoices/%s/detach_payment", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, Invoice.class); + } + /** * Stripe automatically finalizes drafts before sending and attempting payment on invoices. * However, if you’d like to finalize a draft invoice manually, you can do so using this method. @@ -2210,21 +2257,21 @@ public static class CustomerTaxId extends StripeObject { * ro_tin}, {@code rs_pib}, {@code sv_nit}, {@code uy_ruc}, {@code ve_rif}, {@code vn_tin}, * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, - * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code tw_vat}, - * {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, {@code li_vat}, - * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code - * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code - * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, - * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code - * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code al_tin}, - * {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code - * ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, - * {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, {@code cd_nif}, {@code - * mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code gn_nif}, {@code mk_vat}, - * {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, {@code tj_tin}, {@code - * ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code az_tin}, {@code bd_bin}, - * {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, {@code cm_niu}, {@code - * cv_nif}, {@code bf_ifu}, or {@code unknown}. + * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code pl_nip}, + * {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, + * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code + * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code + * sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, + * {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code + * hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, + * {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code + * de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, + * {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, {@code + * cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code gn_nif}, + * {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, {@code + * tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code az_tin}, + * {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, {@code + * cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/InvoiceItem.java b/src/main/java/com/stripe/model/InvoiceItem.java index 16b304014b2..d4cdea39dc5 100644 --- a/src/main/java/com/stripe/model/InvoiceItem.java +++ b/src/main/java/com/stripe/model/InvoiceItem.java @@ -729,11 +729,31 @@ public static class LicenseFeeDetails extends StripeObject { public static class PriceDetails extends StripeObject { /** The ID of the price this item is associated with. */ @SerializedName("price") - String price; + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField price; /** The ID of the product this item is associated with. */ @SerializedName("product") String product; + + /** 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); + } } /** diff --git a/src/main/java/com/stripe/model/InvoiceLineItem.java b/src/main/java/com/stripe/model/InvoiceLineItem.java index 4baa7b8685e..1cde704d54a 100644 --- a/src/main/java/com/stripe/model/InvoiceLineItem.java +++ b/src/main/java/com/stripe/model/InvoiceLineItem.java @@ -134,6 +134,12 @@ public class InvoiceLineItem extends ApiResource implements HasId, MetadataStore @Setter(lombok.AccessLevel.NONE) ExpandableField subscription; + /** + * The subtotal of the line item, in cents (or local equivalent), before any discounts or taxes. + */ + @SerializedName("subtotal") + Long subtotal; + /** The tax calculation identifiers of the line item. */ @SerializedName("tax_calculation_reference") TaxCalculationReference taxCalculationReference; @@ -794,11 +800,31 @@ public static class LicenseFeeDetails extends StripeObject { public static class PriceDetails extends StripeObject { /** The ID of the price this item is associated with. */ @SerializedName("price") - String price; + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField price; /** The ID of the product this item is associated with. */ @SerializedName("product") String product; + + /** 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); + } } /** diff --git a/src/main/java/com/stripe/model/Order.java b/src/main/java/com/stripe/model/Order.java index b36d949f04b..d0fde5941ea 100644 --- a/src/main/java/com/stripe/model/Order.java +++ b/src/main/java/com/stripe/model/Order.java @@ -9,11 +9,8 @@ import com.stripe.net.BaseAddress; import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; -import com.stripe.param.OrderCancelParams; import com.stripe.param.OrderCreateParams; -import com.stripe.param.OrderListLineItemsParams; import com.stripe.param.OrderListParams; -import com.stripe.param.OrderReopenParams; import com.stripe.param.OrderRetrieveParams; import com.stripe.param.OrderSubmitParams; import com.stripe.param.OrderUpdateParams; @@ -249,48 +246,6 @@ public void setDiscountObjects(List objs) { : null; } - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel() throws StripeException { - return cancel((Map) null, (RequestOptions) null); - } - - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(RequestOptions options) throws StripeException { - return cancel((Map) null, options); - } - - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(Map params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(Map params, RequestOptions options) throws StripeException { - String path = String.format("/v1/orders/%s/cancel", ApiResource.urlEncodeId(this.getId())); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); - return getResponseGetter().request(request, Order.class); - } - - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(OrderCancelParams params) throws StripeException { - return cancel(params, (RequestOptions) null); - } - - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(OrderCancelParams params, RequestOptions options) throws StripeException { - String path = String.format("/v1/orders/%s/cancel", ApiResource.urlEncodeId(this.getId())); - ApiResource.checkNullTypedParams(path, params); - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - path, - ApiRequestParams.paramsToMap(params), - options); - return getResponseGetter().request(request, Order.class); - } - /** Creates a new {@code open} order object. */ public static Order create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -371,107 +326,6 @@ public static OrderCollection list(OrderListParams params, RequestOptions option return getGlobalResponseGetter().request(request, OrderCollection.class); } - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public LineItemCollection listLineItems() throws StripeException { - return listLineItems((Map) null, (RequestOptions) null); - } - - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public LineItemCollection listLineItems(Map params) throws StripeException { - return listLineItems(params, (RequestOptions) null); - } - - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public LineItemCollection listLineItems(Map params, RequestOptions options) - throws StripeException { - String path = String.format("/v1/orders/%s/line_items", ApiResource.urlEncodeId(this.getId())); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); - return getResponseGetter().request(request, LineItemCollection.class); - } - - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public LineItemCollection listLineItems(OrderListLineItemsParams params) throws StripeException { - return listLineItems(params, (RequestOptions) null); - } - - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public LineItemCollection listLineItems(OrderListLineItemsParams params, RequestOptions options) - throws StripeException { - String path = String.format("/v1/orders/%s/line_items", ApiResource.urlEncodeId(this.getId())); - ApiResource.checkNullTypedParams(path, params); - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - path, - ApiRequestParams.paramsToMap(params), - options); - return getResponseGetter().request(request, LineItemCollection.class); - } - - /** Reopens a {@code submitted} order. */ - public Order reopen() throws StripeException { - return reopen((Map) null, (RequestOptions) null); - } - - /** Reopens a {@code submitted} order. */ - public Order reopen(RequestOptions options) throws StripeException { - return reopen((Map) null, options); - } - - /** Reopens a {@code submitted} order. */ - public Order reopen(Map params) throws StripeException { - return reopen(params, (RequestOptions) null); - } - - /** Reopens a {@code submitted} order. */ - public Order reopen(Map params, RequestOptions options) throws StripeException { - String path = String.format("/v1/orders/%s/reopen", ApiResource.urlEncodeId(this.getId())); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); - return getResponseGetter().request(request, Order.class); - } - - /** Reopens a {@code submitted} order. */ - public Order reopen(OrderReopenParams params) throws StripeException { - return reopen(params, (RequestOptions) null); - } - - /** Reopens a {@code submitted} order. */ - public Order reopen(OrderReopenParams params, RequestOptions options) throws StripeException { - String path = String.format("/v1/orders/%s/reopen", ApiResource.urlEncodeId(this.getId())); - ApiResource.checkNullTypedParams(path, params); - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - path, - ApiRequestParams.paramsToMap(params), - options); - return getResponseGetter().request(request, Order.class); - } - /** * Retrieves the details of an existing order. Supply the unique order ID from either an order * creation request or the order list, and Stripe will return the corresponding order information. @@ -1897,20 +1751,20 @@ public static class TaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code - * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code - * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, - * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code - * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, - * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code - * ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, - * {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code - * md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, - * {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code - * gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, - * {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code - * az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, - * {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. + * pl_nip}, {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, + * {@code li_uid}, {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code + * ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, + * {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code + * id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, + * {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code + * eg_tin}, {@code ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, + * {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code + * uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, + * {@code bb_tin}, {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code + * ba_tin}, {@code gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, + * {@code np_pan}, {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code + * aw_tin}, {@code az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, + * {@code la_tin}, {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecord.java b/src/main/java/com/stripe/model/PaymentAttemptRecord.java index 23f43ac7c21..9a207d02afd 100644 --- a/src/main/java/com/stripe/model/PaymentAttemptRecord.java +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -1968,11 +1968,11 @@ public static class IdBankTransfer extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code mollie}, - * {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code - * revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank. Can be one of {@code abn_amro}, {@code adyen}, {@code asn_bank}, + * {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code + * knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code + * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, + * or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -1980,11 +1980,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 650f181e444..c034dcb650b 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1752,9 +1752,12 @@ public static class AmountDetails extends StripeObject { @SerializedName("discount_amount") Long discountAmount; + @SerializedName("error") + Errors error; + /** * A list of line items, each containing information about a product in the PaymentIntent. There - * is a maximum of 100 line items. + * is a maximum of 200 line items. */ @SerializedName("line_items") PaymentIntentAmountDetailsLineItemCollection lineItems; @@ -1768,6 +1771,28 @@ public static class AmountDetails extends StripeObject { @SerializedName("tip") Tip tip; + /** + * For more details about Errors, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Errors extends StripeObject { + /** + * The code of the error that occurred when validating the current amount details. + * + *

One of {@code amount_details_amount_mismatch}, or {@code + * amount_details_tax_shipping_discount_greater_than_amount}. + */ + @SerializedName("code") + String code; + + /** A message providing more details about the error. */ + @SerializedName("message") + String message; + } + /** * For more details about Shipping, please refer to the API Reference. @@ -2885,6 +2910,9 @@ public static class PaymentDetails extends StripeObject { @SerializedName("car_rental") CarRental carRental; + @SerializedName("car_rental_data") + List carRentalData; + /** * A unique value to identify the customer. This field is available only for card payments. * @@ -2897,6 +2925,12 @@ public static class PaymentDetails extends StripeObject { @SerializedName("event_details") EventDetails eventDetails; + @SerializedName("flight_data") + List flightData; + + @SerializedName("lodging_data") + List lodgingData; + /** * A unique value assigned by the business to identify the transaction. Required for L2 and L3 * rates. @@ -3137,6 +3171,389 @@ public static class Driver extends StripeObject { } } + /** + * For more details about CarRentalDatum, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CarRentalDatum extends StripeObject { + @SerializedName("affiliate") + Affiliate affiliate; + + /** The booking number associated with the car rental. */ + @SerializedName("booking_number") + String bookingNumber; + + /** The name of the car rental company. */ + @SerializedName("carrier_name") + String carrierName; + + /** The customer service phone number of the car rental company. */ + @SerializedName("customer_service_phone_number") + String customerServicePhoneNumber; + + /** Number of days the car is being rented. */ + @SerializedName("days_rented") + Long daysRented; + + @SerializedName("distance") + Distance distance; + + /** The details of the drivers associated with the rental. */ + @SerializedName("drivers") + List drivers; + + @SerializedName("drop_off") + DropOff dropOff; + + /** Insurance details for the car rental. */ + @SerializedName("insurances") + List insurances; + + /** Indicates if the customer did not keep nor cancel their booking. */ + @SerializedName("no_show_indicator") + Boolean noShowIndicator; + + @SerializedName("pickup") + Pickup pickup; + + /** Name of the person renting the vehicle. */ + @SerializedName("renter_name") + String renterName; + + @SerializedName("total") + Total total; + + @SerializedName("vehicle") + Vehicle vehicle; + + /** + * For more details about Affiliate, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Affiliate extends StripeObject { + /** Affiliate code. */ + @SerializedName("code") + String code; + + /** Affiliate name. */ + @SerializedName("name") + String name; + } + + /** + * For more details about Distance, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Distance extends StripeObject { + /** Distance amount. */ + @SerializedName("amount") + Long amount; + + /** + * Unit for the distance. + * + *

One of {@code kilometers}, or {@code miles}. + */ + @SerializedName("unit") + String unit; + } + + /** + * For more details about Driver, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Driver extends StripeObject { + @SerializedName("date_of_birth") + DateOfBirth dateOfBirth; + + /** Driver's identification number. */ + @SerializedName("driver_identification_number") + String driverIdentificationNumber; + + /** Driver's tax number. */ + @SerializedName("driver_tax_number") + String driverTaxNumber; + + /** Full name of the driver. */ + @SerializedName("name") + String name; + + /** + * For more details about DateOfBirth, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DateOfBirth extends StripeObject { + /** Day of birth. */ + @SerializedName("day") + Long day; + + /** Month of birth. */ + @SerializedName("month") + Long month; + + /** Year of birth. */ + @SerializedName("year") + Long year; + } + } + + /** + * For more details about DropOff, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DropOff extends StripeObject { + @SerializedName("address") + com.stripe.model.Address address; + + /** Name of the location. */ + @SerializedName("location_name") + String locationName; + + /** Time associated with the location. */ + @SerializedName("time") + Long time; + } + + /** + * For more details about Insurance, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Insurance extends StripeObject { + /** Amount of the insurance. */ + @SerializedName("amount") + Long amount; + + /** Currency for the insurance price. */ + @SerializedName("currency") + String currency; + + /** Name of the insurance company. */ + @SerializedName("insurance_company_name") + String insuranceCompanyName; + + /** + * Type of insurance. + * + *

One of {@code liability_supplement}, {@code loss_damage_waiver}, {@code other}, {@code + * partial_damage_waiver}, {@code personal_accident}, or {@code personal_effects}. + */ + @SerializedName("insurance_type") + String insuranceType; + } + + /** + * For more details about Pickup, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pickup extends StripeObject { + @SerializedName("address") + com.stripe.model.Address address; + + /** Name of the location. */ + @SerializedName("location_name") + String locationName; + + /** Time associated with the location. */ + @SerializedName("time") + Long time; + } + + /** + * For more details about Total, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Total extends StripeObject { + /** Total amount. */ + @SerializedName("amount") + Long amount; + + /** Currency for the total amount. */ + @SerializedName("currency") + String currency; + + @SerializedName("discounts") + Discounts discounts; + + /** Additional charges for the rental. */ + @SerializedName("extra_charges") + List extraCharges; + + /** Rate per unit. */ + @SerializedName("rate_per_unit") + Long ratePerUnit; + + /** + * Unit for the rate. + * + *

One of {@code kilometers}, or {@code miles}. + */ + @SerializedName("rate_unit") + String rateUnit; + + @SerializedName("tax") + Tax tax; + + /** + * For more details about Discounts, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Discounts extends StripeObject { + /** Corporate client discount code. */ + @SerializedName("corporate_client_code") + String corporateClientCode; + + /** Coupon code applied. */ + @SerializedName("coupon") + String coupon; + + /** Maximum free miles or kilometers included. */ + @SerializedName("maximum_free_miles_or_kilometers") + Long maximumFreeMilesOrKilometers; + } + + /** + * For more details about ExtraCharge, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ExtraCharge extends StripeObject { + /** Amount of the extra charge. */ + @SerializedName("amount") + Long amount; + + /** + * Type of extra charge. + * + *

One of {@code extra_mileage}, {@code gas}, {@code gps}, {@code late_charge}, {@code + * one_way_drop_off}, {@code other}, {@code parking}, {@code phone}, {@code + * regular_mileage}, or {@code towing}. + */ + @SerializedName("type") + String type; + } + + /** + * For more details about Tax, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** Indicates whether the rental is tax-exempt. */ + @SerializedName("tax_exempt_indicator") + Boolean taxExemptIndicator; + + /** Tax details. */ + @SerializedName("taxes") + List taxes; + + /** + * For more details about InnerTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InnerTax extends StripeObject { + /** Tax amount. */ + @SerializedName("amount") + Long amount; + + /** Tax rate. */ + @SerializedName("rate") + Long rate; + + /** Type of tax. */ + @SerializedName("type") + String type; + } + } + } + + /** + * For more details about Vehicle, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Vehicle extends StripeObject { + /** Make of the vehicle. */ + @SerializedName("make") + String make; + + /** Model of the vehicle. */ + @SerializedName("model") + String model; + + /** Odometer reading. */ + @SerializedName("odometer") + Long odometer; + + /** + * Type of the vehicle. + * + *

One of {@code cargo_van}, {@code compact}, {@code economy}, {@code exotic}, {@code + * exotic_suv}, {@code fifteen_passenger_van}, {@code four_wheel_drive}, {@code full_size}, + * {@code intermediate}, {@code large_suv}, {@code large_truck}, {@code luxury}, {@code + * medium_suv}, {@code midsize}, {@code mini}, {@code minivan}, {@code miscellaneous}, + * {@code moped}, {@code moving_van}, {@code premium}, {@code regular}, {@code + * small_medium_truck}, {@code small_suv}, {@code special}, {@code standard}, {@code + * stretch}, {@code subcompact}, {@code taxi}, {@code twelve_foot_truck}, {@code + * twelve_passenger_van}, {@code twenty_foot_truck}, {@code twenty_four_foot_truck}, {@code + * twenty_six_foot_truck}, or {@code unique}. + */ + @SerializedName("type") + String type; + + /** + * Class of the vehicle. + * + *

One of {@code business}, {@code economy}, {@code first_class}, or {@code + * premium_economy}. + */ + @SerializedName("vehicle_class") + String vehicleClass; + + /** Vehicle identification number. */ + @SerializedName("vehicle_identification_number") + String vehicleIdentificationNumber; + } + } + /** * For more details about EventDetails, please refer to the API Reference. @@ -3233,6 +3650,670 @@ public static class Recipient extends StripeObject { } } + /** + * For more details about FlightDatum, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FlightDatum extends StripeObject { + @SerializedName("affiliate") + Affiliate affiliate; + + /** The booking number associated with the flight reservation. */ + @SerializedName("booking_number") + String bookingNumber; + + /** + * The computerized reservation system used to make the reservation and purchase the ticket. + */ + @SerializedName("computerized_reservation_system") + String computerizedReservationSystem; + + /** Ticket restrictions. */ + @SerializedName("endorsements_and_restrictions") + String endorsementsAndRestrictions; + + /** Insurance details for the flight. */ + @SerializedName("insurances") + List insurances; + + /** The list of passengers for this flight. */ + @SerializedName("passengers") + List passengers; + + /** The list of flight segments for this reservation. */ + @SerializedName("segments") + List segments; + + /** Electronic ticket indicator. */ + @SerializedName("ticket_electronically_issued_indicator") + Boolean ticketElectronicallyIssuedIndicator; + + @SerializedName("total") + Total total; + + /** + * Type of flight transaction. + * + *

One of {@code exchange_ticket}, {@code miscellaneous}, {@code refund}, or {@code + * ticket_purchase}. + */ + @SerializedName("transaction_type") + String transactionType; + + /** + * For more details about Affiliate, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Affiliate extends StripeObject { + /** Affiliate code. */ + @SerializedName("code") + String code; + + /** Affiliate name. */ + @SerializedName("name") + String name; + + /** Code provided by the company to a travel agent authorizing ticket issuance. */ + @SerializedName("travel_authorization_code") + String travelAuthorizationCode; + } + + /** + * For more details about Insurance, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Insurance extends StripeObject { + /** Amount of the insurance. */ + @SerializedName("amount") + Long amount; + + /** Currency for the insurance price. */ + @SerializedName("currency") + String currency; + + /** Name of the insurance company. */ + @SerializedName("insurance_company_name") + String insuranceCompanyName; + + /** + * Type of insurance. + * + *

One of {@code baggage}, {@code bankruptcy}, {@code cancelation}, {@code emergency}, or + * {@code medical}. + */ + @SerializedName("insurance_type") + String insuranceType; + } + + /** + * For more details about Passenger, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Passenger extends StripeObject { + /** Full name of the passenger. */ + @SerializedName("name") + String name; + } + + /** + * For more details about Segment, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Segment extends StripeObject { + /** Segment fare amount. */ + @SerializedName("amount") + Long amount; + + @SerializedName("arrival") + Arrival arrival; + + /** Airline carrier code. */ + @SerializedName("carrier_code") + String carrierCode; + + /** Carrier name. */ + @SerializedName("carrier_name") + String carrierName; + + /** Segment currency. */ + @SerializedName("currency") + String currency; + + @SerializedName("departure") + Departure departure; + + /** Exchange ticket number. */ + @SerializedName("exchange_ticket_number") + String exchangeTicketNumber; + + /** Fare basis code. */ + @SerializedName("fare_basis_code") + String fareBasisCode; + + /** Additional fees. */ + @SerializedName("fees") + Long fees; + + /** Flight number. */ + @SerializedName("flight_number") + String flightNumber; + + /** Stopover indicator. */ + @SerializedName("is_stop_over_indicator") + Boolean isStopOverIndicator; + + /** Refundable ticket indicator. */ + @SerializedName("refundable") + Boolean refundable; + + /** + * Class of service. + * + *

One of {@code business}, {@code economy}, {@code first_class}, or {@code + * premium_economy}. + */ + @SerializedName("service_class") + String serviceClass; + + /** Tax amount for segment. */ + @SerializedName("tax_amount") + Long taxAmount; + + /** Ticket number. */ + @SerializedName("ticket_number") + String ticketNumber; + + /** + * For more details about Arrival, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Arrival extends StripeObject { + /** Arrival airport IATA code. */ + @SerializedName("airport") + String airport; + + /** Arrival date and time. */ + @SerializedName("arrives_at") + Long arrivesAt; + + /** Arrival city. */ + @SerializedName("city") + String city; + + /** Arrival country. */ + @SerializedName("country") + String country; + } + + /** + * For more details about Departure, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Departure extends StripeObject { + /** Departure airport IATA code. */ + @SerializedName("airport") + String airport; + + /** Departure city. */ + @SerializedName("city") + String city; + + /** Departure country. */ + @SerializedName("country") + String country; + + /** Departure date and time. */ + @SerializedName("departs_at") + Long departsAt; + } + } + + /** + * For more details about Total, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Total extends StripeObject { + /** Total amount. */ + @SerializedName("amount") + Long amount; + + /** + * Reason for credit. + * + *

One of {@code other}, {@code partial_ticket_refund}, {@code + * passenger_transport_ancillary_cancellation}, {@code ticket_and_ancillary_cancellation}, + * or {@code ticket_cancellation}. + */ + @SerializedName("credit_reason") + String creditReason; + + /** Currency for the total amount. */ + @SerializedName("currency") + String currency; + + @SerializedName("discounts") + Discounts discounts; + + /** Additional charges for the flight. */ + @SerializedName("extra_charges") + List extraCharges; + + @SerializedName("tax") + Tax tax; + + /** + * For more details about Discounts, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Discounts extends StripeObject { + /** Corporate client discount code. */ + @SerializedName("corporate_client_code") + String corporateClientCode; + } + + /** + * For more details about ExtraCharge, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ExtraCharge extends StripeObject { + /** Amount of the extra charge. */ + @SerializedName("amount") + Long amount; + + /** + * Type of extra charge. + * + *

One of {@code additional_fees}, {@code ancillary_service_charges}, or {@code + * exchange_fee}. + */ + @SerializedName("type") + String type; + } + + /** + * For more details about Tax, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** Tax details. */ + @SerializedName("taxes") + List taxes; + + /** + * For more details about InnerTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InnerTax extends StripeObject { + /** Tax amount. */ + @SerializedName("amount") + Long amount; + + /** Tax rate. */ + @SerializedName("rate") + Long rate; + + /** Type of tax. */ + @SerializedName("type") + String type; + } + } + } + } + + /** + * For more details about LodgingDatum, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LodgingDatum extends StripeObject { + @SerializedName("accommodation") + Accommodation accommodation; + + @SerializedName("affiliate") + Affiliate affiliate; + + /** Booking confirmation number for the lodging. */ + @SerializedName("booking_number") + String bookingNumber; + + /** Check-in date. */ + @SerializedName("checkin_at") + Long checkinAt; + + /** Check-out date. */ + @SerializedName("checkout_at") + Long checkoutAt; + + /** Customer service phone number for the lodging company. */ + @SerializedName("customer_service_phone_number") + String customerServicePhoneNumber; + + /** Whether the lodging is compliant with any hotel fire safety regulations. */ + @SerializedName("fire_safety_act_compliance_indicator") + Boolean fireSafetyActComplianceIndicator; + + /** List of guests for the lodging. */ + @SerializedName("guests") + List guests; + + @SerializedName("host") + Host host; + + /** List of insurances for the lodging. */ + @SerializedName("insurances") + List insurances; + + /** Whether the renter is a no-show. */ + @SerializedName("no_show_indicator") + Boolean noShowIndicator; + + /** Renter ID number for the lodging. */ + @SerializedName("renter_id_number") + String renterIdNumber; + + /** Renter name for the lodging. */ + @SerializedName("renter_name") + String renterName; + + @SerializedName("total") + Total total; + + /** + * For more details about Accommodation, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Accommodation extends StripeObject { + /** + * Type of accommodation. + * + *

One of {@code apartment}, {@code cabana}, {@code house}, {@code penthouse}, {@code + * room}, {@code standard}, {@code suite}, or {@code villa}. + */ + @SerializedName("accommodation_type") + String accommodationType; + + /** Bed type. */ + @SerializedName("bed_type") + String bedType; + + /** Daily accommodation rate in cents. */ + @SerializedName("daily_rate_amount") + Long dailyRateAmount; + + /** Number of nights. */ + @SerializedName("nights") + Long nights; + + /** Number of rooms, cabanas, apartments, and so on. */ + @SerializedName("number_of_rooms") + Long numberOfRooms; + + /** Rate type. */ + @SerializedName("rate_type") + String rateType; + + /** Whether smoking is allowed. */ + @SerializedName("smoking_indicator") + Boolean smokingIndicator; + } + + /** + * For more details about Affiliate, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Affiliate extends StripeObject { + /** Affiliate partner code. */ + @SerializedName("code") + String code; + + /** Affiliate partner name. */ + @SerializedName("name") + String name; + } + + /** + * For more details about Guest, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Guest extends StripeObject { + /** Guest's full name. */ + @SerializedName("name") + String name; + } + + /** + * For more details about Host, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Host extends StripeObject { + @SerializedName("address") + com.stripe.model.Address address; + + /** Host's country of domicile. */ + @SerializedName("country_of_domicile") + String countryOfDomicile; + + /** Reference number for the host. */ + @SerializedName("host_reference") + String hostReference; + + /** + * Type of host. + * + *

One of {@code hostel}, {@code hotel}, {@code owner}, or {@code rental_agency}. + */ + @SerializedName("host_type") + String hostType; + + /** Name of the lodging property or host. */ + @SerializedName("name") + String name; + + /** Total number of reservations for the host. */ + @SerializedName("number_of_reservations") + Long numberOfReservations; + + /** Property phone number. */ + @SerializedName("property_phone_number") + String propertyPhoneNumber; + + /** Host's registration date. */ + @SerializedName("registered_at") + Long registeredAt; + } + + /** + * For more details about Insurance, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Insurance extends StripeObject { + /** Price of the insurance coverage in cents. */ + @SerializedName("amount") + Long amount; + + /** Currency of the insurance amount. */ + @SerializedName("currency") + String currency; + + /** Name of the insurance company. */ + @SerializedName("insurance_company_name") + String insuranceCompanyName; + + /** + * Type of insurance coverage. + * + *

One of {@code bankruptcy}, {@code cancelation}, {@code emergency}, or {@code medical}. + */ + @SerializedName("insurance_type") + String insuranceType; + } + + /** + * For more details about Total, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Total extends StripeObject { + /** Total price of the lodging reservation in cents. */ + @SerializedName("amount") + Long amount; + + /** Cash advances in cents. */ + @SerializedName("cash_advances") + Long cashAdvances; + + /** Currency of the total amount. */ + @SerializedName("currency") + String currency; + + @SerializedName("discounts") + Discounts discounts; + + /** Additional charges for the lodging. */ + @SerializedName("extra_charges") + List extraCharges; + + /** Prepaid amount in cents. */ + @SerializedName("prepaid_amount") + Long prepaidAmount; + + @SerializedName("tax") + Tax tax; + + /** + * For more details about Discounts, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Discounts extends StripeObject { + /** Corporate client discount code. */ + @SerializedName("corporate_client_code") + String corporateClientCode; + + /** Coupon code. */ + @SerializedName("coupon") + String coupon; + } + + /** + * For more details about ExtraCharge, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ExtraCharge extends StripeObject { + /** Amount of the extra charge in cents. */ + @SerializedName("amount") + Long amount; + + /** + * Type of extra charge. + * + *

One of {@code gift_shop}, {@code laundry}, {@code mini_bar}, {@code other}, {@code + * phone}, or {@code restaurant}. + */ + @SerializedName("type") + String type; + } + + /** + * For more details about Tax, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** Indicates whether the transaction is tax exempt. */ + @SerializedName("tax_exempt_indicator") + Boolean taxExemptIndicator; + + /** Tax details. */ + @SerializedName("taxes") + List taxes; + + /** + * For more details about InnerTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InnerTax extends StripeObject { + /** Tax amount in cents. */ + @SerializedName("amount") + Long amount; + + /** Tax rate. */ + @SerializedName("rate") + Long rate; + + /** Type of tax applied. */ + @SerializedName("type") + String type; + } + } + } + } + /** * For more details about Subscription, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index 55261a8c76f..e2f564dab47 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -96,7 +96,7 @@ public class PaymentLink extends ApiResource implements HasId, MetadataStore customFields; diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 35319fcc9c9..c0151aba099 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -2056,11 +2056,11 @@ public static class IdBankTransfer extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code asn_bank}, {@code - * bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code - * mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, - * {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code adyen}, {@code + * asn_bank}, {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, + * {@code knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, + * {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code + * van_lanschot}, or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -2068,11 +2068,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank, if the bank was provided. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or {@code - * TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java index ea9154631a8..02fa3ce3a05 100644 --- a/src/main/java/com/stripe/model/PaymentRecord.java +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -2270,11 +2270,11 @@ public static class IdBankTransfer extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code mollie}, - * {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code - * revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank. Can be one of {@code abn_amro}, {@code adyen}, {@code asn_bank}, + * {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code + * knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code + * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, + * or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -2282,11 +2282,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/QuotePreviewInvoice.java b/src/main/java/com/stripe/model/QuotePreviewInvoice.java index b07a4ef3f62..698749c09ed 100644 --- a/src/main/java/com/stripe/model/QuotePreviewInvoice.java +++ b/src/main/java/com/stripe/model/QuotePreviewInvoice.java @@ -1078,21 +1078,21 @@ public static class CustomerTaxId extends StripeObject { * ro_tin}, {@code rs_pib}, {@code sv_nit}, {@code uy_ruc}, {@code ve_rif}, {@code vn_tin}, * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, - * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code tw_vat}, - * {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, {@code li_vat}, - * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code - * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code - * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, - * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code - * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code al_tin}, - * {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code - * ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, - * {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, {@code cd_nif}, {@code - * mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code gn_nif}, {@code mk_vat}, - * {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, {@code tj_tin}, {@code - * ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code az_tin}, {@code bd_bin}, - * {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, {@code cm_niu}, {@code - * cv_nif}, {@code bf_ifu}, or {@code unknown}. + * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code pl_nip}, + * {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, + * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code + * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code + * sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, + * {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code + * hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, + * {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code + * de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, + * {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, {@code + * cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code gn_nif}, + * {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, {@code + * tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code az_tin}, + * {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, {@code + * cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/SetupAttempt.java b/src/main/java/com/stripe/model/SetupAttempt.java index 86e67391664..acda61f4b9d 100644 --- a/src/main/java/com/stripe/model/SetupAttempt.java +++ b/src/main/java/com/stripe/model/SetupAttempt.java @@ -682,7 +682,7 @@ public static class ThreeDSecure extends StripeObject { /** * The version of 3D Secure that was used. * - *

One of {@code 1.0.2}, {@code 2.1.0}, or {@code 2.2.0}. + *

One of {@code 1.0.2}, {@code 2.1.0}, {@code 2.2.0}, {@code 2.3.0}, or {@code 2.3.1}. */ @SerializedName("version") String version; @@ -839,11 +839,11 @@ public static class IdBankTransfer extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code mollie}, - * {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code - * revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank. Can be one of {@code abn_amro}, {@code adyen}, {@code asn_bank}, + * {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code + * knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code + * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, + * or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -851,11 +851,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index 8ef74da144f..e6df6884b87 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -93,11 +93,11 @@ public class StripeError extends StripeObject { * payouts_limit_exceeded}, {@code payouts_not_allowed}, {@code platform_account_required}, {@code * platform_api_key_expired}, {@code postal_code_invalid}, {@code processing_error}, {@code * product_inactive}, {@code progressive_onboarding_limit_exceeded}, {@code rate_limit}, {@code - * refer_to_customer}, {@code refund_disputed_payment}, {@code resource_already_exists}, {@code - * resource_missing}, {@code return_intent_already_processed}, {@code routing_number_invalid}, - * {@code secret_key_required}, {@code sensitive_data_access_expired}, {@code - * sepa_unsupported_account}, {@code setup_attempt_failed}, {@code - * setup_intent_authentication_failure}, {@code setup_intent_invalid_parameter}, {@code + * refer_to_customer}, {@code refund_disputed_payment}, {@code request_blocked}, {@code + * resource_already_exists}, {@code resource_missing}, {@code return_intent_already_processed}, + * {@code routing_number_invalid}, {@code secret_key_required}, {@code + * sensitive_data_access_expired}, {@code sepa_unsupported_account}, {@code setup_attempt_failed}, + * {@code setup_intent_authentication_failure}, {@code setup_intent_invalid_parameter}, {@code * setup_intent_mandate_invalid}, {@code setup_intent_mobile_wallet_unsupported}, {@code * setup_intent_setup_attempt_expired}, {@code setup_intent_unexpected_state}, {@code * shipping_address_invalid}, {@code shipping_calculation_failed}, {@code sku_inactive}, {@code diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index 8ff6648628c..7f5ec224e9f 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -15,6 +15,7 @@ import com.stripe.param.SubscriptionCreateParams; import com.stripe.param.SubscriptionListParams; import com.stripe.param.SubscriptionMigrateParams; +import com.stripe.param.SubscriptionPauseParams; import com.stripe.param.SubscriptionResumeParams; import com.stripe.param.SubscriptionRetrieveParams; import com.stripe.param.SubscriptionSearchParams; @@ -224,7 +225,10 @@ public class Subscription extends ApiResource implements HasId, MetadataStore params) throws StripeException { + return pause(params, (RequestOptions) null); + } + + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(Map params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/pause", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Subscription.class); + } + + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(SubscriptionPauseParams params) throws StripeException { + return pause(params, (RequestOptions) null); + } + + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(SubscriptionPauseParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/pause", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, Subscription.class); + } + /** * Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor * and creating prorations. If a resumption invoice is generated, it must be paid or marked diff --git a/src/main/java/com/stripe/model/TaxId.java b/src/main/java/com/stripe/model/TaxId.java index ad63f053471..fc29f689840 100644 --- a/src/main/java/com/stripe/model/TaxId.java +++ b/src/main/java/com/stripe/model/TaxId.java @@ -91,13 +91,13 @@ public class TaxId extends ApiResource implements HasId { * kh_tin}, {@code kr_brn}, {@code kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code * my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, - * {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, - * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code - * us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code - * za_vat}, {@code zm_tin}, or {@code zw_tin}. Note that some legacy tax IDs have type {@code - * unknown} + * {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, + * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code + * ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code + * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin}. Note that some legacy tax IDs have + * type {@code unknown} */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index da681481858..9ebdce05176 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -160,7 +160,7 @@ public class Session extends ApiResource implements HasId, MetadataStore customFields; @@ -839,8 +839,8 @@ public static Session retrieve( /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ @Override public Session update(Map params) throws StripeException { @@ -850,8 +850,8 @@ public Session update(Map params) throws StripeException { /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ @Override public Session update(Map params, RequestOptions options) throws StripeException { @@ -864,8 +864,8 @@ public Session update(Map params, RequestOptions options) throws /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(SessionUpdateParams params) throws StripeException { return update(params, (RequestOptions) null); @@ -874,8 +874,8 @@ public Session update(SessionUpdateParams params) throws StripeException { /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(SessionUpdateParams params, RequestOptions options) throws StripeException { String path = String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(this.getId())); @@ -1290,20 +1290,20 @@ public static class TaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code - * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code - * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, - * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code - * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, - * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code - * ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, - * {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code - * md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, - * {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code - * gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, - * {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code - * az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, - * {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. + * pl_nip}, {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, + * {@code li_uid}, {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code + * ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, + * {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code + * id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, + * {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code + * eg_tin}, {@code ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, + * {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code + * uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, + * {@code bb_tin}, {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code + * ba_tin}, {@code gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, + * {@code np_pan}, {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code + * aw_tin}, {@code az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, + * {@code la_tin}, {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; @@ -1728,20 +1728,20 @@ public static class TaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code - * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code - * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, - * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code - * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, - * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code - * ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, - * {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code - * md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, - * {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code - * gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, - * {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code - * az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, - * {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. + * pl_nip}, {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, + * {@code li_uid}, {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code + * ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, + * {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code + * id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, + * {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code + * eg_tin}, {@code ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, + * {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code + * uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, + * {@code bb_tin}, {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code + * ba_tin}, {@code gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, + * {@code np_pan}, {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code + * aw_tin}, {@code az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, + * {@code la_tin}, {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/financialconnections/Account.java b/src/main/java/com/stripe/model/financialconnections/Account.java index 9aafea3d42e..64092491593 100644 --- a/src/main/java/com/stripe/model/financialconnections/Account.java +++ b/src/main/java/com/stripe/model/financialconnections/Account.java @@ -42,6 +42,10 @@ public class Account extends ApiResource implements HasId { @SerializedName("account_numbers") List accountNumbers; + /** The ID of the Financial Connections Authorization this account belongs to. */ + @SerializedName("authorization") + String authorization; + /** The most recent information about the account's balance. */ @SerializedName("balance") Balance balance; @@ -132,6 +136,9 @@ public class Account extends ApiResource implements HasId { @SerializedName("status") String status; + @SerializedName("status_details") + StatusDetails statusDetails; + /** * If {@code category} is {@code cash}, one of: * @@ -828,6 +835,44 @@ public static class OwnershipRefresh extends StripeObject { String status; } + /** + * For more details about StatusDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StatusDetails extends StripeObject { + @SerializedName("inactive") + Inactive inactive; + + /** + * For more details about Inactive, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Inactive extends StripeObject { + /** + * The action (if any) to relink the inactive Account. + * + *

One of {@code none}, or {@code relink_required}. + */ + @SerializedName("action") + String action; + + /** + * The underlying cause of the Account being inactive. + * + *

One of {@code access_denied}, {@code access_expired}, {@code account_closed}, {@code + * account_unavailable}, or {@code unspecified}. + */ + @SerializedName("cause") + String cause; + } + } + /** * For more details about TransactionRefresh, please refer to the API Reference. @@ -874,6 +919,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(institution, responseGetter); trySetResponseGetter(ownership, responseGetter); trySetResponseGetter(ownershipRefresh, responseGetter); + trySetResponseGetter(statusDetails, responseGetter); trySetResponseGetter(transactionRefresh, responseGetter); } } diff --git a/src/main/java/com/stripe/model/financialconnections/Authorization.java b/src/main/java/com/stripe/model/financialconnections/Authorization.java new file mode 100644 index 00000000000..ce78b312d06 --- /dev/null +++ b/src/main/java/com/stripe/model/financialconnections/Authorization.java @@ -0,0 +1,248 @@ +// File generated from our OpenAPI spec +package com.stripe.model.financialconnections; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.Account; +import com.stripe.model.Customer; +import com.stripe.model.ExpandableField; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.financialconnections.AuthorizationRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * An Authorization represents the set of credentials used to connect a group of Financial + * Connections Accounts. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Authorization extends ApiResource implements HasId { + /** The account holder that this authorization belongs to. */ + @SerializedName("account_holder") + AccountHolder accountHolder; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * The ID of the Financial Connections Institution this account belongs to. Note that this + * relationship may sometimes change in rare circumstances (e.g. institution mergers). + */ + @SerializedName("institution") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField institution; + + /** The name of the institution that this authorization belongs to. */ + @SerializedName("institution_name") + String institutionName; + + /** + * 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. + * + *

Equal to {@code financial_connections.authorization}. + */ + @SerializedName("object") + String object; + + /** + * The status of the connection to the Authorization. + * + *

One of {@code active}, {@code disconnected}, or {@code inactive}. + */ + @SerializedName("status") + String status; + + @SerializedName("status_details") + StatusDetails statusDetails; + + /** Get ID of expandable {@code institution} object. */ + public String getInstitution() { + return (this.institution != null) ? this.institution.getId() : null; + } + + public void setInstitution(String id) { + this.institution = ApiResource.setExpandableFieldId(id, this.institution); + } + + /** Get expanded {@code institution}. */ + public Institution getInstitutionObject() { + return (this.institution != null) ? this.institution.getExpanded() : null; + } + + public void setInstitutionObject(Institution expandableObject) { + this.institution = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Retrieves the details of an Financial Connections {@code Authorization}. */ + public static Authorization retrieve(String authorization) throws StripeException { + return retrieve(authorization, (Map) null, (RequestOptions) null); + } + + /** Retrieves the details of an Financial Connections {@code Authorization}. */ + public static Authorization retrieve(String authorization, RequestOptions options) + throws StripeException { + return retrieve(authorization, (Map) null, options); + } + + /** Retrieves the details of an Financial Connections {@code Authorization}. */ + public static Authorization retrieve( + String authorization, Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/financial_connections/authorizations/%s", ApiResource.urlEncodeId(authorization)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, Authorization.class); + } + + /** Retrieves the details of an Financial Connections {@code Authorization}. */ + public static Authorization retrieve( + String authorization, AuthorizationRetrieveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/financial_connections/authorizations/%s", ApiResource.urlEncodeId(authorization)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, Authorization.class); + } + + /** + * For more details about AccountHolder, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AccountHolder extends StripeObject { + /** + * The ID of the Stripe account that this account belongs to. Only available when {@code + * account_holder.type} is {@code account}. + */ + @SerializedName("account") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField account; + + /** + * The ID for an Account representing a customer that this account belongs to. Only available + * when {@code account_holder.type} is {@code customer}. + */ + @SerializedName("customer") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField customer; + + @SerializedName("customer_account") + String customerAccount; + + /** + * Type of account holder that this account belongs to. + * + *

One of {@code account}, or {@code customer}. + */ + @SerializedName("type") + String type; + + /** Get ID of expandable {@code account} object. */ + public String getAccount() { + return (this.account != null) ? this.account.getId() : null; + } + + public void setAccount(String id) { + this.account = ApiResource.setExpandableFieldId(id, this.account); + } + + /** Get expanded {@code account}. */ + public Account getAccountObject() { + return (this.account != null) ? this.account.getExpanded() : null; + } + + public void setAccountObject(Account expandableObject) { + this.account = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code customer} object. */ + public String getCustomer() { + return (this.customer != null) ? this.customer.getId() : null; + } + + public void setCustomer(String id) { + this.customer = ApiResource.setExpandableFieldId(id, this.customer); + } + + /** Get expanded {@code customer}. */ + public Customer getCustomerObject() { + return (this.customer != null) ? this.customer.getExpanded() : null; + } + + public void setCustomerObject(Customer expandableObject) { + this.customer = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about StatusDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StatusDetails extends StripeObject { + @SerializedName("inactive") + Inactive inactive; + + /** + * For more details about Inactive, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Inactive extends StripeObject { + /** + * The action (if any) to relink the inactive Authorization. + * + *

One of {@code none}, or {@code relink_required}. + */ + @SerializedName("action") + String action; + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(accountHolder, responseGetter); + trySetResponseGetter(institution, responseGetter); + trySetResponseGetter(statusDetails, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/financialconnections/Session.java b/src/main/java/com/stripe/model/financialconnections/Session.java index 3b7d59116b3..fe3d77110f0 100644 --- a/src/main/java/com/stripe/model/financialconnections/Session.java +++ b/src/main/java/com/stripe/model/financialconnections/Session.java @@ -79,6 +79,12 @@ public class Session extends ApiResource implements HasId { @SerializedName("prefetch") List prefetch; + @SerializedName("relink_options") + RelinkOptions relinkOptions; + + @SerializedName("relink_result") + RelinkResult relinkResult; + /** * For webview integrations only. Upon completing OAuth login in the native browser, the user will * be redirected to this URL to return to your app. @@ -300,6 +306,53 @@ public static class Limits extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class ManualEntry extends StripeObject {} + /** + * For more details about RelinkOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RelinkOptions extends StripeObject { + /** + * Requires the end user to repair this specific account during the authentication flow instead + * of connecting a different one. + */ + @SerializedName("account") + String account; + + /** The authorization to relink in the Session. */ + @SerializedName("authorization") + String authorization; + } + + /** + * For more details about RelinkResult, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RelinkResult extends StripeObject { + /** + * The account relinked in the Session. Only present if {@code relink_options[account]} is set + * and relink is successful. + */ + @SerializedName("account") + String account; + + /** The authorization relinked in the Session. Only present if relink is successful. */ + @SerializedName("authorization") + String authorization; + + /** + * Reason for why relink failed. One of {@code no_authorization}, {@code no_account}, or {@code + * other}. + */ + @SerializedName("failure_reason") + String failureReason; + } + /** * For more details about StatusDetails, please refer to the API Reference. @@ -337,6 +390,8 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(filters, responseGetter); trySetResponseGetter(limits, responseGetter); trySetResponseGetter(manualEntry, responseGetter); + trySetResponseGetter(relinkOptions, responseGetter); + trySetResponseGetter(relinkResult, responseGetter); trySetResponseGetter(statusDetails, responseGetter); } } diff --git a/src/main/java/com/stripe/model/radar/PaymentEvaluation.java b/src/main/java/com/stripe/model/radar/PaymentEvaluation.java new file mode 100644 index 00000000000..87e169804d9 --- /dev/null +++ b/src/main/java/com/stripe/model/radar/PaymentEvaluation.java @@ -0,0 +1,800 @@ +// File generated from our OpenAPI spec +package com.stripe.model.radar; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.ExpandableField; +import com.stripe.model.HasId; +import com.stripe.model.PaymentMethod; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.radar.PaymentEvaluationCreateParams; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * Payment Evaluations represent the risk lifecycle of an externally processed payment. It includes + * the Radar risk score from Stripe, payment outcome taken by the merchant or processor, and any + * post transaction events, such as refunds or disputes. See the Radar API guide for integration steps. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentEvaluation extends ApiResource implements HasId { + /** Client device metadata attached to this payment evaluation. */ + @SerializedName("client_device_metadata_details") + ClientDeviceMetadataDetails clientDeviceMetadataDetails; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created_at") + Long createdAt; + + /** Customer details attached to this payment evaluation. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** + * Event information associated with the payment evaluation, such as refunds, dispute, early fraud + * warnings, or user interventions. + */ + @SerializedName("events") + List events; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** Collection of scores and insights for this payment evaluation. */ + @SerializedName("insights") + Insights insights; + + /** + * 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code radar.payment_evaluation}. + */ + @SerializedName("object") + String object; + + /** Indicates the final outcome for the payment evaluation. */ + @SerializedName("outcome") + Outcome outcome; + + /** Payment details attached to this payment evaluation. */ + @SerializedName("payment_details") + PaymentDetails paymentDetails; + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public static PaymentEvaluation create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public static PaymentEvaluation create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/radar/payment_evaluations"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, PaymentEvaluation.class); + } + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public static PaymentEvaluation create(PaymentEvaluationCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public static PaymentEvaluation create( + PaymentEvaluationCreateParams params, RequestOptions options) throws StripeException { + String path = "/v1/radar/payment_evaluations"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentEvaluation.class); + } + + /** Client device metadata attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ClientDeviceMetadataDetails extends StripeObject { + /** + * ID for the Radar Session associated with the payment evaluation. A Radar Session is a snapshot of the + * browser metadata and device details that help Radar make more accurate predictions on your + * payments. + */ + @SerializedName("radar_session") + String radarSession; + } + + /** Customer details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails extends StripeObject { + /** The ID of the customer associated with the payment evaluation. */ + @SerializedName("customer") + String customer; + + /** The ID of the Account representing the customer associated with the payment evaluation. */ + @SerializedName("customer_account") + String customerAccount; + + /** The customer's email address. */ + @SerializedName("email") + String email; + + /** The customer's full name or business name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + } + + /** Event reported for this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Event extends StripeObject { + /** Dispute opened event details attached to this payment evaluation. */ + @SerializedName("dispute_opened") + DisputeOpened disputeOpened; + + /** Early Fraud Warning Received event details attached to this payment evaluation. */ + @SerializedName("early_fraud_warning_received") + EarlyFraudWarningReceived earlyFraudWarningReceived; + + /** Timestamp when the event occurred. */ + @SerializedName("occurred_at") + Long occurredAt; + + /** Refunded Event details attached to this payment evaluation. */ + @SerializedName("refunded") + Refunded refunded; + + /** + * Indicates the type of event attached to the payment evaluation. + * + *

One of {@code dispute_opened}, {@code early_fraud_warning_received}, {@code refunded}, + * {@code user_intervention_raised}, or {@code user_intervention_resolved}. + */ + @SerializedName("type") + String type; + + /** User intervention raised event details attached to this payment evaluation. */ + @SerializedName("user_intervention_raised") + UserInterventionRaised userInterventionRaised; + + /** User Intervention Resolved Event details attached to this payment evaluation. */ + @SerializedName("user_intervention_resolved") + UserInterventionResolved userInterventionResolved; + + /** Dispute opened event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DisputeOpened extends StripeObject { + /** + * Amount to dispute for this payment. A positive integer representing how much to charge in + * the smallest currency unit + * (for example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal + * currency). + */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * Reason given by cardholder for dispute. + * + *

One of {@code account_not_available}, {@code credit_not_processed}, {@code + * customer_initiated}, {@code duplicate}, {@code fraudulent}, {@code general}, {@code + * noncompliant}, {@code product_not_received}, {@code product_unacceptable}, {@code + * subscription_canceled}, or {@code unrecognized}. + */ + @SerializedName("reason") + String reason; + } + + /** Early Fraud Warning Received event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EarlyFraudWarningReceived extends StripeObject { + /** + * The type of fraud labeled by the issuer. + * + *

One of {@code made_with_lost_card}, {@code made_with_stolen_card}, {@code other}, or + * {@code unauthorized_use_of_card}. + */ + @SerializedName("fraud_type") + String fraudType; + } + + /** Refunded Event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Refunded extends StripeObject { + /** + * Amount refunded for this payment. A positive integer representing how much to charge in the smallest currency unit (for + * example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). + */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * Indicates the reason for the refund. + * + *

One of {@code duplicate}, {@code fraudulent}, {@code other}, or {@code + * requested_by_customer}. + */ + @SerializedName("reason") + String reason; + } + + /** User intervention raised event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UserInterventionRaised extends StripeObject { + /** User intervention raised custom event details attached to this payment evaluation. */ + @SerializedName("custom") + Custom custom; + + /** Unique identifier for the user intervention event. */ + @SerializedName("key") + String key; + + /** + * Type of user intervention raised. + * + *

One of {@code 3ds}, {@code captcha}, or {@code custom}. + */ + @SerializedName("type") + String type; + + /** User intervention raised custom event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Custom extends StripeObject { + /** + * Custom type of user intervention raised. The string must use a snake case description for + * the type of intervention performed. + */ + @SerializedName("type") + String type; + } + } + + /** User Intervention Resolved Event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UserInterventionResolved extends StripeObject { + /** Unique ID of this intervention. Use this to provide the result. */ + @SerializedName("key") + String key; + + /** + * Result of the intervention if it has been completed. + * + *

One of {@code abandoned}, {@code failed}, or {@code passed}. + */ + @SerializedName("outcome") + String outcome; + } + } + + /** Collection of scores and insights for this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Insights extends StripeObject { + /** Stripe Radar's evaluation of the likelihood of a card issuer decline on this payment. */ + @SerializedName("card_issuer_decline") + CardIssuerDecline cardIssuerDecline; + + /** The timestamp when the evaluation was performed. */ + @SerializedName("evaluated_at") + Long evaluatedAt; + + /** Scores, insights and recommended action for one scorer for this PaymentEvaluation. */ + @SerializedName("fraudulent_dispute") + FraudulentDispute fraudulentDispute; + + /** + * Provides Stripe Radar's evaluation of the likelihood that a payment will be declined by the + * card issuer. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CardIssuerDecline extends StripeObject { + /** + * Stripe Radar's evaluation of the likelihood that the payment will be declined by the card + * issuer. Scores range from 0 to 100, with higher values indicating a higher likelihood of + * decline. + */ + @SerializedName("model_score") + BigDecimal modelScore; + + /** + * Recommended action based on the model score. Possible values are {@code block} and {@code + * continue}. + * + *

One of {@code block}, or {@code continue}. + */ + @SerializedName("recommended_action") + String recommendedAction; + } + + /** Scores, insights and recommended action for one scorer for this PaymentEvaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FraudulentDispute extends StripeObject { + /** + * Recommended action based on the risk score. Possible values are {@code block} and {@code + * continue}. + * + *

One of {@code block}, or {@code continue}. + */ + @SerializedName("recommended_action") + String recommendedAction; + + /** + * Stripe Radar’s evaluation of the risk level of the payment. Possible values for evaluated + * payments are between 0 and 100, with higher scores indicating higher risk. + */ + @SerializedName("risk_score") + Long riskScore; + } + } + + /** Outcome details for this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Outcome extends StripeObject { + /** Details of a merchant_blocked outcome attached to this payment evaluation. */ + @SerializedName("merchant_blocked") + MerchantBlocked merchantBlocked; + + /** The PaymentIntent ID associated with the payment evaluation. */ + @SerializedName("payment_intent_id") + String paymentIntentId; + + /** Details of an rejected outcome attached to this payment evaluation. */ + @SerializedName("rejected") + Rejected rejected; + + /** Details of a succeeded outcome attached to this payment evaluation. */ + @SerializedName("succeeded") + Succeeded succeeded; + + /** + * Indicates the outcome of the payment evaluation. + * + *

One of {@code failed}, {@code merchant_blocked}, {@code rejected}, or {@code succeeded}. + */ + @SerializedName("type") + String type; + + /** Details of a merchant_blocked outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MerchantBlocked extends StripeObject { + /** + * The reason the payment was blocked by the merchant. + * + *

One of {@code authentication_required}, {@code blocked_for_fraud}, {@code + * invalid_payment}, or {@code other}. + */ + @SerializedName("reason") + String reason; + } + + /** Details of an rejected outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Rejected extends StripeObject { + /** Details of an rejected card outcome attached to this payment evaluation. */ + @SerializedName("card") + Card card; + + /** Details of an rejected card outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Result of the address line 1 check. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("address_line1_check") + String addressLine1Check; + + /** + * Indicates whether the cardholder provided a postal code and if it matched the + * cardholder’s billing address. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("address_postal_code_check") + String addressPostalCodeCheck; + + /** + * Result of the CVC check. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("cvc_check") + String cvcCheck; + + /** + * Card issuer's reason for the network decline. + * + *

One of {@code authentication_failed}, {@code do_not_honor}, {@code expired}, {@code + * incorrect_cvc}, {@code incorrect_number}, {@code incorrect_postal_code}, {@code + * insufficient_funds}, {@code invalid_account}, {@code lost_card}, {@code other}, {@code + * processing_error}, {@code reported_stolen}, or {@code try_again_later}. + */ + @SerializedName("reason") + String reason; + } + } + + /** Details of a succeeded outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Succeeded extends StripeObject { + /** Details of an succeeded card outcome attached to this payment evaluation. */ + @SerializedName("card") + Card card; + + /** Details of an succeeded card outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Result of the address line 1 check. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("address_line1_check") + String addressLine1Check; + + /** + * Indicates whether the cardholder provided a postal code and if it matched the + * cardholder’s billing address. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("address_postal_code_check") + String addressPostalCodeCheck; + + /** + * Result of the CVC check. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("cvc_check") + String cvcCheck; + } + } + } + + /** Payment details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails extends StripeObject { + /** + * Amount intended to be collected by this payment. A positive integer representing how much to + * charge in the smallest currency + * unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + * The minimum amount is $0.50 US or equivalent in + * charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 + * for a USD charge of $999,999.99). + */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String description; + + /** Details about the payment's customer presence and type. */ + @SerializedName("money_movement_details") + MoneyMovementDetails moneyMovementDetails; + + /** Details about the payment method used for the payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** Shipping details for the payment evaluation. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + /** Payment statement descriptor. */ + @SerializedName("statement_descriptor") + String statementDescriptor; + + /** Money Movement details attached to this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MoneyMovementDetails extends StripeObject { + /** Describes card money movement details for the payment evaluation. */ + @SerializedName("card") + Card card; + + /** + * Describes the type of money movement. Currently only {@code card} is supported. + * + *

Equal to {@code card}. + */ + @SerializedName("money_movement_type") + String moneyMovementType; + + /** Money Movement card details attached to this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Describes the presence of the customer during the payment. + * + *

One of {@code off_session}, or {@code on_session}. + */ + @SerializedName("customer_presence") + String customerPresence; + + /** + * Describes the type of payment. + * + *

One of {@code one_off}, {@code recurring}, {@code setup_one_off}, or {@code + * setup_recurring}. + */ + @SerializedName("payment_type") + String paymentType; + } + } + + /** Payment method details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodDetails extends StripeObject { + /** Billing information associated with the payment evaluation. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** The payment method used in this payment evaluation. */ + @SerializedName("payment_method") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentMethod; + + /** Get ID of expandable {@code paymentMethod} object. */ + public String getPaymentMethod() { + return (this.paymentMethod != null) ? this.paymentMethod.getId() : null; + } + + public void setPaymentMethod(String id) { + this.paymentMethod = ApiResource.setExpandableFieldId(id, this.paymentMethod); + } + + /** Get expanded {@code paymentMethod}. */ + public PaymentMethod getPaymentMethodObject() { + return (this.paymentMethod != null) ? this.paymentMethod.getExpanded() : null; + } + + public void setPaymentMethodObject(PaymentMethod expandableObject) { + this.paymentMethod = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Billing details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails extends StripeObject { + /** Address data. */ + @SerializedName("address") + Address address; + + /** Email address. */ + @SerializedName("email") + String email; + + /** Full name. */ + @SerializedName("name") + String name; + + /** Billing phone number (including extension). */ + @SerializedName("phone") + String phone; + + /** Address data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO 3166-2). + */ + @SerializedName("state") + String state; + } + } + } + + /** Shipping details attached to this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails extends StripeObject { + /** Address data. */ + @SerializedName("address") + Address address; + + /** Shipping name. */ + @SerializedName("name") + String name; + + /** Shipping phone number. */ + @SerializedName("phone") + String phone; + + /** Address data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO 3166-2). + */ + @SerializedName("state") + String state; + } + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(clientDeviceMetadataDetails, responseGetter); + trySetResponseGetter(customerDetails, responseGetter); + trySetResponseGetter(insights, responseGetter); + trySetResponseGetter(outcome, responseGetter); + trySetResponseGetter(paymentDetails, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/reserve/Hold.java b/src/main/java/com/stripe/model/reserve/Hold.java new file mode 100644 index 00000000000..f7f3ae9319d --- /dev/null +++ b/src/main/java/com/stripe/model/reserve/Hold.java @@ -0,0 +1,267 @@ +// File generated from our OpenAPI spec +package com.stripe.model.reserve; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.Charge; +import com.stripe.model.ExpandableField; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.reserve.HoldListParams; +import com.stripe.param.reserve.HoldRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** ReserveHolds are used to place a temporary ReserveHold on a merchant's funds. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Hold extends ApiResource implements HasId { + /** + * Amount reserved. A positive integer representing how much is reserved in the smallest currency unit. + */ + @SerializedName("amount") + Long amount; + + /** Amount in cents that can be released from this ReserveHold. */ + @SerializedName("amount_releasable") + Long amountReleasable; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** + * Indicates which party created this ReserveHold. + * + *

One of {@code application}, or {@code stripe}. + */ + @SerializedName("created_by") + String createdBy; + + /** + * Three-letter ISO currency code, + * in lowercase. Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Whether there are any funds available to release on this ReserveHold. Note that if the + * ReserveHold is in the process of being released, this could be false, even though the funds + * haven't been fully released yet. + */ + @SerializedName("is_releasable") + Boolean isReleasable; + + /** + * 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code reserve.hold}. + */ + @SerializedName("object") + String object; + + /** + * The reason for the ReserveHold. + * + *

One of {@code charge}, or {@code standalone}. + */ + @SerializedName("reason") + String reason; + + @SerializedName("release_schedule") + ReleaseSchedule releaseSchedule; + + /** The ReservePlan which produced this ReserveHold (i.e., resplan_123). */ + @SerializedName("reserve_plan") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField reservePlan; + + /** The Charge which funded this ReserveHold (e.g., ch_123). */ + @SerializedName("source_charge") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField sourceCharge; + + /** + * Which source balance type this ReserveHold reserves funds from. One of {@code bank_account}, + * {@code card}, or {@code fpx}. + */ + @SerializedName("source_type") + String sourceType; + + /** Get ID of expandable {@code reservePlan} object. */ + public String getReservePlan() { + return (this.reservePlan != null) ? this.reservePlan.getId() : null; + } + + public void setReservePlan(String id) { + this.reservePlan = ApiResource.setExpandableFieldId(id, this.reservePlan); + } + + /** Get expanded {@code reservePlan}. */ + public Plan getReservePlanObject() { + return (this.reservePlan != null) ? this.reservePlan.getExpanded() : null; + } + + public void setReservePlanObject(Plan expandableObject) { + this.reservePlan = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code sourceCharge} object. */ + public String getSourceCharge() { + return (this.sourceCharge != null) ? this.sourceCharge.getId() : null; + } + + public void setSourceCharge(String id) { + this.sourceCharge = ApiResource.setExpandableFieldId(id, this.sourceCharge); + } + + /** Get expanded {@code sourceCharge}. */ + public Charge getSourceChargeObject() { + return (this.sourceCharge != null) ? this.sourceCharge.getExpanded() : null; + } + + public void setSourceChargeObject(Charge expandableObject) { + this.sourceCharge = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** + * Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted + * order, with the most recent ReserveHolds appearing first. + */ + public static HoldCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted + * order, with the most recent ReserveHolds appearing first. + */ + public static HoldCollection list(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/reserve/holds"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, HoldCollection.class); + } + + /** + * Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted + * order, with the most recent ReserveHolds appearing first. + */ + public static HoldCollection list(HoldListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted + * order, with the most recent ReserveHolds appearing first. + */ + public static HoldCollection list(HoldListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/reserve/holds"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, HoldCollection.class); + } + + /** Retrieve a ReserveHold. */ + public static Hold retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** Retrieve a ReserveHold. */ + public static Hold retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieve a ReserveHold. */ + public static Hold retrieve(String id, Map params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/holds/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, Hold.class); + } + + /** Retrieve a ReserveHold. */ + public static Hold retrieve(String id, HoldRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/holds/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, Hold.class); + } + + /** + * For more details about ReleaseSchedule, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ReleaseSchedule extends StripeObject { + /** The time after which the ReserveHold is requested to be released. */ + @SerializedName("release_after") + Long releaseAfter; + + /** + * The time at which the ReserveHold is scheduled to be released, automatically set to midnight + * UTC of the day after {@code release_after}. + */ + @SerializedName("scheduled_release") + Long scheduledRelease; + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(releaseSchedule, responseGetter); + trySetResponseGetter(reservePlan, responseGetter); + trySetResponseGetter(sourceCharge, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/reserve/HoldCollection.java b/src/main/java/com/stripe/model/reserve/HoldCollection.java new file mode 100644 index 00000000000..b9af14c5b4e --- /dev/null +++ b/src/main/java/com/stripe/model/reserve/HoldCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.reserve; + +import com.stripe.model.StripeCollection; + +public class HoldCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/reserve/Plan.java b/src/main/java/com/stripe/model/reserve/Plan.java new file mode 100644 index 00000000000..a30279352b3 --- /dev/null +++ b/src/main/java/com/stripe/model/reserve/Plan.java @@ -0,0 +1,185 @@ +// File generated from our OpenAPI spec +package com.stripe.model.reserve; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.reserve.PlanRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * ReservePlans are used to automatically place holds on a merchant's funds until the plan expires. + * It takes a portion of each incoming Charge (including those resulting from a Transfer from a + * platform account). + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Plan extends ApiResource implements HasId { + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** + * Indicates which party created this ReservePlan. + * + *

One of {@code application}, or {@code stripe}. + */ + @SerializedName("created_by") + String createdBy; + + /** + * Three-letter ISO currency code, + * in lowercase. Must be a supported currency. An + * unset currency indicates that the plan applies to all currencies. + */ + @SerializedName("currency") + String currency; + + /** Time at which the ReservePlan was disabled. */ + @SerializedName("disabled_at") + Long disabledAt; + + @SerializedName("fixed_release") + FixedRelease fixedRelease; + + /** Unique identifier for the 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code reserve.plan}. + */ + @SerializedName("object") + String object; + + /** The percent of each Charge to reserve. */ + @SerializedName("percent") + Long percent; + + @SerializedName("rolling_release") + RollingRelease rollingRelease; + + /** + * The current status of the ReservePlan. The ReservePlan only affects charges if it is {@code + * active}. + * + *

One of {@code active}, {@code disabled}, or {@code expired}. + */ + @SerializedName("status") + String status; + + /** + * The type of the ReservePlan. + * + *

One of {@code fixed_release}, or {@code rolling_release}. + */ + @SerializedName("type") + String type; + + /** Retrieve a ReservePlan. */ + public static Plan retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** Retrieve a ReservePlan. */ + public static Plan retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieve a ReservePlan. */ + public static Plan retrieve(String id, Map params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/plans/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, Plan.class); + } + + /** Retrieve a ReservePlan. */ + public static Plan retrieve(String id, PlanRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/plans/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, Plan.class); + } + + /** + * For more details about FixedRelease, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FixedRelease extends StripeObject { + /** The time after which all reserved funds are requested for release. */ + @SerializedName("release_after") + Long releaseAfter; + + /** + * The time at which reserved funds are scheduled for release, automatically set to midnight UTC + * of the day after {@code release_after}. + */ + @SerializedName("scheduled_release") + Long scheduledRelease; + } + + /** + * For more details about RollingRelease, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RollingRelease extends StripeObject { + /** The number of days to reserve funds before releasing. */ + @SerializedName("days_after_charge") + Long daysAfterCharge; + + /** The time at which the ReservePlan expires. */ + @SerializedName("expires_on") + Long expiresOn; + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(fixedRelease, responseGetter); + trySetResponseGetter(rollingRelease, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/reserve/Release.java b/src/main/java/com/stripe/model/reserve/Release.java new file mode 100644 index 00000000000..ae0b2b83fc2 --- /dev/null +++ b/src/main/java/com/stripe/model/reserve/Release.java @@ -0,0 +1,303 @@ +// File generated from our OpenAPI spec +package com.stripe.model.reserve; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.Dispute; +import com.stripe.model.ExpandableField; +import com.stripe.model.HasId; +import com.stripe.model.Refund; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.reserve.ReleaseListParams; +import com.stripe.param.reserve.ReleaseRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** ReserveReleases represent the release of funds from a ReserveHold. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class Release extends ApiResource implements HasId { + /** + * Amount released. A positive integer representing how much is released in the smallest currency unit. + */ + @SerializedName("amount") + Long amount; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** + * Indicates which party created this ReserveRelease. + * + *

One of {@code application}, or {@code stripe}. + */ + @SerializedName("created_by") + String createdBy; + + /** + * Three-letter ISO currency code, + * in lowercase. Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** Unique identifier for the 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code reserve.release}. + */ + @SerializedName("object") + String object; + + /** + * The reason for the ReserveRelease, indicating why the funds were released. + * + *

One of {@code bulk_hold_expiry}, {@code hold_released_early}, {@code hold_reversed}, or + * {@code plan_disabled}. + */ + @SerializedName("reason") + String reason; + + /** The release timestamp of the funds. */ + @SerializedName("released_at") + Long releasedAt; + + /** The ReserveHold this ReserveRelease is associated with. */ + @SerializedName("reserve_hold") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField reserveHold; + + /** + * The ReservePlan ID this ReserveRelease is associated with. This field is only populated if a + * ReserveRelease is created by a ReservePlan disable operation, or from a scheduled ReservedHold + * expiry. + */ + @SerializedName("reserve_plan") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField reservePlan; + + @SerializedName("source_transaction") + SourceTransaction sourceTransaction; + + /** Get ID of expandable {@code reserveHold} object. */ + public String getReserveHold() { + return (this.reserveHold != null) ? this.reserveHold.getId() : null; + } + + public void setReserveHold(String id) { + this.reserveHold = ApiResource.setExpandableFieldId(id, this.reserveHold); + } + + /** Get expanded {@code reserveHold}. */ + public Hold getReserveHoldObject() { + return (this.reserveHold != null) ? this.reserveHold.getExpanded() : null; + } + + public void setReserveHoldObject(Hold expandableObject) { + this.reserveHold = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code reservePlan} object. */ + public String getReservePlan() { + return (this.reservePlan != null) ? this.reservePlan.getId() : null; + } + + public void setReservePlan(String id) { + this.reservePlan = ApiResource.setExpandableFieldId(id, this.reservePlan); + } + + /** Get expanded {@code reservePlan}. */ + public Plan getReservePlanObject() { + return (this.reservePlan != null) ? this.reservePlan.getExpanded() : null; + } + + public void setReservePlanObject(Plan expandableObject) { + this.reservePlan = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** + * Returns a list of ReserveReleases previously created. The ReserveReleases are returned in + * sorted order, with the most recent ReserveReleases appearing first. + */ + public static ReleaseCollection list(Map params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of ReserveReleases previously created. The ReserveReleases are returned in + * sorted order, with the most recent ReserveReleases appearing first. + */ + public static ReleaseCollection list(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/reserve/releases"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, ReleaseCollection.class); + } + + /** + * Returns a list of ReserveReleases previously created. The ReserveReleases are returned in + * sorted order, with the most recent ReserveReleases appearing first. + */ + public static ReleaseCollection list(ReleaseListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of ReserveReleases previously created. The ReserveReleases are returned in + * sorted order, with the most recent ReserveReleases appearing first. + */ + public static ReleaseCollection list(ReleaseListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/reserve/releases"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, ReleaseCollection.class); + } + + /** Retrieve a ReserveRelease. */ + public static Release retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** Retrieve a ReserveRelease. */ + public static Release retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieve a ReserveRelease. */ + public static Release retrieve(String id, Map params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/releases/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, Release.class); + } + + /** Retrieve a ReserveRelease. */ + public static Release retrieve(String id, ReleaseRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/releases/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, Release.class); + } + + /** + * For more details about SourceTransaction, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SourceTransaction extends StripeObject { + /** The ID of the dispute. */ + @SerializedName("dispute") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField dispute; + + /** The ID of the refund. */ + @SerializedName("refund") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField refund; + + /** + * The type of source transaction. + * + *

One of {@code dispute}, or {@code refund}. + */ + @SerializedName("type") + String type; + + /** Get ID of expandable {@code dispute} object. */ + public String getDispute() { + return (this.dispute != null) ? this.dispute.getId() : null; + } + + public void setDispute(String id) { + this.dispute = ApiResource.setExpandableFieldId(id, this.dispute); + } + + /** Get expanded {@code dispute}. */ + public Dispute getDisputeObject() { + return (this.dispute != null) ? this.dispute.getExpanded() : null; + } + + public void setDisputeObject(Dispute expandableObject) { + this.dispute = new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code refund} object. */ + public String getRefund() { + return (this.refund != null) ? this.refund.getId() : null; + } + + public void setRefund(String id) { + this.refund = ApiResource.setExpandableFieldId(id, this.refund); + } + + /** Get expanded {@code refund}. */ + public Refund getRefundObject() { + return (this.refund != null) ? this.refund.getExpanded() : null; + } + + public void setRefundObject(Refund expandableObject) { + this.refund = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(reserveHold, responseGetter); + trySetResponseGetter(reservePlan, responseGetter); + trySetResponseGetter(sourceTransaction, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/reserve/ReleaseCollection.java b/src/main/java/com/stripe/model/reserve/ReleaseCollection.java new file mode 100644 index 00000000000..de7d05a019b --- /dev/null +++ b/src/main/java/com/stripe/model/reserve/ReleaseCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.reserve; + +import com.stripe.model.StripeCollection; + +public class ReleaseCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/tax/Calculation.java b/src/main/java/com/stripe/model/tax/Calculation.java index bcf98d9be3b..7a8face6bce 100644 --- a/src/main/java/com/stripe/model/tax/Calculation.java +++ b/src/main/java/com/stripe/model/tax/Calculation.java @@ -326,20 +326,20 @@ public static class TaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code - * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code - * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, - * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code - * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, - * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code - * ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, - * {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code - * md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, - * {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code - * gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, - * {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code - * az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, - * {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. + * pl_nip}, {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, + * {@code li_uid}, {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code + * ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, + * {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code + * id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, + * {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code + * eg_tin}, {@code ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, + * {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code + * uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, + * {@code bb_tin}, {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code + * ba_tin}, {@code gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, + * {@code np_pan}, {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code + * aw_tin}, {@code az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, + * {@code la_tin}, {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/tax/Transaction.java b/src/main/java/com/stripe/model/tax/Transaction.java index 99f048a1a82..4cf46630144 100644 --- a/src/main/java/com/stripe/model/tax/Transaction.java +++ b/src/main/java/com/stripe/model/tax/Transaction.java @@ -371,20 +371,20 @@ public static class TaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code - * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code - * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, - * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code - * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, - * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code - * ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, - * {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code - * md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, - * {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code - * gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, - * {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code - * az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, - * {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. + * pl_nip}, {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, + * {@code li_uid}, {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code + * ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, + * {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code + * id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, + * {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code + * eg_tin}, {@code ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, + * {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code + * uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, + * {@code bb_tin}, {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code + * ba_tin}, {@code gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, + * {@code np_pan}, {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code + * aw_tin}, {@code az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, + * {@code la_tin}, {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index c01718d5c1e..a9a4d773780 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -423,9 +423,6 @@ public static class Tipping extends StripeObject { @SerializedName("aud") Aud aud; - @SerializedName("bgn") - Bgn bgn; - @SerializedName("cad") Cad cad; @@ -531,30 +528,6 @@ public static class Aud extends StripeObject { Long smartTipThreshold; } - /** - * For more details about Bgn, please refer to the API - * Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Bgn extends StripeObject { - /** Fixed amounts displayed when collecting a tip. */ - @SerializedName("fixed_amounts") - List fixedAmounts; - - /** Percentages displayed when collecting a tip. */ - @SerializedName("percentages") - List percentages; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - @SerializedName("smart_tip_threshold") - Long smartTipThreshold; - } - /** * For more details about Cad, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java index f8b78696221..b603e094ec0 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java @@ -376,6 +376,13 @@ public static class LinkedFlows extends StripeObject { /** The ReceivedCredit that Capital withheld from. */ @SerializedName("received_credit_capital_withholding") String receivedCreditCapitalWithholding; + + /** + * Set if the ReceivedDebit was created due to a Topup object. + */ + @SerializedName("topup") + String topup; } /** diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index 39ec32e30cb..5ddf1f67ebb 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -11788,6 +11788,7 @@ public static class ProofOfRegistration { @SerializedName("files") List files; + /** Information regarding the person signing the document if applicable. */ @SerializedName("signer") Signer signer; @@ -11869,6 +11870,7 @@ public Builder addAllFile(List elements) { return this; } + /** Information regarding the person signing the document if applicable. */ public Builder setSigner(AccountCreateParams.Documents.ProofOfRegistration.Signer signer) { this.signer = signer; return this; @@ -11968,6 +11970,7 @@ public static class ProofOfUltimateBeneficialOwnership { @SerializedName("files") List files; + /** Information regarding the person signing the document if applicable. */ @SerializedName("signer") Signer signer; @@ -12053,6 +12056,7 @@ public Builder addAllFile(List elements) { return this; } + /** Information regarding the person signing the document if applicable. */ public Builder setSigner( AccountCreateParams.Documents.ProofOfUltimateBeneficialOwnership.Signer signer) { this.signer = signer; @@ -16381,6 +16385,10 @@ public enum WeeklyPayoutDay implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class PaypayPayments { + /** Additional files that are required to support the onboarding process of your business. */ + @SerializedName("additional_files") + List additionalFiles; + /** * 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. @@ -16394,9 +16402,19 @@ public static class PaypayPayments { @SerializedName("goods_type") GoodsType goodsType; - private PaypayPayments(Map extraParams, GoodsType goodsType) { + /** Details regarding your business's website. */ + @SerializedName("site") + Site site; + + private PaypayPayments( + List additionalFiles, + Map extraParams, + GoodsType goodsType, + Site site) { + this.additionalFiles = additionalFiles; this.extraParams = extraParams; this.goodsType = goodsType; + this.site = site; } public static Builder builder() { @@ -16404,13 +16422,46 @@ public static Builder builder() { } public static class Builder { + private List additionalFiles; + private Map extraParams; private GoodsType goodsType; + private Site site; + /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Settings.PaypayPayments build() { - return new AccountCreateParams.Settings.PaypayPayments(this.extraParams, this.goodsType); + return new AccountCreateParams.Settings.PaypayPayments( + this.additionalFiles, this.extraParams, this.goodsType, this.site); + } + + /** + * Add an element to `additionalFiles` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountCreateParams.Settings.PaypayPayments#additionalFiles} for the field + * documentation. + */ + public Builder addAdditionalFile(String element) { + if (this.additionalFiles == null) { + this.additionalFiles = new ArrayList<>(); + } + this.additionalFiles.add(element); + return this; + } + + /** + * Add all elements to `additionalFiles` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountCreateParams.Settings.PaypayPayments#additionalFiles} for the field + * documentation. + */ + public Builder addAllAdditionalFile(List elements) { + if (this.additionalFiles == null) { + this.additionalFiles = new ArrayList<>(); + } + this.additionalFiles.addAll(elements); + return this; } /** @@ -16447,6 +16498,375 @@ public Builder setGoodsType( this.goodsType = goodsType; return this; } + + /** Details regarding your business's website. */ + public Builder setSite(AccountCreateParams.Settings.PaypayPayments.Site site) { + this.site = site; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Site { + /** Additional information about your business's website. */ + @SerializedName("accessible") + Accessible accessible; + + /** + * 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; + + /** Additional information about your business's website. */ + @SerializedName("in_development") + InDevelopment inDevelopment; + + /** Additional information about your business's website. */ + @SerializedName("restricted") + Restricted restricted; + + /** The status of your business's website. */ + @SerializedName("type") + Type type; + + private Site( + Accessible accessible, + Map extraParams, + InDevelopment inDevelopment, + Restricted restricted, + Type type) { + this.accessible = accessible; + this.extraParams = extraParams; + this.inDevelopment = inDevelopment; + this.restricted = restricted; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Accessible accessible; + + private Map extraParams; + + private InDevelopment inDevelopment; + + private Restricted restricted; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Settings.PaypayPayments.Site build() { + return new AccountCreateParams.Settings.PaypayPayments.Site( + this.accessible, this.extraParams, this.inDevelopment, this.restricted, this.type); + } + + /** Additional information about your business's website. */ + public Builder setAccessible( + AccountCreateParams.Settings.PaypayPayments.Site.Accessible accessible) { + this.accessible = accessible; + 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.Settings.PaypayPayments.Site#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.Settings.PaypayPayments.Site#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Additional information about your business's website. */ + public Builder setInDevelopment( + AccountCreateParams.Settings.PaypayPayments.Site.InDevelopment inDevelopment) { + this.inDevelopment = inDevelopment; + return this; + } + + /** Additional information about your business's website. */ + public Builder setRestricted( + AccountCreateParams.Settings.PaypayPayments.Site.Restricted restricted) { + this.restricted = restricted; + return this; + } + + /** The status of your business's website. */ + public Builder setType(AccountCreateParams.Settings.PaypayPayments.Site.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Accessible { + /** + * 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 Accessible(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Settings.PaypayPayments.Site.Accessible build() { + return new AccountCreateParams.Settings.PaypayPayments.Site.Accessible( + this.extraParams); + } + + /** + * 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.Settings.PaypayPayments.Site.Accessible#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.Settings.PaypayPayments.Site.Accessible#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 InDevelopment { + /** + * 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 password needed to access your business's website. */ + @SerializedName("password") + String password; + + /** The username needed to access your business's website. */ + @SerializedName("username") + String username; + + private InDevelopment(Map extraParams, String password, String username) { + this.extraParams = extraParams; + this.password = password; + this.username = username; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String password; + + private String username; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Settings.PaypayPayments.Site.InDevelopment build() { + return new AccountCreateParams.Settings.PaypayPayments.Site.InDevelopment( + this.extraParams, this.password, this.username); + } + + /** + * 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.Settings.PaypayPayments.Site.InDevelopment#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.Settings.PaypayPayments.Site.InDevelopment#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 password needed to access your business's website. */ + public Builder setPassword(String password) { + this.password = password; + return this; + } + + /** The username needed to access your business's website. */ + public Builder setUsername(String username) { + this.username = username; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Restricted { + /** + * 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 file explaining the payment flow for your business. */ + @SerializedName("payment_flow_file") + String paymentFlowFile; + + private Restricted(Map extraParams, String paymentFlowFile) { + this.extraParams = extraParams; + this.paymentFlowFile = paymentFlowFile; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String paymentFlowFile; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Settings.PaypayPayments.Site.Restricted build() { + return new AccountCreateParams.Settings.PaypayPayments.Site.Restricted( + this.extraParams, this.paymentFlowFile); + } + + /** + * 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.Settings.PaypayPayments.Site.Restricted#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.Settings.PaypayPayments.Site.Restricted#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 file explaining the payment flow for your business. */ + public Builder setPaymentFlowFile(String paymentFlowFile) { + this.paymentFlowFile = paymentFlowFile; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("accessible") + ACCESSIBLE("accessible"), + + @SerializedName("in_development") + IN_DEVELOPMENT("in_development"), + + @SerializedName("restricted") + RESTRICTED("restricted"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } } public enum GoodsType implements ApiRequestParams.EnumParam { diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index 32e918b94bd..642876a8de2 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -1876,11 +1876,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -1998,11 +1994,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ public Builder setInstantPayouts(Boolean instantPayouts) { this.instantPayouts = instantPayouts; return this; @@ -3810,11 +3802,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -3906,11 +3894,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ public Builder setInstantPayouts(Boolean instantPayouts) { this.instantPayouts = instantPayouts; return this; @@ -5652,11 +5636,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -5774,11 +5754,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ public Builder setInstantPayouts(Boolean instantPayouts) { this.instantPayouts = instantPayouts; return this; diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index 2c4d5b90728..ea85e995a4d 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -11487,6 +11487,7 @@ public static class ProofOfRegistration { @SerializedName("files") List files; + /** Information regarding the person signing the document if applicable. */ @SerializedName("signer") Signer signer; @@ -11568,6 +11569,7 @@ public Builder addAllFile(List elements) { return this; } + /** Information regarding the person signing the document if applicable. */ public Builder setSigner(AccountUpdateParams.Documents.ProofOfRegistration.Signer signer) { this.signer = signer; return this; @@ -11673,6 +11675,7 @@ public static class ProofOfUltimateBeneficialOwnership { @SerializedName("files") List files; + /** Information regarding the person signing the document if applicable. */ @SerializedName("signer") Signer signer; @@ -11758,6 +11761,7 @@ public Builder addAllFile(List elements) { return this; } + /** Information regarding the person signing the document if applicable. */ public Builder setSigner( AccountUpdateParams.Documents.ProofOfUltimateBeneficialOwnership.Signer signer) { this.signer = signer; @@ -16610,6 +16614,10 @@ public enum WeeklyPayoutDay implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class PaypayPayments { + /** Additional files that are required to support the onboarding process of your business. */ + @SerializedName("additional_files") + List additionalFiles; + /** * 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. @@ -16623,9 +16631,19 @@ public static class PaypayPayments { @SerializedName("goods_type") GoodsType goodsType; - private PaypayPayments(Map extraParams, GoodsType goodsType) { + /** Details regarding your business's website. */ + @SerializedName("site") + Site site; + + private PaypayPayments( + List additionalFiles, + Map extraParams, + GoodsType goodsType, + Site site) { + this.additionalFiles = additionalFiles; this.extraParams = extraParams; this.goodsType = goodsType; + this.site = site; } public static Builder builder() { @@ -16633,13 +16651,46 @@ public static Builder builder() { } public static class Builder { + private List additionalFiles; + private Map extraParams; private GoodsType goodsType; + private Site site; + /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Settings.PaypayPayments build() { - return new AccountUpdateParams.Settings.PaypayPayments(this.extraParams, this.goodsType); + return new AccountUpdateParams.Settings.PaypayPayments( + this.additionalFiles, this.extraParams, this.goodsType, this.site); + } + + /** + * Add an element to `additionalFiles` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountUpdateParams.Settings.PaypayPayments#additionalFiles} for the field + * documentation. + */ + public Builder addAdditionalFile(String element) { + if (this.additionalFiles == null) { + this.additionalFiles = new ArrayList<>(); + } + this.additionalFiles.add(element); + return this; + } + + /** + * Add all elements to `additionalFiles` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountUpdateParams.Settings.PaypayPayments#additionalFiles} for the field + * documentation. + */ + public Builder addAllAdditionalFile(List elements) { + if (this.additionalFiles == null) { + this.additionalFiles = new ArrayList<>(); + } + this.additionalFiles.addAll(elements); + return this; } /** @@ -16676,6 +16727,393 @@ public Builder setGoodsType( this.goodsType = goodsType; return this; } + + /** Details regarding your business's website. */ + public Builder setSite(AccountUpdateParams.Settings.PaypayPayments.Site site) { + this.site = site; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Site { + /** Additional information about your business's website. */ + @SerializedName("accessible") + Accessible accessible; + + /** + * 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; + + /** Additional information about your business's website. */ + @SerializedName("in_development") + InDevelopment inDevelopment; + + /** Additional information about your business's website. */ + @SerializedName("restricted") + Restricted restricted; + + /** The status of your business's website. */ + @SerializedName("type") + Type type; + + private Site( + Accessible accessible, + Map extraParams, + InDevelopment inDevelopment, + Restricted restricted, + Type type) { + this.accessible = accessible; + this.extraParams = extraParams; + this.inDevelopment = inDevelopment; + this.restricted = restricted; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Accessible accessible; + + private Map extraParams; + + private InDevelopment inDevelopment; + + private Restricted restricted; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Settings.PaypayPayments.Site build() { + return new AccountUpdateParams.Settings.PaypayPayments.Site( + this.accessible, this.extraParams, this.inDevelopment, this.restricted, this.type); + } + + /** Additional information about your business's website. */ + public Builder setAccessible( + AccountUpdateParams.Settings.PaypayPayments.Site.Accessible accessible) { + this.accessible = accessible; + 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.Settings.PaypayPayments.Site#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.Settings.PaypayPayments.Site#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Additional information about your business's website. */ + public Builder setInDevelopment( + AccountUpdateParams.Settings.PaypayPayments.Site.InDevelopment inDevelopment) { + this.inDevelopment = inDevelopment; + return this; + } + + /** Additional information about your business's website. */ + public Builder setRestricted( + AccountUpdateParams.Settings.PaypayPayments.Site.Restricted restricted) { + this.restricted = restricted; + return this; + } + + /** The status of your business's website. */ + public Builder setType(AccountUpdateParams.Settings.PaypayPayments.Site.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Accessible { + /** + * 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 Accessible(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Settings.PaypayPayments.Site.Accessible build() { + return new AccountUpdateParams.Settings.PaypayPayments.Site.Accessible( + this.extraParams); + } + + /** + * 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.Settings.PaypayPayments.Site.Accessible#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.Settings.PaypayPayments.Site.Accessible#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 InDevelopment { + /** + * 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 password needed to access your business's website. */ + @SerializedName("password") + Object password; + + /** The username needed to access your business's website. */ + @SerializedName("username") + Object username; + + private InDevelopment(Map extraParams, Object password, Object username) { + this.extraParams = extraParams; + this.password = password; + this.username = username; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object password; + + private Object username; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Settings.PaypayPayments.Site.InDevelopment build() { + return new AccountUpdateParams.Settings.PaypayPayments.Site.InDevelopment( + this.extraParams, this.password, this.username); + } + + /** + * 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.Settings.PaypayPayments.Site.InDevelopment#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.Settings.PaypayPayments.Site.InDevelopment#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 password needed to access your business's website. */ + public Builder setPassword(String password) { + this.password = password; + return this; + } + + /** Required. The password needed to access your business's website. */ + public Builder setPassword(EmptyParam password) { + this.password = password; + return this; + } + + /** The username needed to access your business's website. */ + public Builder setUsername(String username) { + this.username = username; + return this; + } + + /** The username needed to access your business's website. */ + public Builder setUsername(EmptyParam username) { + this.username = username; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Restricted { + /** + * 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 file explaining the payment flow for your business. */ + @SerializedName("payment_flow_file") + Object paymentFlowFile; + + private Restricted(Map extraParams, Object paymentFlowFile) { + this.extraParams = extraParams; + this.paymentFlowFile = paymentFlowFile; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object paymentFlowFile; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Settings.PaypayPayments.Site.Restricted build() { + return new AccountUpdateParams.Settings.PaypayPayments.Site.Restricted( + this.extraParams, this.paymentFlowFile); + } + + /** + * 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.Settings.PaypayPayments.Site.Restricted#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.Settings.PaypayPayments.Site.Restricted#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 file explaining the payment flow for your business. */ + public Builder setPaymentFlowFile(String paymentFlowFile) { + this.paymentFlowFile = paymentFlowFile; + return this; + } + + /** The file explaining the payment flow for your business. */ + public Builder setPaymentFlowFile(EmptyParam paymentFlowFile) { + this.paymentFlowFile = paymentFlowFile; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("accessible") + ACCESSIBLE("accessible"), + + @SerializedName("in_development") + IN_DEVELOPMENT("in_development"), + + @SerializedName("restricted") + RESTRICTED("restricted"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } } public enum GoodsType implements ApiRequestParams.EnumParam { diff --git a/src/main/java/com/stripe/param/BalanceTransactionListParams.java b/src/main/java/com/stripe/param/BalanceTransactionListParams.java index 744b212f76d..e3e649ec359 100644 --- a/src/main/java/com/stripe/param/BalanceTransactionListParams.java +++ b/src/main/java/com/stripe/param/BalanceTransactionListParams.java @@ -61,7 +61,7 @@ public class BalanceTransactionListParams extends ApiRequestParams { @SerializedName("payout") String payout; - /** Only returns the original transaction. */ + /** Only returns transactions associated with the given object. */ @SerializedName("source") String source; @@ -85,11 +85,11 @@ public class BalanceTransactionListParams extends ApiRequestParams { * payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code * payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code * payout_minimum_balance_hold}, {@code payout_minimum_balance_release}, {@code refund}, {@code - * refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, - * {@code stripe_fx_fee}, {@code stripe_balance_payment_debit}, {@code - * stripe_balance_payment_debit_reversal}, {@code tax_fee}, {@code topup}, {@code topup_reversal}, - * {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or {@code - * transfer_refund}. + * refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code reserve_hold}, + * {@code reserve_release}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code + * stripe_balance_payment_debit}, {@code stripe_balance_payment_debit_reversal}, {@code tax_fee}, + * {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code + * transfer_failure}, or {@code transfer_refund}. */ @SerializedName("type") String type; @@ -260,7 +260,7 @@ public Builder setPayout(String payout) { return this; } - /** Only returns the original transaction. */ + /** Only returns transactions associated with the given object. */ public Builder setSource(String source) { this.source = source; return this; @@ -289,10 +289,11 @@ public Builder setStartingAfter(String startingAfter) { * payment_refund}, {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, * {@code payout_cancel}, {@code payout_failure}, {@code payout_minimum_balance_hold}, {@code * payout_minimum_balance_release}, {@code refund}, {@code refund_failure}, {@code - * reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, - * {@code stripe_balance_payment_debit}, {@code stripe_balance_payment_debit_reversal}, {@code - * tax_fee}, {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, - * {@code transfer_failure}, or {@code transfer_refund}. + * reserve_transaction}, {@code reserved_funds}, {@code reserve_hold}, {@code reserve_release}, + * {@code stripe_fee}, {@code stripe_fx_fee}, {@code stripe_balance_payment_debit}, {@code + * stripe_balance_payment_debit_reversal}, {@code tax_fee}, {@code topup}, {@code + * topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or + * {@code transfer_refund}. */ public Builder setType(String type) { this.type = type; diff --git a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java index 2e092fb7dca..8ece8d38971 100644 --- a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java +++ b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java @@ -3633,6 +3633,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), diff --git a/src/main/java/com/stripe/param/CouponCreateParams.java b/src/main/java/com/stripe/param/CouponCreateParams.java index ec609e4fc23..3844bf1c7bd 100644 --- a/src/main/java/com/stripe/param/CouponCreateParams.java +++ b/src/main/java/com/stripe/param/CouponCreateParams.java @@ -109,8 +109,9 @@ public class CouponCreateParams extends ApiRequestParams { BigDecimal percentOff; /** - * Unix timestamp specifying the last time at which the coupon can be redeemed. After the - * redeem_by date, the coupon can no longer be applied to new customers. + * Unix timestamp specifying the last time at which the coupon can be redeemed (cannot be set to + * more than 5 years in the future). After the redeem_by date, the coupon can no longer be applied + * to new customers. */ @SerializedName("redeem_by") Long redeemBy; @@ -429,8 +430,9 @@ public Builder setPercentOff(BigDecimal percentOff) { } /** - * Unix timestamp specifying the last time at which the coupon can be redeemed. After the - * redeem_by date, the coupon can no longer be applied to new customers. + * Unix timestamp specifying the last time at which the coupon can be redeemed (cannot be set to + * more than 5 years in the future). After the redeem_by date, the coupon can no longer be + * applied to new customers. */ public Builder setRedeemBy(Long redeemBy) { this.redeemBy = redeemBy; diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index e12cebfad7c..2a94319b861 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -1738,12 +1738,12 @@ public static class TaxIdData { * kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, * {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code my_frp}, {@code * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code np_pan}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code - * rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, {@code + * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, + * {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ @SerializedName("type") Type type; @@ -1817,11 +1817,12 @@ public Builder putAllExtraParam(Map map) { * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code - * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, - * {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code - * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, - * {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code + * sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, + * {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code + * tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, + * {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code + * zw_tin} */ public Builder setType(CustomerCreateParams.TaxIdData.Type type) { this.type = type; @@ -2085,6 +2086,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java b/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java index b135c6adc4c..a2a30ff9124 100644 --- a/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java @@ -42,11 +42,11 @@ public class CustomerTaxIdCreateParams extends ApiRequestParams { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, - * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code - * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, + * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code + * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ @SerializedName("type") Type type; @@ -149,12 +149,12 @@ public Builder putAllExtraParam(Map map) { * kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, * {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code my_frp}, {@code * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code np_pan}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code - * rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, {@code + * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, + * {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ public Builder setType(CustomerTaxIdCreateParams.Type type) { this.type = type; @@ -418,6 +418,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 32028352253..ee9f1aa2b14 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -1432,11 +1432,12 @@ public static class TaxId { * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code - * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, - * {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code - * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, - * {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code + * sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, + * {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code + * tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, + * {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code + * zw_tin} */ @SerializedName("type") Type type; @@ -1513,12 +1514,12 @@ public Builder putAllExtraParam(Map map) { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code * mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, * {@code no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code - * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, - * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code - * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code - * uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code - * zw_tin} + * ph_tin}, {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, + * {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code + * sr_fin}, {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code + * uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, + * or {@code zw_tin} */ public Builder setType(InvoiceCreatePreviewParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -1782,6 +1783,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/InvoiceDetachPaymentParams.java b/src/main/java/com/stripe/param/InvoiceDetachPaymentParams.java new file mode 100644 index 00000000000..e20ed802442 --- /dev/null +++ b/src/main/java/com/stripe/param/InvoiceDetachPaymentParams.java @@ -0,0 +1,114 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class InvoiceDetachPaymentParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 PaymentIntent to detach from the invoice. */ + @SerializedName("payment_intent") + String paymentIntent; + + private InvoiceDetachPaymentParams( + List expand, Map extraParams, String paymentIntent) { + this.expand = expand; + this.extraParams = extraParams; + this.paymentIntent = paymentIntent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private String paymentIntent; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceDetachPaymentParams build() { + return new InvoiceDetachPaymentParams(this.expand, this.extraParams, this.paymentIntent); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceDetachPaymentParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * InvoiceDetachPaymentParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * InvoiceDetachPaymentParams#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 InvoiceDetachPaymentParams#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 PaymentIntent to detach from the invoice. */ + public Builder setPaymentIntent(String paymentIntent) { + this.paymentIntent = paymentIntent; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/OrderCreateParams.java b/src/main/java/com/stripe/param/OrderCreateParams.java index 0986ddc6119..ce2ed02a7cb 100644 --- a/src/main/java/com/stripe/param/OrderCreateParams.java +++ b/src/main/java/com/stripe/param/OrderCreateParams.java @@ -15563,11 +15563,12 @@ public static class TaxId { * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code - * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, - * {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code - * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, - * {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code + * sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, + * {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code + * tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, + * {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code + * zw_tin} */ @SerializedName("type") Type type; @@ -15643,12 +15644,12 @@ public Builder putAllExtraParam(Map map) { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code * mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, * {@code no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code - * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, - * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code - * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code - * uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code - * zw_tin} + * ph_tin}, {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, + * {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code + * sr_fin}, {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code + * uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, + * or {@code zw_tin} */ public Builder setType(OrderCreateParams.TaxDetails.TaxId.Type type) { this.type = type; @@ -15912,6 +15913,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/OrderUpdateParams.java b/src/main/java/com/stripe/param/OrderUpdateParams.java index 60934ca5822..c113fdc608e 100644 --- a/src/main/java/com/stripe/param/OrderUpdateParams.java +++ b/src/main/java/com/stripe/param/OrderUpdateParams.java @@ -16882,11 +16882,12 @@ public static class TaxId { * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code - * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, - * {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code - * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, - * {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code + * sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, + * {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code + * tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, + * {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code + * zw_tin} */ @SerializedName("type") Type type; @@ -16962,12 +16963,12 @@ public Builder putAllExtraParam(Map map) { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code * mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, * {@code no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code - * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, - * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code - * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code - * uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code - * zw_tin} + * ph_tin}, {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, + * {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code + * sr_fin}, {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code + * uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, + * or {@code zw_tin} */ public Builder setType(OrderUpdateParams.TaxDetails.TaxId.Type type) { this.type = type; @@ -17237,6 +17238,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index a7cd7866f96..477e441a208 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -391,6 +391,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -402,7 +417,7 @@ public static class AmountDetails { /** * A list of line items, each containing information about a product in the PaymentIntent. There - * is a maximum of 100 line items. + * is a maximum of 200 line items. */ @SerializedName("line_items") Object lineItems; @@ -417,11 +432,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -435,6 +452,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -446,7 +465,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCaptureParams.AmountDetails build() { return new PaymentIntentCaptureParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -475,6 +499,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 @@ -533,7 +574,7 @@ public Builder addAllLineItem( /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems(EmptyParam lineItems) { this.lineItems = lineItems; @@ -542,7 +583,7 @@ public Builder setLineItems(EmptyParam lineItems) { /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems( List lineItems) { diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 901ce176588..b165c1b42a9 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -849,6 +849,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -860,7 +875,7 @@ public static class AmountDetails { /** * A list of line items, each containing information about a product in the PaymentIntent. There - * is a maximum of 100 line items. + * is a maximum of 200 line items. */ @SerializedName("line_items") Object lineItems; @@ -875,11 +890,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -893,6 +910,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -904,7 +923,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentConfirmParams.AmountDetails build() { return new PaymentIntentConfirmParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -933,6 +957,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 @@ -991,7 +1032,7 @@ public Builder addAllLineItem( /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems(EmptyParam lineItems) { this.lineItems = lineItems; @@ -1000,7 +1041,7 @@ public Builder setLineItems(EmptyParam lineItems) { /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems( List lineItems) { @@ -16952,6 +16993,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -26468,7 +26512,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; @@ -42499,7 +42549,7 @@ public static class UsBankAccount { /** Preferred transaction settlement speed. */ @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; + PreferredSettlementSpeed preferredSettlementSpeed; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -42544,7 +42594,7 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, + PreferredSettlementSpeed preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, VerificationMethod verificationMethod) { @@ -42571,7 +42621,7 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; + private PreferredSettlementSpeed preferredSettlementSpeed; private ApiRequestParams.EnumParam setupFutureUsage; @@ -42653,12 +42703,6 @@ public Builder setPreferredSettlementSpeed( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 41aa777caed..792ac734afc 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -1257,6 +1257,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -1268,7 +1283,7 @@ public static class AmountDetails { /** * A list of line items, each containing information about a product in the PaymentIntent. There - * is a maximum of 100 line items. + * is a maximum of 200 line items. */ @SerializedName("line_items") Object lineItems; @@ -1283,11 +1298,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -1301,6 +1318,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -1312,7 +1331,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCreateParams.AmountDetails build() { return new PaymentIntentCreateParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -1341,6 +1365,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 @@ -1399,7 +1440,7 @@ public Builder addAllLineItem( /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems(EmptyParam lineItems) { this.lineItems = lineItems; @@ -1408,7 +1449,7 @@ public Builder setLineItems(EmptyParam lineItems) { /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems( List lineItems) { @@ -17458,6 +17499,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -26964,7 +27008,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; @@ -42981,7 +43031,7 @@ public static class UsBankAccount { /** Preferred transaction settlement speed. */ @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; + PreferredSettlementSpeed preferredSettlementSpeed; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -43026,7 +43076,7 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, + PreferredSettlementSpeed preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, VerificationMethod verificationMethod) { @@ -43053,7 +43103,7 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; + private PreferredSettlementSpeed preferredSettlementSpeed; private ApiRequestParams.EnumParam setupFutureUsage; @@ -43133,12 +43183,6 @@ public Builder setPreferredSettlementSpeed( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 9f6a0e99269..e4bdaba85de 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -335,6 +335,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -346,7 +361,7 @@ public static class AmountDetails { /** * A list of line items, each containing information about a product in the PaymentIntent. There - * is a maximum of 100 line items. + * is a maximum of 200 line items. */ @SerializedName("line_items") Object lineItems; @@ -361,11 +376,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -379,6 +396,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -390,7 +409,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentIncrementAuthorizationParams.AmountDetails build() { return new PaymentIntentIncrementAuthorizationParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -419,6 +443,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 @@ -485,7 +526,7 @@ public Builder addAllLineItem( /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems(EmptyParam lineItems) { this.lineItems = lineItems; @@ -494,7 +535,7 @@ public Builder setLineItems(EmptyParam lineItems) { /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems( List lineItems) { diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 407e4ce52ad..6248528d18e 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -1103,6 +1103,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -1114,7 +1129,7 @@ public static class AmountDetails { /** * A list of line items, each containing information about a product in the PaymentIntent. There - * is a maximum of 100 line items. + * is a maximum of 200 line items. */ @SerializedName("line_items") Object lineItems; @@ -1129,11 +1144,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -1147,6 +1164,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -1158,7 +1177,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentUpdateParams.AmountDetails build() { return new PaymentIntentUpdateParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -1187,6 +1211,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 @@ -1245,7 +1286,7 @@ public Builder addAllLineItem( /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems(EmptyParam lineItems) { this.lineItems = lineItems; @@ -1254,7 +1295,7 @@ public Builder setLineItems(EmptyParam lineItems) { /** * A list of line items, each containing information about a product in the PaymentIntent. - * There is a maximum of 100 line items. + * There is a maximum of 200 line items. */ public Builder setLineItems( List lineItems) { @@ -18282,6 +18323,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -28062,7 +28106,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; @@ -44883,7 +44933,7 @@ public static class UsBankAccount { /** Preferred transaction settlement speed. */ @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; + PreferredSettlementSpeed preferredSettlementSpeed; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -44928,7 +44978,7 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, + PreferredSettlementSpeed preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, Object targetDate, VerificationMethod verificationMethod) { @@ -44955,7 +45005,7 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; + private PreferredSettlementSpeed preferredSettlementSpeed; private ApiRequestParams.EnumParam setupFutureUsage; @@ -45035,12 +45085,6 @@ public Builder setPreferredSettlementSpeed( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 1ab1bf683cb..ce2cb951753 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -62,12 +62,15 @@ public class PaymentLinkCreateParams extends ApiRequestParams { /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("custom_fields") List customFields; - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ @SerializedName("custom_text") CustomText customText; @@ -476,7 +479,10 @@ public Builder addAllCustomField(List eleme return this; } - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ public Builder setCustomText(PaymentLinkCreateParams.CustomText customText) { this.customText = customText; return this; @@ -6877,7 +6883,10 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You can't + * set this parameter if {@code ui_mode} is {@code custom}. + */ @SerializedName("required") Required required; @@ -6940,7 +6949,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ public Builder setRequired(PaymentLinkCreateParams.TaxIdCollection.Required required) { this.required = required; return this; diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index cdb986b412c..c2cea546600 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -39,12 +39,15 @@ public class PaymentLinkUpdateParams extends ApiRequestParams { /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("custom_fields") Object customFields; - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ @SerializedName("custom_text") CustomText customText; @@ -362,7 +365,7 @@ public Builder addAllCustomField(List eleme /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setCustomFields(EmptyParam customFields) { this.customFields = customFields; @@ -371,14 +374,17 @@ public Builder setCustomFields(EmptyParam customFields) { /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setCustomFields(List customFields) { this.customFields = customFields; return this; } - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ public Builder setCustomText(PaymentLinkUpdateParams.CustomText customText) { this.customText = customText; return this; @@ -5588,7 +5594,10 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You can't + * set this parameter if {@code ui_mode} is {@code custom}. + */ @SerializedName("required") Required required; @@ -5651,7 +5660,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ public Builder setRequired(PaymentLinkUpdateParams.TaxIdCollection.Required required) { this.required = required; return this; diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java index c0ccf557547..04132633297 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java @@ -210,8 +210,8 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { /** * Meal vouchers in France, or “titres-restaurant”, is a local benefits program commonly offered * by employers for their employees to purchase prepared food and beverages on working days. Check - * this page for more - * details. + * this page for + * more details. */ @SerializedName("fr_meal_voucher_conecs") FrMealVoucherConecs frMealVoucherConecs; @@ -1173,8 +1173,8 @@ public Builder setFpx(PaymentMethodConfigurationCreateParams.Fpx fpx) { /** * Meal vouchers in France, or “titres-restaurant”, is a local benefits program commonly offered * by employers for their employees to purchase prepared food and beverages on working days. - * Check this page for - * more details. + * Check this page + * for more details. */ public Builder setFrMealVoucherConecs( PaymentMethodConfigurationCreateParams.FrMealVoucherConecs frMealVoucherConecs) { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java index 8a1892d094e..a66f808e91a 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java @@ -215,8 +215,8 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { /** * Meal vouchers in France, or “titres-restaurant”, is a local benefits program commonly offered * by employers for their employees to purchase prepared food and beverages on working days. Check - * this page for more - * details. + * this page for + * more details. */ @SerializedName("fr_meal_voucher_conecs") FrMealVoucherConecs frMealVoucherConecs; @@ -1180,8 +1180,8 @@ public Builder setFpx(PaymentMethodConfigurationUpdateParams.Fpx fpx) { /** * Meal vouchers in France, or “titres-restaurant”, is a local benefits program commonly offered * by employers for their employees to purchase prepared food and beverages on working days. - * Check this page for - * more details. + * Check this page + * for more details. */ public Builder setFrMealVoucherConecs( PaymentMethodConfigurationUpdateParams.FrMealVoucherConecs frMealVoucherConecs) { diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index cc4b58519ee..f82dd7e575c 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -3765,6 +3765,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index e288e61ad85..d329209cc2b 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -4036,6 +4036,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -9103,7 +9106,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index f836ba81a8d..213e4ce0ef0 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -4571,6 +4571,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -9635,7 +9638,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index f073d579de8..e1d88b4f998 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -4042,6 +4042,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -9276,7 +9279,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/SubscriptionPauseParams.java b/src/main/java/com/stripe/param/SubscriptionPauseParams.java new file mode 100644 index 00000000000..67fbc645c89 --- /dev/null +++ b/src/main/java/com/stripe/param/SubscriptionPauseParams.java @@ -0,0 +1,274 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class SubscriptionPauseParams extends ApiRequestParams { + /** Controls what to bill for when pausing the subscription. */ + @SerializedName("bill_for") + BillFor billFor; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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; + + /** + * Determines how to handle debits and credits when pausing. The default is {@code + * pending_invoice_item}. + */ + @SerializedName("invoicing_behavior") + InvoicingBehavior invoicingBehavior; + + /** Required. The type of pause to apply. */ + @SerializedName("type") + Type type; + + private SubscriptionPauseParams( + BillFor billFor, + List expand, + Map extraParams, + InvoicingBehavior invoicingBehavior, + Type type) { + this.billFor = billFor; + this.expand = expand; + this.extraParams = extraParams; + this.invoicingBehavior = invoicingBehavior; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillFor billFor; + + private List expand; + + private Map extraParams; + + private InvoicingBehavior invoicingBehavior; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionPauseParams build() { + return new SubscriptionPauseParams( + this.billFor, this.expand, this.extraParams, this.invoicingBehavior, this.type); + } + + /** Controls what to bill for when pausing the subscription. */ + public Builder setBillFor(SubscriptionPauseParams.BillFor billFor) { + this.billFor = billFor; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * SubscriptionPauseParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * SubscriptionPauseParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * SubscriptionPauseParams#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 SubscriptionPauseParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Determines how to handle debits and credits when pausing. The default is {@code + * pending_invoice_item}. + */ + public Builder setInvoicingBehavior( + SubscriptionPauseParams.InvoicingBehavior invoicingBehavior) { + this.invoicingBehavior = invoicingBehavior; + return this; + } + + /** Required. The type of pause to apply. */ + public Builder setType(SubscriptionPauseParams.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillFor { + /** + * 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; + + /** + * Controls whether to debit for accrued metered usage in the current billing period. The + * default is {@code false}. + */ + @SerializedName("outstanding_usage") + Boolean outstandingUsage; + + /** + * Controls whether to credit for licensed items in the current billing period. The default is + * {@code false}. + */ + @SerializedName("unused_time") + Boolean unusedTime; + + private BillFor(Map extraParams, Boolean outstandingUsage, Boolean unusedTime) { + this.extraParams = extraParams; + this.outstandingUsage = outstandingUsage; + this.unusedTime = unusedTime; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean outstandingUsage; + + private Boolean unusedTime; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionPauseParams.BillFor build() { + return new SubscriptionPauseParams.BillFor( + this.extraParams, this.outstandingUsage, this.unusedTime); + } + + /** + * 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 + * SubscriptionPauseParams.BillFor#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 SubscriptionPauseParams.BillFor#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Controls whether to debit for accrued metered usage in the current billing period. The + * default is {@code false}. + */ + public Builder setOutstandingUsage(Boolean outstandingUsage) { + this.outstandingUsage = outstandingUsage; + return this; + } + + /** + * Controls whether to credit for licensed items in the current billing period. The default is + * {@code false}. + */ + public Builder setUnusedTime(Boolean unusedTime) { + this.unusedTime = unusedTime; + return this; + } + } + } + + public enum InvoicingBehavior implements ApiRequestParams.EnumParam { + @SerializedName("invoice") + INVOICE("invoice"), + + @SerializedName("pending_invoice_item") + PENDING_INVOICE_ITEM("pending_invoice_item"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + InvoicingBehavior(String value) { + this.value = value; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("subscription") + SUBSCRIPTION("subscription"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java index a9dac7a769c..509ab49c3b2 100644 --- a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java @@ -42,11 +42,11 @@ public class TaxIdCollectionCreateParams extends ApiRequestParams { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, - * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code - * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, + * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code + * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ @SerializedName("type") Type type; @@ -149,12 +149,12 @@ public Builder putAllExtraParam(Map map) { * kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, * {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code my_frp}, {@code * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code np_pan}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code - * rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, {@code + * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, + * {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ public Builder setType(TaxIdCollectionCreateParams.Type type) { this.type = type; @@ -418,6 +418,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/TaxIdCreateParams.java b/src/main/java/com/stripe/param/TaxIdCreateParams.java index f0e76ac3d39..548215820cd 100644 --- a/src/main/java/com/stripe/param/TaxIdCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCreateParams.java @@ -46,11 +46,11 @@ public class TaxIdCreateParams extends ApiRequestParams { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, - * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code - * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, + * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code + * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ @SerializedName("type") Type type; @@ -163,12 +163,12 @@ public Builder setOwner(TaxIdCreateParams.Owner owner) { * kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, * {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code my_frp}, {@code * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code np_pan}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code - * rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, {@code + * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, + * {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ public Builder setType(TaxIdCreateParams.Type type) { this.type = type; @@ -573,6 +573,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 38cabad42b5..5e0993b7570 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -639,7 +639,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam { VERSION_2025_11_17_CLOVER("2025-11-17.clover"), @SerializedName("2025-12-15.clover") - VERSION_2025_12_15_CLOVER("2025-12-15.clover"); + VERSION_2025_12_15_CLOVER("2025-12-15.clover"), + + @SerializedName("2026-01-28.clover") + VERSION_2026_01_28_CLOVER("2026-01-28.clover"); @Getter(onMethod_ = {@Override}) private final String value; @@ -734,6 +737,10 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("capital.financing_offer.replacement_created") CAPITAL__FINANCING_OFFER__REPLACEMENT_CREATED("capital.financing_offer.replacement_created"), + @SerializedName("capital.financing_summary.line_of_credit_update") + CAPITAL__FINANCING_SUMMARY__LINE_OF_CREDIT_UPDATE( + "capital.financing_summary.line_of_credit_update"), + @SerializedName("capital.financing_transaction.created") CAPITAL__FINANCING_TRANSACTION__CREATED("capital.financing_transaction.created"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index db69d1967f6..b92c66f57d2 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -347,6 +347,10 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("capital.financing_offer.replacement_created") CAPITAL__FINANCING_OFFER__REPLACEMENT_CREATED("capital.financing_offer.replacement_created"), + @SerializedName("capital.financing_summary.line_of_credit_update") + CAPITAL__FINANCING_SUMMARY__LINE_OF_CREDIT_UPDATE( + "capital.financing_summary.line_of_credit_update"), + @SerializedName("capital.financing_transaction.created") CAPITAL__FINANCING_TRANSACTION__CREATED("capital.financing_transaction.created"), diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 532337be4be..fb148cb3f76 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -22,7 +22,10 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName("adaptive_pricing") AdaptivePricing adaptivePricing; - /** Configure actions after a Checkout Session has expired. */ + /** + * Configure actions after a Checkout Session has expired. You can't set this parameter if {@code + * ui_mode} is {@code custom}. + */ @SerializedName("after_expiration") AfterExpiration afterExpiration; @@ -83,12 +86,15 @@ public class SessionCreateParams extends ApiRequestParams { /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("custom_fields") List customFields; - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ @SerializedName("custom_text") CustomText customText; @@ -243,6 +249,8 @@ public class SessionCreateParams extends ApiRequestParams { * *

If a Customer is created or provided, * the names can be saved to the Customer object as well. + * + *

You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("name_collection") NameCollection nameCollection; @@ -260,12 +268,15 @@ public class SessionCreateParams extends ApiRequestParams { * *

For {@code subscription} mode, there is a maximum of 20 line items and optional items with * recurring Prices and 20 line items and optional items with one-time Prices. + * + *

You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("optional_items") List optionalItems; /** * Where the user is coming from. This informs the optimizations that are applied to the session. + * You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("origin_context") OriginContext originContext; @@ -391,7 +402,7 @@ public class SessionCreateParams extends ApiRequestParams { * Describes the type of transaction being performed by Checkout in order to customize relevant * text on the page, such as the submit button. {@code submit_type} can only be specified on * Checkout Sessions in {@code payment} or {@code subscription} mode. If blank or {@code auto}, - * {@code pay} is used. + * {@code pay} is used. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("submit_type") SubmitType submitType; @@ -702,7 +713,10 @@ public Builder setAdaptivePricing(SessionCreateParams.AdaptivePricing adaptivePr return this; } - /** Configure actions after a Checkout Session has expired. */ + /** + * Configure actions after a Checkout Session has expired. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ public Builder setAfterExpiration(SessionCreateParams.AfterExpiration afterExpiration) { this.afterExpiration = afterExpiration; return this; @@ -829,7 +843,10 @@ public Builder addAllCustomField(List elements) return this; } - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ public Builder setCustomText(SessionCreateParams.CustomText customText) { this.customText = customText; return this; @@ -1109,6 +1126,8 @@ public Builder setMode(SessionCreateParams.Mode mode) { * *

If a Customer is created or provided, * the names can be saved to the Customer object as well. + * + *

You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setNameCollection(SessionCreateParams.NameCollection nameCollection) { this.nameCollection = nameCollection; @@ -1143,7 +1162,7 @@ public Builder addAllOptionalItem(List element /** * Where the user is coming from. This informs the optimizations that are applied to the - * session. + * session. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setOriginContext(SessionCreateParams.OriginContext originContext) { this.originContext = originContext; @@ -1331,7 +1350,7 @@ public Builder addAllShippingOption(List ele * Describes the type of transaction being performed by Checkout in order to customize relevant * text on the page, such as the submit button. {@code submit_type} can only be specified on * Checkout Sessions in {@code payment} or {@code subscription} mode. If blank or {@code auto}, - * {@code pay} is used. + * {@code pay} is used. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setSubmitType(SessionCreateParams.SubmitType submitType) { this.submitType = submitType; @@ -5667,7 +5686,8 @@ public static class LineItem { /** * The tax rates that will be applied to * this line item depending on the customer's billing/shipping address. We currently support the - * following countries: US, GB, AU, and all countries in the EU. + * following countries: US, GB, AU, and all countries in the EU. You can't set this parameter if + * {@code ui_mode} is {@code custom}. */ @SerializedName("dynamic_tax_rates") List dynamicTaxRates; @@ -8180,7 +8200,10 @@ public enum AllowRedisplay implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class PaymentMethodOptions { - /** contains details about the ACSS Debit payment method options. */ + /** + * contains details about the ACSS Debit payment method options. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ @SerializedName("acss_debit") AcssDebit acssDebit; @@ -8612,7 +8635,10 @@ public SessionCreateParams.PaymentMethodOptions build() { this.wechatPay); } - /** contains details about the ACSS Debit payment method options. */ + /** + * contains details about the ACSS Debit payment method options. You can't set this parameter + * if {@code ui_mode} is {@code custom}. + */ public Builder setAcssDebit(SessionCreateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; @@ -10907,7 +10933,7 @@ public static class Card { /** * Restrictions to apply to the card payment method. For example, you can block specific card - * brands. + * brands. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("restrictions") Restrictions restrictions; @@ -11147,7 +11173,7 @@ public Builder setRequestThreeDSecure( /** * Restrictions to apply to the card payment method. For example, you can block specific - * card brands. + * card brands. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setRestrictions( SessionCreateParams.PaymentMethodOptions.Card.Restrictions restrictions) { @@ -20395,7 +20421,10 @@ public static class SubscriptionData { @SerializedName("application_fee_percent") BigDecimal applicationFeePercent; - /** A future timestamp to anchor the subscription's billing cycle for new subscriptions. */ + /** + * A future timestamp to anchor the subscription's billing cycle for new subscriptions. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ @SerializedName("billing_cycle_anchor") Long billingCycleAnchor; @@ -20573,7 +20602,10 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { return this; } - /** A future timestamp to anchor the subscription's billing cycle for new subscriptions. */ + /** + * A future timestamp to anchor the subscription's billing cycle for new subscriptions. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ public Builder setBillingCycleAnchor(Long billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; @@ -21426,7 +21458,10 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You can't + * set this parameter if {@code ui_mode} is {@code custom}. + */ @SerializedName("required") Required required; @@ -21488,7 +21523,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ public Builder setRequired(SessionCreateParams.TaxIdCollection.Required required) { this.required = required; return this; diff --git a/src/main/java/com/stripe/param/financialconnections/AuthorizationRetrieveParams.java b/src/main/java/com/stripe/param/financialconnections/AuthorizationRetrieveParams.java new file mode 100644 index 00000000000..bc53c810549 --- /dev/null +++ b/src/main/java/com/stripe/param/financialconnections/AuthorizationRetrieveParams.java @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec +package com.stripe.param.financialconnections; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class AuthorizationRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 AuthorizationRetrieveParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AuthorizationRetrieveParams build() { + return new AuthorizationRetrieveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * AuthorizationRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * AuthorizationRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * AuthorizationRetrieveParams#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 AuthorizationRetrieveParams#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/financialconnections/SessionCreateParams.java b/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java index 2f18d1888af..7655e96322d 100644 --- a/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/financialconnections/SessionCreateParams.java @@ -13,7 +13,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class SessionCreateParams extends ApiRequestParams { - /** Required. The account holder to link accounts for. */ + /** The account holder to link accounts for. */ @SerializedName("account_holder") AccountHolder accountHolder; @@ -55,6 +55,10 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName("prefetch") List prefetch; + /** Options for specifying a Session targeted to relinking an authorization. */ + @SerializedName("relink_options") + RelinkOptions relinkOptions; + /** * For webview integrations only. Upon completing OAuth login in the native browser, the user will * be redirected to this URL to return to your app. @@ -71,6 +75,7 @@ private SessionCreateParams( ManualEntry manualEntry, List permissions, List prefetch, + RelinkOptions relinkOptions, String returnUrl) { this.accountHolder = accountHolder; this.expand = expand; @@ -80,6 +85,7 @@ private SessionCreateParams( this.manualEntry = manualEntry; this.permissions = permissions; this.prefetch = prefetch; + this.relinkOptions = relinkOptions; this.returnUrl = returnUrl; } @@ -104,6 +110,8 @@ public static class Builder { private List prefetch; + private RelinkOptions relinkOptions; + private String returnUrl; /** Finalize and obtain parameter instance from this builder. */ @@ -117,10 +125,11 @@ public SessionCreateParams build() { this.manualEntry, this.permissions, this.prefetch, + this.relinkOptions, this.returnUrl); } - /** Required. The account holder to link accounts for. */ + /** The account holder to link accounts for. */ public Builder setAccountHolder(SessionCreateParams.AccountHolder accountHolder) { this.accountHolder = accountHolder; return this; @@ -248,6 +257,12 @@ public Builder addAllPrefetch(List elements) { return this; } + /** Options for specifying a Session targeted to relinking an authorization. */ + public Builder setRelinkOptions(SessionCreateParams.RelinkOptions relinkOptions) { + this.relinkOptions = relinkOptions; + return this; + } + /** * For webview integrations only. Upon completing OAuth login in the native browser, the user * will be redirected to this URL to return to your app. @@ -727,6 +742,93 @@ public enum Mode implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RelinkOptions { + /** + * The account to relink. Must belong to the authorization specified in {@code authorization}. + */ + @SerializedName("account") + String account; + + /** Required. The authorization to relink. */ + @SerializedName("authorization") + String authorization; + + /** + * 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 RelinkOptions(String account, String authorization, Map extraParams) { + this.account = account; + this.authorization = authorization; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String account; + + private String authorization; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.RelinkOptions build() { + return new SessionCreateParams.RelinkOptions( + this.account, this.authorization, this.extraParams); + } + + /** + * The account to relink. Must belong to the authorization specified in {@code authorization}. + */ + public Builder setAccount(String account) { + this.account = account; + return this; + } + + /** Required. The authorization to relink. */ + public Builder setAuthorization(String authorization) { + this.authorization = authorization; + 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 + * SessionCreateParams.RelinkOptions#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 SessionCreateParams.RelinkOptions#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 Permission implements ApiRequestParams.EnumParam { @SerializedName("balances") BALANCES("balances"), diff --git a/src/main/java/com/stripe/param/radar/PaymentEvaluationCreateParams.java b/src/main/java/com/stripe/param/radar/PaymentEvaluationCreateParams.java new file mode 100644 index 00000000000..d9072f65bdf --- /dev/null +++ b/src/main/java/com/stripe/param/radar/PaymentEvaluationCreateParams.java @@ -0,0 +1,1483 @@ +// File generated from our OpenAPI spec +package com.stripe.param.radar; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentEvaluationCreateParams extends ApiRequestParams { + /** Details about the Client Device Metadata to associate with the payment evaluation. */ + @SerializedName("client_device_metadata_details") + ClientDeviceMetadataDetails clientDeviceMetadataDetails; + + /** + * Required. Details about the customer associated with the payment evaluation. + */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** Required. Details about the payment. */ + @SerializedName("payment_details") + PaymentDetails paymentDetails; + + private PaymentEvaluationCreateParams( + ClientDeviceMetadataDetails clientDeviceMetadataDetails, + CustomerDetails customerDetails, + List expand, + Map extraParams, + Map metadata, + PaymentDetails paymentDetails) { + this.clientDeviceMetadataDetails = clientDeviceMetadataDetails; + this.customerDetails = customerDetails; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + this.paymentDetails = paymentDetails; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ClientDeviceMetadataDetails clientDeviceMetadataDetails; + + private CustomerDetails customerDetails; + + private List expand; + + private Map extraParams; + + private Map metadata; + + private PaymentDetails paymentDetails; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams build() { + return new PaymentEvaluationCreateParams( + this.clientDeviceMetadataDetails, + this.customerDetails, + this.expand, + this.extraParams, + this.metadata, + this.paymentDetails); + } + + /** Details about the Client Device Metadata to associate with the payment evaluation. */ + public Builder setClientDeviceMetadataDetails( + PaymentEvaluationCreateParams.ClientDeviceMetadataDetails clientDeviceMetadataDetails) { + this.clientDeviceMetadataDetails = clientDeviceMetadataDetails; + return this; + } + + /** + * Required. Details about the customer associated with the payment evaluation. + */ + public Builder setCustomerDetails( + PaymentEvaluationCreateParams.CustomerDetails customerDetails) { + this.customerDetails = customerDetails; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentEvaluationCreateParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentEvaluationCreateParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * PaymentEvaluationCreateParams#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 PaymentEvaluationCreateParams#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 `metadata` 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 + * PaymentEvaluationCreateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 PaymentEvaluationCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** Required. Details about the payment. */ + public Builder setPaymentDetails(PaymentEvaluationCreateParams.PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ClientDeviceMetadataDetails { + /** + * 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. ID for the Radar Session to associate with the payment evaluation. + * A Radar Session is a snapshot of + * the browser metadata and device details that help Radar make more accurate predictions on + * your payments. + */ + @SerializedName("radar_session") + String radarSession; + + private ClientDeviceMetadataDetails(Map extraParams, String radarSession) { + this.extraParams = extraParams; + this.radarSession = radarSession; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String radarSession; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.ClientDeviceMetadataDetails build() { + return new PaymentEvaluationCreateParams.ClientDeviceMetadataDetails( + this.extraParams, this.radarSession); + } + + /** + * 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 + * PaymentEvaluationCreateParams.ClientDeviceMetadataDetails#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 PaymentEvaluationCreateParams.ClientDeviceMetadataDetails#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. ID for the Radar Session to associate with the payment + * evaluation. A Radar Session is a + * snapshot of the browser metadata and device details that help Radar make more accurate + * predictions on your payments. + */ + public Builder setRadarSession(String radarSession) { + this.radarSession = radarSession; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails { + /** The ID of the customer associated with the payment evaluation. */ + @SerializedName("customer") + String customer; + + /** The ID of the Account representing the customer associated with the payment evaluation. */ + @SerializedName("customer_account") + String customerAccount; + + /** The customer's email address. */ + @SerializedName("email") + String email; + + /** + * 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 customer's full name or business name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + + private CustomerDetails( + String customer, + String customerAccount, + String email, + Map extraParams, + String name, + String phone) { + this.customer = customer; + this.customerAccount = customerAccount; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String customer; + + private String customerAccount; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.CustomerDetails build() { + return new PaymentEvaluationCreateParams.CustomerDetails( + this.customer, + this.customerAccount, + this.email, + this.extraParams, + this.name, + this.phone); + } + + /** The ID of the customer associated with the payment evaluation. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** The ID of the Account representing the customer associated with the payment evaluation. */ + public Builder setCustomerAccount(String customerAccount) { + this.customerAccount = customerAccount; + return this; + } + + /** The customer's email address. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * PaymentEvaluationCreateParams.CustomerDetails#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 PaymentEvaluationCreateParams.CustomerDetails#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 customer's full name or business name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The customer's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails { + /** + * Required. The intended amount to collect with this payment. A positive + * integer representing how much to charge in the smallest currency unit (for + * example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). + */ + @SerializedName("amount") + Long amount; + + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String description; + + /** + * 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 about the payment's customer presence and type. */ + @SerializedName("money_movement_details") + MoneyMovementDetails moneyMovementDetails; + + /** Required. Details about the payment method to use for the payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** Shipping details for the payment evaluation. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + /** Payment statement descriptor. */ + @SerializedName("statement_descriptor") + String statementDescriptor; + + private PaymentDetails( + Long amount, + String currency, + String description, + Map extraParams, + MoneyMovementDetails moneyMovementDetails, + PaymentMethodDetails paymentMethodDetails, + ShippingDetails shippingDetails, + String statementDescriptor) { + this.amount = amount; + this.currency = currency; + this.description = description; + this.extraParams = extraParams; + this.moneyMovementDetails = moneyMovementDetails; + this.paymentMethodDetails = paymentMethodDetails; + this.shippingDetails = shippingDetails; + this.statementDescriptor = statementDescriptor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private String description; + + private Map extraParams; + + private MoneyMovementDetails moneyMovementDetails; + + private PaymentMethodDetails paymentMethodDetails; + + private ShippingDetails shippingDetails; + + private String statementDescriptor; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails build() { + return new PaymentEvaluationCreateParams.PaymentDetails( + this.amount, + this.currency, + this.description, + this.extraParams, + this.moneyMovementDetails, + this.paymentMethodDetails, + this.shippingDetails, + this.statementDescriptor); + } + + /** + * Required. The intended amount to collect with this payment. A positive + * integer representing how much to charge in the smallest currency unit (for + * example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). + */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + public Builder setDescription(String 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 + * PaymentEvaluationCreateParams.PaymentDetails#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 PaymentEvaluationCreateParams.PaymentDetails#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 about the payment's customer presence and type. */ + public Builder setMoneyMovementDetails( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails moneyMovementDetails) { + this.moneyMovementDetails = moneyMovementDetails; + return this; + } + + /** Required. Details about the payment method to use for the payment. */ + public Builder setPaymentMethodDetails( + PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails paymentMethodDetails) { + this.paymentMethodDetails = paymentMethodDetails; + return this; + } + + /** Shipping details for the payment evaluation. */ + public Builder setShippingDetails( + PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + + /** Payment statement descriptor. */ + public Builder setStatementDescriptor(String statementDescriptor) { + this.statementDescriptor = statementDescriptor; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MoneyMovementDetails { + /** Describes card money movement details for the payment evaluation. */ + @SerializedName("card") + Card card; + + /** + * 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. Describes the type of money movement. Currently only {@code + * card} is supported. + */ + @SerializedName("money_movement_type") + MoneyMovementType moneyMovementType; + + private MoneyMovementDetails( + Card card, Map extraParams, MoneyMovementType moneyMovementType) { + this.card = card; + this.extraParams = extraParams; + this.moneyMovementType = moneyMovementType; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private Map extraParams; + + private MoneyMovementType moneyMovementType; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails build() { + return new PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails( + this.card, this.extraParams, this.moneyMovementType); + } + + /** Describes card money movement details for the payment evaluation. */ + public Builder setCard( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card card) { + this.card = card; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails#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 + * PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails#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. Describes the type of money movement. Currently only {@code + * card} is supported. + */ + public Builder setMoneyMovementType( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.MoneyMovementType + moneyMovementType) { + this.moneyMovementType = moneyMovementType; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** Describes the presence of the customer during the payment. */ + @SerializedName("customer_presence") + CustomerPresence customerPresence; + + /** + * 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; + + /** Describes the type of payment. */ + @SerializedName("payment_type") + PaymentType paymentType; + + private Card( + CustomerPresence customerPresence, + Map extraParams, + PaymentType paymentType) { + this.customerPresence = customerPresence; + this.extraParams = extraParams; + this.paymentType = paymentType; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CustomerPresence customerPresence; + + private Map extraParams; + + private PaymentType paymentType; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card build() { + return new PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card( + this.customerPresence, this.extraParams, this.paymentType); + } + + /** Describes the presence of the customer during the payment. */ + public Builder setCustomerPresence( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card + .CustomerPresence + customerPresence) { + this.customerPresence = customerPresence; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card#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 + * PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Describes the type of payment. */ + public Builder setPaymentType( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card.PaymentType + paymentType) { + this.paymentType = paymentType; + return this; + } + } + + public enum CustomerPresence implements ApiRequestParams.EnumParam { + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CustomerPresence(String value) { + this.value = value; + } + } + + public enum PaymentType implements ApiRequestParams.EnumParam { + @SerializedName("one_off") + ONE_OFF("one_off"), + + @SerializedName("recurring") + RECURRING("recurring"), + + @SerializedName("setup_one_off") + SETUP_ONE_OFF("setup_one_off"), + + @SerializedName("setup_recurring") + SETUP_RECURRING("setup_recurring"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentType(String value) { + this.value = value; + } + } + } + + public enum MoneyMovementType implements ApiRequestParams.EnumParam { + @SerializedName("card") + CARD("card"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + MoneyMovementType(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodDetails { + /** Billing information associated with the payment evaluation. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** + * 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. ID of the payment method used in this payment evaluation. */ + @SerializedName("payment_method") + String paymentMethod; + + private PaymentMethodDetails( + BillingDetails billingDetails, Map extraParams, String paymentMethod) { + this.billingDetails = billingDetails; + this.extraParams = extraParams; + this.paymentMethod = paymentMethod; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingDetails billingDetails; + + private Map extraParams; + + private String paymentMethod; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails build() { + return new PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails( + this.billingDetails, this.extraParams, this.paymentMethod); + } + + /** Billing information associated with the payment evaluation. */ + public Builder setBillingDetails( + PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails + billingDetails) { + this.billingDetails = billingDetails; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails#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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails#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. ID of the payment method used in this payment evaluation. */ + public Builder setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails { + /** Billing address. */ + @SerializedName("address") + Address address; + + /** Email address. */ + @SerializedName("email") + String email; + + /** + * 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; + + /** Full name. */ + @SerializedName("name") + String name; + + /** Billing phone number (including extension). */ + @SerializedName("phone") + String phone; + + private BillingDetails( + Address address, + String email, + Map extraParams, + String name, + String phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails + build() { + return new PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails + .BillingDetails(this.address, this.email, this.extraParams, this.name, this.phone); + } + + /** Billing address. */ + public Builder setAddress( + PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails + .Address + address) { + this.address = address; + return this; + } + + /** Email address. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails#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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Full name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Billing phone number (including extension). */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * 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; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO 3166-2). + */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails + .Address + build() { + return new PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails + .BillingDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails.Address#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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails.Address#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State, county, province, or region (ISO 3166-2). + */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails { + /** Shipping address. */ + @SerializedName("address") + Address address; + + /** + * 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; + + /** Shipping name. */ + @SerializedName("name") + String name; + + /** Shipping phone number. */ + @SerializedName("phone") + String phone; + + private ShippingDetails( + Address address, Map extraParams, String name, String phone) { + this.address = address; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails build() { + return new PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); + } + + /** Shipping address. */ + public Builder setAddress( + PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address address) { + this.address = address; + 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 PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails#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 PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Shipping name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Shipping phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * 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; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO 3166-2). + */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address build() { + return new PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address#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 + * PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State, county, province, or region (ISO 3166-2). + */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + } +} diff --git a/src/main/java/com/stripe/param/OrderLineItemListParams.java b/src/main/java/com/stripe/param/reserve/HoldListParams.java similarity index 57% rename from src/main/java/com/stripe/param/OrderLineItemListParams.java rename to src/main/java/com/stripe/param/reserve/HoldListParams.java index c9d5f865371..e831310db05 100644 --- a/src/main/java/com/stripe/param/OrderLineItemListParams.java +++ b/src/main/java/com/stripe/param/reserve/HoldListParams.java @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec -package com.stripe.param; +package com.stripe.param.reserve; import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; @@ -12,7 +12,15 @@ @Getter @EqualsAndHashCode(callSuper = false) -public class OrderLineItemListParams extends ApiRequestParams { +public class HoldListParams extends ApiRequestParams { + /** + * Only return ReserveHolds associated with the currency specified by this currency code. + * Three-letter ISO currency code, + * in lowercase. Must be a supported currency. + */ + @SerializedName("currency") + String currency; + /** * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place * in the list. For instance, if you make a list request and receive 100 objects, starting with @@ -35,6 +43,10 @@ public class OrderLineItemListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Only return ReserveHolds that are releasable. */ + @SerializedName("is_releasable") + Boolean isReleasable; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -42,6 +54,24 @@ public class OrderLineItemListParams extends ApiRequestParams { @SerializedName("limit") Long limit; + @SerializedName("reason") + Reason reason; + + /** Only return ReserveHolds associated with the ReservePlan specified by this ReservePlan ID. */ + @SerializedName("reserve_plan") + String reservePlan; + + /** + * Only return ReserveHolds associated with the ReserveRelease specified by this ReserveRelease + * ID. + */ + @SerializedName("reserve_release") + String reserveRelease; + + /** Only return ReserveHolds associated with the Charge specified by this source charge ID. */ + @SerializedName("source_charge") + String sourceCharge; + /** * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place * in the list. For instance, if you make a list request and receive 100 objects, ending with @@ -51,16 +81,28 @@ public class OrderLineItemListParams extends ApiRequestParams { @SerializedName("starting_after") String startingAfter; - private OrderLineItemListParams( + private HoldListParams( + String currency, String endingBefore, List expand, Map extraParams, + Boolean isReleasable, Long limit, + Reason reason, + String reservePlan, + String reserveRelease, + String sourceCharge, String startingAfter) { + this.currency = currency; this.endingBefore = endingBefore; this.expand = expand; this.extraParams = extraParams; + this.isReleasable = isReleasable; this.limit = limit; + this.reason = reason; + this.reservePlan = reservePlan; + this.reserveRelease = reserveRelease; + this.sourceCharge = sourceCharge; this.startingAfter = startingAfter; } @@ -69,20 +111,53 @@ public static Builder builder() { } public static class Builder { + private String currency; + private String endingBefore; private List expand; private Map extraParams; + private Boolean isReleasable; + private Long limit; + private Reason reason; + + private String reservePlan; + + private String reserveRelease; + + private String sourceCharge; + private String startingAfter; /** Finalize and obtain parameter instance from this builder. */ - public OrderLineItemListParams build() { - return new OrderLineItemListParams( - this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); + public HoldListParams build() { + return new HoldListParams( + this.currency, + this.endingBefore, + this.expand, + this.extraParams, + this.isReleasable, + this.limit, + this.reason, + this.reservePlan, + this.reserveRelease, + this.sourceCharge, + this.startingAfter); + } + + /** + * Only return ReserveHolds associated with the currency specified by this currency code. + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; } /** @@ -99,7 +174,7 @@ public Builder setEndingBefore(String endingBefore) { /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link - * OrderLineItemListParams#expand} for the field documentation. + * HoldListParams#expand} for the field documentation. */ public Builder addExpand(String element) { if (this.expand == null) { @@ -112,7 +187,7 @@ public Builder addExpand(String element) { /** * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link - * OrderLineItemListParams#expand} for the field documentation. + * HoldListParams#expand} for the field documentation. */ public Builder addAllExpand(List elements) { if (this.expand == null) { @@ -125,7 +200,7 @@ public Builder addAllExpand(List elements) { /** * 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 - * OrderLineItemListParams#extraParams} for the field documentation. + * HoldListParams#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -138,7 +213,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 OrderLineItemListParams#extraParams} for the field documentation. + * See {@link HoldListParams#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -148,6 +223,12 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Only return ReserveHolds that are releasable. */ + public Builder setIsReleasable(Boolean isReleasable) { + this.isReleasable = isReleasable; + return this; + } + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. @@ -157,6 +238,34 @@ public Builder setLimit(Long limit) { return this; } + public Builder setReason(HoldListParams.Reason reason) { + this.reason = reason; + return this; + } + + /** + * Only return ReserveHolds associated with the ReservePlan specified by this ReservePlan ID. + */ + public Builder setReservePlan(String reservePlan) { + this.reservePlan = reservePlan; + return this; + } + + /** + * Only return ReserveHolds associated with the ReserveRelease specified by this ReserveRelease + * ID. + */ + public Builder setReserveRelease(String reserveRelease) { + this.reserveRelease = reserveRelease; + return this; + } + + /** Only return ReserveHolds associated with the Charge specified by this source charge ID. */ + public Builder setSourceCharge(String sourceCharge) { + this.sourceCharge = sourceCharge; + return this; + } + /** * A cursor for use in pagination. {@code starting_after} is an object ID that defines your * place in the list. For instance, if you make a list request and receive 100 objects, ending @@ -168,4 +277,19 @@ public Builder setStartingAfter(String startingAfter) { return this; } } + + public enum Reason implements ApiRequestParams.EnumParam { + @SerializedName("charge") + CHARGE("charge"), + + @SerializedName("standalone") + STANDALONE("standalone"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Reason(String value) { + this.value = value; + } + } } diff --git a/src/main/java/com/stripe/param/OrderCancelParams.java b/src/main/java/com/stripe/param/reserve/HoldRetrieveParams.java similarity index 83% rename from src/main/java/com/stripe/param/OrderCancelParams.java rename to src/main/java/com/stripe/param/reserve/HoldRetrieveParams.java index 8b4f21eae19..f98efd825e2 100644 --- a/src/main/java/com/stripe/param/OrderCancelParams.java +++ b/src/main/java/com/stripe/param/reserve/HoldRetrieveParams.java @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec -package com.stripe.param; +package com.stripe.param.reserve; import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; @@ -12,7 +12,7 @@ @Getter @EqualsAndHashCode(callSuper = false) -public class OrderCancelParams extends ApiRequestParams { +public class HoldRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -26,7 +26,7 @@ public class OrderCancelParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private OrderCancelParams(List expand, Map extraParams) { + private HoldRetrieveParams(List expand, Map extraParams) { this.expand = expand; this.extraParams = extraParams; } @@ -41,14 +41,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public OrderCancelParams build() { - return new OrderCancelParams(this.expand, this.extraParams); + public HoldRetrieveParams build() { + return new HoldRetrieveParams(this.expand, this.extraParams); } /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link - * OrderCancelParams#expand} for the field documentation. + * HoldRetrieveParams#expand} for the field documentation. */ public Builder addExpand(String element) { if (this.expand == null) { @@ -61,7 +61,7 @@ public Builder addExpand(String element) { /** * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link - * OrderCancelParams#expand} for the field documentation. + * HoldRetrieveParams#expand} for the field documentation. */ public Builder addAllExpand(List elements) { if (this.expand == null) { @@ -74,7 +74,7 @@ public Builder addAllExpand(List elements) { /** * 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 - * OrderCancelParams#extraParams} for the field documentation. + * HoldRetrieveParams#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -87,7 +87,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 OrderCancelParams#extraParams} for the field documentation. + * See {@link HoldRetrieveParams#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { diff --git a/src/main/java/com/stripe/param/OrderReopenParams.java b/src/main/java/com/stripe/param/reserve/PlanRetrieveParams.java similarity index 83% rename from src/main/java/com/stripe/param/OrderReopenParams.java rename to src/main/java/com/stripe/param/reserve/PlanRetrieveParams.java index 73cdbc8605d..12fb1d499fe 100644 --- a/src/main/java/com/stripe/param/OrderReopenParams.java +++ b/src/main/java/com/stripe/param/reserve/PlanRetrieveParams.java @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec -package com.stripe.param; +package com.stripe.param.reserve; import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; @@ -12,7 +12,7 @@ @Getter @EqualsAndHashCode(callSuper = false) -public class OrderReopenParams extends ApiRequestParams { +public class PlanRetrieveParams extends ApiRequestParams { /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -26,7 +26,7 @@ public class OrderReopenParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private OrderReopenParams(List expand, Map extraParams) { + private PlanRetrieveParams(List expand, Map extraParams) { this.expand = expand; this.extraParams = extraParams; } @@ -41,14 +41,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public OrderReopenParams build() { - return new OrderReopenParams(this.expand, this.extraParams); + public PlanRetrieveParams build() { + return new PlanRetrieveParams(this.expand, this.extraParams); } /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link - * OrderReopenParams#expand} for the field documentation. + * PlanRetrieveParams#expand} for the field documentation. */ public Builder addExpand(String element) { if (this.expand == null) { @@ -61,7 +61,7 @@ public Builder addExpand(String element) { /** * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link - * OrderReopenParams#expand} for the field documentation. + * PlanRetrieveParams#expand} for the field documentation. */ public Builder addAllExpand(List elements) { if (this.expand == null) { @@ -74,7 +74,7 @@ public Builder addAllExpand(List elements) { /** * 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 - * OrderReopenParams#extraParams} for the field documentation. + * PlanRetrieveParams#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -87,7 +87,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 OrderReopenParams#extraParams} for the field documentation. + * See {@link PlanRetrieveParams#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { diff --git a/src/main/java/com/stripe/param/OrderListLineItemsParams.java b/src/main/java/com/stripe/param/reserve/ReleaseListParams.java similarity index 67% rename from src/main/java/com/stripe/param/OrderListLineItemsParams.java rename to src/main/java/com/stripe/param/reserve/ReleaseListParams.java index f71a81ce907..c07dca1d1bf 100644 --- a/src/main/java/com/stripe/param/OrderListLineItemsParams.java +++ b/src/main/java/com/stripe/param/reserve/ReleaseListParams.java @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec -package com.stripe.param; +package com.stripe.param.reserve; import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; @@ -12,7 +12,15 @@ @Getter @EqualsAndHashCode(callSuper = false) -public class OrderListLineItemsParams extends ApiRequestParams { +public class ReleaseListParams extends ApiRequestParams { + /** + * Only return ReserveReleases associated with the currency specified by this currency code. + * Three-letter ISO currency code, + * in lowercase. Must be a supported currency. + */ + @SerializedName("currency") + String currency; + /** * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place * in the list. For instance, if you make a list request and receive 100 objects, starting with @@ -42,6 +50,18 @@ public class OrderListLineItemsParams extends ApiRequestParams { @SerializedName("limit") Long limit; + /** + * Only return ReserveReleases associated with the ReserveHold specified by this ReserveHold ID. + */ + @SerializedName("reserve_hold") + String reserveHold; + + /** + * Only return ReserveReleases associated with the ReservePlan specified by this ReservePlan ID. + */ + @SerializedName("reserve_plan") + String reservePlan; + /** * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place * in the list. For instance, if you make a list request and receive 100 objects, ending with @@ -51,16 +71,22 @@ public class OrderListLineItemsParams extends ApiRequestParams { @SerializedName("starting_after") String startingAfter; - private OrderListLineItemsParams( + private ReleaseListParams( + String currency, String endingBefore, List expand, Map extraParams, Long limit, + String reserveHold, + String reservePlan, String startingAfter) { + this.currency = currency; this.endingBefore = endingBefore; this.expand = expand; this.extraParams = extraParams; this.limit = limit; + this.reserveHold = reserveHold; + this.reservePlan = reservePlan; this.startingAfter = startingAfter; } @@ -69,6 +95,8 @@ public static Builder builder() { } public static class Builder { + private String currency; + private String endingBefore; private List expand; @@ -77,12 +105,34 @@ public static class Builder { private Long limit; + private String reserveHold; + + private String reservePlan; + private String startingAfter; /** Finalize and obtain parameter instance from this builder. */ - public OrderListLineItemsParams build() { - return new OrderListLineItemsParams( - this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); + public ReleaseListParams build() { + return new ReleaseListParams( + this.currency, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.reserveHold, + this.reservePlan, + this.startingAfter); + } + + /** + * Only return ReserveReleases associated with the currency specified by this currency code. + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; } /** @@ -99,7 +149,7 @@ public Builder setEndingBefore(String endingBefore) { /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link - * OrderListLineItemsParams#expand} for the field documentation. + * ReleaseListParams#expand} for the field documentation. */ public Builder addExpand(String element) { if (this.expand == null) { @@ -112,7 +162,7 @@ public Builder addExpand(String element) { /** * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link - * OrderListLineItemsParams#expand} for the field documentation. + * ReleaseListParams#expand} for the field documentation. */ public Builder addAllExpand(List elements) { if (this.expand == null) { @@ -125,7 +175,7 @@ public Builder addAllExpand(List elements) { /** * 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 - * OrderListLineItemsParams#extraParams} for the field documentation. + * ReleaseListParams#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -138,7 +188,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 OrderListLineItemsParams#extraParams} for the field documentation. + * See {@link ReleaseListParams#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -157,6 +207,22 @@ public Builder setLimit(Long limit) { return this; } + /** + * Only return ReserveReleases associated with the ReserveHold specified by this ReserveHold ID. + */ + public Builder setReserveHold(String reserveHold) { + this.reserveHold = reserveHold; + return this; + } + + /** + * Only return ReserveReleases associated with the ReservePlan specified by this ReservePlan ID. + */ + public Builder setReservePlan(String reservePlan) { + this.reservePlan = reservePlan; + return this; + } + /** * A cursor for use in pagination. {@code starting_after} is an object ID that defines your * place in the list. For instance, if you make a list request and receive 100 objects, ending diff --git a/src/main/java/com/stripe/param/reserve/ReleaseRetrieveParams.java b/src/main/java/com/stripe/param/reserve/ReleaseRetrieveParams.java new file mode 100644 index 00000000000..0683cf1866f --- /dev/null +++ b/src/main/java/com/stripe/param/reserve/ReleaseRetrieveParams.java @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec +package com.stripe.param.reserve; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class ReleaseRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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 ReleaseRetrieveParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public ReleaseRetrieveParams build() { + return new ReleaseRetrieveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * ReleaseRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * ReleaseRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * ReleaseRetrieveParams#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 ReleaseRetrieveParams#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/tax/CalculationCreateParams.java b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java index 10c7a4675c7..5ae040855bc 100644 --- a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java @@ -646,11 +646,12 @@ public static class TaxId { * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code - * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, - * {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code - * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, - * {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code + * sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, + * {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code + * tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, + * {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code + * zw_tin} */ @SerializedName("type") Type type; @@ -727,12 +728,12 @@ public Builder putAllExtraParam(Map map) { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code * mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, * {@code no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code - * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, - * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code - * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code - * uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code - * zw_tin} + * ph_tin}, {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, + * {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code + * sr_fin}, {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code + * uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, + * or {@code zw_tin} */ public Builder setType(CalculationCreateParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -996,6 +997,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java index 0b790b5f102..f7814abbb0b 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java @@ -55,7 +55,7 @@ public class ConfigurationCreateParams extends ApiRequestParams { @SerializedName("stripe_s700") StripeS700 stripeS700; - /** Tipping configurations for readers. supporting on-reader tips */ + /** Tipping configurations for readers that support on-reader tips. */ @SerializedName("tipping") Object tipping; @@ -246,13 +246,13 @@ public Builder setStripeS700(ConfigurationCreateParams.StripeS700 stripeS700) { return this; } - /** Tipping configurations for readers. supporting on-reader tips */ + /** Tipping configurations for readers that support on-reader tips. */ public Builder setTipping(ConfigurationCreateParams.Tipping tipping) { this.tipping = tipping; return this; } - /** Tipping configurations for readers. supporting on-reader tips */ + /** Tipping configurations for readers that support on-reader tips. */ public Builder setTipping(EmptyParam tipping) { this.tipping = tipping; return this; @@ -762,10 +762,6 @@ public static class Tipping { @SerializedName("aud") Aud aud; - /** Tipping configuration for BGN. */ - @SerializedName("bgn") - Bgn bgn; - /** Tipping configuration for CAD. */ @SerializedName("cad") Cad cad; @@ -854,7 +850,6 @@ public static class Tipping { private Tipping( Aed aed, Aud aud, - Bgn bgn, Cad cad, Chf chf, Czk czk, @@ -877,7 +872,6 @@ private Tipping( Usd usd) { this.aed = aed; this.aud = aud; - this.bgn = bgn; this.cad = cad; this.chf = chf; this.czk = czk; @@ -909,8 +903,6 @@ public static class Builder { private Aud aud; - private Bgn bgn; - private Cad cad; private Chf chf; @@ -956,7 +948,6 @@ public ConfigurationCreateParams.Tipping build() { return new ConfigurationCreateParams.Tipping( this.aed, this.aud, - this.bgn, this.cad, this.chf, this.czk, @@ -991,12 +982,6 @@ public Builder setAud(ConfigurationCreateParams.Tipping.Aud aud) { return this; } - /** Tipping configuration for BGN. */ - public Builder setBgn(ConfigurationCreateParams.Tipping.Bgn bgn) { - this.bgn = bgn; - return this; - } - /** Tipping configuration for CAD. */ public Builder setCad(ConfigurationCreateParams.Tipping.Cad cad) { this.cad = cad; @@ -1434,154 +1419,6 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Bgn { - /** - * 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; - - /** Fixed amounts displayed when collecting a tip. */ - @SerializedName("fixed_amounts") - List fixedAmounts; - - /** Percentages displayed when collecting a tip. */ - @SerializedName("percentages") - List percentages; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - @SerializedName("smart_tip_threshold") - Long smartTipThreshold; - - private Bgn( - Map extraParams, - List fixedAmounts, - List percentages, - Long smartTipThreshold) { - this.extraParams = extraParams; - this.fixedAmounts = fixedAmounts; - this.percentages = percentages; - this.smartTipThreshold = smartTipThreshold; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Map extraParams; - - private List fixedAmounts; - - private List percentages; - - private Long smartTipThreshold; - - /** Finalize and obtain parameter instance from this builder. */ - public ConfigurationCreateParams.Tipping.Bgn build() { - return new ConfigurationCreateParams.Tipping.Bgn( - this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); - } - - /** - * 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 ConfigurationCreateParams.Tipping.Bgn#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 ConfigurationCreateParams.Tipping.Bgn#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 an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationCreateParams.Tipping.Bgn#fixedAmounts} for the field documentation. - */ - public Builder addFixedAmount(Long element) { - if (this.fixedAmounts == null) { - this.fixedAmounts = new ArrayList<>(); - } - this.fixedAmounts.add(element); - return this; - } - - /** - * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationCreateParams.Tipping.Bgn#fixedAmounts} for the field documentation. - */ - public Builder addAllFixedAmount(List elements) { - if (this.fixedAmounts == null) { - this.fixedAmounts = new ArrayList<>(); - } - this.fixedAmounts.addAll(elements); - return this; - } - - /** - * Add an element to `percentages` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationCreateParams.Tipping.Bgn#percentages} for the field documentation. - */ - public Builder addPercentage(Long element) { - if (this.percentages == null) { - this.percentages = new ArrayList<>(); - } - this.percentages.add(element); - return this; - } - - /** - * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationCreateParams.Tipping.Bgn#percentages} for the field documentation. - */ - public Builder addAllPercentage(List elements) { - if (this.percentages == null) { - this.percentages = new ArrayList<>(); - } - this.percentages.addAll(elements); - return this; - } - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - public Builder setSmartTipThreshold(Long smartTipThreshold) { - this.smartTipThreshold = smartTipThreshold; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class Cad { diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java index 3399efa11bc..663ad29ee29 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java @@ -798,10 +798,6 @@ public static class Tipping { @SerializedName("aud") Aud aud; - /** Tipping configuration for BGN. */ - @SerializedName("bgn") - Bgn bgn; - /** Tipping configuration for CAD. */ @SerializedName("cad") Cad cad; @@ -890,7 +886,6 @@ public static class Tipping { private Tipping( Aed aed, Aud aud, - Bgn bgn, Cad cad, Chf chf, Czk czk, @@ -913,7 +908,6 @@ private Tipping( Usd usd) { this.aed = aed; this.aud = aud; - this.bgn = bgn; this.cad = cad; this.chf = chf; this.czk = czk; @@ -945,8 +939,6 @@ public static class Builder { private Aud aud; - private Bgn bgn; - private Cad cad; private Chf chf; @@ -992,7 +984,6 @@ public ConfigurationUpdateParams.Tipping build() { return new ConfigurationUpdateParams.Tipping( this.aed, this.aud, - this.bgn, this.cad, this.chf, this.czk, @@ -1027,12 +1018,6 @@ public Builder setAud(ConfigurationUpdateParams.Tipping.Aud aud) { return this; } - /** Tipping configuration for BGN. */ - public Builder setBgn(ConfigurationUpdateParams.Tipping.Bgn bgn) { - this.bgn = bgn; - return this; - } - /** Tipping configuration for CAD. */ public Builder setCad(ConfigurationUpdateParams.Tipping.Cad cad) { this.cad = cad; @@ -1470,154 +1455,6 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Bgn { - /** - * 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; - - /** Fixed amounts displayed when collecting a tip. */ - @SerializedName("fixed_amounts") - List fixedAmounts; - - /** Percentages displayed when collecting a tip. */ - @SerializedName("percentages") - List percentages; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - @SerializedName("smart_tip_threshold") - Long smartTipThreshold; - - private Bgn( - Map extraParams, - List fixedAmounts, - List percentages, - Long smartTipThreshold) { - this.extraParams = extraParams; - this.fixedAmounts = fixedAmounts; - this.percentages = percentages; - this.smartTipThreshold = smartTipThreshold; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Map extraParams; - - private List fixedAmounts; - - private List percentages; - - private Long smartTipThreshold; - - /** Finalize and obtain parameter instance from this builder. */ - public ConfigurationUpdateParams.Tipping.Bgn build() { - return new ConfigurationUpdateParams.Tipping.Bgn( - this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); - } - - /** - * 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 ConfigurationUpdateParams.Tipping.Bgn#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 ConfigurationUpdateParams.Tipping.Bgn#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 an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationUpdateParams.Tipping.Bgn#fixedAmounts} for the field documentation. - */ - public Builder addFixedAmount(Long element) { - if (this.fixedAmounts == null) { - this.fixedAmounts = new ArrayList<>(); - } - this.fixedAmounts.add(element); - return this; - } - - /** - * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationUpdateParams.Tipping.Bgn#fixedAmounts} for the field documentation. - */ - public Builder addAllFixedAmount(List elements) { - if (this.fixedAmounts == null) { - this.fixedAmounts = new ArrayList<>(); - } - this.fixedAmounts.addAll(elements); - return this; - } - - /** - * Add an element to `percentages` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationUpdateParams.Tipping.Bgn#percentages} for the field documentation. - */ - public Builder addPercentage(Long element) { - if (this.percentages == null) { - this.percentages = new ArrayList<>(); - } - this.percentages.add(element); - return this; - } - - /** - * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationUpdateParams.Tipping.Bgn#percentages} for the field documentation. - */ - public Builder addAllPercentage(List elements) { - if (this.percentages == null) { - this.percentages = new ArrayList<>(); - } - this.percentages.addAll(elements); - return this; - } - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - public Builder setSmartTipThreshold(Long smartTipThreshold) { - this.smartTipThreshold = smartTipThreshold; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class Cad { diff --git a/src/main/java/com/stripe/service/CustomerService.java b/src/main/java/com/stripe/service/CustomerService.java index f9f899556bd..6d71cc14460 100644 --- a/src/main/java/com/stripe/service/CustomerService.java +++ b/src/main/java/com/stripe/service/CustomerService.java @@ -69,14 +69,14 @@ public Customer retrieve(String customer, CustomerRetrieveParams params, Request } /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -86,14 +86,14 @@ public Customer update(String customer, CustomerUpdateParams params) throws Stri } /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -103,14 +103,14 @@ public Customer update(String customer, RequestOptions options) throws StripeExc } /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -120,14 +120,14 @@ public Customer update(String customer) throws StripeException { } /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. diff --git a/src/main/java/com/stripe/service/FinancialConnectionsService.java b/src/main/java/com/stripe/service/FinancialConnectionsService.java index 5b72c9d2ba5..6b16bbc9ef3 100644 --- a/src/main/java/com/stripe/service/FinancialConnectionsService.java +++ b/src/main/java/com/stripe/service/FinancialConnectionsService.java @@ -13,6 +13,11 @@ public com.stripe.service.financialconnections.AccountService accounts() { return new com.stripe.service.financialconnections.AccountService(this.getResponseGetter()); } + public com.stripe.service.financialconnections.AuthorizationService authorizations() { + return new com.stripe.service.financialconnections.AuthorizationService( + this.getResponseGetter()); + } + public com.stripe.service.financialconnections.InstitutionService institutions() { return new com.stripe.service.financialconnections.InstitutionService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/InvoiceService.java b/src/main/java/com/stripe/service/InvoiceService.java index 30efc494903..867d25a3d6e 100644 --- a/src/main/java/com/stripe/service/InvoiceService.java +++ b/src/main/java/com/stripe/service/InvoiceService.java @@ -17,6 +17,7 @@ import com.stripe.param.InvoiceAttachPaymentParams; import com.stripe.param.InvoiceCreateParams; import com.stripe.param.InvoiceCreatePreviewParams; +import com.stripe.param.InvoiceDetachPaymentParams; import com.stripe.param.InvoiceFinalizeInvoiceParams; import com.stripe.param.InvoiceListParams; import com.stripe.param.InvoiceMarkUncollectibleParams; @@ -181,8 +182,8 @@ public StripeCollection list(InvoiceListParams params, RequestOptions o /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public Invoice create(InvoiceCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -190,8 +191,8 @@ public Invoice create(InvoiceCreateParams params) throws StripeException { /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public Invoice create(RequestOptions options) throws StripeException { return create((InvoiceCreateParams) null, options); @@ -199,8 +200,8 @@ public Invoice create(RequestOptions options) throws StripeException { /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public Invoice create() throws StripeException { return create((InvoiceCreateParams) null, (RequestOptions) null); @@ -208,8 +209,8 @@ public Invoice create() throws StripeException { /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException { String path = "/v1/invoices"; @@ -353,6 +354,33 @@ public Invoice attachPayment( options); return this.request(request, Invoice.class); } + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment(String invoice, InvoiceDetachPaymentParams params) + throws StripeException { + return detachPayment(invoice, params, (RequestOptions) null); + } + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment(String invoice, RequestOptions options) throws StripeException { + return detachPayment(invoice, (InvoiceDetachPaymentParams) null, options); + } + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment(String invoice) throws StripeException { + return detachPayment(invoice, (InvoiceDetachPaymentParams) null, (RequestOptions) null); + } + /** Detaches a payment from the invoice, removing it from the list of {@code payments}. */ + public Invoice detachPayment( + String invoice, InvoiceDetachPaymentParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/invoices/%s/detach_payment", ApiResource.urlEncodeId(invoice)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Invoice.class); + } /** * Stripe automatically finalizes drafts before sending and attempting payment on invoices. * However, if you’d like to finalize a draft invoice manually, you can do so using this method. diff --git a/src/main/java/com/stripe/service/OrderLineItemService.java b/src/main/java/com/stripe/service/OrderLineItemService.java deleted file mode 100644 index b0c68b7b229..00000000000 --- a/src/main/java/com/stripe/service/OrderLineItemService.java +++ /dev/null @@ -1,64 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.service; - -import com.google.gson.reflect.TypeToken; -import com.stripe.exception.StripeException; -import com.stripe.model.LineItem; -import com.stripe.model.StripeCollection; -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.OrderLineItemListParams; - -public final class OrderLineItemService extends ApiService { - public OrderLineItemService(StripeResponseGetter responseGetter) { - super(responseGetter); - } - - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public StripeCollection list(String id, OrderLineItemListParams params) - throws StripeException { - return list(id, params, (RequestOptions) null); - } - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public StripeCollection list(String id, RequestOptions options) throws StripeException { - return list(id, (OrderLineItemListParams) null, options); - } - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public StripeCollection list(String id) throws StripeException { - return list(id, (OrderLineItemListParams) null, (RequestOptions) null); - } - /** - * When retrieving an order, there is an includable line_items property - * containing the first handful of those items. There is also a URL where you can retrieve the - * full (paginated) list of line items. - */ - public StripeCollection list( - String id, OrderLineItemListParams params, RequestOptions options) throws StripeException { - String path = String.format("/v1/orders/%s/line_items", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - path, - ApiRequestParams.paramsToMap(params), - options); - return this.request(request, new TypeToken>() {}.getType()); - } -} diff --git a/src/main/java/com/stripe/service/OrderService.java b/src/main/java/com/stripe/service/OrderService.java index 4d1504f999b..b4a52679837 100644 --- a/src/main/java/com/stripe/service/OrderService.java +++ b/src/main/java/com/stripe/service/OrderService.java @@ -12,10 +12,8 @@ import com.stripe.net.BaseAddress; import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; -import com.stripe.param.OrderCancelParams; import com.stripe.param.OrderCreateParams; import com.stripe.param.OrderListParams; -import com.stripe.param.OrderReopenParams; import com.stripe.param.OrderRetrieveParams; import com.stripe.param.OrderSubmitParams; import com.stripe.param.OrderUpdateParams; @@ -152,56 +150,6 @@ public Order update(String id, OrderUpdateParams params, RequestOptions options) options); return this.request(request, Order.class); } - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(String id, OrderCancelParams params) throws StripeException { - return cancel(id, params, (RequestOptions) null); - } - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(String id, RequestOptions options) throws StripeException { - return cancel(id, (OrderCancelParams) null, options); - } - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(String id) throws StripeException { - return cancel(id, (OrderCancelParams) null, (RequestOptions) null); - } - /** Cancels the order as well as the payment intent if one is attached. */ - public Order cancel(String id, OrderCancelParams params, RequestOptions options) - throws StripeException { - String path = String.format("/v1/orders/%s/cancel", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - path, - ApiRequestParams.paramsToMap(params), - options); - return this.request(request, Order.class); - } - /** Reopens a {@code submitted} order. */ - public Order reopen(String id, OrderReopenParams params) throws StripeException { - return reopen(id, params, (RequestOptions) null); - } - /** Reopens a {@code submitted} order. */ - public Order reopen(String id, RequestOptions options) throws StripeException { - return reopen(id, (OrderReopenParams) null, options); - } - /** Reopens a {@code submitted} order. */ - public Order reopen(String id) throws StripeException { - return reopen(id, (OrderReopenParams) null, (RequestOptions) null); - } - /** Reopens a {@code submitted} order. */ - public Order reopen(String id, OrderReopenParams params, RequestOptions options) - throws StripeException { - String path = String.format("/v1/orders/%s/reopen", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - path, - ApiRequestParams.paramsToMap(params), - options); - return this.request(request, Order.class); - } /** * Submitting an Order transitions the status to {@code processing} and creates a PaymentIntent * object so the order can be paid. If the Order has an {@code amount_total} of 0, no @@ -231,8 +179,4 @@ public Order submit(String id, OrderSubmitParams params, RequestOptions options) options); return this.request(request, Order.class); } - - public com.stripe.service.OrderLineItemService lineItems() { - return new com.stripe.service.OrderLineItemService(this.getResponseGetter()); - } } diff --git a/src/main/java/com/stripe/service/RadarService.java b/src/main/java/com/stripe/service/RadarService.java index 7d8167482f4..21a1596c52e 100644 --- a/src/main/java/com/stripe/service/RadarService.java +++ b/src/main/java/com/stripe/service/RadarService.java @@ -17,6 +17,10 @@ public com.stripe.service.radar.EarlyFraudWarningService earlyFraudWarnings() { return new com.stripe.service.radar.EarlyFraudWarningService(this.getResponseGetter()); } + public com.stripe.service.radar.PaymentEvaluationService paymentEvaluations() { + return new com.stripe.service.radar.PaymentEvaluationService(this.getResponseGetter()); + } + public com.stripe.service.radar.ValueListItemService valueListItems() { return new com.stripe.service.radar.ValueListItemService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/ReserveService.java b/src/main/java/com/stripe/service/ReserveService.java new file mode 100644 index 00000000000..aa4fa7de8a1 --- /dev/null +++ b/src/main/java/com/stripe/service/ReserveService.java @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.stripe.net.ApiService; +import com.stripe.net.StripeResponseGetter; + +public final class ReserveService extends ApiService { + public ReserveService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + public com.stripe.service.reserve.HoldService holds() { + return new com.stripe.service.reserve.HoldService(this.getResponseGetter()); + } + + public com.stripe.service.reserve.PlanService plans() { + return new com.stripe.service.reserve.PlanService(this.getResponseGetter()); + } + + public com.stripe.service.reserve.ReleaseService releases() { + return new com.stripe.service.reserve.ReleaseService(this.getResponseGetter()); + } +} diff --git a/src/main/java/com/stripe/service/SubscriptionService.java b/src/main/java/com/stripe/service/SubscriptionService.java index 8ddcf9cc3a9..1613c3ae1a4 100644 --- a/src/main/java/com/stripe/service/SubscriptionService.java +++ b/src/main/java/com/stripe/service/SubscriptionService.java @@ -19,6 +19,7 @@ import com.stripe.param.SubscriptionCreateParams; import com.stripe.param.SubscriptionListParams; import com.stripe.param.SubscriptionMigrateParams; +import com.stripe.param.SubscriptionPauseParams; import com.stripe.param.SubscriptionResumeParams; import com.stripe.param.SubscriptionRetrieveParams; import com.stripe.param.SubscriptionSearchParams; @@ -581,6 +582,34 @@ public Subscription migrate( options); return this.request(request, Subscription.class); } + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause(String subscription, SubscriptionPauseParams params) + throws StripeException { + return pause(subscription, params, (RequestOptions) null); + } + /** + * Pauses a subscription by transitioning it to the paused status. A paused subscription does not + * generate invoices and will not advance to new billing periods. The subscription can be resumed + * later using the resume endpoint. Cannot pause subscriptions with attached schedules. + */ + public Subscription pause( + String subscription, SubscriptionPauseParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/pause", ApiResource.urlEncodeId(subscription)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Subscription.class); + } /** * Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor * and creating prorations. If a resumption invoice is generated, it must be paid or marked diff --git a/src/main/java/com/stripe/service/V1Services.java b/src/main/java/com/stripe/service/V1Services.java index b4e6baa77a5..063fd4a1c12 100644 --- a/src/main/java/com/stripe/service/V1Services.java +++ b/src/main/java/com/stripe/service/V1Services.java @@ -261,6 +261,10 @@ public com.stripe.service.ReportingService reporting() { return new com.stripe.service.ReportingService(this.getResponseGetter()); } + public com.stripe.service.ReserveService reserve() { + return new com.stripe.service.ReserveService(this.getResponseGetter()); + } + public com.stripe.service.ReviewService reviews() { return new com.stripe.service.ReviewService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/checkout/SessionService.java b/src/main/java/com/stripe/service/checkout/SessionService.java index 1fd61f54801..b5a1799a1f1 100644 --- a/src/main/java/com/stripe/service/checkout/SessionService.java +++ b/src/main/java/com/stripe/service/checkout/SessionService.java @@ -100,8 +100,8 @@ public Session retrieve(String session, SessionRetrieveParams params, RequestOpt /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(String session, SessionUpdateParams params) throws StripeException { return update(session, params, (RequestOptions) null); @@ -109,8 +109,8 @@ public Session update(String session, SessionUpdateParams params) throws StripeE /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(String session, RequestOptions options) throws StripeException { return update(session, (SessionUpdateParams) null, options); @@ -118,8 +118,8 @@ public Session update(String session, RequestOptions options) throws StripeExcep /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(String session) throws StripeException { return update(session, (SessionUpdateParams) null, (RequestOptions) null); @@ -127,8 +127,8 @@ public Session update(String session) throws StripeException { /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(String session, SessionUpdateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/service/financialconnections/AuthorizationService.java b/src/main/java/com/stripe/service/financialconnections/AuthorizationService.java new file mode 100644 index 00000000000..cf268e0b25f --- /dev/null +++ b/src/main/java/com/stripe/service/financialconnections/AuthorizationService.java @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec +package com.stripe.service.financialconnections; + +import com.stripe.exception.StripeException; +import com.stripe.model.financialconnections.Authorization; +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.financialconnections.AuthorizationRetrieveParams; + +public final class AuthorizationService extends ApiService { + public AuthorizationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieves the details of an Financial Connections {@code Authorization}. */ + public Authorization retrieve(String authorization, AuthorizationRetrieveParams params) + throws StripeException { + return retrieve(authorization, params, (RequestOptions) null); + } + /** Retrieves the details of an Financial Connections {@code Authorization}. */ + public Authorization retrieve(String authorization, RequestOptions options) + throws StripeException { + return retrieve(authorization, (AuthorizationRetrieveParams) null, options); + } + /** Retrieves the details of an Financial Connections {@code Authorization}. */ + public Authorization retrieve(String authorization) throws StripeException { + return retrieve(authorization, (AuthorizationRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves the details of an Financial Connections {@code Authorization}. */ + public Authorization retrieve( + String authorization, AuthorizationRetrieveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/financial_connections/authorizations/%s", ApiResource.urlEncodeId(authorization)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Authorization.class); + } +} diff --git a/src/main/java/com/stripe/service/radar/PaymentEvaluationService.java b/src/main/java/com/stripe/service/radar/PaymentEvaluationService.java new file mode 100644 index 00000000000..44a70e5f163 --- /dev/null +++ b/src/main/java/com/stripe/service/radar/PaymentEvaluationService.java @@ -0,0 +1,43 @@ +// File generated from our OpenAPI spec +package com.stripe.service.radar; + +import com.stripe.exception.StripeException; +import com.stripe.model.radar.PaymentEvaluation; +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.radar.PaymentEvaluationCreateParams; + +public final class PaymentEvaluationService extends ApiService { + public PaymentEvaluationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public PaymentEvaluation create(PaymentEvaluationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public PaymentEvaluation create(PaymentEvaluationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/radar/payment_evaluations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentEvaluation.class); + } +} diff --git a/src/main/java/com/stripe/service/reserve/HoldService.java b/src/main/java/com/stripe/service/reserve/HoldService.java new file mode 100644 index 00000000000..bb8c972f510 --- /dev/null +++ b/src/main/java/com/stripe/service/reserve/HoldService.java @@ -0,0 +1,85 @@ +// File generated from our OpenAPI spec +package com.stripe.service.reserve; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeCollection; +import com.stripe.model.reserve.Hold; +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.reserve.HoldListParams; +import com.stripe.param.reserve.HoldRetrieveParams; + +public final class HoldService extends ApiService { + public HoldService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted + * order, with the most recent ReserveHolds appearing first. + */ + public StripeCollection list(HoldListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted + * order, with the most recent ReserveHolds appearing first. + */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((HoldListParams) null, options); + } + /** + * Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted + * order, with the most recent ReserveHolds appearing first. + */ + public StripeCollection list() throws StripeException { + return list((HoldListParams) null, (RequestOptions) null); + } + /** + * Returns a list of ReserveHolds previously created. The ReserveHolds are returned in sorted + * order, with the most recent ReserveHolds appearing first. + */ + public StripeCollection list(HoldListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/reserve/holds"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } + /** Retrieve a ReserveHold. */ + public Hold retrieve(String id, HoldRetrieveParams params) throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieve a ReserveHold. */ + public Hold retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (HoldRetrieveParams) null, options); + } + /** Retrieve a ReserveHold. */ + public Hold retrieve(String id) throws StripeException { + return retrieve(id, (HoldRetrieveParams) null, (RequestOptions) null); + } + /** Retrieve a ReserveHold. */ + public Hold retrieve(String id, HoldRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/holds/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Hold.class); + } +} diff --git a/src/main/java/com/stripe/service/reserve/PlanService.java b/src/main/java/com/stripe/service/reserve/PlanService.java new file mode 100644 index 00000000000..faf5b61eac8 --- /dev/null +++ b/src/main/java/com/stripe/service/reserve/PlanService.java @@ -0,0 +1,45 @@ +// File generated from our OpenAPI spec +package com.stripe.service.reserve; + +import com.stripe.exception.StripeException; +import com.stripe.model.reserve.Plan; +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.reserve.PlanRetrieveParams; + +public final class PlanService extends ApiService { + public PlanService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieve a ReservePlan. */ + public Plan retrieve(String id, PlanRetrieveParams params) throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieve a ReservePlan. */ + public Plan retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (PlanRetrieveParams) null, options); + } + /** Retrieve a ReservePlan. */ + public Plan retrieve(String id) throws StripeException { + return retrieve(id, (PlanRetrieveParams) null, (RequestOptions) null); + } + /** Retrieve a ReservePlan. */ + public Plan retrieve(String id, PlanRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/plans/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Plan.class); + } +} diff --git a/src/main/java/com/stripe/service/reserve/ReleaseService.java b/src/main/java/com/stripe/service/reserve/ReleaseService.java new file mode 100644 index 00000000000..4c1f38347a4 --- /dev/null +++ b/src/main/java/com/stripe/service/reserve/ReleaseService.java @@ -0,0 +1,85 @@ +// File generated from our OpenAPI spec +package com.stripe.service.reserve; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeCollection; +import com.stripe.model.reserve.Release; +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.reserve.ReleaseListParams; +import com.stripe.param.reserve.ReleaseRetrieveParams; + +public final class ReleaseService extends ApiService { + public ReleaseService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Returns a list of ReserveReleases previously created. The ReserveReleases are returned in + * sorted order, with the most recent ReserveReleases appearing first. + */ + public StripeCollection list(ReleaseListParams params) throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * Returns a list of ReserveReleases previously created. The ReserveReleases are returned in + * sorted order, with the most recent ReserveReleases appearing first. + */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((ReleaseListParams) null, options); + } + /** + * Returns a list of ReserveReleases previously created. The ReserveReleases are returned in + * sorted order, with the most recent ReserveReleases appearing first. + */ + public StripeCollection list() throws StripeException { + return list((ReleaseListParams) null, (RequestOptions) null); + } + /** + * Returns a list of ReserveReleases previously created. The ReserveReleases are returned in + * sorted order, with the most recent ReserveReleases appearing first. + */ + public StripeCollection list(ReleaseListParams params, RequestOptions options) + throws StripeException { + String path = "/v1/reserve/releases"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } + /** Retrieve a ReserveRelease. */ + public Release retrieve(String id, ReleaseRetrieveParams params) throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieve a ReserveRelease. */ + public Release retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (ReleaseRetrieveParams) null, options); + } + /** Retrieve a ReserveRelease. */ + public Release retrieve(String id) throws StripeException { + return retrieve(id, (ReleaseRetrieveParams) null, (RequestOptions) null); + } + /** Retrieve a ReserveRelease. */ + public Release retrieve(String id, ReleaseRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/reserve/releases/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Release.class); + } +} From 84e25c370654bfcd8d16a80409b0a5c383c8dd4e Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 17:28:35 +0000 Subject: [PATCH 5/6] Update generated code for v2160 and --- CODEGEN_VERSION | 2 +- .../com/stripe/param/PaymentIntentConfirmParams.java | 12 +++++++++--- .../com/stripe/param/PaymentIntentCreateParams.java | 12 +++++++++--- .../com/stripe/param/PaymentIntentUpdateParams.java | 12 +++++++++--- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 5a8d600ad16..41e180fca76 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -45d723936ebab9668b6996394720dcf4a2436671 \ No newline at end of file +fdbf5e05015131c7993d2b4017103f0d94561b6a \ No newline at end of file diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index b165c1b42a9..137d38580cd 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -42549,7 +42549,7 @@ public static class UsBankAccount { /** Preferred transaction settlement speed. */ @SerializedName("preferred_settlement_speed") - PreferredSettlementSpeed preferredSettlementSpeed; + ApiRequestParams.EnumParam preferredSettlementSpeed; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -42594,7 +42594,7 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - PreferredSettlementSpeed preferredSettlementSpeed, + ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, VerificationMethod verificationMethod) { @@ -42621,7 +42621,7 @@ public static class Builder { private Networks networks; - private PreferredSettlementSpeed preferredSettlementSpeed; + private ApiRequestParams.EnumParam preferredSettlementSpeed; private ApiRequestParams.EnumParam setupFutureUsage; @@ -42703,6 +42703,12 @@ public Builder setPreferredSettlementSpeed( return this; } + /** Preferred transaction settlement speed. */ + public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { + this.preferredSettlementSpeed = preferredSettlementSpeed; + return this; + } + /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 792ac734afc..1add3850d62 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -43031,7 +43031,7 @@ public static class UsBankAccount { /** Preferred transaction settlement speed. */ @SerializedName("preferred_settlement_speed") - PreferredSettlementSpeed preferredSettlementSpeed; + ApiRequestParams.EnumParam preferredSettlementSpeed; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -43076,7 +43076,7 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - PreferredSettlementSpeed preferredSettlementSpeed, + ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, VerificationMethod verificationMethod) { @@ -43103,7 +43103,7 @@ public static class Builder { private Networks networks; - private PreferredSettlementSpeed preferredSettlementSpeed; + private ApiRequestParams.EnumParam preferredSettlementSpeed; private ApiRequestParams.EnumParam setupFutureUsage; @@ -43183,6 +43183,12 @@ public Builder setPreferredSettlementSpeed( return this; } + /** Preferred transaction settlement speed. */ + public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { + this.preferredSettlementSpeed = preferredSettlementSpeed; + return this; + } + /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 6248528d18e..480e2637e27 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -44933,7 +44933,7 @@ public static class UsBankAccount { /** Preferred transaction settlement speed. */ @SerializedName("preferred_settlement_speed") - PreferredSettlementSpeed preferredSettlementSpeed; + ApiRequestParams.EnumParam preferredSettlementSpeed; /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -44978,7 +44978,7 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - PreferredSettlementSpeed preferredSettlementSpeed, + ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, Object targetDate, VerificationMethod verificationMethod) { @@ -45005,7 +45005,7 @@ public static class Builder { private Networks networks; - private PreferredSettlementSpeed preferredSettlementSpeed; + private ApiRequestParams.EnumParam preferredSettlementSpeed; private ApiRequestParams.EnumParam setupFutureUsage; @@ -45085,6 +45085,12 @@ public Builder setPreferredSettlementSpeed( return this; } + /** Preferred transaction settlement speed. */ + public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { + this.preferredSettlementSpeed = preferredSettlementSpeed; + return this; + } + /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. From 0365b604e5d5bdfdd6af00c2569fe5fb3d84a32f Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:45:15 -0800 Subject: [PATCH 6/6] Update generated code (#2147) * Update generated code for v2154 and * Update generated code for v2158 and * Update generated code for v2158 and * Update generated code for v2159 and * Update generated code for v2160 and --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/ApiVersion.java | 2 +- .../java/com/stripe/model/AccountSession.java | 18 +- .../com/stripe/model/BalanceTransaction.java | 23 +- src/main/java/com/stripe/model/Charge.java | 22 +- .../com/stripe/model/ConfirmationToken.java | 20 +- src/main/java/com/stripe/model/Customer.java | 48 +- .../stripe/model/EventDataClassLookup.java | 1 + src/main/java/com/stripe/model/Invoice.java | 46 +- src/main/java/com/stripe/model/LineItem.java | 21 + .../stripe/model/PaymentAttemptRecord.java | 20 +- .../java/com/stripe/model/PaymentIntent.java | 25 + .../java/com/stripe/model/PaymentLink.java | 2 +- .../java/com/stripe/model/PaymentMethod.java | 20 +- .../java/com/stripe/model/PaymentRecord.java | 20 +- .../java/com/stripe/model/SetupAttempt.java | 22 +- .../java/com/stripe/model/StripeError.java | 19 +- .../java/com/stripe/model/Subscription.java | 5 +- src/main/java/com/stripe/model/TaxId.java | 14 +- .../com/stripe/model/checkout/Session.java | 46 +- .../stripe/model/radar/PaymentEvaluation.java | 800 +++++++++ .../com/stripe/model/tax/Calculation.java | 28 +- .../com/stripe/model/tax/Transaction.java | 28 +- .../stripe/model/terminal/Configuration.java | 27 - .../stripe/model/treasury/ReceivedDebit.java | 7 + .../com/stripe/model/v2/core/Account.java | 54 +- .../param/AccountSessionCreateParams.java | 36 +- .../param/BalanceTransactionListParams.java | 23 +- .../param/ConfirmationTokenCreateParams.java | 3 + .../com/stripe/param/CouponCreateParams.java | 10 +- .../stripe/param/CustomerCreateParams.java | 26 +- .../param/CustomerTaxIdCreateParams.java | 25 +- .../param/InvoiceCreatePreviewParams.java | 26 +- .../param/PaymentIntentCaptureParams.java | 43 +- .../param/PaymentIntentConfirmParams.java | 54 +- .../param/PaymentIntentCreateParams.java | 54 +- ...entIntentIncrementAuthorizationParams.java | 43 +- .../param/PaymentIntentUpdateParams.java | 54 +- .../stripe/param/PaymentLinkCreateParams.java | 22 +- .../stripe/param/PaymentLinkUpdateParams.java | 26 +- ...aymentMethodConfigurationCreateParams.java | 8 +- ...aymentMethodConfigurationUpdateParams.java | 8 +- .../param/PaymentMethodCreateParams.java | 3 + .../param/SetupIntentConfirmParams.java | 11 +- .../stripe/param/SetupIntentCreateParams.java | 11 +- .../stripe/param/SetupIntentUpdateParams.java | 11 +- .../param/TaxIdCollectionCreateParams.java | 25 +- .../com/stripe/param/TaxIdCreateParams.java | 25 +- .../param/checkout/SessionCreateParams.java | 72 +- .../radar/PaymentEvaluationCreateParams.java | 1483 +++++++++++++++++ .../param/tax/CalculationCreateParams.java | 26 +- .../terminal/ConfigurationCreateParams.java | 169 +- .../terminal/ConfigurationUpdateParams.java | 163 -- .../param/v2/core/AccountCreateParams.java | 135 ++ .../v2/core/AccountTokenCreateParams.java | 141 +- .../param/v2/core/AccountUpdateParams.java | 141 ++ .../com/stripe/service/CustomerService.java | 48 +- .../com/stripe/service/InvoiceService.java | 16 +- .../java/com/stripe/service/RadarService.java | 4 + .../service/checkout/SessionService.java | 16 +- .../radar/PaymentEvaluationService.java | 43 + 62 files changed, 3574 insertions(+), 772 deletions(-) create mode 100644 src/main/java/com/stripe/model/radar/PaymentEvaluation.java create mode 100644 src/main/java/com/stripe/param/radar/PaymentEvaluationCreateParams.java create mode 100644 src/main/java/com/stripe/service/radar/PaymentEvaluationService.java diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 81e38dd3bef..41e180fca76 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -c250368ba89214c80bc8de3e4fc5d2094c5502cc \ No newline at end of file +fdbf5e05015131c7993d2b4017103f0d94561b6a \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ccb965af858..469687e756a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2152 \ No newline at end of file +v2160 \ No newline at end of file diff --git a/src/main/java/com/stripe/ApiVersion.java b/src/main/java/com/stripe/ApiVersion.java index 73206cf5c9e..e2e04d01544 100644 --- a/src/main/java/com/stripe/ApiVersion.java +++ b/src/main/java/com/stripe/ApiVersion.java @@ -2,6 +2,6 @@ package com.stripe; final class ApiVersion { - public static final String CURRENT = "2025-12-15.clover"; + public static final String CURRENT = "2026-01-28.clover"; public static final String CURRENT_MAJOR = "clover"; } diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index dee89664593..3c3d6afa5d6 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -322,9 +322,9 @@ public static class Features extends StripeObject { Boolean externalAccountCollection; /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. + * Whether to allow creation of instant payouts. The default value is {@code enabled} when + * Stripe is responsible for negative account balances, and {@code use_dashboard_rules} + * otherwise. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -538,9 +538,9 @@ public static class Features extends StripeObject { Boolean externalAccountCollection; /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. + * Whether to allow creation of instant payouts. The default value is {@code enabled} when + * Stripe is responsible for negative account balances, and {@code use_dashboard_rules} + * otherwise. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -902,9 +902,9 @@ public static class Features extends StripeObject { Boolean externalAccountCollection; /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. + * Whether to allow creation of instant payouts. The default value is {@code enabled} when + * Stripe is responsible for negative account balances, and {@code use_dashboard_rules} + * otherwise. */ @SerializedName("instant_payouts") Boolean instantPayouts; diff --git a/src/main/java/com/stripe/model/BalanceTransaction.java b/src/main/java/com/stripe/model/BalanceTransaction.java index 85c7383900f..b8e639e7799 100644 --- a/src/main/java/com/stripe/model/BalanceTransaction.java +++ b/src/main/java/com/stripe/model/BalanceTransaction.java @@ -43,7 +43,8 @@ public class BalanceTransaction extends ApiResource implements HasId { /** * The balance that this transaction impacts. * - *

One of {@code issuing}, {@code payments}, or {@code refund_and_dispute_prefunding}. + *

One of {@code issuing}, {@code payments}, {@code refund_and_dispute_prefunding}, or {@code + * risk_reserved}. */ @SerializedName("balance_type") String balanceType; @@ -137,11 +138,11 @@ public class BalanceTransaction extends ApiResource implements HasId { * payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code * payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code * payout_minimum_balance_hold}, {@code payout_minimum_balance_release}, {@code refund}, {@code - * refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, - * {@code stripe_fx_fee}, {@code stripe_balance_payment_debit}, {@code - * stripe_balance_payment_debit_reversal}, {@code tax_fee}, {@code topup}, {@code topup_reversal}, - * {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or {@code - * transfer_refund}. Learn more about balance transaction types and * what they represent. To classify transactions for accounting purposes, consider {@code * reporting_category} instead. @@ -156,11 +157,11 @@ public class BalanceTransaction extends ApiResource implements HasId { * payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code * payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code * payout_minimum_balance_hold}, {@code payout_minimum_balance_release}, {@code refund}, {@code - * refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code - * stripe_balance_payment_debit}, {@code stripe_balance_payment_debit_reversal}, {@code - * stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code topup}, {@code topup_reversal}, - * {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or {@code - * transfer_refund}. + * refund_failure}, {@code reserve_hold}, {@code reserve_release}, {@code reserve_transaction}, + * {@code reserved_funds}, {@code stripe_balance_payment_debit}, {@code + * stripe_balance_payment_debit_reversal}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code + * tax_fee}, {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, + * {@code transfer_failure}, or {@code transfer_refund}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 629e5bb1834..0152cd0599a 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -2218,7 +2218,7 @@ public static class ThreeDSecure extends StripeObject { /** * The version of 3D Secure that was used. * - *

One of {@code 1.0.2}, {@code 2.1.0}, or {@code 2.2.0}. + *

One of {@code 1.0.2}, {@code 2.1.0}, {@code 2.2.0}, {@code 2.3.0}, or {@code 2.3.1}. */ @SerializedName("version") String version; @@ -2851,11 +2851,11 @@ public static class Grabpay extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code mollie}, - * {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code - * revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank. Can be one of {@code abn_amro}, {@code adyen}, {@code asn_bank}, + * {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code + * knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code + * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, + * or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -2863,11 +2863,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index ed10fcc1f40..4c4a570d1fe 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -1670,11 +1670,11 @@ public static class Grabpay extends StripeObject {} @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code asn_bank}, {@code - * bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, - * {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code - * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, - * or {@code yoursafe}. + * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code adyen}, {@code + * asn_bank}, {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, + * {@code knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, + * {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code + * van_lanschot}, or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -1682,11 +1682,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank, if the bank was provided. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java index efdf01ffd71..309c0dadb5d 100644 --- a/src/main/java/com/stripe/model/Customer.java +++ b/src/main/java/com/stripe/model/Customer.java @@ -787,14 +787,14 @@ public static CustomerSearchResult search(CustomerSearchParams params, RequestOp /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -806,14 +806,14 @@ public Customer update(Map params) throws StripeException { /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -829,14 +829,14 @@ public Customer update(Map params, RequestOptions options) /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -847,14 +847,14 @@ public Customer update(CustomerUpdateParams params) throws StripeException { /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 7796bfcb3b7..0d55bf2b35e 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -166,6 +166,7 @@ public final class EventDataClassLookup { classLookup.put("issuing.transaction", com.stripe.model.issuing.Transaction.class); classLookup.put("radar.early_fraud_warning", com.stripe.model.radar.EarlyFraudWarning.class); + classLookup.put("radar.payment_evaluation", com.stripe.model.radar.PaymentEvaluation.class); classLookup.put("radar.value_list", com.stripe.model.radar.ValueList.class); classLookup.put("radar.value_list_item", com.stripe.model.radar.ValueListItem.class); diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index 6fecb44be1f..5ee18bcf717 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -975,8 +975,8 @@ public Invoice attachPayment(InvoiceAttachPaymentParams params, RequestOptions o /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public static Invoice create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -985,8 +985,8 @@ public static Invoice create(Map params) throws StripeException /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public static Invoice create(Map params, RequestOptions options) throws StripeException { @@ -999,8 +999,8 @@ public static Invoice create(Map params, RequestOptions options) /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public static Invoice create(InvoiceCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -1009,8 +1009,8 @@ public static Invoice create(InvoiceCreateParams params) throws StripeException /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public static Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException { @@ -2105,21 +2105,21 @@ public static class CustomerTaxId extends StripeObject { * ro_tin}, {@code rs_pib}, {@code sv_nit}, {@code uy_ruc}, {@code ve_rif}, {@code vn_tin}, * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, - * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code tw_vat}, - * {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, {@code li_vat}, - * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code - * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code - * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, - * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code - * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code al_tin}, - * {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code - * ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, - * {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, {@code cd_nif}, {@code - * mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code gn_nif}, {@code mk_vat}, - * {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, {@code tj_tin}, {@code - * ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code az_tin}, {@code bd_bin}, - * {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, {@code cm_niu}, {@code - * cv_nif}, {@code bf_ifu}, or {@code unknown}. + * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code pl_nip}, + * {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, + * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code + * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code + * sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, + * {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code + * hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, + * {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code + * de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, + * {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, {@code + * cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code gn_nif}, + * {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, {@code + * tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code az_tin}, + * {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, {@code + * cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/LineItem.java b/src/main/java/com/stripe/model/LineItem.java index a56bae6c7f5..257c89f29dd 100644 --- a/src/main/java/com/stripe/model/LineItem.java +++ b/src/main/java/com/stripe/model/LineItem.java @@ -13,6 +13,9 @@ @Setter @EqualsAndHashCode(callSuper = false) public class LineItem extends StripeObject implements HasId { + @SerializedName("adjustable_quantity") + AdjustableQuantity adjustableQuantity; + /** Total discount amount applied. If no discounts were applied, defaults to 0. */ @SerializedName("amount_discount") Long amountDiscount; @@ -80,6 +83,24 @@ public class LineItem extends StripeObject implements HasId { @SerializedName("taxes") List taxes; + /** + * For more details about AdjustableQuantity, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AdjustableQuantity extends StripeObject { + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("maximum") + Long maximum; + + @SerializedName("minimum") + Long minimum; + } + /** * For more details about Discount, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecord.java b/src/main/java/com/stripe/model/PaymentAttemptRecord.java index 41267ddb2c8..5e482e24bd6 100644 --- a/src/main/java/com/stripe/model/PaymentAttemptRecord.java +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -1894,11 +1894,11 @@ public static class Grabpay extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code mollie}, - * {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code - * revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank. Can be one of {@code abn_amro}, {@code adyen}, {@code asn_bank}, + * {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code + * knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code + * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, + * or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -1906,11 +1906,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 8f41afcbe09..c23183b74e7 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1551,6 +1551,9 @@ public static class AmountDetails extends StripeObject { @SerializedName("discount_amount") Long discountAmount; + @SerializedName("error") + Errors error; + /** * A list of line items, each containing information about a product in the PaymentIntent. There * is a maximum of 200 line items. @@ -1567,6 +1570,28 @@ public static class AmountDetails extends StripeObject { @SerializedName("tip") Tip tip; + /** + * For more details about Errors, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Errors extends StripeObject { + /** + * The code of the error that occurred when validating the current amount details. + * + *

One of {@code amount_details_amount_mismatch}, or {@code + * amount_details_tax_shipping_discount_greater_than_amount}. + */ + @SerializedName("code") + String code; + + /** A message providing more details about the error. */ + @SerializedName("message") + String message; + } + /** * For more details about Shipping, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index 55261a8c76f..e2f564dab47 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -96,7 +96,7 @@ public class PaymentLink extends ApiResource implements HasId, MetadataStore customFields; diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 76646c88811..cf0854766b7 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -1924,11 +1924,11 @@ public static class Grabpay extends StripeObject {} @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code asn_bank}, {@code - * bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code - * mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, - * {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code adyen}, {@code + * asn_bank}, {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, + * {@code knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, + * {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code + * van_lanschot}, or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -1936,11 +1936,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank, if the bank was provided. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or {@code - * TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java index 15980fac033..1fedb45b0da 100644 --- a/src/main/java/com/stripe/model/PaymentRecord.java +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -2196,11 +2196,11 @@ public static class Grabpay extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code mollie}, - * {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code - * revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank. Can be one of {@code abn_amro}, {@code adyen}, {@code asn_bank}, + * {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code + * knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code + * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, + * or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -2208,11 +2208,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/SetupAttempt.java b/src/main/java/com/stripe/model/SetupAttempt.java index 668b27f97c8..3d7a6f58788 100644 --- a/src/main/java/com/stripe/model/SetupAttempt.java +++ b/src/main/java/com/stripe/model/SetupAttempt.java @@ -673,7 +673,7 @@ public static class ThreeDSecure extends StripeObject { /** * The version of 3D Secure that was used. * - *

One of {@code 1.0.2}, {@code 2.1.0}, or {@code 2.2.0}. + *

One of {@code 1.0.2}, {@code 2.1.0}, {@code 2.2.0}, {@code 2.3.0}, or {@code 2.3.1}. */ @SerializedName("version") String version; @@ -798,11 +798,11 @@ public static class Cashapp extends StripeObject {} @EqualsAndHashCode(callSuper = false) public static class Ideal extends StripeObject { /** - * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code mollie}, - * {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code - * revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code - * yoursafe}. + * The customer's bank. Can be one of {@code abn_amro}, {@code adyen}, {@code asn_bank}, + * {@code bunq}, {@code buut}, {@code finom}, {@code handelsbanken}, {@code ing}, {@code + * knab}, {@code mollie}, {@code moneyou}, {@code n26}, {@code nn}, {@code rabobank}, {@code + * regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, {@code van_lanschot}, + * or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -810,11 +810,11 @@ public static class Ideal extends StripeObject { /** * The Bank Identifier Code of the customer's bank. * - *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code - * KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code - * RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or - * {@code TRIONL2U}. + *

One of {@code ABNANL2A}, {@code ADYBNL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code + * BUNQNL2A}, {@code BUUTNL2A}, {@code FNOMNL22}, {@code FVLBNL22}, {@code HANDNL2A}, {@code + * INGBNL2A}, {@code KNABNL2H}, {@code MLLENL2A}, {@code MOYONL21}, {@code NNBANL2G}, {@code + * NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code REVOLT21}, {@code + * SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index fe99381b2d3..9b94fbe4faf 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -92,15 +92,16 @@ public class StripeError extends StripeObject { * payouts_limit_exceeded}, {@code payouts_not_allowed}, {@code platform_account_required}, {@code * platform_api_key_expired}, {@code postal_code_invalid}, {@code processing_error}, {@code * product_inactive}, {@code progressive_onboarding_limit_exceeded}, {@code rate_limit}, {@code - * refer_to_customer}, {@code refund_disputed_payment}, {@code resource_already_exists}, {@code - * resource_missing}, {@code return_intent_already_processed}, {@code routing_number_invalid}, - * {@code secret_key_required}, {@code sepa_unsupported_account}, {@code setup_attempt_failed}, - * {@code setup_intent_authentication_failure}, {@code setup_intent_invalid_parameter}, {@code - * setup_intent_mandate_invalid}, {@code setup_intent_mobile_wallet_unsupported}, {@code - * setup_intent_setup_attempt_expired}, {@code setup_intent_unexpected_state}, {@code - * shipping_address_invalid}, {@code shipping_calculation_failed}, {@code sku_inactive}, {@code - * state_unsupported}, {@code status_transition_invalid}, {@code stripe_tax_inactive}, {@code - * tax_id_invalid}, {@code tax_id_prohibited}, {@code taxes_calculation_failed}, {@code + * refer_to_customer}, {@code refund_disputed_payment}, {@code request_blocked}, {@code + * resource_already_exists}, {@code resource_missing}, {@code return_intent_already_processed}, + * {@code routing_number_invalid}, {@code secret_key_required}, {@code sepa_unsupported_account}, + * {@code setup_attempt_failed}, {@code setup_intent_authentication_failure}, {@code + * setup_intent_invalid_parameter}, {@code setup_intent_mandate_invalid}, {@code + * setup_intent_mobile_wallet_unsupported}, {@code setup_intent_setup_attempt_expired}, {@code + * setup_intent_unexpected_state}, {@code shipping_address_invalid}, {@code + * shipping_calculation_failed}, {@code sku_inactive}, {@code state_unsupported}, {@code + * status_transition_invalid}, {@code stripe_tax_inactive}, {@code tax_id_invalid}, {@code + * tax_id_prohibited}, {@code taxes_calculation_failed}, {@code * terminal_location_country_unsupported}, {@code terminal_reader_busy}, {@code * terminal_reader_hardware_fault}, {@code terminal_reader_invalid_location_for_activation}, * {@code terminal_reader_invalid_location_for_payment}, {@code terminal_reader_offline}, {@code diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index 0c11ec277b2..e5486348fe1 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -206,7 +206,10 @@ public class Subscription extends ApiResource implements HasId, MetadataStore customFields; @@ -836,8 +836,8 @@ public static Session retrieve( /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ @Override public Session update(Map params) throws StripeException { @@ -847,8 +847,8 @@ public Session update(Map params) throws StripeException { /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ @Override public Session update(Map params, RequestOptions options) throws StripeException { @@ -861,8 +861,8 @@ public Session update(Map params, RequestOptions options) throws /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(SessionUpdateParams params) throws StripeException { return update(params, (RequestOptions) null); @@ -871,8 +871,8 @@ public Session update(SessionUpdateParams params) throws StripeException { /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(SessionUpdateParams params, RequestOptions options) throws StripeException { String path = String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(this.getId())); @@ -1577,20 +1577,20 @@ public static class TaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code - * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code - * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, - * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code - * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, - * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code - * ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, - * {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code - * md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, - * {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code - * gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, - * {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code - * az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, - * {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. + * pl_nip}, {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, + * {@code li_uid}, {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code + * ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, + * {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code + * id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, + * {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code + * eg_tin}, {@code ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, + * {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code + * uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, + * {@code bb_tin}, {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code + * ba_tin}, {@code gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, + * {@code np_pan}, {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code + * aw_tin}, {@code az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, + * {@code la_tin}, {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/radar/PaymentEvaluation.java b/src/main/java/com/stripe/model/radar/PaymentEvaluation.java new file mode 100644 index 00000000000..87e169804d9 --- /dev/null +++ b/src/main/java/com/stripe/model/radar/PaymentEvaluation.java @@ -0,0 +1,800 @@ +// File generated from our OpenAPI spec +package com.stripe.model.radar; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.ExpandableField; +import com.stripe.model.HasId; +import com.stripe.model.PaymentMethod; +import com.stripe.model.StripeObject; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.radar.PaymentEvaluationCreateParams; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * Payment Evaluations represent the risk lifecycle of an externally processed payment. It includes + * the Radar risk score from Stripe, payment outcome taken by the merchant or processor, and any + * post transaction events, such as refunds or disputes. See the Radar API guide for integration steps. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentEvaluation extends ApiResource implements HasId { + /** Client device metadata attached to this payment evaluation. */ + @SerializedName("client_device_metadata_details") + ClientDeviceMetadataDetails clientDeviceMetadataDetails; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created_at") + Long createdAt; + + /** Customer details attached to this payment evaluation. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** + * Event information associated with the payment evaluation, such as refunds, dispute, early fraud + * warnings, or user interventions. + */ + @SerializedName("events") + List events; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** Collection of scores and insights for this payment evaluation. */ + @SerializedName("insights") + Insights insights; + + /** + * 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code radar.payment_evaluation}. + */ + @SerializedName("object") + String object; + + /** Indicates the final outcome for the payment evaluation. */ + @SerializedName("outcome") + Outcome outcome; + + /** Payment details attached to this payment evaluation. */ + @SerializedName("payment_details") + PaymentDetails paymentDetails; + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public static PaymentEvaluation create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public static PaymentEvaluation create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/radar/payment_evaluations"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, PaymentEvaluation.class); + } + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public static PaymentEvaluation create(PaymentEvaluationCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); + } + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public static PaymentEvaluation create( + PaymentEvaluationCreateParams params, RequestOptions options) throws StripeException { + String path = "/v1/radar/payment_evaluations"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentEvaluation.class); + } + + /** Client device metadata attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ClientDeviceMetadataDetails extends StripeObject { + /** + * ID for the Radar Session associated with the payment evaluation. A Radar Session is a snapshot of the + * browser metadata and device details that help Radar make more accurate predictions on your + * payments. + */ + @SerializedName("radar_session") + String radarSession; + } + + /** Customer details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails extends StripeObject { + /** The ID of the customer associated with the payment evaluation. */ + @SerializedName("customer") + String customer; + + /** The ID of the Account representing the customer associated with the payment evaluation. */ + @SerializedName("customer_account") + String customerAccount; + + /** The customer's email address. */ + @SerializedName("email") + String email; + + /** The customer's full name or business name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + } + + /** Event reported for this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Event extends StripeObject { + /** Dispute opened event details attached to this payment evaluation. */ + @SerializedName("dispute_opened") + DisputeOpened disputeOpened; + + /** Early Fraud Warning Received event details attached to this payment evaluation. */ + @SerializedName("early_fraud_warning_received") + EarlyFraudWarningReceived earlyFraudWarningReceived; + + /** Timestamp when the event occurred. */ + @SerializedName("occurred_at") + Long occurredAt; + + /** Refunded Event details attached to this payment evaluation. */ + @SerializedName("refunded") + Refunded refunded; + + /** + * Indicates the type of event attached to the payment evaluation. + * + *

One of {@code dispute_opened}, {@code early_fraud_warning_received}, {@code refunded}, + * {@code user_intervention_raised}, or {@code user_intervention_resolved}. + */ + @SerializedName("type") + String type; + + /** User intervention raised event details attached to this payment evaluation. */ + @SerializedName("user_intervention_raised") + UserInterventionRaised userInterventionRaised; + + /** User Intervention Resolved Event details attached to this payment evaluation. */ + @SerializedName("user_intervention_resolved") + UserInterventionResolved userInterventionResolved; + + /** Dispute opened event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DisputeOpened extends StripeObject { + /** + * Amount to dispute for this payment. A positive integer representing how much to charge in + * the smallest currency unit + * (for example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal + * currency). + */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * Reason given by cardholder for dispute. + * + *

One of {@code account_not_available}, {@code credit_not_processed}, {@code + * customer_initiated}, {@code duplicate}, {@code fraudulent}, {@code general}, {@code + * noncompliant}, {@code product_not_received}, {@code product_unacceptable}, {@code + * subscription_canceled}, or {@code unrecognized}. + */ + @SerializedName("reason") + String reason; + } + + /** Early Fraud Warning Received event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class EarlyFraudWarningReceived extends StripeObject { + /** + * The type of fraud labeled by the issuer. + * + *

One of {@code made_with_lost_card}, {@code made_with_stolen_card}, {@code other}, or + * {@code unauthorized_use_of_card}. + */ + @SerializedName("fraud_type") + String fraudType; + } + + /** Refunded Event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Refunded extends StripeObject { + /** + * Amount refunded for this payment. A positive integer representing how much to charge in the smallest currency unit (for + * example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). + */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * Indicates the reason for the refund. + * + *

One of {@code duplicate}, {@code fraudulent}, {@code other}, or {@code + * requested_by_customer}. + */ + @SerializedName("reason") + String reason; + } + + /** User intervention raised event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UserInterventionRaised extends StripeObject { + /** User intervention raised custom event details attached to this payment evaluation. */ + @SerializedName("custom") + Custom custom; + + /** Unique identifier for the user intervention event. */ + @SerializedName("key") + String key; + + /** + * Type of user intervention raised. + * + *

One of {@code 3ds}, {@code captcha}, or {@code custom}. + */ + @SerializedName("type") + String type; + + /** User intervention raised custom event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Custom extends StripeObject { + /** + * Custom type of user intervention raised. The string must use a snake case description for + * the type of intervention performed. + */ + @SerializedName("type") + String type; + } + } + + /** User Intervention Resolved Event details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UserInterventionResolved extends StripeObject { + /** Unique ID of this intervention. Use this to provide the result. */ + @SerializedName("key") + String key; + + /** + * Result of the intervention if it has been completed. + * + *

One of {@code abandoned}, {@code failed}, or {@code passed}. + */ + @SerializedName("outcome") + String outcome; + } + } + + /** Collection of scores and insights for this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Insights extends StripeObject { + /** Stripe Radar's evaluation of the likelihood of a card issuer decline on this payment. */ + @SerializedName("card_issuer_decline") + CardIssuerDecline cardIssuerDecline; + + /** The timestamp when the evaluation was performed. */ + @SerializedName("evaluated_at") + Long evaluatedAt; + + /** Scores, insights and recommended action for one scorer for this PaymentEvaluation. */ + @SerializedName("fraudulent_dispute") + FraudulentDispute fraudulentDispute; + + /** + * Provides Stripe Radar's evaluation of the likelihood that a payment will be declined by the + * card issuer. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CardIssuerDecline extends StripeObject { + /** + * Stripe Radar's evaluation of the likelihood that the payment will be declined by the card + * issuer. Scores range from 0 to 100, with higher values indicating a higher likelihood of + * decline. + */ + @SerializedName("model_score") + BigDecimal modelScore; + + /** + * Recommended action based on the model score. Possible values are {@code block} and {@code + * continue}. + * + *

One of {@code block}, or {@code continue}. + */ + @SerializedName("recommended_action") + String recommendedAction; + } + + /** Scores, insights and recommended action for one scorer for this PaymentEvaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FraudulentDispute extends StripeObject { + /** + * Recommended action based on the risk score. Possible values are {@code block} and {@code + * continue}. + * + *

One of {@code block}, or {@code continue}. + */ + @SerializedName("recommended_action") + String recommendedAction; + + /** + * Stripe Radar’s evaluation of the risk level of the payment. Possible values for evaluated + * payments are between 0 and 100, with higher scores indicating higher risk. + */ + @SerializedName("risk_score") + Long riskScore; + } + } + + /** Outcome details for this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Outcome extends StripeObject { + /** Details of a merchant_blocked outcome attached to this payment evaluation. */ + @SerializedName("merchant_blocked") + MerchantBlocked merchantBlocked; + + /** The PaymentIntent ID associated with the payment evaluation. */ + @SerializedName("payment_intent_id") + String paymentIntentId; + + /** Details of an rejected outcome attached to this payment evaluation. */ + @SerializedName("rejected") + Rejected rejected; + + /** Details of a succeeded outcome attached to this payment evaluation. */ + @SerializedName("succeeded") + Succeeded succeeded; + + /** + * Indicates the outcome of the payment evaluation. + * + *

One of {@code failed}, {@code merchant_blocked}, {@code rejected}, or {@code succeeded}. + */ + @SerializedName("type") + String type; + + /** Details of a merchant_blocked outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MerchantBlocked extends StripeObject { + /** + * The reason the payment was blocked by the merchant. + * + *

One of {@code authentication_required}, {@code blocked_for_fraud}, {@code + * invalid_payment}, or {@code other}. + */ + @SerializedName("reason") + String reason; + } + + /** Details of an rejected outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Rejected extends StripeObject { + /** Details of an rejected card outcome attached to this payment evaluation. */ + @SerializedName("card") + Card card; + + /** Details of an rejected card outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Result of the address line 1 check. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("address_line1_check") + String addressLine1Check; + + /** + * Indicates whether the cardholder provided a postal code and if it matched the + * cardholder’s billing address. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("address_postal_code_check") + String addressPostalCodeCheck; + + /** + * Result of the CVC check. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("cvc_check") + String cvcCheck; + + /** + * Card issuer's reason for the network decline. + * + *

One of {@code authentication_failed}, {@code do_not_honor}, {@code expired}, {@code + * incorrect_cvc}, {@code incorrect_number}, {@code incorrect_postal_code}, {@code + * insufficient_funds}, {@code invalid_account}, {@code lost_card}, {@code other}, {@code + * processing_error}, {@code reported_stolen}, or {@code try_again_later}. + */ + @SerializedName("reason") + String reason; + } + } + + /** Details of a succeeded outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Succeeded extends StripeObject { + /** Details of an succeeded card outcome attached to this payment evaluation. */ + @SerializedName("card") + Card card; + + /** Details of an succeeded card outcome attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Result of the address line 1 check. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("address_line1_check") + String addressLine1Check; + + /** + * Indicates whether the cardholder provided a postal code and if it matched the + * cardholder’s billing address. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("address_postal_code_check") + String addressPostalCodeCheck; + + /** + * Result of the CVC check. + * + *

One of {@code fail}, {@code pass}, {@code unavailable}, or {@code unchecked}. + */ + @SerializedName("cvc_check") + String cvcCheck; + } + } + } + + /** Payment details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails extends StripeObject { + /** + * Amount intended to be collected by this payment. A positive integer representing how much to + * charge in the smallest currency + * unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + * The minimum amount is $0.50 US or equivalent in + * charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 + * for a USD charge of $999,999.99). + */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String description; + + /** Details about the payment's customer presence and type. */ + @SerializedName("money_movement_details") + MoneyMovementDetails moneyMovementDetails; + + /** Details about the payment method used for the payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** Shipping details for the payment evaluation. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + /** Payment statement descriptor. */ + @SerializedName("statement_descriptor") + String statementDescriptor; + + /** Money Movement details attached to this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MoneyMovementDetails extends StripeObject { + /** Describes card money movement details for the payment evaluation. */ + @SerializedName("card") + Card card; + + /** + * Describes the type of money movement. Currently only {@code card} is supported. + * + *

Equal to {@code card}. + */ + @SerializedName("money_movement_type") + String moneyMovementType; + + /** Money Movement card details attached to this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Describes the presence of the customer during the payment. + * + *

One of {@code off_session}, or {@code on_session}. + */ + @SerializedName("customer_presence") + String customerPresence; + + /** + * Describes the type of payment. + * + *

One of {@code one_off}, {@code recurring}, {@code setup_one_off}, or {@code + * setup_recurring}. + */ + @SerializedName("payment_type") + String paymentType; + } + } + + /** Payment method details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodDetails extends StripeObject { + /** Billing information associated with the payment evaluation. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** The payment method used in this payment evaluation. */ + @SerializedName("payment_method") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentMethod; + + /** Get ID of expandable {@code paymentMethod} object. */ + public String getPaymentMethod() { + return (this.paymentMethod != null) ? this.paymentMethod.getId() : null; + } + + public void setPaymentMethod(String id) { + this.paymentMethod = ApiResource.setExpandableFieldId(id, this.paymentMethod); + } + + /** Get expanded {@code paymentMethod}. */ + public PaymentMethod getPaymentMethodObject() { + return (this.paymentMethod != null) ? this.paymentMethod.getExpanded() : null; + } + + public void setPaymentMethodObject(PaymentMethod expandableObject) { + this.paymentMethod = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Billing details attached to this payment evaluation. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails extends StripeObject { + /** Address data. */ + @SerializedName("address") + Address address; + + /** Email address. */ + @SerializedName("email") + String email; + + /** Full name. */ + @SerializedName("name") + String name; + + /** Billing phone number (including extension). */ + @SerializedName("phone") + String phone; + + /** Address data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO 3166-2). + */ + @SerializedName("state") + String state; + } + } + } + + /** Shipping details attached to this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails extends StripeObject { + /** Address data. */ + @SerializedName("address") + Address address; + + /** Shipping name. */ + @SerializedName("name") + String name; + + /** Shipping phone number. */ + @SerializedName("phone") + String phone; + + /** Address data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO 3166-2). + */ + @SerializedName("state") + String state; + } + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(clientDeviceMetadataDetails, responseGetter); + trySetResponseGetter(customerDetails, responseGetter); + trySetResponseGetter(insights, responseGetter); + trySetResponseGetter(outcome, responseGetter); + trySetResponseGetter(paymentDetails, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/tax/Calculation.java b/src/main/java/com/stripe/model/tax/Calculation.java index 4f2a4219eb2..8dc6f167c73 100644 --- a/src/main/java/com/stripe/model/tax/Calculation.java +++ b/src/main/java/com/stripe/model/tax/Calculation.java @@ -326,20 +326,20 @@ public static class TaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code - * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code - * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, - * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code - * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, - * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code - * ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, - * {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code - * md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, - * {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code - * gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, - * {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code - * az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, - * {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. + * pl_nip}, {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, + * {@code li_uid}, {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code + * ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, + * {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code + * id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, + * {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code + * eg_tin}, {@code ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, + * {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code + * uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, + * {@code bb_tin}, {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code + * ba_tin}, {@code gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, + * {@code np_pan}, {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code + * aw_tin}, {@code az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, + * {@code la_tin}, {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/tax/Transaction.java b/src/main/java/com/stripe/model/tax/Transaction.java index adb88509e17..ff821c03f95 100644 --- a/src/main/java/com/stripe/model/tax/Transaction.java +++ b/src/main/java/com/stripe/model/tax/Transaction.java @@ -371,20 +371,20 @@ public static class TaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code - * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code - * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, - * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code - * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, - * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code - * ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, - * {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code - * md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, {@code bb_tin}, - * {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code ba_tin}, {@code - * gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, {@code np_pan}, - * {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code aw_tin}, {@code - * az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, {@code la_tin}, - * {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. + * pl_nip}, {@code tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, + * {@code li_uid}, {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code + * ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, + * {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code + * id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, + * {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code + * eg_tin}, {@code ph_tin}, {@code al_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, + * {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code + * uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, {@code ao_tin}, {@code bs_tin}, + * {@code bb_tin}, {@code cd_nif}, {@code mr_nif}, {@code me_pib}, {@code zw_tin}, {@code + * ba_tin}, {@code gn_nif}, {@code mk_vat}, {@code sr_fin}, {@code sn_ninea}, {@code am_tin}, + * {@code np_pan}, {@code tj_tin}, {@code ug_tin}, {@code zm_tin}, {@code kh_tin}, {@code + * aw_tin}, {@code az_tin}, {@code bd_bin}, {@code bj_ifu}, {@code et_tin}, {@code kg_tin}, + * {@code la_tin}, {@code cm_niu}, {@code cv_nif}, {@code bf_ifu}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index b6adb662df1..d6d5456c9ae 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -407,9 +407,6 @@ public static class Tipping extends StripeObject { @SerializedName("aud") Aud aud; - @SerializedName("bgn") - Bgn bgn; - @SerializedName("cad") Cad cad; @@ -515,30 +512,6 @@ public static class Aud extends StripeObject { Long smartTipThreshold; } - /** - * For more details about Bgn, please refer to the API - * Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Bgn extends StripeObject { - /** Fixed amounts displayed when collecting a tip. */ - @SerializedName("fixed_amounts") - List fixedAmounts; - - /** Percentages displayed when collecting a tip. */ - @SerializedName("percentages") - List percentages; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - @SerializedName("smart_tip_threshold") - Long smartTipThreshold; - } - /** * For more details about Cad, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java index 3fc38259a95..6e7c5fb5b4f 100644 --- a/src/main/java/com/stripe/model/treasury/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/treasury/ReceivedDebit.java @@ -368,6 +368,13 @@ public static class LinkedFlows extends StripeObject { */ @SerializedName("payout") String payout; + + /** + * Set if the ReceivedDebit was created due to a Topup object. + */ + @SerializedName("topup") + String topup; } /** diff --git a/src/main/java/com/stripe/model/v2/core/Account.java b/src/main/java/com/stripe/model/v2/core/Account.java index 6feae8b1b22..b5c960ad6f7 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -43,6 +43,10 @@ public class Account extends StripeObject implements HasId { @SerializedName("contact_email") String contactEmail; + /** The default contact phone for the Account. */ + @SerializedName("contact_phone") + String contactPhone; + /** * Time at which the object was created. Represented as a RFC 3339 date & time UTC value in * millisecond precision, for example: 2022-09-18T13:22:18.123Z. @@ -4160,6 +4164,10 @@ public static class BusinessDetails extends StripeObject { @SerializedName("registered_name") String registeredName; + /** When the business was incorporated or registered. */ + @SerializedName("registration_date") + RegistrationDate registrationDate; + /** The business registration address of the business entity in non latin script. */ @SerializedName("script_addresses") ScriptAddresses scriptAddresses; @@ -4603,20 +4611,20 @@ public static class IdNumber extends StripeObject { * cy_he}, {@code cy_tic}, {@code cy_vat}, {@code cz_ico}, {@code cz_vat}, {@code de_hrn}, * {@code de_stn}, {@code de_vat}, {@code dk_cvr}, {@code dk_vat}, {@code do_rcn}, {@code * ee_rk}, {@code ee_vat}, {@code es_cif}, {@code es_vat}, {@code fi_vat}, {@code fi_yt}, - * {@code fr_rna}, {@code fr_siren}, {@code fr_vat}, {@code gb_crn}, {@code gi_crn}, {@code - * gr_afm}, {@code gr_gemi}, {@code gr_vat}, {@code gt_nit}, {@code hk_br}, {@code hk_cr}, - * {@code hr_mbs}, {@code hr_oib}, {@code hr_vat}, {@code hu_cjs}, {@code hu_tin}, {@code - * hu_vat}, {@code ie_crn}, {@code ie_trn}, {@code ie_vat}, {@code it_rea}, {@code it_vat}, - * {@code jp_cn}, {@code kz_bin}, {@code li_uid}, {@code lt_ccrn}, {@code lt_vat}, {@code - * lu_nif}, {@code lu_rcs}, {@code lu_vat}, {@code lv_urn}, {@code lv_vat}, {@code mt_crn}, - * {@code mt_tin}, {@code mt_vat}, {@code mx_rfc}, {@code my_brn}, {@code my_coid}, {@code - * my_itn}, {@code my_sst}, {@code mz_nuit}, {@code nl_kvk}, {@code nl_rsin}, {@code - * nl_vat}, {@code no_orgnr}, {@code nz_bn}, {@code nz_ird}, {@code pe_ruc}, {@code pk_ntn}, - * {@code pl_nip}, {@code pl_regon}, {@code pl_vat}, {@code pt_vat}, {@code ro_cui}, {@code - * ro_orc}, {@code ro_vat}, {@code sa_crn}, {@code sa_tin}, {@code se_orgnr}, {@code - * se_vat}, {@code sg_uen}, {@code si_msp}, {@code si_tin}, {@code si_vat}, {@code sk_dic}, - * {@code sk_ico}, {@code sk_vat}, {@code th_crn}, {@code th_prn}, {@code th_tin}, or {@code - * us_ein}. + * {@code fr_rna}, {@code fr_siren}, {@code fr_vat}, {@code gb_crn}, {@code gb_vat}, {@code + * gi_crn}, {@code gr_afm}, {@code gr_gemi}, {@code gr_vat}, {@code gt_nit}, {@code hk_br}, + * {@code hk_cr}, {@code hr_mbs}, {@code hr_oib}, {@code hr_vat}, {@code hu_cjs}, {@code + * hu_tin}, {@code hu_vat}, {@code ie_crn}, {@code ie_trn}, {@code ie_vat}, {@code it_rea}, + * {@code it_vat}, {@code jp_cn}, {@code kz_bin}, {@code li_uid}, {@code lt_ccrn}, {@code + * lt_vat}, {@code lu_nif}, {@code lu_rcs}, {@code lu_vat}, {@code lv_urn}, {@code lv_vat}, + * {@code mt_crn}, {@code mt_tin}, {@code mt_vat}, {@code mx_rfc}, {@code my_brn}, {@code + * my_coid}, {@code my_itn}, {@code my_sst}, {@code mz_nuit}, {@code nl_kvk}, {@code + * nl_rsin}, {@code nl_vat}, {@code no_orgnr}, {@code nz_bn}, {@code nz_ird}, {@code + * pe_ruc}, {@code pk_ntn}, {@code pl_nip}, {@code pl_regon}, {@code pl_vat}, {@code + * pt_vat}, {@code ro_cui}, {@code ro_orc}, {@code ro_vat}, {@code sa_crn}, {@code sa_tin}, + * {@code se_orgnr}, {@code se_vat}, {@code sg_uen}, {@code si_msp}, {@code si_tin}, {@code + * si_vat}, {@code sk_dic}, {@code sk_ico}, {@code sk_vat}, {@code th_crn}, {@code th_prn}, + * {@code th_tin}, or {@code us_ein}. */ @SerializedName("type") String type; @@ -4662,6 +4670,24 @@ public static class Amount extends StripeObject { } } + /** When the business was incorporated or registered. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RegistrationDate extends StripeObject { + /** The day of registration, between 1 and 31. */ + @SerializedName("day") + Long day; + + /** The month of registration, between 1 and 12. */ + @SerializedName("month") + Long month; + + /** The four-digit year of registration. */ + @SerializedName("year") + Long year; + } + /** The business registration address of the business entity in non latin script. */ @Getter @Setter diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index d64d4518df2..6c8ddb4ce12 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -1174,11 +1174,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -1296,11 +1292,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ public Builder setInstantPayouts(Boolean instantPayouts) { this.instantPayouts = instantPayouts; return this; @@ -2211,11 +2203,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -2307,11 +2295,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ public Builder setInstantPayouts(Boolean instantPayouts) { this.instantPayouts = instantPayouts; return this; @@ -3904,11 +3888,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ @SerializedName("instant_payouts") Boolean instantPayouts; @@ -4026,11 +4006,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code - * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code - * false}. - */ + /** Whether instant payouts are enabled for this component. */ public Builder setInstantPayouts(Boolean instantPayouts) { this.instantPayouts = instantPayouts; return this; diff --git a/src/main/java/com/stripe/param/BalanceTransactionListParams.java b/src/main/java/com/stripe/param/BalanceTransactionListParams.java index 744b212f76d..e3e649ec359 100644 --- a/src/main/java/com/stripe/param/BalanceTransactionListParams.java +++ b/src/main/java/com/stripe/param/BalanceTransactionListParams.java @@ -61,7 +61,7 @@ public class BalanceTransactionListParams extends ApiRequestParams { @SerializedName("payout") String payout; - /** Only returns the original transaction. */ + /** Only returns transactions associated with the given object. */ @SerializedName("source") String source; @@ -85,11 +85,11 @@ public class BalanceTransactionListParams extends ApiRequestParams { * payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code * payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code * payout_minimum_balance_hold}, {@code payout_minimum_balance_release}, {@code refund}, {@code - * refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, - * {@code stripe_fx_fee}, {@code stripe_balance_payment_debit}, {@code - * stripe_balance_payment_debit_reversal}, {@code tax_fee}, {@code topup}, {@code topup_reversal}, - * {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or {@code - * transfer_refund}. + * refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code reserve_hold}, + * {@code reserve_release}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code + * stripe_balance_payment_debit}, {@code stripe_balance_payment_debit_reversal}, {@code tax_fee}, + * {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code + * transfer_failure}, or {@code transfer_refund}. */ @SerializedName("type") String type; @@ -260,7 +260,7 @@ public Builder setPayout(String payout) { return this; } - /** Only returns the original transaction. */ + /** Only returns transactions associated with the given object. */ public Builder setSource(String source) { this.source = source; return this; @@ -289,10 +289,11 @@ public Builder setStartingAfter(String startingAfter) { * payment_refund}, {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, * {@code payout_cancel}, {@code payout_failure}, {@code payout_minimum_balance_hold}, {@code * payout_minimum_balance_release}, {@code refund}, {@code refund_failure}, {@code - * reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, - * {@code stripe_balance_payment_debit}, {@code stripe_balance_payment_debit_reversal}, {@code - * tax_fee}, {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, - * {@code transfer_failure}, or {@code transfer_refund}. + * reserve_transaction}, {@code reserved_funds}, {@code reserve_hold}, {@code reserve_release}, + * {@code stripe_fee}, {@code stripe_fx_fee}, {@code stripe_balance_payment_debit}, {@code + * stripe_balance_payment_debit_reversal}, {@code tax_fee}, {@code topup}, {@code + * topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or + * {@code transfer_refund}. */ public Builder setType(String type) { this.type = type; diff --git a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java index c120c974de8..ccdc86b5f71 100644 --- a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java +++ b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java @@ -3332,6 +3332,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), diff --git a/src/main/java/com/stripe/param/CouponCreateParams.java b/src/main/java/com/stripe/param/CouponCreateParams.java index 4a9f1e35e1e..49d3d9a285f 100644 --- a/src/main/java/com/stripe/param/CouponCreateParams.java +++ b/src/main/java/com/stripe/param/CouponCreateParams.java @@ -109,8 +109,9 @@ public class CouponCreateParams extends ApiRequestParams { BigDecimal percentOff; /** - * Unix timestamp specifying the last time at which the coupon can be redeemed. After the - * redeem_by date, the coupon can no longer be applied to new customers. + * Unix timestamp specifying the last time at which the coupon can be redeemed (cannot be set to + * more than 5 years in the future). After the redeem_by date, the coupon can no longer be applied + * to new customers. */ @SerializedName("redeem_by") Long redeemBy; @@ -407,8 +408,9 @@ public Builder setPercentOff(BigDecimal percentOff) { } /** - * Unix timestamp specifying the last time at which the coupon can be redeemed. After the - * redeem_by date, the coupon can no longer be applied to new customers. + * Unix timestamp specifying the last time at which the coupon can be redeemed (cannot be set to + * more than 5 years in the future). After the redeem_by date, the coupon can no longer be + * applied to new customers. */ public Builder setRedeemBy(Long redeemBy) { this.redeemBy = redeemBy; diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index e12cebfad7c..2a94319b861 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -1738,12 +1738,12 @@ public static class TaxIdData { * kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, * {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code my_frp}, {@code * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code np_pan}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code - * rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, {@code + * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, + * {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ @SerializedName("type") Type type; @@ -1817,11 +1817,12 @@ public Builder putAllExtraParam(Map map) { * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code - * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, - * {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code - * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, - * {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code + * sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, + * {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code + * tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, + * {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code + * zw_tin} */ public Builder setType(CustomerCreateParams.TaxIdData.Type type) { this.type = type; @@ -2085,6 +2086,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java b/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java index b135c6adc4c..a2a30ff9124 100644 --- a/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java @@ -42,11 +42,11 @@ public class CustomerTaxIdCreateParams extends ApiRequestParams { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, - * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code - * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, + * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code + * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ @SerializedName("type") Type type; @@ -149,12 +149,12 @@ public Builder putAllExtraParam(Map map) { * kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, * {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code my_frp}, {@code * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code np_pan}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code - * rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, {@code + * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, + * {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ public Builder setType(CustomerTaxIdCreateParams.Type type) { this.type = type; @@ -418,6 +418,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 3566d4da7b0..8797706e760 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -1409,11 +1409,12 @@ public static class TaxId { * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code - * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, - * {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code - * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, - * {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code + * sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, + * {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code + * tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, + * {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code + * zw_tin} */ @SerializedName("type") Type type; @@ -1490,12 +1491,12 @@ public Builder putAllExtraParam(Map map) { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code * mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, * {@code no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code - * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, - * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code - * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code - * uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code - * zw_tin} + * ph_tin}, {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, + * {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code + * sr_fin}, {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code + * uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, + * or {@code zw_tin} */ public Builder setType(InvoiceCreatePreviewParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -1759,6 +1760,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index 1d6717c1256..7aec63f319b 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -391,6 +391,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -417,11 +432,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -435,6 +452,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -446,7 +465,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCaptureParams.AmountDetails build() { return new PaymentIntentCaptureParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -475,6 +499,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 13ea2b047cc..669e9aff1b0 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -689,6 +689,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -715,11 +730,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -733,6 +750,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -744,7 +763,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentConfirmParams.AmountDetails build() { return new PaymentIntentConfirmParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -773,6 +797,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 @@ -5854,6 +5895,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -14346,7 +14390,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 9b21b69adff..f72c5652648 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -1092,6 +1092,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -1118,11 +1133,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -1136,6 +1153,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -1147,7 +1166,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCreateParams.AmountDetails build() { return new PaymentIntentCreateParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -1176,6 +1200,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 @@ -6375,6 +6416,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -14859,7 +14903,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 868dc107a0b..5c6ed24b654 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -319,6 +319,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -345,11 +360,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -363,6 +380,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -374,7 +393,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentIncrementAuthorizationParams.AmountDetails build() { return new PaymentIntentIncrementAuthorizationParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -403,6 +427,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 1a94270da8c..9225d5c5a09 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -991,6 +991,21 @@ public static class AmountDetails { @SerializedName("discount_amount") Object discountAmount; + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic errors + * in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic validation + * error to card networks. + */ + @SerializedName("enforce_arithmetic_validation") + Boolean enforceArithmeticValidation; + /** * 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 @@ -1017,11 +1032,13 @@ public static class AmountDetails { private AmountDetails( Object discountAmount, + Boolean enforceArithmeticValidation, Map extraParams, Object lineItems, Object shipping, Object tax) { this.discountAmount = discountAmount; + this.enforceArithmeticValidation = enforceArithmeticValidation; this.extraParams = extraParams; this.lineItems = lineItems; this.shipping = shipping; @@ -1035,6 +1052,8 @@ public static Builder builder() { public static class Builder { private Object discountAmount; + private Boolean enforceArithmeticValidation; + private Map extraParams; private Object lineItems; @@ -1046,7 +1065,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentUpdateParams.AmountDetails build() { return new PaymentIntentUpdateParams.AmountDetails( - this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + this.discountAmount, + this.enforceArithmeticValidation, + this.extraParams, + this.lineItems, + this.shipping, + this.tax); } /** @@ -1075,6 +1099,23 @@ public Builder setDiscountAmount(EmptyParam discountAmount) { return this; } + /** + * Set to {@code false} to return arithmetic validation errors in the response without failing + * the request. Use this when you want the operation to proceed regardless of arithmetic + * errors in the line item data. + * + *

Omit or set to {@code true} to immediately return a 400 error when arithmetic validation + * fails. Use this for strict validation that prevents processing with line item data that has + * arithmetic inconsistencies. + * + *

For card payments, Stripe doesn't send line item data if there's an arithmetic + * validation error to card networks. + */ + public Builder setEnforceArithmeticValidation(Boolean enforceArithmeticValidation) { + this.enforceArithmeticValidation = enforceArithmeticValidation; + 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 @@ -5954,6 +5995,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -14658,7 +14702,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 8a8146b7349..5b70c912672 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -62,12 +62,15 @@ public class PaymentLinkCreateParams extends ApiRequestParams { /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("custom_fields") List customFields; - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ @SerializedName("custom_text") CustomText customText; @@ -476,7 +479,10 @@ public Builder addAllCustomField(List eleme return this; } - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ public Builder setCustomText(PaymentLinkCreateParams.CustomText customText) { this.customText = customText; return this; @@ -6750,7 +6756,10 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You can't + * set this parameter if {@code ui_mode} is {@code custom}. + */ @SerializedName("required") Required required; @@ -6813,7 +6822,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ public Builder setRequired(PaymentLinkCreateParams.TaxIdCollection.Required required) { this.required = required; return this; diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 939c7cc1595..fbf7d674611 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -39,12 +39,15 @@ public class PaymentLinkUpdateParams extends ApiRequestParams { /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("custom_fields") Object customFields; - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ @SerializedName("custom_text") CustomText customText; @@ -362,7 +365,7 @@ public Builder addAllCustomField(List eleme /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setCustomFields(EmptyParam customFields) { this.customFields = customFields; @@ -371,14 +374,17 @@ public Builder setCustomFields(EmptyParam customFields) { /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setCustomFields(List customFields) { this.customFields = customFields; return this; } - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ public Builder setCustomText(PaymentLinkUpdateParams.CustomText customText) { this.customText = customText; return this; @@ -5588,7 +5594,10 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You can't + * set this parameter if {@code ui_mode} is {@code custom}. + */ @SerializedName("required") Required required; @@ -5651,7 +5660,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ public Builder setRequired(PaymentLinkUpdateParams.TaxIdCollection.Required required) { this.required = required; return this; diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java index 88173144d23..a4cae983f99 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java @@ -210,8 +210,8 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { /** * Meal vouchers in France, or “titres-restaurant”, is a local benefits program commonly offered * by employers for their employees to purchase prepared food and beverages on working days. Check - * this page for more - * details. + * this page for + * more details. */ @SerializedName("fr_meal_voucher_conecs") FrMealVoucherConecs frMealVoucherConecs; @@ -1109,8 +1109,8 @@ public Builder setFpx(PaymentMethodConfigurationCreateParams.Fpx fpx) { /** * Meal vouchers in France, or “titres-restaurant”, is a local benefits program commonly offered * by employers for their employees to purchase prepared food and beverages on working days. - * Check this page for - * more details. + * Check this page + * for more details. */ public Builder setFrMealVoucherConecs( PaymentMethodConfigurationCreateParams.FrMealVoucherConecs frMealVoucherConecs) { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java index a1aeee447ef..1261aa9fceb 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java @@ -215,8 +215,8 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { /** * Meal vouchers in France, or “titres-restaurant”, is a local benefits program commonly offered * by employers for their employees to purchase prepared food and beverages on working days. Check - * this page for more - * details. + * this page for + * more details. */ @SerializedName("fr_meal_voucher_conecs") FrMealVoucherConecs frMealVoucherConecs; @@ -1116,8 +1116,8 @@ public Builder setFpx(PaymentMethodConfigurationUpdateParams.Fpx fpx) { /** * Meal vouchers in France, or “titres-restaurant”, is a local benefits program commonly offered * by employers for their employees to purchase prepared food and beverages on working days. - * Check this page for - * more details. + * Check this page + * for more details. */ public Builder setFrMealVoucherConecs( PaymentMethodConfigurationUpdateParams.FrMealVoucherConecs frMealVoucherConecs) { diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index ba1d8389e5e..6a80db12abd 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -3476,6 +3476,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index 09ecee2dc4b..6758c5ef32b 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -3724,6 +3724,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -8291,7 +8294,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 6222f201ccc..df0d34e227b 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -4260,6 +4260,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -8825,7 +8828,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 7a5c6be9f37..60c1dd1bbb0 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -3731,6 +3731,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("abn_amro") ABN_AMRO("abn_amro"), + @SerializedName("adyen") + ADYEN("adyen"), + @SerializedName("asn_bank") ASN_BANK("asn_bank"), @@ -8460,7 +8463,13 @@ public enum Version implements ApiRequestParams.EnumParam { N2__1__0("2.1.0"), @SerializedName("2.2.0") - N2__2__0("2.2.0"); + N2__2__0("2.2.0"), + + @SerializedName("2.3.0") + N2__3__0("2.3.0"), + + @SerializedName("2.3.1") + N2__3__1("2.3.1"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java index a9dac7a769c..509ab49c3b2 100644 --- a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java @@ -42,11 +42,11 @@ public class TaxIdCollectionCreateParams extends ApiRequestParams { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, - * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code - * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, + * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code + * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ @SerializedName("type") Type type; @@ -149,12 +149,12 @@ public Builder putAllExtraParam(Map map) { * kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, * {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code my_frp}, {@code * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code np_pan}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code - * rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, {@code + * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, + * {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ public Builder setType(TaxIdCollectionCreateParams.Type type) { this.type = type; @@ -418,6 +418,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/TaxIdCreateParams.java b/src/main/java/com/stripe/param/TaxIdCreateParams.java index f0e76ac3d39..548215820cd 100644 --- a/src/main/java/com/stripe/param/TaxIdCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCreateParams.java @@ -46,11 +46,11 @@ public class TaxIdCreateParams extends ApiRequestParams { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, - * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code - * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, + * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code + * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ @SerializedName("type") Type type; @@ -163,12 +163,12 @@ public Builder setOwner(TaxIdCreateParams.Owner owner) { * kz_bin}, {@code la_tin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, * {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, {@code my_frp}, {@code * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code np_pan}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code - * rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, - * {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code th_vat}, {@code - * tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code - * vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code pl_nip}, {@code + * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, + * {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, {@code + * th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, + * {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code + * ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} */ public Builder setType(TaxIdCreateParams.Type type) { this.type = type; @@ -573,6 +573,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 49d3c528142..fe2ad8eea9d 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -22,7 +22,10 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName("adaptive_pricing") AdaptivePricing adaptivePricing; - /** Configure actions after a Checkout Session has expired. */ + /** + * Configure actions after a Checkout Session has expired. You can't set this parameter if {@code + * ui_mode} is {@code custom}. + */ @SerializedName("after_expiration") AfterExpiration afterExpiration; @@ -80,12 +83,15 @@ public class SessionCreateParams extends ApiRequestParams { /** * Collect additional information from your customer using custom fields. Up to 3 fields are - * supported. + * supported. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("custom_fields") List customFields; - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ @SerializedName("custom_text") CustomText customText; @@ -240,6 +246,8 @@ public class SessionCreateParams extends ApiRequestParams { * *

If a Customer is created or provided, * the names can be saved to the Customer object as well. + * + *

You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("name_collection") NameCollection nameCollection; @@ -257,12 +265,15 @@ public class SessionCreateParams extends ApiRequestParams { * *

For {@code subscription} mode, there is a maximum of 20 line items and optional items with * recurring Prices and 20 line items and optional items with one-time Prices. + * + *

You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("optional_items") List optionalItems; /** * Where the user is coming from. This informs the optimizations that are applied to the session. + * You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("origin_context") OriginContext originContext; @@ -388,7 +399,7 @@ public class SessionCreateParams extends ApiRequestParams { * Describes the type of transaction being performed by Checkout in order to customize relevant * text on the page, such as the submit button. {@code submit_type} can only be specified on * Checkout Sessions in {@code payment} or {@code subscription} mode. If blank or {@code auto}, - * {@code pay} is used. + * {@code pay} is used. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("submit_type") SubmitType submitType; @@ -694,7 +705,10 @@ public Builder setAdaptivePricing(SessionCreateParams.AdaptivePricing adaptivePr return this; } - /** Configure actions after a Checkout Session has expired. */ + /** + * Configure actions after a Checkout Session has expired. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ public Builder setAfterExpiration(SessionCreateParams.AfterExpiration afterExpiration) { this.afterExpiration = afterExpiration; return this; @@ -795,7 +809,10 @@ public Builder addAllCustomField(List elements) return this; } - /** Display additional text for your customers using custom text. */ + /** + * Display additional text for your customers using custom text. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ public Builder setCustomText(SessionCreateParams.CustomText customText) { this.customText = customText; return this; @@ -1075,6 +1092,8 @@ public Builder setMode(SessionCreateParams.Mode mode) { * *

If a Customer is created or provided, * the names can be saved to the Customer object as well. + * + *

You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setNameCollection(SessionCreateParams.NameCollection nameCollection) { this.nameCollection = nameCollection; @@ -1109,7 +1128,7 @@ public Builder addAllOptionalItem(List element /** * Where the user is coming from. This informs the optimizations that are applied to the - * session. + * session. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setOriginContext(SessionCreateParams.OriginContext originContext) { this.originContext = originContext; @@ -1297,7 +1316,7 @@ public Builder addAllShippingOption(List ele * Describes the type of transaction being performed by Checkout in order to customize relevant * text on the page, such as the submit button. {@code submit_type} can only be specified on * Checkout Sessions in {@code payment} or {@code subscription} mode. If blank or {@code auto}, - * {@code pay} is used. + * {@code pay} is used. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setSubmitType(SessionCreateParams.SubmitType submitType) { this.submitType = submitType; @@ -4757,7 +4776,8 @@ public static class LineItem { /** * The tax rates that will be applied to * this line item depending on the customer's billing/shipping address. We currently support the - * following countries: US, GB, AU, and all countries in the EU. + * following countries: US, GB, AU, and all countries in the EU. You can't set this parameter if + * {@code ui_mode} is {@code custom}. */ @SerializedName("dynamic_tax_rates") List dynamicTaxRates; @@ -7143,7 +7163,10 @@ public enum AllowRedisplay implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class PaymentMethodOptions { - /** contains details about the ACSS Debit payment method options. */ + /** + * contains details about the ACSS Debit payment method options. You can't set this parameter if + * {@code ui_mode} is {@code custom}. + */ @SerializedName("acss_debit") AcssDebit acssDebit; @@ -7575,7 +7598,10 @@ public SessionCreateParams.PaymentMethodOptions build() { this.wechatPay); } - /** contains details about the ACSS Debit payment method options. */ + /** + * contains details about the ACSS Debit payment method options. You can't set this parameter + * if {@code ui_mode} is {@code custom}. + */ public Builder setAcssDebit(SessionCreateParams.PaymentMethodOptions.AcssDebit acssDebit) { this.acssDebit = acssDebit; return this; @@ -9863,7 +9889,7 @@ public static class Card { /** * Restrictions to apply to the card payment method. For example, you can block specific card - * brands. + * brands. You can't set this parameter if {@code ui_mode} is {@code custom}. */ @SerializedName("restrictions") Restrictions restrictions; @@ -10087,7 +10113,7 @@ public Builder setRequestThreeDSecure( /** * Restrictions to apply to the card payment method. For example, you can block specific - * card brands. + * card brands. You can't set this parameter if {@code ui_mode} is {@code custom}. */ public Builder setRestrictions( SessionCreateParams.PaymentMethodOptions.Card.Restrictions restrictions) { @@ -18692,7 +18718,10 @@ public static class SubscriptionData { @SerializedName("application_fee_percent") BigDecimal applicationFeePercent; - /** A future timestamp to anchor the subscription's billing cycle for new subscriptions. */ + /** + * A future timestamp to anchor the subscription's billing cycle for new subscriptions. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ @SerializedName("billing_cycle_anchor") Long billingCycleAnchor; @@ -18870,7 +18899,10 @@ public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { return this; } - /** A future timestamp to anchor the subscription's billing cycle for new subscriptions. */ + /** + * A future timestamp to anchor the subscription's billing cycle for new subscriptions. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ public Builder setBillingCycleAnchor(Long billingCycleAnchor) { this.billingCycleAnchor = billingCycleAnchor; return this; @@ -19723,7 +19755,10 @@ public static class TaxIdCollection { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You can't + * set this parameter if {@code ui_mode} is {@code custom}. + */ @SerializedName("required") Required required; @@ -19785,7 +19820,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Describes whether a tax ID is required during checkout. Defaults to {@code never}. */ + /** + * Describes whether a tax ID is required during checkout. Defaults to {@code never}. You + * can't set this parameter if {@code ui_mode} is {@code custom}. + */ public Builder setRequired(SessionCreateParams.TaxIdCollection.Required required) { this.required = required; return this; diff --git a/src/main/java/com/stripe/param/radar/PaymentEvaluationCreateParams.java b/src/main/java/com/stripe/param/radar/PaymentEvaluationCreateParams.java new file mode 100644 index 00000000000..d9072f65bdf --- /dev/null +++ b/src/main/java/com/stripe/param/radar/PaymentEvaluationCreateParams.java @@ -0,0 +1,1483 @@ +// File generated from our OpenAPI spec +package com.stripe.param.radar; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentEvaluationCreateParams extends ApiRequestParams { + /** Details about the Client Device Metadata to associate with the payment evaluation. */ + @SerializedName("client_device_metadata_details") + ClientDeviceMetadataDetails clientDeviceMetadataDetails; + + /** + * Required. Details about the customer associated with the payment evaluation. + */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** Required. Details about the payment. */ + @SerializedName("payment_details") + PaymentDetails paymentDetails; + + private PaymentEvaluationCreateParams( + ClientDeviceMetadataDetails clientDeviceMetadataDetails, + CustomerDetails customerDetails, + List expand, + Map extraParams, + Map metadata, + PaymentDetails paymentDetails) { + this.clientDeviceMetadataDetails = clientDeviceMetadataDetails; + this.customerDetails = customerDetails; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + this.paymentDetails = paymentDetails; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ClientDeviceMetadataDetails clientDeviceMetadataDetails; + + private CustomerDetails customerDetails; + + private List expand; + + private Map extraParams; + + private Map metadata; + + private PaymentDetails paymentDetails; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams build() { + return new PaymentEvaluationCreateParams( + this.clientDeviceMetadataDetails, + this.customerDetails, + this.expand, + this.extraParams, + this.metadata, + this.paymentDetails); + } + + /** Details about the Client Device Metadata to associate with the payment evaluation. */ + public Builder setClientDeviceMetadataDetails( + PaymentEvaluationCreateParams.ClientDeviceMetadataDetails clientDeviceMetadataDetails) { + this.clientDeviceMetadataDetails = clientDeviceMetadataDetails; + return this; + } + + /** + * Required. Details about the customer associated with the payment evaluation. + */ + public Builder setCustomerDetails( + PaymentEvaluationCreateParams.CustomerDetails customerDetails) { + this.customerDetails = customerDetails; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentEvaluationCreateParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentEvaluationCreateParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + 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 + * PaymentEvaluationCreateParams#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 PaymentEvaluationCreateParams#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 `metadata` 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 + * PaymentEvaluationCreateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` 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 PaymentEvaluationCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** Required. Details about the payment. */ + public Builder setPaymentDetails(PaymentEvaluationCreateParams.PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ClientDeviceMetadataDetails { + /** + * 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. ID for the Radar Session to associate with the payment evaluation. + * A Radar Session is a snapshot of + * the browser metadata and device details that help Radar make more accurate predictions on + * your payments. + */ + @SerializedName("radar_session") + String radarSession; + + private ClientDeviceMetadataDetails(Map extraParams, String radarSession) { + this.extraParams = extraParams; + this.radarSession = radarSession; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String radarSession; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.ClientDeviceMetadataDetails build() { + return new PaymentEvaluationCreateParams.ClientDeviceMetadataDetails( + this.extraParams, this.radarSession); + } + + /** + * 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 + * PaymentEvaluationCreateParams.ClientDeviceMetadataDetails#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 PaymentEvaluationCreateParams.ClientDeviceMetadataDetails#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. ID for the Radar Session to associate with the payment + * evaluation. A Radar Session is a + * snapshot of the browser metadata and device details that help Radar make more accurate + * predictions on your payments. + */ + public Builder setRadarSession(String radarSession) { + this.radarSession = radarSession; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails { + /** The ID of the customer associated with the payment evaluation. */ + @SerializedName("customer") + String customer; + + /** The ID of the Account representing the customer associated with the payment evaluation. */ + @SerializedName("customer_account") + String customerAccount; + + /** The customer's email address. */ + @SerializedName("email") + String email; + + /** + * 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 customer's full name or business name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + + private CustomerDetails( + String customer, + String customerAccount, + String email, + Map extraParams, + String name, + String phone) { + this.customer = customer; + this.customerAccount = customerAccount; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String customer; + + private String customerAccount; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.CustomerDetails build() { + return new PaymentEvaluationCreateParams.CustomerDetails( + this.customer, + this.customerAccount, + this.email, + this.extraParams, + this.name, + this.phone); + } + + /** The ID of the customer associated with the payment evaluation. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** The ID of the Account representing the customer associated with the payment evaluation. */ + public Builder setCustomerAccount(String customerAccount) { + this.customerAccount = customerAccount; + return this; + } + + /** The customer's email address. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * PaymentEvaluationCreateParams.CustomerDetails#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 PaymentEvaluationCreateParams.CustomerDetails#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 customer's full name or business name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The customer's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails { + /** + * Required. The intended amount to collect with this payment. A positive + * integer representing how much to charge in the smallest currency unit (for + * example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). + */ + @SerializedName("amount") + Long amount; + + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String description; + + /** + * 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 about the payment's customer presence and type. */ + @SerializedName("money_movement_details") + MoneyMovementDetails moneyMovementDetails; + + /** Required. Details about the payment method to use for the payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** Shipping details for the payment evaluation. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + /** Payment statement descriptor. */ + @SerializedName("statement_descriptor") + String statementDescriptor; + + private PaymentDetails( + Long amount, + String currency, + String description, + Map extraParams, + MoneyMovementDetails moneyMovementDetails, + PaymentMethodDetails paymentMethodDetails, + ShippingDetails shippingDetails, + String statementDescriptor) { + this.amount = amount; + this.currency = currency; + this.description = description; + this.extraParams = extraParams; + this.moneyMovementDetails = moneyMovementDetails; + this.paymentMethodDetails = paymentMethodDetails; + this.shippingDetails = shippingDetails; + this.statementDescriptor = statementDescriptor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String currency; + + private String description; + + private Map extraParams; + + private MoneyMovementDetails moneyMovementDetails; + + private PaymentMethodDetails paymentMethodDetails; + + private ShippingDetails shippingDetails; + + private String statementDescriptor; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails build() { + return new PaymentEvaluationCreateParams.PaymentDetails( + this.amount, + this.currency, + this.description, + this.extraParams, + this.moneyMovementDetails, + this.paymentMethodDetails, + this.shippingDetails, + this.statementDescriptor); + } + + /** + * Required. The intended amount to collect with this payment. A positive + * integer representing how much to charge in the smallest currency unit (for + * example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). + */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + public Builder setDescription(String 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 + * PaymentEvaluationCreateParams.PaymentDetails#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 PaymentEvaluationCreateParams.PaymentDetails#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 about the payment's customer presence and type. */ + public Builder setMoneyMovementDetails( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails moneyMovementDetails) { + this.moneyMovementDetails = moneyMovementDetails; + return this; + } + + /** Required. Details about the payment method to use for the payment. */ + public Builder setPaymentMethodDetails( + PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails paymentMethodDetails) { + this.paymentMethodDetails = paymentMethodDetails; + return this; + } + + /** Shipping details for the payment evaluation. */ + public Builder setShippingDetails( + PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + + /** Payment statement descriptor. */ + public Builder setStatementDescriptor(String statementDescriptor) { + this.statementDescriptor = statementDescriptor; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MoneyMovementDetails { + /** Describes card money movement details for the payment evaluation. */ + @SerializedName("card") + Card card; + + /** + * 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. Describes the type of money movement. Currently only {@code + * card} is supported. + */ + @SerializedName("money_movement_type") + MoneyMovementType moneyMovementType; + + private MoneyMovementDetails( + Card card, Map extraParams, MoneyMovementType moneyMovementType) { + this.card = card; + this.extraParams = extraParams; + this.moneyMovementType = moneyMovementType; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private Map extraParams; + + private MoneyMovementType moneyMovementType; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails build() { + return new PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails( + this.card, this.extraParams, this.moneyMovementType); + } + + /** Describes card money movement details for the payment evaluation. */ + public Builder setCard( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card card) { + this.card = card; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails#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 + * PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails#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. Describes the type of money movement. Currently only {@code + * card} is supported. + */ + public Builder setMoneyMovementType( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.MoneyMovementType + moneyMovementType) { + this.moneyMovementType = moneyMovementType; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** Describes the presence of the customer during the payment. */ + @SerializedName("customer_presence") + CustomerPresence customerPresence; + + /** + * 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; + + /** Describes the type of payment. */ + @SerializedName("payment_type") + PaymentType paymentType; + + private Card( + CustomerPresence customerPresence, + Map extraParams, + PaymentType paymentType) { + this.customerPresence = customerPresence; + this.extraParams = extraParams; + this.paymentType = paymentType; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CustomerPresence customerPresence; + + private Map extraParams; + + private PaymentType paymentType; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card build() { + return new PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card( + this.customerPresence, this.extraParams, this.paymentType); + } + + /** Describes the presence of the customer during the payment. */ + public Builder setCustomerPresence( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card + .CustomerPresence + customerPresence) { + this.customerPresence = customerPresence; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card#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 + * PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Describes the type of payment. */ + public Builder setPaymentType( + PaymentEvaluationCreateParams.PaymentDetails.MoneyMovementDetails.Card.PaymentType + paymentType) { + this.paymentType = paymentType; + return this; + } + } + + public enum CustomerPresence implements ApiRequestParams.EnumParam { + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CustomerPresence(String value) { + this.value = value; + } + } + + public enum PaymentType implements ApiRequestParams.EnumParam { + @SerializedName("one_off") + ONE_OFF("one_off"), + + @SerializedName("recurring") + RECURRING("recurring"), + + @SerializedName("setup_one_off") + SETUP_ONE_OFF("setup_one_off"), + + @SerializedName("setup_recurring") + SETUP_RECURRING("setup_recurring"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentType(String value) { + this.value = value; + } + } + } + + public enum MoneyMovementType implements ApiRequestParams.EnumParam { + @SerializedName("card") + CARD("card"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + MoneyMovementType(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodDetails { + /** Billing information associated with the payment evaluation. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** + * 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. ID of the payment method used in this payment evaluation. */ + @SerializedName("payment_method") + String paymentMethod; + + private PaymentMethodDetails( + BillingDetails billingDetails, Map extraParams, String paymentMethod) { + this.billingDetails = billingDetails; + this.extraParams = extraParams; + this.paymentMethod = paymentMethod; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingDetails billingDetails; + + private Map extraParams; + + private String paymentMethod; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails build() { + return new PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails( + this.billingDetails, this.extraParams, this.paymentMethod); + } + + /** Billing information associated with the payment evaluation. */ + public Builder setBillingDetails( + PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails + billingDetails) { + this.billingDetails = billingDetails; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails#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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails#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. ID of the payment method used in this payment evaluation. */ + public Builder setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails { + /** Billing address. */ + @SerializedName("address") + Address address; + + /** Email address. */ + @SerializedName("email") + String email; + + /** + * 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; + + /** Full name. */ + @SerializedName("name") + String name; + + /** Billing phone number (including extension). */ + @SerializedName("phone") + String phone; + + private BillingDetails( + Address address, + String email, + Map extraParams, + String name, + String phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails + build() { + return new PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails + .BillingDetails(this.address, this.email, this.extraParams, this.name, this.phone); + } + + /** Billing address. */ + public Builder setAddress( + PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails + .Address + address) { + this.address = address; + return this; + } + + /** Email address. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails#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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Full name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Billing phone number (including extension). */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * 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; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO 3166-2). + */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails + .Address + build() { + return new PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails + .BillingDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails.Address#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 + * PaymentEvaluationCreateParams.PaymentDetails.PaymentMethodDetails.BillingDetails.Address#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State, county, province, or region (ISO 3166-2). + */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails { + /** Shipping address. */ + @SerializedName("address") + Address address; + + /** + * 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; + + /** Shipping name. */ + @SerializedName("name") + String name; + + /** Shipping phone number. */ + @SerializedName("phone") + String phone; + + private ShippingDetails( + Address address, Map extraParams, String name, String phone) { + this.address = address; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails build() { + return new PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); + } + + /** Shipping address. */ + public Builder setAddress( + PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address address) { + this.address = address; + 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 PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails#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 PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Shipping name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Shipping phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * 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; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO 3166-2). + */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address build() { + return new PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + 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 + * PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address#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 + * PaymentEvaluationCreateParams.PaymentDetails.ShippingDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State, county, province, or region (ISO 3166-2). + */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + } +} diff --git a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java index 10433a7db45..e11770bc6ca 100644 --- a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java @@ -646,11 +646,12 @@ public static class TaxId { * ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code mx_rfc}, * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code * no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, - * {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code - * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code sv_nit}, - * {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code - * ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, - * {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code zw_tin} + * {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code + * sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, + * {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code + * tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, + * {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code + * zw_tin} */ @SerializedName("type") Type type; @@ -727,12 +728,12 @@ public Builder putAllExtraParam(Map map) { * {@code ma_vat}, {@code md_vat}, {@code me_pib}, {@code mk_vat}, {@code mr_nif}, {@code * mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, * {@code no_voec}, {@code np_pan}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code - * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, - * {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code sr_fin}, {@code - * sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code - * uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, or {@code - * zw_tin} + * ph_tin}, {@code pl_nip}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, + * {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sn_ninea}, {@code + * sr_fin}, {@code sv_nit}, {@code th_vat}, {@code tj_tin}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code ug_tin}, {@code us_ein}, {@code uy_ruc}, {@code + * uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, {@code za_vat}, {@code zm_tin}, + * or {@code zw_tin} */ public Builder setType(CalculationCreateParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -996,6 +997,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("ph_tin") PH_TIN("ph_tin"), + @SerializedName("pl_nip") + PL_NIP("pl_nip"), + @SerializedName("ro_tin") RO_TIN("ro_tin"), diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java index e3a2a6341cc..d4013302e2b 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java @@ -51,7 +51,7 @@ public class ConfigurationCreateParams extends ApiRequestParams { @SerializedName("stripe_s700") StripeS700 stripeS700; - /** Tipping configurations for readers. supporting on-reader tips */ + /** Tipping configurations for readers that support on-reader tips. */ @SerializedName("tipping") Object tipping; @@ -225,13 +225,13 @@ public Builder setStripeS700(ConfigurationCreateParams.StripeS700 stripeS700) { return this; } - /** Tipping configurations for readers. supporting on-reader tips */ + /** Tipping configurations for readers that support on-reader tips. */ public Builder setTipping(ConfigurationCreateParams.Tipping tipping) { this.tipping = tipping; return this; } - /** Tipping configurations for readers. supporting on-reader tips */ + /** Tipping configurations for readers that support on-reader tips. */ public Builder setTipping(EmptyParam tipping) { this.tipping = tipping; return this; @@ -664,10 +664,6 @@ public static class Tipping { @SerializedName("aud") Aud aud; - /** Tipping configuration for BGN. */ - @SerializedName("bgn") - Bgn bgn; - /** Tipping configuration for CAD. */ @SerializedName("cad") Cad cad; @@ -756,7 +752,6 @@ public static class Tipping { private Tipping( Aed aed, Aud aud, - Bgn bgn, Cad cad, Chf chf, Czk czk, @@ -779,7 +774,6 @@ private Tipping( Usd usd) { this.aed = aed; this.aud = aud; - this.bgn = bgn; this.cad = cad; this.chf = chf; this.czk = czk; @@ -811,8 +805,6 @@ public static class Builder { private Aud aud; - private Bgn bgn; - private Cad cad; private Chf chf; @@ -858,7 +850,6 @@ public ConfigurationCreateParams.Tipping build() { return new ConfigurationCreateParams.Tipping( this.aed, this.aud, - this.bgn, this.cad, this.chf, this.czk, @@ -893,12 +884,6 @@ public Builder setAud(ConfigurationCreateParams.Tipping.Aud aud) { return this; } - /** Tipping configuration for BGN. */ - public Builder setBgn(ConfigurationCreateParams.Tipping.Bgn bgn) { - this.bgn = bgn; - return this; - } - /** Tipping configuration for CAD. */ public Builder setCad(ConfigurationCreateParams.Tipping.Cad cad) { this.cad = cad; @@ -1336,154 +1321,6 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Bgn { - /** - * 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; - - /** Fixed amounts displayed when collecting a tip. */ - @SerializedName("fixed_amounts") - List fixedAmounts; - - /** Percentages displayed when collecting a tip. */ - @SerializedName("percentages") - List percentages; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - @SerializedName("smart_tip_threshold") - Long smartTipThreshold; - - private Bgn( - Map extraParams, - List fixedAmounts, - List percentages, - Long smartTipThreshold) { - this.extraParams = extraParams; - this.fixedAmounts = fixedAmounts; - this.percentages = percentages; - this.smartTipThreshold = smartTipThreshold; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Map extraParams; - - private List fixedAmounts; - - private List percentages; - - private Long smartTipThreshold; - - /** Finalize and obtain parameter instance from this builder. */ - public ConfigurationCreateParams.Tipping.Bgn build() { - return new ConfigurationCreateParams.Tipping.Bgn( - this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); - } - - /** - * 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 ConfigurationCreateParams.Tipping.Bgn#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 ConfigurationCreateParams.Tipping.Bgn#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 an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationCreateParams.Tipping.Bgn#fixedAmounts} for the field documentation. - */ - public Builder addFixedAmount(Long element) { - if (this.fixedAmounts == null) { - this.fixedAmounts = new ArrayList<>(); - } - this.fixedAmounts.add(element); - return this; - } - - /** - * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationCreateParams.Tipping.Bgn#fixedAmounts} for the field documentation. - */ - public Builder addAllFixedAmount(List elements) { - if (this.fixedAmounts == null) { - this.fixedAmounts = new ArrayList<>(); - } - this.fixedAmounts.addAll(elements); - return this; - } - - /** - * Add an element to `percentages` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationCreateParams.Tipping.Bgn#percentages} for the field documentation. - */ - public Builder addPercentage(Long element) { - if (this.percentages == null) { - this.percentages = new ArrayList<>(); - } - this.percentages.add(element); - return this; - } - - /** - * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationCreateParams.Tipping.Bgn#percentages} for the field documentation. - */ - public Builder addAllPercentage(List elements) { - if (this.percentages == null) { - this.percentages = new ArrayList<>(); - } - this.percentages.addAll(elements); - return this; - } - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - public Builder setSmartTipThreshold(Long smartTipThreshold) { - this.smartTipThreshold = smartTipThreshold; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class Cad { diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java index 382ad087f68..f51015f5fdd 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java @@ -700,10 +700,6 @@ public static class Tipping { @SerializedName("aud") Aud aud; - /** Tipping configuration for BGN. */ - @SerializedName("bgn") - Bgn bgn; - /** Tipping configuration for CAD. */ @SerializedName("cad") Cad cad; @@ -792,7 +788,6 @@ public static class Tipping { private Tipping( Aed aed, Aud aud, - Bgn bgn, Cad cad, Chf chf, Czk czk, @@ -815,7 +810,6 @@ private Tipping( Usd usd) { this.aed = aed; this.aud = aud; - this.bgn = bgn; this.cad = cad; this.chf = chf; this.czk = czk; @@ -847,8 +841,6 @@ public static class Builder { private Aud aud; - private Bgn bgn; - private Cad cad; private Chf chf; @@ -894,7 +886,6 @@ public ConfigurationUpdateParams.Tipping build() { return new ConfigurationUpdateParams.Tipping( this.aed, this.aud, - this.bgn, this.cad, this.chf, this.czk, @@ -929,12 +920,6 @@ public Builder setAud(ConfigurationUpdateParams.Tipping.Aud aud) { return this; } - /** Tipping configuration for BGN. */ - public Builder setBgn(ConfigurationUpdateParams.Tipping.Bgn bgn) { - this.bgn = bgn; - return this; - } - /** Tipping configuration for CAD. */ public Builder setCad(ConfigurationUpdateParams.Tipping.Cad cad) { this.cad = cad; @@ -1372,154 +1357,6 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Bgn { - /** - * 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; - - /** Fixed amounts displayed when collecting a tip. */ - @SerializedName("fixed_amounts") - List fixedAmounts; - - /** Percentages displayed when collecting a tip. */ - @SerializedName("percentages") - List percentages; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - @SerializedName("smart_tip_threshold") - Long smartTipThreshold; - - private Bgn( - Map extraParams, - List fixedAmounts, - List percentages, - Long smartTipThreshold) { - this.extraParams = extraParams; - this.fixedAmounts = fixedAmounts; - this.percentages = percentages; - this.smartTipThreshold = smartTipThreshold; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Map extraParams; - - private List fixedAmounts; - - private List percentages; - - private Long smartTipThreshold; - - /** Finalize and obtain parameter instance from this builder. */ - public ConfigurationUpdateParams.Tipping.Bgn build() { - return new ConfigurationUpdateParams.Tipping.Bgn( - this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); - } - - /** - * 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 ConfigurationUpdateParams.Tipping.Bgn#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 ConfigurationUpdateParams.Tipping.Bgn#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 an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationUpdateParams.Tipping.Bgn#fixedAmounts} for the field documentation. - */ - public Builder addFixedAmount(Long element) { - if (this.fixedAmounts == null) { - this.fixedAmounts = new ArrayList<>(); - } - this.fixedAmounts.add(element); - return this; - } - - /** - * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationUpdateParams.Tipping.Bgn#fixedAmounts} for the field documentation. - */ - public Builder addAllFixedAmount(List elements) { - if (this.fixedAmounts == null) { - this.fixedAmounts = new ArrayList<>(); - } - this.fixedAmounts.addAll(elements); - return this; - } - - /** - * Add an element to `percentages` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationUpdateParams.Tipping.Bgn#percentages} for the field documentation. - */ - public Builder addPercentage(Long element) { - if (this.percentages == null) { - this.percentages = new ArrayList<>(); - } - this.percentages.add(element); - return this; - } - - /** - * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` - * call, and subsequent calls adds additional elements to the original list. See {@link - * ConfigurationUpdateParams.Tipping.Bgn#percentages} for the field documentation. - */ - public Builder addAllPercentage(List elements) { - if (this.percentages == null) { - this.percentages = new ArrayList<>(); - } - this.percentages.addAll(elements); - return this; - } - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be - * displayed. - */ - public Builder setSmartTipThreshold(Long smartTipThreshold) { - this.smartTipThreshold = smartTipThreshold; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class Cad { diff --git a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java index 3ad20c561f6..7543b5309c1 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -32,6 +32,10 @@ public class AccountCreateParams extends ApiRequestParams { @SerializedName("contact_email") String contactEmail; + /** The default contact phone for the Account. */ + @SerializedName("contact_phone") + String contactPhone; + /** * A value indicating the Stripe dashboard this Account has access to. This will depend on which * configurations are enabled for this account. @@ -78,6 +82,7 @@ private AccountCreateParams( String accountToken, Configuration configuration, String contactEmail, + String contactPhone, Dashboard dashboard, Defaults defaults, String displayName, @@ -88,6 +93,7 @@ private AccountCreateParams( this.accountToken = accountToken; this.configuration = configuration; this.contactEmail = contactEmail; + this.contactPhone = contactPhone; this.dashboard = dashboard; this.defaults = defaults; this.displayName = displayName; @@ -108,6 +114,8 @@ public static class Builder { private String contactEmail; + private String contactPhone; + private Dashboard dashboard; private Defaults defaults; @@ -128,6 +136,7 @@ public AccountCreateParams build() { this.accountToken, this.configuration, this.contactEmail, + this.contactPhone, this.dashboard, this.defaults, this.displayName, @@ -161,6 +170,12 @@ public Builder setContactEmail(String contactEmail) { return this; } + /** The default contact phone for the Account. */ + public Builder setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + return this; + } + /** * A value indicating the Stripe dashboard this Account has access to. This will depend on which * configurations are enabled for this account. @@ -9589,6 +9604,10 @@ public static class BusinessDetails { @SerializedName("registered_name") String registeredName; + /** When the business was incorporated or registered. */ + @SerializedName("registration_date") + RegistrationDate registrationDate; + /** The business registration address of the business entity in non latin script. */ @SerializedName("script_addresses") ScriptAddresses scriptAddresses; @@ -9611,6 +9630,7 @@ private BusinessDetails( MonthlyEstimatedRevenue monthlyEstimatedRevenue, String phone, String registeredName, + RegistrationDate registrationDate, ScriptAddresses scriptAddresses, ScriptNames scriptNames, Structure structure) { @@ -9623,6 +9643,7 @@ private BusinessDetails( this.monthlyEstimatedRevenue = monthlyEstimatedRevenue; this.phone = phone; this.registeredName = registeredName; + this.registrationDate = registrationDate; this.scriptAddresses = scriptAddresses; this.scriptNames = scriptNames; this.structure = structure; @@ -9651,6 +9672,8 @@ public static class Builder { private String registeredName; + private RegistrationDate registrationDate; + private ScriptAddresses scriptAddresses; private ScriptNames scriptNames; @@ -9669,6 +9692,7 @@ public AccountCreateParams.Identity.BusinessDetails build() { this.monthlyEstimatedRevenue, this.phone, this.registeredName, + this.registrationDate, this.scriptAddresses, this.scriptNames, this.structure); @@ -9778,6 +9802,13 @@ public Builder setRegisteredName(String registeredName) { return this; } + /** When the business was incorporated or registered. */ + public Builder setRegistrationDate( + AccountCreateParams.Identity.BusinessDetails.RegistrationDate registrationDate) { + this.registrationDate = registrationDate; + return this; + } + /** The business registration address of the business entity in non latin script. */ public Builder setScriptAddresses( AccountCreateParams.Identity.BusinessDetails.ScriptAddresses scriptAddresses) { @@ -12129,6 +12160,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("gb_crn") GB_CRN("gb_crn"), + @SerializedName("gb_vat") + GB_VAT("gb_vat"), + @SerializedName("gi_crn") GI_CRN("gi_crn"), @@ -12518,6 +12552,107 @@ public Builder setValue(Long value) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RegistrationDate { + /** Required. The day of registration, between 1 and 31. */ + @SerializedName("day") + Long day; + + /** + * 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 month of registration, between 1 and 12. */ + @SerializedName("month") + Long month; + + /** Required. The four-digit year of registration. */ + @SerializedName("year") + Long year; + + private RegistrationDate(Long day, Map extraParams, Long month, Long year) { + this.day = day; + this.extraParams = extraParams; + this.month = month; + this.year = year; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long day; + + private Map extraParams; + + private Long month; + + private Long year; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Identity.BusinessDetails.RegistrationDate build() { + return new AccountCreateParams.Identity.BusinessDetails.RegistrationDate( + this.day, this.extraParams, this.month, this.year); + } + + /** Required. The day of registration, between 1 and 31. */ + public Builder setDay(Long day) { + this.day = day; + 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.Identity.BusinessDetails.RegistrationDate#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.Identity.BusinessDetails.RegistrationDate#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 month of registration, between 1 and 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** Required. The four-digit year of registration. */ + public Builder setYear(Long year) { + this.year = year; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class ScriptAddresses { diff --git a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java index 8c7eec1925b..80f89389a60 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java @@ -21,6 +21,10 @@ public class AccountTokenCreateParams extends ApiRequestParams { @SerializedName("contact_email") String contactEmail; + /** The default contact phone for the Account. */ + @SerializedName("contact_phone") + String contactPhone; + /** * A descriptive name for the Account. This name will be surfaced in the Stripe Dashboard and on * any invoices sent to the Account. @@ -42,8 +46,13 @@ public class AccountTokenCreateParams extends ApiRequestParams { Identity identity; private AccountTokenCreateParams( - String contactEmail, String displayName, Map extraParams, Identity identity) { + String contactEmail, + String contactPhone, + String displayName, + Map extraParams, + Identity identity) { this.contactEmail = contactEmail; + this.contactPhone = contactPhone; this.displayName = displayName; this.extraParams = extraParams; this.identity = identity; @@ -56,6 +65,8 @@ public static Builder builder() { public static class Builder { private String contactEmail; + private String contactPhone; + private String displayName; private Map extraParams; @@ -65,7 +76,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public AccountTokenCreateParams build() { return new AccountTokenCreateParams( - this.contactEmail, this.displayName, this.extraParams, this.identity); + this.contactEmail, this.contactPhone, this.displayName, this.extraParams, this.identity); } /** @@ -77,6 +88,12 @@ public Builder setContactEmail(String contactEmail) { return this; } + /** The default contact phone for the Account. */ + public Builder setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + return this; + } + /** * A descriptive name for the Account. This name will be surfaced in the Stripe Dashboard and on * any invoices sent to the Account. @@ -1005,6 +1022,10 @@ public static class BusinessDetails { @SerializedName("registered_name") String registeredName; + /** When the business was incorporated or registered. */ + @SerializedName("registration_date") + RegistrationDate registrationDate; + /** The business registration address of the business entity in non latin script. */ @SerializedName("script_addresses") ScriptAddresses scriptAddresses; @@ -1027,6 +1048,7 @@ private BusinessDetails( MonthlyEstimatedRevenue monthlyEstimatedRevenue, String phone, String registeredName, + RegistrationDate registrationDate, ScriptAddresses scriptAddresses, ScriptNames scriptNames, Structure structure) { @@ -1039,6 +1061,7 @@ private BusinessDetails( this.monthlyEstimatedRevenue = monthlyEstimatedRevenue; this.phone = phone; this.registeredName = registeredName; + this.registrationDate = registrationDate; this.scriptAddresses = scriptAddresses; this.scriptNames = scriptNames; this.structure = structure; @@ -1067,6 +1090,8 @@ public static class Builder { private String registeredName; + private RegistrationDate registrationDate; + private ScriptAddresses scriptAddresses; private ScriptNames scriptNames; @@ -1085,6 +1110,7 @@ public AccountTokenCreateParams.Identity.BusinessDetails build() { this.monthlyEstimatedRevenue, this.phone, this.registeredName, + this.registrationDate, this.scriptAddresses, this.scriptNames, this.structure); @@ -1196,6 +1222,13 @@ public Builder setRegisteredName(String registeredName) { return this; } + /** When the business was incorporated or registered. */ + public Builder setRegistrationDate( + AccountTokenCreateParams.Identity.BusinessDetails.RegistrationDate registrationDate) { + this.registrationDate = registrationDate; + return this; + } + /** The business registration address of the business entity in non latin script. */ public Builder setScriptAddresses( AccountTokenCreateParams.Identity.BusinessDetails.ScriptAddresses scriptAddresses) { @@ -3562,6 +3595,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("gb_crn") GB_CRN("gb_crn"), + @SerializedName("gb_vat") + GB_VAT("gb_vat"), + @SerializedName("gi_crn") GI_CRN("gi_crn"), @@ -3952,6 +3988,107 @@ public Builder setValue(Long value) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RegistrationDate { + /** Required. The day of registration, between 1 and 31. */ + @SerializedName("day") + Long day; + + /** + * 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 month of registration, between 1 and 12. */ + @SerializedName("month") + Long month; + + /** Required. The four-digit year of registration. */ + @SerializedName("year") + Long year; + + private RegistrationDate(Long day, Map extraParams, Long month, Long year) { + this.day = day; + this.extraParams = extraParams; + this.month = month; + this.year = year; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long day; + + private Map extraParams; + + private Long month; + + private Long year; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountTokenCreateParams.Identity.BusinessDetails.RegistrationDate build() { + return new AccountTokenCreateParams.Identity.BusinessDetails.RegistrationDate( + this.day, this.extraParams, this.month, this.year); + } + + /** Required. The day of registration, between 1 and 31. */ + public Builder setDay(Long day) { + this.day = day; + 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 + * AccountTokenCreateParams.Identity.BusinessDetails.RegistrationDate#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 + * AccountTokenCreateParams.Identity.BusinessDetails.RegistrationDate#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 month of registration, between 1 and 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** Required. The four-digit year of registration. */ + public Builder setYear(Long year) { + this.year = year; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class ScriptAddresses { diff --git a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java index 2f56b622cbf..fea3ba60a71 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -33,6 +33,10 @@ public class AccountUpdateParams extends ApiRequestParams { @SerializedName("contact_email") Object contactEmail; + /** The default contact phone for the Account. */ + @SerializedName("contact_phone") + Object contactPhone; + /** * A value indicating the Stripe dashboard this Account has access to. This will depend on which * configurations are enabled for this account. @@ -79,6 +83,7 @@ private AccountUpdateParams( Object accountToken, Configuration configuration, Object contactEmail, + Object contactPhone, Dashboard dashboard, Defaults defaults, Object displayName, @@ -89,6 +94,7 @@ private AccountUpdateParams( this.accountToken = accountToken; this.configuration = configuration; this.contactEmail = contactEmail; + this.contactPhone = contactPhone; this.dashboard = dashboard; this.defaults = defaults; this.displayName = displayName; @@ -109,6 +115,8 @@ public static class Builder { private Object contactEmail; + private Object contactPhone; + private Dashboard dashboard; private Defaults defaults; @@ -129,6 +137,7 @@ public AccountUpdateParams build() { this.accountToken, this.configuration, this.contactEmail, + this.contactPhone, this.dashboard, this.defaults, this.displayName, @@ -177,6 +186,18 @@ public Builder setContactEmail(EmptyParam contactEmail) { return this; } + /** The default contact phone for the Account. */ + public Builder setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + return this; + } + + /** The default contact phone for the Account. */ + public Builder setContactPhone(EmptyParam contactPhone) { + this.contactPhone = contactPhone; + return this; + } + /** * A value indicating the Stripe dashboard this Account has access to. This will depend on which * configurations are enabled for this account. @@ -10498,6 +10519,10 @@ public static class BusinessDetails { @SerializedName("registered_name") Object registeredName; + /** When the business was incorporated or registered. */ + @SerializedName("registration_date") + RegistrationDate registrationDate; + /** The business registration address of the business entity in non latin script. */ @SerializedName("script_addresses") ScriptAddresses scriptAddresses; @@ -10520,6 +10545,7 @@ private BusinessDetails( MonthlyEstimatedRevenue monthlyEstimatedRevenue, Object phone, Object registeredName, + RegistrationDate registrationDate, ScriptAddresses scriptAddresses, ScriptNames scriptNames, Structure structure) { @@ -10532,6 +10558,7 @@ private BusinessDetails( this.monthlyEstimatedRevenue = monthlyEstimatedRevenue; this.phone = phone; this.registeredName = registeredName; + this.registrationDate = registrationDate; this.scriptAddresses = scriptAddresses; this.scriptNames = scriptNames; this.structure = structure; @@ -10560,6 +10587,8 @@ public static class Builder { private Object registeredName; + private RegistrationDate registrationDate; + private ScriptAddresses scriptAddresses; private ScriptNames scriptNames; @@ -10578,6 +10607,7 @@ public AccountUpdateParams.Identity.BusinessDetails build() { this.monthlyEstimatedRevenue, this.phone, this.registeredName, + this.registrationDate, this.scriptAddresses, this.scriptNames, this.structure); @@ -10699,6 +10729,13 @@ public Builder setRegisteredName(EmptyParam registeredName) { return this; } + /** When the business was incorporated or registered. */ + public Builder setRegistrationDate( + AccountUpdateParams.Identity.BusinessDetails.RegistrationDate registrationDate) { + this.registrationDate = registrationDate; + return this; + } + /** The business registration address of the business entity in non latin script. */ public Builder setScriptAddresses( AccountUpdateParams.Identity.BusinessDetails.ScriptAddresses scriptAddresses) { @@ -13149,6 +13186,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("gb_crn") GB_CRN("gb_crn"), + @SerializedName("gb_vat") + GB_VAT("gb_vat"), + @SerializedName("gi_crn") GI_CRN("gi_crn"), @@ -13548,6 +13588,107 @@ public Builder setValue(Long value) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RegistrationDate { + /** Required. The day of registration, between 1 and 31. */ + @SerializedName("day") + Long day; + + /** + * 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 month of registration, between 1 and 12. */ + @SerializedName("month") + Long month; + + /** Required. The four-digit year of registration. */ + @SerializedName("year") + Long year; + + private RegistrationDate(Long day, Map extraParams, Long month, Long year) { + this.day = day; + this.extraParams = extraParams; + this.month = month; + this.year = year; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long day; + + private Map extraParams; + + private Long month; + + private Long year; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Identity.BusinessDetails.RegistrationDate build() { + return new AccountUpdateParams.Identity.BusinessDetails.RegistrationDate( + this.day, this.extraParams, this.month, this.year); + } + + /** Required. The day of registration, between 1 and 31. */ + public Builder setDay(Long day) { + this.day = day; + 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.Identity.BusinessDetails.RegistrationDate#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.Identity.BusinessDetails.RegistrationDate#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 month of registration, between 1 and 12. */ + public Builder setMonth(Long month) { + this.month = month; + return this; + } + + /** Required. The four-digit year of registration. */ + public Builder setYear(Long year) { + this.year = year; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class ScriptAddresses { diff --git a/src/main/java/com/stripe/service/CustomerService.java b/src/main/java/com/stripe/service/CustomerService.java index f9f899556bd..6d71cc14460 100644 --- a/src/main/java/com/stripe/service/CustomerService.java +++ b/src/main/java/com/stripe/service/CustomerService.java @@ -69,14 +69,14 @@ public Customer retrieve(String customer, CustomerRetrieveParams params, Request } /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -86,14 +86,14 @@ public Customer update(String customer, CustomerUpdateParams params) throws Stri } /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -103,14 +103,14 @@ public Customer update(String customer, RequestOptions options) throws StripeExc } /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. @@ -120,14 +120,14 @@ public Customer update(String customer) throws StripeException { } /** * Updates the specified customer by setting the values of the parameters passed. Any parameters - * not provided will be left unchanged. For example, if you pass the source - * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges - * in the future. When you update a customer to a new valid card source by passing the + * not provided are left unchanged. For example, if you pass the source + * parameter, that becomes the customer’s active source (such as a card) to be used for all + * charges in the future. When you update a customer to a new valid card source by passing the * source parameter: for each of the customer’s current subscriptions, if the * subscription bills automatically and is in the {@code past_due} state, then the latest open - * invoice for the subscription with automatic collection enabled will be retried. This retry will - * not count as an automatic retry, and will not affect the next regularly scheduled payment for - * the invoice. Changing the default_source for a customer will not trigger this + * invoice for the subscription with automatic collection enabled is retried. This retry doesn’t + * count as an automatic retry, and doesn’t affect the next regularly scheduled payment for the + * invoice. Changing the default_source for a customer doesn’t trigger this * behavior. * *

This request accepts mostly the same arguments as the customer creation call. diff --git a/src/main/java/com/stripe/service/InvoiceService.java b/src/main/java/com/stripe/service/InvoiceService.java index 30efc494903..979dc51661d 100644 --- a/src/main/java/com/stripe/service/InvoiceService.java +++ b/src/main/java/com/stripe/service/InvoiceService.java @@ -181,8 +181,8 @@ public StripeCollection list(InvoiceListParams params, RequestOptions o /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public Invoice create(InvoiceCreateParams params) throws StripeException { return create(params, (RequestOptions) null); @@ -190,8 +190,8 @@ public Invoice create(InvoiceCreateParams params) throws StripeException { /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public Invoice create(RequestOptions options) throws StripeException { return create((InvoiceCreateParams) null, options); @@ -199,8 +199,8 @@ public Invoice create(RequestOptions options) throws StripeException { /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public Invoice create() throws StripeException { return create((InvoiceCreateParams) null, (RequestOptions) null); @@ -208,8 +208,8 @@ public Invoice create() throws StripeException { /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which - * allows you to pay or send the invoice to your customers. + * allows you to pay or send the invoice to your customers. */ public Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException { String path = "/v1/invoices"; diff --git a/src/main/java/com/stripe/service/RadarService.java b/src/main/java/com/stripe/service/RadarService.java index ab27ef3a18d..c3281a95d64 100644 --- a/src/main/java/com/stripe/service/RadarService.java +++ b/src/main/java/com/stripe/service/RadarService.java @@ -13,6 +13,10 @@ public com.stripe.service.radar.EarlyFraudWarningService earlyFraudWarnings() { return new com.stripe.service.radar.EarlyFraudWarningService(this.getResponseGetter()); } + public com.stripe.service.radar.PaymentEvaluationService paymentEvaluations() { + return new com.stripe.service.radar.PaymentEvaluationService(this.getResponseGetter()); + } + public com.stripe.service.radar.ValueListItemService valueListItems() { return new com.stripe.service.radar.ValueListItemService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/checkout/SessionService.java b/src/main/java/com/stripe/service/checkout/SessionService.java index 1fd61f54801..b5a1799a1f1 100644 --- a/src/main/java/com/stripe/service/checkout/SessionService.java +++ b/src/main/java/com/stripe/service/checkout/SessionService.java @@ -100,8 +100,8 @@ public Session retrieve(String session, SessionRetrieveParams params, RequestOpt /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(String session, SessionUpdateParams params) throws StripeException { return update(session, params, (RequestOptions) null); @@ -109,8 +109,8 @@ public Session update(String session, SessionUpdateParams params) throws StripeE /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(String session, RequestOptions options) throws StripeException { return update(session, (SessionUpdateParams) null, options); @@ -118,8 +118,8 @@ public Session update(String session, RequestOptions options) throws StripeExcep /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(String session) throws StripeException { return update(session, (SessionUpdateParams) null, (RequestOptions) null); @@ -127,8 +127,8 @@ public Session update(String session) throws StripeException { /** * Updates a Checkout Session object. * - *

Related guide: Dynamically - * update Checkout. + *

Related guide: Dynamically + * update a Checkout Session. */ public Session update(String session, SessionUpdateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/service/radar/PaymentEvaluationService.java b/src/main/java/com/stripe/service/radar/PaymentEvaluationService.java new file mode 100644 index 00000000000..44a70e5f163 --- /dev/null +++ b/src/main/java/com/stripe/service/radar/PaymentEvaluationService.java @@ -0,0 +1,43 @@ +// File generated from our OpenAPI spec +package com.stripe.service.radar; + +import com.stripe.exception.StripeException; +import com.stripe.model.radar.PaymentEvaluation; +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.radar.PaymentEvaluationCreateParams; + +public final class PaymentEvaluationService extends ApiService { + public PaymentEvaluationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public PaymentEvaluation create(PaymentEvaluationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** + * Request a Radar API fraud risk score from Stripe for a payment before sending it for external + * processor authorization. + */ + public PaymentEvaluation create(PaymentEvaluationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/radar/payment_evaluations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentEvaluation.class); + } +}