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

/**
 * The Refinements model module.
 * @module catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Refinements
 * @version 2022-04-01
 */
export class Refinements {
  /**
   * Constructs a new <code>Refinements</code>.
   * Search refinements.
   * @alias module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Refinements
   * @class
   * @param brands {Array.<module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/BrandRefinement>} Brand search refinements.
   * @param classifications {Array.<module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ClassificationRefinement>} Classification search refinements.
   */
  constructor(brands, classifications) {
    this.brands = brands;
    this.classifications = classifications;
  }

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

/**
 * Brand search refinements.
 * @member {Array.<module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/BrandRefinement>} brands
 */
Refinements.prototype.brands = undefined;

/**
 * Classification search refinements.
 * @member {Array.<module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ClassificationRefinement>} classifications
 */
Refinements.prototype.classifications = undefined;
