{-# LANGUAGE DataKinds                  #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings          #-}

module CoinbasePro.Headers
    ( RequiredHeader
    , UserAgent
    , UserAgentHeader

    , userAgent
    ) where

import           Data.Text       (Text)
import           Servant.API     (Header', Required)
import           Web.HttpApiData (ToHttpApiData (..))


type RequiredHeader = Header' '[Required]


newtype UserAgent = UserAgent Text
    deriving (UserAgent -> UserAgent -> Bool
(UserAgent -> UserAgent -> Bool)
-> (UserAgent -> UserAgent -> Bool) -> Eq UserAgent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserAgent -> UserAgent -> Bool
$c/= :: UserAgent -> UserAgent -> Bool
== :: UserAgent -> UserAgent -> Bool
$c== :: UserAgent -> UserAgent -> Bool
Eq, Int -> UserAgent -> ShowS
[UserAgent] -> ShowS
UserAgent -> String
(Int -> UserAgent -> ShowS)
-> (UserAgent -> String)
-> ([UserAgent] -> ShowS)
-> Show UserAgent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserAgent] -> ShowS
$cshowList :: [UserAgent] -> ShowS
show :: UserAgent -> String
$cshow :: UserAgent -> String
showsPrec :: Int -> UserAgent -> ShowS
$cshowsPrec :: Int -> UserAgent -> ShowS
Show, UserAgent -> ByteString
UserAgent -> Builder
UserAgent -> Text
(UserAgent -> Text)
-> (UserAgent -> Builder)
-> (UserAgent -> ByteString)
-> (UserAgent -> Text)
-> ToHttpApiData UserAgent
forall a.
(a -> Text)
-> (a -> Builder)
-> (a -> ByteString)
-> (a -> Text)
-> ToHttpApiData a
toQueryParam :: UserAgent -> Text
$ctoQueryParam :: UserAgent -> Text
toHeader :: UserAgent -> ByteString
$ctoHeader :: UserAgent -> ByteString
toEncodedUrlPiece :: UserAgent -> Builder
$ctoEncodedUrlPiece :: UserAgent -> Builder
toUrlPiece :: UserAgent -> Text
$ctoUrlPiece :: UserAgent -> Text
ToHttpApiData)


userAgent :: UserAgent
userAgent :: UserAgent
userAgent = Text -> UserAgent
UserAgent Text
"coinbase-pro/0.9"


type UserAgentHeader = RequiredHeader "User-Agent" UserAgent