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

            if (data.hasOwnProperty('symbol_id')) {
                obj['symbol_id'] = ApiClient.convertToType(data['symbol_id'], 'String');
            }
            if (data.hasOwnProperty('symbol_id_exchange')) {
                obj['symbol_id_exchange'] = ApiClient.convertToType(data['symbol_id_exchange'], 'String');
            }
            if (data.hasOwnProperty('coinapi_datainfo_id')) {
                obj['coinapi_datainfo_id'] = ApiClient.convertToType(data['coinapi_datainfo_id'], 'Number');
            }
            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('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('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');
            }
        }
        return obj;
    }

    /**
     * Validates the JSON data with respect to <code>V1SymbolMapping</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>V1SymbolMapping</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['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']);
        }
        // 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']);
        }

        return true;
    }


}



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

/**
 * The exchange-specific symbol ID.
 * @member {String} symbol_id_exchange
 */
V1SymbolMapping.prototype['symbol_id_exchange'] = undefined;

/**
 * The CoinAPI DataInfo ID.
 * @member {Number} coinapi_datainfo_id
 */
V1SymbolMapping.prototype['coinapi_datainfo_id'] = undefined;

/**
 * The exchange-specific base asset ID.
 * @member {String} asset_id_base_exchange
 */
V1SymbolMapping.prototype['asset_id_base_exchange'] = undefined;

/**
 * The exchange-specific quote asset ID.
 * @member {String} asset_id_quote_exchange
 */
V1SymbolMapping.prototype['asset_id_quote_exchange'] = undefined;

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

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

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

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






export default V1SymbolMapping;

