Interface ProductVariantPatch


public interface ProductVariantPatch

Representation for an update of a ProductVariant. Use this type to import updates for existing ProductVariants in a Project.


Example to create an instance using the builder pattern

     ProductVariantPatch productVariantPatch = ProductVariantPatch.builder()
             .productVariant(productVariantBuilder -> productVariantBuilder)
             .build()
 
  • Method Details

    • getProductVariant

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

      Reference to the ProductVariant to update. If the referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

      Returns:
      productVariant
    • getAttributes

      @Valid @Valid Attributes getAttributes()

      Maps to ProductVariant.attributes.

      • The referenced Attribute must be defined in an existing ProductType, or the state of the ImportOperation will be validationFailed.
      • Setting the value of a non-required Attribute to null will remove the Attribute.
      • Attempting to set a null value to a required Attribute will make the import operation fail with an InvalidOperation error.
      • Importing LocalizableTextAttributes or LocalizableTextSetAttributes follows an override pattern, meaning that omitted localized fields will be deleted, new fields will be created, and existing fields will be updated. You can also delete localized fields by setting their value to null.
      Returns:
      attributes
    • getStaged

      Boolean getStaged()

      If false, the attribute changes are applied to both current and staged projected representations of the Product.

      Returns:
      staged
    • getProduct

      @Valid @Valid ProductKeyReference getProduct()

      Reference to the Product which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.

      Returns:
      product
    • setProductVariant

      void setProductVariant(ProductVariantKeyReference productVariant)

      Reference to the ProductVariant to update. If the 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
    • setAttributes

      void setAttributes(Attributes attributes)

      Maps to ProductVariant.attributes.

      • The referenced Attribute must be defined in an existing ProductType, or the state of the ImportOperation will be validationFailed.
      • Setting the value of a non-required Attribute to null will remove the Attribute.
      • Attempting to set a null value to a required Attribute will make the import operation fail with an InvalidOperation error.
      • Importing LocalizableTextAttributes or LocalizableTextSetAttributes follows an override pattern, meaning that omitted localized fields will be deleted, new fields will be created, and existing fields will be updated. You can also delete localized fields by setting their value to null.
      Parameters:
      attributes - value to be set
    • setStaged

      void setStaged(Boolean staged)

      If false, the attribute changes are applied to both current and staged projected representations of the Product.

      Parameters:
      staged - value to be set
    • setProduct

      void setProduct(ProductKeyReference product)

      Reference to the Product which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the ProductVariantPatchRequest.

      Parameters:
      product - value to be set
    • of

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

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

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

      static ProductVariantPatchBuilder builder()
      builder factory method for ProductVariantPatch
      Returns:
      builder
    • builder

      create builder for ProductVariantPatch instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductVariantPatch

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