Interface ProductAddPriceAction

All Superinterfaces:
ProductUpdateAction, ResourceUpdateAction<ProductUpdateAction>

public interface ProductAddPriceAction extends ProductUpdateAction

Adds the given Price to the prices array of the ProductVariant. Either variantId or sku is required.


Example to create an instance using the builder pattern

     ProductAddPriceAction productAddPriceAction = ProductAddPriceAction.builder()
             .price(priceBuilder -> priceBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getVariantId

      Long getVariantId()

      The id of the ProductVariant to update.

      Returns:
      variantId
    • getSku

      String getSku()

      The sku of the ProductVariant to update.

      Returns:
      sku
    • getPrice

      @NotNull @Valid @NotNull @Valid PriceDraft getPrice()

      Embedded Price to add to the Product Variant.

      If the key of the Price is used by another Embedded Price on the ProductVariant, a DuplicatePriceKey error is returned.

      If this Embedded Price has the same price scope as an existing Embedded Price on the ProductVariant, a DuplicatePriceScope error is returned.

      If this Embedded Price has overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

      Returns:
      price
    • getStaged

      Boolean getStaged()

      Whether only staged prices are updated. If false, both current and staged prices are updated.

      Returns:
      staged
    • setVariantId

      void setVariantId(Long variantId)

      The id of the ProductVariant to update.

      Parameters:
      variantId - value to be set
    • setSku

      void setSku(String sku)

      The sku of the ProductVariant to update.

      Parameters:
      sku - value to be set
    • setPrice

      void setPrice(PriceDraft price)

      Embedded Price to add to the Product Variant.

      If the key of the Price is used by another Embedded Price on the ProductVariant, a DuplicatePriceKey error is returned.

      If this Embedded Price has the same price scope as an existing Embedded Price on the ProductVariant, a DuplicatePriceScope error is returned.

      If this Embedded Price has overlapping validity periods within the same price scope, an OverlappingPriceValidity error is returned. An Embedded Price without validity period does not conflict with an Embedded Price defined for a time period.

      Parameters:
      price - value to be set
    • setStaged

      void setStaged(Boolean staged)

      Whether only staged prices are updated. If false, both current and staged prices are updated.

      Parameters:
      staged - value to be set
    • of

      static ProductAddPriceAction of()
      factory method
      Returns:
      instance of ProductAddPriceAction
    • of

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

      Specified by:
      copyDeep in interface ProductUpdateAction
    • deepCopy

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

      static ProductAddPriceActionBuilder builder()
      builder factory method for ProductAddPriceAction
      Returns:
      builder
    • builder

      create builder for ProductAddPriceAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductAddPriceAction

      default <T> T withProductAddPriceAction(Function<ProductAddPriceAction,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static tools.jackson.core.type.TypeReference<ProductAddPriceAction> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference