Source: models/ProductSearchRefinement.js

/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
/* Copyright (c) 2020 Mobify Research & Development Inc. All rights reserved. */
/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

/**
 * Shop API
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 20.4
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 *
 */


import ApiClient from '../ApiClient'
import ProductSearchRefinementValue from './ProductSearchRefinementValue'





/**
* The ProductSearchRefinement model module.
* @module models/ProductSearchRefinement
* @version 20.4
*/
export default class ProductSearchRefinement {
    /**
    * Constructs a new <code>ProductSearchRefinement</code>.
    * Document representing a product search refinement attribute.
    * @alias module:models/ProductSearchRefinement
    * @class
    * @param attributeId {String} The id of the search refinement attribute. In the case of an attribute refinement, this is the attribute id.  Custom attributes are marked by the prefix \"c_\" (for example, \"c_refinementColor\"). In the case of a  category refinement, the id must be \"cgid\". In the case of a price refinement, the id must be \"price\".
    */

    constructor(attributeId) {





        this.attribute_id = attributeId


    }

    /**
    * Constructs a <code>ProductSearchRefinement</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:models/ProductSearchRefinement} obj Optional instance to populate.
    * @return {module:models/ProductSearchRefinement} The populated <code>ProductSearchRefinement</code> instance.
    */
    static constructFromObject(data, obj) {
        if (data) {
            obj = obj || new ProductSearchRefinement()





            if (data.hasOwnProperty('attribute_id')) {
                obj.attribute_id = ApiClient.convertToType(data.attribute_id, 'String')
            }
            if (data.hasOwnProperty('label')) {
                obj.label = ApiClient.convertToType(data.label, 'String')
            }
            if (data.hasOwnProperty('values')) {
                obj.values = ApiClient.convertToType(data.values, [ProductSearchRefinementValue])
            }
        }
        return obj
    }

    /**
    * The id of the search refinement attribute. In the case of an attribute refinement, this is the attribute id.  Custom attributes are marked by the prefix \"c_\" (for example, \"c_refinementColor\"). In the case of a  category refinement, the id must be \"cgid\". In the case of a price refinement, the id must be \"price\".
    * @member {String} attribute_id
    */
    attribute_id = undefined;
    /**
    * The localized label of the refinement.
    * @member {String} label
    */
    label = undefined;
    /**
    * The sorted array of refinement values. This array can be empty.
    * @member {Array.<module:models/ProductSearchRefinementValue>} values
    */
    values = undefined;








}