Source: models/PriceRange.js

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

/**
 * OCC No description provided (generated by Swagger Codegen
 * https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: v2
 *
 *
 * 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 Price from './Price'

/**
* The PriceRange model module.
* @module models/PriceRange
* @version v2
*/
export default class PriceRange {
    /**
    * Constructs a new <code>PriceRange</code>.
    * @alias module:models/PriceRange
    * @class
    */

    constructor() {
        /**
    * @member {module:models/Price} maxPrice
    */
        this.maxPrice = undefined
        /**
    * @member {module:models/Price} minPrice
    */
        this.minPrice = undefined
    }

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

            if (data.hasOwnProperty('maxPrice')) {
                obj.maxPrice = Price.constructFromObject(data.maxPrice)
            }
            if (data.hasOwnProperty('minPrice')) {
                obj.minPrice = Price.constructFromObject(data.minPrice)
            }
        }
        return obj
    }

}