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.Metadata
  -}
  
  {-# 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.Metadata 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
  
  
  -- ** Metadata
  
  -- *** v1AssetsAssetIdGet
  
  -- | @GET \/v1\/assets\/{asset_id}@
  -- 
  -- List all assets by asset ID
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1AssetsAssetIdGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> AssetId -- ^ "assetId" -  The asset ID.
    -> CoinAPIMarketDataRESTRequest V1AssetsAssetIdGet MimeNoContent [V1Asset] accept
  v1AssetsAssetIdGet  _ (AssetId assetId) =
    _mkRequest "GET" ["/v1/assets/",toPath assetId]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1AssetsAssetIdGet  
  -- | @application/json@
  instance Produces V1AssetsAssetIdGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1AssetsAssetIdGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1AssetsAssetIdGet MimeTextJson
  -- | @text/plain@
  instance Produces V1AssetsAssetIdGet MimePlainText
  
  
  -- *** v1AssetsGet
  
  -- | @GET \/v1\/assets@
  -- 
  -- List all assets
  -- 
  -- Retrieves all assets.              :::info Our asset identifiers are aligned with the ISO 4217 currency codes standard only for fiat money (government or law regulated currency). :::              :::info Properties of the output are providing aggregated information from across all symbols related to the specific asset. If you need to calculate your aggregation (e.g., limiting only the particular type of symbols), you should use /v1/symbols endpoint as a data source. :::
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1AssetsGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> CoinAPIMarketDataRESTRequest V1AssetsGet MimeNoContent [V1Asset] accept
  v1AssetsGet  _ =
    _mkRequest "GET" ["/v1/assets"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1AssetsGet  
  
  -- | /Optional Param/ "filter_asset_id" - Comma or semicolon delimited asset identifiers used to filter response. (optional, eg. `BTC;ETH`).
  instance HasOptionalParam V1AssetsGet FilterAssetId where
    applyOptionalParam req (FilterAssetId xs) =
      req `addQuery` toQuery ("filter_asset_id", Just xs)
  -- | @application/json@
  instance Produces V1AssetsGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1AssetsGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1AssetsGet MimeTextJson
  -- | @text/plain@
  instance Produces V1AssetsGet MimePlainText
  
  
  -- *** v1AssetsIconsSizeGet
  
  -- | @GET \/v1\/assets\/icons\/{size}@
  -- 
  -- List all asset icons
  -- 
  -- Gets the list of icons (of the given size) for all the assets.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1AssetsIconsSizeGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> Size -- ^ "size" -  The size of the icons.
    -> CoinAPIMarketDataRESTRequest V1AssetsIconsSizeGet MimeNoContent [V1Icon] accept
  v1AssetsIconsSizeGet  _ (Size size) =
    _mkRequest "GET" ["/v1/assets/icons/",toPath size]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1AssetsIconsSizeGet  
  -- | @application/json@
  instance Produces V1AssetsIconsSizeGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1AssetsIconsSizeGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1AssetsIconsSizeGet MimeTextJson
  -- | @text/plain@
  instance Produces V1AssetsIconsSizeGet MimePlainText
  
  
  -- *** v1ChainsChainIdGet
  
  -- | @GET \/v1\/chains\/{chain_id}@
  -- 
  -- List all chains by chain ID
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1ChainsChainIdGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> ChainId -- ^ "chainId" -  The chain ID.
    -> CoinAPIMarketDataRESTRequest V1ChainsChainIdGet MimeNoContent [V1Chain] accept
  v1ChainsChainIdGet  _ (ChainId chainId) =
    _mkRequest "GET" ["/v1/chains/",toPath chainId]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1ChainsChainIdGet  
  -- | @application/json@
  instance Produces V1ChainsChainIdGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1ChainsChainIdGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1ChainsChainIdGet MimeTextJson
  -- | @text/plain@
  instance Produces V1ChainsChainIdGet MimePlainText
  
  
  -- *** v1ChainsGet
  
  -- | @GET \/v1\/chains@
  -- 
  -- List all blockchain chains
  -- 
  -- Retrieves all blockchain chains supported by the system.              :::info Properties of the output are providing aggregated information from across all symbols related to the specific chain. If you need to calculate your aggregation (e.g., limiting only the particular type of symbols), you should use /v1/symbols endpoint as a data source. :::
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1ChainsGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> CoinAPIMarketDataRESTRequest V1ChainsGet MimeNoContent [V1Chain] accept
  v1ChainsGet  _ =
    _mkRequest "GET" ["/v1/chains"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1ChainsGet  
  
  -- | /Optional Param/ "filter_chain_id" - Comma or semicolon delimited chain identifiers used to filter response. (optional, eg. `ETHEREUM;ARBITRUM`).
  instance HasOptionalParam V1ChainsGet FilterChainId where
    applyOptionalParam req (FilterChainId xs) =
      req `addQuery` toQuery ("filter_chain_id", Just xs)
  -- | @application/json@
  instance Produces V1ChainsGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1ChainsGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1ChainsGet MimeTextJson
  -- | @text/plain@
  instance Produces V1ChainsGet MimePlainText
  
  
  -- *** v1ExchangesExchangeIdGet
  
  -- | @GET \/v1\/exchanges\/{exchange_id}@
  -- 
  -- List all exchanges by exchange_id
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1ExchangesExchangeIdGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> ExchangeId -- ^ "exchangeId" -  The ID of the exchange.
    -> CoinAPIMarketDataRESTRequest V1ExchangesExchangeIdGet MimeNoContent [V1Exchange] accept
  v1ExchangesExchangeIdGet  _ (ExchangeId exchangeId) =
    _mkRequest "GET" ["/v1/exchanges/",toPath exchangeId]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1ExchangesExchangeIdGet  
  -- | @application/json@
  instance Produces V1ExchangesExchangeIdGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1ExchangesExchangeIdGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1ExchangesExchangeIdGet MimeTextJson
  -- | @text/plain@
  instance Produces V1ExchangesExchangeIdGet MimePlainText
  
  
  -- *** v1ExchangesGet
  
  -- | @GET \/v1\/exchanges@
  -- 
  -- List all exchanges
  -- 
  -- Get a detailed list of exchanges provided by the system.              :::info Properties of the output are providing aggregated information from across all symbols related to the specific exchange. If you need to calculate your aggregation (e.g., limiting only the particular type of symbols), you should use /v1/symbols endpoint as a data source. :::
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1ExchangesGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> CoinAPIMarketDataRESTRequest V1ExchangesGet MimeNoContent [V1Exchange] accept
  v1ExchangesGet  _ =
    _mkRequest "GET" ["/v1/exchanges"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1ExchangesGet  
  
  -- | /Optional Param/ "filter_exchange_id" - Comma or semicolon delimited exchange identifiers used to filter response. (optional, eg. `BITSTAMP;GEMINI`)
  instance HasOptionalParam V1ExchangesGet FilterExchangeId where
    applyOptionalParam req (FilterExchangeId xs) =
      req `addQuery` toQuery ("filter_exchange_id", Just xs)
  -- | @application/json@
  instance Produces V1ExchangesGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1ExchangesGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1ExchangesGet MimeTextJson
  -- | @text/plain@
  instance Produces V1ExchangesGet MimePlainText
  
  
  -- *** v1ExchangesIconsSizeGet
  
  -- | @GET \/v1\/exchanges\/icons\/{size}@
  -- 
  -- List of icons for the exchanges
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1ExchangesIconsSizeGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> Size -- ^ "size" -  The size of the icons.
    -> CoinAPIMarketDataRESTRequest V1ExchangesIconsSizeGet MimeNoContent [V1Icon] accept
  v1ExchangesIconsSizeGet  _ (Size size) =
    _mkRequest "GET" ["/v1/exchanges/icons/",toPath size]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1ExchangesIconsSizeGet  
  -- | @application/json@
  instance Produces V1ExchangesIconsSizeGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1ExchangesIconsSizeGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1ExchangesIconsSizeGet MimeTextJson
  -- | @text/plain@
  instance Produces V1ExchangesIconsSizeGet MimePlainText
  
  
  -- *** v1SymbolsExchangeIdActiveGet
  
  -- | @GET \/v1\/symbols\/{exchange_id}\/active@
  -- 
  -- List all active symbols
  -- 
  -- Retrieves all currently active (listed) symbols, with optional filtering.              :::info \"price_precision\" and \"size_precision\" are data precisions and are not always the same precisions used for trading eg. for the \"BINANCE\" exchanges. :::              :::info You should not assume that the market data will be always within the resolution provided by the \"price_precision\" and \"size_precision\". The fact that the precision values can be derived from a posterior implies the fact that this data could be delayed, also it can be changed by the data source without notice and we will immediately deliver data with the new precision while could not update the precision values in this endpoint immediately. :::              ### Symbol identifier              Our symbol identifier is created using a pattern that depends on symbol type.              Type | `symbol_id` pattern --------- | --------- SPOT | `{exchange_id}_SPOT_{asset_id_base}_{asset_id_quote}` FUTURES | `{exchange_id}_FTS_{asset_id_base}_{asset_id_quote}_{YYMMDD of future_delivery_time}` OPTION | `{exchange_id}_OPT_{asset_id_base}_{asset_id_quote}_{YYMMDD of option_expiration_time}_{option_strike_price}_{option_type_is_call as C/P}` PERPETUAL | `{exchange_id}_PERP_{asset_id_base}_{asset_id_quote}` INDEX | `{exchange_id}_IDX_{index_id}` CREDIT | `{exchange_id}_CRE_{asset_id_base}` CONTACT  | `{exchange_id}_COT_{contract_id}`              :::info In the unlikely event when the \"symbol_id\" for more than one market is the same. We will append the additional term (prefixed with the \"_\") at the end of the duplicated identifiers to differentiate them. :::info              ### Symbol types list (enumeration of `symbol_type` output variable)              Type | Name | Description -------- | - | ----------- SPOT | FX Spot | Agreement to exchange one asset for another one *(e.g. Buy BTC for USD)* FUTURES | Futures contract | FX Spot derivative contract where traders agree to trade fx spot at predetermined future time OPTION | Option contract | FX Spot derivative contract where traders agree to trade right to require buy or sell of fx spot at agreed price on exercise date PERPETUAL | Perpetual contract | FX Spot derivative contract where traders agree to trade fx spot continously without predetermined future delivery time INDEX | Index | Statistical composite that measures changes in the economy or markets. CREDIT | Credit/Funding | Margin funding contract. Order book displays lending offers and borrow bids. Price represents the daily rate. CONTRACT | Contract | Represents other types of financial instruments *(e.g. spreads, interest rate swap)*              ### Additional output variables for `symbol_type = INDEX`              Variable | Description --------- | ----------- index_id | Index identifier index_display_name | Human readable name of the index *(optional)* index_display_description | Description of the index *(optional)*              ### Additional output variables for `symbol_type = FUTURES`              Variable | Description --------- | ----------- future_delivery_time | Predetermined time of futures contract delivery date in ISO 8601 future_contract_unit | Contact size *(eg. 10 BTC if `future_contract_unit` = `10` and `future_contract_unit_asset` = `BTC`)* future_contract_unit_asset | Identifier of the asset used to denominate the contract unit              ### Additional output variables for `symbol_type = PERPETUAL`              Variable | Description --------- | ----------- future_contract_unit | Contact size *(eg. 10 BTC if `future_contract_unit` = `10` and `future_contract_unit_asset` = `BTC`)* future_contract_unit_asset | Identifier of the asset used to denominate the contract unit              ### Additional output variables for `symbol_type = OPTION`              Variable | Description --------- | ----------- option_type_is_call | Boolean value representing option type. `true` for Call options, `false` for Put options option_strike_price | Price at which option contract can be exercised option_contract_unit | Base asset amount of underlying spot which single option represents option_exercise_style | Option exercise style. Can be `EUROPEAN` or `AMERICAN` option_expiration_time | Option contract expiration time in ISO 8601              ### Additional output variables for `symbol_type = CONTRACT`              Variable | Description --------- | ----------- contract_delivery_time | Predetermined time of contract delivery date in ISO 8601 contract_unit | Contact size *(eg. 10 BTC if `contract_unit` = `10` and `contract_unit_asset` = `BTC`)* contract_unit_asset | Identifier of the asset used to denominate the contract unit contract_id | Identifier of contract by the exchange
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1SymbolsExchangeIdActiveGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> ExchangeId -- ^ "exchangeId" -  The ID of the exchange.
    -> CoinAPIMarketDataRESTRequest V1SymbolsExchangeIdActiveGet MimeNoContent [V1Symbol] accept
  v1SymbolsExchangeIdActiveGet  _ (ExchangeId exchangeId) =
    _mkRequest "GET" ["/v1/symbols/",toPath exchangeId,"/active"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1SymbolsExchangeIdActiveGet  
  
  -- | /Optional Param/ "filter_symbol_id" - Comma or semicolon delimited parts of symbol identifier used to filter response. (optional, eg. `BITSTAMP`_ or `BINANCE_SPOT_`)
  instance HasOptionalParam V1SymbolsExchangeIdActiveGet FilterSymbolId where
    applyOptionalParam req (FilterSymbolId xs) =
      req `addQuery` toQuery ("filter_symbol_id", Just xs)
  
  -- | /Optional Param/ "filter_asset_id" - The filter for asset ID.
  instance HasOptionalParam V1SymbolsExchangeIdActiveGet FilterAssetId where
    applyOptionalParam req (FilterAssetId xs) =
      req `addQuery` toQuery ("filter_asset_id", Just xs)
  -- | @application/json@
  instance Produces V1SymbolsExchangeIdActiveGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1SymbolsExchangeIdActiveGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1SymbolsExchangeIdActiveGet MimeTextJson
  -- | @text/plain@
  instance Produces V1SymbolsExchangeIdActiveGet MimePlainText
  
  
  -- *** v1SymbolsExchangeIdHistoryGet
  
  -- | @GET \/v1\/symbols\/{exchange_id}\/history@
  -- 
  -- List all historical symbols for an exchange.
  -- 
  -- This endpoint provides access to symbols that are no longer actively traded or listed on a given exchange. The data is provided with pagination support.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1SymbolsExchangeIdHistoryGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> ExchangeId -- ^ "exchangeId" -  The ID of the exchange.
    -> CoinAPIMarketDataRESTRequest V1SymbolsExchangeIdHistoryGet MimeNoContent [V1Symbol] accept
  v1SymbolsExchangeIdHistoryGet  _ (ExchangeId exchangeId) =
    _mkRequest "GET" ["/v1/symbols/",toPath exchangeId,"/history"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1SymbolsExchangeIdHistoryGet  
  
  -- | /Optional Param/ "page" - The page number for pagination (starts from 1).
  instance HasOptionalParam V1SymbolsExchangeIdHistoryGet Page where
    applyOptionalParam req (Page xs) =
      req `addQuery` toQuery ("page", Just xs)
  
  -- | /Optional Param/ "limit" - Number of records to return per page.
  instance HasOptionalParam V1SymbolsExchangeIdHistoryGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  -- | @application/json@
  instance Produces V1SymbolsExchangeIdHistoryGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1SymbolsExchangeIdHistoryGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1SymbolsExchangeIdHistoryGet MimeTextJson
  -- | @text/plain@
  instance Produces V1SymbolsExchangeIdHistoryGet MimePlainText
  
  
  -- *** v1SymbolsMapExchangeIdGet
  
  -- | @GET \/v1\/symbols\/map\/{exchange_id}@
  -- 
  -- List active symbol mapping for the exchange
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1SymbolsMapExchangeIdGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> ExchangeId -- ^ "exchangeId" -  The ID of the exchange (from the Metadata -> Exchanges)
    -> CoinAPIMarketDataRESTRequest V1SymbolsMapExchangeIdGet MimeNoContent [V1SymbolMapping] accept
  v1SymbolsMapExchangeIdGet  _ (ExchangeId exchangeId) =
    _mkRequest "GET" ["/v1/symbols/map/",toPath exchangeId]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1SymbolsMapExchangeIdGet  
  -- | @application/json@
  instance Produces V1SymbolsMapExchangeIdGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1SymbolsMapExchangeIdGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1SymbolsMapExchangeIdGet MimeTextJson
  -- | @text/plain@
  instance Produces V1SymbolsMapExchangeIdGet MimePlainText
  
  