public static class PromotionCodeCreateParams.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
PromotionCodeCreateParams.Builder |
addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list.
|
PromotionCodeCreateParams.Builder |
addExpand(java.lang.String element)
Add an element to `expand` list.
|
PromotionCodeCreateParams |
build()
Finalize and obtain parameter instance from this builder.
|
PromotionCodeCreateParams.Builder |
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.
|
PromotionCodeCreateParams.Builder |
putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
Add all map key/value pairs to `metadata` map.
|
PromotionCodeCreateParams.Builder |
putExtraParam(java.lang.String key,
java.lang.Object value)
Add a key/value pair to `extraParams` map.
|
PromotionCodeCreateParams.Builder |
putMetadata(java.lang.String key,
java.lang.String value)
Add a key/value pair to `metadata` map.
|
PromotionCodeCreateParams.Builder |
setActive(java.lang.Boolean active)
Whether the promotion code is currently active.
|
PromotionCodeCreateParams.Builder |
setCode(java.lang.String code)
The customer-facing code.
|
PromotionCodeCreateParams.Builder |
setCoupon(java.lang.String coupon)
The coupon for this promotion code.
|
PromotionCodeCreateParams.Builder |
setCustomer(java.lang.String customer)
The customer that this promotion code can be used by.
|
PromotionCodeCreateParams.Builder |
setExpiresAt(java.lang.Long expiresAt)
The timestamp at which this promotion code will expire.
|
PromotionCodeCreateParams.Builder |
setMaxRedemptions(java.lang.Long maxRedemptions)
A positive integer specifying the number of times the promotion code can be redeemed.
|
PromotionCodeCreateParams.Builder |
setRestrictions(PromotionCodeCreateParams.Restrictions restrictions)
Settings that restrict the redemption of the promotion code.
|
public PromotionCodeCreateParams build()
public PromotionCodeCreateParams.Builder setActive(java.lang.Boolean active)
public PromotionCodeCreateParams.Builder setCode(java.lang.String code)
public PromotionCodeCreateParams.Builder setCoupon(java.lang.String coupon)
public PromotionCodeCreateParams.Builder setCustomer(java.lang.String customer)
public PromotionCodeCreateParams.Builder addExpand(java.lang.String element)
PromotionCodeCreateParams.expand
for the field documentation.public PromotionCodeCreateParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
PromotionCodeCreateParams.expand
for the field documentation.public PromotionCodeCreateParams.Builder setExpiresAt(java.lang.Long expiresAt)
redeems_by
, then this value cannot be after the coupon's redeems_by
.public PromotionCodeCreateParams.Builder putExtraParam(java.lang.String key, java.lang.Object value)
PromotionCodeCreateParams.extraParams
for the field documentation.public PromotionCodeCreateParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
PromotionCodeCreateParams.extraParams
for the field documentation.public PromotionCodeCreateParams.Builder setMaxRedemptions(java.lang.Long maxRedemptions)
max_redemptions
, then this value cannot be greater than the
coupon's max_redemptions
.public PromotionCodeCreateParams.Builder putMetadata(java.lang.String key, java.lang.String value)
PromotionCodeCreateParams.metadata
for the field documentation.public PromotionCodeCreateParams.Builder putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
PromotionCodeCreateParams.metadata
for the field documentation.public PromotionCodeCreateParams.Builder setRestrictions(PromotionCodeCreateParams.Restrictions restrictions)