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

goog.require('API.Client.FinFeedAPI.ExchangeModel');
goog.require('API.Client.FinFeedAPI.SymbolModel');

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

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

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

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

/**
 * List of exchanges
 * 
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.FinFeedAPI.ExchangeModel>>}
 */
API.Client.MetadataApi.prototype.v1ExchangesGet = function(opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/exchanges';

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

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders_);
  /** @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);
}

/**
 * List of symbols for the exchange
 * 
 * @param {!string} exchangeId 
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.FinFeedAPI.SymbolModel>>}
 */
API.Client.MetadataApi.prototype.v1SymbolsExchangeIdGet = function(exchangeId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/symbols/{exchange_id}'
      .replace('{' + 'exchange_id' + '}', String(exchangeId));

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

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders_);
  // verify required parameter 'exchangeId' is set
  if (!exchangeId) {
    throw new Error('Missing required parameter exchangeId when calling v1SymbolsExchangeIdGet');
  }
  /** @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);
}
