Interface StagedOrderAddDiscountCodeAction
- All Superinterfaces:
ResourceUpdateAction<StagedOrderUpdateAction>
,StagedOrderUpdateAction
Adds a DiscountCode to the Cart to activate the related Cart Discounts. Adding a Discount Code is only possible if no DirectDiscount has been applied to the Order.
The maximum number of Discount Codes in a Cart is restricted by a limit.
Specific Error Code: MatchingPriceNotFound
Example to create an instance using the builder pattern
StagedOrderAddDiscountCodeAction stagedOrderAddDiscountCodeAction = StagedOrderAddDiscountCodeAction.builder()
.code("{code}")
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for StagedOrderAddDiscountCodeAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for StagedOrderAddDiscountCodeActionbuilder
(StagedOrderAddDiscountCodeAction template) create builder for StagedOrderAddDiscountCodeAction instancedeepCopy
(StagedOrderAddDiscountCodeAction template) factory method to create a deep copy of StagedOrderAddDiscountCodeAction@NotNull String
getCode()
code
of a DiscountCode.of()
factory methodof
(StagedOrderAddDiscountCodeAction template) factory method to create a shallow copy StagedOrderAddDiscountCodeActionvoid
code
of a DiscountCode.static com.fasterxml.jackson.core.type.TypeReference<StagedOrderAddDiscountCodeAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
Methods inherited from interface com.commercetools.api.models.order.StagedOrderUpdateAction
getAction, withStagedOrderUpdateAction
-
Field Details
-
ADD_DISCOUNT_CODE
discriminator value for StagedOrderAddDiscountCodeAction- See Also:
-
-
Method Details
-
getCode
code
of a DiscountCode.- Returns:
- code
-
setCode
code
of a DiscountCode.- Parameters:
code
- value to be set
-
of
factory method- Returns:
- instance of StagedOrderAddDiscountCodeAction
-
of
factory method to create a shallow copy StagedOrderAddDiscountCodeAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static StagedOrderAddDiscountCodeAction deepCopy(@Nullable StagedOrderAddDiscountCodeAction template) factory method to create a deep copy of StagedOrderAddDiscountCodeAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for StagedOrderAddDiscountCodeAction- Returns:
- builder
-
builder
create builder for StagedOrderAddDiscountCodeAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withStagedOrderAddDiscountCodeAction
default <T> T withStagedOrderAddDiscountCodeAction(Function<StagedOrderAddDiscountCodeAction, T> helper) accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
static com.fasterxml.jackson.core.type.TypeReference<StagedOrderAddDiscountCodeAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-