/**
 * CoinAPI Market Data REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 * Contact: support@apibricks.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import ApiClient from '../ApiClient';
import V1QuoteTrade from './V1QuoteTrade';

/**
 * The OptionsStrike model module.
 * @module model/OptionsStrike
 * @version v1
 */
class OptionsStrike {
    /**
     * Constructs a new <code>OptionsStrike</code>.
     * Represents a strike within the option exchange group.
     * @alias module:model/OptionsStrike
     */
    constructor() { 
        
        OptionsStrike.initialize(this);
    }

    /**
     * Initializes the fields of this object.
     * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
     * Only for internal use.
     */
    static initialize(obj) { 
    }

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

            if (data.hasOwnProperty('strike_price')) {
                obj['strike_price'] = ApiClient.convertToType(data['strike_price'], 'Number');
            }
            if (data.hasOwnProperty('call')) {
                obj['call'] = V1QuoteTrade.constructFromObject(data['call']);
            }
            if (data.hasOwnProperty('put')) {
                obj['put'] = V1QuoteTrade.constructFromObject(data['put']);
            }
        }
        return obj;
    }

    /**
     * Validates the JSON data with respect to <code>OptionsStrike</code>.
     * @param {Object} data The plain JavaScript object bearing properties of interest.
     * @return {boolean} to indicate whether the JSON data is valid with respect to <code>OptionsStrike</code>.
     */
    static validateJSON(data) {
        // validate the optional field `call`
        if (data['call']) { // data not null
          V1QuoteTrade.validateJSON(data['call']);
        }
        // validate the optional field `put`
        if (data['put']) { // data not null
          V1QuoteTrade.validateJSON(data['put']);
        }

        return true;
    }


}



/**
 * The strike price.
 * @member {Number} strike_price
 */
OptionsStrike.prototype['strike_price'] = undefined;

/**
 * @member {module:model/V1QuoteTrade} call
 */
OptionsStrike.prototype['call'] = undefined;

/**
 * @member {module:model/V1QuoteTrade} put
 */
OptionsStrike.prototype['put'] = undefined;






export default OptionsStrike;

