/*
 * 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";
import { ItemClassificationSalesRank } from "./ItemClassificationSalesRank.js";
import { ItemDisplayGroupSalesRank } from "./ItemDisplayGroupSalesRank.js";

/**
 * The ItemSalesRanksByMarketplace model module.
 * @module catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemSalesRanksByMarketplace
 * @version 2022-04-01
 */
export class ItemSalesRanksByMarketplace {
  /**
   * Constructs a new <code>ItemSalesRanksByMarketplace</code>.
   * Sales ranks of an Amazon catalog item for the indicated Amazon marketplace.
   * @alias module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemSalesRanksByMarketplace
   * @class
   * @param marketplaceId {String} Amazon marketplace identifier.
   */
  constructor(marketplaceId) {
    this.marketplaceId = marketplaceId;
  }

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

/**
 * Amazon marketplace identifier.
 * @member {String} marketplaceId
 */
ItemSalesRanksByMarketplace.prototype.marketplaceId = undefined;

/**
 * Sales ranks of an Amazon catalog item for an Amazon marketplace by classification.
 * @member {Array.<module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemClassificationSalesRank>} classificationRanks
 */
ItemSalesRanksByMarketplace.prototype.classificationRanks = undefined;

/**
 * Sales ranks of an Amazon catalog item for an Amazon marketplace by website display group.
 * @member {Array.<module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemDisplayGroupSalesRank>} displayGroupRanks
 */
ItemSalesRanksByMarketplace.prototype.displayGroupRanks = undefined;
