Interface MyCartChangeLineItemQuantityAction

All Superinterfaces:
MyCartUpdateAction, ResourceUpdateAction<MyCartUpdateAction>
All Known Implementing Classes:
MyCartChangeLineItemQuantityActionImpl

public interface MyCartChangeLineItemQuantityAction extends 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 Details

    • CHANGE_LINE_ITEM_QUANTITY

      static final String CHANGE_LINE_ITEM_QUANTITY
      discriminator value for MyCartChangeLineItemQuantityAction
      See Also:
  • Method Details

    • getLineItemId

      String getLineItemId()

      id of the LineItem to update. Either lineItemId or lineItemKey is required.

      Returns:
      lineItemId
    • getLineItemKey

      String getLineItemKey()

      key of the LineItem to update. Either lineItemId or lineItemKey is required.

      Returns:
      lineItemKey
    • getQuantity

      @NotNull @NotNull Long getQuantity()

      New value to set.

      If 0, the Line Item is removed from the Cart.

      Returns:
      quantity
    • setLineItemId

      void setLineItemId(String lineItemId)

      id of the LineItem to update. Either lineItemId or lineItemKey is required.

      Parameters:
      lineItemId - value to be set
    • setLineItemKey

      void setLineItemKey(String lineItemKey)

      key of the LineItem to update. Either lineItemId or lineItemKey is required.

      Parameters:
      lineItemKey - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      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

      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

      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