Package com.stripe.param
Class InvoiceUpcomingParams.Builder
- java.lang.Object
-
- com.stripe.param.InvoiceUpcomingParams.Builder
-
- Enclosing class:
- InvoiceUpcomingParams
public static class InvoiceUpcomingParams.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvoiceUpcomingParams.Builder
addAllDiscount(java.util.List<InvoiceUpcomingParams.Discount> elements)
Add all elements to `discounts` list.InvoiceUpcomingParams.Builder
addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list.InvoiceUpcomingParams.Builder
addAllInvoiceItem(java.util.List<InvoiceUpcomingParams.InvoiceItem> elements)
Add all elements to `invoiceItems` list.InvoiceUpcomingParams.Builder
addAllSubscriptionDefaultTaxRate(java.util.List<java.lang.String> elements)
Add all elements to `subscriptionDefaultTaxRates` list.InvoiceUpcomingParams.Builder
addAllSubscriptionItem(java.util.List<InvoiceUpcomingParams.SubscriptionItem> elements)
Add all elements to `subscriptionItems` list.InvoiceUpcomingParams.Builder
addDiscount(InvoiceUpcomingParams.Discount element)
Add an element to `discounts` list.InvoiceUpcomingParams.Builder
addExpand(java.lang.String element)
Add an element to `expand` list.InvoiceUpcomingParams.Builder
addInvoiceItem(InvoiceUpcomingParams.InvoiceItem element)
Add an element to `invoiceItems` list.InvoiceUpcomingParams.Builder
addSubscriptionDefaultTaxRate(java.lang.String element)
Add an element to `subscriptionDefaultTaxRates` list.InvoiceUpcomingParams.Builder
addSubscriptionItem(InvoiceUpcomingParams.SubscriptionItem element)
Add an element to `subscriptionItems` list.InvoiceUpcomingParams
build()
Finalize and obtain parameter instance from this builder.InvoiceUpcomingParams.Builder
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.InvoiceUpcomingParams.Builder
putExtraParam(java.lang.String key, java.lang.Object value)
Add a key/value pair to `extraParams` map.InvoiceUpcomingParams.Builder
setCoupon(java.lang.String coupon)
The code of the coupon to apply.InvoiceUpcomingParams.Builder
setCustomer(java.lang.String customer)
The identifier of the customer whose upcoming invoice you'd like to retrieve.InvoiceUpcomingParams.Builder
setDiscounts(EmptyParam discounts)
The coupons to redeem into discounts for the invoice preview.InvoiceUpcomingParams.Builder
setDiscounts(java.util.List<InvoiceUpcomingParams.Discount> discounts)
The coupons to redeem into discounts for the invoice preview.InvoiceUpcomingParams.Builder
setSchedule(java.lang.String schedule)
The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve.InvoiceUpcomingParams.Builder
setSubscription(java.lang.String subscription)
The identifier of the subscription for which you'd like to retrieve the upcoming invoice.InvoiceUpcomingParams.Builder
setSubscriptionBillingCycleAnchor(InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor)
For new subscriptions, a future timestamp to anchor the subscription's billing cycle.InvoiceUpcomingParams.Builder
setSubscriptionBillingCycleAnchor(java.lang.Long subscriptionBillingCycleAnchor)
For new subscriptions, a future timestamp to anchor the subscription's billing cycle.InvoiceUpcomingParams.Builder
setSubscriptionCancelAt(EmptyParam subscriptionCancelAt)
Timestamp indicating when the subscription should be scheduled to cancel.InvoiceUpcomingParams.Builder
setSubscriptionCancelAt(java.lang.Long subscriptionCancelAt)
Timestamp indicating when the subscription should be scheduled to cancel.InvoiceUpcomingParams.Builder
setSubscriptionCancelAtPeriodEnd(java.lang.Boolean subscriptionCancelAtPeriodEnd)
Boolean indicating whether this subscription should cancel at the end of the current period.InvoiceUpcomingParams.Builder
setSubscriptionCancelNow(java.lang.Boolean subscriptionCancelNow)
This simulates the subscription being canceled or expired immediately.InvoiceUpcomingParams.Builder
setSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates)
If provided, the invoice returned will preview updating or creating a subscription with these default tax rates.InvoiceUpcomingParams.Builder
setSubscriptionDefaultTaxRates(java.util.List<java.lang.String> subscriptionDefaultTaxRates)
If provided, the invoice returned will preview updating or creating a subscription with these default tax rates.InvoiceUpcomingParams.Builder
setSubscriptionProrationBehavior(InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior)
Determines how to handle prorations when the billing cycle changes (e.g., when switching plans, resettingbilling_cycle_anchor=now
, or starting a trial), or if an item'squantity
changes.InvoiceUpcomingParams.Builder
setSubscriptionProrationDate(java.lang.Long subscriptionProrationDate)
If previewing an update to a subscription, and doing proration,subscription_proration_date
forces the proration to be calculated as though the update was done at the specified time.InvoiceUpcomingParams.Builder
setSubscriptionStartDate(java.lang.Long subscriptionStartDate)
Date a subscription is intended to start (can be future or past).InvoiceUpcomingParams.Builder
setSubscriptionTrialEnd(InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd)
If provided, the invoice returned will preview updating or creating a subscription with that trial end.InvoiceUpcomingParams.Builder
setSubscriptionTrialEnd(java.lang.Long subscriptionTrialEnd)
If provided, the invoice returned will preview updating or creating a subscription with that trial end.InvoiceUpcomingParams.Builder
setSubscriptionTrialFromPlan(java.lang.Boolean subscriptionTrialFromPlan)
Indicates if a plan'strial_period_days
should be applied to the subscription.
-
-
-
Method Detail
-
build
public InvoiceUpcomingParams build()
Finalize and obtain parameter instance from this builder.
-
setCoupon
public InvoiceUpcomingParams.Builder setCoupon(java.lang.String coupon)
The code of the coupon to apply. Ifsubscription
orsubscription_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.
-
setCustomer
public InvoiceUpcomingParams.Builder setCustomer(java.lang.String customer)
The identifier of the customer whose upcoming invoice you'd like to retrieve.
-
addDiscount
public InvoiceUpcomingParams.Builder addDiscount(InvoiceUpcomingParams.Discount element)
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. SeeInvoiceUpcomingParams.discounts
for the field documentation.
-
addAllDiscount
public InvoiceUpcomingParams.Builder addAllDiscount(java.util.List<InvoiceUpcomingParams.Discount> elements)
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. SeeInvoiceUpcomingParams.discounts
for the field documentation.
-
setDiscounts
public InvoiceUpcomingParams.Builder setDiscounts(EmptyParam discounts)
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.
-
setDiscounts
public InvoiceUpcomingParams.Builder setDiscounts(java.util.List<InvoiceUpcomingParams.Discount> discounts)
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.
-
addExpand
public InvoiceUpcomingParams.Builder addExpand(java.lang.String element)
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. SeeInvoiceUpcomingParams.expand
for the field documentation.
-
addAllExpand
public InvoiceUpcomingParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
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. SeeInvoiceUpcomingParams.expand
for the field documentation.
-
putExtraParam
public InvoiceUpcomingParams.Builder putExtraParam(java.lang.String key, java.lang.Object 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. SeeInvoiceUpcomingParams.extraParams
for the field documentation.
-
putAllExtraParam
public InvoiceUpcomingParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
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. SeeInvoiceUpcomingParams.extraParams
for the field documentation.
-
addInvoiceItem
public InvoiceUpcomingParams.Builder addInvoiceItem(InvoiceUpcomingParams.InvoiceItem element)
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. SeeInvoiceUpcomingParams.invoiceItems
for the field documentation.
-
addAllInvoiceItem
public InvoiceUpcomingParams.Builder addAllInvoiceItem(java.util.List<InvoiceUpcomingParams.InvoiceItem> elements)
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. SeeInvoiceUpcomingParams.invoiceItems
for the field documentation.
-
setSchedule
public InvoiceUpcomingParams.Builder setSchedule(java.lang.String schedule)
The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
-
setSubscription
public InvoiceUpcomingParams.Builder setSubscription(java.lang.String subscription)
The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but asubscription_items
is provided, you will preview creating a subscription with those items. If neithersubscription
norsubscription_items
is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
-
setSubscriptionBillingCycleAnchor
public InvoiceUpcomingParams.Builder setSubscriptionBillingCycleAnchor(InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor)
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 withmonth
oryear
intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set tonow
orunchanged
.
-
setSubscriptionBillingCycleAnchor
public InvoiceUpcomingParams.Builder setSubscriptionBillingCycleAnchor(java.lang.Long subscriptionBillingCycleAnchor)
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 withmonth
oryear
intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set tonow
orunchanged
.
-
setSubscriptionCancelAt
public InvoiceUpcomingParams.Builder setSubscriptionCancelAt(java.lang.Long subscriptionCancelAt)
Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled usingproration_behavior
.
-
setSubscriptionCancelAt
public InvoiceUpcomingParams.Builder setSubscriptionCancelAt(EmptyParam subscriptionCancelAt)
Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled usingproration_behavior
.
-
setSubscriptionCancelAtPeriodEnd
public InvoiceUpcomingParams.Builder setSubscriptionCancelAtPeriodEnd(java.lang.Boolean subscriptionCancelAtPeriodEnd)
Boolean indicating whether this subscription should cancel at the end of the current period.
-
setSubscriptionCancelNow
public InvoiceUpcomingParams.Builder setSubscriptionCancelNow(java.lang.Boolean subscriptionCancelNow)
This simulates the subscription being canceled or expired immediately.
-
addSubscriptionDefaultTaxRate
public InvoiceUpcomingParams.Builder addSubscriptionDefaultTaxRate(java.lang.String element)
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. SeeInvoiceUpcomingParams.subscriptionDefaultTaxRates
for the field documentation.
-
addAllSubscriptionDefaultTaxRate
public InvoiceUpcomingParams.Builder addAllSubscriptionDefaultTaxRate(java.util.List<java.lang.String> elements)
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. SeeInvoiceUpcomingParams.subscriptionDefaultTaxRates
for the field documentation.
-
setSubscriptionDefaultTaxRates
public InvoiceUpcomingParams.Builder setSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates)
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 havetax_rates
set.
-
setSubscriptionDefaultTaxRates
public InvoiceUpcomingParams.Builder setSubscriptionDefaultTaxRates(java.util.List<java.lang.String> subscriptionDefaultTaxRates)
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 havetax_rates
set.
-
addSubscriptionItem
public InvoiceUpcomingParams.Builder addSubscriptionItem(InvoiceUpcomingParams.SubscriptionItem element)
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. SeeInvoiceUpcomingParams.subscriptionItems
for the field documentation.
-
addAllSubscriptionItem
public InvoiceUpcomingParams.Builder addAllSubscriptionItem(java.util.List<InvoiceUpcomingParams.SubscriptionItem> elements)
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. SeeInvoiceUpcomingParams.subscriptionItems
for the field documentation.
-
setSubscriptionProrationBehavior
public InvoiceUpcomingParams.Builder setSubscriptionProrationBehavior(InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior)
Determines how to handle prorations when the billing cycle changes (e.g., when switching plans, resettingbilling_cycle_anchor=now
, or starting a trial), or if an item'squantity
changes. Valid values arecreate_prorations
,none
, oralways_invoice
.Passing
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, passalways_invoice
.Prorations can be disabled by passing
none
.
-
setSubscriptionProrationDate
public InvoiceUpcomingParams.Builder setSubscriptionProrationDate(java.lang.Long subscriptionProrationDate)
If previewing an update to a subscription, and doing proration,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,subscription
, and one ofsubscription_items
, orsubscription_trial_end
are required. Also,subscription_proration_behavior
cannot be set to 'none'.
-
setSubscriptionStartDate
public InvoiceUpcomingParams.Builder setSubscriptionStartDate(java.lang.Long subscriptionStartDate)
Date a subscription is intended to start (can be future or past).
-
setSubscriptionTrialEnd
public InvoiceUpcomingParams.Builder setSubscriptionTrialEnd(InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd)
If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one ofsubscription_items
orsubscription
is required.
-
setSubscriptionTrialEnd
public InvoiceUpcomingParams.Builder setSubscriptionTrialEnd(java.lang.Long subscriptionTrialEnd)
If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one ofsubscription_items
orsubscription
is required.
-
setSubscriptionTrialFromPlan
public InvoiceUpcomingParams.Builder setSubscriptionTrialFromPlan(java.lang.Boolean subscriptionTrialFromPlan)
Indicates if a plan'strial_period_days
should be applied to the subscription. Settingsubscription_trial_end
per subscription is preferred, and this defaults tofalse
. Setting this flag totrue
together withsubscription_trial_end
is not allowed.
-
-