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

goog.require('API.Client.v1.Quote');
goog.require('API.Client.v1.QuoteTrade');

/**
 * @constructor
 * @param {!angular.$http} $http
 * @param {!Object} $httpParamSerializer
 * @param {!angular.$injector} $injector
 * @struct
 */
API.Client.QuotesApi = function($http, $httpParamSerializer, $injector) {
  /** @private {!string} */
  this.basePath_ = $injector.has('QuotesApiBasePath') ?
                   /** @type {!string} */ ($injector.get('QuotesApiBasePath')) :
                   'https://rest.coinapi.io';

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

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

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

/**
 * Current data
 * Get current quotes for all symbols or for a specific symbol.              :::info When requesting current data for a specific symbol, output is not encapsulated into JSON array as only one item is returned. :::
 * @param {!string=} opt_filterSymbolId Comma or semicolon delimited parts of symbol identifier used to filter response. (optional)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.QuoteTrade>>}
 */
API.Client.QuotesApi.prototype.v1QuotesCurrentGet = function(opt_filterSymbolId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/quotes/current';

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

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

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

/**
 * Latest data
 * Get latest updates of the quotes up to 1 minute ago. Latest data is always returned in time descending order.
 * @param {!string=} opt_filterSymbolId Comma or semicolon delimited parts of symbol identifier used to filter response. (optional)
 * @param {!number=} opt_limit Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.Quote>>}
 */
API.Client.QuotesApi.prototype.v1QuotesLatestGet = function(opt_filterSymbolId, opt_limit, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/quotes/latest';

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

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

  if (opt_limit !== undefined) {
    queryParameters['limit'] = opt_limit;
  }

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

/**
 * Current quotes for a specific symbol
 * 
 * @param {!string} symbolId The symbol identifier (from the Metadata -&gt; Symbols)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!API.Client.v1.QuoteTrade>}
 */
API.Client.QuotesApi.prototype.v1QuotesSymbolIdCurrentGet = function(symbolId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/quotes/{symbol_id}/current'
      .replace('{' + 'symbol_id' + '}', String(symbolId));

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

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

/**
 * Historical data
 * Get historical quote updates within requested time range, returned in time ascending order.  :::warning The &#39;time_start&#39; and &#39;time_end&#39; parameters must be from the same day as this endpoint provides intraday data only for specific day. Please use the &#39;date&#39; parameter instead for querying data for a specific day without filter. :::
 * @param {!string} symbolId Symbol identifier for requested timeseries (from the Metadata -&gt; Symbols)
 * @param {!string=} opt_date Date in ISO 8601, returned data is for the whole given day (preferred method, required if &#39;time_start&#39; is not provided)
 * @param {!string=} opt_timeStart Starting time in ISO 8601
 * @param {!string=} opt_timeEnd Timeseries ending time in ISO 8601
 * @param {!number=} opt_limit Amount of items to return (optional, minimum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.Quote>>}
 */
API.Client.QuotesApi.prototype.v1QuotesSymbolIdHistoryGet = function(symbolId, opt_date, opt_timeStart, opt_timeEnd, opt_limit, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/quotes/{symbol_id}/history'
      .replace('{' + 'symbol_id' + '}', String(symbolId));

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

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

  if (opt_timeStart !== undefined) {
    queryParameters['time_start'] = opt_timeStart;
  }

  if (opt_timeEnd !== undefined) {
    queryParameters['time_end'] = opt_timeEnd;
  }

  if (opt_limit !== undefined) {
    queryParameters['limit'] = opt_limit;
  }

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

/**
 * Latest quote updates for a specific symbol
 * 
 * @param {!string} symbolId Symbol identifier of requested timeseries (from the Metadata -&gt; Symbols)
 * @param {!number=} opt_limit Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.Quote>>}
 */
API.Client.QuotesApi.prototype.v1QuotesSymbolIdLatestGet = function(symbolId, opt_limit, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/quotes/{symbol_id}/latest'
      .replace('{' + 'symbol_id' + '}', String(symbolId));

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

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

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