Class ProductVariantPatchBuilder
- All Implemented Interfaces:
Builder<ProductVariantPatch>
Example to create an instance using the builder pattern
ProductVariantPatch productVariantPatch = ProductVariantPatch.builder()
.productVariant(productVariantBuilder -> productVariantBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionattributes
(Attributes attributes) Maps toProductVariant.attributes
.attributes
(Function<AttributesBuilder, AttributesBuilder> builder) Maps toProductVariant.attributes
.build()
builds ProductVariantPatch with checking for non-null required valuesbuilds ProductVariantPatch without checking for non-null required valuesMaps toProductVariant.attributes
.Reference to the Product which contains the ProductVariant.Reference to the ProductVariant to update.Iffalse
, the attribute changes are applied to both current and staged projected representations of the Product.static ProductVariantPatchBuilder
of()
factory method for an instance of ProductVariantPatchBuilderstatic ProductVariantPatchBuilder
of
(ProductVariantPatch template) create builder for ProductVariantPatch instanceproduct
(ProductKeyReference product) Reference to the Product which contains the ProductVariant.Reference to the Product which contains the ProductVariant.productVariant
(ProductVariantKeyReference productVariant) Reference to the ProductVariant to update.productVariant
(Function<ProductVariantKeyReferenceBuilder, ProductVariantKeyReferenceBuilder> builder) Reference to the ProductVariant to update.Iffalse
, the attribute changes are applied to both current and staged projected representations of the Product.withAttributes
(Function<AttributesBuilder, Attributes> builder) Maps toProductVariant.attributes
.Reference to the Product which contains the ProductVariant.Reference to the ProductVariant to update.
-
Constructor Details
-
ProductVariantPatchBuilder
public ProductVariantPatchBuilder()
-
-
Method Details
-
productVariant
public ProductVariantPatchBuilder productVariant(Function<ProductVariantKeyReferenceBuilder, ProductVariantKeyReferenceBuilder> builder) Reference to the ProductVariant to update. If the referenced ProductVariant does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary ProductVariant is created.- Parameters:
builder
- function to build the productVariant value- Returns:
- Builder
-
withProductVariant
public ProductVariantPatchBuilder withProductVariant(Function<ProductVariantKeyReferenceBuilder, ProductVariantKeyReference> builder) Reference to the ProductVariant to update. If the referenced ProductVariant does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary ProductVariant is created.- Parameters:
builder
- function to build the productVariant value- Returns:
- Builder
-
productVariant
Reference to the ProductVariant to update. If the referenced ProductVariant does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary ProductVariant is created.- Parameters:
productVariant
- value to be set- Returns:
- Builder
-
attributes
Maps to
ProductVariant.attributes
.- The referenced Attribute must be defined in an existing ProductType, or the
state
of the ImportOperation will bevalidationFailed
. - Setting the value of a non-required Attribute to
null
will remove the Attribute. - Attempting to set a
null
value 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 also delete localized fields by setting their value to
null
.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
- The referenced Attribute must be defined in an existing ProductType, or the
-
withAttributes
Maps to
ProductVariant.attributes
.- The referenced Attribute must be defined in an existing ProductType, or the
state
of the ImportOperation will bevalidationFailed
. - Setting the value of a non-required Attribute to
null
will remove the Attribute. - Attempting to set a
null
value 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 also delete localized fields by setting their value to
null
.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
- The referenced Attribute must be defined in an existing ProductType, or the
-
attributes
Maps to
ProductVariant.attributes
.- The referenced Attribute must be defined in an existing ProductType, or the
state
of the ImportOperation will bevalidationFailed
. - Setting the value of a non-required Attribute to
null
will remove the Attribute. - Attempting to set a
null
value 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 also delete localized fields by setting their value to
null
.
- Parameters:
attributes
- value to be set- Returns:
- Builder
- The referenced Attribute must be defined in an existing ProductType, or the
-
staged
If
false
, the attribute changes are applied to both current and staged projected representations of the Product.- Parameters:
staged
- value to be set- Returns:
- Builder
-
product
public ProductVariantPatchBuilder product(Function<ProductKeyReferenceBuilder, ProductKeyReferenceBuilder> builder) Reference to the Product which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.
- Parameters:
builder
- function to build the product value- Returns:
- Builder
-
withProduct
public ProductVariantPatchBuilder withProduct(Function<ProductKeyReferenceBuilder, ProductKeyReference> builder) Reference to the Product which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.
- Parameters:
builder
- function to build the product value- Returns:
- Builder
-
product
Reference to the Product which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.
- Parameters:
product
- value to be set- Returns:
- Builder
-
getProductVariant
Reference to the ProductVariant to update. If the referenced ProductVariant does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary ProductVariant is created.- Returns:
- productVariant
-
getAttributes
Maps to
ProductVariant.attributes
.- The referenced Attribute must be defined in an existing ProductType, or the
state
of the ImportOperation will bevalidationFailed
. - Setting the value of a non-required Attribute to
null
will remove the Attribute. - Attempting to set a
null
value 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 also delete localized fields by setting their value to
null
.
- Returns:
- attributes
- The referenced Attribute must be defined in an existing ProductType, or the
-
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 which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.
- Returns:
- product
-
build
builds ProductVariantPatch with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductVariantPatch>
- Returns:
- ProductVariantPatch
-
buildUnchecked
builds ProductVariantPatch without checking for non-null required values- Returns:
- ProductVariantPatch
-
of
factory method for an instance of ProductVariantPatchBuilder- Returns:
- builder
-
of
create builder for ProductVariantPatch instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-