-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | automatical derivation of querying functions for servant webservices
--   
--   This library lets you derive automatically Haskell functions that let
--   you query each endpoint of a <a>servant</a> webservice.
--   
--   See <a>the client section of the tutorial</a>.
--   
--   <a>CHANGELOG</a>
@package servant-client
@version 0.9.1.1

module Servant.Common.BaseUrl

-- | Simple data type to represent the target of HTTP requests for
--   servant's automatically-generated clients.
data BaseUrl
BaseUrl :: Scheme -> String -> Int -> String -> BaseUrl

-- | URI scheme to use
[baseUrlScheme] :: BaseUrl -> Scheme

-- | host (eg "haskell.org")
[baseUrlHost] :: BaseUrl -> String

-- | port (eg 80)
[baseUrlPort] :: BaseUrl -> Int

-- | path (eg "<i>a</i>b/c")
[baseUrlPath] :: BaseUrl -> String
data InvalidBaseUrlException

-- | URI scheme to use
data Scheme

-- | http://
Http :: Scheme

-- | https://
Https :: Scheme
parseBaseUrl :: MonadThrow m => String -> m BaseUrl
showBaseUrl :: BaseUrl -> String
instance GHC.Show.Show Servant.Common.BaseUrl.InvalidBaseUrlException
instance GHC.Generics.Generic Servant.Common.BaseUrl.BaseUrl
instance GHC.Classes.Ord Servant.Common.BaseUrl.BaseUrl
instance GHC.Show.Show Servant.Common.BaseUrl.BaseUrl
instance GHC.Generics.Generic Servant.Common.BaseUrl.Scheme
instance GHC.Classes.Ord Servant.Common.BaseUrl.Scheme
instance GHC.Classes.Eq Servant.Common.BaseUrl.Scheme
instance GHC.Show.Show Servant.Common.BaseUrl.Scheme
instance GHC.Classes.Eq Servant.Common.BaseUrl.BaseUrl
instance GHC.Exception.Exception Servant.Common.BaseUrl.InvalidBaseUrlException

module Servant.Common.Req
data ServantError
FailureResponse :: Status -> MediaType -> ByteString -> ServantError
[responseStatus] :: ServantError -> Status
[responseContentType] :: ServantError -> MediaType
[responseBody] :: ServantError -> ByteString
DecodeFailure :: String -> MediaType -> ByteString -> ServantError
[decodeError] :: ServantError -> String
[responseContentType] :: ServantError -> MediaType
[responseBody] :: ServantError -> ByteString
UnsupportedContentType :: MediaType -> ByteString -> ServantError
[responseContentType] :: ServantError -> MediaType
[responseBody] :: ServantError -> ByteString
InvalidContentTypeHeader :: ByteString -> ByteString -> ServantError
[responseContentTypeHeader] :: ServantError -> ByteString
[responseBody] :: ServantError -> ByteString
ConnectionError :: SomeException -> ServantError
[connectionError] :: ServantError -> SomeException
data Req
Req :: String -> QueryText -> Maybe (ByteString, MediaType) -> [MediaType] -> [(String, Text)] -> Req
[reqPath] :: Req -> String
[qs] :: Req -> QueryText
[reqBody] :: Req -> Maybe (ByteString, MediaType)
[reqAccept] :: Req -> [MediaType]
[headers] :: Req -> [(String, Text)]
defReq :: Req
appendToPath :: String -> Req -> Req
appendToQueryString :: Text -> Maybe Text -> Req -> Req
addHeader :: ToHttpApiData a => String -> a -> Req -> Req
setRQBody :: ByteString -> MediaType -> Req -> Req
reqToRequest :: (Functor m, MonadThrow m) => Req -> BaseUrl -> m Request
displayHttpRequest :: Method -> String
data ClientEnv
ClientEnv :: Manager -> BaseUrl -> ClientEnv
[manager] :: ClientEnv -> Manager
[baseUrl] :: ClientEnv -> BaseUrl

