Package com.commercetools.api.models.me
Interface MyCartSetDirectDiscountsAction
- All Superinterfaces:
MyCartUpdateAction
,ResourceUpdateAction<MyCartUpdateAction>
- All Known Implementing Classes:
MyCartSetDirectDiscountsActionImpl
Adds a DirectDiscount, but only if no DiscountCode has been added to the Cart. Either a Discount Code or a Direct Discount can exist on a Cart at the same time.
Example to create an instance using the builder pattern
MyCartSetDirectDiscountsAction myCartSetDirectDiscountsAction = MyCartSetDirectDiscountsAction.builder()
.plusDiscounts(discountsBuilder -> discountsBuilder)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for MyCartSetDirectDiscountsAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for MyCartSetDirectDiscountsActionbuilder
(MyCartSetDirectDiscountsAction template) create builder for MyCartSetDirectDiscountsAction instancedeepCopy
(MyCartSetDirectDiscountsAction template) factory method to create a deep copy of MyCartSetDirectDiscountsAction@NotNull @Valid List<DirectDiscountDraft>
If set, all existing Direct Discounts are replaced.of()
factory methodof
(MyCartSetDirectDiscountsAction template) factory method to create a shallow copy MyCartSetDirectDiscountsActionvoid
setDiscounts
(DirectDiscountDraft... discounts) If set, all existing Direct Discounts are replaced.void
setDiscounts
(List<DirectDiscountDraft> discounts) If set, all existing Direct Discounts are replaced.static com.fasterxml.jackson.core.type.TypeReference<MyCartSetDirectDiscountsAction>
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
-
SET_DIRECT_DISCOUNTS
discriminator value for MyCartSetDirectDiscountsAction- See Also:
-
-
Method Details
-
getDiscounts
- If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Returns:
- discounts
-
setDiscounts
- If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
discounts
- values to be set
-
setDiscounts
- If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
- If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
- Parameters:
discounts
- values to be set
-
of
factory method- Returns:
- instance of MyCartSetDirectDiscountsAction
-
of
factory method to create a shallow copy MyCartSetDirectDiscountsAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static MyCartSetDirectDiscountsAction deepCopy(@Nullable MyCartSetDirectDiscountsAction template) factory method to create a deep copy of MyCartSetDirectDiscountsAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for MyCartSetDirectDiscountsAction- Returns:
- builder
-
builder
create builder for MyCartSetDirectDiscountsAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withMyCartSetDirectDiscountsAction
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<MyCartSetDirectDiscountsAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-