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.
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 instancestatic LineItemImportDraft
deepCopy
(LineItemImportDraft template) factory method to create a deep copy of LineItemImportDraft@Valid Custom
Custom Fields for this Line Item.@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 to LineItem.shippingDetails.getState()
@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
Custom Fields for this Line Item.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 to LineItem.shippingDetails.void
set statevoid
set statevoid
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
.- 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
- Returns:
- state
-
getSupplyChannel
Maps to
LineItem.supplyChannel
. The Reference to the Supply Channel with which the LineItem is associated. If referenced Supply Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Supply Channel is created.- Returns:
- supplyChannel
-
getDistributionChannel
Maps to
LineItem.distributionChannel
. The Reference to the Distribution Channel with which the LineItem is associated. If referenced CustomerGroup does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Distribution Channel is created.- Returns:
- distributionChannel
-
getTaxRate
Maps to
LineItem.taxRate
.- Returns:
- taxRate
-
getShippingDetails
Maps to LineItem.shippingDetails.
- Returns:
- shippingDetails
-
getCustom
Custom Fields for this Line Item.
- Returns:
- custom
-
setProduct
Maps to
LineItem.productId
.- 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
set state- Parameters:
state
- values to be set
-
setState
set state- Parameters:
state
- values to be set
-
setSupplyChannel
Maps to
LineItem.supplyChannel
. The Reference to the Supply Channel with which the LineItem is associated. If referenced Supply Channel does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Supply Channel is created.- Parameters:
supplyChannel
- value to be set
-
setDistributionChannel
Maps to
LineItem.distributionChannel
. The Reference to the Distribution Channel with which the LineItem is associated. If referenced CustomerGroup does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Distribution 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
Custom Fields for this Line Item.
- 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
-
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
-