Interface ProductDraftImport
- All Superinterfaces:
ImportResource
The representation of a Product Draft for the import purpose.
Example to create an instance using the builder pattern
ProductDraftImport productDraftImport = ProductDraftImport.builder()
.key("{key}")
.productType(productTypeBuilder -> productTypeBuilder)
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductDraftImportBuilder
builder()
builder factory method for ProductDraftImportstatic ProductDraftImportBuilder
builder
(ProductDraftImport template) create builder for ProductDraftImport instancestatic ProductDraftImport
deepCopy
(ProductDraftImport template) factory method to create a deep copy of ProductDraftImport@Valid List<CategoryKeyReference>
The Reference to the Categories with which the ProductDraft is associated.@Valid LocalizedString
Maps toProduct.description
.@NotNull String
getKey()
User-defined unique identifier.@Valid ProductVariantDraftImport
The master Product variant.@Valid LocalizedString
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.@Valid LocalizedString
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.@Valid LocalizedString
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.@NotNull @Valid LocalizedString
getName()
Determines the type of Prices the API uses.@NotNull @Valid ProductTypeKeyReference
TheproductType
of a Product.Determines the published status and current/staged projection of the Product.@Valid SearchKeywords
Search keywords are primarily used by the suggester but are also considered for the full-text search.@NotNull @Valid LocalizedString
getSlug()
Human-readable identifiers usually used as deep-link URL to the related product.@Valid StateKeyReference
getState()
The Reference to the State with which the ProductDraft is associated.@Valid TaxCategoryKeyReference
The Reference to the TaxCategory with which the ProductDraft is associated.@Valid List<ProductVariantDraftImport>
An array of related Product Variants.static ProductDraftImport
of()
factory methodstatic ProductDraftImport
of
(ProductDraftImport template) factory method to create a shallow copy ProductDraftImportvoid
setCategories
(CategoryKeyReference... categories) The Reference to the Categories with which the ProductDraft is associated.void
setCategories
(List<CategoryKeyReference> categories) The Reference to the Categories with which the ProductDraft is associated.void
setDescription
(LocalizedString description) Maps toProduct.description
.void
User-defined unique identifier.void
setMasterVariant
(ProductVariantDraftImport masterVariant) The master Product variant.void
setMetaDescription
(LocalizedString metaDescription) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.void
setMetaKeywords
(LocalizedString metaKeywords) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.void
setMetaTitle
(LocalizedString metaTitle) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.void
setName
(LocalizedString name) set namevoid
setPriceMode
(ProductPriceModeEnum priceMode) Determines the type of Prices the API uses.void
setProductType
(ProductTypeKeyReference productType) TheproductType
of a Product.void
setPublish
(Boolean publish) Determines the published status and current/staged projection of the Product.void
setSearchKeywords
(SearchKeywords searchKeywords) Search keywords are primarily used by the suggester but are also considered for the full-text search.void
setSlug
(LocalizedString slug) Human-readable identifiers usually used as deep-link URL to the related product.void
setState
(StateKeyReference state) The Reference to the State with which the ProductDraft is associated.void
setTaxCategory
(TaxCategoryKeyReference taxCategory) The Reference to the TaxCategory with which the ProductDraft is associated.void
setVariants
(ProductVariantDraftImport... variants) An array of related Product Variants.void
setVariants
(List<ProductVariantDraftImport> variants) An array of related Product Variants.static com.fasterxml.jackson.core.type.TypeReference<ProductDraftImport>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withProductDraftImport
(Function<ProductDraftImport, T> helper) accessor map functionMethods inherited from interface com.commercetools.importapi.models.common.ImportResource
withImportResource
-
Method Details
-
getKey
User-defined unique identifier. If a Product with this
key
exists, it will be updated with the imported data.- Specified by:
getKey
in interfaceImportResource
- Returns:
- key
-
getProductType
The
productType
of a Product. Maps toProduct.productType
. The Reference to the ProductType with which the ProductDraft is associated. If referenced ProductType does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary ProductType is created.- Returns:
- productType
-
getName
- Returns:
- name
-
getSlug
Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a project, but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.
- Returns:
- slug
-
getDescription
Maps to
Product.description
.- Returns:
- description
-
getCategories
The Reference to the Categories with which the ProductDraft is associated. If referenced Categories do not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary Categories are created.- Returns:
- categories
-
getMetaTitle
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Returns:
- metaTitle
-
getMetaDescription
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Returns:
- metaDescription
-
getMetaKeywords
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Returns:
- metaKeywords
-
getMasterVariant
The master Product variant. Required if the
variants
array contains a Product Variant.- Returns:
- masterVariant
-
getVariants
An array of related Product Variants.
- Returns:
- variants
-
getTaxCategory
The Reference to the TaxCategory with which the ProductDraft is associated. If referenced TaxCategory does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary TaxCategory is created.- Returns:
- taxCategory
-
getSearchKeywords
Search keywords are primarily used by the suggester but are also considered for the full-text search. SearchKeywords is a JSON object where the keys are of IETF language tag. The value to a language tag key is an array of SearchKeyword for the specific language.
{ "en": [ { "text": "Multi tool" }, { "text": "Swiss Army Knife", "suggestTokenizer": { "type": "whitespace" } } ], "de": [ { "text": "Schweizer Messer", "suggestTokenizer": { "type": "custom", "inputs": ["schweizer messer", "offiziersmesser", "sackmesser"] } } ] }
- Returns:
- searchKeywords
-
getState
The Reference to the State with which the ProductDraft is associated. If referenced State does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary State is created.- Returns:
- state
-
getPublish
Boolean getPublish()Determines the published status and current/staged projection of the Product. For more information, see Managing the published state of Products.
- Returns:
- publish
-
getPriceMode
ProductPriceModeEnum getPriceMode()Determines the type of Prices the API uses. If not provided, the existing
Product.priceMode
is not changed.- Returns:
- priceMode
-
setKey
User-defined unique identifier. If a Product with this
key
exists, it will be updated with the imported data.- Specified by:
setKey
in interfaceImportResource
- Parameters:
key
- value to be set
-
setProductType
The
productType
of a Product. Maps toProduct.productType
. The Reference to the ProductType with which the ProductDraft is associated. If referenced ProductType does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary ProductType is created.- Parameters:
productType
- value to be set
-
setName
set name- Parameters:
name
- value to be set
-
setSlug
Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a project, but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.
- Parameters:
slug
- value to be set
-
setDescription
Maps to
Product.description
.- Parameters:
description
- value to be set
-
setCategories
The Reference to the Categories with which the ProductDraft is associated. If referenced Categories do not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary Categories are created.- Parameters:
categories
- values to be set
-
setCategories
The Reference to the Categories with which the ProductDraft is associated. If referenced Categories do not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary Categories are created.- Parameters:
categories
- values to be set
-
setMetaTitle
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Parameters:
metaTitle
- value to be set
-
setMetaDescription
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Parameters:
metaDescription
- value to be set
-
setMetaKeywords
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Parameters:
metaKeywords
- value to be set
-
setMasterVariant
The master Product variant. Required if the
variants
array contains a Product Variant.- Parameters:
masterVariant
- value to be set
-
setVariants
An array of related Product Variants.
- Parameters:
variants
- values to be set
-
setVariants
An array of related Product Variants.
- Parameters:
variants
- values to be set
-
setTaxCategory
The Reference to the TaxCategory with which the ProductDraft is associated. If referenced TaxCategory does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary TaxCategory is created.- Parameters:
taxCategory
- value to be set
-
setSearchKeywords
Search keywords are primarily used by the suggester but are also considered for the full-text search. SearchKeywords is a JSON object where the keys are of IETF language tag. The value to a language tag key is an array of SearchKeyword for the specific language.
{ "en": [ { "text": "Multi tool" }, { "text": "Swiss Army Knife", "suggestTokenizer": { "type": "whitespace" } } ], "de": [ { "text": "Schweizer Messer", "suggestTokenizer": { "type": "custom", "inputs": ["schweizer messer", "offiziersmesser", "sackmesser"] } } ] }
- Parameters:
searchKeywords
- value to be set
-
setState
The Reference to the State with which the ProductDraft is associated. If referenced State does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary State is created.- Parameters:
state
- value to be set
-
setPublish
Determines the published status and current/staged projection of the Product. For more information, see Managing the published state of Products.
- Parameters:
publish
- value to be set
-
setPriceMode
Determines the type of Prices the API uses. If not provided, the existing
Product.priceMode
is not changed.- Parameters:
priceMode
- value to be set
-
of
factory method- Returns:
- instance of ProductDraftImport
-
of
factory method to create a shallow copy ProductDraftImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ProductDraftImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductDraftImport- Returns:
- builder
-
builder
create builder for ProductDraftImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductDraftImport
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
-