
com.stripe.param.InvoiceUpcomingParams 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;
import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiRequestParams.EnumParam;
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 InvoiceUpcomingParams extends ApiRequestParams {
/**
* Settings for automatic tax lookup for this invoice preview.
*/
@SerializedName("automatic_tax")
AutomaticTax automaticTax;
/**
* The code of the coupon to apply. If {@code subscription} or {@code subscription_items} is
* provided, the invoice returned will preview updating or creating a subscription with that
* coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming
* invoice from among the customer's subscriptions. The invoice can be previewed without a coupon
* by passing this value as an empty string.
*/
@SerializedName("coupon")
String coupon;
/**
* The identifier of the customer whose upcoming invoice you'd like to retrieve.
*/
@SerializedName("customer")
String customer;
/**
* Details about the customer you want to invoice or overrides for an existing customer.
*/
@SerializedName("customer_details")
CustomerDetails customerDetails;
/**
* The coupons to redeem into discounts for the invoice preview. If not specified, inherits the
* discount from the customer or subscription. Pass an empty string to avoid inheriting any
* discounts. To preview the upcoming invoice for a subscription that hasn't been created, use
* {@code coupon} instead.
*/
@SerializedName("discounts")
Object discounts;
/**
* 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;
/**
* List of invoice items to add or update in the upcoming invoice preview.
*/
@SerializedName("invoice_items")
List invoiceItems;
/**
* The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot
* be used with subscription or subscription fields.
*/
@SerializedName("schedule")
String schedule;
/**
* The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If
* not provided, but a {@code subscription_items} is provided, you will preview creating a
* subscription with those items. If neither {@code subscription} nor {@code subscription_items}
* is provided, you will retrieve the next upcoming invoice from among the customer's
* subscriptions.
*/
@SerializedName("subscription")
String subscription;
/**
* For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to
* determine the date of the first full invoice, and, for plans with {@code month} or {@code year}
* intervals, the day of the month for subsequent invoices. For existing subscriptions, the value
* can only be set to {@code now} or {@code unchanged}.
*/
@SerializedName("subscription_billing_cycle_anchor")
Object subscriptionBillingCycleAnchor;
/**
* Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if
* within the current period and prorations have been enabled using {@code proration_behavior}.
*/
@SerializedName("subscription_cancel_at")
Object subscriptionCancelAt;
/**
* Boolean indicating whether this subscription should cancel at the end of the current period.
*/
@SerializedName("subscription_cancel_at_period_end")
Boolean subscriptionCancelAtPeriodEnd;
/**
* This simulates the subscription being canceled or expired immediately.
*/
@SerializedName("subscription_cancel_now")
Boolean subscriptionCancelNow;
/**
* If provided, the invoice returned will preview updating or creating a subscription with these
* default tax rates. The default tax rates will apply to any line item that does not have {@code
* tax_rates} set.
*/
@SerializedName("subscription_default_tax_rates")
Object subscriptionDefaultTaxRates;
/**
* A list of up to 20 subscription items, each with an attached price.
*/
@SerializedName("subscription_items")
List subscriptionItems;
/**
* Determines how to handle prorations when the
* billing cycle changes (e.g., when switching plans, resetting {@code billing_cycle_anchor=now},
* or starting a trial), or if an item's {@code quantity} changes. Valid values are {@code
* create_prorations}, {@code none}, or {@code always_invoice}.
*
* Passing {@code create_prorations} will cause proration invoice items to be created when
* applicable. These proration items will only be invoiced immediately under certain
* conditions. In order to always invoice immediately for prorations, pass {@code
* always_invoice}.
*
*
Prorations can be disabled by passing {@code none}.
*/
@SerializedName("subscription_proration_behavior")
SubscriptionProrationBehavior subscriptionProrationBehavior;
/**
* If previewing an update to a subscription, and doing proration, {@code
* subscription_proration_date} forces the proration to be calculated as though the update was
* done at the specified time. The time given must be within the current subscription period, and
* cannot be before the subscription was on its current plan. If set, {@code subscription}, and
* one of {@code subscription_items}, or {@code subscription_trial_end} are required. Also, {@code
* subscription_proration_behavior} cannot be set to 'none'.
*/
@SerializedName("subscription_proration_date")
Long subscriptionProrationDate;
/**
* Date a subscription is intended to start (can be future or past).
*/
@SerializedName("subscription_start_date")
Long subscriptionStartDate;
/**
* If provided, the invoice returned will preview updating or creating a subscription with that
* trial end. If set, one of {@code subscription_items} or {@code subscription} is required.
*/
@SerializedName("subscription_trial_end")
Object subscriptionTrialEnd;
/**
* Indicates if a plan's {@code trial_period_days} should be applied to the subscription. Setting
* {@code subscription_trial_end} per subscription is preferred, and this defaults to {@code
* false}. Setting this flag to {@code true} together with {@code subscription_trial_end} is not
* allowed.
*/
@SerializedName("subscription_trial_from_plan")
Boolean subscriptionTrialFromPlan;
private InvoiceUpcomingParams(AutomaticTax automaticTax, String coupon, String customer, CustomerDetails customerDetails, Object discounts, List expand, Map extraParams, List invoiceItems, String schedule, String subscription, Object subscriptionBillingCycleAnchor, Object subscriptionCancelAt, Boolean subscriptionCancelAtPeriodEnd, Boolean subscriptionCancelNow, Object subscriptionDefaultTaxRates, List subscriptionItems, SubscriptionProrationBehavior subscriptionProrationBehavior, Long subscriptionProrationDate, Long subscriptionStartDate, Object subscriptionTrialEnd, Boolean subscriptionTrialFromPlan) {
this.automaticTax = automaticTax;
this.coupon = coupon;
this.customer = customer;
this.customerDetails = customerDetails;
this.discounts = discounts;
this.expand = expand;
this.extraParams = extraParams;
this.invoiceItems = invoiceItems;
this.schedule = schedule;
this.subscription = subscription;
this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor;
this.subscriptionCancelAt = subscriptionCancelAt;
this.subscriptionCancelAtPeriodEnd = subscriptionCancelAtPeriodEnd;
this.subscriptionCancelNow = subscriptionCancelNow;
this.subscriptionDefaultTaxRates = subscriptionDefaultTaxRates;
this.subscriptionItems = subscriptionItems;
this.subscriptionProrationBehavior = subscriptionProrationBehavior;
this.subscriptionProrationDate = subscriptionProrationDate;
this.subscriptionStartDate = subscriptionStartDate;
this.subscriptionTrialEnd = subscriptionTrialEnd;
this.subscriptionTrialFromPlan = subscriptionTrialFromPlan;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private AutomaticTax automaticTax;
private String coupon;
private String customer;
private CustomerDetails customerDetails;
private Object discounts;
private List expand;
private Map extraParams;
private List invoiceItems;
private String schedule;
private String subscription;
private Object subscriptionBillingCycleAnchor;
private Object subscriptionCancelAt;
private Boolean subscriptionCancelAtPeriodEnd;
private Boolean subscriptionCancelNow;
private Object subscriptionDefaultTaxRates;
private List subscriptionItems;
private SubscriptionProrationBehavior subscriptionProrationBehavior;
private Long subscriptionProrationDate;
private Long subscriptionStartDate;
private Object subscriptionTrialEnd;
private Boolean subscriptionTrialFromPlan;
/**
* Finalize and obtain parameter instance from this builder.
*/
public InvoiceUpcomingParams build() {
return new InvoiceUpcomingParams(this.automaticTax, this.coupon, this.customer, this.customerDetails, this.discounts, this.expand, this.extraParams, this.invoiceItems, this.schedule, this.subscription, this.subscriptionBillingCycleAnchor, this.subscriptionCancelAt, this.subscriptionCancelAtPeriodEnd, this.subscriptionCancelNow, this.subscriptionDefaultTaxRates, this.subscriptionItems, this.subscriptionProrationBehavior, this.subscriptionProrationDate, this.subscriptionStartDate, this.subscriptionTrialEnd, this.subscriptionTrialFromPlan);
}
/**
* Settings for automatic tax lookup for this invoice preview.
*/
public Builder setAutomaticTax(AutomaticTax automaticTax) {
this.automaticTax = automaticTax;
return this;
}
/**
* The code of the coupon to apply. If {@code subscription} or {@code subscription_items} is
* provided, the invoice returned will preview updating or creating a subscription with that
* coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming
* invoice from among the customer's subscriptions. The invoice can be previewed without a
* coupon by passing this value as an empty string.
*/
public Builder setCoupon(String coupon) {
this.coupon = coupon;
return this;
}
/**
* The identifier of the customer whose upcoming invoice you'd like to retrieve.
*/
public Builder setCustomer(String customer) {
this.customer = customer;
return this;
}
/**
* Details about the customer you want to invoice or overrides for an existing customer.
*/
public Builder setCustomerDetails(CustomerDetails customerDetails) {
this.customerDetails = customerDetails;
return this;
}
/**
* Add an element to `discounts` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams#discounts} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addDiscount(Discount element) {
if (this.discounts == null || this.discounts instanceof EmptyParam) {
this.discounts = new ArrayList();
}
((List) this.discounts).add(element);
return this;
}
/**
* Add all elements to `discounts` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams#discounts} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllDiscount(List elements) {
if (this.discounts == null || this.discounts instanceof EmptyParam) {
this.discounts = new ArrayList();
}
((List) this.discounts).addAll(elements);
return this;
}
/**
* The coupons to redeem into discounts for the invoice preview. If not specified, inherits the
* discount from the customer or subscription. Pass an empty string to avoid inheriting any
* discounts. To preview the upcoming invoice for a subscription that hasn't been created, use
* {@code coupon} instead.
*/
public Builder setDiscounts(EmptyParam discounts) {
this.discounts = discounts;
return this;
}
/**
* The coupons to redeem into discounts for the invoice preview. If not specified, inherits the
* discount from the customer or subscription. Pass an empty string to avoid inheriting any
* discounts. To preview the upcoming invoice for a subscription that hasn't been created, use
* {@code coupon} instead.
*/
public Builder setDiscounts(List discounts) {
this.discounts = discounts;
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
* InvoiceUpcomingParams#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
* InvoiceUpcomingParams#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
* InvoiceUpcomingParams#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 InvoiceUpcomingParams#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 `invoiceItems` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams#invoiceItems} for the field documentation.
*/
public Builder addInvoiceItem(InvoiceItem element) {
if (this.invoiceItems == null) {
this.invoiceItems = new ArrayList<>();
}
this.invoiceItems.add(element);
return this;
}
/**
* Add all elements to `invoiceItems` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams#invoiceItems} for the field documentation.
*/
public Builder addAllInvoiceItem(List elements) {
if (this.invoiceItems == null) {
this.invoiceItems = new ArrayList<>();
}
this.invoiceItems.addAll(elements);
return this;
}
/**
* The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve.
* Cannot be used with subscription or subscription fields.
*/
public Builder setSchedule(String schedule) {
this.schedule = schedule;
return this;
}
/**
* The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If
* not provided, but a {@code subscription_items} is provided, you will preview creating a
* subscription with those items. If neither {@code subscription} nor {@code subscription_items}
* is provided, you will retrieve the next upcoming invoice from among the customer's
* subscriptions.
*/
public Builder setSubscription(String subscription) {
this.subscription = subscription;
return this;
}
/**
* For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to
* determine the date of the first full invoice, and, for plans with {@code month} or {@code
* year} intervals, the day of the month for subsequent invoices. For existing subscriptions,
* the value can only be set to {@code now} or {@code unchanged}.
*/
public Builder setSubscriptionBillingCycleAnchor(SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor) {
this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor;
return this;
}
/**
* For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to
* determine the date of the first full invoice, and, for plans with {@code month} or {@code
* year} intervals, the day of the month for subsequent invoices. For existing subscriptions,
* the value can only be set to {@code now} or {@code unchanged}.
*/
public Builder setSubscriptionBillingCycleAnchor(Long subscriptionBillingCycleAnchor) {
this.subscriptionBillingCycleAnchor = subscriptionBillingCycleAnchor;
return this;
}
/**
* Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if
* within the current period and prorations have been enabled using {@code proration_behavior}.
*/
public Builder setSubscriptionCancelAt(Long subscriptionCancelAt) {
this.subscriptionCancelAt = subscriptionCancelAt;
return this;
}
/**
* Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if
* within the current period and prorations have been enabled using {@code proration_behavior}.
*/
public Builder setSubscriptionCancelAt(EmptyParam subscriptionCancelAt) {
this.subscriptionCancelAt = subscriptionCancelAt;
return this;
}
/**
* Boolean indicating whether this subscription should cancel at the end of the current period.
*/
public Builder setSubscriptionCancelAtPeriodEnd(Boolean subscriptionCancelAtPeriodEnd) {
this.subscriptionCancelAtPeriodEnd = subscriptionCancelAtPeriodEnd;
return this;
}
/**
* This simulates the subscription being canceled or expired immediately.
*/
public Builder setSubscriptionCancelNow(Boolean subscriptionCancelNow) {
this.subscriptionCancelNow = subscriptionCancelNow;
return this;
}
/**
* Add an element to `subscriptionDefaultTaxRates` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link InvoiceUpcomingParams#subscriptionDefaultTaxRates} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addSubscriptionDefaultTaxRate(String element) {
if (this.subscriptionDefaultTaxRates == null || this.subscriptionDefaultTaxRates instanceof EmptyParam) {
this.subscriptionDefaultTaxRates = new ArrayList();
}
((List) this.subscriptionDefaultTaxRates).add(element);
return this;
}
/**
* Add all elements to `subscriptionDefaultTaxRates` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link InvoiceUpcomingParams#subscriptionDefaultTaxRates} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllSubscriptionDefaultTaxRate(List elements) {
if (this.subscriptionDefaultTaxRates == null || this.subscriptionDefaultTaxRates instanceof EmptyParam) {
this.subscriptionDefaultTaxRates = new ArrayList();
}
((List) this.subscriptionDefaultTaxRates).addAll(elements);
return this;
}
/**
* If provided, the invoice returned will preview updating or creating a subscription with these
* default tax rates. The default tax rates will apply to any line item that does not have
* {@code tax_rates} set.
*/
public Builder setSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates) {
this.subscriptionDefaultTaxRates = subscriptionDefaultTaxRates;
return this;
}
/**
* If provided, the invoice returned will preview updating or creating a subscription with these
* default tax rates. The default tax rates will apply to any line item that does not have
* {@code tax_rates} set.
*/
public Builder setSubscriptionDefaultTaxRates(List subscriptionDefaultTaxRates) {
this.subscriptionDefaultTaxRates = subscriptionDefaultTaxRates;
return this;
}
/**
* Add an element to `subscriptionItems` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams#subscriptionItems} for the field documentation.
*/
public Builder addSubscriptionItem(SubscriptionItem element) {
if (this.subscriptionItems == null) {
this.subscriptionItems = new ArrayList<>();
}
this.subscriptionItems.add(element);
return this;
}
/**
* Add all elements to `subscriptionItems` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link InvoiceUpcomingParams#subscriptionItems} for the field documentation.
*/
public Builder addAllSubscriptionItem(List elements) {
if (this.subscriptionItems == null) {
this.subscriptionItems = new ArrayList<>();
}
this.subscriptionItems.addAll(elements);
return this;
}
/**
* Determines how to handle prorations when the
* billing cycle changes (e.g., when switching plans, resetting {@code
* billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes.
* Valid values are {@code create_prorations}, {@code none}, or {@code always_invoice}.
*
* Passing {@code create_prorations} will cause proration invoice items to be created when
* applicable. These proration items will only be invoiced immediately under certain
* conditions. In order to always invoice immediately for prorations, pass {@code
* always_invoice}.
*
*
Prorations can be disabled by passing {@code none}.
*/
public Builder setSubscriptionProrationBehavior(SubscriptionProrationBehavior subscriptionProrationBehavior) {
this.subscriptionProrationBehavior = subscriptionProrationBehavior;
return this;
}
/**
* If previewing an update to a subscription, and doing proration, {@code
* subscription_proration_date} forces the proration to be calculated as though the update was
* done at the specified time. The time given must be within the current subscription period,
* and cannot be before the subscription was on its current plan. If set, {@code subscription},
* and one of {@code subscription_items}, or {@code subscription_trial_end} are required. Also,
* {@code subscription_proration_behavior} cannot be set to 'none'.
*/
public Builder setSubscriptionProrationDate(Long subscriptionProrationDate) {
this.subscriptionProrationDate = subscriptionProrationDate;
return this;
}
/**
* Date a subscription is intended to start (can be future or past).
*/
public Builder setSubscriptionStartDate(Long subscriptionStartDate) {
this.subscriptionStartDate = subscriptionStartDate;
return this;
}
/**
* If provided, the invoice returned will preview updating or creating a subscription with that
* trial end. If set, one of {@code subscription_items} or {@code subscription} is required.
*/
public Builder setSubscriptionTrialEnd(SubscriptionTrialEnd subscriptionTrialEnd) {
this.subscriptionTrialEnd = subscriptionTrialEnd;
return this;
}
/**
* If provided, the invoice returned will preview updating or creating a subscription with that
* trial end. If set, one of {@code subscription_items} or {@code subscription} is required.
*/
public Builder setSubscriptionTrialEnd(Long subscriptionTrialEnd) {
this.subscriptionTrialEnd = subscriptionTrialEnd;
return this;
}
/**
* Indicates if a plan's {@code trial_period_days} should be applied to the subscription.
* Setting {@code subscription_trial_end} per subscription is preferred, and this defaults to
* {@code false}. Setting this flag to {@code true} together with {@code subscription_trial_end}
* is not allowed.
*/
public Builder setSubscriptionTrialFromPlan(Boolean subscriptionTrialFromPlan) {
this.subscriptionTrialFromPlan = subscriptionTrialFromPlan;
return this;
}
}
public static class AutomaticTax {
/**
* Controls whether Stripe will automatically compute tax on this invoice.
*/
@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 AutomaticTax(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 AutomaticTax build() {
return new AutomaticTax(this.enabled, this.extraParams);
}
/** Controls whether Stripe will automatically compute tax on this invoice. */
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
* InvoiceUpcomingParams.AutomaticTax#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;
}
}
/**
* Controls whether Stripe will automatically compute tax on this invoice.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getEnabled() {
return this.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.
*/
@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 InvoiceUpcomingParams.AutomaticTax#extraParams} for the field documentation.
*/
public static class CustomerDetails {
/**
* The customer's address.
*/
@SerializedName("address")
Object address;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* The customer's shipping information. Appears on invoices emailed to this customer.
*/
@SerializedName("shipping")
Object shipping;
/**
* Tax details about the customer.
*/
@SerializedName("tax")
Tax tax;
/**
* The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}.
*/
@SerializedName("tax_exempt")
EnumParam taxExempt;
/**
* The customer's tax IDs.
*/
@SerializedName("tax_ids")
List taxIds;
private CustomerDetails(Object address, Map extraParams, Object shipping, Tax tax, EnumParam taxExempt, List taxIds) {
this.address = address;
this.extraParams = extraParams;
this.shipping = shipping;
this.tax = tax;
this.taxExempt = taxExempt;
this.taxIds = taxIds;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Object address;
private Map extraParams;
private Object shipping;
private Tax tax;
private EnumParam taxExempt;
private List taxIds;
/**
* Finalize and obtain parameter instance from this builder.
*/
public CustomerDetails build() {
return new CustomerDetails(this.address, this.extraParams, this.shipping, this.tax, this.taxExempt, this.taxIds);
}
/**
* The customer's address.
*/
public Builder setAddress(Address address) {
this.address = address;
return this;
}
/**
* The customer's address.
*/
public Builder setAddress(EmptyParam address) {
this.address = address;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* InvoiceUpcomingParams.CustomerDetails#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link InvoiceUpcomingParams.CustomerDetails#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* The customer's shipping information. Appears on invoices emailed to this customer.
*/
public Builder setShipping(Shipping shipping) {
this.shipping = shipping;
return this;
}
/**
* The customer's shipping information. Appears on invoices emailed to this customer.
*/
public Builder setShipping(EmptyParam shipping) {
this.shipping = shipping;
return this;
}
/**
* Tax details about the customer.
*/
public Builder setTax(Tax tax) {
this.tax = tax;
return this;
}
/**
* The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}.
*/
public Builder setTaxExempt(TaxExempt taxExempt) {
this.taxExempt = taxExempt;
return this;
}
/**
* The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}.
*/
public Builder setTaxExempt(EmptyParam taxExempt) {
this.taxExempt = taxExempt;
return this;
}
/**
* Add an element to `taxIds` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams.CustomerDetails#taxIds} for the field documentation.
*/
public Builder addTaxId(TaxId element) {
if (this.taxIds == null) {
this.taxIds = new ArrayList<>();
}
this.taxIds.add(element);
return this;
}
/**
* Add all elements to `taxIds` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams.CustomerDetails#taxIds} for the field documentation.
*/
public Builder addAllTaxId(List elements) {
if (this.taxIds == null) {
this.taxIds = new ArrayList<>();
}
this.taxIds.addAll(elements);
return this;
}
}
public static class Address {
/**
* City, district, suburb, town, or village.
*/
@SerializedName("city")
String city;
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
@SerializedName("country")
String country;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
* name in this param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
@SerializedName("line1")
String line1;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
@SerializedName("line2")
String line2;
/**
* ZIP or postal code.
*/
@SerializedName("postal_code")
String postalCode;
/**
* State, county, province, or region.
*/
@SerializedName("state")
String state;
private Address(String city, String country, Map extraParams, String line1, String line2, String postalCode, String state) {
this.city = city;
this.country = country;
this.extraParams = extraParams;
this.line1 = line1;
this.line2 = line2;
this.postalCode = postalCode;
this.state = state;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String city;
private String country;
private Map extraParams;
private String line1;
private String line2;
private String postalCode;
private String state;
/** Finalize and obtain parameter instance from this builder. */
public Address build() {
return new Address(this.city, this.country, this.extraParams, this.line1, this.line2, this.postalCode, this.state);
}
/** City, district, suburb, town, or village. */
public Builder setCity(String city) {
this.city = city;
return this;
}
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
public Builder setCountry(String country) {
this.country = country;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link InvoiceUpcomingParams.CustomerDetails.Address#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link InvoiceUpcomingParams.CustomerDetails.Address#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(String line1) {
this.line1 = line1;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(String line2) {
this.line2 = line2;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
public Builder setState(String state) {
this.state = state;
return this;
}
}
/**
* City, district, suburb, town, or village.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCity() {
return this.city;
}
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCountry() {
return this.country;
}
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
* name in this param object. Effectively, this map is flattened to its parent instance.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getLine1() {
return this.line1;
}
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getLine2() {
return this.line2;
}
/**
* ZIP or postal code.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPostalCode() {
return this.postalCode;
}
/**
* State, county, province, or region.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getState() {
return this.state;
}
}
/**
* State, county, province, or region.
*/
public static class Shipping {
/**
* Customer shipping address.
*/
@SerializedName("address")
Address address;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
* name in this param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Customer name.
*/
@SerializedName("name")
String name;
/**
* Customer phone (including extension).
*/
@SerializedName("phone")
String phone;
private Shipping(Address address, Map extraParams, String name, String phone) {
this.address = address;
this.extraParams = extraParams;
this.name = name;
this.phone = phone;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Address address;
private Map extraParams;
private String name;
private String phone;
/**
* Finalize and obtain parameter instance from this builder.
*/
public Shipping build() {
return new Shipping(this.address, this.extraParams, this.name, this.phone);
}
/**
* Customer shipping address.
*/
public Builder setAddress(Address address) {
this.address = address;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link InvoiceUpcomingParams.CustomerDetails.Shipping#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 InvoiceUpcomingParams.CustomerDetails.Shipping#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Customer name.
*/
public Builder setName(String name) {
this.name = name;
return this;
}
/**
* Customer phone (including extension).
*/
public Builder setPhone(String phone) {
this.phone = phone;
return this;
}
}
public static class Address {
/** City, district, suburb, town, or village. */
@SerializedName("city")
String city;
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
@SerializedName("country")
String country;
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field
* (serialized) name in this param object. Effectively, this map is flattened to its parent
* instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/** Address line 1 (e.g., street, PO Box, or company name). */
@SerializedName("line1")
String line1;
/** Address line 2 (e.g., apartment, suite, unit, or building). */
@SerializedName("line2")
String line2;
/** ZIP or postal code. */
@SerializedName("postal_code")
String postalCode;
/** State, county, province, or region. */
@SerializedName("state")
String state;
private Address(String city, String country, Map extraParams, String line1, String line2, String postalCode, String state) {
this.city = city;
this.country = country;
this.extraParams = extraParams;
this.line1 = line1;
this.line2 = line2;
this.postalCode = postalCode;
this.state = state;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String city;
private String country;
private Map extraParams;
private String line1;
private String line2;
private String postalCode;
private String state;
/** Finalize and obtain parameter instance from this builder. */
public Address build() {
return new Address(this.city, this.country, this.extraParams, this.line1, this.line2, this.postalCode, this.state);
}
/** City, district, suburb, town, or village. */
public Builder setCity(String city) {
this.city = city;
return this;
}
/**
* Two-letter country code (ISO
* 3166-1 alpha-2).
*/
public Builder setCountry(String country) {
this.country = country;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link InvoiceUpcomingParams.CustomerDetails.Shipping.Address#extraParams} for
* the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link InvoiceUpcomingParams.CustomerDetails.Shipping.Address#extraParams} for
* the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/** Address line 1 (e.g., street, PO Box, or company name). */
public Builder setLine1(String line1) {
this.line1 = line1;
return this;
}
/** Address line 2 (e.g., apartment, suite, unit, or building). */
public Builder setLine2(String line2) {
this.line2 = line2;
return this;
}
/** ZIP or postal code. */
public Builder setPostalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
public Builder setState(String state) {
this.state = state;
return this;
}
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCity() {
return this.city;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCountry() {
return this.country;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getLine1() {
return this.line1;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getLine2() {
return this.line2;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPostalCode() {
return this.postalCode;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getState() {
return this.state;
}
}
/**
* Customer shipping address.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Address getAddress() {
return this.address;
}
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
* name in this param object. Effectively, this map is flattened to its parent instance.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* Customer name.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getName() {
return this.name;
}
/**
* Customer phone (including extension).
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPhone() {
return this.phone;
}
}
/**
* State, county, province, or region.
*/
public static class Tax {
/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
* Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
* name in this param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* A recent IP address of the customer used for tax reporting and tax location inference.
* Stripe recommends updating the IP address when a new PaymentMethod is attached or the
* address field on the customer is updated. We recommend against updating this field more
* frequently since it could result in unexpected tax location/reporting outcomes.
*/
@SerializedName("ip_address")
Object ipAddress;
private Tax(Map extraParams, Object ipAddress) {
this.extraParams = extraParams;
this.ipAddress = ipAddress;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Object ipAddress;
/** Finalize and obtain parameter instance from this builder. */
public Tax build() {
return new Tax(this.extraParams, this.ipAddress);
}
/**
* 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 InvoiceUpcomingParams.CustomerDetails.Tax#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 InvoiceUpcomingParams.CustomerDetails.Tax#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* A recent IP address of the customer used for tax reporting and tax location inference.
* Stripe recommends updating the IP address when a new PaymentMethod is attached or the
* address field on the customer is updated. We recommend against updating this field more
* frequently since it could result in unexpected tax location/reporting outcomes.
*/
public Builder setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
return this;
}
public Builder setIpAddress(EmptyParam ipAddress) {
this.ipAddress = ipAddress;
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;
}
/**
* A recent IP address of the customer used for tax reporting and tax location inference.
* Stripe recommends updating the IP address when a new PaymentMethod is attached or the
* address field on the customer is updated. We recommend against updating this field more
* frequently since it could result in unexpected tax location/reporting outcomes.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getIpAddress() {
return this.ipAddress;
}
}
/**
* A recent IP address of the customer used for tax reporting and tax location inference.
* Stripe recommends updating the IP address when a new PaymentMethod is attached or the
* address field on the customer is updated. We recommend against updating this field more
* frequently since it could result in unexpected tax location/reporting outcomes.
*/
public static class TaxId {
/**
* 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;
/**
* Type of the tax ID, one of {@code ae_trn}, {@code au_abn}, {@code au_arn}, {@code br_cnpj},
* {@code br_cpf}, {@code ca_bn}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb},
* {@code ca_pst_sk}, {@code ca_qst}, {@code ch_vat}, {@code cl_tin}, {@code es_cif}, {@code
* eu_vat}, {@code gb_vat}, {@code hk_br}, {@code id_npwp}, {@code il_vat}, {@code in_gst},
* {@code jp_cn}, {@code jp_rn}, {@code kr_brn}, {@code li_uid}, {@code mx_rfc}, {@code
* my_frp}, {@code my_itn}, {@code my_sst}, {@code no_vat}, {@code nz_gst}, {@code ru_inn},
* {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code th_vat}, {@code
* tw_vat}, {@code us_ein}, or {@code za_vat}.
*/
@SerializedName("type")
Type type;
/**
* Value of the tax ID.
*/
@SerializedName("value")
String value;
private TaxId(Map extraParams, Type type, String value) {
this.extraParams = extraParams;
this.type = type;
this.value = value;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Map extraParams;
private Type type;
private String value;
/**
* Finalize and obtain parameter instance from this builder.
*/
public TaxId build() {
return new TaxId(this.extraParams, this.type, this.value);
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link InvoiceUpcomingParams.CustomerDetails.TaxId#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 InvoiceUpcomingParams.CustomerDetails.TaxId#extraParams} for the field
* documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Type of the tax ID, one of {@code ae_trn}, {@code au_abn}, {@code au_arn}, {@code
* br_cnpj}, {@code br_cpf}, {@code ca_bn}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code
* ca_pst_mb}, {@code ca_pst_sk}, {@code ca_qst}, {@code ch_vat}, {@code cl_tin}, {@code
* es_cif}, {@code eu_vat}, {@code gb_vat}, {@code hk_br}, {@code id_npwp}, {@code il_vat},
* {@code in_gst}, {@code jp_cn}, {@code jp_rn}, {@code kr_brn}, {@code li_uid}, {@code
* mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code no_vat}, {@code nz_gst},
* {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code
* th_vat}, {@code tw_vat}, {@code us_ein}, or {@code za_vat}.
*/
public Builder setType(Type type) {
this.type = type;
return this;
}
/**
* Value of the tax ID.
*/
public Builder setValue(String value) {
this.value = value;
return this;
}
}
public enum Type implements ApiRequestParams.EnumParam {
@SerializedName("ae_trn")
AE_TRN("ae_trn"), @SerializedName("au_abn")
AU_ABN("au_abn"), @SerializedName("au_arn")
AU_ARN("au_arn"), @SerializedName("br_cnpj")
BR_CNPJ("br_cnpj"), @SerializedName("br_cpf")
BR_CPF("br_cpf"), @SerializedName("ca_bn")
CA_BN("ca_bn"), @SerializedName("ca_gst_hst")
CA_GST_HST("ca_gst_hst"), @SerializedName("ca_pst_bc")
CA_PST_BC("ca_pst_bc"), @SerializedName("ca_pst_mb")
CA_PST_MB("ca_pst_mb"), @SerializedName("ca_pst_sk")
CA_PST_SK("ca_pst_sk"), @SerializedName("ca_qst")
CA_QST("ca_qst"), @SerializedName("ch_vat")
CH_VAT("ch_vat"), @SerializedName("cl_tin")
CL_TIN("cl_tin"), @SerializedName("es_cif")
ES_CIF("es_cif"), @SerializedName("eu_vat")
EU_VAT("eu_vat"), @SerializedName("gb_vat")
GB_VAT("gb_vat"), @SerializedName("hk_br")
HK_BR("hk_br"), @SerializedName("id_npwp")
ID_NPWP("id_npwp"), @SerializedName("il_vat")
IL_VAT("il_vat"), @SerializedName("in_gst")
IN_GST("in_gst"), @SerializedName("jp_cn")
JP_CN("jp_cn"), @SerializedName("jp_rn")
JP_RN("jp_rn"), @SerializedName("kr_brn")
KR_BRN("kr_brn"), @SerializedName("li_uid")
LI_UID("li_uid"), @SerializedName("mx_rfc")
MX_RFC("mx_rfc"), @SerializedName("my_frp")
MY_FRP("my_frp"), @SerializedName("my_itn")
MY_ITN("my_itn"), @SerializedName("my_sst")
MY_SST("my_sst"), @SerializedName("no_vat")
NO_VAT("no_vat"), @SerializedName("nz_gst")
NZ_GST("nz_gst"), @SerializedName("ru_inn")
RU_INN("ru_inn"), @SerializedName("ru_kpp")
RU_KPP("ru_kpp"), @SerializedName("sa_vat")
SA_VAT("sa_vat"), @SerializedName("sg_gst")
SG_GST("sg_gst"), @SerializedName("sg_uen")
SG_UEN("sg_uen"), @SerializedName("th_vat")
TH_VAT("th_vat"), @SerializedName("tw_vat")
TW_VAT("tw_vat"), @SerializedName("us_ein")
US_EIN("us_ein"), @SerializedName("za_vat")
ZA_VAT("za_vat");
private final String value;
Type(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* 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;
}
/**
* Type of the tax ID, one of {@code ae_trn}, {@code au_abn}, {@code au_arn}, {@code br_cnpj},
* {@code br_cpf}, {@code ca_bn}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb},
* {@code ca_pst_sk}, {@code ca_qst}, {@code ch_vat}, {@code cl_tin}, {@code es_cif}, {@code
* eu_vat}, {@code gb_vat}, {@code hk_br}, {@code id_npwp}, {@code il_vat}, {@code in_gst},
* {@code jp_cn}, {@code jp_rn}, {@code kr_brn}, {@code li_uid}, {@code mx_rfc}, {@code
* my_frp}, {@code my_itn}, {@code my_sst}, {@code no_vat}, {@code nz_gst}, {@code ru_inn},
* {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code th_vat}, {@code
* tw_vat}, {@code us_ein}, or {@code za_vat}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Type getType() {
return this.type;
}
/**
* Value of the tax ID.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum TaxExempt implements ApiRequestParams.EnumParam {
@SerializedName("exempt")
EXEMPT("exempt"), @SerializedName("none")
NONE("none"), @SerializedName("reverse")
REVERSE("reverse");
private final String value;
TaxExempt(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* The customer's address.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getAddress() {
return this.address;
}
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* The customer's shipping information. Appears on invoices emailed to this customer.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getShipping() {
return this.shipping;
}
/**
* Tax details about the customer.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Tax getTax() {
return this.tax;
}
/**
* The customer's tax exemption. One of {@code none}, {@code exempt}, or {@code reverse}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public EnumParam getTaxExempt() {
return this.taxExempt;
}
/**
* The customer's tax IDs.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getTaxIds() {
return this.taxIds;
}
}
public static class Discount {
/**
* ID of the coupon to create a new discount for.
*/
@SerializedName("coupon")
String coupon;
/**
* ID of an existing discount on the object (or one of its ancestors) to reuse.
*/
@SerializedName("discount")
String discount;
/**
* 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 Discount(String coupon, String discount, Map extraParams) {
this.coupon = coupon;
this.discount = discount;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String coupon;
private String discount;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public Discount build() {
return new Discount(this.coupon, this.discount, this.extraParams);
}
/** ID of the coupon to create a new discount for. */
public Builder setCoupon(String coupon) {
this.coupon = coupon;
return this;
}
/** ID of an existing discount on the object (or one of its ancestors) to reuse. */
public Builder setDiscount(String discount) {
this.discount = discount;
return this;
}
/**
* 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
* InvoiceUpcomingParams.Discount#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
/**
* ID of the coupon to create a new discount for.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCoupon() {
return this.coupon;
}
/**
* ID of an existing discount on the object (or one of its ancestors) to reuse.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDiscount() {
return this.discount;
}
/**
* 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 InvoiceUpcomingParams.Discount#extraParams} for the field documentation.
*/
public static class InvoiceItem {
/**
* The integer amount in %s of previewed invoice item.
*/
@SerializedName("amount")
Long amount;
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency. Only applicable to new invoice items.
*/
@SerializedName("currency")
String currency;
/**
* An arbitrary string which you can attach to the invoice item. The description is displayed in
* the invoice for easy tracking.
*/
@SerializedName("description")
String description;
/**
* Explicitly controls whether discounts apply to this invoice item. Defaults to true, except
* for negative invoice items.
*/
@SerializedName("discountable")
Boolean discountable;
/**
* The coupons to redeem into discounts for the invoice item in the preview.
*/
@SerializedName("discounts")
Object discounts;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* The ID of the invoice item to update in preview. If not specified, a new invoice item will be
* added to the preview of the upcoming invoice.
*/
@SerializedName("invoiceitem")
String invoiceitem;
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys
* can be unset by posting an empty value to {@code metadata}.
*/
@SerializedName("metadata")
Object metadata;
/**
* The period associated with this invoice item.
*/
@SerializedName("period")
Period period;
/**
* The ID of the price object.
*/
@SerializedName("price")
String price;
/**
* Data used to generate a new Price object
* inline.
*/
@SerializedName("price_data")
PriceData priceData;
/**
* Non-negative integer. The quantity of units for the invoice item.
*/
@SerializedName("quantity")
Long quantity;
/**
* The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply to
* this item.
*/
@SerializedName("tax_rates")
Object taxRates;
/**
* The integer unit amount in %s of the charge to be applied to the upcoming invoice. This
* unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a
* credit to the customer's account, pass a negative unit_amount.
*/
@SerializedName("unit_amount")
Long unitAmount;
/**
* Same as {@code unit_amount}, but accepts a decimal value in %s with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
@SerializedName("unit_amount_decimal")
BigDecimal unitAmountDecimal;
private InvoiceItem(Long amount, String currency, String description, Boolean discountable, Object discounts, Map extraParams, String invoiceitem, Object metadata, Period period, String price, PriceData priceData, Long quantity, Object taxRates, Long unitAmount, BigDecimal unitAmountDecimal) {
this.amount = amount;
this.currency = currency;
this.description = description;
this.discountable = discountable;
this.discounts = discounts;
this.extraParams = extraParams;
this.invoiceitem = invoiceitem;
this.metadata = metadata;
this.period = period;
this.price = price;
this.priceData = priceData;
this.quantity = quantity;
this.taxRates = taxRates;
this.unitAmount = unitAmount;
this.unitAmountDecimal = unitAmountDecimal;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long amount;
private String currency;
private String description;
private Boolean discountable;
private Object discounts;
private Map extraParams;
private String invoiceitem;
private Object metadata;
private Period period;
private String price;
private PriceData priceData;
private Long quantity;
private Object taxRates;
private Long unitAmount;
private BigDecimal unitAmountDecimal;
/**
* Finalize and obtain parameter instance from this builder.
*/
public InvoiceItem build() {
return new InvoiceItem(this.amount, this.currency, this.description, this.discountable, this.discounts, this.extraParams, this.invoiceitem, this.metadata, this.period, this.price, this.priceData, this.quantity, this.taxRates, this.unitAmount, this.unitAmountDecimal);
}
/**
* The integer amount in %s of previewed invoice item.
*/
public Builder setAmount(Long amount) {
this.amount = amount;
return this;
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency. Only applicable to new invoice items.
*/
public Builder setCurrency(String currency) {
this.currency = currency;
return this;
}
/**
* An arbitrary string which you can attach to the invoice item. The description is displayed
* in the invoice for easy tracking.
*/
public Builder setDescription(String description) {
this.description = description;
return this;
}
/**
* Explicitly controls whether discounts apply to this invoice item. Defaults to true, except
* for negative invoice items.
*/
public Builder setDiscountable(Boolean discountable) {
this.discountable = discountable;
return this;
}
/**
* Add an element to `discounts` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams.InvoiceItem#discounts} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addDiscount(Discount element) {
if (this.discounts == null || this.discounts instanceof EmptyParam) {
this.discounts = new ArrayList();
}
((List) this.discounts).add(element);
return this;
}
/**
* Add all elements to `discounts` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
* InvoiceUpcomingParams.InvoiceItem#discounts} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder addAllDiscount(List elements) {
if (this.discounts == null || this.discounts instanceof EmptyParam) {
this.discounts = new ArrayList();
}
((List) this.discounts).addAll(elements);
return this;
}
/**
* The coupons to redeem into discounts for the invoice item in the preview.
*/
public Builder setDiscounts(EmptyParam discounts) {
this.discounts = discounts;
return this;
}
/**
* The coupons to redeem into discounts for the invoice item in the preview.
*/
public Builder setDiscounts(List discounts) {
this.discounts = discounts;
return this;
}
/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* InvoiceUpcomingParams.InvoiceItem#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link InvoiceUpcomingParams.InvoiceItem#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* The ID of the invoice item to update in preview. If not specified, a new invoice item will
* be added to the preview of the upcoming invoice.
*/
public Builder setInvoiceitem(String invoiceitem) {
this.invoiceitem = invoiceitem;
return this;
}
/**
* Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* InvoiceUpcomingParams.InvoiceItem#metadata} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder putMetadata(String key, String value) {
if (this.metadata == null || this.metadata instanceof EmptyParam) {
this.metadata = new HashMap();
}
((Map) this.metadata).put(key, value);
return this;
}
/**
* Add all map key/value pairs to `metadata` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link InvoiceUpcomingParams.InvoiceItem#metadata} for the field documentation.
*/
@SuppressWarnings("unchecked")
public Builder putAllMetadata(Map map) {
if (this.metadata == null || this.metadata instanceof EmptyParam) {
this.metadata = new HashMap();
}
((Map) this.metadata).putAll(map);
return this;
}
/**
* 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;
}
/**
* The period associated with this invoice item.
*/
public Builder setPeriod(Period period) {
this.period = period;
return this;
}
/**
* The ID of the price object.
*/
public Builder setPrice(String 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;
}
/**
* Non-negative integer. The quantity of units for the invoice item.
*/
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
* InvoiceUpcomingParams.InvoiceItem#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
* InvoiceUpcomingParams.InvoiceItem#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;
}
/**
* The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply
* to this item.
*/
public Builder setTaxRates(EmptyParam taxRates) {
this.taxRates = taxRates;
return this;
}
/**
* The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply
* to this item.
*/
public Builder setTaxRates(List taxRates) {
this.taxRates = taxRates;
return this;
}
/**
* The integer unit amount in %s of the charge to be applied to the upcoming invoice. This
* unit_amount will be multiplied by the quantity to get the full amount. If you want to apply
* a credit to the customer's account, pass a negative unit_amount.
*/
public Builder setUnitAmount(Long unitAmount) {
this.unitAmount = unitAmount;
return this;
}
/**
* Same as {@code unit_amount}, but accepts a decimal value in %s 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 static class Discount {
/**
* ID of the coupon to create a new discount for.
*/
@SerializedName("coupon")
String coupon;
/**
* ID of an existing discount on the object (or one of its ancestors) to reuse.
*/
@SerializedName("discount")
String discount;
/**
* 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 Discount(String coupon, String discount, Map extraParams) {
this.coupon = coupon;
this.discount = discount;
this.extraParams = extraParams;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String coupon;
private String discount;
private Map extraParams;
/** Finalize and obtain parameter instance from this builder. */
public Discount build() {
return new Discount(this.coupon, this.discount, this.extraParams);
}
/** ID of the coupon to create a new discount for. */
public Builder setCoupon(String coupon) {
this.coupon = coupon;
return this;
}
/** ID of an existing discount on the object (or one of its ancestors) to reuse. */
public Builder setDiscount(String discount) {
this.discount = discount;
return this;
}
/**
* 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 InvoiceUpcomingParams.InvoiceItem.Discount#extraParams} for the field
* documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
/**
* ID of the coupon to create a new discount for.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCoupon() {
return this.coupon;
}
/**
* ID of an existing discount on the object (or one of its ancestors) to reuse.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDiscount() {
return this.discount;
}
/**
* 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 InvoiceUpcomingParams.InvoiceItem.Discount#extraParams} for the field
* documentation.
*/
public static class Period {
/**
* The end of the period, which must be greater than or equal to the start.
*/
@SerializedName("end")
Long end;
/**
* 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 start of the period.
*/
@SerializedName("start")
Long start;
private Period(Long end, Map extraParams, Long start) {
this.end = end;
this.extraParams = extraParams;
this.start = start;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private Long end;
private Map extraParams;
private Long start;
/** Finalize and obtain parameter instance from this builder. */
public Period build() {
return new Period(this.end, this.extraParams, this.start);
}
/** The end of the period, which must be greater than or equal to the start. */
public Builder setEnd(Long end) {
this.end = end;
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 InvoiceUpcomingParams.InvoiceItem.Period#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 InvoiceUpcomingParams.InvoiceItem.Period#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 setStart(Long start) {
this.start = start;
return this;
}
}
/**
* The end of the period, which must be greater than or equal to the start.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getEnd() {
return this.end;
}
/**
* 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 start of the period.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getStart() {
return this.start;
}
}
/**
* The start of the period.
*/
public static class PriceData {
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency.
*/
@SerializedName("currency")
String 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")
String product;
/**
* Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
* {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either
* {@code inclusive} or {@code exclusive}, it cannot be changed.
*/
@SerializedName("tax_behavior")
TaxBehavior taxBehavior;
/** A 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 in %s with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
@SerializedName("unit_amount_decimal")
BigDecimal unitAmountDecimal;
private PriceData(String currency, Map extraParams, String product, TaxBehavior taxBehavior, Long unitAmount, BigDecimal unitAmountDecimal) {
this.currency = currency;
this.extraParams = extraParams;
this.product = product;
this.taxBehavior = taxBehavior;
this.unitAmount = unitAmount;
this.unitAmountDecimal = unitAmountDecimal;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String currency;
private Map extraParams;
private String product;
private TaxBehavior taxBehavior;
private Long unitAmount;
private BigDecimal unitAmountDecimal;
/** Finalize and obtain parameter instance from this builder. */
public PriceData build() {
return new PriceData(this.currency, this.extraParams, this.product, this.taxBehavior, 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;
}
/**
* 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 InvoiceUpcomingParams.InvoiceItem.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 InvoiceUpcomingParams.InvoiceItem.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;
}
/**
* Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One
* of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either
* {@code inclusive} or {@code exclusive}, it cannot be changed.
*/
public Builder setTaxBehavior(TaxBehavior taxBehavior) {
this.taxBehavior = taxBehavior;
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;
}
public Builder setUnitAmountDecimal(BigDecimal unitAmountDecimal) {
this.unitAmountDecimal = unitAmountDecimal;
return this;
}
}
public enum TaxBehavior implements ApiRequestParams.EnumParam {
@SerializedName("exclusive")
EXCLUSIVE("exclusive"), @SerializedName("inclusive")
INCLUSIVE("inclusive"), @SerializedName("unspecified")
UNSPECIFIED("unspecified");
private final String value;
TaxBehavior(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 String getCurrency() {
return this.currency;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getProduct() {
return this.product;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public TaxBehavior getTaxBehavior() {
return this.taxBehavior;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getUnitAmount() {
return this.unitAmount;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BigDecimal getUnitAmountDecimal() {
return this.unitAmountDecimal;
}
}
/**
* The integer amount in %s of previewed invoice item.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getAmount() {
return this.amount;
}
/**
* Three-letter ISO currency
* code, in lowercase. Must be a supported
* currency. Only applicable to new invoice items.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCurrency() {
return this.currency;
}
/**
* An arbitrary string which you can attach to the invoice item. The description is displayed in
* the invoice for easy tracking.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDescription() {
return this.description;
}
/**
* Explicitly controls whether discounts apply to this invoice item. Defaults to true, except
* for negative invoice items.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getDiscountable() {
return this.discountable;
}
/**
* The coupons to redeem into discounts for the invoice item in the preview.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getDiscounts() {
return this.discounts;
}
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
/**
* The ID of the invoice item to update in preview. If not specified, a new invoice item will be
* added to the preview of the upcoming invoice.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getInvoiceitem() {
return this.invoiceitem;
}
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format. Individual keys can be unset by posting an empty value to them. All keys
* can be unset by posting an empty value to {@code metadata}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getMetadata() {
return this.metadata;
}
/**
* The period associated with this invoice item.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Period getPeriod() {
return this.period;
}
/**
* The ID of the price object.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String 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;
}
/**
* Non-negative integer. The quantity of units for the invoice item.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getQuantity() {
return this.quantity;
}
/**
* The tax rates that apply to the item. When set, any {@code default_tax_rates} do not apply to
* this item.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getTaxRates() {
return this.taxRates;
}
/**
* The integer unit amount in %s of the charge to be applied to the upcoming invoice. This
* unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a
* credit to the customer's account, pass a negative unit_amount.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getUnitAmount() {
return this.unitAmount;
}
/**
* Same as {@code unit_amount}, but accepts a decimal value in %s with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BigDecimal getUnitAmountDecimal() {
return this.unitAmountDecimal;
}
}
/**
* Same as {@code unit_amount}, but accepts a decimal value in %s with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
public static class SubscriptionItem {
/**
* 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;
/**
* Delete all usage for a given subscription item. Allowed only when {@code deleted} is set to
* {@code true} and the current plan's {@code usage_type} is {@code metered}.
*/
@SerializedName("clear_usage")
Boolean clearUsage;
/**
* A flag that, if set to {@code true}, will delete the specified item.
*/
@SerializedName("deleted")
Boolean deleted;
/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map extraParams;
/**
* Subscription item to update.
*/
@SerializedName("id")
String id;
/**
* 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;
/**
* Plan ID for this item, as a string.
*/
@SerializedName("plan")
String plan;
/**
* The ID of the price object. When changing a subscription item's price, {@code quantity} is
* set to 1 unless a {@code quantity} parameter is provided.
*/
@SerializedName("price")
String price;
/**
* Data used to generate a new Price object
* inline.
*/
@SerializedName("price_data")
PriceData priceData;
/**
* Quantity for this item.
*/
@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 SubscriptionItem(Object billingThresholds, Boolean clearUsage, Boolean deleted, Map extraParams, String id, Object metadata, String plan, String price, PriceData priceData, Long quantity, Object taxRates) {
this.billingThresholds = billingThresholds;
this.clearUsage = clearUsage;
this.deleted = deleted;
this.extraParams = extraParams;
this.id = id;
this.metadata = metadata;
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 Boolean clearUsage;
private Boolean deleted;
private Map extraParams;
private String id;
private Object metadata;
private String plan;
private String price;
private PriceData priceData;
private Long quantity;
private Object taxRates;
/**
* Finalize and obtain parameter instance from this builder.
*/
public SubscriptionItem build() {
return new SubscriptionItem(this.billingThresholds, this.clearUsage, this.deleted, this.extraParams, this.id, this.metadata, 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;
}
/**
* Delete all usage for a given subscription item. Allowed only when {@code deleted} is set to
* {@code true} and the current plan's {@code usage_type} is {@code metered}.
*/
public Builder setClearUsage(Boolean clearUsage) {
this.clearUsage = clearUsage;
return this;
}
/**
* A flag that, if set to {@code true}, will delete the specified item.
*/
public Builder setDeleted(Boolean deleted) {
this.deleted = deleted;
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
* InvoiceUpcomingParams.SubscriptionItem#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 InvoiceUpcomingParams.SubscriptionItem#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
/**
* Subscription item to update.
*/
public Builder setId(String id) {
this.id = id;
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
* InvoiceUpcomingParams.SubscriptionItem#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 InvoiceUpcomingParams.SubscriptionItem#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;
}
/**
* Plan ID for this item, as a string.
*/
public Builder setPlan(String plan) {
this.plan = plan;
return this;
}
/**
* The ID of the price object. When changing a subscription item's price, {@code quantity} is
* set to 1 unless a {@code quantity} parameter is provided.
*/
public Builder setPrice(String 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.
*/
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
* InvoiceUpcomingParams.SubscriptionItem#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
* InvoiceUpcomingParams.SubscriptionItem#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 InvoiceUpcomingParams.SubscriptionItem.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 InvoiceUpcomingParams.SubscriptionItem.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")
String 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")
String product;
/** The recurring components of a price such as {@code interval} and {@code usage_type}. */
@SerializedName("recurring")
Recurring recurring;
/**
* Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
* {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either
* {@code inclusive} or {@code exclusive}, it cannot be changed.
*/
@SerializedName("tax_behavior")
TaxBehavior taxBehavior;
/** A 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 in %s with at most 12 decimal
* places. Only one of {@code unit_amount} and {@code unit_amount_decimal} can be set.
*/
@SerializedName("unit_amount_decimal")
BigDecimal unitAmountDecimal;
private PriceData(String currency, Map extraParams, String product, Recurring recurring, TaxBehavior taxBehavior, Long unitAmount, BigDecimal unitAmountDecimal) {
this.currency = currency;
this.extraParams = extraParams;
this.product = product;
this.recurring = recurring;
this.taxBehavior = taxBehavior;
this.unitAmount = unitAmount;
this.unitAmountDecimal = unitAmountDecimal;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String currency;
private Map extraParams;
private String product;
private Recurring recurring;
private TaxBehavior taxBehavior;
private Long unitAmount;
private BigDecimal unitAmountDecimal;
/** Finalize and obtain parameter instance from this builder. */
public PriceData build() {
return new PriceData(this.currency, this.extraParams, this.product, this.recurring, this.taxBehavior, 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;
}
/**
* 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 InvoiceUpcomingParams.SubscriptionItem.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 InvoiceUpcomingParams.SubscriptionItem.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 recurring components of a price such as {@code interval} and {@code usage_type}. */
public Builder setRecurring(Recurring recurring) {
this.recurring = recurring;
return this;
}
/**
* Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One
* of {@code inclusive}, {@code exclusive}, or {@code unspecified}. Once specified as either
* {@code inclusive} or {@code exclusive}, it cannot be changed.
*/
public Builder setTaxBehavior(TaxBehavior taxBehavior) {
this.taxBehavior = taxBehavior;
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 in %s 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 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 InvoiceUpcomingParams.SubscriptionItem.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 InvoiceUpcomingParams.SubscriptionItem.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;
}
}
public enum TaxBehavior implements ApiRequestParams.EnumParam {
@SerializedName("exclusive")
EXCLUSIVE("exclusive"), @SerializedName("inclusive")
INCLUSIVE("inclusive"), @SerializedName("unspecified")
UNSPECIFIED("unspecified");
private final String value;
TaxBehavior(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 String getCurrency() {
return this.currency;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getExtraParams() {
return this.extraParams;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getProduct() {
return this.product;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Recurring getRecurring() {
return this.recurring;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public TaxBehavior getTaxBehavior() {
return this.taxBehavior;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getUnitAmount() {
return this.unitAmount;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public BigDecimal 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;
}
/**
* Delete all usage for a given subscription item. Allowed only when {@code deleted} is set to
* {@code true} and the current plan's {@code usage_type} is {@code metered}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getClearUsage() {
return this.clearUsage;
}
/**
* A flag that, if set to {@code true}, will delete the specified item.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getDeleted() {
return this.deleted;
}
/**
* 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;
}
/**
* Subscription item to update.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getId() {
return this.id;
}
/**
* 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;
}
/**
* Plan ID for this item, as a string.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getPlan() {
return this.plan;
}
/**
* The ID of the price object. When changing a subscription item's price, {@code quantity} is
* set to 1 unless a {@code quantity} parameter is provided.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String 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.
*/
@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 SubscriptionBillingCycleAnchor implements ApiRequestParams.EnumParam {
@SerializedName("now")
NOW("now"), @SerializedName("unchanged")
UNCHANGED("unchanged");
private final String value;
SubscriptionBillingCycleAnchor(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum SubscriptionProrationBehavior 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;
SubscriptionProrationBehavior(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
public enum SubscriptionTrialEnd implements ApiRequestParams.EnumParam {
@SerializedName("now")
NOW("now");
private final String value;
SubscriptionTrialEnd(String value) {
this.value = value;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getValue() {
return this.value;
}
}
/**
* Settings for automatic tax lookup for this invoice preview.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public AutomaticTax getAutomaticTax() {
return this.automaticTax;
}
/**
* The code of the coupon to apply. If {@code subscription} or {@code subscription_items} is
* provided, the invoice returned will preview updating or creating a subscription with that
* coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming
* invoice from among the customer's subscriptions. The invoice can be previewed without a coupon
* by passing this value as an empty string.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCoupon() {
return this.coupon;
}
/**
* The identifier of the customer whose upcoming invoice you'd like to retrieve.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCustomer() {
return this.customer;
}
/**
* Details about the customer you want to invoice or overrides for an existing customer.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public CustomerDetails getCustomerDetails() {
return this.customerDetails;
}
/**
* The coupons to redeem into discounts for the invoice preview. If not specified, inherits the
* discount from the customer or subscription. Pass an empty string to avoid inheriting any
* discounts. To preview the upcoming invoice for a subscription that hasn't been created, use
* {@code coupon} instead.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getDiscounts() {
return this.discounts;
}
/**
* 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;
}
/**
* List of invoice items to add or update in the upcoming invoice preview.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getInvoiceItems() {
return this.invoiceItems;
}
/**
* The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot
* be used with subscription or subscription fields.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getSchedule() {
return this.schedule;
}
/**
* The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If
* not provided, but a {@code subscription_items} is provided, you will preview creating a
* subscription with those items. If neither {@code subscription} nor {@code subscription_items}
* is provided, you will retrieve the next upcoming invoice from among the customer's
* subscriptions.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getSubscription() {
return this.subscription;
}
/**
* For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to
* determine the date of the first full invoice, and, for plans with {@code month} or {@code year}
* intervals, the day of the month for subsequent invoices. For existing subscriptions, the value
* can only be set to {@code now} or {@code unchanged}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getSubscriptionBillingCycleAnchor() {
return this.subscriptionBillingCycleAnchor;
}
/**
* Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if
* within the current period and prorations have been enabled using {@code proration_behavior}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getSubscriptionCancelAt() {
return this.subscriptionCancelAt;
}
/**
* Boolean indicating whether this subscription should cancel at the end of the current period.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getSubscriptionCancelAtPeriodEnd() {
return this.subscriptionCancelAtPeriodEnd;
}
/**
* This simulates the subscription being canceled or expired immediately.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getSubscriptionCancelNow() {
return this.subscriptionCancelNow;
}
/**
* If provided, the invoice returned will preview updating or creating a subscription with these
* default tax rates. The default tax rates will apply to any line item that does not have {@code
* tax_rates} set.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getSubscriptionDefaultTaxRates() {
return this.subscriptionDefaultTaxRates;
}
/**
* A list of up to 20 subscription items, each with an attached price.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public List getSubscriptionItems() {
return this.subscriptionItems;
}
/**
* Determines how to handle prorations when the
* billing cycle changes (e.g., when switching plans, resetting {@code billing_cycle_anchor=now},
* or starting a trial), or if an item's {@code quantity} changes. Valid values are {@code
* create_prorations}, {@code none}, or {@code always_invoice}.
*
* Passing {@code create_prorations} will cause proration invoice items to be created when
* applicable. These proration items will only be invoiced immediately under certain
* conditions. In order to always invoice immediately for prorations, pass {@code
* always_invoice}.
*
*
Prorations can be disabled by passing {@code none}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public SubscriptionProrationBehavior getSubscriptionProrationBehavior() {
return this.subscriptionProrationBehavior;
}
/**
* If previewing an update to a subscription, and doing proration, {@code
* subscription_proration_date} forces the proration to be calculated as though the update was
* done at the specified time. The time given must be within the current subscription period, and
* cannot be before the subscription was on its current plan. If set, {@code subscription}, and
* one of {@code subscription_items}, or {@code subscription_trial_end} are required. Also, {@code
* subscription_proration_behavior} cannot be set to 'none'.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getSubscriptionProrationDate() {
return this.subscriptionProrationDate;
}
/**
* Date a subscription is intended to start (can be future or past).
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getSubscriptionStartDate() {
return this.subscriptionStartDate;
}
/**
* If provided, the invoice returned will preview updating or creating a subscription with that
* trial end. If set, one of {@code subscription_items} or {@code subscription} is required.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Object getSubscriptionTrialEnd() {
return this.subscriptionTrialEnd;
}
/**
* Indicates if a plan's {@code trial_period_days} should be applied to the subscription. Setting
* {@code subscription_trial_end} per subscription is preferred, and this defaults to {@code
* false}. Setting this flag to {@code true} together with {@code subscription_trial_end} is not
* allowed.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getSubscriptionTrialFromPlan() {
return this.subscriptionTrialFromPlan;
}
}