-- | <tt>ClientM</tt> is the monad in which client functions run. Contains
--   the <a>Manager</a> and <a>BaseUrl</a> used for requests in the reader
--   environment.
newtype ClientM a
ClientM :: ReaderT ClientEnv (ExceptT ServantError IO) a -> ClientM a
[runClientM'] :: ClientM a -> ReaderT ClientEnv (ExceptT ServantError IO) a
runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a)
performRequest :: Method -> Req -> ClientM (Int, ByteString, MediaType, [Header], Response ByteString)
performRequestCT :: MimeUnrender ct result => Proxy ct -> Method -> Req -> ClientM ([Header], result)
performRequestNoBody :: Method -> Req -> ClientM [Header]
catchConnectionError :: IO a -> IO (Either ServantError a)
instance Control.Monad.Catch.MonadCatch Servant.Common.Req.ClientM
instance Control.Monad.Catch.MonadThrow Servant.Common.Req.ClientM
instance Control.Monad.Error.Class.MonadError Servant.Common.Req.ServantError Servant.Common.Req.ClientM
instance Control.Monad.Reader.Class.MonadReader Servant.Common.Req.ClientEnv Servant.Common.Req.ClientM
instance GHC.Generics.Generic (Servant.Common.Req.ClientM a)
instance Control.Monad.IO.Class.MonadIO Servant.Common.Req.ClientM
instance GHC.Base.Monad Servant.Common.Req.ClientM
instance GHC.Base.Applicative Servant.Common.Req.ClientM
instance GHC.Base.Functor Servant.Common.Req.ClientM
instance GHC.Show.Show Servant.Common.Req.ServantError
instance GHC.Classes.Eq Servant.Common.Req.ServantError
instance GHC.Exception.Exception Servant.Common.Req.ServantError


-- | Basic Authentication for clients
module Servant.Common.BasicAuth

-- | Authenticate a request using Basic Authentication
basicAuthReq :: BasicAuthData -> Req -> Req


-- | Authentication for clients
module Servant.Client.Experimental.Auth

-- | For better type inference and to avoid usage of a data family, we
--   newtype wrap the combination of some <a>AuthClientData</a> and a
--   function to add authentication data to a request
--   
--   NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
newtype AuthenticateReq a
AuthenticateReq :: (AuthClientData a, AuthClientData a -> Req -> Req) -> AuthenticateReq a
[unAuthReq] :: AuthenticateReq a -> (AuthClientData a, AuthClientData a -> Req -> Req)

-- | For a resource protected by authentication (e.g. AuthProtect), we need
--   to provide the client with some data used to add authentication data
--   to a request
--   
--   NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE

-- | Handy helper to avoid wrapping datatypes in tuples everywhere.
--   
--   NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
mkAuthenticateReq :: AuthClientData a -> (AuthClientData a -> Req -> Req) -> AuthenticateReq a


-- | This module provides <a>client</a> which can automatically generate
--   querying functions for each endpoint just from the type representing
--   your API.
module Servant.Client

-- | For a resource protected by authentication (e.g. AuthProtect), we need
--   to provide the client with some data used to add authentication data
--   to a request
--   
--   NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE

-- | For better type inference and to avoid usage of a data family, we
--   newtype wrap the combination of some <a>AuthClientData</a> and a
--   function to add authentication data to a request
--   
--   NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
newtype AuthenticateReq a
AuthenticateReq :: (AuthClientData a, AuthClientData a -> Req -> Req) -> AuthenticateReq a
[unAuthReq] :: AuthenticateReq a -> (AuthClientData a, AuthClientData a -> Req -> Req)

