public class Plan extends ApiResource implements HasId, MetadataStore<Plan>
Modifier and Type | Class and Description |
---|---|
static class |
Plan.Tier |
static class |
Plan.TransformUsage |
ApiResource.RequestMethod
CHARSET, GSON
PRETTY_PRINT_GSON
Constructor and Description |
---|
Plan() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(java.lang.Object other) |
static Plan |
create(java.util.Map<java.lang.String,java.lang.Object> params)
You can now model subscriptions more flexibly using the Prices API.
|
static Plan |
create(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
You can now model subscriptions more flexibly using the Prices API.
|
static Plan |
create(PlanCreateParams params)
You can now model subscriptions more flexibly using the Prices API.
|
static Plan |
create(PlanCreateParams params,
RequestOptions options)
You can now model subscriptions more flexibly using the Prices API.
|
Plan |
delete()
Deleting plans means new subscribers can’t be added.
|
Plan |
delete(java.util.Map<java.lang.String,java.lang.Object> params)
Deleting plans means new subscribers can’t be added.
|
Plan |
delete(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Deleting plans means new subscribers can’t be added.
|
Plan |
delete(RequestOptions options)
Deleting plans means new subscribers can’t be added.
|
boolean |
equals(java.lang.Object o) |
java.lang.Boolean |
getActive()
Whether the plan can be used for new purchases.
|
java.lang.String |
getAggregateUsage()
Specifies a usage aggregation strategy for plans of
usage_type=metered . |
java.lang.Long |
getAmount()
The unit amount in %s to be charged, represented as a whole integer if possible.
|
java.math.BigDecimal |
getAmountDecimal()
The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal
places.
|
java.lang.String |
getBillingScheme()
Describes how to compute the price per period.
|
java.lang.Long |
getCreated()
Time at which the object was created.
|
java.lang.String |
getCurrency()
Three-letter ISO currency code,
in lowercase.
|
java.lang.Boolean |
getDeleted()
Always true for a deleted object.
|
java.lang.String |
getId()
Unique identifier for the object.
|
java.lang.String |
getInterval()
The frequency at which a subscription is billed.
|
java.lang.Long |
getIntervalCount()
The number of intervals (specified in the
interval attribute) between subscription
billings. |
java.lang.Boolean |
getLivemode()
Has the value
true if the object exists in live mode or the value false if the
object exists in test mode. |
java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
Set of key-value pairs that you can attach
to an object.
|
java.lang.String |
getNickname()
A brief description of the plan, hidden from customers.
|
java.lang.String |
getObject()
String representing the object's type.
|
java.lang.String |
getProduct()
Get ID of expandable
product object. |
Product |
getProductObject()
Get expanded
product . |
java.util.List<Plan.Tier> |
getTiers()
Each element represents a pricing tier.
|
java.lang.String |
getTiersMode()
Defines if the tiering price should be
graduated or volume based. |
Plan.TransformUsage |
getTransformUsage()
Apply a transformation to the reported usage or set quantity before computing the amount
billed.
|
java.lang.Long |
getTrialPeriodDays()
Default number of trial days when subscribing a customer to this plan using
trial_from_plan=true . |
java.lang.String |
getUsageType()
Configures how the quantity per period should be determined.
|
int |
hashCode() |
static PlanCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of your plans.
|
static PlanCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Returns a list of your plans.
|
static PlanCollection |
list(PlanListParams params)
Returns a list of your plans.
|
static PlanCollection |
list(PlanListParams params,
RequestOptions options)
Returns a list of your plans.
|
static Plan |
retrieve(java.lang.String plan)
Retrieves the plan with the given ID.
|
static Plan |
retrieve(java.lang.String plan,
java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Retrieves the plan with the given ID.
|
static Plan |
retrieve(java.lang.String plan,
PlanRetrieveParams params,
RequestOptions options)
Retrieves the plan with the given ID.
|
static Plan |
retrieve(java.lang.String plan,
RequestOptions options)
Retrieves the plan with the given ID.
|
void |
setActive(java.lang.Boolean active)
Whether the plan can be used for new purchases.
|
void |
setAggregateUsage(java.lang.String aggregateUsage)
Specifies a usage aggregation strategy for plans of
usage_type=metered . |
void |
setAmount(java.lang.Long amount)
The unit amount in %s to be charged, represented as a whole integer if possible.
|
void |
setAmountDecimal(java.math.BigDecimal amountDecimal)
The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal
places.
|
void |
setBillingScheme(java.lang.String billingScheme)
Describes how to compute the price per period.
|
void |
setCreated(java.lang.Long created)
Time at which the object was created.
|
void |
setCurrency(java.lang.String currency)
Three-letter ISO currency code,
in lowercase.
|
void |
setDeleted(java.lang.Boolean deleted)
Always true for a deleted object.
|
void |
setId(java.lang.String id)
Unique identifier for the object.
|
void |
setInterval(java.lang.String interval)
The frequency at which a subscription is billed.
|
void |
setIntervalCount(java.lang.Long intervalCount)
The number of intervals (specified in the
interval attribute) between subscription
billings. |
void |
setLivemode(java.lang.Boolean livemode)
Has the value
true if the object exists in live mode or the value false if the
object exists in test mode. |
void |
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach
to an object.
|
void |
setNickname(java.lang.String nickname)
A brief description of the plan, hidden from customers.
|
void |
setObject(java.lang.String object)
String representing the object's type.
|
void |
setProduct(java.lang.String id) |
void |
setProductObject(Product expandableObject) |
void |
setTiers(java.util.List<Plan.Tier> tiers)
Each element represents a pricing tier.
|
void |
setTiersMode(java.lang.String tiersMode)
Defines if the tiering price should be
graduated or volume based. |
void |
setTransformUsage(Plan.TransformUsage transformUsage)
Apply a transformation to the reported usage or set quantity before computing the amount
billed.
|
void |
setTrialPeriodDays(java.lang.Long trialPeriodDays)
Default number of trial days when subscribing a customer to this plan using
trial_from_plan=true . |
void |
setUsageType(java.lang.String usageType)
Configures how the quantity per period should be determined.
|
Plan |
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates the specified plan by setting the values of the parameters passed.
|
Plan |
update(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Updates the specified plan by setting the values of the parameters passed.
|
Plan |
update(PlanUpdateParams params)
Updates the specified plan by setting the values of the parameters passed.
|
Plan |
update(PlanUpdateParams params,
RequestOptions options)
Updates the specified plan by setting the values of the parameters passed.
|
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
public java.lang.String getProduct()
product
object.public void setProduct(java.lang.String id)
public Product getProductObject()
product
.public void setProductObject(Product expandableObject)
public static PlanCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
StripeException
public static PlanCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public static PlanCollection list(PlanListParams params) throws StripeException
StripeException
public static PlanCollection list(PlanListParams params, RequestOptions options) throws StripeException
StripeException
public static Plan create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
StripeException
public static Plan create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public static Plan create(PlanCreateParams params) throws StripeException
StripeException
public static Plan create(PlanCreateParams params, RequestOptions options) throws StripeException
StripeException
public static Plan retrieve(java.lang.String plan) throws StripeException
StripeException
public static Plan retrieve(java.lang.String plan, RequestOptions options) throws StripeException
StripeException
public static Plan retrieve(java.lang.String plan, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public static Plan retrieve(java.lang.String plan, PlanRetrieveParams params, RequestOptions options) throws StripeException
StripeException
public Plan update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
update
in interface MetadataStore<Plan>
StripeException
public Plan update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
update
in interface MetadataStore<Plan>
StripeException
public Plan update(PlanUpdateParams params) throws StripeException
StripeException
public Plan update(PlanUpdateParams params, RequestOptions options) throws StripeException
StripeException
public Plan delete() throws StripeException
StripeException
public Plan delete(RequestOptions options) throws StripeException
StripeException
public Plan delete(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
StripeException
public Plan delete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public java.lang.Boolean getActive()
public java.lang.String getAggregateUsage()
usage_type=metered
. Allowed values
are sum
for summing up all usage during a period, last_during_period
for using
the last usage record reported within a period, last_ever
for using the last usage
record ever (across period bounds) or max
which uses the usage record with the maximum
reported usage during a period. Defaults to sum
.
One of last_during_period
, last_ever
, max
, or sum
.
public java.lang.Long getAmount()
public java.math.BigDecimal getAmountDecimal()
public java.lang.String getBillingScheme()
per_unit
or tiered
.
per_unit
indicates that the fixed amount (specified in amount
) will be charged
per unit in quantity
(for plans with usage_type=licensed
), or per unit of total
usage (for plans with usage_type=metered
). tiered
indicates that the unit
pricing will be computed using a tiering strategy as defined using the tiers
and tiers_mode
attributes.
One of per_unit
, or tiered
.
public java.lang.Long getCreated()
public java.lang.String getCurrency()
public java.lang.Boolean getDeleted()
public java.lang.String getInterval()
day
, week
, month
or year
.public java.lang.Long getIntervalCount()
interval
attribute) between subscription
billings. For example, interval=month
and interval_count=3
bills every 3
months.public java.lang.Boolean getLivemode()
true
if the object exists in live mode or the value false
if the
object exists in test mode.public java.lang.String getNickname()
public java.lang.String getObject()
Equal to plan
.
public java.util.List<Plan.Tier> getTiers()
billing_scheme
to be
set to tiered
. See also the documentation for billing_scheme
.public java.lang.String getTiersMode()
graduated
or volume
based. In volume
-based tiering, the maximum quantity within a period determines the per unit price. In
graduated
tiering, pricing can change as the quantity grows.
One of graduated
, or volume
.
public Plan.TransformUsage getTransformUsage()
tiers
.public java.lang.Long getTrialPeriodDays()
trial_from_plan=true
.public java.lang.String getUsageType()
metered
or
licensed
. licensed
automatically bills the quantity
set when adding it
to a subscription. metered
aggregates the total usage based on usage records. Defaults
to licensed
.public void setActive(java.lang.Boolean active)
public void setAggregateUsage(java.lang.String aggregateUsage)
usage_type=metered
. Allowed values
are sum
for summing up all usage during a period, last_during_period
for using
the last usage record reported within a period, last_ever
for using the last usage
record ever (across period bounds) or max
which uses the usage record with the maximum
reported usage during a period. Defaults to sum
.
One of last_during_period
, last_ever
, max
, or sum
.
public void setAmount(java.lang.Long amount)
public void setAmountDecimal(java.math.BigDecimal amountDecimal)
public void setBillingScheme(java.lang.String billingScheme)
per_unit
or tiered
.
per_unit
indicates that the fixed amount (specified in amount
) will be charged
per unit in quantity
(for plans with usage_type=licensed
), or per unit of total
usage (for plans with usage_type=metered
). tiered
indicates that the unit
pricing will be computed using a tiering strategy as defined using the tiers
and tiers_mode
attributes.
One of per_unit
, or tiered
.
public void setCreated(java.lang.Long created)
public void setCurrency(java.lang.String currency)
public void setDeleted(java.lang.Boolean deleted)
public void setId(java.lang.String id)
public void setInterval(java.lang.String interval)
day
, week
, month
or year
.public void setIntervalCount(java.lang.Long intervalCount)
interval
attribute) between subscription
billings. For example, interval=month
and interval_count=3
bills every 3
months.public void setLivemode(java.lang.Boolean livemode)
true
if the object exists in live mode or the value false
if the
object exists in test mode.public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
public void setNickname(java.lang.String nickname)
public void setObject(java.lang.String object)
Equal to plan
.
public void setTiers(java.util.List<Plan.Tier> tiers)
billing_scheme
to be
set to tiered
. See also the documentation for billing_scheme
.public void setTiersMode(java.lang.String tiersMode)
graduated
or volume
based. In volume
-based tiering, the maximum quantity within a period determines the per unit price. In
graduated
tiering, pricing can change as the quantity grows.
One of graduated
, or volume
.
public void setTransformUsage(Plan.TransformUsage transformUsage)
tiers
.public void setTrialPeriodDays(java.lang.Long trialPeriodDays)
trial_from_plan=true
.public void setUsageType(java.lang.String usageType)
metered
or
licensed
. licensed
automatically bills the quantity
set when adding it
to a subscription. metered
aggregates the total usage based on usage records. Defaults
to licensed
.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getId()
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
getMetadata
in interface MetadataStore<Plan>