Interface ProductSetAttributeAction
- All Superinterfaces:
ProductUpdateAction
,ResourceUpdateAction<ProductUpdateAction>
Either variantId
or sku
is required.
Example to create an instance using the builder pattern
ProductSetAttributeAction productSetAttributeAction = ProductSetAttributeAction.builder()
.name("{name}")
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for ProductSetAttributeAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for ProductSetAttributeActionbuilder
(ProductSetAttributeAction template) create builder for ProductSetAttributeAction instancestatic ProductSetAttributeAction
deepCopy
(ProductSetAttributeAction template) factory method to create a deep copy of ProductSetAttributeAction@NotNull String
getName()
The name of the Attribute to set.getSku()
Thesku
of the ProductVariant to update.Iftrue
, only the staged Attribute is set.getValue()
Value to set for the Attribute.Theid
of the ProductVariant to update.static ProductSetAttributeAction
of()
factory methodstatic ProductSetAttributeAction
of
(ProductSetAttributeAction template) factory method to create a shallow copy ProductSetAttributeActionstatic ProductSetAttributeAction
static ProductSetAttributeAction
ofUnsetAttribute
(Long variantId, String name) static ProductSetAttributeAction
ofUnsetAttribute
(Long variantId, String name, Boolean staged) static ProductSetAttributeAction
ofUnsetAttributeForSku
(String sku, String name) static ProductSetAttributeAction
ofUnsetAttributeForSku
(String sku, String name, Boolean staged) static ProductSetAttributeAction
ofUnsetAttributeForVariantId
(Long variantId, String name) static ProductSetAttributeAction
ofVariantId
(Long variantId, String name, JsonNode value, Boolean staged) void
The name of the Attribute to set.void
Thesku
of the ProductVariant to update.void
Iftrue
, only the staged Attribute is set.void
Value to set for the Attribute.void
setVariantId
(Long variantId) Theid
of the ProductVariant to update.static com.fasterxml.jackson.core.type.TypeReference<ProductSetAttributeAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.product.ProductUpdateAction
getAction, withProductUpdateAction
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Field Details
-
SET_ATTRIBUTE
discriminator value for ProductSetAttributeAction- See Also:
-
-
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
-
getName
The name of the Attribute to set.
- Returns:
- name
-
getValue
Object getValue()Value to set for the Attribute. If empty, any existing value will be removed.
The AttributeType determines the format of the Attribute
value
to be provided:- For Enum Type and Localized Enum Type, use the
key
of the Plain Enum Value or Localized Enum Value objects, or the complete objects asvalue
. - For Localizable Text Type, use the LocalizedString object as
value
. - For Money Type Attributes, use the Money object as
value
. - For Set Type Attributes, use the entire
set
object asvalue
. - For Nested Type Attributes, use the list of values of all Attributes of the nested Product as
value
. - For Reference Type Attributes, use the Reference object as
value
.
- Returns:
- value
- For Enum Type and Localized Enum Type, use the
-
getStaged
Boolean getStaged()If
true
, only the staged Attribute is set. Iffalse
, both current and staged Attribute is set.- Returns:
- staged
-
setVariantId
The
id
of the ProductVariant to update.- Parameters:
variantId
- value to be set
-
setSku
The
sku
of the ProductVariant to update.- Parameters:
sku
- value to be set
-
setName
The name of the Attribute to set.
- Parameters:
name
- value to be set
-
setValue
Value to set for the Attribute. If empty, any existing value will be removed.
The AttributeType determines the format of the Attribute
value
to be provided:- For Enum Type and Localized Enum Type, use the
key
of the Plain Enum Value or Localized Enum Value objects, or the complete objects asvalue
. - For Localizable Text Type, use the LocalizedString object as
value
. - For Money Type Attributes, use the Money object as
value
. - For Set Type Attributes, use the entire
set
object asvalue
. - For Nested Type Attributes, use the list of values of all Attributes of the nested Product as
value
. - For Reference Type Attributes, use the Reference object as
value
.
- Parameters:
value
- value to be set
- For Enum Type and Localized Enum Type, use the
-
setStaged
If
true
, only the staged Attribute is set. Iffalse
, both current and staged Attribute is set.- Parameters:
staged
- value to be set
-
of
factory method- Returns:
- instance of ProductSetAttributeAction
-
of
factory method to create a shallow copy ProductSetAttributeAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ProductSetAttributeAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductSetAttributeAction- Returns:
- builder
-
builder
create builder for ProductSetAttributeAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductSetAttributeAction
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
ofVariantId
static ProductSetAttributeAction ofVariantId(Long variantId, String name, JsonNode value, Boolean staged) -
ofSku
-
ofUnsetAttribute
-
ofUnsetAttribute
-
ofUnsetAttributeForVariantId
-
ofUnsetAttributeForSku
-
ofUnsetAttributeForSku
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-