/**
 * 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';

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

            if (data.hasOwnProperty('symbol_id')) {
                obj['symbol_id'] = ApiClient.convertToType(data['symbol_id'], 'String');
            }
            if (data.hasOwnProperty('time_exchange')) {
                obj['time_exchange'] = ApiClient.convertToType(data['time_exchange'], 'Date');
            }
            if (data.hasOwnProperty('time_coinapi')) {
                obj['time_coinapi'] = ApiClient.convertToType(data['time_coinapi'], 'Date');
            }
            if (data.hasOwnProperty('ask_price')) {
                obj['ask_price'] = ApiClient.convertToType(data['ask_price'], 'Number');
            }
            if (data.hasOwnProperty('ask_size')) {
                obj['ask_size'] = ApiClient.convertToType(data['ask_size'], 'Number');
            }
            if (data.hasOwnProperty('bid_price')) {
                obj['bid_price'] = ApiClient.convertToType(data['bid_price'], 'Number');
            }
            if (data.hasOwnProperty('bid_size')) {
                obj['bid_size'] = ApiClient.convertToType(data['bid_size'], 'Number');
            }
        }
        return obj;
    }

    /**
     * Validates the JSON data with respect to <code>V1Quote</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>V1Quote</code>.
     */
    static validateJSON(data) {
        // ensure the json data is a string
        if (data['symbol_id'] && !(typeof data['symbol_id'] === 'string' || data['symbol_id'] instanceof String)) {
            throw new Error("Expected the field `symbol_id` to be a primitive type in the JSON string but got " + data['symbol_id']);
        }

        return true;
    }


}



/**
 * The symbol identifier.
 * @member {String} symbol_id
 */
V1Quote.prototype['symbol_id'] = undefined;

/**
 * The exchange time of the quote.
 * @member {Date} time_exchange
 */
V1Quote.prototype['time_exchange'] = undefined;

/**
 * The CoinAPI time when the quote was received.
 * @member {Date} time_coinapi
 */
V1Quote.prototype['time_coinapi'] = undefined;

/**
 * The best asking price.
 * @member {Number} ask_price
 */
V1Quote.prototype['ask_price'] = undefined;

/**
 * The volume resting on the best ask. If the value is equal to zero, then the size is unknown.
 * @member {Number} ask_size
 */
V1Quote.prototype['ask_size'] = undefined;

/**
 * The best bidding price.
 * @member {Number} bid_price
 */
V1Quote.prototype['bid_price'] = undefined;

/**
 * The volume resting on the best bid. If the value is equal to zero, then the size is unknown.
 * @member {Number} bid_size
 */
V1Quote.prototype['bid_size'] = undefined;






export default V1Quote;

