Interface CartDiscountSetStoresAction

All Superinterfaces:
CartDiscountUpdateAction, ResourceUpdateAction<CartDiscountUpdateAction>

public interface CartDiscountSetStoresAction extends CartDiscountUpdateAction

If a referenced Store does not exist, a ReferencedResourceNotFound error is returned.

This action generates a CartDiscountStoresSet Message.


Example to create an instance using the builder pattern

     CartDiscountSetStoresAction cartDiscountSetStoresAction = CartDiscountSetStoresAction.builder()
             .plusStores(storesBuilder -> storesBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getStores

      @NotNull @Valid @NotNull @Valid List<StoreResourceIdentifier> getStores()

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Returns:
      stores
    • setStores

      void setStores(StoreResourceIdentifier... stores)

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      stores - values to be set
    • setStores

      void setStores(List<StoreResourceIdentifier> stores)

      Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

      A failed update can return the following errors:

      • If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.
      • If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.
      Parameters:
      stores - values to be set
    • of

      factory method
      Returns:
      instance of CartDiscountSetStoresAction
    • of

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

      factory method to create a deep copy of CartDiscountSetStoresAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for CartDiscountSetStoresAction
      Returns:
      builder
    • builder

      create builder for CartDiscountSetStoresAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartDiscountSetStoresAction

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