com.stripe.param.SubscriptionScheduleUpdateParams Maven / Gradle / Ivy
// Generated by delombok at Mon May 18 17:31:34 PDT 2020
package com.stripe.param;
import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiRequestParams;
import com.stripe.param.common.EmptyParam;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SubscriptionScheduleUpdateParams extends ApiRequestParams {
/**
* Object representing the subscription schedule's default settings.
*/
@SerializedName("default_settings")
DefaultSettings defaultSettings;
/**
* Configures how the subscription schedule behaves when it ends. Possible values are {@code
* release} or {@code cancel} with the default being {@code release}. {@code release} will end the
* subscription schedule and keep the underlying subscription running.{@code cancel} will end the
* subscription schedule and cancel the underlying subscription.
*/
@SerializedName("end_behavior")
EndBehavior endBehavior;
/**
* Specifies which fields in the response should be expanded.
*/
@SerializedName("expand")
List expand;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing
* additional information about the object in a structured format. Individual keys can be unset by
* posting an empty value to them. All keys can be unset by posting an empty value to {@code
* metadata}.
*/
@SerializedName("metadata")
Object metadata;
/**
* List representing phases of the subscription schedule. Each phase can be customized to have
* different durations, plans, and coupons. If there are multiple phases, the {@code end_date} of
* one phase will always equal the {@code start_date} of the next phase. Note that past phases can
* be omitted.
*/
@SerializedName("phases")
List phases;
/**
* This field has been renamed to {@code proration_behavior}. {@code prorate=true} can be replaced
* with {@code proration_behavior=create_prorations} and {@code prorate=false} can be replaced
* with {@code proration_behavior=none}.
*/
@SerializedName("prorate")
Boolean prorate;
/**
* If the update changes the current phase, indicates if the changes should be prorated. Valid
* values are {@code create_prorations} or {@code none}, and the default value is {@code
* create_prorations}.
*/
@SerializedName("proration_behavior")
ProrationBehavior prorationBehavior;
private SubscriptionScheduleUpdateParams(DefaultSettings defaultSettings, EndBehavior endBehavior, List expand, Map extraParams, Object metadata, List phases, Boolean prorate, ProrationBehavior prorationBehavior) {
this.defaultSettings = defaultSettings;
this.endBehavior = endBehavior;
this.expand = expand;
this.extraParams = extraParams;
this.metadata = metadata;
this.phases = phases;
this.prorate = prorate;
this.prorationBehavior = prorationBehavior;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private DefaultSettings defaultSettings;
private EndBehavior endBehavior;
private List expand;
private Map extraParams;
private Object metadata;
private List phases;
private Boolean prorate;
private ProrationBehavior prorationBehavior;
/**
* Finalize and obtain parameter instance from this builder.
*/
public SubscriptionScheduleUpdateParams build() {
return new SubscriptionScheduleUpdateParams(this.defaultSettings, this.endBehavior, this.expand, this.extraParams, this.metadata, this.phases, this.prorate, this.prorationBehavior);
}
/**
* Object representing the subscription schedule's default settings.
*/
public Builder setDefaultSettings(DefaultSettings defaultSettings) {
this.defaultSettings = defaultSettings;
return this;
}
/**
* Configures how the subscription schedule behaves when it ends. Possible values are {@code
* release} or {@code cancel} with the default being {@code release}. {@code release} will end
* the subscription schedule and keep the underlying subscription running.{@code cancel} will
* end the subscription schedule and cancel the underlying subscription.
*/
public Builder setEndBehavior(EndBehavior endBehavior) {
this.endBehavior = endBehavior;
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
* SubscriptionScheduleUpdateParams#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
* SubscriptionScheduleUpdateParams#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
* SubscriptionScheduleUpdateParams#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SubscriptionScheduleUpdateParams#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
* SubscriptionScheduleUpdateParams#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 SubscriptionScheduleUpdateParams#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;
}
/**
* 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}.
*/
public Builder setMetadata(EmptyParam metadata) {
this.metadata = metadata;
return this;
}
/**
* 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}.
*/
public Builder setMetadata(Map metadata) {
this.metadata = metadata;
return this;
}
/**
* Add an element to `phases` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* SubscriptionScheduleUpdateParams#phases} for the field documentation.
*/
public Builder addPhase(Phase element) {
if (this.phases == null) {
this.phases = new ArrayList<>();
}
this.phases.add(element);
return this;
}
/**
* Add all elements to `phases` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* SubscriptionScheduleUpdateParams#phases} for the field documentation.
*/
public Builder addAllPhase(List elements) {
if (this.phases == null) {
this.phases = new ArrayList<>();
}
this.phases.addAll(elements);
return this;
}
/**
* This field has been renamed to {@code proration_behavior}. {@code prorate=true} can be
* replaced with {@code proration_behavior=create_prorations} and {@code prorate=false} can be
* replaced with {@code proration_behavior=none}.
*/
public Builder setProrate(Boolean prorate) {
this.prorate = prorate;
return this;
}
/**
* If the update changes the current phase, indicates if the changes should be prorated. Valid
* values are {@code create_prorations} or {@code none}, and the default value is {@code
* create_prorations}.
*/
public Builder setProrationBehavior(ProrationBehavior prorationBehavior) {
this.prorationBehavior = prorationBehavior;
return this;
}
}
public static class DefaultSettings {
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. Pass an empty string to remove previously-defined thresholds.
*/
@SerializedName("billing_thresholds")
Object billingThresholds;
/**
* Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
* Stripe will attempt to pay the underlying subscription at the end of each billing cycle using
* the default source attached to the customer. When sending an invoice, Stripe will email your
* customer an invoice with payment instructions. Defaults to {@code charge_automatically} on
* creation.
*/
@SerializedName("collection_method")
CollectionMethod collectionMethod;
/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the default
* payment method in the customer's invoice settings.
*/
@SerializedName("default_payment_method")
Object defaultPaymentMethod;
/**
* Map of extra parameters 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;
/**
* All invoices will be billed using the specified settings.
*/
@SerializedName("invoice_settings")
InvoiceSettings invoiceSettings;
private DefaultSettings(Object billingThresholds, CollectionMethod collectionMethod, Object defaultPaymentMethod, Map extraParams, InvoiceSettings invoiceSettings) {
this.billingThresholds = billingThresholds;
this.collectionMethod = collectionMethod;
this.defaultPaymentMethod = defaultPaymentMethod;
this.extraParams = extraParams;
this.invoiceSettings = invoiceSettings;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Object billingThresholds;
private CollectionMethod collectionMethod;
private Object defaultPaymentMethod;
private Map extraParams;
private InvoiceSettings invoiceSettings;
/**
* Finalize and obtain parameter instance from this builder.
*/
public DefaultSettings build() {
return new DefaultSettings(this.billingThresholds, this.collectionMethod, this.defaultPaymentMethod, this.extraParams, this.invoiceSettings);
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. Pass an empty string to remove previously-defined thresholds.
*/
public Builder setBillingThresholds(BillingThresholds billingThresholds) {
this.billingThresholds = billingThresholds;
return this;
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. Pass an empty string to remove previously-defined thresholds.
*/
public Builder setBillingThresholds(EmptyParam billingThresholds) {
this.billingThresholds = billingThresholds;
return this;
}
/**
* Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
* Stripe will attempt to pay the underlying subscription at the end of each billing cycle
* using the default source attached to the customer. When sending an invoice, Stripe will
* email your customer an invoice with payment instructions. Defaults to {@code
* charge_automatically} on creation.
*/
public Builder setCollectionMethod(CollectionMethod collectionMethod) {
this.collectionMethod = collectionMethod;
return this;
}
/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the
* default payment method in the customer's invoice settings.
*/
public Builder setDefaultPaymentMethod(String defaultPaymentMethod) {
this.defaultPaymentMethod = defaultPaymentMethod;
return this;
}
/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the
* default payment method in the customer's invoice settings.
*/
public Builder setDefaultPaymentMethod(EmptyParam defaultPaymentMethod) {
this.defaultPaymentMethod = defaultPaymentMethod;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SubscriptionScheduleUpdateParams.DefaultSettings#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SubscriptionScheduleUpdateParams.DefaultSettings#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* All invoices will be billed using the specified settings.
*/
public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) {
this.invoiceSettings = invoiceSettings;
return this;
}
}
public static class BillingThresholds {
/**
* Monetary threshold that triggers the subscription to advance to a new billing period.
*/
@SerializedName("amount_gte")
Long amountGte;
/**
* Map of extra parameters 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;
/**
* 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.
*/
@SerializedName("reset_billing_cycle_anchor")
Boolean resetBillingCycleAnchor;
private BillingThresholds(Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) {
this.amountGte = amountGte;
this.extraParams = extraParams;
this.resetBillingCycleAnchor = resetBillingCycleAnchor;
}
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 BillingThresholds build() {
return new 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
* SubscriptionScheduleUpdateParams.DefaultSettings.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
* SubscriptionScheduleUpdateParams.DefaultSettings.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;
}
public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) {
this.resetBillingCycleAnchor = resetBillingCycleAnchor;
return this;
}
}
/**
* Monetary threshold that triggers the subscription to advance to a new billing period.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getAmountGte() {
return this.amountGte;
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getResetBillingCycleAnchor() {
return this.resetBillingCycleAnchor;
}
}
/**
* 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 static class InvoiceSettings {
/**
* Number of days within which a customer must pay invoices generated by this subscription
* schedule. This value will be {@code null} for subscription schedules where {@code
* billing=charge_automatically}.
*/
@SerializedName("days_until_due")
Long daysUntilDue;
/**
* Map of extra parameters 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 InvoiceSettings(Long daysUntilDue, Map extraParams) {
this.daysUntilDue = daysUntilDue;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long daysUntilDue;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public InvoiceSettings build() {
return new InvoiceSettings(this.daysUntilDue, this.extraParams);
}
/**
* Number of days within which a customer must pay invoices generated by this subscription
* schedule. This value will be {@code null} for subscription schedules where {@code
* billing=charge_automatically}.
*/
public Builder setDaysUntilDue(Long daysUntilDue) {
this.daysUntilDue = daysUntilDue;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link
* SubscriptionScheduleUpdateParams.DefaultSettings.InvoiceSettings#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
/**
* Number of days within which a customer must pay invoices generated by this subscription
* schedule. This value will be {@code null} for subscription schedules where {@code
* billing=charge_automatically}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getDaysUntilDue() {
return this.daysUntilDue;
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.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
* SubscriptionScheduleUpdateParams.DefaultSettings.InvoiceSettings#extraParams} for the
* field documentation.
*/
public enum CollectionMethod implements ApiRequestParams.EnumParam {
@SerializedName("charge_automatically")
CHARGE_AUTOMATICALLY("charge_automatically"), @SerializedName("send_invoice")
SEND_INVOICE("send_invoice");
private final String value;
CollectionMethod(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. Pass an empty string to remove previously-defined thresholds.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getBillingThresholds() {
return this.billingThresholds;
}
/**
* Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
* Stripe will attempt to pay the underlying subscription at the end of each billing cycle using
* the default source attached to the customer. When sending an invoice, Stripe will email your
* customer an invoice with payment instructions. Defaults to {@code charge_automatically} on
* creation.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public CollectionMethod getCollectionMethod() {
return this.collectionMethod;
}
/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the default
* payment method in the customer's invoice settings.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getDefaultPaymentMethod() {
return this.defaultPaymentMethod;
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* All invoices will be billed using the specified settings.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public InvoiceSettings getInvoiceSettings() {
return this.invoiceSettings;
}
}
public static class Phase {
/**
* A list of prices and quantities that will generate invoice items appended to the next
* invoice. You may pass up to 10 items.
*/
@SerializedName("add_invoice_items")
List addInvoiceItems;
/**
* A non-negative decimal between 0 and 100, with at most two decimal places. This represents
* the percentage of the subscription invoice subtotal that will be transferred to the
* application owner's Stripe account. The request must be made by a platform account on a
* connected account in order to set an application fee percentage. For more information, see
* the application fees documentation.
*/
@SerializedName("application_fee_percent")
BigDecimal applicationFeePercent;
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. Pass an empty string to remove previously-defined thresholds.
*/
@SerializedName("billing_thresholds")
Object billingThresholds;
/**
* Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
* Stripe will attempt to pay the underlying subscription at the end of each billing cycle using
* the default source attached to the customer. When sending an invoice, Stripe will email your
* customer an invoice with payment instructions. Defaults to {@code charge_automatically} on
* creation.
*/
@SerializedName("collection_method")
CollectionMethod collectionMethod;
/**
* The identifier of the coupon to apply to this phase of the subscription schedule.
*/
@SerializedName("coupon")
Object coupon;
/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the default
* payment method in the customer's invoice settings.
*/
@SerializedName("default_payment_method")
Object defaultPaymentMethod;
/**
* A list of Tax Rate ids. These Tax Rates
* will set the Subscription's {@code
* default_tax_rates}, which means they will be the Invoice's {@code
* default_tax_rates} for any Invoices issued by the Subscription during this Phase.
*/
@SerializedName("default_tax_rates")
Object defaultTaxRates;
/**
* The date at which this phase of the subscription schedule ends. If set, {@code iterations}
* must not be set.
*/
@SerializedName("end_date")
Object endDate;
/**
* Map of extra parameters 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;
/**
* All invoices will be billed using the specified settings.
*/
@SerializedName("invoice_settings")
InvoiceSettings invoiceSettings;
/**
* Integer representing the multiplier applied to the plan interval. For example, {@code
* iterations=2} applied to a plan with {@code interval=month} and {@code interval_count=3}
* results in a phase of duration {@code 2 * 3 months = 6 months}. If set, {@code end_date} must
* not be set.
*/
@SerializedName("iterations")
Long iterations;
/**
* List of configuration items, each with an attached plan, to apply during this phase of the
* subscription schedule.
*/
@SerializedName("plans")
List plans;
/**
* Controls whether or not a subscription schedule will create prorations when transitioning to
* this phase. Valid values are {@code create_prorations} or {@code none}, and the default value
* is {@code create_prorations}. See Prorations.
*/
@SerializedName("proration_behavior")
ProrationBehavior prorationBehavior;
/**
* The date at which this phase of the subscription schedule starts or {@code now}. Must be set
* on the first phase.
*/
@SerializedName("start_date")
Object startDate;
/**
* A non-negative decimal (with at most four decimal places) between 0 and 100. This represents
* the percentage of the subscription invoice subtotal that will be calculated and added as tax
* to the final amount in each billing period during thise phase of the schedule. For example, a
* plan which charges $10/month with a {@code tax_percent} of {@code 20.0} will charge $12 per
* invoice. To unset a previously-set value, pass an empty string. This field has been
* deprecated and will be removed in a future API version, for further information view the migration docs for {@code
* tax_rates}.
*/
@SerializedName("tax_percent")
BigDecimal taxPercent;
/**
* If set to true the entire phase is counted as a trial and the customer will not be charged
* for any fees.
*/
@SerializedName("trial")
Boolean trial;
/**
* Sets the phase to trialing from the start date to this date. Must be before the phase end
* date, can not be combined with {@code trial}
*/
@SerializedName("trial_end")
Object trialEnd;
private Phase(List addInvoiceItems, BigDecimal applicationFeePercent, Object billingThresholds, CollectionMethod collectionMethod, Object coupon, Object defaultPaymentMethod, Object defaultTaxRates, Object endDate, Map extraParams, InvoiceSettings invoiceSettings, Long iterations, List plans, ProrationBehavior prorationBehavior, Object startDate, BigDecimal taxPercent, Boolean trial, Object trialEnd) {
this.addInvoiceItems = addInvoiceItems;
this.applicationFeePercent = applicationFeePercent;
this.billingThresholds = billingThresholds;
this.collectionMethod = collectionMethod;
this.coupon = coupon;
this.defaultPaymentMethod = defaultPaymentMethod;
this.defaultTaxRates = defaultTaxRates;
this.endDate = endDate;
this.extraParams = extraParams;
this.invoiceSettings = invoiceSettings;
this.iterations = iterations;
this.plans = plans;
this.prorationBehavior = prorationBehavior;
this.startDate = startDate;
this.taxPercent = taxPercent;
this.trial = trial;
this.trialEnd = trialEnd;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private List addInvoiceItems;
private BigDecimal applicationFeePercent;
private Object billingThresholds;
private CollectionMethod collectionMethod;
private Object coupon;
private Object defaultPaymentMethod;
private Object defaultTaxRates;
private Object endDate;
private Map extraParams;
private InvoiceSettings invoiceSettings;
private Long iterations;
private List plans;
private ProrationBehavior prorationBehavior;
private Object startDate;
private BigDecimal taxPercent;
private Boolean trial;
private Object trialEnd;
/**
* Finalize and obtain parameter instance from this builder.
*/
public Phase build() {
return new Phase(this.addInvoiceItems, this.applicationFeePercent, this.billingThresholds, this.collectionMethod, this.coupon, this.defaultPaymentMethod, this.defaultTaxRates, this.endDate, this.extraParams, this.invoiceSettings, this.iterations, this.plans, this.prorationBehavior, this.startDate, this.taxPercent, this.trial, this.trialEnd);
}
/**
* Add an element to `addInvoiceItems` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* SubscriptionScheduleUpdateParams.Phase#addInvoiceItems} for the field documentation.
*/
public Builder addAddInvoiceItem(AddInvoiceItem element) {
if (this.addInvoiceItems == null) {
this.addInvoiceItems = new ArrayList<>();
}
this.addInvoiceItems.add(element);
return this;
}
/**
* Add all elements to `addInvoiceItems` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link SubscriptionScheduleUpdateParams.Phase#addInvoiceItems} for the field documentation.
*/
public Builder addAllAddInvoiceItem(List elements) {
if (this.addInvoiceItems == null) {
this.addInvoiceItems = new ArrayList<>();
}
this.addInvoiceItems.addAll(elements);
return this;
}
/**
* A non-negative decimal between 0 and 100, with at most two decimal places. This represents
* the percentage of the subscription invoice subtotal that will be transferred to the
* application owner's Stripe account. The request must be made by a platform account on a
* connected account in order to set an application fee percentage. For more information, see
* the application fees documentation.
*/
public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) {
this.applicationFeePercent = applicationFeePercent;
return this;
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. Pass an empty string to remove previously-defined thresholds.
*/
public Builder setBillingThresholds(BillingThresholds billingThresholds) {
this.billingThresholds = billingThresholds;
return this;
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. Pass an empty string to remove previously-defined thresholds.
*/
public Builder setBillingThresholds(EmptyParam billingThresholds) {
this.billingThresholds = billingThresholds;
return this;
}
/**
* Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
* Stripe will attempt to pay the underlying subscription at the end of each billing cycle
* using the default source attached to the customer. When sending an invoice, Stripe will
* email your customer an invoice with payment instructions. Defaults to {@code
* charge_automatically} on creation.
*/
public Builder setCollectionMethod(CollectionMethod collectionMethod) {
this.collectionMethod = collectionMethod;
return this;
}
/**
* The identifier of the coupon to apply to this phase of the subscription schedule.
*/
public Builder setCoupon(String coupon) {
this.coupon = coupon;
return this;
}
/**
* The identifier of the coupon to apply to this phase of the subscription schedule.
*/
public Builder setCoupon(EmptyParam coupon) {
this.coupon = coupon;
return this;
}
/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the
* default payment method in the customer's invoice settings.
*/
public Builder setDefaultPaymentMethod(String defaultPaymentMethod) {
this.defaultPaymentMethod = defaultPaymentMethod;
return this;
}
/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the
* default payment method in the customer's invoice settings.
*/
public Builder setDefaultPaymentMethod(EmptyParam defaultPaymentMethod) {
this.defaultPaymentMethod = defaultPaymentMethod;
return this;
}
/**
* Add an element to `defaultTaxRates` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* SubscriptionScheduleUpdateParams.Phase#defaultTaxRates} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addDefaultTaxRate(String element) {
if (this.defaultTaxRates == null || this.defaultTaxRates instanceof EmptyParam) {
this.defaultTaxRates = new ArrayList();
}
((List) this.defaultTaxRates).add(element);
return this;
}
/**
* Add all elements to `defaultTaxRates` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link SubscriptionScheduleUpdateParams.Phase#defaultTaxRates} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllDefaultTaxRate(List elements) {
if (this.defaultTaxRates == null || this.defaultTaxRates instanceof EmptyParam) {
this.defaultTaxRates = new ArrayList();
}
((List) this.defaultTaxRates).addAll(elements);
return this;
}
/**
* A list of Tax Rate ids. These Tax Rates
* will set the Subscription's {@code
* default_tax_rates}, which means they will be the Invoice's {@code
* default_tax_rates} for any Invoices issued by the Subscription during this Phase.
*/
public Builder setDefaultTaxRates(EmptyParam defaultTaxRates) {
this.defaultTaxRates = defaultTaxRates;
return this;
}
/**
* A list of Tax Rate ids. These Tax Rates
* will set the Subscription's {@code
* default_tax_rates}, which means they will be the Invoice's {@code
* default_tax_rates} for any Invoices issued by the Subscription during this Phase.
*/
public Builder setDefaultTaxRates(List defaultTaxRates) {
this.defaultTaxRates = defaultTaxRates;
return this;
}
/**
* The date at which this phase of the subscription schedule ends. If set, {@code iterations}
* must not be set.
*/
public Builder setEndDate(Long endDate) {
this.endDate = endDate;
return this;
}
/**
* The date at which this phase of the subscription schedule ends. If set, {@code iterations}
* must not be set.
*/
public Builder setEndDate(EndDate endDate) {
this.endDate = endDate;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* SubscriptionScheduleUpdateParams.Phase#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link SubscriptionScheduleUpdateParams.Phase#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* All invoices will be billed using the specified settings.
*/
public Builder setInvoiceSettings(InvoiceSettings invoiceSettings) {
this.invoiceSettings = invoiceSettings;
return this;
}
/**
* Integer representing the multiplier applied to the plan interval. For example, {@code
* iterations=2} applied to a plan with {@code interval=month} and {@code interval_count=3}
* results in a phase of duration {@code 2 * 3 months = 6 months}. If set, {@code end_date}
* must not be set.
*/
public Builder setIterations(Long iterations) {
this.iterations = iterations;
return this;
}
/**
* Add an element to `plans` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* SubscriptionScheduleUpdateParams.Phase#plans} for the field documentation.
*/
public Builder addPlan(Plan element) {
if (this.plans == null) {
this.plans = new ArrayList<>();
}
this.plans.add(element);
return this;
}
/**
* Add all elements to `plans` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SubscriptionScheduleUpdateParams.Phase#plans} for the field documentation.
*/
public Builder addAllPlan(List elements) {
if (this.plans == null) {
this.plans = new ArrayList<>();
}
this.plans.addAll(elements);
return this;
}
/**
* Controls whether or not a subscription schedule will create prorations when transitioning
* to this phase. Valid values are {@code create_prorations} or {@code none}, and the default
* value is {@code create_prorations}. See Prorations.
*/
public Builder setProrationBehavior(ProrationBehavior prorationBehavior) {
this.prorationBehavior = prorationBehavior;
return this;
}
/**
* The date at which this phase of the subscription schedule starts or {@code now}. Must be
* set on the first phase.
*/
public Builder setStartDate(Long startDate) {
this.startDate = startDate;
return this;
}
/**
* The date at which this phase of the subscription schedule starts or {@code now}. Must be
* set on the first phase.
*/
public Builder setStartDate(StartDate startDate) {
this.startDate = startDate;
return this;
}
/**
* A non-negative decimal (with at most four decimal places) between 0 and 100. This
* represents the percentage of the subscription invoice subtotal that will be calculated and
* added as tax to the final amount in each billing period during thise phase of the schedule.
* For example, a plan which charges $10/month with a {@code tax_percent} of {@code 20.0} will
* charge $12 per invoice. To unset a previously-set value, pass an empty string. This field
* has been deprecated and will be removed in a future API version, for further information
* view the migration docs for
* {@code tax_rates}.
*/
public Builder setTaxPercent(BigDecimal taxPercent) {
this.taxPercent = taxPercent;
return this;
}
/**
* If set to true the entire phase is counted as a trial and the customer will not be charged
* for any fees.
*/
public Builder setTrial(Boolean trial) {
this.trial = trial;
return this;
}
/**
* Sets the phase to trialing from the start date to this date. Must be before the phase end
* date, can not be combined with {@code trial}
*/
public Builder setTrialEnd(Long trialEnd) {
this.trialEnd = trialEnd;
return this;
}
/**
* Sets the phase to trialing from the start date to this date. Must be before the phase end
* date, can not be combined with {@code trial}
*/
public Builder setTrialEnd(TrialEnd trialEnd) {
this.trialEnd = trialEnd;
return this;
}
}
public static class AddInvoiceItem {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
* name in this param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* The ID of the price object.
*/
@SerializedName("price")
Object price;
/**
* Data used to generate a new price object inline.
*/
@SerializedName("price_data")
PriceData priceData;
/**
* Quantity for this item. Defaults to 1.
*/
@SerializedName("quantity")
Long quantity;
private AddInvoiceItem(Map extraParams, Object price, PriceData priceData, Long quantity) {
this.extraParams = extraParams;
this.price = price;
this.priceData = priceData;
this.quantity = quantity;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Object price;
private PriceData priceData;
private Long quantity;
/**
* Finalize and obtain parameter instance from this builder.
*/
public AddInvoiceItem build() {
return new AddInvoiceItem(this.extraParams, this.price, this.priceData, this.quantity);
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* The ID of the price object.
*/
public Builder setPrice(String price) {
this.price = price;
return this;
}
/**
* The ID of the price object.
*/
public Builder setPrice(EmptyParam price) {
this.price = price;
return this;
}
/**
* Data used to generate a new price object inline.
*/
public Builder setPriceData(PriceData priceData) {
this.priceData = priceData;
return this;
}
/**
* Quantity for this item. Defaults to 1.
*/
public Builder setQuantity(Long quantity) {
this.quantity = quantity;
return this;
}
}
public static class PriceData {
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency.
*/
@SerializedName("currency")
Object currency;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** The ID of the product that this price will belong to. */
@SerializedName("product")
Object product;
/** A positive integer in %s (or 0 for a free price) representing how much to charge. */
@SerializedName("unit_amount")
Long unitAmount;
/**
* Same as {@code unit_amount}, but accepts a decimal value with at most 12 decimal places.
* Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
@SerializedName("unit_amount_decimal")
Object unitAmountDecimal;
private PriceData(Object currency, Map extraParams, Object product, Long unitAmount, Object unitAmountDecimal) {
this.currency = currency;
this.extraParams = extraParams;
this.product = product;
this.unitAmount = unitAmount;
this.unitAmountDecimal = unitAmountDecimal;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Object currency;
private Map extraParams;
private Object product;
private Long unitAmount;
private Object unitAmountDecimal;
/** Finalize and obtain parameter instance from this builder. */
public PriceData build() {
return new PriceData(this.currency, this.extraParams, this.product, this.unitAmount, this.unitAmountDecimal);
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported currency.
*/
public Builder setCurrency(String currency) {
this.currency = currency;
return this;
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported currency.
*/
public Builder setCurrency(EmptyParam currency) {
this.currency = currency;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link
* SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link
* SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.PriceData#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 product that this price will belong to. */
public Builder setProduct(String product) {
this.product = product;
return this;
}
/** The ID of the product that this price will belong to. */
public Builder setProduct(EmptyParam product) {
this.product = product;
return this;
}
/** A positive integer in %s (or 0 for a free price) representing how much to charge. */
public Builder setUnitAmount(Long unitAmount) {
this.unitAmount = unitAmount;
return this;
}
/**
* Same as {@code unit_amount}, but accepts a decimal value with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) {
this.unitAmountDecimal = unitAmountDecimal;
return this;
}
public Builder setUnitAmountDecimal(EmptyParam unitAmountDecimal) {
this.unitAmountDecimal = unitAmountDecimal;
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getCurrency() {
return this.currency;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getProduct() {
return this.product;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getUnitAmount() {
return this.unitAmount;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getUnitAmountDecimal() {
return this.unitAmountDecimal;
}
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* The ID of the price object.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getPrice() {
return this.price;
}
/**
* Data used to generate a new price object inline.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public PriceData getPriceData() {
return this.priceData;
}
/**
* Quantity for this item. Defaults to 1.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getQuantity() {
return this.quantity;
}
}
/**
* Same as {@code unit_amount}, but accepts a decimal value with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
public static class BillingThresholds {
/**
* Monetary threshold that triggers the subscription to advance to a new billing period.
*/
@SerializedName("amount_gte")
Long amountGte;
/**
* Map of extra parameters 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;
/**
* 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.
*/
@SerializedName("reset_billing_cycle_anchor")
Boolean resetBillingCycleAnchor;
private BillingThresholds(Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) {
this.amountGte = amountGte;
this.extraParams = extraParams;
this.resetBillingCycleAnchor = resetBillingCycleAnchor;
}
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 BillingThresholds build() {
return new 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 SubscriptionScheduleUpdateParams.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 SubscriptionScheduleUpdateParams.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;
}
public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) {
this.resetBillingCycleAnchor = resetBillingCycleAnchor;
return this;
}
}
/**
* Monetary threshold that triggers the subscription to advance to a new billing period.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getAmountGte() {
return this.amountGte;
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getResetBillingCycleAnchor() {
return this.resetBillingCycleAnchor;
}
}
/**
* 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 static class InvoiceSettings {
/**
* Number of days within which a customer must pay invoices generated by this subscription
* schedule. This value will be {@code null} for subscription schedules where {@code
* billing=charge_automatically}.
*/
@SerializedName("days_until_due")
Long daysUntilDue;
/**
* Map of extra parameters 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 InvoiceSettings(Long daysUntilDue, Map extraParams) {
this.daysUntilDue = daysUntilDue;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long daysUntilDue;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public InvoiceSettings build() {
return new InvoiceSettings(this.daysUntilDue, this.extraParams);
}
/**
* Number of days within which a customer must pay invoices generated by this subscription
* schedule. This value will be {@code null} for subscription schedules where {@code
* billing=charge_automatically}.
*/
public Builder setDaysUntilDue(Long daysUntilDue) {
this.daysUntilDue = daysUntilDue;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SubscriptionScheduleUpdateParams.Phase.InvoiceSettings#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
/**
* Number of days within which a customer must pay invoices generated by this subscription
* schedule. This value will be {@code null} for subscription schedules where {@code
* billing=charge_automatically}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getDaysUntilDue() {
return this.daysUntilDue;
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.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 SubscriptionScheduleUpdateParams.Phase.InvoiceSettings#extraParams} for
* the field documentation.
*/
public static class Plan {
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. When updating, pass an empty string to remove previously-defined
* thresholds.
*/
@SerializedName("billing_thresholds")
Object billingThresholds;
/**
* Map of extra parameters 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 plan ID to subscribe to.
*/
@SerializedName("plan")
Object plan;
/**
* The ID of the price object.
*/
@SerializedName("price")
Object price;
/**
* Data used to generate a new price object inline.
*/
@SerializedName("price_data")
PriceData priceData;
/**
* Quantity for the given plan. Can be set only if the plan's {@code usage_type} is {@code
* licensed} and not {@code metered}.
*/
@SerializedName("quantity")
Long quantity;
/**
* A list of Tax Rate ids. These Tax Rates
* will override the {@code
* default_tax_rates} on the Subscription. When updating, pass an empty string to remove
* previously-defined tax rates.
*/
@SerializedName("tax_rates")
Object taxRates;
private Plan(Object billingThresholds, Map extraParams, Object plan, Object price, PriceData priceData, Long quantity, Object taxRates) {
this.billingThresholds = billingThresholds;
this.extraParams = extraParams;
this.plan = plan;
this.price = price;
this.priceData = priceData;
this.quantity = quantity;
this.taxRates = taxRates;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Object billingThresholds;
private Map extraParams;
private Object plan;
private Object price;
private PriceData priceData;
private Long quantity;
private Object taxRates;
/**
* Finalize and obtain parameter instance from this builder.
*/
public Plan build() {
return new Plan(this.billingThresholds, this.extraParams, this.plan, this.price, this.priceData, this.quantity, this.taxRates);
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a
* new billing period. When updating, pass an empty string to remove previously-defined
* thresholds.
*/
public Builder setBillingThresholds(BillingThresholds billingThresholds) {
this.billingThresholds = billingThresholds;
return this;
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a
* new billing period. When updating, pass an empty string to remove previously-defined
* thresholds.
*/
public Builder setBillingThresholds(EmptyParam billingThresholds) {
this.billingThresholds = billingThresholds;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SubscriptionScheduleUpdateParams.Phase.Plan#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SubscriptionScheduleUpdateParams.Phase.Plan#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 plan ID to subscribe to.
*/
public Builder setPlan(String plan) {
this.plan = plan;
return this;
}
/**
* The plan ID to subscribe to.
*/
public Builder setPlan(EmptyParam plan) {
this.plan = plan;
return this;
}
/**
* The ID of the price object.
*/
public Builder setPrice(String price) {
this.price = price;
return this;
}
/**
* The ID of the price object.
*/
public Builder setPrice(EmptyParam price) {
this.price = price;
return this;
}
/**
* Data used to generate a new price object inline.
*/
public Builder setPriceData(PriceData priceData) {
this.priceData = priceData;
return this;
}
/**
* Quantity for the given plan. Can be set only if the plan's {@code usage_type} is {@code
* licensed} and not {@code metered}.
*/
public Builder setQuantity(Long quantity) {
this.quantity = quantity;
return this;
}
/**
* Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SubscriptionScheduleUpdateParams.Phase.Plan#taxRates} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addTaxRate(String element) {
if (this.taxRates == null || this.taxRates instanceof EmptyParam) {
this.taxRates = new ArrayList();
}
((List) this.taxRates).add(element);
return this;
}
/**
* Add all elements to `taxRates` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* SubscriptionScheduleUpdateParams.Phase.Plan#taxRates} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllTaxRate(List elements) {
if (this.taxRates == null || this.taxRates instanceof EmptyParam) {
this.taxRates = new ArrayList();
}
((List) this.taxRates).addAll(elements);
return this;
}
/**
* A list of Tax Rate ids. These Tax
* Rates will override the {@code
* default_tax_rates} on the Subscription. When updating, pass an empty string to remove
* previously-defined tax rates.
*/
public Builder setTaxRates(EmptyParam taxRates) {
this.taxRates = taxRates;
return this;
}
/**
* A list of Tax Rate ids. These Tax
* Rates will override the {@code
* default_tax_rates} on the Subscription. When updating, pass an empty string to remove
* previously-defined tax rates.
*/
public Builder setTaxRates(List taxRates) {
this.taxRates = taxRates;
return this;
}
}
public static class BillingThresholds {
/**
* Map of extra parameters 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;
/**
* Usage threshold that triggers the subscription to advance to a new billing period.
*/
@SerializedName("usage_gte")
Long usageGte;
private BillingThresholds(Map extraParams, Long usageGte) {
this.extraParams = extraParams;
this.usageGte = usageGte;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Long usageGte;
/** Finalize and obtain parameter instance from this builder. */
public BillingThresholds build() {
return new BillingThresholds(this.extraParams, this.usageGte);
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link
* SubscriptionScheduleUpdateParams.Phase.Plan.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
* SubscriptionScheduleUpdateParams.Phase.Plan.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;
}
public Builder setUsageGte(Long usageGte) {
this.usageGte = usageGte;
return this;
}
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* Usage threshold that triggers the subscription to advance to a new billing period.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getUsageGte() {
return this.usageGte;
}
}
/**
* Usage threshold that triggers the subscription to advance to a new billing period.
*/
public static class PriceData {
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency.
*/
@SerializedName("currency")
Object currency;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** The ID of the product that this price will belong to. */
@SerializedName("product")
Object product;
/** The recurring components of a price such as {@code interval} and {@code usage_type}. */
@SerializedName("recurring")
Recurring recurring;
/** A positive integer in %s (or 0 for a free price) representing how much to charge. */
@SerializedName("unit_amount")
Long unitAmount;
/**
* Same as {@code unit_amount}, but accepts a decimal value with at most 12 decimal places.
* Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
@SerializedName("unit_amount_decimal")
Object unitAmountDecimal;
private PriceData(Object currency, Map extraParams, Object product, Recurring recurring, Long unitAmount, Object unitAmountDecimal) {
this.currency = currency;
this.extraParams = extraParams;
this.product = product;
this.recurring = recurring;
this.unitAmount = unitAmount;
this.unitAmountDecimal = unitAmountDecimal;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Object currency;
private Map extraParams;
private Object product;
private Recurring recurring;
private Long unitAmount;
private Object unitAmountDecimal;
/** Finalize and obtain parameter instance from this builder. */
public PriceData build() {
return new PriceData(this.currency, this.extraParams, this.product, this.recurring, this.unitAmount, this.unitAmountDecimal);
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported currency.
*/
public Builder setCurrency(String currency) {
this.currency = currency;
return this;
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported currency.
*/
public Builder setCurrency(EmptyParam currency) {
this.currency = currency;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SubscriptionScheduleUpdateParams.Phase.Plan.PriceData#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link SubscriptionScheduleUpdateParams.Phase.Plan.PriceData#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 product that this price will belong to. */
public Builder setProduct(String product) {
this.product = product;
return this;
}
/** The ID of the product that this price will belong to. */
public Builder setProduct(EmptyParam product) {
this.product = product;
return this;
}
/**
* The recurring components of a price such as {@code interval} and {@code usage_type}.
*/
public Builder setRecurring(Recurring recurring) {
this.recurring = recurring;
return this;
}
/** A positive integer in %s (or 0 for a free price) representing how much to charge. */
public Builder setUnitAmount(Long unitAmount) {
this.unitAmount = unitAmount;
return this;
}
/**
* Same as {@code unit_amount}, but accepts a decimal value with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) {
this.unitAmountDecimal = unitAmountDecimal;
return this;
}
/**
* Same as {@code unit_amount}, but accepts a decimal value with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
public Builder setUnitAmountDecimal(EmptyParam unitAmountDecimal) {
this.unitAmountDecimal = unitAmountDecimal;
return this;
}
}
public static class Recurring {
/**
* Map of extra parameters 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;
/**
* Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or {@code
* year}.
*/
@SerializedName("interval")
Interval interval;
/**
* The number of intervals between subscription billings. For example, {@code
* interval=month} and {@code interval_count=3} bills every 3 months. Maximum of one year
* interval allowed (1 year, 12 months, or 52 weeks).
*/
@SerializedName("interval_count")
Long intervalCount;
private Recurring(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 Recurring build() {
return new Recurring(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
* SubscriptionScheduleUpdateParams.Phase.Plan.PriceData.Recurring#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the
* original map. See {@link
* SubscriptionScheduleUpdateParams.Phase.Plan.PriceData.Recurring#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Specifies billing frequency. Either {@code day}, {@code week}, {@code month} or
* {@code year}.
*/
public Builder setInterval(Interval interval) {
this.interval = interval;
return this;
}
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");
private final String value;
Interval(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Interval getInterval() {
return this.interval;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getIntervalCount() {
return this.intervalCount;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getCurrency() {
return this.currency;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getProduct() {
return this.product;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Recurring getRecurring() {
return this.recurring;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getUnitAmount() {
return this.unitAmount;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getUnitAmountDecimal() {
return this.unitAmountDecimal;
}
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. When updating, pass an empty string to remove previously-defined
* thresholds.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getBillingThresholds() {
return this.billingThresholds;
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* The plan ID to subscribe to.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getPlan() {
return this.plan;
}
/**
* The ID of the price object.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getPrice() {
return this.price;
}
/**
* Data used to generate a new price object inline.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public PriceData getPriceData() {
return this.priceData;
}
/**
* Quantity for the given plan. Can be set only if the plan's {@code usage_type} is {@code
* licensed} and not {@code metered}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getQuantity() {
return this.quantity;
}
/**
* A list of Tax Rate ids. These Tax Rates
* will override the {@code
* default_tax_rates} on the Subscription. When updating, pass an empty string to remove
* previously-defined tax rates.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getTaxRates() {
return this.taxRates;
}
}
/**
* The number of intervals between subscription billings. For example, {@code
* interval=month} and {@code interval_count=3} bills every 3 months. Maximum of one
* year interval allowed (1 year, 12 months, or 52 weeks).
*/
public enum CollectionMethod implements ApiRequestParams.EnumParam {
@SerializedName("charge_automatically")
CHARGE_AUTOMATICALLY("charge_automatically"), @SerializedName("send_invoice")
SEND_INVOICE("send_invoice");
private final String value;
CollectionMethod(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum EndDate implements ApiRequestParams.EnumParam {
@SerializedName("now")
NOW("now");
private final String value;
EndDate(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum ProrationBehavior implements ApiRequestParams.EnumParam {
@SerializedName("always_invoice")
ALWAYS_INVOICE("always_invoice"), @SerializedName("create_prorations")
CREATE_PRORATIONS("create_prorations"), @SerializedName("none")
NONE("none");
private final String value;
ProrationBehavior(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum StartDate implements ApiRequestParams.EnumParam {
@SerializedName("now")
NOW("now");
private final String value;
StartDate(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum TrialEnd implements ApiRequestParams.EnumParam {
@SerializedName("now")
NOW("now");
private final String value;
TrialEnd(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* A list of prices and quantities that will generate invoice items appended to the next
* invoice. You may pass up to 10 items.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getAddInvoiceItems() {
return this.addInvoiceItems;
}
/**
* A non-negative decimal between 0 and 100, with at most two decimal places. This represents
* the percentage of the subscription invoice subtotal that will be transferred to the
* application owner's Stripe account. The request must be made by a platform account on a
* connected account in order to set an application fee percentage. For more information, see
* the application fees documentation.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BigDecimal getApplicationFeePercent() {
return this.applicationFeePercent;
}
/**
* Define thresholds at which an invoice will be sent, and the subscription advanced to a new
* billing period. Pass an empty string to remove previously-defined thresholds.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getBillingThresholds() {
return this.billingThresholds;
}
/**
* Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
* Stripe will attempt to pay the underlying subscription at the end of each billing cycle using
* the default source attached to the customer. When sending an invoice, Stripe will email your
* customer an invoice with payment instructions. Defaults to {@code charge_automatically} on
* creation.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public CollectionMethod getCollectionMethod() {
return this.collectionMethod;
}
/**
* The identifier of the coupon to apply to this phase of the subscription schedule.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getCoupon() {
return this.coupon;
}
/**
* ID of the default payment method for the subscription schedule. It must belong to the
* customer associated with the subscription schedule. If not set, invoices will use the default
* payment method in the customer's invoice settings.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getDefaultPaymentMethod() {
return this.defaultPaymentMethod;
}
/**
* A list of Tax Rate ids. These Tax Rates
* will set the Subscription's {@code
* default_tax_rates}, which means they will be the Invoice's {@code
* default_tax_rates} for any Invoices issued by the Subscription during this Phase.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getDefaultTaxRates() {
return this.defaultTaxRates;
}
/**
* The date at which this phase of the subscription schedule ends. If set, {@code iterations}
* must not be set.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getEndDate() {
return this.endDate;
}
/**
* Map of extra parameters 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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* All invoices will be billed using the specified settings.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public InvoiceSettings getInvoiceSettings() {
return this.invoiceSettings;
}
/**
* Integer representing the multiplier applied to the plan interval. For example, {@code
* iterations=2} applied to a plan with {@code interval=month} and {@code interval_count=3}
* results in a phase of duration {@code 2 * 3 months = 6 months}. If set, {@code end_date} must
* not be set.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getIterations() {
return this.iterations;
}
/**
* List of configuration items, each with an attached plan, to apply during this phase of the
* subscription schedule.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getPlans() {
return this.plans;
}
/**
* Controls whether or not a subscription schedule will create prorations when transitioning to
* this phase. Valid values are {@code create_prorations} or {@code none}, and the default value
* is {@code create_prorations}. See Prorations.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public ProrationBehavior getProrationBehavior() {
return this.prorationBehavior;
}
/**
* The date at which this phase of the subscription schedule starts or {@code now}. Must be set
* on the first phase.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getStartDate() {
return this.startDate;
}
/**
* A non-negative decimal (with at most four decimal places) between 0 and 100. This represents
* the percentage of the subscription invoice subtotal that will be calculated and added as tax
* to the final amount in each billing period during thise phase of the schedule. For example, a
* plan which charges $10/month with a {@code tax_percent} of {@code 20.0} will charge $12 per
* invoice. To unset a previously-set value, pass an empty string. This field has been
* deprecated and will be removed in a future API version, for further information view the migration docs for {@code
* tax_rates}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BigDecimal getTaxPercent() {
return this.taxPercent;
}
/**
* If set to true the entire phase is counted as a trial and the customer will not be charged
* for any fees.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getTrial() {
return this.trial;
}
/**
* Sets the phase to trialing from the start date to this date. Must be before the phase end
* date, can not be combined with {@code trial}
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getTrialEnd() {
return this.trialEnd;
}
}
public enum EndBehavior implements ApiRequestParams.EnumParam {
@SerializedName("cancel")
CANCEL("cancel"), @SerializedName("none")
NONE("none"), @SerializedName("release")
RELEASE("release"), @SerializedName("renew")
RENEW("renew");
private final String value;
EndBehavior(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum ProrationBehavior implements ApiRequestParams.EnumParam {
@SerializedName("always_invoice")
ALWAYS_INVOICE("always_invoice"), @SerializedName("create_prorations")
CREATE_PRORATIONS("create_prorations"), @SerializedName("none")
NONE("none");
private final String value;
ProrationBehavior(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* Object representing the subscription schedule's default settings.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public DefaultSettings getDefaultSettings() {
return this.defaultSettings;
}
/**
* Configures how the subscription schedule behaves when it ends. Possible values are {@code
* release} or {@code cancel} with the default being {@code release}. {@code release} will end the
* subscription schedule and keep the underlying subscription running.{@code cancel} will end the
* subscription schedule and cancel the underlying subscription.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public EndBehavior getEndBehavior() {
return this.endBehavior;
}
/**
* Specifies which fields in the response should be expanded.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getExpand() {
return this.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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.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}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getMetadata() {
return this.metadata;
}
/**
* List representing phases of the subscription schedule. Each phase can be customized to have
* different durations, plans, and coupons. If there are multiple phases, the {@code end_date} of
* one phase will always equal the {@code start_date} of the next phase. Note that past phases can
* be omitted.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getPhases() {
return this.phases;
}
/**
* This field has been renamed to {@code proration_behavior}. {@code prorate=true} can be replaced
* with {@code proration_behavior=create_prorations} and {@code prorate=false} can be replaced
* with {@code proration_behavior=none}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getProrate() {
return this.prorate;
}
/**
* If the update changes the current phase, indicates if the changes should be prorated. Valid
* values are {@code create_prorations} or {@code none}, and the default value is {@code
* create_prorations}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public ProrationBehavior getProrationBehavior() {
return this.prorationBehavior;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy