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

            if (data.hasOwnProperty('symbol_id')) {
                obj['symbol_id'] = ApiClient.convertToType(data['symbol_id'], 'String');
            }
            if (data.hasOwnProperty('exchange_id')) {
                obj['exchange_id'] = ApiClient.convertToType(data['exchange_id'], 'String');
            }
            if (data.hasOwnProperty('symbol_type')) {
                obj['symbol_type'] = ApiClient.convertToType(data['symbol_type'], 'String');
            }
            if (data.hasOwnProperty('asset_id_base')) {
                obj['asset_id_base'] = ApiClient.convertToType(data['asset_id_base'], 'String');
            }
            if (data.hasOwnProperty('asset_id_quote')) {
                obj['asset_id_quote'] = ApiClient.convertToType(data['asset_id_quote'], 'String');
            }
            if (data.hasOwnProperty('asset_id_unit')) {
                obj['asset_id_unit'] = ApiClient.convertToType(data['asset_id_unit'], 'String');
            }
            if (data.hasOwnProperty('future_contract_unit')) {
                obj['future_contract_unit'] = ApiClient.convertToType(data['future_contract_unit'], 'Number');
            }
            if (data.hasOwnProperty('future_contract_unit_asset')) {
                obj['future_contract_unit_asset'] = ApiClient.convertToType(data['future_contract_unit_asset'], 'String');
            }
            if (data.hasOwnProperty('future_delivery_time')) {
                obj['future_delivery_time'] = ApiClient.convertToType(data['future_delivery_time'], 'Date');
            }
            if (data.hasOwnProperty('option_type_is_call')) {
                obj['option_type_is_call'] = ApiClient.convertToType(data['option_type_is_call'], 'Boolean');
            }
            if (data.hasOwnProperty('option_strike_price')) {
                obj['option_strike_price'] = ApiClient.convertToType(data['option_strike_price'], 'Number');
            }
            if (data.hasOwnProperty('option_contract_unit')) {
                obj['option_contract_unit'] = ApiClient.convertToType(data['option_contract_unit'], 'Number');
            }
            if (data.hasOwnProperty('option_exercise_style')) {
                obj['option_exercise_style'] = ApiClient.convertToType(data['option_exercise_style'], 'String');
            }
            if (data.hasOwnProperty('option_expiration_time')) {
                obj['option_expiration_time'] = ApiClient.convertToType(data['option_expiration_time'], 'Date');
            }
            if (data.hasOwnProperty('contract_delivery_time')) {
                obj['contract_delivery_time'] = ApiClient.convertToType(data['contract_delivery_time'], 'Date');
            }
            if (data.hasOwnProperty('contract_unit')) {
                obj['contract_unit'] = ApiClient.convertToType(data['contract_unit'], 'Number');
            }
            if (data.hasOwnProperty('contract_unit_asset')) {
                obj['contract_unit_asset'] = ApiClient.convertToType(data['contract_unit_asset'], 'String');
            }
            if (data.hasOwnProperty('contract_id')) {
                obj['contract_id'] = ApiClient.convertToType(data['contract_id'], 'String');
            }
            if (data.hasOwnProperty('contract_display_name')) {
                obj['contract_display_name'] = ApiClient.convertToType(data['contract_display_name'], 'String');
            }
            if (data.hasOwnProperty('contract_display_description')) {
                obj['contract_display_description'] = ApiClient.convertToType(data['contract_display_description'], 'String');
            }
            if (data.hasOwnProperty('data_start')) {
                obj['data_start'] = ApiClient.convertToType(data['data_start'], 'String');
            }
            if (data.hasOwnProperty('data_end')) {
                obj['data_end'] = ApiClient.convertToType(data['data_end'], 'String');
            }
            if (data.hasOwnProperty('data_quote_start')) {
                obj['data_quote_start'] = ApiClient.convertToType(data['data_quote_start'], 'Date');
            }
            if (data.hasOwnProperty('data_quote_end')) {
                obj['data_quote_end'] = ApiClient.convertToType(data['data_quote_end'], 'Date');
            }
            if (data.hasOwnProperty('data_orderbook_start')) {
                obj['data_orderbook_start'] = ApiClient.convertToType(data['data_orderbook_start'], 'Date');
            }
            if (data.hasOwnProperty('data_orderbook_end')) {
                obj['data_orderbook_end'] = ApiClient.convertToType(data['data_orderbook_end'], 'Date');
            }
            if (data.hasOwnProperty('data_trade_start')) {
                obj['data_trade_start'] = ApiClient.convertToType(data['data_trade_start'], 'Date');
            }
            if (data.hasOwnProperty('data_trade_end')) {
                obj['data_trade_end'] = ApiClient.convertToType(data['data_trade_end'], 'Date');
            }
            if (data.hasOwnProperty('index_id')) {
                obj['index_id'] = ApiClient.convertToType(data['index_id'], 'String');
            }
            if (data.hasOwnProperty('index_display_name')) {
                obj['index_display_name'] = ApiClient.convertToType(data['index_display_name'], 'String');
            }
            if (data.hasOwnProperty('index_display_description')) {
                obj['index_display_description'] = ApiClient.convertToType(data['index_display_description'], 'String');
            }
            if (data.hasOwnProperty('volume_1hrs')) {
                obj['volume_1hrs'] = ApiClient.convertToType(data['volume_1hrs'], 'Number');
            }
            if (data.hasOwnProperty('volume_1hrs_usd')) {
                obj['volume_1hrs_usd'] = ApiClient.convertToType(data['volume_1hrs_usd'], 'Number');
            }
            if (data.hasOwnProperty('volume_1day')) {
                obj['volume_1day'] = ApiClient.convertToType(data['volume_1day'], 'Number');
            }
            if (data.hasOwnProperty('volume_1day_usd')) {
                obj['volume_1day_usd'] = ApiClient.convertToType(data['volume_1day_usd'], 'Number');
            }
            if (data.hasOwnProperty('volume_1mth')) {
                obj['volume_1mth'] = ApiClient.convertToType(data['volume_1mth'], 'Number');
            }
            if (data.hasOwnProperty('volume_1mth_usd')) {
                obj['volume_1mth_usd'] = ApiClient.convertToType(data['volume_1mth_usd'], 'Number');
            }
            if (data.hasOwnProperty('price')) {
                obj['price'] = ApiClient.convertToType(data['price'], 'Number');
            }
            if (data.hasOwnProperty('symbol_id_exchange')) {
                obj['symbol_id_exchange'] = ApiClient.convertToType(data['symbol_id_exchange'], 'String');
            }
            if (data.hasOwnProperty('asset_id_base_exchange')) {
                obj['asset_id_base_exchange'] = ApiClient.convertToType(data['asset_id_base_exchange'], 'String');
            }
            if (data.hasOwnProperty('asset_id_quote_exchange')) {
                obj['asset_id_quote_exchange'] = ApiClient.convertToType(data['asset_id_quote_exchange'], 'String');
            }
            if (data.hasOwnProperty('price_precision')) {
                obj['price_precision'] = ApiClient.convertToType(data['price_precision'], 'Number');
            }
            if (data.hasOwnProperty('size_precision')) {
                obj['size_precision'] = ApiClient.convertToType(data['size_precision'], 'Number');
            }
            if (data.hasOwnProperty('raw_kvp')) {
                obj['raw_kvp'] = ApiClient.convertToType(data['raw_kvp'], {'String': 'String'});
            }
            if (data.hasOwnProperty('volume_to_usd')) {
                obj['volume_to_usd'] = ApiClient.convertToType(data['volume_to_usd'], 'Number');
            }
            if (data.hasOwnProperty('symbol_id_int')) {
                obj['symbol_id_int'] = ApiClient.convertToType(data['symbol_id_int'], 'Number');
            }
        }
        return obj;
    }

    /**
     * Validates the JSON data with respect to <code>V1Symbol</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>V1Symbol</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']);
        }
        // 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['symbol_type'] && !(typeof data['symbol_type'] === 'string' || data['symbol_type'] instanceof String)) {
            throw new Error("Expected the field `symbol_type` to be a primitive type in the JSON string but got " + data['symbol_type']);
        }
        // ensure the json data is a string
        if (data['asset_id_base'] && !(typeof data['asset_id_base'] === 'string' || data['asset_id_base'] instanceof String)) {
            throw new Error("Expected the field `asset_id_base` to be a primitive type in the JSON string but got " + data['asset_id_base']);
        }
        // ensure the json data is a string
        if (data['asset_id_quote'] && !(typeof data['asset_id_quote'] === 'string' || data['asset_id_quote'] instanceof String)) {
            throw new Error("Expected the field `asset_id_quote` to be a primitive type in the JSON string but got " + data['asset_id_quote']);
        }
        // ensure the json data is a string
        if (data['asset_id_unit'] && !(typeof data['asset_id_unit'] === 'string' || data['asset_id_unit'] instanceof String)) {
            throw new Error("Expected the field `asset_id_unit` to be a primitive type in the JSON string but got " + data['asset_id_unit']);
        }
        // ensure the json data is a string
        if (data['future_contract_unit_asset'] && !(typeof data['future_contract_unit_asset'] === 'string' || data['future_contract_unit_asset'] instanceof String)) {
            throw new Error("Expected the field `future_contract_unit_asset` to be a primitive type in the JSON string but got " + data['future_contract_unit_asset']);
        }
        // ensure the json data is a string
        if (data['option_exercise_style'] && !(typeof data['option_exercise_style'] === 'string' || data['option_exercise_style'] instanceof String)) {
            throw new Error("Expected the field `option_exercise_style` to be a primitive type in the JSON string but got " + data['option_exercise_style']);
        }
        // ensure the json data is a string
        if (data['contract_unit_asset'] && !(typeof data['contract_unit_asset'] === 'string' || data['contract_unit_asset'] instanceof String)) {
            throw new Error("Expected the field `contract_unit_asset` to be a primitive type in the JSON string but got " + data['contract_unit_asset']);
        }
        // ensure the json data is a string
        if (data['contract_id'] && !(typeof data['contract_id'] === 'string' || data['contract_id'] instanceof String)) {
            throw new Error("Expected the field `contract_id` to be a primitive type in the JSON string but got " + data['contract_id']);
        }
        // ensure the json data is a string
        if (data['contract_display_name'] && !(typeof data['contract_display_name'] === 'string' || data['contract_display_name'] instanceof String)) {
            throw new Error("Expected the field `contract_display_name` to be a primitive type in the JSON string but got " + data['contract_display_name']);
        }
        // ensure the json data is a string
        if (data['contract_display_description'] && !(typeof data['contract_display_description'] === 'string' || data['contract_display_description'] instanceof String)) {
            throw new Error("Expected the field `contract_display_description` to be a primitive type in the JSON string but got " + data['contract_display_description']);
        }
        // ensure the json data is a string
        if (data['data_start'] && !(typeof data['data_start'] === 'string' || data['data_start'] instanceof String)) {
            throw new Error("Expected the field `data_start` to be a primitive type in the JSON string but got " + data['data_start']);
        }
        // ensure the json data is a string
        if (data['data_end'] && !(typeof data['data_end'] === 'string' || data['data_end'] instanceof String)) {
            throw new Error("Expected the field `data_end` to be a primitive type in the JSON string but got " + data['data_end']);
        }
        // ensure the json data is a string
        if (data['index_id'] && !(typeof data['index_id'] === 'string' || data['index_id'] instanceof String)) {
            throw new Error("Expected the field `index_id` to be a primitive type in the JSON string but got " + data['index_id']);
        }
        // ensure the json data is a string
        if (data['index_display_name'] && !(typeof data['index_display_name'] === 'string' || data['index_display_name'] instanceof String)) {
            throw new Error("Expected the field `index_display_name` to be a primitive type in the JSON string but got " + data['index_display_name']);
        }
        // ensure the json data is a string
        if (data['index_display_description'] && !(typeof data['index_display_description'] === 'string' || data['index_display_description'] instanceof String)) {
            throw new Error("Expected the field `index_display_description` to be a primitive type in the JSON string but got " + data['index_display_description']);
        }
        // ensure the json data is a string
        if (data['symbol_id_exchange'] && !(typeof data['symbol_id_exchange'] === 'string' || data['symbol_id_exchange'] instanceof String)) {
            throw new Error("Expected the field `symbol_id_exchange` to be a primitive type in the JSON string but got " + data['symbol_id_exchange']);
        }
        // ensure the json data is a string
        if (data['asset_id_base_exchange'] && !(typeof data['asset_id_base_exchange'] === 'string' || data['asset_id_base_exchange'] instanceof String)) {
            throw new Error("Expected the field `asset_id_base_exchange` to be a primitive type in the JSON string but got " + data['asset_id_base_exchange']);
        }
        // ensure the json data is a string
        if (data['asset_id_quote_exchange'] && !(typeof data['asset_id_quote_exchange'] === 'string' || data['asset_id_quote_exchange'] instanceof String)) {
            throw new Error("Expected the field `asset_id_quote_exchange` to be a primitive type in the JSON string but got " + data['asset_id_quote_exchange']);
        }

        return true;
    }


}



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

/**
 * The exchange identifier.
 * @member {String} exchange_id
 */
