Package com.stripe.param
Class PromotionCodeCreateParams.Builder
- java.lang.Object
-
- com.stripe.param.PromotionCodeCreateParams.Builder
-
- Enclosing class:
- PromotionCodeCreateParams
public static class PromotionCodeCreateParams.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PromotionCodeCreateParams.BuilderaddAllExpand(java.util.List<java.lang.String> elements)Add all elements to `expand` list.PromotionCodeCreateParams.BuilderaddExpand(java.lang.String element)Add an element to `expand` list.PromotionCodeCreateParamsbuild()Finalize and obtain parameter instance from this builder.PromotionCodeCreateParams.BuilderputAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)Add all map key/value pairs to `extraParams` map.PromotionCodeCreateParams.BuilderputAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)Add all map key/value pairs to `metadata` map.PromotionCodeCreateParams.BuilderputExtraParam(java.lang.String key, java.lang.Object value)Add a key/value pair to `extraParams` map.PromotionCodeCreateParams.BuilderputMetadata(java.lang.String key, java.lang.String value)Add a key/value pair to `metadata` map.PromotionCodeCreateParams.BuildersetActive(java.lang.Boolean active)Whether the promotion code is currently active.PromotionCodeCreateParams.BuildersetCode(java.lang.String code)The customer-facing code.PromotionCodeCreateParams.BuildersetCoupon(java.lang.String coupon)The coupon for this promotion code.PromotionCodeCreateParams.BuildersetCustomer(java.lang.String customer)The customer that this promotion code can be used by.PromotionCodeCreateParams.BuildersetExpiresAt(java.lang.Long expiresAt)The timestamp at which this promotion code will expire.PromotionCodeCreateParams.BuildersetMaxRedemptions(java.lang.Long maxRedemptions)A positive integer specifying the number of times the promotion code can be redeemed.PromotionCodeCreateParams.BuildersetRestrictions(PromotionCodeCreateParams.Restrictions restrictions)Settings that restrict the redemption of the promotion code.
-
-
-
Method Detail
-
build
public PromotionCodeCreateParams build()
Finalize and obtain parameter instance from this builder.
-
setActive
public PromotionCodeCreateParams.Builder setActive(java.lang.Boolean active)
Whether the promotion code is currently active.
-
setCode
public PromotionCodeCreateParams.Builder setCode(java.lang.String code)
The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically.
-
setCoupon
public PromotionCodeCreateParams.Builder setCoupon(java.lang.String coupon)
The coupon for this promotion code.
-
setCustomer
public PromotionCodeCreateParams.Builder setCustomer(java.lang.String customer)
The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers.
-
addExpand
public PromotionCodeCreateParams.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. SeePromotionCodeCreateParams.expandfor the field documentation.
-
addAllExpand
public PromotionCodeCreateParams.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. SeePromotionCodeCreateParams.expandfor the field documentation.
-
setExpiresAt
public PromotionCodeCreateParams.Builder setExpiresAt(java.lang.Long expiresAt)
The timestamp at which this promotion code will expire. If the coupon has specified aredeems_by, then this value cannot be after the coupon'sredeems_by.
-
putExtraParam
public PromotionCodeCreateParams.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. SeePromotionCodeCreateParams.extraParamsfor the field documentation.
-
putAllExtraParam
public PromotionCodeCreateParams.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. SeePromotionCodeCreateParams.extraParamsfor the field documentation.
-
setMaxRedemptions
public PromotionCodeCreateParams.Builder setMaxRedemptions(java.lang.Long maxRedemptions)
A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified amax_redemptions, then this value cannot be greater than the coupon'smax_redemptions.
-
putMetadata
public PromotionCodeCreateParams.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. SeePromotionCodeCreateParams.metadatafor the field documentation.
-
putAllMetadata
public PromotionCodeCreateParams.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. SeePromotionCodeCreateParams.metadatafor the field documentation.
-
setRestrictions
public PromotionCodeCreateParams.Builder setRestrictions(PromotionCodeCreateParams.Restrictions restrictions)
Settings that restrict the redemption of the promotion code.
-
-