-- | <a>client</a> allows you to produce operations to query an API from a
--   client.
--   
--   <pre>
--   type MyApi = "books" :&gt; Get '[JSON] [Book] -- GET /books
--           :&lt;|&gt; "books" :&gt; ReqBody '[JSON] Book :&gt; Post '[JSON] Book -- POST /books
--   
--   myApi :: Proxy MyApi
--   myApi = Proxy
--   
--   getAllBooks :: ClientM [Book]
--   postNewBook :: Book -&gt; ClientM Book
--   (getAllBooks :&lt;|&gt; postNewBook) = client myApi
--   </pre>
client :: HasClient api => Proxy api -> Client api

-- | This class lets us define how each API combinator influences the
--   creation of an HTTP request. It's mostly an internal class, you can
--   just use <a>client</a>.
class HasClient api where type Client api :: * where {
    type family Client api :: *;
}
clientWithRoute :: HasClient api => Proxy api -> Req -> Client api

-- | <tt>ClientM</tt> is the monad in which client functions run. Contains
--   the <a>Manager</a> and <a>BaseUrl</a> used for requests in the reader
--   environment.
data ClientM a
runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a)
data ClientEnv
ClientEnv :: Manager -> BaseUrl -> ClientEnv

-- | Handy helper to avoid wrapping datatypes in tuples everywhere.
--   
--   NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
mkAuthenticateReq :: AuthClientData a -> (AuthClientData a -> Req -> Req) -> AuthenticateReq a
data ServantError
FailureResponse :: Status -> MediaType -> ByteString -> ServantError
[responseStatus] :: ServantError -> Status
[responseContentType] :: ServantError -> MediaType
[responseBody] :: ServantError -> ByteString
DecodeFailure :: String -> MediaType -> ByteString -> ServantError
[decodeError] :: ServantError -> String
[responseContentType] :: ServantError -> MediaType
[responseBody] :: ServantError -> ByteString
UnsupportedContentType :: MediaType -> ByteString -> ServantError
[responseContentType] :: ServantError -> MediaType
[responseBody] :: ServantError -> ByteString
InvalidContentTypeHeader :: ByteString -> ByteString -> ServantError
[responseContentTypeHeader] :: ServantError -> ByteString
[responseBody] :: ServantError -> ByteString
ConnectionError :: SomeException -> ServantError
[connectionError] :: ServantError -> SomeException
instance (Servant.Client.HasClient a, Servant.Client.HasClient b) => Servant.Client.HasClient (a Servant.API.Alternative.:<|> b)
instance forall k (capture :: GHC.Types.Symbol) a (api :: k). (GHC.TypeLits.KnownSymbol capture, Web.Internal.HttpApiData.ToHttpApiData a, Servant.Client.HasClient api) => Servant.Client.HasClient (Servant.API.Capture.Capture capture a Servant.API.Sub.:> api)
instance forall k (capture :: GHC.Types.Symbol) a (sublayout :: k). (GHC.TypeLits.KnownSymbol capture, Web.Internal.HttpApiData.ToHttpApiData a, Servant.Client.HasClient sublayout) => Servant.Client.HasClient (Servant.API.Capture.CaptureAll capture a Servant.API.Sub.:> sublayout)
instance forall k1 ct a (method :: k1) (cts' :: [GHC.Types.*]) (cts :: [GHC.Types.*]) (status :: GHC.Types.Nat). (Servant.API.ContentTypes.MimeUnrender ct a, Servant.API.Verbs.ReflectMethod method, cts' ~ (ct : cts)) => Servant.Client.HasClient (Servant.API.Verbs.Verb method status cts' a)
instance forall k1 (method :: k1) (status :: GHC.Types.Nat) (cts :: [GHC.Types.*]). Servant.API.Verbs.ReflectMethod method => Servant.Client.HasClient (Servant.API.Verbs.Verb method status cts Servant.API.ContentTypes.NoContent)
instance forall k1 ct a (ls :: [*]) (method :: k1) (cts' :: [GHC.Types.*]) (cts :: [GHC.Types.*]) (status :: GHC.Types.Nat). (Servant.API.ContentTypes.MimeUnrender ct a, Servant.API.ResponseHeaders.BuildHeadersTo ls, Servant.API.Verbs.ReflectMethod method, cts' ~ (ct : cts)) => Servant.Client.HasClient (Servant.API.Verbs.Verb method status cts' (Servant.API.ResponseHeaders.Headers ls a))
instance forall k1 (ls :: [*]) (method :: k1) (status :: GHC.Types.Nat) (cts :: [GHC.Types.*]). (Servant.API.ResponseHeaders.BuildHeadersTo ls, Servant.API.Verbs.ReflectMethod method) => Servant.Client.HasClient (Servant.API.Verbs.Verb method status cts (Servant.API.ResponseHeaders.Headers ls Servant.API.ContentTypes.NoContent))
instance forall k (sym :: GHC.Types.Symbol) a (api :: k). (GHC.TypeLits.KnownSymbol sym, Web.Internal.HttpApiData.ToHttpApiData a, Servant.Client.HasClient api) => Servant.Client.HasClient (Servant.API.Header.Header sym a Servant.API.Sub.:> api)
instance forall k (api :: k). Servant.Client.HasClient api => Servant.Client.HasClient (Network.HTTP.Types.Version.HttpVersion Servant.API.Sub.:> api)
instance forall k (sym :: GHC.Types.Symbol) a (api :: k). (GHC.TypeLits.KnownSymbol sym, Web.Internal.HttpApiData.ToHttpApiData a, Servant.Client.HasClient api) => Servant.Client.HasClient (Servant.API.QueryParam.QueryParam sym a Servant.API.Sub.:> api)
instance forall k (sym :: GHC.Types.Symbol) a (api :: k). (GHC.TypeLits.KnownSymbol sym, Web.Internal.HttpApiData.ToHttpApiData a, Servant.Client.HasClient api) => Servant.Client.HasClient (Servant.API.QueryParam.QueryParams sym a Servant.API.Sub.:> api)
instance forall k (sym :: GHC.Types.Symbol) (api :: k). (GHC.TypeLits.KnownSymbol sym, Servant.Client.HasClient api) => Servant.Client.HasClient (Servant.API.QueryParam.QueryFlag sym Servant.API.Sub.:> api)
instance Servant.Client.HasClient Servant.API.Raw.Raw
instance forall k ct a (api :: k) (cts :: [GHC.Types.*]). (Servant.API.ContentTypes.MimeRender ct a, Servant.Client.HasClient api) => Servant.Client.HasClient (Servant.API.ReqBody.ReqBody (ct : cts) a Servant.API.Sub.:> api)
instance forall k (path :: GHC.Types.Symbol) (api :: k). (GHC.TypeLits.KnownSymbol path, Servant.Client.HasClient api) => Servant.Client.HasClient (path Servant.API.Sub.:> api)
instance forall k (api :: k). Servant.Client.HasClient api => Servant.Client.HasClient (Data.Vault.Lazy.Vault Servant.API.Sub.:> api)
instance forall k (api :: k). Servant.Client.HasClient api => Servant.Client.HasClient (Servant.API.RemoteHost.RemoteHost Servant.API.Sub.:> api)
instance forall k (api :: k). Servant.Client.HasClient api => Servant.Client.HasClient (Servant.API.IsSecure.IsSecure Servant.API.Sub.:> api)
instance Servant.Client.HasClient subapi => Servant.Client.HasClient (Servant.API.WithNamedContext.WithNamedContext name context subapi)
instance forall k k1 (api :: k1) (tag :: k). Servant.Client.HasClient api => Servant.Client.HasClient (Servant.API.Experimental.Auth.AuthProtect tag Servant.API.Sub.:> api)
instance forall k (api :: k) (realm :: GHC.Types.Symbol) usr. Servant.Client.HasClient api => Servant.Client.HasClient (Servant.API.BasicAuth.BasicAuth realm usr Servant.API.Sub.:> api)