V1Symbol.prototype['exchange_id'] = undefined;

/**
 * The symbol type.
 * @member {String} symbol_type
 */
V1Symbol.prototype['symbol_type'] = undefined;

/**
 * The base asset identifier.
 * @member {String} asset_id_base
 */
V1Symbol.prototype['asset_id_base'] = undefined;

/**
 * The quote asset identifier.
 * @member {String} asset_id_quote
 */
V1Symbol.prototype['asset_id_quote'] = undefined;

/**
 * The unit asset identifier.
 * @member {String} asset_id_unit
 */
V1Symbol.prototype['asset_id_unit'] = undefined;

/**
 * The contract unit for futures.
 * @member {Number} future_contract_unit
 */
V1Symbol.prototype['future_contract_unit'] = undefined;

/**
 * The asset used as the unit for futures contract.
 * @member {String} future_contract_unit_asset
 */
V1Symbol.prototype['future_contract_unit_asset'] = undefined;

/**
 * The future delivery time for futures contract.
 * @member {Date} future_delivery_time
 */
V1Symbol.prototype['future_delivery_time'] = undefined;

/**
 * Indicates whether the option type is a call.
 * @member {Boolean} option_type_is_call
 */
V1Symbol.prototype['option_type_is_call'] = undefined;

/**
 * The strike price for options.
 * @member {Number} option_strike_price
 */
