Class MyLineItemDraftBuilder
- All Implemented Interfaces:
Builder<MyLineItemDraft>
Example to create an instance using the builder pattern
MyLineItemDraft myLineItemDraft = MyLineItemDraft.builder()
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddedAt
(ZonedDateTime addedAt) Date and time (UTC) the Product Variant is added to the Cart.build()
builds MyLineItemDraft with checking for non-null required valuesbuilds MyLineItemDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields for the Cart.Custom Fields for the Cart.distributionChannel
(ChannelResourceIdentifier distributionChannel) Used to select a Product Price.distributionChannel
(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Used to select a Product Price.Date and time (UTC) the Product Variant is added to the Cart.Custom Fields for the Cart.Used to select a Product Price.getKey()
User-defined unique identifier of the LineItem.id
of the Product.Number of Product Variants to add to the Cart.Container for Line Item-specific addresses.getSku()
sku
of the ProductVariant.Used to identify Inventory entries that must be reserved.id
of the ProductVariant in the Product.User-defined unique identifier of the LineItem.static MyLineItemDraftBuilder
of()
factory method for an instance of MyLineItemDraftBuilderstatic MyLineItemDraftBuilder
of
(MyLineItemDraft template) create builder for MyLineItemDraft instanceid
of the Product.Number of Product Variants to add to the Cart.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.id
of the ProductVariant in the Product.Custom Fields for the Cart.withDistributionChannel
(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Used to select a Product Price.Container for Line Item-specific addresses.Used to identify Inventory entries that must be reserved.
-
Constructor Details
-
MyLineItemDraftBuilder
public MyLineItemDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier of the LineItem.
- Parameters:
key
- value to be set- Returns:
- Builder
-
productId
id
of the Product.- Parameters:
productId
- value to be set- Returns:
- Builder
-
variantId
id
of the ProductVariant in the Product. If not provided, the Master Variant is used.- Parameters:
variantId
- value to be set- Returns:
- Builder
-
sku
sku
of the ProductVariant.- Parameters:
sku
- value to be set- Returns:
- Builder
-
quantity
Number of Product Variants 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
-
supplyChannel
public MyLineItemDraftBuilder supplyChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupply
ChannelRoleEnum.- Parameters:
builder
- function to build the supplyChannel value- Returns:
- Builder
-
withSupplyChannel
public MyLineItemDraftBuilder withSupplyChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupply
ChannelRoleEnum.- Parameters:
builder
- function to build the supplyChannel value- Returns:
- Builder
-
supplyChannel
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupply
ChannelRoleEnum.- Parameters:
supplyChannel
- value to be set- Returns:
- Builder
-
distributionChannel
public MyLineItemDraftBuilder distributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifierBuilder> builder) Used to select a Product Price. The Channel must have the
ProductDistribution
ChannelRoleEnum.If the Cart is bound to a Store with
distributionChannels
set, the Channel must match one of the Store's distribution channels.- Parameters:
builder
- function to build the distributionChannel value- Returns:
- Builder
-
withDistributionChannel
public MyLineItemDraftBuilder withDistributionChannel(Function<ChannelResourceIdentifierBuilder, ChannelResourceIdentifier> builder) Used to select a Product Price. The Channel must have the
ProductDistribution
ChannelRoleEnum.If the Cart is bound to a Store with
distributionChannels
set, the Channel must match one of the Store's distribution channels.- Parameters:
builder
- function to build the distributionChannel value- Returns:
- Builder
-
distributionChannel
public MyLineItemDraftBuilder distributionChannel(@Nullable ChannelResourceIdentifier distributionChannel) Used to select a Product Price. The Channel must have the
ProductDistribution
ChannelRoleEnum.If the Cart is bound to a Store with
distributionChannels
set, the Channel must match one of the Store's distribution channels.- Parameters:
distributionChannel
- value to be set- Returns:
- Builder
-
shippingDetails
public MyLineItemDraftBuilder shippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraftBuilder> builder) Container for Line Item-specific addresses.
- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
withShippingDetails
public MyLineItemDraftBuilder withShippingDetails(Function<ItemShippingDetailsDraftBuilder, ItemShippingDetailsDraft> builder) Container for Line Item-specific addresses.
- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
shippingDetails
Container for Line Item-specific addresses.
- Parameters:
shippingDetails
- value to be set- Returns:
- Builder
-
custom
public MyLineItemDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Cart.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public MyLineItemDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the Cart.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Cart.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier of the LineItem.
- Returns:
- key
-
getProductId
id
of the Product.- Returns:
- productId
-
getVariantId
id
of the ProductVariant in the Product. If not provided, the Master Variant is used.- Returns:
- variantId
-
getSku
sku
of the ProductVariant.- Returns:
- sku
-
getQuantity
Number of Product Variants 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
-
getSupplyChannel
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupply
ChannelRoleEnum.- Returns:
- supplyChannel
-
getDistributionChannel
Used to select a Product Price. The Channel must have the
ProductDistribution
ChannelRoleEnum.If the Cart is bound to a Store with
distributionChannels
set, the Channel must match one of the Store's distribution channels.- Returns:
- distributionChannel
-
getShippingDetails
Container for Line Item-specific addresses.
- Returns:
- shippingDetails
-
getCustom
Custom Fields for the Cart.
- Returns:
- custom
-
build
builds MyLineItemDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<MyLineItemDraft>
- Returns:
- MyLineItemDraft
-
buildUnchecked
builds MyLineItemDraft without checking for non-null required values- Returns:
- MyLineItemDraft
-
of
factory method for an instance of MyLineItemDraftBuilder- Returns:
- builder
-
of
create builder for MyLineItemDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-