Interface CategorySetStoresAction
- All Superinterfaces:
CategoryUpdateAction,ResourceUpdateAction<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
storesfield 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for CategorySetStoresAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for CategorySetStoresActionbuilder(CategorySetStoresAction template) create builder for CategorySetStoresAction instancecopyDeep()static CategorySetStoresActiondeepCopy(CategorySetStoresAction template) factory method to create a deep copy of CategorySetStoresAction@NotNull @Valid List<StoreResourceIdentifier>Value to set.static CategorySetStoresActionof()factory methodstatic CategorySetStoresActionof(CategorySetStoresAction template) factory method to create a shallow copy CategorySetStoresActionvoidsetStores(StoreResourceIdentifier... stores) Value to set.voidsetStores(List<StoreResourceIdentifier> stores) Value to set.static tools.jackson.core.type.TypeReference<CategorySetStoresAction>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.category.CategoryUpdateAction
getAction, withCategoryUpdateActionMethods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Field Details
-
SET_STORES
discriminator value for CategorySetStoresAction- See Also:
-
-
Method Details
-
getStores
Value to set. It replaces the entire set of Stores assigned to the Category.
If the
storesfield contains a Store that you do not have permission for, an InvalidInput error is returned.- Returns:
- stores
-
setStores
Value to set. It replaces the entire set of Stores assigned to the Category.
If the
storesfield contains a Store that you do not have permission for, an InvalidInput error is returned.- Parameters:
stores- values to be set
-
setStores
Value to set. It replaces the entire set of Stores assigned to the Category.
If the
storesfield 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
CategorySetStoresAction copyDeep()- Specified by:
copyDeepin interfaceCategoryUpdateAction
-
deepCopy
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
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-