swagger-petstore-0.0.1.1: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Contents

Description

 

Synopsis

Config

data SwaggerPetstoreConfig Source #

Constructors

SwaggerPetstoreConfig 

Fields

newConfig :: SwaggerPetstoreConfig Source #

constructs a default SwaggerPetstoreConfig

configHost:

http://petstore.swagger.io/v2

configUserAgent:

"swagger-haskell-http-client/1.0.0"

configExecLoggingT: runNullLoggingT

configLoggingFilter: infoLevelFilter

withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to use a MonadLogger instance which prints to stdout.

withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to use a MonadLogger instance which prints to stderr.

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> InitRequest req contentType res accept -> ShowS #

show :: InitRequest req contentType res accept -> String #

showList :: [InitRequest req contentType res accept] -> ShowS #

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

type ExecLoggingT = forall m. MonadIO m => forall a. LoggingT m a -> m a Source #

A block using a MonadLogger instance

Null Logger

nullLogger :: Loc -> LogSource -> LogLevel -> LogStr -> IO () Source #

a logger which disables logging

runNullLoggingT :: LoggingT m a -> m a Source #

run the monad transformer that disables logging

Logging Filters

errorLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelError as the minimum logging level

infoLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelInfo as the minimum logging level

debugLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelDebug as the minimum logging level

Logging

logNST :: (MonadIO m, MonadLogger m) => LogLevel -> Text -> Text -> m () Source #

Log a message using the current time

logExceptions :: (MonadLogger m, MonadCatch m, MonadIO m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT Source #

Run a block using the configured MonadLogger instance

runExceptionLoggingT :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LoggingT m a -> m a Source #

Run a block using the configured MonadLogger instance (logs exceptions)