public static class PriceCreateParams.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
PriceCreateParams.Builder |
addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list.
|
PriceCreateParams.Builder |
addAllTier(java.util.List<PriceCreateParams.Tier> elements)
Add all elements to `tiers` list.
|
PriceCreateParams.Builder |
addExpand(java.lang.String element)
Add an element to `expand` list.
|
PriceCreateParams.Builder |
addTier(PriceCreateParams.Tier element)
Add an element to `tiers` list.
|
PriceCreateParams |
build()
Finalize and obtain parameter instance from this builder.
|
PriceCreateParams.Builder |
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.
|
PriceCreateParams.Builder |
putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
Add all map key/value pairs to `metadata` map.
|
PriceCreateParams.Builder |
putExtraParam(java.lang.String key,
java.lang.Object value)
Add a key/value pair to `extraParams` map.
|
PriceCreateParams.Builder |
putMetadata(java.lang.String key,
java.lang.String value)
Add a key/value pair to `metadata` map.
|
PriceCreateParams.Builder |
setActive(java.lang.Boolean active)
Whether the price is currently active.
|
PriceCreateParams.Builder |
setBillingScheme(PriceCreateParams.BillingScheme billingScheme)
Describes how to compute the price per period.
|
PriceCreateParams.Builder |
setCurrency(java.lang.String currency)
Three-letter ISO currency
code, in lowercase.
|
PriceCreateParams.Builder |
setLookupKey(java.lang.String lookupKey)
A lookup key used to retrieve prices dynamically from a static string.
|
PriceCreateParams.Builder |
setNickname(java.lang.String nickname)
A brief description of the price, hidden from customers.
|
PriceCreateParams.Builder |
setProduct(java.lang.String product)
The ID of the product that this price will belong to.
|
PriceCreateParams.Builder |
setProductData(PriceCreateParams.ProductData productData)
These fields can be used to create a new product that this price will belong to.
|
PriceCreateParams.Builder |
setRecurring(PriceCreateParams.Recurring recurring)
The recurring components of a price such as
interval and usage_type . |
PriceCreateParams.Builder |
setTiersMode(PriceCreateParams.TiersMode tiersMode)
Defines if the tiering price should be
graduated or volume based. |
PriceCreateParams.Builder |
setTransferLookupKey(java.lang.Boolean transferLookupKey)
If set to true, will atomically remove the lookup key from the existing price, and assign it
to this price.
|
PriceCreateParams.Builder |
setTransformQuantity(PriceCreateParams.TransformQuantity transformQuantity)
Apply a transformation to the reported usage or set quantity before computing the billed
price.
|
PriceCreateParams.Builder |
setUnitAmount(java.lang.Long unitAmount)
A positive integer in %s (or 0 for a free price) representing how much to charge.
|
PriceCreateParams.Builder |
setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
Same as
unit_amount , but accepts a decimal value with at most 12 decimal places. |
public PriceCreateParams build()
public PriceCreateParams.Builder setActive(java.lang.Boolean active)
true
.public PriceCreateParams.Builder setBillingScheme(PriceCreateParams.BillingScheme billingScheme)
per_unit
or tiered
.
per_unit
indicates that the fixed amount (specified in unit_amount
or unit_amount_decimal
) will be charged per unit in quantity
(for prices with usage_type=licensed
), or per unit of total usage (for prices 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.public PriceCreateParams.Builder setCurrency(java.lang.String currency)
public PriceCreateParams.Builder addExpand(java.lang.String element)
PriceCreateParams.expand
for the field documentation.public PriceCreateParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
PriceCreateParams.expand
for the field documentation.public PriceCreateParams.Builder putExtraParam(java.lang.String key, java.lang.Object value)
PriceCreateParams.extraParams
for the field documentation.public PriceCreateParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
PriceCreateParams.extraParams
for the field documentation.public PriceCreateParams.Builder setLookupKey(java.lang.String lookupKey)
public PriceCreateParams.Builder putMetadata(java.lang.String key, java.lang.String value)
PriceCreateParams.metadata
for the field documentation.public PriceCreateParams.Builder putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
PriceCreateParams.metadata
for the field documentation.public PriceCreateParams.Builder setNickname(java.lang.String nickname)
public PriceCreateParams.Builder setProduct(java.lang.String product)
public PriceCreateParams.Builder setProductData(PriceCreateParams.ProductData productData)
public PriceCreateParams.Builder setRecurring(PriceCreateParams.Recurring recurring)
interval
and usage_type
.public PriceCreateParams.Builder addTier(PriceCreateParams.Tier element)
PriceCreateParams.tiers
for the field documentation.public PriceCreateParams.Builder addAllTier(java.util.List<PriceCreateParams.Tier> elements)
PriceCreateParams.tiers
for the field documentation.public PriceCreateParams.Builder setTiersMode(PriceCreateParams.TiersMode 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 successively change as the quantity grows.public PriceCreateParams.Builder setTransferLookupKey(java.lang.Boolean transferLookupKey)
public PriceCreateParams.Builder setTransformQuantity(PriceCreateParams.TransformQuantity transformQuantity)
tiers
.public PriceCreateParams.Builder setUnitAmount(java.lang.Long unitAmount)
public PriceCreateParams.Builder setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
unit_amount
, but accepts a decimal value with at most 12 decimal places. Only
one of unit_amount
and unit_amount_decimal
can be set.