/*
 * Selling Partner API for Catalog Items
 * The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog.  For more information, refer to the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2022-04-01-use-case-guide).
 *
 * OpenAPI spec version: 2022-04-01
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 *
 * Swagger Codegen version: 2.4.9
 *
 * Do not edit the class manually.
 *
 */

import { ApiClient } from "../ApiClient.js";

/**
 * The ItemImage model module.
 * @module catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemImage
 * @version 2022-04-01
 */
export class ItemImage {
  /**
   * Constructs a new <code>ItemImage</code>.
   * Image for an item in the Amazon catalog.
   * @alias module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemImage
   * @class
   * @param variant {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemImage.VariantEnum} Variant of the image, such as `MAIN` or `PT01`.
   * @param link {String} Link, or URL, for the image.
   * @param height {Number} Height of the image in pixels.
   * @param width {Number} Width of the image in pixels.
   */
  constructor(variant, link, height, width) {
    this.variant = variant;
    this.link = link;
    this.height = height;
    this.width = width;
  }

  /**
   * Constructs a <code>ItemImage</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemImage} obj Optional instance to populate.
   * @return {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemImage} The populated <code>ItemImage</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new ItemImage();
      if (data.hasOwnProperty("variant"))
        obj.variant = ApiClient.convertToType(data["variant"], "String");
      if (data.hasOwnProperty("link"))
        obj.link = ApiClient.convertToType(data["link"], "String");
      if (data.hasOwnProperty("height"))
        obj.height = ApiClient.convertToType(data["height"], "Number");
      if (data.hasOwnProperty("width"))
        obj.width = ApiClient.convertToType(data["width"], "Number");
    }
    return obj;
  }
}

/**
 * Allowed values for the <code>variant</code> property.
 * @enum {String}
 * @readonly
 */
ItemImage.VariantEnum = {
  /**
   * value: "MAIN"
   * @const
   */
  MAIN: "MAIN",

  /**
   * value: "PT01"
   * @const
   */
  pT01: "PT01",

  /**
   * value: "PT02"
   * @const
   */
  pT02: "PT02",

  /**
   * value: "PT03"
   * @const
   */
  pT03: "PT03",

  /**
   * value: "PT04"
   * @const
   */
  pT04: "PT04",

  /**
   * value: "PT05"
   * @const
   */
  pT05: "PT05",

  /**
   * value: "PT06"
   * @const
   */
  pT06: "PT06",

  /**
   * value: "PT07"
   * @const
   */
  pT07: "PT07",

  /**
   * value: "PT08"
   * @const
   */
  pT08: "PT08",

  /**
   * value: "SWCH"
   * @const
   */
  SWCH: "SWCH",
};

/**
 * Variant of the image, such as `MAIN` or `PT01`.
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemImage.VariantEnum} variant
 */
ItemImage.prototype.variant = undefined;

/**
 * Link, or URL, for the image.
 * @member {String} link
 */
ItemImage.prototype.link = undefined;

/**
 * Height of the image in pixels.
 * @member {Number} height
 */
ItemImage.prototype.height = undefined;

/**
 * Width of the image in pixels.
 * @member {Number} width
 */
ItemImage.prototype.width = undefined;
