Interface LineItemImportDraft
- All Superinterfaces:
Draft<LineItemImportDraft>
Represents an individual Line Item in an Order. A line item is a snapshot of a product at the time it was added to the order.
You cannot create an Order that includes line item operations that do not exist in the Project or have been deleted. Products and Product Variants referenced by a line item must already exist in the Project. Product Attributes are merged with Variant Attributes to ensure the full Attribute context of the Product Variant.
Example to create an instance using the builder pattern
LineItemImportDraft lineItemImportDraft = LineItemImportDraft.builder()
.name(nameBuilder -> nameBuilder)
.variant(variantBuilder -> variantBuilder)
.price(priceBuilder -> priceBuilder)
.quantity(0.3)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic LineItemImportDraftBuilder
builder()
builder factory method for LineItemImportDraftstatic LineItemImportDraftBuilder
builder
(LineItemImportDraft template) create builder for LineItemImportDraft instancecopyDeep()
static LineItemImportDraft
deepCopy
(LineItemImportDraft template) factory method to create a deep copy of LineItemImportDraft@Valid Custom
Maps toLineItem.custom
.@Valid ChannelKeyReference
Maps toLineItem.distributionChannel
.@NotNull @Valid LocalizedString
getName()
Maps toLineItem.name
.@NotNull @Valid LineItemPrice
getPrice()
Maps toLineItem.price
.@Valid ProductKeyReference
Maps toLineItem.productId
.@NotNull Long
Maps toLineItem.quantity
.@Valid ItemShippingDetailsDraft
Maps toLineItem.shippingDetails
.getState()
Maps toLineItem.state
.@Valid ChannelKeyReference
Maps toLineItem.supplyChannel
.@Valid TaxRate
Maps toLineItem.taxRate
.@NotNull @Valid LineItemProductVariantImportDraft
Maps toProductVariantImportDraft
.static LineItemImportDraft
of()
factory methodstatic LineItemImportDraft
of
(LineItemImportDraft template) factory method to create a shallow copy LineItemImportDraftvoid
Maps toLineItem.custom
.void
setDistributionChannel
(ChannelKeyReference distributionChannel) Maps toLineItem.distributionChannel
.void
setName
(LocalizedString name) Maps toLineItem.name
.void
setPrice
(LineItemPrice price) Maps toLineItem.price
.void
setProduct
(ProductKeyReference product) Maps toLineItem.productId
.void
setQuantity
(Long quantity) Maps toLineItem.quantity
.void
setShippingDetails
(ItemShippingDetailsDraft shippingDetails) Maps toLineItem.shippingDetails
.void
Maps toLineItem.state
.void
Maps toLineItem.state
.void
setSupplyChannel
(ChannelKeyReference supplyChannel) Maps toLineItem.supplyChannel
.void
setTaxRate
(TaxRate taxRate) Maps toLineItem.taxRate
.void
Maps toProductVariantImportDraft
.static com.fasterxml.jackson.core.type.TypeReference<LineItemImportDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withLineItemImportDraft
(Function<LineItemImportDraft, T> helper) accessor map function
-
Method Details
-
getProduct
Maps to
LineItem.productId
. If the referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Product is created.- Returns:
- product
-
getName
Maps to
LineItem.name
.- Returns:
- name
-
getVariant
Maps to
ProductVariantImportDraft
.- Returns:
- variant
-
getPrice
Maps to
LineItem.price
.- Returns:
- price
-
getQuantity
Maps to
LineItem.quantity
.- Returns:
- quantity
-
getState
Maps to
LineItem.state
.- Returns:
- state
-
getSupplyChannel
Maps to
LineItem.supplyChannel
. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Returns:
- supplyChannel
-
getDistributionChannel
Maps to
LineItem.distributionChannel
. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Returns:
- distributionChannel
-
getTaxRate
Maps to
LineItem.taxRate
.- Returns:
- taxRate
-
getShippingDetails
Maps to
LineItem.shippingDetails
.- Returns:
- shippingDetails
-
getCustom
Maps to
LineItem.custom
.- Returns:
- custom
-
setProduct
Maps to
LineItem.productId
. 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
-
setName
Maps to
LineItem.name
.- Parameters:
name
- value to be set
-
setVariant
Maps to
ProductVariantImportDraft
.- Parameters:
variant
- value to be set
-
setPrice
Maps to
LineItem.price
.- Parameters:
price
- value to be set
-
setQuantity
Maps to
LineItem.quantity
.- Parameters:
quantity
- value to be set
-
setState
Maps to
LineItem.state
.- Parameters:
state
- values to be set
-
setState
Maps to
LineItem.state
.- Parameters:
state
- values to be set
-
setSupplyChannel
Maps to
LineItem.supplyChannel
. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Parameters:
supplyChannel
- value to be set
-
setDistributionChannel
Maps to
LineItem.distributionChannel
. If the referenced Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Channel is created.- Parameters:
distributionChannel
- value to be set
-
setTaxRate
Maps to
LineItem.taxRate
.- Parameters:
taxRate
- value to be set
-
setShippingDetails
Maps to
LineItem.shippingDetails
.- Parameters:
shippingDetails
- value to be set
-
setCustom
Maps to
LineItem.custom
.- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of LineItemImportDraft
-
of
factory method to create a shallow copy LineItemImportDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
copyDeep
LineItemImportDraft copyDeep() -
deepCopy
factory method to create a deep copy of LineItemImportDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for LineItemImportDraft- Returns:
- builder
-
builder
create builder for LineItemImportDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withLineItemImportDraft
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
-