Interface CategorySetStoresAction

All Superinterfaces:
CategoryUpdateAction, ResourceUpdateAction<CategoryUpdateAction>

public interface CategorySetStoresAction extends CategoryUpdateAction

This action locks the Category and its parent Category. For details, see Category tree locking.

Every direct child Category must be assigned to at least one Store in that set; otherwise, the action is rejected.

  • When updating a Category via the general endpoint, all Stores can be removed as a global Category is accessible in all Stores.

  • When updating a Category via the Store-specific endpoint, the stores field cannot be empty; otherwise, an InvalidOperation error is returned.

    If you do not have permission for every Store currently assigned to the Category, an Unauthorized error is returned.


Example to create an instance using the builder pattern

     CategorySetStoresAction categorySetStoresAction = CategorySetStoresAction.builder()
             .plusStores(storesBuilder -> storesBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getStores

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

      Value to set. It replaces the entire set of Stores assigned to the Category.

      If the stores field contains a Store that you do not have permission for, an InvalidInput error is returned.

      Returns:
      stores
    • setStores

      void setStores(StoreResourceIdentifier... stores)

      Value to set. It replaces the entire set of Stores assigned to the Category.

      If the stores field contains a Store that you do not have permission for, an InvalidInput error is returned.

      Parameters:
      stores - values to be set
    • setStores

      void setStores(List<StoreResourceIdentifier> stores)

      Value to set. It replaces the entire set of Stores assigned to the Category.

      If the stores field contains a Store that you do not have permission for, an InvalidInput error is returned.

      Parameters:
      stores - values to be set
    • of

      factory method
      Returns:
      instance of CategorySetStoresAction
    • of

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

      Specified by:
      copyDeep in interface CategoryUpdateAction
    • deepCopy

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

      builder factory method for CategorySetStoresAction
      Returns:
      builder
    • builder

      create builder for CategorySetStoresAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCategorySetStoresAction

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