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