Interface ImportResource

All Known Subinterfaces:
CategoryImport, CustomerImport, DiscountCodeImport, InventoryImport, PriceImport, ProductDraftImport, ProductImport, ProductTypeImport, ProductVariantImport, StandalonePriceImport, TypeImport

public interface ImportResource

A representation of the resource to import. Import resources are similar to draft types, but they only support key references. In general, import resources are more granular then regular resources. They are optimized for incremental updates and therefore have a slightly different structure.


Example to create an instance using the builder pattern

     ImportResource importResource = ImportResource.builder()
             .key("{key}")
             .build()
 
  • Method Details

    • getKey

      @NotNull @NotNull String getKey()

      User-defined unique identifier.

      Returns:
      key
    • setKey

      void setKey(String key)

      User-defined unique identifier.

      Parameters:
      key - value to be set
    • of

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

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

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

      static ImportResourceBuilder builder()
      builder factory method for ImportResource
      Returns:
      builder
    • builder

      static ImportResourceBuilder builder(ImportResource template)
      create builder for ImportResource instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withImportResource

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