/**
 * 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 V1GeneralData model module.
 * @module model/V1GeneralData
 * @version v1
 */
class V1GeneralData {
    /**
     * Constructs a new <code>V1GeneralData</code>.
     * Class representation of general metric data. This class is an XML type with name &#39;general_data&#39; and inherits from the BaseCsvModel class.
     * @alias module:model/V1GeneralData
     */
    constructor() { 
        
        V1GeneralData.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>V1GeneralData</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/V1GeneralData} obj Optional instance to populate.
     * @return {module:model/V1GeneralData} The populated <code>V1GeneralData</code> instance.
     */
    static constructFromObject(data, obj) {
        if (data) {
            obj = obj || new V1GeneralData();

            if (data.hasOwnProperty('entry_time')) {
                obj['entry_time'] = ApiClient.convertToType(data['entry_time'], 'Date');
            }
            if (data.hasOwnProperty('recv_time')) {
                obj['recv_time'] = ApiClient.convertToType(data['recv_time'], 'Date');
            }
            if (data.hasOwnProperty('exchange_id')) {
                obj['exchange_id'] = ApiClient.convertToType(data['exchange_id'], 'String');
            }
            if (data.hasOwnProperty('asset_id')) {
                obj['asset_id'] = ApiClient.convertToType(data['asset_id'], 'String');
            }
            if (data.hasOwnProperty('symbol_id')) {
                obj['symbol_id'] = ApiClient.convertToType(data['symbol_id'], 'String');
            }
            if (data.hasOwnProperty('metric_id')) {
                obj['metric_id'] = ApiClient.convertToType(data['metric_id'], 'String');
            }
            if (data.hasOwnProperty('value_decimal')) {
                obj['value_decimal'] = ApiClient.convertToType(data['value_decimal'], 'Number');
            }
            if (data.hasOwnProperty('value_text')) {
                obj['value_text'] = ApiClient.convertToType(data['value_text'], 'String');
            }
            if (data.hasOwnProperty('value_time')) {
                obj['value_time'] = ApiClient.convertToType(data['value_time'], 'Date');
            }
        }
        return obj;
    }

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

        return true;
    }


}



/**
 * Gets or sets the entry time for the data point.
 * @member {Date} entry_time
 */
V1GeneralData.prototype['entry_time'] = undefined;

/**
 * Gets or sets the received time for the data point.
 * @member {Date} recv_time
 */
V1GeneralData.prototype['recv_time'] = undefined;

/**
 * Gets or sets the identifier for the exchange.
 * @member {String} exchange_id
 */
V1GeneralData.prototype['exchange_id'] = undefined;

/**
 * Gets or sets the identifier for the asset.
 * @member {String} asset_id
 */
V1GeneralData.prototype['asset_id'] = undefined;

/**
 * Gets or sets the identifier for the symbol.
 * @member {String} symbol_id
 */
V1GeneralData.prototype['symbol_id'] = undefined;

/**
 * Gets or sets the identifier for the metric.
 * @member {String} metric_id
 */
V1GeneralData.prototype['metric_id'] = undefined;

/**
 * Gets or sets the decimal value for the metric.
 * @member {Number} value_decimal
 */
V1GeneralData.prototype['value_decimal'] = undefined;

/**
 * Gets or sets the textual representation of the value for the metric.
 * @member {String} value_text
 */
V1GeneralData.prototype['value_text'] = undefined;

/**
 * Gets or sets the timestamp value for the metric.
 * @member {Date} value_time
 */
V1GeneralData.prototype['value_time'] = undefined;






export default V1GeneralData;

