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

/**
* ContentExtraction service.
* @module api/ContentExtractionApi
* @version v1
*/
export default class ContentExtractionApi {

    /**
    * Constructs a new ContentExtractionApi. 
    * @alias module:api/ContentExtractionApi
    * @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 v1ExtractorGet operation.
     * @callback module:api/ContentExtractionApi~v1ExtractorGetCallback
     * @param {String} error Error message, if any.
     * @param {Object.<String, {String: Object}>} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Extract and classify SEC filing content
     * Retrieves filing content from the EDGAR database and intelligently classifies it according to form type and item categories.  ### Supported Form Types  Form Type | Description ----------|------------ 8-K      | Current report filing 10-K     | Annual report filing 10-Q     | Quarterly report filing  ### Content Classification - 8-K forms: Content classified by item numbers (e.g., 1.01, 2.01) - 10-K/10-Q forms: Items categorized by their respective part and item structure  :::note Both HTML and plain text documents are supported for content extraction. :::
     * @param {String} accessionNumber The SEC filing accession number used to retrieve the filing from EDGAR database.
     * @param {Object} opts Optional parameters
     * @param {module:model/DTOExtractorType} [type] Result type (text or html, default: text)
     * @param {module:api/ContentExtractionApi~v1ExtractorGetCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link Object.<String, {String: Object}>}
     */
    v1ExtractorGet(accessionNumber, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'accessionNumber' is set
      if (accessionNumber === undefined || accessionNumber === null) {
        throw new Error("Missing the required parameter 'accessionNumber' when calling v1ExtractorGet");
      }

      let pathParams = {
      };
      let queryParams = {
        'accession_number': accessionNumber,
        'type': opts['type']
      };
      let headerParams = {
      };
      let formParams = {
      };

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

    /**
     * Callback function to receive the result of the v1ExtractorItemGet operation.
     * @callback module:api/ContentExtractionApi~v1ExtractorItemGetCallback
     * @param {String} error Error message, if any.
     * @param {String} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Extract specific item content from SEC filing
     * Retrieves filing content from the EDGAR database and returns only the text content of the specified item number.  ### Item Number Format  Form Type | Item Format Examples -----------|------------------- 8-K       | 1.01, 2.01, 7.01 10-K      | 1, 2, 3 10-K/10-Q | PartI 1, PartII 2  :::tip For best results, ensure the item number matches exactly with the filing's structure. :::
     * @param {String} accessionNumber The SEC filing accession number used to retrieve the filing from EDGAR database.
     * @param {String} itemNumber The specific item number to extract (e.g., \"1.01\", \"2.01\", \"7.01\").
     * @param {Object} opts Optional parameters
     * @param {module:model/DTOExtractorType} [type] Result type (text or html, default: text)
     * @param {module:api/ContentExtractionApi~v1ExtractorItemGetCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link String}
     */
    v1ExtractorItemGet(accessionNumber, itemNumber, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'accessionNumber' is set
      if (accessionNumber === undefined || accessionNumber === null) {
        throw new Error("Missing the required parameter 'accessionNumber' when calling v1ExtractorItemGet");
      }
      // verify the required parameter 'itemNumber' is set
      if (itemNumber === undefined || itemNumber === null) {
        throw new Error("Missing the required parameter 'itemNumber' when calling v1ExtractorItemGet");
      }

      let pathParams = {
      };
      let queryParams = {
        'accession_number': accessionNumber,
        'item_number': itemNumber,
        'type': opts['type']
      };
      let headerParams = {
      };
      let formParams = {
      };

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


}
