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

goog.require('API.Client.v1.GeneralData');
goog.require('API.Client.v1.ListingItem');
goog.require('API.Client.v1.Metric');
goog.require('API.Client.v1.MetricData');

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

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

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

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

/**
 * Current metrics for given asset
 * Get current asset metrics.
 * @param {!string=} opt_metricId Metric identifier (from the Metrics -&gt; Listing)
 * @param {!string=} opt_assetId Asset identifier (from the Metadata -&gt; Assets)
 * @param {!string=} opt_assetIdExternal Exchange asset identifier
 * @param {!string=} opt_exchangeId Exchange identifier (from the Metadata -&gt; Exchanges)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.GeneralData>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsAssetCurrentGet = function(opt_metricId, opt_assetId, opt_assetIdExternal, opt_exchangeId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/asset/current';

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

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

  if (opt_assetId !== undefined) {
    queryParameters['asset_id'] = opt_assetId;
  }

  if (opt_assetIdExternal !== undefined) {
    queryParameters['asset_id_external'] = opt_assetIdExternal;
  }

  if (opt_exchangeId !== undefined) {
    queryParameters['exchange_id'] = opt_exchangeId;
  }

  /** @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 metrics for asset
 * Get asset metrics history.
 * @param {!string} metricId Metric identifier (from the Metrics -&gt; Listing)
 * @param {!string} exchangeId Exchange identifier (from the Metadata -&gt; Exchanges)
 * @param {!string=} opt_assetId Asset identifier (from the Metadata -&gt; Assets)
 * @param {!string=} opt_assetIdExternal Exchange asset identifier
 * @param {!Date=} opt_timeStart Starting time in ISO 8601
 * @param {!Date=} opt_timeEnd Ending time in ISO 8601
 * @param {!string=} opt_timeFormat If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)
 * @param {!string=} opt_periodId Identifier of requested timeseries period (e.g. &#x60;5SEC&#x60; or &#x60;2MTH&#x60;), default value is &#x60;1SEC&#x60;
 * @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.MetricData>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsAssetHistoryGet = function(metricId, exchangeId, opt_assetId, opt_assetIdExternal, opt_timeStart, opt_timeEnd, opt_timeFormat, opt_periodId, opt_limit, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/asset/history';

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

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

  if (opt_assetId !== undefined) {
    queryParameters['asset_id'] = opt_assetId;
  }

  if (opt_assetIdExternal !== undefined) {
    queryParameters['asset_id_external'] = opt_assetIdExternal;
  }

  if (exchangeId !== undefined) {
    queryParameters['exchange_id'] = exchangeId;
  }

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

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

  if (opt_timeFormat !== undefined) {
    queryParameters['time_format'] = opt_timeFormat;
  }

  if (opt_periodId !== undefined) {
    queryParameters['period_id'] = opt_periodId;
  }

  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);
}

/**
 * Listing of all supported metrics for asset
 * Get data metrics for asset.
 * @param {!string=} opt_metricId Metric identifier (from the Metrics -&gt; Listing)
 * @param {!string=} opt_exchangeId Exchange identifier (from the Metadata -&gt; Exchanges)
 * @param {!string=} opt_chainId Chain identifier
 * @param {!string=} opt_networkId Network identifier
 * @param {!string=} opt_assetId Asset identifier (from the Metadata -&gt; Assets)
 * @param {!string=} opt_assetIdExternal The asset external identifier
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.ListingItem>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsAssetListingGet = function(opt_metricId, opt_exchangeId, opt_chainId, opt_networkId, opt_assetId, opt_assetIdExternal, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/asset/listing';

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

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

  if (opt_exchangeId !== undefined) {
    queryParameters['exchange_id'] = opt_exchangeId;
  }

  if (opt_chainId !== undefined) {
    queryParameters['chain_id'] = opt_chainId;
  }

  if (opt_networkId !== undefined) {
    queryParameters['network_id'] = opt_networkId;
  }

  if (opt_assetId !== undefined) {
    queryParameters['asset_id'] = opt_assetId;
  }

  if (opt_assetIdExternal !== undefined) {
    queryParameters['asset_id_external'] = opt_assetIdExternal;
  }

  /** @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 metrics for given exchange
 * Get current exchange metrics values.
 * @param {!string} exchangeId The exchange identifier (from the Metadata -&gt; Exchanges)
 * @param {!string=} opt_metricId The metric identifier (from the Metrics -&gt; Listing)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.GeneralData>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsExchangeCurrentGet = function(exchangeId, opt_metricId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/exchange/current';

  /** @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 v1MetricsExchangeCurrentGet');
  }
  if (opt_metricId !== undefined) {
    queryParameters['metric_id'] = opt_metricId;
  }

  if (exchangeId !== undefined) {
    queryParameters['exchange_id'] = exchangeId;
  }

  /** @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 metrics for the exchange
 * Get exchange metrics history.
 * @param {!string} metricId Metric identifier (from the Metrics -&gt; Listing)
 * @param {!string} exchangeId Exchange identifier (from the Metadata -&gt; Exchanges)
 * @param {!Date=} opt_timeStart Starting time in ISO 8601
 * @param {!Date=} opt_timeEnd Ending time in ISO 8601
 * @param {!string=} opt_timeFormat If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)
 * @param {!string=} opt_periodId Identifier of requested timeseries period (e.g. &#x60;5SEC&#x60; or &#x60;2MTH&#x60;), default value is &#x60;1SEC&#x60;
 * @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.MetricData>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsExchangeHistoryGet = function(metricId, exchangeId, opt_timeStart, opt_timeEnd, opt_timeFormat, opt_periodId, opt_limit, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/exchange/history';

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

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

  if (exchangeId !== undefined) {
    queryParameters['exchange_id'] = exchangeId;
  }

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

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

  if (opt_timeFormat !== undefined) {
    queryParameters['time_format'] = opt_timeFormat;
  }

  if (opt_periodId !== undefined) {
    queryParameters['period_id'] = opt_periodId;
  }

  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);
}

/**
 * Listing of all supported exchange metrics
 * Get data metrics for exchange.
 * @param {!string} exchangeId The exchange identifier (from the Metadata -&gt; Exchanges)
 * @param {!string=} opt_metricId The metric identifier (from the Metrics -&gt; Listing)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.ListingItem>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsExchangeListingGet = function(exchangeId, opt_metricId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/exchange/listing';

  /** @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 v1MetricsExchangeListingGet');
  }
  if (opt_metricId !== undefined) {
    queryParameters['metric_id'] = opt_metricId;
  }

  if (exchangeId !== undefined) {
    queryParameters['exchange_id'] = exchangeId;
  }

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

/**
 * Listing of all supported metrics by CoinAPI
 * Get all data metrics.
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.Metric>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsListingGet = function(opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/listing';

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

/**
 * Current metrics for given symbol
 * Get current symbol metrics.
 * @param {!string=} opt_metricId Metric identifier (from the Metrics -&gt; Listing)
 * @param {!string=} opt_symbolId Symbol identifier (from the Metadata -&gt; Symbols)
 * @param {!string=} opt_exchangeId Exchange id (from the Metadata -&gt; Exchanges)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.GeneralData>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsSymbolCurrentGet = function(opt_metricId, opt_symbolId, opt_exchangeId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/symbol/current';

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

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

  if (opt_symbolId !== undefined) {
    queryParameters['symbol_id'] = opt_symbolId;
  }

  if (opt_exchangeId !== undefined) {
    queryParameters['exchange_id'] = opt_exchangeId;
  }

  /** @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 metrics for symbol
 * Get symbol metrics history.
 * @param {!string} metricId Metric identifier (from the Metrics -&gt; Listing)
 * @param {!string} symbolId Symbol identifier (from the Metadata -&gt; Symbols)
 * @param {!Date=} opt_timeStart Starting time in ISO 8601
 * @param {!Date=} opt_timeEnd Ending time in ISO 8601
 * @param {!string=} opt_timeFormat If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)
 * @param {!string=} opt_periodId Identifier of requested timeseries period (e.g. &#x60;5SEC&#x60; or &#x60;2MTH&#x60;), default value is &#x60;1SEC&#x60;
 * @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.MetricData>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsSymbolHistoryGet = function(metricId, symbolId, opt_timeStart, opt_timeEnd, opt_timeFormat, opt_periodId, opt_limit, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/symbol/history';

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

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

  if (symbolId !== undefined) {
    queryParameters['symbol_id'] = symbolId;
  }

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

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

  if (opt_timeFormat !== undefined) {
    queryParameters['time_format'] = opt_timeFormat;
  }

  if (opt_periodId !== undefined) {
    queryParameters['period_id'] = opt_periodId;
  }

  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);
}

/**
 * Listing of all supported metrics for symbol
 * Get data metrics for symbol.
 * @param {!string=} opt_metricId Metric identifier (from the Metrics -&gt; Listing)
 * @param {!string=} opt_exchangeId Exchange identifier (from the Metadata -&gt; Exchanges)
 * @param {!string=} opt_symbolId Symbol identifier (from the Metadata -&gt; Symbols)
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Array<!API.Client.v1.ListingItem>>}
 */
API.Client.MetricsV1Api.prototype.v1MetricsSymbolListingGet = function(opt_metricId, opt_exchangeId, opt_symbolId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/v1/metrics/symbol/listing';

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

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

  if (opt_exchangeId !== undefined) {
    queryParameters['exchange_id'] = opt_exchangeId;
  }

  if (opt_symbolId !== undefined) {
    queryParameters['symbol_id'] = opt_symbolId;
  }

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