Package im.getsocial.sdk.promocodes
Class PromoCodeContent
- java.lang.Object
-
- im.getsocial.sdk.promocodes.PromoCodeContent
-
public final class PromoCodeContent extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PromoCodeContent
addProperties(java.util.Map<java.lang.String,java.lang.String> data)
Attach some custom data to the promo code.PromoCodeContent
addProperty(java.lang.String key, java.lang.String value)
Attach some custom data to the promo code.static PromoCodeContent
createRandomCode()
Create a Promo Code with a random code.static PromoCodeContent
createWithCode(java.lang.String code)
Create a Promo Code with defined code.java.lang.String
getCode()
java.util.Date
getEndDate()
int
getMaxClaimCount()
java.util.Map<java.lang.String,java.lang.String>
getProperties()
java.util.Date
getStartDate()
PromoCodeContent
withMaxClaimCount(int maxClaimCount)
The maximum number of times this code can be claimed.PromoCodeContent
withTimeLimit(java.util.Date startDate, java.util.Date endDate)
Set the time range when this Promo Code is available.
-
-
-
Method Detail
-
createRandomCode
public static PromoCodeContent createRandomCode()
Create a Promo Code with a random code.- Returns:
- new builder instance.
-
createWithCode
public static PromoCodeContent createWithCode(java.lang.String code)
Create a Promo Code with defined code.- Parameters:
code
- code to be used as promo code.- Returns:
- new builder instance.
-
withMaxClaimCount
public PromoCodeContent withMaxClaimCount(int maxClaimCount)
The maximum number of times this code can be claimed. All the next attempts will receive an error. If `0` then no limits.- Parameters:
maxClaimCount
- maximum claim times.- Returns:
- instance of
PromoCodeContent
for method chaining.
-
withTimeLimit
public PromoCodeContent withTimeLimit(java.util.Date startDate, java.util.Date endDate)
Set the time range when this Promo Code is available. If not set - will be available from the creation moment and until manually disabled on the Dashboard.- Parameters:
startDate
- date when the Promo Code should become available.endDate
- date when the Promo Code should not be available anymore.- Returns:
- instance of
PromoCodeContent
for method chaining.
-
addProperty
public PromoCodeContent addProperty(java.lang.String key, java.lang.String value)
Attach some custom data to the promo code.- Parameters:
key
- data key.value
- data value.- Returns:
- instance of
PromoCodeContent
for method chaining.
-
addProperties
public PromoCodeContent addProperties(java.util.Map<java.lang.String,java.lang.String> data)
Attach some custom data to the promo code.- Parameters:
data
- custom data.- Returns:
- instance of
PromoCodeContent
for method chaining.
-
getCode
public java.lang.String getCode()
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
-
getMaxClaimCount
public int getMaxClaimCount()
-
getStartDate
public java.util.Date getStartDate()
-
getEndDate
public java.util.Date getEndDate()
-
-