V1Symbol.prototype['option_strike_price'] = undefined;

/**
 * The contract unit for options.
 * @member {Number} option_contract_unit
 */
V1Symbol.prototype['option_contract_unit'] = undefined;

/**
 * The exercise style for options.
 * @member {String} option_exercise_style
 */
V1Symbol.prototype['option_exercise_style'] = undefined;

/**
 * The expiration time for options.
 * @member {Date} option_expiration_time
 */
V1Symbol.prototype['option_expiration_time'] = undefined;

/**
 * The delivery time for contracts.
 * @member {Date} contract_delivery_time
 */
V1Symbol.prototype['contract_delivery_time'] = undefined;

/**
 * The contract unit for contracts.
 * @member {Number} contract_unit
 */
V1Symbol.prototype['contract_unit'] = undefined;

/**
 * The asset used as the unit for contracts.
 * @member {String} contract_unit_asset
 */
V1Symbol.prototype['contract_unit_asset'] = undefined;

/**
 * The contract identifier.
 * @member {String} contract_id
 */
V1Symbol.prototype['contract_id'] = undefined;

/**
 * The display name of the contract.
 * @member {String} contract_display_name
 */
V1Symbol.prototype['contract_display_name'] = undefined;

/**
 * The display description of the contract.
 * @member {String} contract_display_description
 */
