/**
 * FinFeedAPI SEC 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 DTOFilingMetadataDto model module.
 * @module model/DTOFilingMetadataDto
 * @version v1
 */
class DTOFilingMetadataDto {
    /**
     * Constructs a new <code>DTOFilingMetadataDto</code>.
     * Represents the response for a single SEC filing metadata record. Maps fields from the edgar_submissions table.
     * @alias module:model/DTOFilingMetadataDto
     */
    constructor() { 
        
        DTOFilingMetadataDto.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>DTOFilingMetadataDto</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/DTOFilingMetadataDto} obj Optional instance to populate.
     * @return {module:model/DTOFilingMetadataDto} The populated <code>DTOFilingMetadataDto</code> instance.
     */
    static constructFromObject(data, obj) {
        if (data) {
            obj = obj || new DTOFilingMetadataDto();

            if (data.hasOwnProperty('cik')) {
                obj['cik'] = ApiClient.convertToType(data['cik'], 'Number');
            }
            if (data.hasOwnProperty('accession_number')) {
                obj['accession_number'] = ApiClient.convertToType(data['accession_number'], 'String');
            }
            if (data.hasOwnProperty('filing_date')) {
                obj['filing_date'] = ApiClient.convertToType(data['filing_date'], 'Date');
            }
            if (data.hasOwnProperty('report_date')) {
                obj['report_date'] = ApiClient.convertToType(data['report_date'], 'Date');
            }
            if (data.hasOwnProperty('acceptance_date_time')) {
                obj['acceptance_date_time'] = ApiClient.convertToType(data['acceptance_date_time'], 'Date');
            }
            if (data.hasOwnProperty('act')) {
                obj['act'] = ApiClient.convertToType(data['act'], 'String');
            }
            if (data.hasOwnProperty('form')) {
                obj['form'] = ApiClient.convertToType(data['form'], 'String');
            }
            if (data.hasOwnProperty('file_number')) {
                obj['file_number'] = ApiClient.convertToType(data['file_number'], 'String');
            }
            if (data.hasOwnProperty('film_number')) {
                obj['film_number'] = ApiClient.convertToType(data['film_number'], 'String');
            }
            if (data.hasOwnProperty('items')) {
                obj['items'] = ApiClient.convertToType(data['items'], 'String');
            }
            if (data.hasOwnProperty('core_type')) {
                obj['core_type'] = ApiClient.convertToType(data['core_type'], 'String');
            }
            if (data.hasOwnProperty('size')) {
                obj['size'] = ApiClient.convertToType(data['size'], 'Number');
            }
            if (data.hasOwnProperty('is_xbrl')) {
                obj['is_xbrl'] = ApiClient.convertToType(data['is_xbrl'], 'Boolean');
            }
            if (data.hasOwnProperty('is_inline_xbrl')) {
                obj['is_inline_xbrl'] = ApiClient.convertToType(data['is_inline_xbrl'], 'Boolean');
            }
            if (data.hasOwnProperty('primary_document')) {
                obj['primary_document'] = ApiClient.convertToType(data['primary_document'], 'String');
            }
            if (data.hasOwnProperty('primary_doc_description')) {
                obj['primary_doc_description'] = ApiClient.convertToType(data['primary_doc_description'], 'String');
            }
            if (data.hasOwnProperty('source_file')) {
                obj['source_file'] = ApiClient.convertToType(data['source_file'], 'String');
            }
        }
        return obj;
    }

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

        return true;
    }


}



/**
 * @member {Number} cik
 */
DTOFilingMetadataDto.prototype['cik'] = undefined;

/**
 * @member {String} accession_number
 */
DTOFilingMetadataDto.prototype['accession_number'] = undefined;

/**
 * @member {Date} filing_date
 */
DTOFilingMetadataDto.prototype['filing_date'] = undefined;

/**
 * @member {Date} report_date
 */
DTOFilingMetadataDto.prototype['report_date'] = undefined;

/**
 * @member {Date} acceptance_date_time
 */
DTOFilingMetadataDto.prototype['acceptance_date_time'] = undefined;

/**
 * @member {String} act
 */
DTOFilingMetadataDto.prototype['act'] = undefined;

/**
 * @member {String} form
 */
DTOFilingMetadataDto.prototype['form'] = undefined;

/**
 * @member {String} file_number
 */
DTOFilingMetadataDto.prototype['file_number'] = undefined;

/**
 * @member {String} film_number
 */
DTOFilingMetadataDto.prototype['film_number'] = undefined;

/**
 * @member {String} items
 */
DTOFilingMetadataDto.prototype['items'] = undefined;

/**
 * @member {String} core_type
 */
DTOFilingMetadataDto.prototype['core_type'] = undefined;

/**
 * @member {Number} size
 */
DTOFilingMetadataDto.prototype['size'] = undefined;

/**
 * @member {Boolean} is_xbrl
 */
DTOFilingMetadataDto.prototype['is_xbrl'] = undefined;

/**
 * @member {Boolean} is_inline_xbrl
 */
DTOFilingMetadataDto.prototype['is_inline_xbrl'] = undefined;

/**
 * @member {String} primary_document
 */
DTOFilingMetadataDto.prototype['primary_document'] = undefined;

/**
 * @member {String} primary_doc_description
 */
DTOFilingMetadataDto.prototype['primary_doc_description'] = undefined;

/**
 * @member {String} source_file
 */
DTOFilingMetadataDto.prototype['source_file'] = undefined;






export default DTOFilingMetadataDto;

