/*
 * 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 ItemDisplayGroupSalesRank model module.
 * @module catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemDisplayGroupSalesRank
 * @version 2022-04-01
 */
export class ItemDisplayGroupSalesRank {
  /**
   * Constructs a new <code>ItemDisplayGroupSalesRank</code>.
   * Sales rank of an Amazon catalog item by website display group.
   * @alias module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemDisplayGroupSalesRank
   * @class
   * @param websiteDisplayGroup {String} Name of the website display group associated with the sales rank
   * @param title {String} Title, or name, of the sales rank.
   * @param rank {Number} Sales rank value.
   */
  constructor(websiteDisplayGroup, title, rank) {
    this.websiteDisplayGroup = websiteDisplayGroup;
    this.title = title;
    this.rank = rank;
  }

  /**
   * Constructs a <code>ItemDisplayGroupSalesRank</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/ItemDisplayGroupSalesRank} obj Optional instance to populate.
   * @return {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemDisplayGroupSalesRank} The populated <code>ItemDisplayGroupSalesRank</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new ItemDisplayGroupSalesRank();
      if (data.hasOwnProperty("websiteDisplayGroup"))
        obj.websiteDisplayGroup = ApiClient.convertToType(
          data["websiteDisplayGroup"],
          "String",
        );
      if (data.hasOwnProperty("title"))
        obj.title = ApiClient.convertToType(data["title"], "String");
      if (data.hasOwnProperty("link"))
        obj.link = ApiClient.convertToType(data["link"], "String");
      if (data.hasOwnProperty("rank"))
        obj.rank = ApiClient.convertToType(data["rank"], "Number");
    }
    return obj;
  }
}

/**
 * Name of the website display group associated with the sales rank
 * @member {String} websiteDisplayGroup
 */
ItemDisplayGroupSalesRank.prototype.websiteDisplayGroup = undefined;

/**
 * Title, or name, of the sales rank.
 * @member {String} title
 */
ItemDisplayGroupSalesRank.prototype.title = undefined;

/**
 * Corresponding Amazon retail website link, or URL, for the sales rank.
 * @member {String} link
 */
ItemDisplayGroupSalesRank.prototype.link = undefined;

/**
 * Sales rank value.
 * @member {Number} rank
 */
ItemDisplayGroupSalesRank.prototype.rank = undefined;
