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
Constructors -
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 totrueif the ProductVariant exists and you want to set this ProductVariant as the Master Variant.getKey()User-defined unique identifier.The Product containing this ProductVariant.getSku()Maps toProductVariant.sku.Set tofalseto update both the current and staged projections of the Product with the new Product Variant data. Leave empty or set totrueto 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 totrueif the ProductVariant exists and you want to set this ProductVariant as the Master Variant.User-defined unique identifier.static ProductVariantImportBuilderof()factory method for an instance of ProductVariantImportBuilderstatic ProductVariantImportBuilderof(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 containing this ProductVariant.The Product containing this ProductVariant.setAssets(Function<AssetBuilder, Asset> builder) Maps toProductVariant.assets.setImages(Function<ImageBuilder, Image> builder) Maps toProductVariant.images.Maps toProductVariant.sku.Set tofalseto update both the current and staged projections of the Product with the new Product Variant data. Leave empty or set totrueto 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 containing this ProductVariant.
-
Constructor Details
-
ProductVariantImportBuilder
public ProductVariantImportBuilder()
-
-
Method Details
-
key
User-defined unique identifier. If a ProductVariant with this
keyexists on the specifiedproduct, it is 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
trueif 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 thestateof 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 thestateof 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 thestateof 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 thestateof 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 thestateof 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
falseto update both the current and staged projections of the Product with the new Product Variant data. - Leave empty or set to
trueto 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 containing this ProductVariant. If the referenced Product does not exist, the
stateof the ImportOperation will be set tounresolveduntil the referenced Product is created.- Parameters:
builder- function to build the product value- Returns:
- Builder
-
withProduct
public ProductVariantImportBuilder withProduct(Function<ProductKeyReferenceBuilder, ProductKeyReference> builder) The Product containing this ProductVariant. If the referenced Product does not exist, the
stateof the ImportOperation will be set tounresolveduntil the referenced Product is created.- Parameters:
builder- function to build the product value- Returns:
- Builder
-
product
The Product containing this ProductVariant. 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- Returns:
- Builder
-
getKey
User-defined unique identifier. If a ProductVariant with this
keyexists on the specifiedproduct, it is 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
trueif 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 thestateof the ImportOperation will beunresolved.- Returns:
- attributes
-
getImages
Maps to
ProductVariant.images.- Returns:
- images
-
getAssets
Maps to
ProductVariant.assets.- Returns:
- assets
-
getStaged
- Set to
falseto update both the current and staged projections of the Product with the new Product Variant data. - Leave empty or set to
trueto only update the staged projection.
- Returns:
- staged
- Set to
-
getProduct
The Product containing this ProductVariant. If the referenced Product does not exist, the
stateof the ImportOperation will be set tounresolveduntil the referenced Product is created.- Returns:
- product
-
build
builds ProductVariantImport with checking for non-null required values- Specified by:
buildin 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
-