Interface VariantImport

All Superinterfaces:
ImportResource

public interface VariantImport extends ImportResource

Represents the data used to import a Variant. Once imported, this data is persisted as a Variant in the Project.

This import resource is only available for Projects with productCatalogModel set to Modular.


Example to create an instance using the builder pattern

     VariantImport variantImport = VariantImport.builder()
             .key("{key}")
             .sku("{sku}")
             .product(productBuilder -> productBuilder)
             .build()
 
  • Method Details

    • getKey

      @NotNull @NotNull String getKey()

      User-defined unique identifier. If a Variant with this key exists, it is updated with the imported data.

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

      @NotNull @NotNull String getSku()

      Maps to VariantData.sku.

      Returns:
      sku
    • getProduct

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

      Maps to Variant.product.

      Returns:
      product
    • getPublish

      Boolean getPublish()

      Indicates whether the Variant is published. If true, the Variant is immediately available in the current published state. Maps to VariantDraft.publish.

      Returns:
      publish
    • getImages

      @Valid @Valid List<Image> getImages()

      Maps to VariantData.images.

      Returns:
      images
    • getAttributes

      @Valid @Valid List<Attribute> getAttributes()

      Maps to VariantData.attributes.

      Returns:
      attributes
    • getAssets

      @Valid @Valid List<Asset> getAssets()

      Maps to VariantData.assets.

      Returns:
      assets
    • setKey

      void setKey(String key)

      User-defined unique identifier. If a Variant with this key exists, it is updated with the imported data.

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

      void setSku(String sku)

      Maps to VariantData.sku.

      Parameters:
      sku - value to be set
    • setProduct

      void setProduct(ProductKeyReference product)

      Maps to Variant.product.

      Parameters:
      product - value to be set
    • setPublish

      void setPublish(Boolean publish)

      Indicates whether the Variant is published. If true, the Variant is immediately available in the current published state. Maps to VariantDraft.publish.

      Parameters:
      publish - value to be set
    • setImages

      void setImages(Image... images)

      Maps to VariantData.images.

      Parameters:
      images - values to be set
    • setImages

      void setImages(List<Image> images)

      Maps to VariantData.images.

      Parameters:
      images - values to be set
    • setAttributes

      void setAttributes(Attribute... attributes)

      Maps to VariantData.attributes.

      Parameters:
      attributes - values to be set
    • setAttributes

      void setAttributes(List<Attribute> attributes)

      Maps to VariantData.attributes.

      Parameters:
      attributes - values to be set
    • setAssets

      void setAssets(Asset... assets)

      Maps to VariantData.assets.

      Parameters:
      assets - values to be set
    • setAssets

      void setAssets(List<Asset> assets)

      Maps to VariantData.assets.

      Parameters:
      assets - values to be set
    • of

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

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

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

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

      static VariantImportBuilder builder()
      builder factory method for VariantImport
      Returns:
      builder
    • builder

      static VariantImportBuilder builder(VariantImport template)
      create builder for VariantImport instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withVariantImport

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

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