Interface ProductVariantImport

All Superinterfaces:
ImportResource

public interface ProductVariantImport extends ImportResource

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


Example to create an instance using the builder pattern

     ProductVariantImport productVariantImport = ProductVariantImport.builder()
             .key("{key}")
             .isMasterVariant(true)
             .product(productBuilder -> productBuilder)
             .build()
 
  • Method Details

    • getKey

      @NotNull @NotNull String getKey()

      User-defined unique identifier. If a ProductVariant with this key exists on the specified product, it will be updated with the imported data.

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

      String getSku()

      Maps to ProductVariant.sku.

      Returns:
      sku
    • getIsMasterVariant

      @NotNull @NotNull Boolean getIsMasterVariant()

      Maps to ProductVariant.isMasterVariant.

      Returns:
      isMasterVariant
    • getAttributes

      @Valid @Valid List<Attribute> getAttributes()

      Maps to ProductVariant.attributes. The referenced attribute must be defined in an already existing ProductType in the project, or the state of the ImportOperation will be unresolved.

      Returns:
      attributes
    • getImages

      @Valid @Valid List<Image> getImages()

      Maps to ProductVariant.images.

      Returns:
      images
    • getAssets

      @Valid @Valid List<Asset> getAssets()

      Maps to ProductVariant.assets.

      Returns:
      assets
    • getPublish

      Boolean getPublish()

      If publish is set to either true or false, both staged and current projections are set to the same value provided by the import data. If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

      Returns:
      publish
    • getProduct

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

      The Product to which this Product Variant belongs. Maps to ProductVariant.product. The Reference to the Product with which the ProductVariant 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. If a ProductVariant with this key exists on the specified product, it will be updated with the imported data.

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

      void setSku(String sku)

      Maps to ProductVariant.sku.

      Parameters:
      sku - value to be set
    • setIsMasterVariant

      void setIsMasterVariant(Boolean isMasterVariant)

      Maps to ProductVariant.isMasterVariant.

      Parameters:
      isMasterVariant - value to be set
    • setAttributes

      void setAttributes(Attribute... attributes)

      Maps to ProductVariant.attributes. The referenced attribute must be defined in an already existing ProductType in the project, or the state of the ImportOperation will be unresolved.

      Parameters:
      attributes - values to be set
    • setAttributes

      void setAttributes(List<Attribute> attributes)

      Maps to ProductVariant.attributes. The referenced attribute must be defined in an already existing ProductType in the project, or the state of the ImportOperation will be unresolved.

      Parameters:
      attributes - values to be set
    • setImages

      void setImages(Image... images)

      Maps to ProductVariant.images.

      Parameters:
      images - values to be set
    • setImages

      void setImages(List<Image> images)

      Maps to ProductVariant.images.

      Parameters:
      images - values to be set
    • setAssets

      void setAssets(Asset... assets)

      Maps to ProductVariant.assets.

      Parameters:
      assets - values to be set
    • setAssets

      void setAssets(List<Asset> assets)

      Maps to ProductVariant.assets.

      Parameters:
      assets - values to be set
    • setPublish

      void setPublish(Boolean publish)

      If publish is set to either true or false, both staged and current projections are set to the same value provided by the import data. If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whether publish is set or not.

      Parameters:
      publish - value to be set
    • setProduct

      void setProduct(ProductKeyReference product)

      The Product to which this Product Variant belongs. Maps to ProductVariant.product. The Reference to the Product with which the ProductVariant 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 ProductVariantImport of()
      factory method
      Returns:
      instance of ProductVariantImport
    • of

      factory method to create a shallow copy ProductVariantImport
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ProductVariantImport
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ProductVariantImportBuilder builder()
      builder factory method for ProductVariantImport
      Returns:
      builder
    • builder

      create builder for ProductVariantImport instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductVariantImport

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