Class ProductVariantImportBuilder
- All Implemented Interfaces:
Builder<ProductVariantImport>
Example to create an instance using the builder pattern
ProductVariantImport productVariantImport = ProductVariantImport.builder()
.key("{key}")
.isMasterVariant(true)
.product(productBuilder -> productBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAssets
(Function<AssetBuilder, Asset> builder) Maps toProductVariant.assets
.addImages
(Function<ImageBuilder, Image> builder) Maps toProductVariant.images
.Maps toProductVariant.assets
.Maps toProductVariant.assets
.attributes
(Attribute... attributes) Maps toProductVariant.attributes
.attributes
(List<Attribute> attributes) Maps toProductVariant.attributes
.build()
builds ProductVariantImport with checking for non-null required valuesbuilds ProductVariantImport without checking for non-null required valuesMaps toProductVariant.assets
.Maps toProductVariant.attributes
.Maps toProductVariant.images
.When creating a new ProductVariant, set tofalse
; otherwise, the import operation will fail with a NewMasterVariantAdditionNotAllowed error. Set totrue
if the ProductVariant exists and you want to set this ProductVariant as the Master Variant.getKey()
User-defined unique identifier.The Product to which this Product Variant belongs.getSku()
Maps toProductVariant.sku
.Set tofalse
to update both the current and staged projections of the Product with the new Product Variant data. Leave empty or set totrue
to only update the staged projection.Maps toProductVariant.images
.Maps toProductVariant.images
.isMasterVariant
(Boolean isMasterVariant) When creating a new ProductVariant, set tofalse
; otherwise, the import operation will fail with a NewMasterVariantAdditionNotAllowed error. Set totrue
if the ProductVariant exists and you want to set this ProductVariant as the Master Variant.User-defined unique identifier.static ProductVariantImportBuilder
of()
factory method for an instance of ProductVariantImportBuilderstatic ProductVariantImportBuilder
of
(ProductVariantImport template) create builder for ProductVariantImport instanceplusAssets
(Asset... assets) Maps toProductVariant.assets
.plusAssets
(Function<AssetBuilder, AssetBuilder> builder) Maps toProductVariant.assets
.plusAttributes
(Attribute... attributes) Maps toProductVariant.attributes
.plusAttributes
(Function<AttributeBuilder, Builder<? extends Attribute>> builder) Maps toProductVariant.attributes
.plusImages
(Image... images) Maps toProductVariant.images
.plusImages
(Function<ImageBuilder, ImageBuilder> builder) Maps toProductVariant.images
.product
(ProductKeyReference product) The Product to which this Product Variant belongs.The Product to which this Product Variant belongs.setAssets
(Function<AssetBuilder, Asset> builder) Maps toProductVariant.assets
.setImages
(Function<ImageBuilder, Image> builder) Maps toProductVariant.images
.Maps toProductVariant.sku
.Set tofalse
to update both the current and staged projections of the Product with the new Product Variant data. Leave empty or set totrue
to only update the staged projection.withAssets
(Function<AssetBuilder, AssetBuilder> builder) Maps toProductVariant.assets
.withAttributes
(Function<AttributeBuilder, Builder<? extends Attribute>> builder) Maps toProductVariant.attributes
.withImages
(Function<ImageBuilder, ImageBuilder> builder) Maps toProductVariant.images
.The Product to which this Product Variant belongs.
-
Constructor Details
-
ProductVariantImportBuilder
public ProductVariantImportBuilder()
-
-
Method Details
-
key
User-defined unique identifier. If a ProductVariant with this
key
exists on the specifiedproduct
, it will be updated with the imported data.- Parameters:
key
- value to be set- Returns:
- Builder
-
sku
Maps to
ProductVariant.sku
.- Parameters:
sku
- value to be set- Returns:
- Builder
-
isMasterVariant
- When creating a new ProductVariant, set to
false
; otherwise, the import operation will fail with a NewMasterVariantAdditionNotAllowed error. - Set to
true
if the ProductVariant exists and you want to set this ProductVariant as the Master Variant.
- Parameters:
isMasterVariant
- value to be set- Returns:
- Builder
- When creating a new ProductVariant, set to
-
attributes
Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Parameters:
attributes
- value to be set- Returns:
- Builder
-
attributes
Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Parameters:
attributes
- value to be set- Returns:
- Builder
-
plusAttributes
Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Parameters:
attributes
- value to be set- Returns:
- Builder
-
plusAttributes
public ProductVariantImportBuilder plusAttributes(Function<AttributeBuilder, Builder<? extends Attribute>> builder) Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
withAttributes
public ProductVariantImportBuilder withAttributes(Function<AttributeBuilder, Builder<? extends Attribute>> builder) Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
images
Maps to
ProductVariant.images
.- Parameters:
images
- value to be set- Returns:
- Builder
-
images
Maps to
ProductVariant.images
.- Parameters:
images
- value to be set- Returns:
- Builder
-
plusImages
Maps to
ProductVariant.images
.- Parameters:
images
- value to be set- Returns:
- Builder
-
plusImages
Maps to
ProductVariant.images
.- Parameters:
builder
- function to build the images value- Returns:
- Builder
-
withImages
Maps to
ProductVariant.images
.- Parameters:
builder
- function to build the images value- Returns:
- Builder
-
addImages
Maps to
ProductVariant.images
.- Parameters:
builder
- function to build the images value- Returns:
- Builder
-
setImages
Maps to
ProductVariant.images
.- Parameters:
builder
- function to build the images value- Returns:
- Builder
-
assets
Maps to
ProductVariant.assets
.- Parameters:
assets
- value to be set- Returns:
- Builder
-
assets
Maps to
ProductVariant.assets
.- Parameters:
assets
- value to be set- Returns:
- Builder
-
plusAssets
Maps to
ProductVariant.assets
.- Parameters:
assets
- value to be set- Returns:
- Builder
-
plusAssets
Maps to
ProductVariant.assets
.- Parameters:
builder
- function to build the assets value- Returns:
- Builder
-
withAssets
Maps to
ProductVariant.assets
.- Parameters:
builder
- function to build the assets value- Returns:
- Builder
-
addAssets
Maps to
ProductVariant.assets
.- Parameters:
builder
- function to build the assets value- Returns:
- Builder
-
setAssets
Maps to
ProductVariant.assets
.- Parameters:
builder
- function to build the assets value- Returns:
- Builder
-
staged
- Set to
false
to update both the current and staged projections of the Product with the new Product Variant data. - Leave empty or set to
true
to only update the staged projection.
- Parameters:
staged
- value to be set- Returns:
- Builder
- Set to
-
product
public ProductVariantImportBuilder product(Function<ProductKeyReferenceBuilder, ProductKeyReferenceBuilder> builder) The Product to which this Product Variant belongs. Maps to
ProductVariant.product
. The Reference to the Product with which the ProductVariant is associated. If referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Product is created.- Parameters:
builder
- function to build the product value- Returns:
- Builder
-
withProduct
public ProductVariantImportBuilder withProduct(Function<ProductKeyReferenceBuilder, ProductKeyReference> builder) The Product to which this Product Variant belongs. Maps to
ProductVariant.product
. The Reference to the Product with which the ProductVariant is associated. If referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Product is created.- Parameters:
builder
- function to build the product value- Returns:
- Builder
-
product
The Product to which this Product Variant belongs. Maps to
ProductVariant.product
. The Reference to the Product with which the ProductVariant is associated. If referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Product is created.- Parameters:
product
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier. If a ProductVariant with this
key
exists on the specifiedproduct
, it will be updated with the imported data.- Returns:
- key
-
getSku
Maps to
ProductVariant.sku
.- Returns:
- sku
-
getIsMasterVariant
- When creating a new ProductVariant, set to
false
; otherwise, the import operation will fail with a NewMasterVariantAdditionNotAllowed error. - Set to
true
if the ProductVariant exists and you want to set this ProductVariant as the Master Variant.
- Returns:
- isMasterVariant
- When creating a new ProductVariant, set to
-
getAttributes
Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Returns:
- attributes
-
getImages
Maps to
ProductVariant.images
.- Returns:
- images
-
getAssets
Maps to
ProductVariant.assets
.- Returns:
- assets
-
getStaged
- Set to
false
to update both the current and staged projections of the Product with the new Product Variant data. - Leave empty or set to
true
to only update the staged projection.
- Returns:
- staged
- Set to
-
getProduct
The Product to which this Product Variant belongs. Maps to
ProductVariant.product
. The Reference to the Product with which the ProductVariant is associated. If referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Product is created.- Returns:
- product
-
build
builds ProductVariantImport with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductVariantImport>
- Returns:
- ProductVariantImport
-
buildUnchecked
builds ProductVariantImport without checking for non-null required values- Returns:
- ProductVariantImport
-
of
factory method for an instance of ProductVariantImportBuilder- Returns:
- builder
-
of
create builder for ProductVariantImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-