/*
 * 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 BrandRefinement model module.
 * @module catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/BrandRefinement
 * @version 2022-04-01
 */
export class BrandRefinement {
  /**
   * Constructs a new <code>BrandRefinement</code>.
   * Description of a brand that can be used to get more fine-grained search results.
   * @alias module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/BrandRefinement
   * @class
   * @param numberOfResults {Number} The estimated number of results that would still be returned if refinement key applied.
   * @param brandName {String} Brand name. For display and can be used as a search refinement.
   */
  constructor(numberOfResults, brandName) {
    this.numberOfResults = numberOfResults;
    this.brandName = brandName;
  }

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

/**
 * The estimated number of results that would still be returned if refinement key applied.
 * @member {Number} numberOfResults
 */
BrandRefinement.prototype.numberOfResults = undefined;

/**
 * Brand name. For display and can be used as a search refinement.
 * @member {String} brandName
 */
BrandRefinement.prototype.brandName = undefined;
