Interface MyCartChangeLineItemQuantityAction
- All Superinterfaces:
MyCartUpdateAction
,ResourceUpdateAction<MyCartUpdateAction>
When multiple shipping addresses are set for a Line Item, use the Remove LineItem and Add LineItem update action to change the shipping details. Since it is not possible for the API to infer how the overall change in the Line Item quantity should be distributed over the sub-quantities, the shippingDetails
field is kept in its current state to avoid data loss.
To change the Line Item quantity and shipping details together, use this update action in combination with the Set LineItem ShippingDetails update action in a single Cart update command.
When the action applies to LineItems with ExternalTotal
LineItemPriceMode, it will be changed to ExternalPrice
and the existing externalPrice
value, i.e. LineItem.price
, will be retained. The LineItem total will be calculated by the system instead, so that the externalTotalPrice
will be dropped.
Example to create an instance using the builder pattern
MyCartChangeLineItemQuantityAction myCartChangeLineItemQuantityAction = MyCartChangeLineItemQuantityAction.builder()
.quantity(0.3)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for MyCartChangeLineItemQuantityAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for MyCartChangeLineItemQuantityActionbuilder
(MyCartChangeLineItemQuantityAction template) create builder for MyCartChangeLineItemQuantityAction instancedeepCopy
(MyCartChangeLineItemQuantityAction template) factory method to create a deep copy of MyCartChangeLineItemQuantityActionid
of the LineItem to update.key
of the LineItem to update.@NotNull Long
New value to set.of()
factory methodof
(MyCartChangeLineItemQuantityAction template) factory method to create a shallow copy MyCartChangeLineItemQuantityActionvoid
setLineItemId
(String lineItemId) id
of the LineItem to update.void
setLineItemKey
(String lineItemKey) key
of the LineItem to update.void
setQuantity
(Long quantity) New value to set.static com.fasterxml.jackson.core.type.TypeReference<MyCartChangeLineItemQuantityAction>
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
-
CHANGE_LINE_ITEM_QUANTITY
discriminator value for MyCartChangeLineItemQuantityAction- See Also:
-
-
Method Details
-
getLineItemId
String getLineItemId()id
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Returns:
- lineItemId
-
getLineItemKey
String getLineItemKey()key
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Returns:
- lineItemKey
-
getQuantity
New value to set.
If
0
, the Line Item is removed from the Cart.- Returns:
- quantity
-
setLineItemId
id
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Parameters:
lineItemId
- value to be set
-
setLineItemKey
key
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Parameters:
lineItemKey
- value to be set
-
setQuantity
New value to set.
If
0
, the Line Item is removed from the Cart.- Parameters:
quantity
- value to be set
-
of
factory method- Returns:
- instance of MyCartChangeLineItemQuantityAction
-
of
factory method to create a shallow copy MyCartChangeLineItemQuantityAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static MyCartChangeLineItemQuantityAction deepCopy(@Nullable MyCartChangeLineItemQuantityAction template) factory method to create a deep copy of MyCartChangeLineItemQuantityAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for MyCartChangeLineItemQuantityAction- Returns:
- builder
-
builder
static MyCartChangeLineItemQuantityActionBuilder builder(MyCartChangeLineItemQuantityAction template) create builder for MyCartChangeLineItemQuantityAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withMyCartChangeLineItemQuantityAction
default <T> T withMyCartChangeLineItemQuantityAction(Function<MyCartChangeLineItemQuantityAction, 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<MyCartChangeLineItemQuantityAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-