Class PriceImportBuilder
- All Implemented Interfaces:
Builder<PriceImport>
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()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTiers
(Function<PriceTierBuilder, PriceTier> builder) The tiered prices for this price.build()
builds PriceImport with checking for non-null required valuesbuilds PriceImport without checking for non-null required valueschannel
(ChannelKeyReference channel) Maps toPrice.channel
.Maps toPrice.channel
.Maps toPrice.county
.Maps toPrice.custom
.custom
(Function<CustomBuilder, CustomBuilder> builder) Maps toPrice.custom
.customerGroup
(CustomerGroupKeyReference customerGroup) Maps toPrice.customerGroup
.Maps toPrice.customerGroup
.discounted
(DiscountedPrice discounted) Sets a discounted price from an external service.Sets a discounted price from an external service.Maps toPrice.channel
.Maps toPrice.county
.Maps toPrice.custom
.Maps toPrice.customerGroup
.Sets a discounted price from an external service.getKey()
User-defined unique identifier for the Embedded Price.The Product which contains theproductVariant
.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
.getValue()
Maps toPrice.value
.User-defined unique identifier for the Embedded Price.static PriceImportBuilder
of()
factory method for an instance of PriceImportBuilderstatic PriceImportBuilder
of
(PriceImport template) create builder for PriceImport instanceThe tiered prices for this price.plusTiers
(Function<PriceTierBuilder, PriceTierBuilder> builder) The tiered prices for this price.product
(ProductKeyReference product) The Product which contains theproductVariant
.The Product which contains theproductVariant
.productVariant
(ProductVariantKeyReference productVariant) The ProductVariant which contains this Embedded Price.productVariant
(Function<ProductVariantKeyReferenceBuilder, ProductVariantKeyReferenceBuilder> builder) The ProductVariant which contains this Embedded Price.setTiers
(Function<PriceTierBuilder, PriceTier> builder) The tiered prices for this 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.The tiered prices for this price.The tiered prices for this price.validFrom
(ZonedDateTime validFrom) Maps toPrice.validFrom
.validUntil
(ZonedDateTime validUntil) Maps toPrice.validUntil
.value
(TypedMoney value) Maps toPrice.value
.value
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Maps toPrice.value
.Maps toPrice.channel
.withCustom
(Function<CustomBuilder, Custom> builder) Maps toPrice.custom
.Maps toPrice.customerGroup
.Sets a discounted price from an external service.The Product which contains theproductVariant
.The ProductVariant which contains this Embedded Price.withTiers
(Function<PriceTierBuilder, PriceTierBuilder> builder) The tiered prices for this price.
-
Constructor Details
-
PriceImportBuilder
public PriceImportBuilder()
-
-
Method Details
-
key
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.- Parameters:
key
- value to be set- Returns:
- Builder
-
value
Maps to
Price.value
.- Parameters:
value
- value to be set- Returns:
- Builder
-
value
Maps to
Price.value
.- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
country
Maps to
Price.county
.- Parameters:
country
- value to be set- Returns:
- Builder
-
validFrom
Maps to
Price.validFrom
.- Parameters:
validFrom
- value to be set- Returns:
- Builder
-
validUntil
Maps to
Price.validUntil
.- Parameters:
validUntil
- value to be set- Returns:
- Builder
-
customerGroup
public PriceImportBuilder customerGroup(Function<CustomerGroupKeyReferenceBuilder, CustomerGroupKeyReferenceBuilder> builder) 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:
builder
- function to build the customerGroup value- Returns:
- Builder
-
withCustomerGroup
public PriceImportBuilder withCustomerGroup(Function<CustomerGroupKeyReferenceBuilder, CustomerGroupKeyReference> builder) 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:
builder
- function to build the customerGroup value- Returns:
- Builder
-
customerGroup
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- Returns:
- Builder
-
channel
public PriceImportBuilder channel(Function<ChannelKeyReferenceBuilder, ChannelKeyReferenceBuilder> builder) 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:
builder
- function to build the channel value- Returns:
- Builder
-
withChannel
public PriceImportBuilder withChannel(Function<ChannelKeyReferenceBuilder, ChannelKeyReference> builder) 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:
builder
- function to build the channel value- Returns:
- Builder
-
channel
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- Returns:
- Builder
-
discounted
public PriceImportBuilder discounted(Function<DiscountedPriceBuilder, DiscountedPriceBuilder> builder) Sets a discounted price from an external service.
- Parameters:
builder
- function to build the discounted value- Returns:
- Builder
-
withDiscounted
Sets a discounted price from an external service.
- Parameters:
builder
- function to build the discounted value- Returns:
- Builder
-
discounted
Sets a discounted price from an external service.
- Parameters:
discounted
- value to be set- Returns:
- Builder
-
staged
- 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- Returns:
- Builder
- Set to
-
tiers
The tiered prices for this price.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
tiers
The tiered prices for this price.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
The tiered prices for this price.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
The tiered prices for this price.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
withTiers
The tiered prices for this price.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
addTiers
The tiered prices for this price.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
setTiers
The tiered prices for this price.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
custom
Maps to
Price.custom
.- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Maps to
Price.custom
.- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Maps to
Price.custom
.- Parameters:
custom
- value to be set- Returns:
- Builder
-
productVariant
public PriceImportBuilder productVariant(Function<ProductVariantKeyReferenceBuilder, ProductVariantKeyReferenceBuilder> builder) 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:
builder
- function to build the productVariant value- Returns:
- Builder
-
withProductVariant
public PriceImportBuilder withProductVariant(Function<ProductVariantKeyReferenceBuilder, ProductVariantKeyReference> builder) 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:
builder
- function to build the productVariant value- Returns:
- Builder
-
productVariant
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- Returns:
- Builder
-
product
public PriceImportBuilder product(Function<ProductKeyReferenceBuilder, ProductKeyReferenceBuilder> builder) 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:
builder
- function to build the product value- Returns:
- Builder
-
withProduct
public PriceImportBuilder withProduct(Function<ProductKeyReferenceBuilder, ProductKeyReference> builder) 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:
builder
- function to build the product value- Returns:
- Builder
-
product
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- Returns:
- Builder
-
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.- Returns:
- key
-
getValue
Maps to
Price.value
.- Returns:
- value
-
getCountry
Maps to
Price.county
.- Returns:
- country
-
getValidFrom
Maps to
Price.validFrom
.- Returns:
- validFrom
-
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
- 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
-
build
builds PriceImport with checking for non-null required values- Specified by:
build
in interfaceBuilder<PriceImport>
- Returns:
- PriceImport
-
buildUnchecked
builds PriceImport without checking for non-null required values- Returns:
- PriceImport
-
of
factory method for an instance of PriceImportBuilder- Returns:
- builder
-
of
create builder for PriceImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-