Interface PriceImport
- All Superinterfaces:
ImportResource
Represents the data used to import an Embedded Price . Once imported, this data is persisted as a Price in a Product Variant.
Example to create an instance using the builder pattern
PriceImport priceImport = PriceImport.builder()
.key("{key}")
.value(valueBuilder -> valueBuilder)
.productVariant(productVariantBuilder -> productVariantBuilder)
.product(productBuilder -> productBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic PriceImportBuilder
builder()
builder factory method for PriceImportstatic PriceImportBuilder
builder
(PriceImport template) create builder for PriceImport instancecopyDeep()
static PriceImport
deepCopy
(PriceImport template) factory method to create a deep copy of PriceImport@Valid ChannelKeyReference
Maps toPrice.channel
.Maps toPrice.county
.@Valid Custom
Maps toPrice.custom
.@Valid CustomerGroupKeyReference
Maps toPrice.customerGroup
.@Valid DiscountedPrice
Sets a discounted price from an external service.@NotNull String
getKey()
User-defined unique identifier for the Embedded Price.@NotNull @Valid ProductKeyReference
The Product which contains theproductVariant
.@NotNull @Valid ProductVariantKeyReference
The ProductVariant which contains this Embedded Price.Set tofalse
to update both the current and staged projections of the Product with the new Price data. Leave empty or set totrue
to only update the staged projection.getTiers()
The tiered prices for this price.Maps toPrice.validFrom
.Maps toPrice.validUntil
.@NotNull @Valid TypedMoney
getValue()
Maps toPrice.value
.static PriceImport
of()
factory methodstatic PriceImport
of
(PriceImport template) factory method to create a shallow copy PriceImportvoid
setChannel
(ChannelKeyReference channel) Maps toPrice.channel
.void
setCountry
(String country) Maps toPrice.county
.void
Maps toPrice.custom
.void
setCustomerGroup
(CustomerGroupKeyReference customerGroup) Maps toPrice.customerGroup
.void
setDiscounted
(DiscountedPrice discounted) Sets a discounted price from an external service.void
User-defined unique identifier for the Embedded Price.void
setProduct
(ProductKeyReference product) The Product which contains theproductVariant
.void
setProductVariant
(ProductVariantKeyReference productVariant) The ProductVariant which contains this Embedded Price.void
Set tofalse
to update both the current and staged projections of the Product with the new Price data. Leave empty or set totrue
to only update the staged projection.void
The tiered prices for this price.void
The tiered prices for this price.void
setValidFrom
(ZonedDateTime validFrom) Maps toPrice.validFrom
.void
setValidUntil
(ZonedDateTime validUntil) Maps toPrice.validUntil
.void
setValue
(TypedMoney value) Maps toPrice.value
.static com.fasterxml.jackson.core.type.TypeReference<PriceImport>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withPriceImport
(Function<PriceImport, T> helper) accessor map functionMethods inherited from interface com.commercetools.importapi.models.common.ImportResource
withImportResource
-
Method Details
-
getKey
User-defined unique identifier for the Embedded Price. If a Price with this
key
exists on the specifiedproductVariant
, it is updated with the imported data.- Specified by:
getKey
in interfaceImportResource
- Returns:
- key
-
getValue
Maps to
Price.value
.- Returns:
- value
-
getCountry
String getCountry()Maps to
Price.county
.- Returns:
- country
-
getValidFrom
ZonedDateTime getValidFrom()Maps to
Price.validFrom
.- Returns:
- validFrom
-
getValidUntil
ZonedDateTime getValidUntil()Maps to
Price.validUntil
.- Returns:
- validUntil
-
getCustomerGroup
Maps to
Price.customerGroup
. If the referenced CustomerGroup does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CustomerGroup is created.- Returns:
- customerGroup
-
getChannel
Maps to
Price.channel
. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Returns:
- channel
-
getDiscounted
Sets a discounted price from an external service.
- Returns:
- discounted
-
getStaged
Boolean getStaged()- Set to
false
to update both the current and staged projections of the Product with the new Price data. - Leave empty or set to
true
to only update the staged projection.
- Returns:
- staged
- Set to
-
getTiers
The tiered prices for this price.
- Returns:
- tiers
-
getCustom
Maps to
Price.custom
.- Returns:
- custom
-
getProductVariant
The ProductVariant which contains this Embedded Price. If the referenced ProductVariant does not exist, the
state
of the ImportOperation will be set tounresolved
until the referenced ProductVariant is created.- Returns:
- productVariant
-
getProduct
The Product which contains the
productVariant
. If the referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Product is created.- Returns:
- product
-
setKey
User-defined unique identifier for the Embedded Price. If a Price with this
key
exists on the specifiedproductVariant
, it is updated with the imported data.- Specified by:
setKey
in interfaceImportResource
- Parameters:
key
- value to be set
-
setValue
Maps to
Price.value
.- Parameters:
value
- value to be set
-
setCountry
Maps to
Price.county
.- Parameters:
country
- value to be set
-
setValidFrom
Maps to
Price.validFrom
.- Parameters:
validFrom
- value to be set
-
setValidUntil
Maps to
Price.validUntil
.- Parameters:
validUntil
- value to be set
-
setCustomerGroup
Maps to
Price.customerGroup
. If the referenced CustomerGroup does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced CustomerGroup is created.- Parameters:
customerGroup
- value to be set
-
setChannel
Maps to
Price.channel
. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Parameters:
channel
- value to be set
-
setDiscounted
Sets a discounted price from an external service.
- Parameters:
discounted
- value to be set
-
setStaged
- Set to
false
to update both the current and staged projections of the Product with the new Price data. - Leave empty or set to
true
to only update the staged projection.
- Parameters:
staged
- value to be set
- Set to
-
setTiers
The tiered prices for this price.
- Parameters:
tiers
- values to be set
-
setTiers
The tiered prices for this price.
- Parameters:
tiers
- values to be set
-
setCustom
Maps to
Price.custom
.- Parameters:
custom
- value to be set
-
setProductVariant
The ProductVariant which contains this Embedded Price. If the referenced ProductVariant does not exist, the
state
of the ImportOperation will be set tounresolved
until the referenced ProductVariant is created.- Parameters:
productVariant
- value to be set
-
setProduct
The Product which contains the
productVariant
. If the referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Product is created.- Parameters:
product
- value to be set
-
of
factory method- Returns:
- instance of PriceImport
-
of
factory method to create a shallow copy PriceImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
copyDeep
PriceImport copyDeep()- Specified by:
copyDeep
in interfaceImportResource
-
deepCopy
factory method to create a deep copy of PriceImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for PriceImport- Returns:
- builder
-
builder
create builder for PriceImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withPriceImport
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
-