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

            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('system_event')) {
                obj['system_event'] = ApiClient.convertToType(data['system_event'], 'Number');
            }
            if (data.hasOwnProperty('system_event_code')) {
                obj['system_event_code'] = ApiClient.convertToType(data['system_event_code'], 'String');
            }
            if (data.hasOwnProperty('system_event_text')) {
                obj['system_event_text'] = ApiClient.convertToType(data['system_event_text'], 'String');
            }
            if (data.hasOwnProperty('is_system_event_start_of_messages')) {
                obj['is_system_event_start_of_messages'] = ApiClient.convertToType(data['is_system_event_start_of_messages'], 'Boolean');
            }
            if (data.hasOwnProperty('is_system_event_start_of_system_hours')) {
                obj['is_system_event_start_of_system_hours'] = ApiClient.convertToType(data['is_system_event_start_of_system_hours'], 'Boolean');
            }
            if (data.hasOwnProperty('is_system_event_start_of_regular_market_hours')) {
                obj['is_system_event_start_of_regular_market_hours'] = ApiClient.convertToType(data['is_system_event_start_of_regular_market_hours'], 'Boolean');
            }
            if (data.hasOwnProperty('is_system_event_end_of_regular_market_hours')) {
                obj['is_system_event_end_of_regular_market_hours'] = ApiClient.convertToType(data['is_system_event_end_of_regular_market_hours'], 'Boolean');
            }
            if (data.hasOwnProperty('is_system_event_end_of_system_hours')) {
                obj['is_system_event_end_of_system_hours'] = ApiClient.convertToType(data['is_system_event_end_of_system_hours'], 'Boolean');
            }
            if (data.hasOwnProperty('is_system_event_end_of_messages')) {
                obj['is_system_event_end_of_messages'] = ApiClient.convertToType(data['is_system_event_end_of_messages'], 'Boolean');
            }
        }
        return obj;
    }

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

        return true;
    }


}



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

/**
 * Time when the system event was recorded as DateTime
 * @member {Date} timestamp
 */
AdminSystemEventModel.prototype['timestamp'] = undefined;

/**
 * System event as byte value
 * @member {Number} system_event
 */
AdminSystemEventModel.prototype['system_event'] = undefined;

/**
 * System event as string
 * @member {String} system_event_code
 */
AdminSystemEventModel.prototype['system_event_code'] = undefined;

/**
 * Human-readable description of the system event
 * @member {String} system_event_text
 */
AdminSystemEventModel.prototype['system_event_text'] = undefined;

/**
 * Indicates if the system event is 'Start of Messages' (O). Outside of heartbeat messages on the lower level protocol,  the start of day message is the first message sent in any trading session.
 * @member {Boolean} is_system_event_start_of_messages
 */
AdminSystemEventModel.prototype['is_system_event_start_of_messages'] = undefined;

/**
 * Indicates if the system event is 'Start of System Hours' (S). This message indicates that IEX is open and ready to start accepting orders.
 * @member {Boolean} is_system_event_start_of_system_hours
 */
AdminSystemEventModel.prototype['is_system_event_start_of_system_hours'] = undefined;

/**
 * Indicates if the system event is 'Start of Regular Market Hours' (R). This message indicates that DAY and GTX orders, as well as market orders and pegged orders,  are available for execution on IEX.
 * @member {Boolean} is_system_event_start_of_regular_market_hours
 */
AdminSystemEventModel.prototype['is_system_event_start_of_regular_market_hours'] = undefined;

/**
 * Indicates if the system event is 'End of Regular Market Hours' (M). This message indicates that DAY orders, market orders, and pegged orders  are no longer accepted by IEX.
 * @member {Boolean} is_system_event_end_of_regular_market_hours
 */
AdminSystemEventModel.prototype['is_system_event_end_of_regular_market_hours'] = undefined;

/**
 * Indicates if the system event is 'End of System Hours' (E). This message indicates that IEX is now closed and will not accept  any new orders during this trading session. It is still possible  to receive messages after the end of day.
 * @member {Boolean} is_system_event_end_of_system_hours
 */
AdminSystemEventModel.prototype['is_system_event_end_of_system_hours'] = undefined;

/**
 * Indicates if the system event is 'End of Messages' (C). This is always the last message sent in any trading session.
 * @member {Boolean} is_system_event_end_of_messages
 */
AdminSystemEventModel.prototype['is_system_event_end_of_messages'] = undefined;






export default AdminSystemEventModel;