V1Symbol.prototype['contract_display_description'] = undefined;

/**
 * @member {String} data_start
 */
V1Symbol.prototype['data_start'] = undefined;

/**
 * @member {String} data_end
 */
V1Symbol.prototype['data_end'] = undefined;

/**
 * The start date of quote data.
 * @member {Date} data_quote_start
 */
V1Symbol.prototype['data_quote_start'] = undefined;

/**
 * The end date of quote data.
 * @member {Date} data_quote_end
 */
V1Symbol.prototype['data_quote_end'] = undefined;

/**
 * The start date of order book data.
 * @member {Date} data_orderbook_start
 */
V1Symbol.prototype['data_orderbook_start'] = undefined;

/**
 * The end date of order book data.
 * @member {Date} data_orderbook_end
 */
V1Symbol.prototype['data_orderbook_end'] = undefined;

/**
 * The start date of trade data.
 * @member {Date} data_trade_start
 */
V1Symbol.prototype['data_trade_start'] = undefined;

/**
 * The end date of trade data.
 * @member {Date} data_trade_end
 */
V1Symbol.prototype['data_trade_end'] = undefined;

/**
 * The index identifier.
 * @member {String} index_id
 */
V1Symbol.prototype['index_id'] = undefined;

/**
 * The display name of the index.
 * @member {String} index_display_name
 */
