Interface LineItemImportDraft

All Superinterfaces:
Draft<LineItemImportDraft>

public interface LineItemImportDraft extends 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 Details

    • getProduct

      @Valid @Valid ProductKeyReference getProduct()

      Maps to LineItem.productId.

      Returns:
      product
    • getName

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Maps to LineItem.name.

      Returns:
      name
    • getVariant

      @NotNull @Valid @NotNull @Valid LineItemProductVariantImportDraft getVariant()

      Maps to ProductVariantImportDraft.

      Returns:
      variant
    • getPrice

      @NotNull @Valid @NotNull @Valid LineItemPrice getPrice()

      Maps to LineItem.price.

      Returns:
      price
    • getQuantity

      @NotNull @NotNull Long getQuantity()

      Maps to LineItem.quantity.

      Returns:
      quantity
    • getState

      @Valid @Valid List<ItemState> getState()
      Returns:
      state
    • getSupplyChannel

      @Valid @Valid ChannelKeyReference getSupplyChannel()

      Maps to LineItem.supplyChannel. The Reference to the Supply Channel with which the LineItem is associated. If referenced Supply Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Supply Channel is created.

      Returns:
      supplyChannel
    • getDistributionChannel

      @Valid @Valid ChannelKeyReference getDistributionChannel()

      Maps to LineItem.distributionChannel. The Reference to the Distribution Channel with which the LineItem is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary Distribution Channel is created.

      Returns:
      distributionChannel
    • getTaxRate

      @Valid @Valid TaxRate getTaxRate()

      Maps to LineItem.taxRate.

      Returns:
      taxRate
    • getShippingDetails

      @Valid @Valid ItemShippingDetailsDraft getShippingDetails()

      Maps to LineItem.shippingDetails.

      Returns:
      shippingDetails
    • getCustom

      @Valid @Valid Custom getCustom()

      Custom Fields for this Line Item.

      Returns:
      custom
    • setProduct

      void setProduct(ProductKeyReference product)

      Maps to LineItem.productId.

      Parameters:
      product - value to be set
    • setName

      void setName(LocalizedString name)

      Maps to LineItem.name.

      Parameters:
      name - value to be set
    • setVariant

      void setVariant(LineItemProductVariantImportDraft variant)

      Maps to ProductVariantImportDraft.

      Parameters:
      variant - value to be set
    • setPrice

      void setPrice(LineItemPrice price)

      Maps to LineItem.price.

      Parameters:
      price - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      Maps to LineItem.quantity.

      Parameters:
      quantity - value to be set
    • setState

      void setState(ItemState... state)
      set state
      Parameters:
      state - values to be set
    • setState

      void setState(List<ItemState> state)
      set state
      Parameters:
      state - values to be set
    • setSupplyChannel

      void setSupplyChannel(ChannelKeyReference supplyChannel)

      Maps to LineItem.supplyChannel. The Reference to the Supply Channel with which the LineItem is associated. If referenced Supply Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Supply Channel is created.

      Parameters:
      supplyChannel - value to be set
    • setDistributionChannel

      void setDistributionChannel(ChannelKeyReference distributionChannel)

      Maps to LineItem.distributionChannel. The Reference to the Distribution Channel with which the LineItem is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary Distribution Channel is created.

      Parameters:
      distributionChannel - value to be set
    • setTaxRate

      void setTaxRate(TaxRate taxRate)

      Maps to LineItem.taxRate.

      Parameters:
      taxRate - value to be set
    • setShippingDetails

      void setShippingDetails(ItemShippingDetailsDraft shippingDetails)

      Maps to LineItem.shippingDetails.

      Parameters:
      shippingDetails - value to be set
    • setCustom

      void setCustom(Custom custom)

      Custom Fields for this Line Item.

      Parameters:
      custom - value to be set
    • of

      static LineItemImportDraft 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

      static LineItemImportDraftBuilder 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

      default <T> T withLineItemImportDraft(Function<LineItemImportDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<LineItemImportDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference