Interface ShoppingListAddLineItemAction

All Superinterfaces:
CustomizableDraft<ShoppingListAddLineItemAction>, ResourceUpdateAction<ShoppingListUpdateAction>, ShoppingListUpdateAction

public interface ShoppingListAddLineItemAction extends ShoppingListUpdateAction, CustomizableDraft<ShoppingListAddLineItemAction>

The ProductVariant to be included in the ShoppingListLineItem must be specified using the productID and variantID, or by the sku. If the ShoppingList already contains a ShoppingListLineItem for the same Product Variant with the same Custom Fields, then only the quantity of the existing ShoppingListLineItem is increased. A ShoppingListLineItem with an empty variantId is not considered the same as a ShoppingListLineItem with a variantId currently referring to the Master Variant.

Product Attributes are merged with Variant Attributes to ensure the full Attribute context of the Product Variant.

Produces the Shopping List Line Item Added Message.


Example to create an instance using the builder pattern

     ShoppingListAddLineItemAction shoppingListAddLineItemAction = ShoppingListAddLineItemAction.builder()
             .build()
 
  • Field Details

    • ADD_LINE_ITEM

      static final String ADD_LINE_ITEM
      discriminator value for ShoppingListAddLineItemAction
      See Also:
  • Method Details

    • getKey

      String getKey()

      User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

      Returns:
      key
    • getSku

      String getSku()

      sku of the ProductVariant.

      Returns:
      sku
    • getProductId

      String getProductId()

      Unique identifier of a Product.

      Returns:
      productId
    • getVariantId

      Long getVariantId()

      id of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.

      Returns:
      variantId
    • getQuantity

      Long getQuantity()

      Number of Products in the ShoppingListLineItem.

      Returns:
      quantity
    • getAddedAt

      ZonedDateTime getAddedAt()

      Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.

      Returns:
      addedAt
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields defined for the ShoppingListLineItem.

      Specified by:
      getCustom in interface CustomizableDraft<ShoppingListAddLineItemAction>
      Returns:
      custom
    • setKey

      void setKey(String key)

      User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

      Parameters:
      key - value to be set
    • setSku

      void setSku(String sku)

      sku of the ProductVariant.

      Parameters:
      sku - value to be set
    • setProductId

      void setProductId(String productId)

      Unique identifier of a Product.

      Parameters:
      productId - value to be set
    • setVariantId

      void setVariantId(Long variantId)

      id of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.

      Parameters:
      variantId - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      Number of Products in the ShoppingListLineItem.

      Parameters:
      quantity - value to be set
    • setAddedAt

      void setAddedAt(ZonedDateTime addedAt)

      Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.

      Parameters:
      addedAt - value to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields defined for the ShoppingListLineItem.

      Specified by:
      setCustom in interface CustomizableDraft<ShoppingListAddLineItemAction>
      Parameters:
      custom - value to be set
    • of

      factory method
      Returns:
      instance of ShoppingListAddLineItemAction
    • of

      factory method to create a shallow copy ShoppingListAddLineItemAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      Specified by:
      copyDeep in interface ShoppingListUpdateAction
    • deepCopy

      @Nullable static ShoppingListAddLineItemAction deepCopy(@Nullable ShoppingListAddLineItemAction template)
      factory method to create a deep copy of ShoppingListAddLineItemAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for ShoppingListAddLineItemAction
      Returns:
      builder
    • builder

      create builder for ShoppingListAddLineItemAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withShoppingListAddLineItemAction

      default <T> T withShoppingListAddLineItemAction(Function<ShoppingListAddLineItemAction,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<ShoppingListAddLineItemAction> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference