Interface StagedOrderChangeLineItemQuantityAction
- All Superinterfaces:
ResourceUpdateAction<StagedOrderUpdateAction>
,StagedOrderUpdateAction
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 Order update command.
The LineItem price is updated as described in Line Item price selection.
Example to create an instance using the builder pattern
StagedOrderChangeLineItemQuantityAction stagedOrderChangeLineItemQuantityAction = StagedOrderChangeLineItemQuantityAction.builder()
.quantity(0.3)
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
discriminator value for StagedOrderChangeLineItemQuantityAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for StagedOrderChangeLineItemQuantityActioncreate builder for StagedOrderChangeLineItemQuantityAction instancefactory method to create a deep copy of StagedOrderChangeLineItemQuantityAction@Valid Money
Required when the Line Item usesExternalPrice
LineItemPriceMode.@Valid ExternalLineItemTotalPrice
Sets the LineItemprice
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.id
of the LineItem to update.key
of the LineItem to update.@NotNull Long
New value to set.of()
factory methodof
(StagedOrderChangeLineItemQuantityAction template) factory method to create a shallow copy StagedOrderChangeLineItemQuantityActionvoid
setExternalPrice
(Money externalPrice) Required when the Line Item usesExternalPrice
LineItemPriceMode.void
setExternalTotalPrice
(ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItemprice
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.void
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<StagedOrderChangeLineItemQuantityAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withStagedOrderChangeLineItemQuantityAction
(Function<StagedOrderChangeLineItemQuantityAction, T> helper) 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
-
CHANGE_LINE_ITEM_QUANTITY
discriminator value for StagedOrderChangeLineItemQuantityAction- 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 LineItem is removed from the Order.- Returns:
- quantity
-
getExternalPrice
Required when the Line Item uses
ExternalPrice
LineItemPriceMode. Sets the LineItemprice
to the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
- Returns:
- externalPrice
-
getExternalTotalPrice
Sets the LineItem
price
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode. IfexternalTotalPrice
is not given and thepriceMode
isExternalTotal
, the external price is unset and thepriceMode
is set toPlatform
.- Returns:
- externalTotalPrice
-
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 LineItem is removed from the Order.- Parameters:
quantity
- value to be set
-
setExternalPrice
Required when the Line Item uses
ExternalPrice
LineItemPriceMode. Sets the LineItemprice
to the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
- Parameters:
externalPrice
- value to be set
-
setExternalTotalPrice
Sets the LineItem
price
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode. IfexternalTotalPrice
is not given and thepriceMode
isExternalTotal
, the external price is unset and thepriceMode
is set toPlatform
.- Parameters:
externalTotalPrice
- value to be set
-
of
factory method- Returns:
- instance of StagedOrderChangeLineItemQuantityAction
-
of
factory method to create a shallow copy StagedOrderChangeLineItemQuantityAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static StagedOrderChangeLineItemQuantityAction deepCopy(@Nullable StagedOrderChangeLineItemQuantityAction template) factory method to create a deep copy of StagedOrderChangeLineItemQuantityAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for StagedOrderChangeLineItemQuantityAction- Returns:
- builder
-
builder
static StagedOrderChangeLineItemQuantityActionBuilder builder(StagedOrderChangeLineItemQuantityAction template) create builder for StagedOrderChangeLineItemQuantityAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withStagedOrderChangeLineItemQuantityAction
default <T> T withStagedOrderChangeLineItemQuantityAction(Function<StagedOrderChangeLineItemQuantityAction, 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<StagedOrderChangeLineItemQuantityAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-