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

            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('security_event')) {
                obj['security_event'] = ApiClient.convertToType(data['security_event'], 'Number');
            }
            if (data.hasOwnProperty('security_event_code')) {
                obj['security_event_code'] = ApiClient.convertToType(data['security_event_code'], 'String');
            }
            if (data.hasOwnProperty('security_event_text')) {
                obj['security_event_text'] = ApiClient.convertToType(data['security_event_text'], 'String');
            }
            if (data.hasOwnProperty('is_opening_process_complete')) {
                obj['is_opening_process_complete'] = ApiClient.convertToType(data['is_opening_process_complete'], 'Boolean');
            }
            if (data.hasOwnProperty('is_closing_process_complete')) {
                obj['is_closing_process_complete'] = ApiClient.convertToType(data['is_closing_process_complete'], 'Boolean');
            }
        }
        return obj;
    }

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

        return true;
    }


}



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

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

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

/**
 * Security event as byte value
 * @member {Number} security_event
 */
AdminSecurityEventModel.prototype['security_event'] = undefined;

/**
 * Security event as character string ('O' or 'C')
 * @member {String} security_event_code
 */
AdminSecurityEventModel.prototype['security_event_code'] = undefined;

/**
 * Human-readable description of the security event
 * @member {String} security_event_text
 */
AdminSecurityEventModel.prototype['security_event_text'] = undefined;

/**
 * Indicates if the security event is 'Opening Process Complete' ('O'/0x4f).
 * @member {Boolean} is_opening_process_complete
 */
AdminSecurityEventModel.prototype['is_opening_process_complete'] = undefined;

/**
 * Indicates if the security event is 'Closing Process Complete' ('C'/0x43).
 * @member {Boolean} is_closing_process_complete
 */
AdminSecurityEventModel.prototype['is_closing_process_complete'] = undefined;






export default AdminSecurityEventModel;

