Interface ProductVariantPatch
Represents the data used to update a ProductVariant.
Example to create an instance using the builder pattern
ProductVariantPatch productVariantPatch = ProductVariantPatch.builder()
.productVariant(productVariantBuilder -> productVariantBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductVariantPatchBuilderbuilder()builder factory method for ProductVariantPatchstatic ProductVariantPatchBuilderbuilder(ProductVariantPatch template) create builder for ProductVariantPatch instancecopyDeep()static ProductVariantPatchdeepCopy(ProductVariantPatch template) factory method to create a deep copy of ProductVariantPatch@Valid AttributesMaps toProductVariant.attributes.@Valid ProductKeyReferenceReference to the Product that contains the ProductVariant.@NotNull @Valid ProductVariantKeyReferenceReference to the ProductVariant to update.Iffalse, the attribute changes are applied to both current and staged projected representations of the Product.static ProductVariantPatchof()factory methodstatic ProductVariantPatchof(ProductVariantPatch template) factory method to create a shallow copy ProductVariantPatchvoidsetAttributes(Attributes attributes) Maps toProductVariant.attributes.voidsetProduct(ProductKeyReference product) Reference to the Product that contains the ProductVariant.voidsetProductVariant(ProductVariantKeyReference productVariant) Reference to the ProductVariant to update.voidIffalse, the attribute changes are applied to both current and staged projected representations of the Product.static com.fasterxml.jackson.core.type.TypeReference<ProductVariantPatch>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithProductVariantPatch(Function<ProductVariantPatch, T> helper) accessor map function
-
Method Details
-
getProductVariant
Reference to the ProductVariant to update.
- Returns:
- productVariant
-
getAttributes
Maps to
ProductVariant.attributes.- The referenced Attribute must be defined in an existing ProductType, or the
stateof the ImportOperation will bevalidationFailed. - Setting the value of a non-required Attribute to
nullwill remove the Attribute. - Attempting to set a
nullvalue to a required Attribute will make the import operation fail with an InvalidOperation error. - Importing LocalizableTextAttributes or LocalizableTextSetAttributes follows an override pattern, meaning that omitted localized fields will be deleted, new fields will be created, and existing fields will be updated. You can delete localized fields by setting their value to
null.
- Returns:
- attributes
- The referenced Attribute must be defined in an existing ProductType, or the
-
getStaged
Boolean getStaged()If
false, the attribute changes are applied to both current and staged projected representations of the Product.- Returns:
- staged
-
getProduct
Reference to the Product that contains the ProductVariant.
We recommend to set this value to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.
If the referenced Product does not exist, the
stateof the ImportOperation will be set tounresolveduntil the referenced Product is created.- Returns:
- product
-
setProductVariant
Reference to the ProductVariant to update.
- Parameters:
productVariant- value to be set
-
setAttributes
Maps to
ProductVariant.attributes.- The referenced Attribute must be defined in an existing ProductType, or the
stateof the ImportOperation will bevalidationFailed. - Setting the value of a non-required Attribute to
nullwill remove the Attribute. - Attempting to set a
nullvalue to a required Attribute will make the import operation fail with an InvalidOperation error. - Importing LocalizableTextAttributes or LocalizableTextSetAttributes follows an override pattern, meaning that omitted localized fields will be deleted, new fields will be created, and existing fields will be updated. You can delete localized fields by setting their value to
null.
- Parameters:
attributes- value to be set
- The referenced Attribute must be defined in an existing ProductType, or the
-
setStaged
If
false, the attribute changes are applied to both current and staged projected representations of the Product.- Parameters:
staged- value to be set
-
setProduct
Reference to the Product that contains the ProductVariant.
We recommend to set this value to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.
If the referenced Product does not exist, the
stateof the ImportOperation will be set tounresolveduntil the referenced Product is created.- Parameters:
product- value to be set
-
of
factory method- Returns:
- instance of ProductVariantPatch
-
of
factory method to create a shallow copy ProductVariantPatch- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ProductVariantPatch copyDeep() -
deepCopy
factory method to create a deep copy of ProductVariantPatch- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductVariantPatch- Returns:
- builder
-
builder
create builder for ProductVariantPatch instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withProductVariantPatch
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
-