Package com.stripe.param
Class CouponCreateParams.Builder
- java.lang.Object
-
- com.stripe.param.CouponCreateParams.Builder
-
- Enclosing class:
- CouponCreateParams
public static class CouponCreateParams.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CouponCreateParams.BuilderaddAllExpand(java.util.List<java.lang.String> elements)Add all elements to `expand` list.CouponCreateParams.BuilderaddExpand(java.lang.String element)Add an element to `expand` list.CouponCreateParamsbuild()Finalize and obtain parameter instance from this builder.CouponCreateParams.BuilderputAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)Add all map key/value pairs to `extraParams` map.CouponCreateParams.BuilderputAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)Add all map key/value pairs to `metadata` map.CouponCreateParams.BuilderputExtraParam(java.lang.String key, java.lang.Object value)Add a key/value pair to `extraParams` map.CouponCreateParams.BuilderputMetadata(java.lang.String key, java.lang.String value)Add a key/value pair to `metadata` map.CouponCreateParams.BuildersetAmountOff(java.lang.Long amountOff)A positive integer representing the amount to subtract from an invoice total (required ifpercent_offis not passed).CouponCreateParams.BuildersetAppliesTo(CouponCreateParams.AppliesTo appliesTo)A hash containing directions for what this Coupon will apply discounts to.CouponCreateParams.BuildersetCurrency(java.lang.String currency)Three-letter ISO code for the currency of theamount_offparameter (required ifamount_offis passed).CouponCreateParams.BuildersetDuration(CouponCreateParams.Duration duration)Specifies how long the discount will be in effect if used on a subscription.CouponCreateParams.BuildersetDurationInMonths(java.lang.Long durationInMonths)Required only ifdurationisrepeating, in which case it must be a positive integer that specifies the number of months the discount will be in effect.CouponCreateParams.BuildersetId(java.lang.String id)Unique string of your choice that will be used to identify this coupon when applying it to a customer.CouponCreateParams.BuildersetMaxRedemptions(java.lang.Long maxRedemptions)A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid.CouponCreateParams.BuildersetMetadata(EmptyParam metadata)Set of key-value pairs that you can attach to an object.CouponCreateParams.BuildersetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.CouponCreateParams.BuildersetName(java.lang.String name)Name of the coupon displayed to customers on, for instance invoices, or receipts.CouponCreateParams.BuildersetPercentOff(java.math.BigDecimal percentOff)A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required ifamount_offis not passed).CouponCreateParams.BuildersetRedeemBy(java.lang.Long redeemBy)Unix timestamp specifying the last time at which the coupon can be redeemed.
-
-
-
Method Detail
-
build
public CouponCreateParams build()
Finalize and obtain parameter instance from this builder.
-
setAmountOff
public CouponCreateParams.Builder setAmountOff(java.lang.Long amountOff)
A positive integer representing the amount to subtract from an invoice total (required ifpercent_offis not passed).
-
setAppliesTo
public CouponCreateParams.Builder setAppliesTo(CouponCreateParams.AppliesTo appliesTo)
A hash containing directions for what this Coupon will apply discounts to.
-
setCurrency
public CouponCreateParams.Builder setCurrency(java.lang.String currency)
Three-letter ISO code for the currency of theamount_offparameter (required ifamount_offis passed).
-
setDuration
public CouponCreateParams.Builder setDuration(CouponCreateParams.Duration duration)
Specifies how long the discount will be in effect if used on a subscription. Can beforever,once, orrepeating. Defaults toonce.
-
setDurationInMonths
public CouponCreateParams.Builder setDurationInMonths(java.lang.Long durationInMonths)
Required only ifdurationisrepeating, in which case it must be a positive integer that specifies the number of months the discount will be in effect.
-
addExpand
public CouponCreateParams.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. SeeCouponCreateParams.expandfor the field documentation.
-
addAllExpand
public CouponCreateParams.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. SeeCouponCreateParams.expandfor the field documentation.
-
putExtraParam
public CouponCreateParams.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. SeeCouponCreateParams.extraParamsfor the field documentation.
-
putAllExtraParam
public CouponCreateParams.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. SeeCouponCreateParams.extraParamsfor the field documentation.
-
setId
public CouponCreateParams.Builder setId(java.lang.String id)
Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you.
-
setMaxRedemptions
public CouponCreateParams.Builder setMaxRedemptions(java.lang.Long maxRedemptions)
A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use.
-
putMetadata
public CouponCreateParams.Builder putMetadata(java.lang.String key, java.lang.String value)
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. SeeCouponCreateParams.metadatafor the field documentation.
-
putAllMetadata
public CouponCreateParams.Builder putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
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. SeeCouponCreateParams.metadatafor the field documentation.
-
setMetadata
public CouponCreateParams.Builder setMetadata(EmptyParam metadata)
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 tometadata.
-
setMetadata
public CouponCreateParams.Builder setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
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 tometadata.
-
setName
public CouponCreateParams.Builder setName(java.lang.String name)
Name of the coupon displayed to customers on, for instance invoices, or receipts. By default theidis shown ifnameis not set.
-
setPercentOff
public CouponCreateParams.Builder setPercentOff(java.math.BigDecimal percentOff)
A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required ifamount_offis not passed).
-
setRedeemBy
public CouponCreateParams.Builder setRedeemBy(java.lang.Long redeemBy)
Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers.
-
-