Source: models/BaseOption.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 ApiClient from '../ApiClient'
import VariantOption from './VariantOption'

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

    constructor() {
        /**
    *
    * @member {String} variantType
    */
        this.variantType = undefined
        /**
    *
    * @member {Array.<module:models/VariantOption>} options
    */
        this.options = undefined
        /**
    * @member {module:models/VariantOption} selected
    */
        this.selected = undefined
    }

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

            if (data.hasOwnProperty('variantType')) {
                obj.variantType = ApiClient.convertToType(data.variantType, 'String')
            }
            if (data.hasOwnProperty('options')) {
                obj.options = ApiClient.convertToType(data.options, [VariantOption])
            }
            if (data.hasOwnProperty('selected')) {
                obj.selected = VariantOption.constructFromObject(data.selected)
            }
        }
        return obj
    }

}