V1Symbol.prototype['index_display_name'] = undefined;

/**
 * The display description of the index.
 * @member {String} index_display_description
 */
V1Symbol.prototype['index_display_description'] = undefined;

/**
 * The volume in the last 1 hour.
 * @member {Number} volume_1hrs
 */
V1Symbol.prototype['volume_1hrs'] = undefined;

/**
 * The volume in USD in the last 1 hour.
 * @member {Number} volume_1hrs_usd
 */
V1Symbol.prototype['volume_1hrs_usd'] = undefined;

/**
 * The volume in the last 1 day.
 * @member {Number} volume_1day
 */
V1Symbol.prototype['volume_1day'] = undefined;

/**
 * The volume in USD in the last 1 day.
 * @member {Number} volume_1day_usd
 */
V1Symbol.prototype['volume_1day_usd'] = undefined;

/**
 * The volume in the last 1 month.
 * @member {Number} volume_1mth
 */
V1Symbol.prototype['volume_1mth'] = undefined;

/**
 * The volume in USD in the last 1 month.
 * @member {Number} volume_1mth_usd
 */
V1Symbol.prototype['volume_1mth_usd'] = undefined;

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

/**
 * The symbol identifier in the exchange.
 * @member {String} symbol_id_exchange
 */
V1Symbol.prototype['symbol_id_exchange'] = undefined;

/**
 * The base asset identifier in the exchange.
 * @member {String} asset_id_base_exchange
 */
V1Symbol.prototype['asset_id_base_exchange'] = undefined;

/**
 * The quote asset identifier in the exchange.
 * @member {String} asset_id_quote_exchange
 */
V1Symbol.prototype['asset_id_quote_exchange'] = undefined;

/**
 * The price precision.
 * @member {Number} price_precision
 */
V1Symbol.prototype['price_precision'] = undefined;

/**
 * The size precision.
 * @member {Number} size_precision
 */
V1Symbol.prototype['size_precision'] = undefined;

/**
 * Not normalized raw kvp data.
 * @member {Object.<String, String>} raw_kvp
 */
V1Symbol.prototype['raw_kvp'] = undefined;

/**
 * Volume unit in USD.
 * @member {Number} volume_to_usd
 */
V1Symbol.prototype['volume_to_usd'] = undefined;

/**
 * The symbol identifier in integer immutable format, used to correlate data across different APIs.
 * @member {Number} symbol_id_int
 */
V1Symbol.prototype['symbol_id_int'] = undefined;






export default V1Symbol;

