Interface PriceImport

All Superinterfaces:
ImportResource

public interface PriceImport extends ImportResource

Represents the data used to import an Embedded Price . Once imported, this data is persisted as a Price in a Product Variant.


Example to create an instance using the builder pattern

     PriceImport priceImport = PriceImport.builder()
             .key("{key}")
             .value(valueBuilder -> valueBuilder)
             .productVariant(productVariantBuilder -> productVariantBuilder)
             .product(productBuilder -> productBuilder)
             .build()
 
  • Method Details

    • getKey

      @NotNull @NotNull String getKey()

      User-defined unique identifier for the Embedded Price. If a Price with this key exists on the specified productVariant, it is updated with the imported data.

      Specified by:
      getKey in interface ImportResource
      Returns:
      key
    • getValue

      @NotNull @Valid @NotNull @Valid TypedMoney getValue()

      Maps to Price.value.

      Returns:
      value
    • getCountry

      String getCountry()

      Maps to Price.county.

      Returns:
      country
    • getValidFrom

      ZonedDateTime getValidFrom()

      Maps to Price.validFrom.

      Returns:
      validFrom
    • getValidUntil

      ZonedDateTime getValidUntil()

      Maps to Price.validUntil.

      Returns:
      validUntil
    • getCustomerGroup

      @Valid @Valid CustomerGroupKeyReference getCustomerGroup()

      Maps to Price.customerGroup. If the referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the referenced CustomerGroup is created.

      Returns:
      customerGroup
    • getChannel

      @Valid @Valid ChannelKeyReference getChannel()

      Maps to Price.channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

      Returns:
      channel
    • getDiscounted

      @Valid @Valid DiscountedPrice getDiscounted()

      Sets a discounted price from an external service.

      Returns:
      discounted
    • getStaged

      Boolean getStaged()
      • Set to false to update both the current and staged projections of the Product with the new Price data.
      • Leave empty or set to true to only update the staged projection.
      Returns:
      staged
    • getTiers

      @Valid @Valid List<PriceTier> getTiers()

      The tiered prices for this price.

      Returns:
      tiers
    • getCustom

      @Valid @Valid Custom getCustom()

      Maps to Price.custom.

      Returns:
      custom
    • getProductVariant

      @NotNull @Valid @NotNull @Valid ProductVariantKeyReference getProductVariant()

      The ProductVariant which contains this Embedded Price. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the referenced ProductVariant is created.

      Returns:
      productVariant
    • getProduct

      @NotNull @Valid @NotNull @Valid ProductKeyReference getProduct()

      The Product which contains the productVariant. If the referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the referenced Product is created.

      Returns:
      product
    • setKey

      void setKey(String key)

      User-defined unique identifier for the Embedded Price. If a Price with this key exists on the specified productVariant, it is updated with the imported data.

      Specified by:
      setKey in interface ImportResource
      Parameters:
      key - value to be set
    • setValue

      void setValue(TypedMoney value)

      Maps to Price.value.

      Parameters:
      value - value to be set
    • setCountry

      void setCountry(String country)

      Maps to Price.county.

      Parameters:
      country - value to be set
    • setValidFrom

      void setValidFrom(ZonedDateTime validFrom)

      Maps to Price.validFrom.

      Parameters:
      validFrom - value to be set
    • setValidUntil

      void setValidUntil(ZonedDateTime validUntil)

      Maps to Price.validUntil.

      Parameters:
      validUntil - value to be set
    • setCustomerGroup

      void setCustomerGroup(CustomerGroupKeyReference customerGroup)

      Maps to Price.customerGroup. If the referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the referenced CustomerGroup is created.

      Parameters:
      customerGroup - value to be set
    • setChannel

      void setChannel(ChannelKeyReference channel)

      Maps to Price.channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

      Parameters:
      channel - value to be set
    • setDiscounted

      void setDiscounted(DiscountedPrice discounted)

      Sets a discounted price from an external service.

      Parameters:
      discounted - value to be set
    • setStaged

      void setStaged(Boolean staged)
      • Set to false to update both the current and staged projections of the Product with the new Price data.
      • Leave empty or set to true to only update the staged projection.
      Parameters:
      staged - value to be set
    • setTiers

      void setTiers(PriceTier... tiers)

      The tiered prices for this price.

      Parameters:
      tiers - values to be set
    • setTiers

      void setTiers(List<PriceTier> tiers)

      The tiered prices for this price.

      Parameters:
      tiers - values to be set
    • setCustom

      void setCustom(Custom custom)

      Maps to Price.custom.

      Parameters:
      custom - value to be set
    • setProductVariant

      void setProductVariant(ProductVariantKeyReference productVariant)

      The ProductVariant which contains this Embedded Price. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the referenced ProductVariant is created.

      Parameters:
      productVariant - value to be set
    • setProduct

      void setProduct(ProductKeyReference product)

      The Product which contains the productVariant. If the referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the referenced Product is created.

      Parameters:
      product - value to be set
    • of

      static PriceImport of()
      factory method
      Returns:
      instance of PriceImport
    • of

      static PriceImport of(PriceImport template)
      factory method to create a shallow copy PriceImport
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      PriceImport copyDeep()
      Specified by:
      copyDeep in interface ImportResource
    • deepCopy

      @Nullable static PriceImport deepCopy(@Nullable PriceImport template)
      factory method to create a deep copy of PriceImport
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static PriceImportBuilder builder()
      builder factory method for PriceImport
      Returns:
      builder
    • builder

      static PriceImportBuilder builder(PriceImport template)
      create builder for PriceImport instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withPriceImport

      default <T> T withPriceImport(Function<PriceImport,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<PriceImport> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference