/**
 * FinFeedAPI Stock 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 Level2PriceLevelUpdateModel model module.
 * @module model/Level2PriceLevelUpdateModel
 * @version v1
 */
class Level2PriceLevelUpdateModel {
    /**
     * Constructs a new <code>Level2PriceLevelUpdateModel</code>.
     * Represents the response DTO for price level update information
     * @alias module:model/Level2PriceLevelUpdateModel
     */
    constructor() { 
        
        Level2PriceLevelUpdateModel.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>Level2PriceLevelUpdateModel</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/Level2PriceLevelUpdateModel} obj Optional instance to populate.
     * @return {module:model/Level2PriceLevelUpdateModel} The populated <code>Level2PriceLevelUpdateModel</code> instance.
     */
    static constructFromObject(data, obj) {
        if (data) {
            obj = obj || new Level2PriceLevelUpdateModel();

            if (data.hasOwnProperty('symbol')) {
                obj['symbol'] = ApiClient.convertToType(data['symbol'], 'String');
            }
            if (data.hasOwnProperty('timestamp_nanos')) {
                obj['timestamp_nanos'] = ApiClient.convertToType(data['timestamp_nanos'], 'Number');
            }
            if (data.hasOwnProperty('timestamp')) {
                obj['timestamp'] = ApiClient.convertToType(data['timestamp'], 'Date');
            }
            if (data.hasOwnProperty('is_side_buy')) {
                obj['is_side_buy'] = ApiClient.convertToType(data['is_side_buy'], 'Boolean');
            }
            if (data.hasOwnProperty('is_event_processing_complete')) {
                obj['is_event_processing_complete'] = ApiClient.convertToType(data['is_event_processing_complete'], 'Boolean');
            }
            if (data.hasOwnProperty('size')) {
                obj['size'] = ApiClient.convertToType(data['size'], 'Number');
            }
            if (data.hasOwnProperty('price')) {
                obj['price'] = ApiClient.convertToType(data['price'], 'Number');
            }
        }
        return obj;
    }

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

        return true;
    }


}



/**
 * The stock symbol
 * @member {String} symbol
 */
Level2PriceLevelUpdateModel.prototype['symbol'] = undefined;

/**
 * Original timestamp in nanoseconds since epoch
 * @member {Number} timestamp_nanos
 */
Level2PriceLevelUpdateModel.prototype['timestamp_nanos'] = undefined;

/**
 * Time when the price level update was recorded as DateTime
 * @member {Date} timestamp
 */
Level2PriceLevelUpdateModel.prototype['timestamp'] = undefined;

/**
 * Indicates if this is a price level update for the Buy Side.
 * @member {Boolean} is_side_buy
 */
Level2PriceLevelUpdateModel.prototype['is_side_buy'] = undefined;

/**
 * Indicates if event processing is complete.
 * @member {Boolean} is_event_processing_complete
 */
Level2PriceLevelUpdateModel.prototype['is_event_processing_complete'] = undefined;

/**
 * Aggregate quoted size at the price level
 * @member {Number} size
 */
Level2PriceLevelUpdateModel.prototype['size'] = undefined;

/**
 * Price level as decimal
 * @member {Number} price
 */
Level2PriceLevelUpdateModel.prototype['price'] = undefined;






export default Level2PriceLevelUpdateModel;

