Interface PriceImport

All Superinterfaces:
ImportResource

public interface PriceImport extends ImportResource

The data representation for a price to be imported that is persisted as a Price in the Project.


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 will be 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()

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

      Returns:
      customerGroup
    • getChannel

      @Valid @Valid ChannelKeyReference getChannel()

      The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary 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()

      The custom fields for this price.

      Returns:
      custom
    • getProductVariant

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

      The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

      Returns:
      productVariant
    • getProduct

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

      The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. The Reference to the Product with which the Price is associated. If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary 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 will be 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)

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

      Parameters:
      customerGroup - value to be set
    • setChannel

      void setChannel(ChannelKeyReference channel)

      The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary 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)

      The custom fields for this price.

      Parameters:
      custom - value to be set
    • setProductVariant

      void setProductVariant(ProductVariantKeyReference productVariant)

      The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

      Parameters:
      productVariant - value to be set
    • setProduct

      void setProduct(ProductKeyReference product)

      The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product. The Reference to the Product with which the Price is associated. If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary 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
    • 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