/**
 * @fileoverview AUTOMATICALLY GENERATED service for API.Client.ContentExtractionApi.
 * Do not edit this file by hand or your changes will be lost next time it is
 * generated.
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 * Version: v1
* Generator version: 7.13.0
 * Generated by: org.openapitools.codegen.languages.JavascriptClosureAngularClientCodegen
 */
/**
 * @license MIT License
 * https://github.com/api-bricks/api-bricks-sdk/blob/master/LICENSE
 */

goog.provide('API.Client.ContentExtractionApi');

goog.require('API.Client.AnyType');
goog.require('API.Client.DTO.ExtractorType');
goog.require('API.Client.Mvc.ProblemDetails');
goog.require('API.Client.Mvc.ValidationProblemDetails');

/**
 * @constructor
 * @param {!angular.$http} $http
 * @param {!Object} $httpParamSerializer
 * @param {!angular.$injector} $injector
 * @struct
 */
API.Client.ContentExtractionApi = function($http, $httpParamSerializer, $injector) {
  /** @private {!string} */
  this.basePath_ = $injector.has('ContentExtractionApiBasePath') ?
                   /** @type {!string} */ ($injector.get('ContentExtractionApiBasePath')) :
                   'https://api.sec.finfeedapi.com';

  /** @private {!Object<string, string>} */
  this.defaultHeaders_ = $injector.has('ContentExtractionApiDefaultHeaders') ?
                   /** @type {!Object<string, string>} */ (
                       $injector.get('ContentExtractionApiDefaultHeaders')) :
                   {};

  /** @private {!angular.$http} */
  this.http_ = $http;

  /** @package {!Object} */
  this.httpParamSerializer = $injector.get('$httpParamSerializer');
}
API.Client.ContentExtractionApi.$inject = ['$http', '$httpParamSerializer', '$injector'];

/**
 * 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 {!DTOExtractorType=} opt_type Result type (text or html, default: text)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Object<!string, API.Client.AnyType>>}
 */
API.Client.ContentExtractionApi.prototype.v1ExtractorGet = function(accessionNumber, opt_type, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/extractor';

  /** @type {!Object} */
  var queryParameters = {};

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders_);
  // verify required parameter 'accessionNumber' is set
  if (!accessionNumber) {
    throw new Error('Missing required parameter accessionNumber when calling v1ExtractorGet');
  }
  if (accessionNumber !== undefined) {
    queryParameters['accession_number'] = accessionNumber;
  }

  if (opt_type !== undefined) {
    queryParameters['type'] = opt_type;
  }

  /** @type {!Object} */
  var httpRequestParams = {
    method: 'GET',
    url: path,
    json: true,
            params: queryParameters,
    headers: headerParams
  };

  if (opt_extraHttpRequestParams) {
    httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
  }

  return (/** @type {?} */ (this.http_))(httpRequestParams);
}

/**
 * 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&#39;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., \&quot;1.01\&quot;, \&quot;2.01\&quot;, \&quot;7.01\&quot;).
 * @param {!DTOExtractorType=} opt_type Result type (text or html, default: text)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!string>}
 */
API.Client.ContentExtractionApi.prototype.v1ExtractorItemGet = function(accessionNumber, itemNumber, opt_type, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/extractor/item';

  /** @type {!Object} */
  var queryParameters = {};

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders_);
  // verify required parameter 'accessionNumber' is set
  if (!accessionNumber) {
    throw new Error('Missing required parameter accessionNumber when calling v1ExtractorItemGet');
  }
  // verify required parameter 'itemNumber' is set
  if (!itemNumber) {
    throw new Error('Missing required parameter itemNumber when calling v1ExtractorItemGet');
  }
  if (accessionNumber !== undefined) {
    queryParameters['accession_number'] = accessionNumber;
  }

  if (itemNumber !== undefined) {
    queryParameters['item_number'] = itemNumber;
  }

  if (opt_type !== undefined) {
    queryParameters['type'] = opt_type;
  }

  /** @type {!Object} */
  var httpRequestParams = {
    method: 'GET',
    url: path,
    json: true,
            params: queryParameters,
    headers: headerParams
  };

  if (opt_extraHttpRequestParams) {
    httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
  }

  return (/** @type {?} */ (this.http_))(httpRequestParams);
}
