/*
 * Selling Partner API for Product Type Definitions
 * The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds).  For more information, see the [Product Type Definitions API Use Case Guide](doc:product-type-api-use-case-guide).
 *
 * OpenAPI spec version: 2020-09-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 { ProductType } from "./ProductType.js";

/**
 * The ProductTypeList model module.
 * @module definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/ProductTypeList
 * @version 2020-09-01
 */
export class ProductTypeList {
  /**
   * Constructs a new <code>ProductTypeList</code>.
   * A list of Amazon product types with definitions available.
   * @alias module:definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/ProductTypeList
   * @class
   * @param productTypes {Array.<module:definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/ProductType>}
   */
  constructor(productTypes) {
    this.productTypes = productTypes;
  }

  /**
   * Constructs a <code>ProductTypeList</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:definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/ProductTypeList} obj Optional instance to populate.
   * @return {module:definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/ProductTypeList} The populated <code>ProductTypeList</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new ProductTypeList();
      if (data.hasOwnProperty("productTypes"))
        obj.productTypes = ApiClient.convertToType(data["productTypes"], [
          ProductType,
        ]);
    }
    return obj;
  }
}

/**
 * @member {Array.<module:definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/ProductType>} productTypes
 */
ProductTypeList.prototype.productTypes = undefined;
