com.stripe.param.billingportal.ConfigurationCreateParams Maven / Gradle / Ivy
// Generated by delombok at Wed Jun 30 19:13:16 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 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(Boolean enabled, Map extraParams, Mode mode, ProrationBehavior prorationBehavior) {
this.enabled = enabled;
this.extraParams = extraParams;
this.mode = mode;
this.prorationBehavior = prorationBehavior;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
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.enabled, this.extraParams, this.mode, this.prorationBehavior);
}
/** 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 enum Mode implements ApiRequestParams.EnumParam {
@SerializedName("at_period_end")
AT_PERIOD_END("at_period_end"), @SerializedName("immediately")
IMMEDIATELY("immediately");
private final String value;
Mode(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;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getEnabled() {
return this.enabled;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Mode getMode() {
return this.mode;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public ProrationBehavior getProrationBehavior() {
return this.prorationBehavior;
}
}
public static class SubscriptionPause {
/** 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 SubscriptionPause(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 SubscriptionPause build() {
return new SubscriptionPause(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.SubscriptionPause#extraParams} for the
* 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.SubscriptionPause#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 SubscriptionUpdate {
/**
* The types of subscription updates that are supported. When empty, subscriptions are not
* updateable.
*/
@SerializedName("default_allowed_updates")
Object defaultAllowedUpdates;
/** 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;
/** The list of products that support subscription updates. */
@SerializedName("products")
Object products;
/**
* Determines how to handle prorations resulting from subscription updates. Valid values are
* {@code none}, {@code create_prorations}, and {@code always_invoice}.
*/
@SerializedName("proration_behavior")
ProrationBehavior prorationBehavior;
private SubscriptionUpdate(Object defaultAllowedUpdates, Boolean enabled, Map extraParams, Object products, ProrationBehavior prorationBehavior) {
this.defaultAllowedUpdates = defaultAllowedUpdates;
this.enabled = enabled;
this.extraParams = extraParams;
this.products = products;
this.prorationBehavior = prorationBehavior;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Object defaultAllowedUpdates;
private Boolean enabled;
private Map extraParams;
private Object products;
private ProrationBehavior prorationBehavior;
/** Finalize and obtain parameter instance from this builder. */
public SubscriptionUpdate build() {
return new SubscriptionUpdate(this.defaultAllowedUpdates, this.enabled, this.extraParams, this.products, this.prorationBehavior);
}
/**
* Add an element to `defaultAllowedUpdates` 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.SubscriptionUpdate#defaultAllowedUpdates}
* for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addDefaultAllowedUpdate(DefaultAllowedUpdate element) {
if (this.defaultAllowedUpdates == null || this.defaultAllowedUpdates instanceof EmptyParam) {
this.defaultAllowedUpdates = new ArrayList();
}
((List) this.defaultAllowedUpdates).add(element);
return this;
}
/**
* Add all elements to `defaultAllowedUpdates` 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.SubscriptionUpdate#defaultAllowedUpdates}
* for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllDefaultAllowedUpdate(List elements) {
if (this.defaultAllowedUpdates == null || this.defaultAllowedUpdates instanceof EmptyParam) {
this.defaultAllowedUpdates = new ArrayList();
}
((List) this.defaultAllowedUpdates).addAll(elements);
return this;
}
/**
* The types of subscription updates that are supported. When empty, subscriptions are not
* updateable.
*/
public Builder setDefaultAllowedUpdates(EmptyParam defaultAllowedUpdates) {
this.defaultAllowedUpdates = defaultAllowedUpdates;
return this;
}
/**
* The types of subscription updates that are supported. When empty, subscriptions are not
* updateable.
*/
public Builder setDefaultAllowedUpdates(List defaultAllowedUpdates) {
this.defaultAllowedUpdates = defaultAllowedUpdates;
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.SubscriptionUpdate#extraParams} for
* the 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.SubscriptionUpdate#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 `products` 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.SubscriptionUpdate#products} for the field
* documentation.
*/
@SuppressWarnings("unchecked")
public Builder addProduct(Product element) {
if (this.products == null || this.products instanceof EmptyParam) {
this.products = new ArrayList();
}
((List) this.products).add(element);
return this;
}
/**
* Add all elements to `products` 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.SubscriptionUpdate#products} for the field
* documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllProduct(List elements) {
if (this.products == null || this.products instanceof EmptyParam) {
this.products = new ArrayList();
}
((List) this.products).addAll(elements);
return this;
}
/** The list of products that support subscription updates. */
public Builder setProducts(EmptyParam products) {
this.products = products;
return this;
}
/** The list of products that support subscription updates. */
public Builder setProducts(List products) {
this.products = products;
return this;
}
/**
* Determines how to handle prorations resulting from subscription updates. Valid values are
* {@code none}, {@code create_prorations}, and {@code always_invoice}.
*/
public Builder setProrationBehavior(ProrationBehavior prorationBehavior) {
this.prorationBehavior = prorationBehavior;
return this;
}
}
public static class Product {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-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 list of prices IDs that a subscription can be updated to. */
@SerializedName("prices")
List prices;
/** The product id. */
@SerializedName("product")
String product;
private Product(Map extraParams, List prices, String product) {
this.extraParams = extraParams;
this.prices = prices;
this.product = product;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private List prices;
private String product;
/** Finalize and obtain parameter instance from this builder. */
public Product build() {
return new Product(this.extraParams, this.prices, this.product);
}
/**
* Add a key/value pair to `extraParams` map. 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.SubscriptionUpdate.Product#extraParams} for the
* 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.SubscriptionUpdate.Product#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 `prices` 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.SubscriptionUpdate.Product#prices} for the field
* documentation.
*/
public Builder addPrice(String element) {
if (this.prices == null) {
this.prices = new ArrayList<>();
}
this.prices.add(element);
return this;
}
/**
* Add all elements to `prices` 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.SubscriptionUpdate.Product#prices} for the field
* documentation.
*/
public Builder addAllPrice(List elements) {
if (this.prices == null) {
this.prices = new ArrayList<>();
}
this.prices.addAll(elements);
return this;
}
/** The product id. */
public Builder setProduct(String product) {
this.product = product;
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getPrices() {
return this.prices;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getProduct() {
return this.product;
}
}
public enum DefaultAllowedUpdate implements ApiRequestParams.EnumParam {
@SerializedName("price")
PRICE("price"), @SerializedName("promotion_code")
PROMOTION_CODE("promotion_code"), @SerializedName("quantity")
QUANTITY("quantity");
private final String value;
DefaultAllowedUpdate(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;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getDefaultAllowedUpdates() {
return this.defaultAllowedUpdates;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getEnabled() {
return this.enabled;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getProducts() {
return this.products;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public ProrationBehavior getProrationBehavior() {
return this.prorationBehavior;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public CustomerUpdate getCustomerUpdate() {
return this.customerUpdate;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public InvoiceHistory getInvoiceHistory() {
return this.invoiceHistory;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public PaymentMethodUpdate getPaymentMethodUpdate() {
return this.paymentMethodUpdate;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SubscriptionCancel getSubscriptionCancel() {
return this.subscriptionCancel;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SubscriptionPause getSubscriptionPause() {
return this.subscriptionPause;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SubscriptionUpdate getSubscriptionUpdate() {
return this.subscriptionUpdate;
}
}
/**
* The business information shown to customers in the portal.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BusinessProfile getBusinessProfile() {
return this.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.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getDefaultReturnUrl() {
return this.defaultReturnUrl;
}
/**
* 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;
}
/**
* Information about the features available in the portal.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Features getFeatures() {
return this.features;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy