public interface DiscountCode extends BaseResource, DomainResource<DiscountCode>
Modifier and Type | Method and Description |
---|---|
static DiscountCodeBuilder |
builder() |
static DiscountCodeBuilder |
builder(DiscountCode template) |
@NotNull @Valid List<CartDiscountReference> |
getCartDiscounts()
The referenced matching cart discounts can be applied to the cart once the DiscountCode is added.
|
String |
getCartPredicate()
The discount code can only be applied to carts that match this predicate.
|
@NotNull String |
getCode()
Unique identifier of this discount code.
|
@NotNull ZonedDateTime |
getCreatedAt() |
@Valid CreatedBy |
getCreatedBy()
Present on resources created after 1/02/2019 except for events not tracked.
|
@Valid CustomFields |
getCustom() |
@Valid LocalizedString |
getDescription() |
@NotNull List<String> |
getGroups()
The groups to which this discount code belong.
|
@NotNull String |
getId()
The unique ID of the discount code.
|
@NotNull Boolean |
getIsActive() |
@NotNull ZonedDateTime |
getLastModifiedAt() |
@Valid LastModifiedBy |
getLastModifiedBy()
Present on resources updated after 1/02/2019 except for events not tracked.
|
Long |
getMaxApplications()
The discount code can only be applied
maxApplications times. |
Long |
getMaxApplicationsPerCustomer()
The discount code can only be applied
maxApplicationsPerCustomer times per customer. |
@Valid LocalizedString |
getName() |
@NotNull @Valid List<Reference> |
getReferences()
The platform will generate this array from the cart predicate.
|
ZonedDateTime |
getValidFrom()
The time from which the discount can be applied on a cart.
|
ZonedDateTime |
getValidUntil()
The time until the discount can be applied on a cart.
|
@NotNull Long |
getVersion() |
static DiscountCode |
of() |
static DiscountCode |
of(DiscountCode template) |
void |
setCartDiscounts(CartDiscountReference... cartDiscounts) |
void |
setCartDiscounts(List<CartDiscountReference> cartDiscounts) |
void |
setCartPredicate(String cartPredicate) |
void |
setCode(String code) |
void |
setCreatedAt(ZonedDateTime createdAt) |
void |
setCreatedBy(CreatedBy createdBy) |
void |
setCustom(CustomFields custom) |
void |
setDescription(LocalizedString description) |
void |
setGroups(List<String> groups) |
void |
setGroups(String... groups) |
void |
setId(String id) |
void |
setIsActive(Boolean isActive) |
void |
setLastModifiedAt(ZonedDateTime lastModifiedAt) |
void |
setLastModifiedBy(LastModifiedBy lastModifiedBy) |
void |
setMaxApplications(Long maxApplications) |
void |
setMaxApplicationsPerCustomer(Long maxApplicationsPerCustomer) |
void |
setName(LocalizedString name) |
void |
setReferences(List<Reference> references) |
void |
setReferences(Reference... references) |
void |
setValidFrom(ZonedDateTime validFrom) |
void |
setValidUntil(ZonedDateTime validUntil) |
void |
setVersion(Long version) |
default <T> T |
withDiscountCode(Function<DiscountCode,T> helper) |
withBaseResource
get
@NotNull @NotNull String getId()
The unique ID of the discount code.
getId
in interface BaseResource
getId
in interface DomainResource<DiscountCode>
@NotNull @NotNull Long getVersion()
getVersion
in interface BaseResource
getVersion
in interface DomainResource<DiscountCode>
@NotNull @NotNull ZonedDateTime getCreatedAt()
getCreatedAt
in interface BaseResource
@NotNull @NotNull ZonedDateTime getLastModifiedAt()
getLastModifiedAt
in interface BaseResource
@Valid @Valid LastModifiedBy getLastModifiedBy()
Present on resources updated after 1/02/2019 except for events not tracked.
@Valid @Valid CreatedBy getCreatedBy()
Present on resources created after 1/02/2019 except for events not tracked.
@Valid @Valid LocalizedString getName()
@Valid @Valid LocalizedString getDescription()
@NotNull @NotNull String getCode()
Unique identifier of this discount code. This value is added to the cart to enable the related cart discounts in the cart.
@NotNull @Valid @NotNull @Valid List<CartDiscountReference> getCartDiscounts()
The referenced matching cart discounts can be applied to the cart once the DiscountCode is added.
String getCartPredicate()
The discount code can only be applied to carts that match this predicate.
@NotNull @NotNull Boolean getIsActive()
@NotNull @Valid @NotNull @Valid List<Reference> getReferences()
The platform will generate this array from the cart predicate. It contains the references of all the resources that are addressed in the predicate.
Long getMaxApplications()
The discount code can only be applied maxApplications
times.
Long getMaxApplicationsPerCustomer()
The discount code can only be applied maxApplicationsPerCustomer
times per customer.
@Valid @Valid CustomFields getCustom()
ZonedDateTime getValidFrom()
The time from which the discount can be applied on a cart. Before that time the code is invalid.
ZonedDateTime getValidUntil()
The time until the discount can be applied on a cart. After that time the code is invalid.
void setId(String id)
setId
in interface BaseResource
void setVersion(Long version)
setVersion
in interface BaseResource
void setCreatedAt(ZonedDateTime createdAt)
setCreatedAt
in interface BaseResource
void setLastModifiedAt(ZonedDateTime lastModifiedAt)
setLastModifiedAt
in interface BaseResource
void setLastModifiedBy(LastModifiedBy lastModifiedBy)
void setCreatedBy(CreatedBy createdBy)
void setName(LocalizedString name)
void setDescription(LocalizedString description)
void setCode(String code)
void setCartDiscounts(CartDiscountReference... cartDiscounts)
void setCartDiscounts(List<CartDiscountReference> cartDiscounts)
void setCartPredicate(String cartPredicate)
void setIsActive(Boolean isActive)
void setReferences(Reference... references)
void setMaxApplications(Long maxApplications)
void setMaxApplicationsPerCustomer(Long maxApplicationsPerCustomer)
void setCustom(CustomFields custom)
void setGroups(String... groups)
void setValidFrom(ZonedDateTime validFrom)
void setValidUntil(ZonedDateTime validUntil)
static DiscountCode of()
static DiscountCode of(DiscountCode template)
static DiscountCodeBuilder builder()
static DiscountCodeBuilder builder(DiscountCode template)
default <T> T withDiscountCode(Function<DiscountCode,T> helper)