Interface VariantImport
- All Superinterfaces:
ImportResource
Represents the data used to import a Variant. Once imported, this data is persisted as a Variant in the Project.
This import resource is only available for Projects with productCatalogModel set to Modular.
Example to create an instance using the builder pattern
VariantImport variantImport = VariantImport.builder()
.key("{key}")
.sku("{sku}")
.product(productBuilder -> productBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic VariantImportBuilderbuilder()builder factory method for VariantImportstatic VariantImportBuilderbuilder(VariantImport template) create builder for VariantImport instancecopyDeep()static VariantImportdeepCopy(VariantImport template) factory method to create a deep copy of VariantImportMaps toVariantData.assets.Maps toVariantData.attributes.Maps toVariantData.images.@NotNull StringgetKey()User-defined unique identifier.@NotNull @Valid ProductKeyReferenceMaps toVariant.product.Indicates whether the Variant is published.@NotNull StringgetSku()Maps toVariantData.sku.static VariantImportof()factory methodstatic VariantImportof(VariantImport template) factory method to create a shallow copy VariantImportvoidMaps toVariantData.assets.voidMaps toVariantData.assets.voidsetAttributes(Attribute... attributes) Maps toVariantData.attributes.voidsetAttributes(List<Attribute> attributes) Maps toVariantData.attributes.voidMaps toVariantData.images.voidMaps toVariantData.images.voidUser-defined unique identifier.voidsetProduct(ProductKeyReference product) Maps toVariant.product.voidsetPublish(Boolean publish) Indicates whether the Variant is published.voidMaps toVariantData.sku.static tools.jackson.core.type.TypeReference<VariantImport>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithVariantImport(Function<VariantImport, T> helper) accessor map functionMethods inherited from interface com.commercetools.importapi.models.common.ImportResource
withImportResource
-
Method Details
-
getKey
User-defined unique identifier. If a Variant with this
keyexists, it is updated with the imported data.- Specified by:
getKeyin interfaceImportResource- Returns:
- key
-
getSku
Maps to
VariantData.sku.- Returns:
- sku
-
getProduct
Maps to
Variant.product.- Returns:
- product
-
getPublish
Boolean getPublish()Indicates whether the Variant is published. If
true, the Variant is immediately available in the current published state. Maps toVariantDraft.publish.- Returns:
- publish
-
getImages
Maps to
VariantData.images.- Returns:
- images
-
getAttributes
Maps to
VariantData.attributes.- Returns:
- attributes
-
getAssets
Maps to
VariantData.assets.- Returns:
- assets
-
setKey
User-defined unique identifier. If a Variant with this
keyexists, it is updated with the imported data.- Specified by:
setKeyin interfaceImportResource- Parameters:
key- value to be set
-
setSku
Maps to
VariantData.sku.- Parameters:
sku- value to be set
-
setProduct
Maps to
Variant.product.- Parameters:
product- value to be set
-
setPublish
Indicates whether the Variant is published. If
true, the Variant is immediately available in the current published state. Maps toVariantDraft.publish.- Parameters:
publish- value to be set
-
setImages
Maps to
VariantData.images.- Parameters:
images- values to be set
-
setImages
Maps to
VariantData.images.- Parameters:
images- values to be set
-
setAttributes
Maps to
VariantData.attributes.- Parameters:
attributes- values to be set
-
setAttributes
Maps to
VariantData.attributes.- Parameters:
attributes- values to be set
-
setAssets
Maps to
VariantData.assets.- Parameters:
assets- values to be set
-
setAssets
Maps to
VariantData.assets.- Parameters:
assets- values to be set
-
of
factory method- Returns:
- instance of VariantImport
-
of
factory method to create a shallow copy VariantImport- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
VariantImport copyDeep()- Specified by:
copyDeepin interfaceImportResource
-
deepCopy
factory method to create a deep copy of VariantImport- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for VariantImport- Returns:
- builder
-
builder
create builder for VariantImport instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withVariantImport
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
-