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 Stringdiscriminator value for StagedOrderChangeLineItemQuantityAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for StagedOrderChangeLineItemQuantityActioncreate builder for StagedOrderChangeLineItemQuantityAction instancecopyDeep()factory method to create a deep copy of StagedOrderChangeLineItemQuantityAction@Valid MoneyRequired when the Line Item usesExternalPriceLineItemPriceMode.@Valid ExternalLineItemTotalPriceSets the LineItempriceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode.idof the LineItem to update.keyof the LineItem to update.@NotNull LongNew value to set.of()factory methodof(StagedOrderChangeLineItemQuantityAction template) factory method to create a shallow copy StagedOrderChangeLineItemQuantityActionvoidsetExternalPrice(Money externalPrice) Required when the Line Item usesExternalPriceLineItemPriceMode.voidsetExternalTotalPrice(ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItempriceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode.voidsetLineItemId(String lineItemId) idof the LineItem to update.voidsetLineItemKey(String lineItemKey) keyof the LineItem to update.voidsetQuantity(Long quantity) New value to set.static com.fasterxml.jackson.core.type.TypeReference<StagedOrderChangeLineItemQuantityAction>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithStagedOrderChangeLineItemQuantityAction(Function<StagedOrderChangeLineItemQuantityAction, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.ResourceUpdateAction
getMethods 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()idof the LineItem to update. EitherlineItemIdorlineItemKeyis required.- Returns:
- lineItemId
-
getLineItemKey
String getLineItemKey()keyof the LineItem to update. EitherlineItemIdorlineItemKeyis 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
ExternalPriceLineItemPriceMode. Sets the LineItempriceto the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Returns:
- externalPrice
-
getExternalTotalPrice
Sets the LineItem
priceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode. IfexternalTotalPriceis not given and thepriceModeisExternalTotal, the external price is unset and thepriceModeis set toPlatform.- Returns:
- externalTotalPrice
-
setLineItemId
idof the LineItem to update. EitherlineItemIdorlineItemKeyis required.- Parameters:
lineItemId- value to be set
-
setLineItemKey
keyof the LineItem to update. EitherlineItemIdorlineItemKeyis 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
ExternalPriceLineItemPriceMode. Sets the LineItempriceto the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
externalPrice- value to be set
-
setExternalTotalPrice
Sets the LineItem
priceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode. IfexternalTotalPriceis not given and thepriceModeisExternalTotal, the external price is unset and thepriceModeis 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
-
copyDeep
StagedOrderChangeLineItemQuantityAction copyDeep()- Specified by:
copyDeepin interfaceStagedOrderUpdateAction
-
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
-