/**
 * 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";
import DTOFilingMetadataDto from '../model/DTOFilingMetadataDto';
import DTOFilingSortBy from '../model/DTOFilingSortBy';
import MvcProblemDetails from '../model/MvcProblemDetails';
import MvcValidationProblemDetails from '../model/MvcValidationProblemDetails';

/**
* FilingMetadata service.
* @module api/FilingMetadataApi
* @version v1
*/
export default class FilingMetadataApi {

    /**
    * Constructs a new FilingMetadataApi. 
    * @alias module:api/FilingMetadataApi
    * @class
    * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
    * default to {@link module:ApiClient#instance} if unspecified.
    */
    constructor(apiClient) {
        this.apiClient = apiClient || ApiClient.instance;
    }


    /**
     * Callback function to receive the result of the v1FilingsGet operation.
     * @callback module:api/FilingMetadataApi~v1FilingsGetCallback
     * @param {String} error Error message, if any.
     * @param {Array.<module:model/DTOFilingMetadataDto>} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Query SEC filing metadata
     * Retrieves metadata for SEC filings based on various filter criteria with pagination and sorting support.  ### Available Sort Fields  Field Name | Description -----------|------------- AccessionNumber | SEC filing accession number FilingDate | Date when filing was submitted AcceptanceDateTime | Date and time of filing acceptance ReportDate | Date of the report Size | Size of the filing document  ### Date Format All dates must be provided in YYYY-MM-DD format  ### Form Types Form types can be provided as comma-separated values, e.g.: \"10-K,8-K,10-Q\"  :::tip For optimal performance, use date ranges and form types to narrow down your search :::
     * @param {Object} opts Optional parameters
     * @param {Number} [cik] Filter by Central Index Key (CIK)
     * @param {String} [ticker] Filter by stock ticker symbol
     * @param {String} [formType] Filter by form type(s) (e.g., \"10-K\", \"8-K\"). Multiple values can be comma-separated
     * @param {String} [fillingDateStart] Filter by filling date start (inclusive), format YYYY-MM-DD
     * @param {String} [fillingDateEnd] Filter by filling date end (inclusive), format YYYY-MM-DD
     * @param {String} [reportDateStart] Filter by report date start (inclusive), format YYYY-MM-DD
     * @param {String} [reportDateEnd] Filter by report date end (inclusive), format YYYY-MM-DD
     * @param {String} [itemsContain] Filter filings where the 'Items' field contains the specified text
     * @param {Number} [pageSize] Number of results per page (default: 50, max: 200)
     * @param {Number} [pageNumber] Page number to retrieve (default: 1)
     * @param {module:model/DTOFilingSortBy} [sortBy] Field to sort results by (default: AccessionNumber)
     * @param {String} [sortOrder = 'desc')] Sort order (asc or desc, default: desc)
     * @param {module:api/FilingMetadataApi~v1FilingsGetCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link Array.<module:model/DTOFilingMetadataDto>}
     */
    v1FilingsGet(opts, callback) {
      opts = opts || {};
      let postBody = null;

      let pathParams = {
      };
      let queryParams = {
        'cik': opts['cik'],
        'ticker': opts['ticker'],
        'form_type': opts['formType'],
        'filling_date_start': opts['fillingDateStart'],
        'filling_date_end': opts['fillingDateEnd'],
        'report_date_start': opts['reportDateStart'],
        'report_date_end': opts['reportDateEnd'],
        'items_contain': opts['itemsContain'],
        'page_size': opts['pageSize'],
        'page_number': opts['pageNumber'],
        'sort_by': opts['sortBy'],
        'sort_order': opts['sortOrder']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['APIKey', 'JWT'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = [DTOFilingMetadataDto];
      return this.apiClient.callApi(
        '/v1/filings', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }


}
