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.Trades
  -}
  
  {-# 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.Trades 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
  
  
  -- ** Trades
  
  -- *** v1TradesLatestGet
  
  -- | @GET \/v1\/trades\/latest@
  -- 
  -- Latest data
  -- 
  -- Get latest trades executed up to 1 minute ago. Latest data is always returned in time descending order.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1TradesLatestGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> CoinAPIMarketDataRESTRequest V1TradesLatestGet MimeNoContent [V1Trade] accept
  v1TradesLatestGet  _ =
    _mkRequest "GET" ["/v1/trades/latest"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1TradesLatestGet  
  
  -- | /Optional Param/ "filter_symbol_id" - Comma or semicolon delimited parts of symbol identifier used to filter response. (optional)
  instance HasOptionalParam V1TradesLatestGet FilterSymbolId where
    applyOptionalParam req (FilterSymbolId xs) =
      req `addQuery` toQuery ("filter_symbol_id", Just xs)
  
  -- | /Optional Param/ "include_id" - Information that additional exchange trade identifier should be included in the `id_trade` parameter of the trade if exchange providing identifiers.
  instance HasOptionalParam V1TradesLatestGet IncludeId where
    applyOptionalParam req (IncludeId xs) =
      req `addQuery` toQuery ("include_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 V1TradesLatestGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  -- | @application/json@
  instance Produces V1TradesLatestGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1TradesLatestGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1TradesLatestGet MimeTextJson
  -- | @text/plain@
  instance Produces V1TradesLatestGet MimePlainText
  
  
  -- *** v1TradesSymbolIdHistoryGet
  
  -- | @GET \/v1\/trades\/{symbol_id}\/history@
  -- 
  -- Historical data
  -- 
  -- Get history transactions from specific symbol, returned in time ascending order.  :::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'
  -- 
  v1TradesSymbolIdHistoryGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> SymbolId -- ^ "symbolId" -  Symbol identifier for requested timeseries (from the Metadata -> Symbols)
    -> CoinAPIMarketDataRESTRequest V1TradesSymbolIdHistoryGet MimeNoContent [V1Trade] accept
  v1TradesSymbolIdHistoryGet  _ (SymbolId symbolId) =
    _mkRequest "GET" ["/v1/trades/",toPath symbolId,"/history"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1TradesSymbolIdHistoryGet  
  
  -- | /Optional Param/ "date" - Date in ISO 8601, returned data is for the whole given day (required if 'time_start' is not provided)
  instance HasOptionalParam V1TradesSymbolIdHistoryGet ParamDate where
    applyOptionalParam req (ParamDate xs) =
      req `addQuery` toQuery ("date", Just xs)
  
  -- | /Optional Param/ "time_start" - Starting time in ISO 8601
  instance HasOptionalParam V1TradesSymbolIdHistoryGet TimeStart where
    applyOptionalParam req (TimeStart xs) =
      req `addQuery` toQuery ("time_start", Just xs)
  
  -- | /Optional Param/ "time_end" - Timeseries ending time in ISO 8601
  instance HasOptionalParam V1TradesSymbolIdHistoryGet 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 V1TradesSymbolIdHistoryGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  
  -- | /Optional Param/ "include_id" - Information that additional exchange trade identifier should be included in the `id_trade` parameter of the trade if exchange providing identifiers.
  instance HasOptionalParam V1TradesSymbolIdHistoryGet IncludeId where
    applyOptionalParam req (IncludeId xs) =
      req `addQuery` toQuery ("include_id", Just xs)
  -- | @application/json@
  instance Produces V1TradesSymbolIdHistoryGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1TradesSymbolIdHistoryGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1TradesSymbolIdHistoryGet MimeTextJson
  -- | @text/plain@
  instance Produces V1TradesSymbolIdHistoryGet MimePlainText
  
  
  -- *** v1TradesSymbolIdLatestGet
  
  -- | @GET \/v1\/trades\/{symbol_id}\/latest@
  -- 
  -- Latest data by symbol_id
  -- 
  -- Get latest trades executed up to 1 minute ago. Latest data is always returned in time descending order.
  -- 
  -- AuthMethod: 'AuthApiKeyAPIKey', 'AuthBasicJWT'
  -- 
  v1TradesSymbolIdLatestGet
    :: Accept accept -- ^ request accept ('MimeType')
    -> SymbolId -- ^ "symbolId" -  Symbol identifier for requested timeseries (from the Metadata -> Symbols)
    -> CoinAPIMarketDataRESTRequest V1TradesSymbolIdLatestGet MimeNoContent [V1Trade] accept
  v1TradesSymbolIdLatestGet  _ (SymbolId symbolId) =
    _mkRequest "GET" ["/v1/trades/",toPath symbolId,"/latest"]
      `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyAPIKey)
      `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicJWT)
  
  data V1TradesSymbolIdLatestGet  
  
  -- | /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 V1TradesSymbolIdLatestGet Limit where
    applyOptionalParam req (Limit xs) =
      req `addQuery` toQuery ("limit", Just xs)
  
  -- | /Optional Param/ "include_id" - Information that additional exchange trade identifier should be included in the `id_trade` parameter of the trade if exchange providing identifiers.
  instance HasOptionalParam V1TradesSymbolIdLatestGet IncludeId where
    applyOptionalParam req (IncludeId xs) =
      req `addQuery` toQuery ("include_id", Just xs)
  -- | @application/json@
  instance Produces V1TradesSymbolIdLatestGet MimeJSON
  -- | @application/x-msgpack@
  instance Produces V1TradesSymbolIdLatestGet MimeXMsgpack
  -- | @text/json@
  instance Produces V1TradesSymbolIdLatestGet MimeTextJson
  -- | @text/plain@
  instance Produces V1TradesSymbolIdLatestGet MimePlainText
  
  