com.stripe.param.billingportal.ConfigurationCreateParams Maven / Gradle / Ivy
// Generated by delombok at Thu Oct 07 18:42:34 EDT 2021
// File generated from our OpenAPI spec
package com.stripe.param.billingportal;
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;
public class ConfigurationCreateParams extends ApiRequestParams {
/**
* The business information shown to customers in the portal.
*/
@SerializedName("business_profile")
BusinessProfile businessProfile;
/**
* The default URL to redirect customers to when they click on the portal's link to return to your
* website. This can be overriden
* when creating the session.
*/
@SerializedName("default_return_url")
Object defaultReturnUrl;
/**
* 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;
/**
* Information about the features available in the portal.
*/
@SerializedName("features")
Features features;
private ConfigurationCreateParams(BusinessProfile businessProfile, Object defaultReturnUrl, List expand, Map extraParams, Features features) {
this.businessProfile = businessProfile;
this.defaultReturnUrl = defaultReturnUrl;
this.expand = expand;
this.extraParams = extraParams;
this.features = features;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private BusinessProfile businessProfile;
private Object defaultReturnUrl;
private List expand;
private Map extraParams;
private Features features;
/**
* Finalize and obtain parameter instance from this builder.
*/
public ConfigurationCreateParams build() {
return new ConfigurationCreateParams(this.businessProfile, this.defaultReturnUrl, this.expand, this.extraParams, this.features);
}
/**
* The business information shown to customers in the portal.
*/
public Builder setBusinessProfile(BusinessProfile businessProfile) {
this.businessProfile = businessProfile;
return this;
}
/**
* The default URL to redirect customers to when they click on the portal's link to return to
* your website. This can be overriden
* when creating the session.
*/
public Builder setDefaultReturnUrl(String defaultReturnUrl) {
this.defaultReturnUrl = defaultReturnUrl;
return this;
}
/**
* The default URL to redirect customers to when they click on the portal's link to return to
* your website. This can be overriden
* when creating the session.
*/
public Builder setDefaultReturnUrl(EmptyParam defaultReturnUrl) {
this.defaultReturnUrl = defaultReturnUrl;
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
* ConfigurationCreateParams#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
* ConfigurationCreateParams#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
* ConfigurationCreateParams#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link ConfigurationCreateParams#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Information about the features available in the portal.
*/
public Builder setFeatures(Features features) {
this.features = features;
return this;
}
}
public static class BusinessProfile {
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized 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 messaging shown to customers in the portal.
*/
@SerializedName("headline")
String headline;
/**
* A link to the business’s publicly available privacy policy.
*/
@SerializedName("privacy_policy_url")
String privacyPolicyUrl;
/**
* A link to the business’s publicly available terms of service.
*/
@SerializedName("terms_of_service_url")
String termsOfServiceUrl;
private BusinessProfile(Map extraParams, String headline, String privacyPolicyUrl, String termsOfServiceUrl) {
this.extraParams = extraParams;
this.headline = headline;
this.privacyPolicyUrl = privacyPolicyUrl;
this.termsOfServiceUrl = termsOfServiceUrl;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private String headline;
private String privacyPolicyUrl;
private String termsOfServiceUrl;
/** Finalize and obtain parameter instance from this builder. */
public BusinessProfile build() {
return new BusinessProfile(this.extraParams, this.headline, this.privacyPolicyUrl, this.termsOfServiceUrl);
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* ConfigurationCreateParams.BusinessProfile#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link ConfigurationCreateParams.BusinessProfile#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 messaging shown to customers in the portal. */
public Builder setHeadline(String headline) {
this.headline = headline;
return this;
}
/** A link to the business’s publicly available privacy policy. */
public Builder setPrivacyPolicyUrl(String privacyPolicyUrl) {
this.privacyPolicyUrl = privacyPolicyUrl;
return this;
}
public Builder setTermsOfServiceUrl(String termsOfServiceUrl) {
this.termsOfServiceUrl = termsOfServiceUrl;
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;
}
/**
* The messaging shown to customers in the portal.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getHeadline() {
return this.headline;
}
/**
* A link to the business’s publicly available privacy policy.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPrivacyPolicyUrl() {
return this.privacyPolicyUrl;
}
/**
* A link to the business’s publicly available terms of service.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getTermsOfServiceUrl() {
return this.termsOfServiceUrl;
}
}
/**
* A link to the business’s publicly available terms of service.
*/
public static class Features {
/** Information about updating the customer details in the portal. */
@SerializedName("customer_update")
CustomerUpdate customerUpdate;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized 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;
/** Information about showing the billing history in the portal. */
@SerializedName("invoice_history")
InvoiceHistory invoiceHistory;
/** Information about updating payment methods in the portal. */
@SerializedName("payment_method_update")
PaymentMethodUpdate paymentMethodUpdate;
/** Information about canceling subscriptions in the portal. */
@SerializedName("subscription_cancel")
SubscriptionCancel subscriptionCancel;
/** Information about pausing subscriptions in the portal. */
@SerializedName("subscription_pause")
SubscriptionPause subscriptionPause;
/** Information about updating subscriptions in the portal. */
@SerializedName("subscription_update")
SubscriptionUpdate subscriptionUpdate;
private Features(CustomerUpdate customerUpdate, Map extraParams, InvoiceHistory invoiceHistory, PaymentMethodUpdate paymentMethodUpdate, SubscriptionCancel subscriptionCancel, SubscriptionPause subscriptionPause, SubscriptionUpdate subscriptionUpdate) {
this.customerUpdate = customerUpdate;
this.extraParams = extraParams;
this.invoiceHistory = invoiceHistory;
this.paymentMethodUpdate = paymentMethodUpdate;
this.subscriptionCancel = subscriptionCancel;
this.subscriptionPause = subscriptionPause;
this.subscriptionUpdate = subscriptionUpdate;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private CustomerUpdate customerUpdate;
private Map extraParams;
private InvoiceHistory invoiceHistory;
private PaymentMethodUpdate paymentMethodUpdate;
private SubscriptionCancel subscriptionCancel;
private SubscriptionPause subscriptionPause;
private SubscriptionUpdate subscriptionUpdate;
/** Finalize and obtain parameter instance from this builder. */
public Features build() {
return new Features(this.customerUpdate, this.extraParams, this.invoiceHistory, this.paymentMethodUpdate, this.subscriptionCancel, this.subscriptionPause, this.subscriptionUpdate);
}
/** Information about updating the customer details in the portal. */
public Builder setCustomerUpdate(CustomerUpdate customerUpdate) {
this.customerUpdate = customerUpdate;
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
* ConfigurationCreateParams.Features#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link ConfigurationCreateParams.Features#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Information about showing the billing history in the portal. */
public Builder setInvoiceHistory(InvoiceHistory invoiceHistory) {
this.invoiceHistory = invoiceHistory;
return this;
}
/** Information about updating payment methods in the portal. */
public Builder setPaymentMethodUpdate(PaymentMethodUpdate paymentMethodUpdate) {
this.paymentMethodUpdate = paymentMethodUpdate;
return this;
}
/** Information about canceling subscriptions in the portal. */
public Builder setSubscriptionCancel(SubscriptionCancel subscriptionCancel) {
this.subscriptionCancel = subscriptionCancel;
return this;
}
/** Information about pausing subscriptions in the portal. */
public Builder setSubscriptionPause(SubscriptionPause subscriptionPause) {
this.subscriptionPause = subscriptionPause;
return this;
}
/** Information about updating subscriptions in the portal. */
public Builder setSubscriptionUpdate(SubscriptionUpdate subscriptionUpdate) {
this.subscriptionUpdate = subscriptionUpdate;
return this;
}
}
public static class CustomerUpdate {
/**
* The types of customer updates that are supported. When empty, customers are not updateable.
*/
@SerializedName("allowed_updates")
Object allowedUpdates;
/** Whether the feature is enabled. */
@SerializedName("enabled")
Boolean enabled;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized 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 CustomerUpdate(Object allowedUpdates, Boolean enabled, Map extraParams) {
this.allowedUpdates = allowedUpdates;
this.enabled = enabled;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Object allowedUpdates;
private Boolean enabled;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public CustomerUpdate build() {
return new CustomerUpdate(this.allowedUpdates, this.enabled, this.extraParams);
}
/**
* Add an element to `allowedUpdates` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ConfigurationCreateParams.Features.CustomerUpdate#allowedUpdates} for the field
* documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllowedUpdate(AllowedUpdate element) {
if (this.allowedUpdates == null || this.allowedUpdates instanceof EmptyParam) {
this.allowedUpdates = new ArrayList();
}
((List) this.allowedUpdates).add(element);
return this;
}
/**
* Add all elements to `allowedUpdates` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list.
* See {@link ConfigurationCreateParams.Features.CustomerUpdate#allowedUpdates} for the
* field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllAllowedUpdate(List elements) {
if (this.allowedUpdates == null || this.allowedUpdates instanceof EmptyParam) {
this.allowedUpdates = new ArrayList();
}
((List) this.allowedUpdates).addAll(elements);
return this;
}
/**
* The types of customer updates that are supported. When empty, customers are not
* updateable.
*/
public Builder setAllowedUpdates(EmptyParam allowedUpdates) {
this.allowedUpdates = allowedUpdates;
return this;
}
/**
* The types of customer updates that are supported. When empty, customers are not
* updateable.
*/
public Builder setAllowedUpdates(List allowedUpdates) {
this.allowedUpdates = allowedUpdates;
return this;
}
/** Whether the feature is enabled. */
public Builder setEnabled(Boolean enabled) {
this.enabled = enabled;
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 ConfigurationCreateParams.Features.CustomerUpdate#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ConfigurationCreateParams.Features.CustomerUpdate#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
public enum AllowedUpdate implements ApiRequestParams.EnumParam {
@SerializedName("address")
ADDRESS("address"), @SerializedName("email")
EMAIL("email"), @SerializedName("phone")
PHONE("phone"), @SerializedName("shipping")
SHIPPING("shipping"), @SerializedName("tax_id")
TAX_ID("tax_id");
private final String value;
AllowedUpdate(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 Object getAllowedUpdates() {
return this.allowedUpdates;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getEnabled() {
return this.enabled;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
}
public static class InvoiceHistory {
/** Whether the feature is enabled. */
@SerializedName("enabled")
Boolean enabled;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized 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 InvoiceHistory(Boolean enabled, Map extraParams) {
this.enabled = enabled;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Boolean enabled;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public InvoiceHistory build() {
return new InvoiceHistory(this.enabled, this.extraParams);
}
/** Whether the feature is enabled. */
public Builder setEnabled(Boolean enabled) {
this.enabled = enabled;
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 ConfigurationCreateParams.Features.InvoiceHistory#extraParams} for the
* field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ConfigurationCreateParams.Features.InvoiceHistory#extraParams} for the
* field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getEnabled() {
return this.enabled;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
}
public static class PaymentMethodUpdate {
/** Whether the feature is enabled. */
@SerializedName("enabled")
Boolean enabled;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized 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 PaymentMethodUpdate(Boolean enabled, Map extraParams) {
this.enabled = enabled;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Boolean enabled;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public PaymentMethodUpdate build() {
return new PaymentMethodUpdate(this.enabled, this.extraParams);
}
/** Whether the feature is enabled. */
public Builder setEnabled(Boolean enabled) {
this.enabled = enabled;
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 ConfigurationCreateParams.Features.PaymentMethodUpdate#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ConfigurationCreateParams.Features.PaymentMethodUpdate#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getEnabled() {
return this.enabled;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
}
public static class SubscriptionCancel {
/**
* Whether the cancellation reasons will be collected in the portal and which options are
* exposed to the customer.
*/
@SerializedName("cancellation_reason")
CancellationReason cancellationReason;
/** Whether the feature is enabled. */
@SerializedName("enabled")
Boolean enabled;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized 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;
/** Whether to cancel subscriptions immediately or at the end of the billing period. */
@SerializedName("mode")
Mode mode;
/**
* Whether to create prorations when canceling subscriptions. Possible values are {@code none}
* and {@code create_prorations}, which is only compatible with {@code mode=immediately}. No
* prorations are generated when canceling a subscription at the end of its natural billing
* period.
*/
@SerializedName("proration_behavior")
ProrationBehavior prorationBehavior;
private SubscriptionCancel(CancellationReason cancellationReason, Boolean enabled, Map extraParams, Mode mode, ProrationBehavior prorationBehavior) {
this.cancellationReason = cancellationReason;
this.enabled = enabled;
this.extraParams = extraParams;
this.mode = mode;
this.prorationBehavior = prorationBehavior;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private CancellationReason cancellationReason;
private Boolean enabled;
private Map extraParams;
private Mode mode;
private ProrationBehavior prorationBehavior;
/** Finalize and obtain parameter instance from this builder. */
public SubscriptionCancel build() {
return new SubscriptionCancel(this.cancellationReason, this.enabled, this.extraParams, this.mode, this.prorationBehavior);
}
/**
* Whether the cancellation reasons will be collected in the portal and which options are
* exposed to the customer.
*/
public Builder setCancellationReason(CancellationReason cancellationReason) {
this.cancellationReason = cancellationReason;
return this;
}
/** Whether the feature is enabled. */
public Builder setEnabled(Boolean enabled) {
this.enabled = enabled;
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 ConfigurationCreateParams.Features.SubscriptionCancel#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link ConfigurationCreateParams.Features.SubscriptionCancel#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Whether to cancel subscriptions immediately or at the end of the billing period. */
public Builder setMode(Mode mode) {
this.mode = mode;
return this;
}
/**
* Whether to create prorations when canceling subscriptions. Possible values are {@code
* none} and {@code create_prorations}, which is only compatible with {@code
* mode=immediately}. No prorations are generated when canceling a subscription at the end
* of its natural billing period.
*/
public Builder setProrationBehavior(ProrationBehavior prorationBehavior) {
this.prorationBehavior = prorationBehavior;
return this;
}
}
public static class CancellationReason {
/** Whether the feature is enabled. */
@SerializedName("enabled")
Boolean enabled;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized 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;
/** Which cancellation reasons will be given as options to the customer. */
@SerializedName("options")
Object options;
private CancellationReason(Boolean enabled, Map extraParams, Object options) {
this.enabled = enabled;
this.extraParams = extraParams;
this.options = options;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Boolean enabled;
private Map extraParams;
private Object options;
/** Finalize and obtain parameter instance from this builder. */
public CancellationReason build() {
return new CancellationReason(this.enabled, this.extraParams, this.options);
}
/** Whether the feature is enabled. */
public Builder setEnabled(Boolean enabled) {
this.enabled = enabled;
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
* ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason#extraParams}
* for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link
* ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason#extraParams}
* for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Add an element to `options` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason#options} for
* the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addOption(Option element) {
if (this.options == null || this.options instanceof EmptyParam) {
this.options = new ArrayList();
}
((List) this.options).add(element);
return this;
}
/**
* Add all elements to `options` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason#options} for
* the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllOption(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy