Package com.commercetools.api.models.me
Interface MyCartAddDiscountCodeAction
- All Superinterfaces:
MyCartUpdateAction
,ResourceUpdateAction<MyCartUpdateAction>
Adds a DiscountCode to the Cart to activate the related CartDiscounts. Adding a Discount Code is only possible if no DirectDiscount has been applied to the Cart. Discount Codes can be added to frozen Carts, but their DiscountCodeState is then DoesNotMatchCart
.
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
MyCartAddDiscountCodeAction myCartAddDiscountCodeAction = MyCartAddDiscountCodeAction.builder()
.code("{code}")
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for MyCartAddDiscountCodeAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for MyCartAddDiscountCodeActionbuilder
(MyCartAddDiscountCodeAction template) create builder for MyCartAddDiscountCodeAction instancestatic MyCartAddDiscountCodeAction
deepCopy
(MyCartAddDiscountCodeAction template) factory method to create a deep copy of MyCartAddDiscountCodeAction@NotNull String
getCode()
code
of a DiscountCode.static MyCartAddDiscountCodeAction
of()
factory methodstatic MyCartAddDiscountCodeAction
of
(MyCartAddDiscountCodeAction template) factory method to create a shallow copy MyCartAddDiscountCodeActionvoid
code
of a DiscountCode.static com.fasterxml.jackson.core.type.TypeReference<MyCartAddDiscountCodeAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.me.MyCartUpdateAction
getAction, withMyCartUpdateAction
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Field Details
-
ADD_DISCOUNT_CODE
discriminator value for MyCartAddDiscountCodeAction- 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 MyCartAddDiscountCodeAction
-
of
factory method to create a shallow copy MyCartAddDiscountCodeAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static MyCartAddDiscountCodeAction deepCopy(@Nullable MyCartAddDiscountCodeAction template) factory method to create a deep copy of MyCartAddDiscountCodeAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for MyCartAddDiscountCodeAction- Returns:
- builder
-
builder
create builder for MyCartAddDiscountCodeAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withMyCartAddDiscountCodeAction
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-