Class CartAddLineItemActionBuilder
- All Implemented Interfaces:
Builder<CartAddLineItemAction>
Example to create an instance using the builder pattern
CartAddLineItemAction cartAddLineItemAction = CartAddLineItemAction.builder()
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddedAt(ZonedDateTime addedAt) Date and time (UTC) the Product Variant is added to the Cart.addPerMethodExternalTaxRate(Function<MethodExternalTaxRateDraftBuilder, MethodExternalTaxRateDraft> builder) Sets the external Tax Rates for individual Shipping Methods, if the Cart has theExternalTaxMode andMultipleShippingMode.build()builds CartAddLineItemAction with checking for non-null required valuesbuilds CartAddLineItemAction without checking for non-null required valuescustom(CustomFieldsDraft custom) Custom Fields for the Line Item.Custom Fields for the Line Item.distributionChannel(ChannelResourceIdentifier distributionChannel) Used to select a Product Price.distributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Used to select a Product Price.externalPrice(Money externalPrice) externalPrice(Function<MoneyBuilder, MoneyBuilder> builder) externalTaxRate(ExternalTaxRateDraft externalTaxRate) Sets the external Tax Rate for the Line Item, if the Cart has theExternalTaxMode andSingleShippingMode.Sets the external Tax Rate for the Line Item, if the Cart has theExternalTaxMode andSingleShippingMode.externalTotalPrice(ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItempriceandtotalPricevalues, and thepriceModetoExternalTotalLineItemPriceMode.externalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPriceBuilder> builder) Sets the LineItempriceandtotalPricevalues, and thepriceModetoExternalTotalLineItemPriceMode.Date and time (UTC) the Product Variant is added to the Cart.Custom Fields for the Line Item.Used to select a Product Price.Sets the external Tax Rate for the Line Item, if the Cart has theExternalTaxMode andSingleShippingMode.Sets the LineItempriceandtotalPricevalues, and thepriceModetoExternalTotalLineItemPriceMode.Inventory mode specific to the Line Item only, and valid for the entirequantityof the Line Item.getKey()User-defined unique identifier of the LineItem.Sets the external Tax Rates for individual Shipping Methods, if the Cart has theExternalTaxMode andMultipleShippingMode.idof the published Product.Quantity of the Product Variant to add to the Cart.Recurring Order and frequency data.Container for Line Item-specific addresses.getSku()SKU of the ProductVariant.Used to identify Inventory entries that must be reserved.idof the ProductVariant in the Product.inventoryMode(InventoryMode inventoryMode) Inventory mode specific to the Line Item only, and valid for the entirequantityof the Line Item.User-defined unique identifier of the LineItem.static CartAddLineItemActionBuilderof()factory method for an instance of CartAddLineItemActionBuilderstatic CartAddLineItemActionBuilderof(CartAddLineItemAction template) create builder for CartAddLineItemAction instanceperMethodExternalTaxRate(MethodExternalTaxRateDraft... perMethodExternalTaxRate) Sets the external Tax Rates for individual Shipping Methods, if the Cart has theExternalTaxMode andMultipleShippingMode.perMethodExternalTaxRate(List<MethodExternalTaxRateDraft> perMethodExternalTaxRate) Sets the external Tax Rates for individual Shipping Methods, if the Cart has theExternalTaxMode andMultipleShippingMode.plusPerMethodExternalTaxRate(MethodExternalTaxRateDraft... perMethodExternalTaxRate) Sets the external Tax Rates for individual Shipping Methods, if the Cart has theExternalTaxMode andMultipleShippingMode.plusPerMethodExternalTaxRate(Function<MethodExternalTaxRateDraftBuilder, MethodExternalTaxRateDraftBuilder> builder) Sets the external Tax Rates for individual Shipping Methods, if the Cart has theExternalTaxMode andMultipleShippingMode.idof the published Product.Quantity of the Product Variant to add to the Cart.recurrenceInfo(LineItemRecurrenceInfoDraft recurrenceInfo) Recurring Order and frequency data.recurrenceInfo(Function<LineItemRecurrenceInfoDraftBuilder, LineItemRecurrenceInfoDraftBuilder> builder) Recurring Order and frequency data.setPerMethodExternalTaxRate(Function<MethodExternalTaxRateDraftBuilder, MethodExternalTaxRateDraft> builder) Sets the external Tax Rates for individual Shipping Methods, if the Cart has theExternalTaxMode andMultipleShippingMode.shippingDetails(ItemShippingDetailsDraft shippingDetails) Container for Line Item-specific addresses.Container for Line Item-specific addresses.SKU of the ProductVariant.supplyChannel(ChannelResourceIdentifier supplyChannel) Used to identify Inventory entries that must be reserved.Used to identify Inventory entries that must be reserved.idof the ProductVariant in the Product.Custom Fields for the Line Item.withDistributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Used to select a Product Price.withExternalPrice(Function<MoneyBuilder, Money> builder) Sets the external Tax Rate for the Line Item, if the Cart has theExternalTaxMode andSingleShippingMode.withExternalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPrice> builder) Sets the LineItempriceandtotalPricevalues, and thepriceModetoExternalTotalLineItemPriceMode.withPerMethodExternalTaxRate(Function<MethodExternalTaxRateDraftBuilder, MethodExternalTaxRateDraftBuilder> builder) Sets the external Tax Rates for individual Shipping Methods, if the Cart has theExternalTaxMode andMultipleShippingMode.withRecurrenceInfo(Function<LineItemRecurrenceInfoDraftBuilder, LineItemRecurrenceInfoDraft> builder) Recurring Order and frequency data.Container for Line Item-specific addresses.Used to identify Inventory entries that must be reserved.
-
Constructor Details
-
CartAddLineItemActionBuilder
public CartAddLineItemActionBuilder()
-
-
Method Details
-
key
User-defined unique identifier of the LineItem.
- Parameters:
key- value to be set- Returns:
- Builder
-
productId
idof the published Product.Either the
productIdandvariantId, orskumust be provided.- Parameters:
productId- value to be set- Returns:
- Builder
-
variantId
idof the ProductVariant in the Product. If not provided, the Master Variant is used.Either the
productIdandvariantId, orskumust be provided.- Parameters:
variantId- value to be set- Returns:
- Builder
-
sku
SKU of the ProductVariant.
Either the
productIdandvariantId, orskumust be provided.- Parameters:
sku- value to be set- Returns:
- Builder
-
quantity
Quantity of the Product Variant to add to the Cart.
- Parameters:
quantity- value to be set- Returns:
- Builder
-
addedAt
Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.
Optional for backwards compatibility reasons.
- Parameters:
addedAt- value to be set- Returns:
- Builder
-
distributionChannel
public CartAddLineItemActionBuilder distributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Used to select a Product Price. The Channel must have the
ProductDistributionChannelRoleEnum. If the Cart is bound to a Store withdistributionChannelsset, the Channel must match one of the Store's distribution channels.- Parameters:
builder- function to build the distributionChannel value- Returns:
- Builder
-
withDistributionChannel
public CartAddLineItemActionBuilder withDistributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Used to select a Product Price. The Channel must have the
ProductDistributionChannelRoleEnum. If the Cart is bound to a Store withdistributionChannelsset, the Channel must match one of the Store's distribution channels.- Parameters:
builder- function to build the distributionChannel value- Returns:
- Builder
-
distributionChannel
public CartAddLineItemActionBuilder distributionChannel(@Nullable ChannelResourceIdentifier distributionChannel) Used to select a Product Price. The Channel must have the
ProductDistributionChannelRoleEnum. If the Cart is bound to a Store withdistributionChannelsset, the Channel must match one of the Store's distribution channels.- Parameters:
distributionChannel- value to be set- Returns:
- Builder
-
supplyChannel
public CartAddLineItemActionBuilder supplyChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupplyChannelRoleEnum.- Parameters:
builder- function to build the supplyChannel value- Returns:
- Builder
-
withSupplyChannel
public CartAddLineItemActionBuilder withSupplyChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupplyChannelRoleEnum.- Parameters:
builder- function to build the supplyChannel value- Returns:
- Builder
-
supplyChannel
public CartAddLineItemActionBuilder supplyChannel(@Nullable ChannelResourceIdentifier supplyChannel) Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupplyChannelRoleEnum.- Parameters:
supplyChannel- value to be set- Returns:
- Builder
-
externalPrice
Sets the LineItem
pricevalue, and thepriceModetoExternalPriceLineItemPriceMode.To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
builder- function to build the externalPrice value- Returns:
- Builder
-
withExternalPrice
Sets the LineItem
pricevalue, and thepriceModetoExternalPriceLineItemPriceMode.To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
builder- function to build the externalPrice value- Returns:
- Builder
-
externalPrice
Sets the LineItem
pricevalue, and thepriceModetoExternalPriceLineItemPriceMode.To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
externalPrice- value to be set- Returns:
- Builder
-
externalTotalPrice
public CartAddLineItemActionBuilder externalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPriceBuilder> builder) Sets the LineItem
priceandtotalPricevalues, and thepriceModetoExternalTotalLineItemPriceMode.- Parameters:
builder- function to build the externalTotalPrice value- Returns:
- Builder
-
withExternalTotalPrice
public CartAddLineItemActionBuilder withExternalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPrice> builder) Sets the LineItem
priceandtotalPricevalues, and thepriceModetoExternalTotalLineItemPriceMode.- Parameters:
builder- function to build the externalTotalPrice value- Returns:
- Builder
-
externalTotalPrice
public CartAddLineItemActionBuilder externalTotalPrice(@Nullable ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItem
priceandtotalPricevalues, and thepriceModetoExternalTotalLineItemPriceMode.- Parameters:
externalTotalPrice- value to be set- Returns:
- Builder
-
externalTaxRate
public CartAddLineItemActionBuilder externalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraftBuilder> builder) Sets the external Tax Rate for the Line Item, if the Cart has the
ExternalTaxMode andSingleShippingMode. If the Cart hasMultipleShippingMode, the Tax Rate is accepted but ignored.- Parameters:
builder- function to build the externalTaxRate value- Returns:
- Builder
-
withExternalTaxRate
public CartAddLineItemActionBuilder withExternalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraft> builder) Sets the external Tax Rate for the Line Item, if the Cart has the
ExternalTaxMode andSingleShippingMode. If the Cart hasMultipleShippingMode, the Tax Rate is accepted but ignored.- Parameters:
builder- function to build the externalTaxRate value- Returns:
- Builder
-
externalTaxRate
Sets the external Tax Rate for the Line Item, if the Cart has the
ExternalTaxMode andSingleShippingMode. If the Cart hasMultipleShippingMode, the Tax Rate is accepted but ignored.- Parameters:
externalTaxRate- value to be set- Returns:
- Builder
-
perMethodExternalTaxRate
public CartAddLineItemActionBuilder perMethodExternalTaxRate(@Nullable MethodExternalTaxRateDraft... perMethodExternalTaxRate) Sets the external Tax Rates for individual Shipping Methods, if the Cart has the
ExternalTaxMode andMultipleShippingMode.- Parameters:
perMethodExternalTaxRate- value to be set- Returns:
- Builder
-
perMethodExternalTaxRate
public CartAddLineItemActionBuilder perMethodExternalTaxRate(@Nullable List<MethodExternalTaxRateDraft> perMethodExternalTaxRate) Sets the external Tax Rates for individual Shipping Methods, if the Cart has the
ExternalTaxMode andMultipleShippingMode.- Parameters:
perMethodExternalTaxRate- value to be set- Returns:
- Builder
-
plusPerMethodExternalTaxRate
public CartAddLineItemActionBuilder plusPerMethodExternalTaxRate(@Nullable MethodExternalTaxRateDraft... perMethodExternalTaxRate) Sets the external Tax Rates for individual Shipping Methods, if the Cart has the
ExternalTaxMode andMultipleShippingMode.- Parameters:
perMethodExternalTaxRate- value to be set- Returns:
- Builder
-
plusPerMethodExternalTaxRate
public CartAddLineItemActionBuilder plusPerMethodExternalTaxRate(Function<MethodExternalTaxRateDraftBuilder, MethodExternalTaxRateDraftBuilder> builder) Sets the external Tax Rates for individual Shipping Methods, if the Cart has the
ExternalTaxMode andMultipleShippingMode.- Parameters:
builder- function to build the perMethodExternalTaxRate value- Returns:
- Builder
-
withPerMethodExternalTaxRate
public CartAddLineItemActionBuilder withPerMethodExternalTaxRate(Function<MethodExternalTaxRateDraftBuilder, MethodExternalTaxRateDraftBuilder> builder) Sets the external Tax Rates for individual Shipping Methods, if the Cart has the
ExternalTaxMode andMultipleShippingMode.- Parameters:
builder- function to build the perMethodExternalTaxRate value- Returns:
- Builder
-
addPerMethodExternalTaxRate
public CartAddLineItemActionBuilder addPerMethodExternalTaxRate(Function<MethodExternalTaxRateDraftBuilder, MethodExternalTaxRateDraft> builder) Sets the external Tax Rates for individual Shipping Methods, if the Cart has the
ExternalTaxMode andMultipleShippingMode.- Parameters:
builder- function to build the perMethodExternalTaxRate value- Returns:
- Builder
-
setPerMethodExternalTaxRate
public CartAddLineItemActionBuilder setPerMethodExternalTaxRate(Function<MethodExternalTaxRateDraftBuilder, MethodExternalTaxRateDraft> builder) Sets the external Tax Rates for individual Shipping Methods, if the Cart has the
ExternalTaxMode andMultipleShippingMode.- Parameters:
builder- function to build the perMethodExternalTaxRate value- Returns:
- Builder
-
inventoryMode
Inventory mode specific to the Line Item only, and valid for the entire
quantityof the Line Item. Set only if the inventory mode should be different from theinventoryModespecified on the Cart.- Parameters:
inventoryMode- value to be set- Returns:
- Builder
-
shippingDetails
public CartAddLineItemActionBuilder shippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraftBuilder> builder) Container for Line Item-specific addresses.
- Parameters:
builder- function to build the shippingDetails value- Returns:
- Builder
-
withShippingDetails
public CartAddLineItemActionBuilder withShippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraft> builder) Container for Line Item-specific addresses.
- Parameters:
builder- function to build the shippingDetails value- Returns:
- Builder
-
shippingDetails
public CartAddLineItemActionBuilder shippingDetails(@Nullable ItemShippingDetailsDraft shippingDetails) Container for Line Item-specific addresses.
- Parameters:
shippingDetails- value to be set- Returns:
- Builder
-
recurrenceInfo
public CartAddLineItemActionBuilder recurrenceInfo(Function<LineItemRecurrenceInfoDraftBuilder, LineItemRecurrenceInfoDraftBuilder> builder) Recurring Order and frequency data.
- Parameters:
builder- function to build the recurrenceInfo value- Returns:
- Builder
-
withRecurrenceInfo
public CartAddLineItemActionBuilder withRecurrenceInfo(Function<LineItemRecurrenceInfoDraftBuilder, LineItemRecurrenceInfoDraft> builder) Recurring Order and frequency data.
- Parameters:
builder- function to build the recurrenceInfo value- Returns:
- Builder
-
recurrenceInfo
public CartAddLineItemActionBuilder recurrenceInfo(@Nullable LineItemRecurrenceInfoDraft recurrenceInfo) Recurring Order and frequency data.
- Parameters:
recurrenceInfo- value to be set- Returns:
- Builder
-
custom
public CartAddLineItemActionBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Line Item.
- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
withCustom
public CartAddLineItemActionBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the Line Item.
- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Line Item.
- Parameters:
custom- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier of the LineItem.
- Returns:
- key
-
getProductId
idof the published Product.Either the
productIdandvariantId, orskumust be provided.- Returns:
- productId
-
getVariantId
idof the ProductVariant in the Product. If not provided, the Master Variant is used.Either the
productIdandvariantId, orskumust be provided.- Returns:
- variantId
-
getSku
SKU of the ProductVariant.
Either the
productIdandvariantId, orskumust be provided.- Returns:
- sku
-
getQuantity
Quantity of the Product Variant to add to the Cart.
- Returns:
- quantity
-
getAddedAt
Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.
Optional for backwards compatibility reasons.
- Returns:
- addedAt
-
getDistributionChannel
Used to select a Product Price. The Channel must have the
ProductDistributionChannelRoleEnum. If the Cart is bound to a Store withdistributionChannelsset, the Channel must match one of the Store's distribution channels.- Returns:
- distributionChannel
-
getSupplyChannel
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupplyChannelRoleEnum.- Returns:
- supplyChannel
-
getExternalPrice
Sets the LineItem
pricevalue, and thepriceModetoExternalPriceLineItemPriceMode.To set the money value in high precision, use HighPrecisionMoneyDraft.
- Returns:
- externalPrice
-
getExternalTotalPrice
Sets the LineItem
priceandtotalPricevalues, and thepriceModetoExternalTotalLineItemPriceMode.- Returns:
- externalTotalPrice
-
getExternalTaxRate
Sets the external Tax Rate for the Line Item, if the Cart has the
ExternalTaxMode andSingleShippingMode. If the Cart hasMultipleShippingMode, the Tax Rate is accepted but ignored.- Returns:
- externalTaxRate
-
getPerMethodExternalTaxRate
Sets the external Tax Rates for individual Shipping Methods, if the Cart has the
ExternalTaxMode andMultipleShippingMode.- Returns:
- perMethodExternalTaxRate
-
getInventoryMode
Inventory mode specific to the Line Item only, and valid for the entire
quantityof the Line Item. Set only if the inventory mode should be different from theinventoryModespecified on the Cart.- Returns:
- inventoryMode
-
getShippingDetails
Container for Line Item-specific addresses.
- Returns:
- shippingDetails
-
getRecurrenceInfo
Recurring Order and frequency data.
- Returns:
- recurrenceInfo
-
getCustom
Custom Fields for the Line Item.
- Returns:
- custom
-
build
builds CartAddLineItemAction with checking for non-null required values- Specified by:
buildin interfaceBuilder<CartAddLineItemAction>- Returns:
- CartAddLineItemAction
-
buildUnchecked
builds CartAddLineItemAction without checking for non-null required values- Returns:
- CartAddLineItemAction
-
of
factory method for an instance of CartAddLineItemActionBuilder- Returns:
- builder
-
of
create builder for CartAddLineItemAction instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-