Interface PriceImport
- All Superinterfaces:
ImportResource
The data representation for a price to be imported that is persisted as a Price in the Project.
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 instancestatic PriceImport
deepCopy
(PriceImport template) factory method to create a deep copy of PriceImport@Valid ChannelKeyReference
The Reference to the Channel with which the Price is associated.Maps toPrice.county
.@Valid Custom
The custom fields for this price.@Valid CustomerGroupKeyReference
The Reference to the CustomerGroup with which the Price is associated.@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 in which the Product Variant containing this Embedded Price is contained.@NotNull @Valid ProductVariantKeyReference
The ProductVariant in which this Embedded Price is contained.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) The Reference to the Channel with which the Price is associated.void
setCountry
(String country) Maps toPrice.county
.void
The custom fields for this price.void
setCustomerGroup
(CustomerGroupKeyReference customerGroup) The Reference to the CustomerGroup with which the Price is associated.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 in which the Product Variant containing this Embedded Price is contained.void
setProductVariant
(ProductVariantKeyReference productVariant) The ProductVariant in which this Embedded Price is contained.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 will be 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
The Reference to the CustomerGroup with which the Price is associated. If referenced CustomerGroup does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary CustomerGroup is created.- Returns:
- customerGroup
-
getChannel
The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary 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
The custom fields for this price.
- Returns:
- custom
-
getProductVariant
The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If the referenced ProductVariant does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary ProductVariant is created.- Returns:
- productVariant
-
getProduct
The Product in which the Product Variant containing this Embedded Price is contained. Maps to
ProductVariant.product
. The Reference to the Product with which the Price is associated. If referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary 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 will be 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
The Reference to the CustomerGroup with which the Price is associated. If referenced CustomerGroup does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary CustomerGroup is created.- Parameters:
customerGroup
- value to be set
-
setChannel
The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary 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
The custom fields for this price.
- Parameters:
custom
- value to be set
-
setProductVariant
The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If the referenced ProductVariant does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary ProductVariant is created.- Parameters:
productVariant
- value to be set
-
setProduct
The Product in which the Product Variant containing this Embedded Price is contained. Maps to
ProductVariant.product
. The Reference to the Product with which the Price 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
-
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
-
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
-