public class PromotionCode extends ApiResource implements HasId, MetadataStore<PromotionCode>
| Modifier and Type | Class and Description |
|---|---|
static class |
PromotionCode.Restrictions |
ApiResource.RequestMethodCHARSET, GSONPRETTY_PRINT_GSON| Constructor and Description |
|---|
PromotionCode() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canEqual(java.lang.Object other) |
static PromotionCode |
create(java.util.Map<java.lang.String,java.lang.Object> params)
A promotion code points to a coupon.
|
static PromotionCode |
create(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
A promotion code points to a coupon.
|
static PromotionCode |
create(PromotionCodeCreateParams params)
A promotion code points to a coupon.
|
static PromotionCode |
create(PromotionCodeCreateParams params,
RequestOptions options)
A promotion code points to a coupon.
|
boolean |
equals(java.lang.Object o) |
java.lang.Boolean |
getActive()
Whether the promotion code is currently active.
|
java.lang.String |
getCode()
The customer-facing code.
|
Coupon |
getCoupon()
A coupon contains information about a percent-off or amount-off discount you might want to
apply to a customer.
|
java.lang.Long |
getCreated()
Time at which the object was created.
|
java.lang.String |
getCustomer()
Get ID of expandable
customer object. |
Customer |
getCustomerObject()
Get expanded
customer. |
java.lang.Long |
getExpiresAt()
Date at which the promotion code can no longer be redeemed.
|
java.lang.String |
getId()
Unique identifier for the object.
|
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.lang.Long |
getMaxRedemptions()
Maximum number of times this promotion code can be redeemed.
|
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 |
getObject()
String representing the object's type.
|
PromotionCode.Restrictions |
getRestrictions() |
java.lang.Long |
getTimesRedeemed()
Number of times this promotion code has been used.
|
int |
hashCode() |
static PromotionCodeCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of your promotion codes.
|
static PromotionCodeCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Returns a list of your promotion codes.
|
static PromotionCodeCollection |
list(PromotionCodeListParams params)
Returns a list of your promotion codes.
|
static PromotionCodeCollection |
list(PromotionCodeListParams params,
RequestOptions options)
Returns a list of your promotion codes.
|
static PromotionCode |
retrieve(java.lang.String promotionCode)
Retrieves the promotion code with the given ID.
|
static PromotionCode |
retrieve(java.lang.String promotionCode,
java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Retrieves the promotion code with the given ID.
|
static PromotionCode |
retrieve(java.lang.String promotionCode,
PromotionCodeRetrieveParams params,
RequestOptions options)
Retrieves the promotion code with the given ID.
|
static PromotionCode |
retrieve(java.lang.String promotionCode,
RequestOptions options)
Retrieves the promotion code with the given ID.
|
void |
setActive(java.lang.Boolean active)
Whether the promotion code is currently active.
|
void |
setCode(java.lang.String code)
The customer-facing code.
|
void |
setCoupon(Coupon coupon)
A coupon contains information about a percent-off or amount-off discount you might want to
apply to a customer.
|
void |
setCreated(java.lang.Long created)
Time at which the object was created.
|
void |
setCustomer(java.lang.String id) |
void |
setCustomerObject(Customer expandableObject) |
void |
setExpiresAt(java.lang.Long expiresAt)
Date at which the promotion code can no longer be redeemed.
|
void |
setId(java.lang.String id)
Unique identifier for the object.
|
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 |
setMaxRedemptions(java.lang.Long maxRedemptions)
Maximum number of times this promotion code can be redeemed.
|
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 |
setObject(java.lang.String object)
String representing the object's type.
|
void |
setRestrictions(PromotionCode.Restrictions restrictions) |
void |
setTimesRedeemed(java.lang.Long timesRedeemed)
Number of times this promotion code has been used.
|
PromotionCode |
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates the specified promotion code by setting the values of the parameters passed.
|
PromotionCode |
update(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Updates the specified promotion code by setting the values of the parameters passed.
|
PromotionCode |
update(PromotionCodeUpdateParams params)
Updates the specified promotion code by setting the values of the parameters passed.
|
PromotionCode |
update(PromotionCodeUpdateParams params,
RequestOptions options)
Updates the specified promotion code by setting the values of the parameters passed.
|
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeIdequals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringpublic java.lang.String getCustomer()
customer object.public void setCustomer(java.lang.String id)
public Customer getCustomerObject()
customer.public void setCustomerObject(Customer expandableObject)
public static PromotionCode retrieve(java.lang.String promotionCode) throws StripeException
StripeExceptionpublic static PromotionCode retrieve(java.lang.String promotionCode, RequestOptions options) throws StripeException
StripeExceptionpublic static PromotionCode retrieve(java.lang.String promotionCode, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeExceptionpublic static PromotionCode retrieve(java.lang.String promotionCode, PromotionCodeRetrieveParams params, RequestOptions options) throws StripeException
StripeExceptionpublic static PromotionCode create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
StripeExceptionpublic static PromotionCode create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeExceptionpublic static PromotionCode create(PromotionCodeCreateParams params) throws StripeException
StripeExceptionpublic static PromotionCode create(PromotionCodeCreateParams params, RequestOptions options) throws StripeException
StripeExceptionpublic PromotionCode update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
update in interface MetadataStore<PromotionCode>StripeExceptionpublic PromotionCode update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
update in interface MetadataStore<PromotionCode>StripeExceptionpublic PromotionCode update(PromotionCodeUpdateParams params) throws StripeException
StripeExceptionpublic PromotionCode update(PromotionCodeUpdateParams params, RequestOptions options) throws StripeException
StripeExceptionpublic static PromotionCodeCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
StripeExceptionpublic static PromotionCodeCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeExceptionpublic static PromotionCodeCollection list(PromotionCodeListParams params) throws StripeException
StripeExceptionpublic static PromotionCodeCollection list(PromotionCodeListParams params, RequestOptions options) throws StripeException
StripeExceptionpublic java.lang.Boolean getActive()
public java.lang.String getCode()
public Coupon getCoupon()
public java.lang.Long getCreated()
public java.lang.Long getExpiresAt()
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.Long getMaxRedemptions()
public java.lang.String getObject()
Equal to promotion_code.
public PromotionCode.Restrictions getRestrictions()
public java.lang.Long getTimesRedeemed()
public void setActive(java.lang.Boolean active)
public void setCode(java.lang.String code)
public void setCoupon(Coupon coupon)
public void setCreated(java.lang.Long created)
public void setExpiresAt(java.lang.Long expiresAt)
public void setId(java.lang.String id)
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 setMaxRedemptions(java.lang.Long maxRedemptions)
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
public void setObject(java.lang.String object)
Equal to promotion_code.
public void setRestrictions(PromotionCode.Restrictions restrictions)
public void setTimesRedeemed(java.lang.Long timesRedeemed)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getId()
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
getMetadata in interface MetadataStore<PromotionCode>