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.OrderBook
  -}
  
  {-# 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.OrderBook 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
  
  
  -- ** OrderBook
  
  -- *** v1OrderbooksSymbolIdCurrentGet
  
  -- | @GET \/v1\/orderbooks\/{symbol_id}\/current@
  -- 
  -- Get current order book
  -- 
  -- Retrieves the current order book for the specified symbol.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1OrderbooksSymbolIdCurrentGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> SymbolId -- ^ "symbolId" -  The symbol ID (from the Metadata -> Symbols)
    -> CoinAPIMarketDataRESTRequest V1OrderbooksSymbolIdCurrentGet MimeNoContent V1OrderBookBase accept
  v1OrderbooksSymbolIdCurrentGet  _ (SymbolId symbolId) =
    _mkRequest "GET" ["/v1/orderbooks/",toPath symbolId,"/current"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1OrderbooksSymbolIdCurrentGet  
  
  -- | /Optional Param/ "limit_levels" - The maximum number of levels to include in the response.
  instance HasOptionalParam V1OrderbooksSymbolIdCurrentGet LimitLevels where
    applyOptionalParam req (LimitLevels xs) =
      req `addQuery` toQuery ("limit_levels", Just xs)
  -- | @application/json@
  instance Produces V1OrderbooksSymbolIdCurrentGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1OrderbooksSymbolIdCurrentGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1OrderbooksSymbolIdCurrentGet MimeTextJson
  -- | @text/plain@
  instance Produces V1OrderbooksSymbolIdCurrentGet MimePlainText
  
  
  -- *** v1OrderbooksSymbolIdDepthCurrentGet
  
  -- | @GET \/v1\/orderbooks\/{symbol_id}\/depth\/current@
  -- 
  -- Current depth of the order book
  -- 
  -- Retrieves the current depth of the order book for the specified symbol.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1OrderbooksSymbolIdDepthCurrentGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> SymbolId -- ^ "symbolId" -  The symbol ID (from the Metadata -> Symbols)
    -> CoinAPIMarketDataRESTRequest V1OrderbooksSymbolIdDepthCurrentGet MimeNoContent V1OrderBookDepth accept
  v1OrderbooksSymbolIdDepthCurrentGet  _ (SymbolId symbolId) =
    _mkRequest "GET" ["/v1/orderbooks/",toPath symbolId,"/depth/current"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1OrderbooksSymbolIdDepthCurrentGet  
  
  -- | /Optional Param/ "limit_levels" - The maximum number of levels to include in the response.
  instance HasOptionalParam V1OrderbooksSymbolIdDepthCurrentGet LimitLevels where
    applyOptionalParam req (LimitLevels xs) =
      req `addQuery` toQuery ("limit_levels", Just xs)
  -- | @application/json@
  instance Produces V1OrderbooksSymbolIdDepthCurrentGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1OrderbooksSymbolIdDepthCurrentGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1OrderbooksSymbolIdDepthCurrentGet MimeTextJson
  -- | @text/plain@
  instance Produces V1OrderbooksSymbolIdDepthCurrentGet MimePlainText
  
  
  -- *** v1OrderbooksSymbolIdHistoryGet
  
  -- | @GET \/v1\/orderbooks\/{symbol_id}\/history@
  -- 
  -- Historical data
  -- 
  -- Get historical order book snapshots for a specific symbol within time range, returned in time ascending order.              :::info The historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels. :::  :::warning The 'time_start' and 'time_end' parameters must be from the same day as this endpoint provides intraday data only for specific day. Please use the 'date' parameter instead for querying data for a specific day without filter. :::
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1OrderbooksSymbolIdHistoryGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> SymbolId -- ^ "symbolId" -  Symbol identifier for requested timeseries (from the Metadata -> Symbols)
    -> CoinAPIMarketDataRESTRequest V1OrderbooksSymbolIdHistoryGet MimeNoContent [V1OrderBook] accept
  v1OrderbooksSymbolIdHistoryGet  _ (SymbolId symbolId) =
    _mkRequest "GET" ["/v1/orderbooks/",toPath symbolId,"/history"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1OrderbooksSymbolIdHistoryGet  
  
  -- | /Optional Param/ "date" - Date in ISO 8601, returned data is for the whole given day (preferred method, required if 'time_start' is not provided)
  instance HasOptionalParam V1OrderbooksSymbolIdHistoryGet ParamDate where
    applyOptionalParam req (ParamDate xs) =
      req `addQuery` toQuery ("date", Just xs)
  
  -- | /Optional Param/ "time_start" - Starting time in ISO 8601 (deprecated, use 'date' instead)
  instance HasOptionalParam V1OrderbooksSymbolIdHistoryGet TimeStart where
    applyOptionalParam req (TimeStart xs) =
      req `addQuery` toQuery ("time_start", Just xs)
  
  -- | /Optional Param/ "time_end" - Timeseries ending time in ISO 8601 (deprecated, use 'date' instead)
  instance HasOptionalParam V1OrderbooksSymbolIdHistoryGet TimeEnd where
    applyOptionalParam req (TimeEnd xs) =
      req `addQuery` toQuery ("time_end", Just xs)
  
  -- | /Optional Param/ "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)
  instance HasOptionalParam V1OrderbooksSymbolIdHistoryGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  
  -- | /Optional Param/ "limit_levels" - Maximum amount of levels from each side of the book to include in response (optional)
  instance HasOptionalParam V1OrderbooksSymbolIdHistoryGet LimitLevels where
    applyOptionalParam req (LimitLevels xs) =
      req `addQuery` toQuery ("limit_levels", Just xs)
  -- | @application/json@
  instance Produces V1OrderbooksSymbolIdHistoryGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1OrderbooksSymbolIdHistoryGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1OrderbooksSymbolIdHistoryGet MimeTextJson
  -- | @text/plain@
  instance Produces V1OrderbooksSymbolIdHistoryGet MimePlainText
  
  
  -- *** v1OrderbooksSymbolIdLatestGet
  
  -- | @GET \/v1\/orderbooks\/{symbol_id}\/latest@
  -- 
  -- Latest data
  -- 
  -- Get latest order book snapshots for a specific symbol, returned in time descending order.              :::info The historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels. :::
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1OrderbooksSymbolIdLatestGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> SymbolId -- ^ "symbolId" -  Symbol identifier of requested timeseries (from the Metadata -> Symbols)
    -> CoinAPIMarketDataRESTRequest V1OrderbooksSymbolIdLatestGet MimeNoContent [V1OrderBook] accept
  v1OrderbooksSymbolIdLatestGet  _ (SymbolId symbolId) =
    _mkRequest "GET" ["/v1/orderbooks/",toPath symbolId,"/latest"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1OrderbooksSymbolIdLatestGet  
  
  -- | /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 V1OrderbooksSymbolIdLatestGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  
  -- | /Optional Param/ "limit_levels" - Maximum amount of levels from each side of the book to include in response (optional)
  instance HasOptionalParam V1OrderbooksSymbolIdLatestGet LimitLevels where
    applyOptionalParam req (LimitLevels xs) =
      req `addQuery` toQuery ("limit_levels", Just xs)
  -- | @application/json@
  instance Produces V1OrderbooksSymbolIdLatestGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1OrderbooksSymbolIdLatestGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1OrderbooksSymbolIdLatestGet MimeTextJson
  -- | @text/plain@
  instance Produces V1OrderbooksSymbolIdLatestGet MimePlainText
  
  