/*
 * 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 { ItemAsin } from "./ItemAsin.js";
import { ItemAttributes } from "./ItemAttributes.js";
import { ItemDimensions } from "./ItemDimensions.js";
import { ItemIdentifiers } from "./ItemIdentifiers.js";
import { ItemImages } from "./ItemImages.js";
import { ItemProductTypes } from "./ItemProductTypes.js";
import { ItemRelationships } from "./ItemRelationships.js";
import { ItemSalesRanks } from "./ItemSalesRanks.js";
import { ItemSummaries } from "./ItemSummaries.js";
import { ItemVendorDetails } from "./ItemVendorDetails.js";

/**
 * The Item model module.
 * @module catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Item
 * @version 2022-04-01
 */
export class Item {
  /**
   * Constructs a new <code>Item</code>.
   * An item in the Amazon catalog.
   * @alias module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Item
   * @class
   * @param asin {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemAsin}
   */
  constructor(asin) {
    this.asin = asin;
  }

  /**
   * Constructs a <code>Item</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/Item} obj Optional instance to populate.
   * @return {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Item} The populated <code>Item</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new Item();
      if (data.hasOwnProperty("asin"))
        obj.asin = ItemAsin.constructFromObject(data["asin"]);
      if (data.hasOwnProperty("attributes"))
        obj.attributes = ItemAttributes.constructFromObject(data["attributes"]);
      if (data.hasOwnProperty("dimensions"))
        obj.dimensions = ItemDimensions.constructFromObject(data["dimensions"]);
      if (data.hasOwnProperty("identifiers"))
        obj.identifiers = ItemIdentifiers.constructFromObject(
          data["identifiers"],
        );
      if (data.hasOwnProperty("images"))
        obj.images = ItemImages.constructFromObject(data["images"]);
      if (data.hasOwnProperty("productTypes"))
        obj.productTypes = ItemProductTypes.constructFromObject(
          data["productTypes"],
        );
      if (data.hasOwnProperty("relationships"))
        obj.relationships = ItemRelationships.constructFromObject(
          data["relationships"],
        );
      if (data.hasOwnProperty("salesRanks"))
        obj.salesRanks = ItemSalesRanks.constructFromObject(data["salesRanks"]);
      if (data.hasOwnProperty("summaries"))
        obj.summaries = ItemSummaries.constructFromObject(data["summaries"]);
      if (data.hasOwnProperty("vendorDetails"))
        obj.vendorDetails = ItemVendorDetails.constructFromObject(
          data["vendorDetails"],
        );
    }
    return obj;
  }
}

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemAsin} asin
 */
Item.prototype.asin = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemAttributes} attributes
 */
Item.prototype.attributes = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemDimensions} dimensions
 */
Item.prototype.dimensions = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemIdentifiers} identifiers
 */
Item.prototype.identifiers = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemImages} images
 */
Item.prototype.images = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemProductTypes} productTypes
 */
Item.prototype.productTypes = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemRelationships} relationships
 */
Item.prototype.relationships = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemSalesRanks} salesRanks
 */
Item.prototype.salesRanks = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemSummaries} summaries
 */
Item.prototype.summaries = undefined;

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemVendorDetails} vendorDetails
 */
Item.prototype.vendorDetails = undefined;
