/**
 * @fileoverview AUTOMATICALLY GENERATED service for API.Client.FilingMetadataApi.
 * 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.FilingMetadataApi');

goog.require('API.Client.DTO.FilingMetadataDto');
goog.require('API.Client.DTO.FilingSortBy');
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.FilingMetadataApi = function($http, $httpParamSerializer, $injector) {
  /** @private {!string} */
  this.basePath_ = $injector.has('FilingMetadataApiBasePath') ?
                   /** @type {!string} */ ($injector.get('FilingMetadataApiBasePath')) :
                   'https://api.sec.finfeedapi.com';

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

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

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

/**
 * 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.: \&quot;10-K,8-K,10-Q\&quot;  :::tip For optimal performance, use date ranges and form types to narrow down your search :::
 * @param {!number=} opt_cik Filter by Central Index Key (CIK)
 * @param {!string=} opt_ticker Filter by stock ticker symbol
 * @param {!string=} opt_formType Filter by form type(s) (e.g., \&quot;10-K\&quot;, \&quot;8-K\&quot;). Multiple values can be comma-separated
 * @param {!string=} opt_fillingDateStart Filter by filling date start (inclusive), format YYYY-MM-DD
 * @param {!string=} opt_fillingDateEnd Filter by filling date end (inclusive), format YYYY-MM-DD
 * @param {!string=} opt_reportDateStart Filter by report date start (inclusive), format YYYY-MM-DD
 * @param {!string=} opt_reportDateEnd Filter by report date end (inclusive), format YYYY-MM-DD
 * @param {!string=} opt_itemsContain Filter filings where the &#39;Items&#39; field contains the specified text
 * @param {!number=} opt_pageSize Number of results per page (default: 50, max: 200)
 * @param {!number=} opt_pageNumber Page number to retrieve (default: 1)
 * @param {!DTOFilingSortBy=} opt_sortBy Field to sort results by (default: AccessionNumber)
 * @param {!string=} opt_sortOrder Sort order (asc or desc, default: desc)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.DTO.FilingMetadataDto>>}
 */
API.Client.FilingMetadataApi.prototype.v1FilingsGet = function(opt_cik, opt_ticker, opt_formType, opt_fillingDateStart, opt_fillingDateEnd, opt_reportDateStart, opt_reportDateEnd, opt_itemsContain, opt_pageSize, opt_pageNumber, opt_sortBy, opt_sortOrder, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/filings';

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

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders_);
  if (opt_cik !== undefined) {
    queryParameters['cik'] = opt_cik;
  }

  if (opt_ticker !== undefined) {
    queryParameters['ticker'] = opt_ticker;
  }

  if (opt_formType !== undefined) {
    queryParameters['form_type'] = opt_formType;
  }

  if (opt_fillingDateStart !== undefined) {
    queryParameters['filling_date_start'] = opt_fillingDateStart;
  }

  if (opt_fillingDateEnd !== undefined) {
    queryParameters['filling_date_end'] = opt_fillingDateEnd;
  }

  if (opt_reportDateStart !== undefined) {
    queryParameters['report_date_start'] = opt_reportDateStart;
  }

  if (opt_reportDateEnd !== undefined) {
    queryParameters['report_date_end'] = opt_reportDateEnd;
  }

  if (opt_itemsContain !== undefined) {
    queryParameters['items_contain'] = opt_itemsContain;
  }

  if (opt_pageSize !== undefined) {
    queryParameters['page_size'] = opt_pageSize;
  }

  if (opt_pageNumber !== undefined) {
    queryParameters['page_number'] = opt_pageNumber;
  }

  if (opt_sortBy !== undefined) {
    queryParameters['sort_by'] = opt_sortBy;
  }

  if (opt_sortOrder !== undefined) {
    queryParameters['sort_order'] = opt_sortOrder;
  }

  /** @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);
}
