content: {-
     CoinAPI Market Data REST API
  
     No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
  
     OpenAPI Version: 3.0.4
     CoinAPI Market Data REST API API version: v1
     Contact: support@apibricks.io
     Generated by OpenAPI Generator (https://openapi-generator.tech)
  -}
  
  {-|
  Module : CoinAPIMarketDataREST.API.MetricsV2
  -}
  
  {-# LANGUAGE FlexibleContexts #-}
  {-# LANGUAGE FlexibleInstances #-}
  {-# LANGUAGE MonoLocalBinds #-}
  {-# LANGUAGE MultiParamTypeClasses #-}
  {-# LANGUAGE OverloadedStrings #-}
  {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
  
  module CoinAPIMarketDataREST.API.MetricsV2 where
  
  import CoinAPIMarketDataREST.Core
  import CoinAPIMarketDataREST.MimeTypes
  import CoinAPIMarketDataREST.Model as M
  
  import qualified Data.Aeson as A
  import qualified Data.ByteString as B
  import qualified Data.ByteString.Lazy as BL
  import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
  import qualified Data.Foldable as P
  import qualified Data.Map as Map
  import qualified Data.Maybe as P
  import qualified Data.Proxy as P (Proxy(..))
  import qualified Data.Set as Set
  import qualified Data.String as P
  import qualified Data.Text as T
  import qualified Data.Text.Encoding as T
  import qualified Data.Text.Lazy as TL
  import qualified Data.Text.Lazy.Encoding as TL
  import qualified Data.Time as TI
  import qualified Network.HTTP.Client.MultipartFormData as NH
  import qualified Network.HTTP.Media as ME
  import qualified Network.HTTP.Types as NH
  import qualified Web.FormUrlEncoded as WH
  import qualified Web.HttpApiData as WH
  
  import Data.Text (Text)
  import GHC.Base ((<|>))
  
  import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
  import qualified Prelude as P
  
  -- * Operations
  
  
  -- ** MetricsV2
  
  -- *** v2MetricsAssetHistoryGet
  
  -- | @GET \/v2\/metrics\/asset\/history@
  -- 
  -- Historical metrics for the asset
  -- 
  -- Get asset metrics history.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v2MetricsAssetHistoryGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> MetricId -- ^ "metricId" -  Metric identifier (e.g., `TVL`, `STABLES_BRIDGED_USD`)
    -> AssetId -- ^ "assetId" -  Asset identifier (e.g., `USDC`, `USDT`)
    -> CoinAPIMarketDataRESTRequest V2MetricsAssetHistoryGet MimeNoContent [A.Value] accept
  v2MetricsAssetHistoryGet  _ (MetricId metricId) (AssetId assetId) =
    _mkRequest "GET" ["/v2/metrics/asset/history"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
      `addQuery` toQuery ("metric_id", Just metricId)
      `addQuery` toQuery ("asset_id", Just assetId)
  
  data V2MetricsAssetHistoryGet  
  
  -- | /Optional Param/ "time_start" - Starting time in ISO 8601
  instance HasOptionalParam V2MetricsAssetHistoryGet TimeStartDateTime where
    applyOptionalParam req (TimeStartDateTime xs) =
      req `addQuery` toQuery ("time_start", Just xs)
  
  -- | /Optional Param/ "time_end" - Ending time in ISO 8601
  instance HasOptionalParam V2MetricsAssetHistoryGet TimeEndDateTime where
    applyOptionalParam req (TimeEndDateTime xs) =
      req `addQuery` toQuery ("time_end", Just xs)
  
  -- | /Optional Param/ "time_format" - If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)
  instance HasOptionalParam V2MetricsAssetHistoryGet TimeFormat where
    applyOptionalParam req (TimeFormat xs) =
      req `addQuery` toQuery ("time_format", Just xs)
  
  -- | /Optional Param/ "period_id" - Identifier of requested timeseries period (e.g. `1MIN` or `2MTH`), default value is `1MIN`
  instance HasOptionalParam V2MetricsAssetHistoryGet PeriodId where
    applyOptionalParam req (PeriodId xs) =
      req `addQuery` toQuery ("period_id", Just xs)
  
  -- | /Optional Param/ "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)
  instance HasOptionalParam V2MetricsAssetHistoryGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  -- | @application/json@
  instance Produces V2MetricsAssetHistoryGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V2MetricsAssetHistoryGet MimeXMsgpack
  -- | @text/json@
  instance Produces V2MetricsAssetHistoryGet MimeTextJson
  -- | @text/plain@
  instance Produces V2MetricsAssetHistoryGet MimePlainText
  
  
  -- *** v2MetricsAssetListingGet
  
  -- | @GET \/v2\/metrics\/asset\/listing@
  -- 
  -- Listing of metrics available for specific asset
  -- 
  -- Get all metrics that are actually available for the specified asset.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v2MetricsAssetListingGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> AssetId -- ^ "assetId" -  Asset identifier (e.g., USDC, USDT)
    -> CoinAPIMarketDataRESTRequest V2MetricsAssetListingGet MimeNoContent [V1MetricInfo] accept
  v2MetricsAssetListingGet  _ (AssetId assetId) =
    _mkRequest "GET" ["/v2/metrics/asset/listing"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
      `addQuery` toQuery ("asset_id", Just assetId)
  
  data V2MetricsAssetListingGet  
  -- | @application/json@
  instance Produces V2MetricsAssetListingGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V2MetricsAssetListingGet MimeXMsgpack
  -- | @text/json@
  instance Produces V2MetricsAssetListingGet MimeTextJson
  -- | @text/plain@
  instance Produces V2MetricsAssetListingGet MimePlainText
  
  
  -- *** v2MetricsChainHistoryGet
  
  -- | @GET \/v2\/metrics\/chain\/history@
  -- 
  -- Historical metrics for the chain
  -- 
  -- Get chain metrics history.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v2MetricsChainHistoryGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> MetricId -- ^ "metricId" -  Metric identifier (e.g., `TVL`, `STABLES_BRIDGED_USD`)
    -> ChainId -- ^ "chainId" -  Chain identifier (e.g., `Ethereum`, `Arbitrum`)
    -> CoinAPIMarketDataRESTRequest V2MetricsChainHistoryGet MimeNoContent [A.Value] accept
  v2MetricsChainHistoryGet  _ (MetricId metricId) (ChainId chainId) =
    _mkRequest "GET" ["/v2/metrics/chain/history"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
      `addQuery` toQuery ("metric_id", Just metricId)
      `addQuery` toQuery ("chain_id", Just chainId)
  
  data V2MetricsChainHistoryGet  
  
  -- | /Optional Param/ "time_start" - Starting time in ISO 8601
  instance HasOptionalParam V2MetricsChainHistoryGet TimeStartDateTime where
    applyOptionalParam req (TimeStartDateTime xs) =
      req `addQuery` toQuery ("time_start", Just xs)
  
  -- | /Optional Param/ "time_end" - Ending time in ISO 8601
  instance HasOptionalParam V2MetricsChainHistoryGet TimeEndDateTime where
    applyOptionalParam req (TimeEndDateTime xs) =
      req `addQuery` toQuery ("time_end", Just xs)
  
  -- | /Optional Param/ "time_format" - If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)
  instance HasOptionalParam V2MetricsChainHistoryGet TimeFormat where
    applyOptionalParam req (TimeFormat xs) =
      req `addQuery` toQuery ("time_format", Just xs)
  
  -- | /Optional Param/ "period_id" - Identifier of requested timeseries period (e.g. `1MIN` or `2MTH`), default value is `1MIN`
  instance HasOptionalParam V2MetricsChainHistoryGet PeriodId where
    applyOptionalParam req (PeriodId xs) =
      req `addQuery` toQuery ("period_id", Just xs)
  
  -- | /Optional Param/ "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)
  instance HasOptionalParam V2MetricsChainHistoryGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  -- | @application/json@
  instance Produces V2MetricsChainHistoryGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V2MetricsChainHistoryGet MimeXMsgpack
  -- | @text/json@
  instance Produces V2MetricsChainHistoryGet MimeTextJson
  -- | @text/plain@
  instance Produces V2MetricsChainHistoryGet MimePlainText
  
  
  -- *** v2MetricsChainListingGet
  
  -- | @GET \/v2\/metrics\/chain\/listing@
  -- 
  -- Listing of metrics available for specific chain
  -- 
  -- Get all metrics that are actually available for the specified blockchain chain.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v2MetricsChainListingGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> ChainId -- ^ "chainId" -  Chain identifier (e.g., ETHEREUM, ARBITRUM)
    -> CoinAPIMarketDataRESTRequest V2MetricsChainListingGet MimeNoContent [V1MetricInfo] accept
  v2MetricsChainListingGet  _ (ChainId chainId) =
    _mkRequest "GET" ["/v2/metrics/chain/listing"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
      `addQuery` toQuery ("chain_id", Just chainId)
  
  data V2MetricsChainListingGet  
  -- | @application/json@
  instance Produces V2MetricsChainListingGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V2MetricsChainListingGet MimeXMsgpack
  -- | @text/json@
  instance Produces V2MetricsChainListingGet MimeTextJson
  -- | @text/plain@
  instance Produces V2MetricsChainListingGet MimePlainText
  
  
  -- *** v2MetricsExchangeHistoryGet
  
  -- | @GET \/v2\/metrics\/exchange\/history@
  -- 
  -- Historical metrics for the exchange
  -- 
  -- Get exchange metrics history.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v2MetricsExchangeHistoryGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> MetricId -- ^ "metricId" -  Metric identifier (e.g., `TVL`, `STABLES_BRIDGED_USD`)
    -> ExchangeId -- ^ "exchangeId" -  Exchange identifier (e.g., `BINANCE`, `UNISWAP-V3-ETHEREUM`)
    -> CoinAPIMarketDataRESTRequest V2MetricsExchangeHistoryGet MimeNoContent [A.Value] accept
  v2MetricsExchangeHistoryGet  _ (MetricId metricId) (ExchangeId exchangeId) =
    _mkRequest "GET" ["/v2/metrics/exchange/history"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
      `addQuery` toQuery ("metric_id", Just metricId)
      `addQuery` toQuery ("exchange_id", Just exchangeId)
  
  data V2MetricsExchangeHistoryGet  
  
  -- | /Optional Param/ "time_start" - Starting time in ISO 8601
  instance HasOptionalParam V2MetricsExchangeHistoryGet TimeStartDateTime where
    applyOptionalParam req (TimeStartDateTime xs) =
      req `addQuery` toQuery ("time_start", Just xs)
  
  -- | /Optional Param/ "time_end" - Ending time in ISO 8601
  instance HasOptionalParam V2MetricsExchangeHistoryGet TimeEndDateTime where
    applyOptionalParam req (TimeEndDateTime xs) =
      req `addQuery` toQuery ("time_end", Just xs)
  
  -- | /Optional Param/ "time_format" - If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)
  instance HasOptionalParam V2MetricsExchangeHistoryGet TimeFormat where
    applyOptionalParam req (TimeFormat xs) =
      req `addQuery` toQuery ("time_format", Just xs)
  
  -- | /Optional Param/ "period_id" - Identifier of requested timeseries period (e.g. `1MIN` or `2MTH`), default value is `1MIN`
  instance HasOptionalParam V2MetricsExchangeHistoryGet PeriodId where
    applyOptionalParam req (PeriodId xs) =
      req `addQuery` toQuery ("period_id", Just xs)
  
  -- | /Optional Param/ "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)
  instance HasOptionalParam V2MetricsExchangeHistoryGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  -- | @application/json@
  instance Produces V2MetricsExchangeHistoryGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V2MetricsExchangeHistoryGet MimeXMsgpack
  -- | @text/json@
  instance Produces V2MetricsExchangeHistoryGet MimeTextJson
  -- | @text/plain@
  instance Produces V2MetricsExchangeHistoryGet MimePlainText
  
  
  -- *** v2MetricsExchangeListingGet
  
  -- | @GET \/v2\/metrics\/exchange\/listing@
  -- 
  -- Listing of metrics available for specific exchange
  -- 
  -- Get all metrics that are actually available for the specified exchange.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v2MetricsExchangeListingGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> ExchangeId -- ^ "exchangeId" -  Exchange identifier (e.g., BINANCE, UNISWAP-V3-ETHEREUM)
    -> CoinAPIMarketDataRESTRequest V2MetricsExchangeListingGet MimeNoContent [V1MetricInfo] accept
  v2MetricsExchangeListingGet  _ (ExchangeId exchangeId) =
    _mkRequest "GET" ["/v2/metrics/exchange/listing"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
      `addQuery` toQuery ("exchange_id", Just exchangeId)
  
  data V2MetricsExchangeListingGet  
  -- | @application/json@
  instance Produces V2MetricsExchangeListingGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V2MetricsExchangeListingGet MimeXMsgpack
  -- | @text/json@
  instance Produces V2MetricsExchangeListingGet MimeTextJson
  -- | @text/plain@
  instance Produces V2MetricsExchangeListingGet MimePlainText
  
  
  -- *** v2MetricsListingGet
  
  -- | @GET \/v2\/metrics\/listing@
  -- 
  -- Listing of all supported metrics
  -- 
  -- Get all metrics available in the system.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v2MetricsListingGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> CoinAPIMarketDataRESTRequest V2MetricsListingGet MimeNoContent [V1MetricInfo] accept
  v2MetricsListingGet  _ =
    _mkRequest "GET" ["/v2/metrics/listing"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V2MetricsListingGet  
  -- | @application/json@
  instance Produces V2MetricsListingGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V2MetricsListingGet MimeXMsgpack
  -- | @text/json@
  instance Produces V2MetricsListingGet MimeTextJson
  -- | @text/plain@
  instance Produces V2MetricsListingGet MimePlainText
  
  