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

            if (data.hasOwnProperty('index_id')) {
                obj['index_id'] = ApiClient.convertToType(data['index_id'], 'String');
            }
            if (data.hasOwnProperty('timestamp')) {
                obj['timestamp'] = ApiClient.convertToType(data['timestamp'], 'Date');
            }
            if (data.hasOwnProperty('value')) {
                obj['value'] = ApiClient.convertToType(data['value'], 'Number');
            }
        }
        return obj;
    }

    /**
     * Validates the JSON data with respect to <code>IndexesIndexDefinitionSnapshotEntry</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>IndexesIndexDefinitionSnapshotEntry</code>.
     */
    static validateJSON(data) {
        // 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']);
        }

        return true;
    }


}



/**
 * @member {String} index_id
 */
IndexesIndexDefinitionSnapshotEntry.prototype['index_id'] = undefined;

/**
 * @member {Date} timestamp
 */
IndexesIndexDefinitionSnapshotEntry.prototype['timestamp'] = undefined;

/**
 * @member {Number} value
 */
IndexesIndexDefinitionSnapshotEntry.prototype['value'] = undefined;






export default IndexesIndexDefinitionSnapshotEntry;

