| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
SwaggerPetstore.Client
Description
- data SwaggerPetstoreConfig = SwaggerPetstoreConfig {}
- newConfig :: SwaggerPetstoreConfig
- withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig
- withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig
- withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig
- dispatchLbs :: (Produces req accept, MimeType contentType) => Manager -> SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res -> accept -> IO (Response ByteString)
- data MimeResult res = MimeResult {}
- data MimeError = MimeError {}
- dispatchMime :: (Produces req accept, MimeUnrender accept res, MimeType contentType) => Manager -> SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res -> accept -> IO (MimeResult res)
- dispatchMime' :: (Produces req accept, MimeUnrender accept res, MimeType contentType) => Manager -> SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res -> accept -> IO (Either MimeError res)
- dispatchLbsUnsafe :: (MimeType accept, MimeType contentType) => Manager -> SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res -> accept -> IO (Response ByteString)
- dispatchInitUnsafe :: Manager -> SwaggerPetstoreConfig -> InitRequest req contentType res accept -> IO (Response ByteString)
- newtype InitRequest req contentType res accept = InitRequest {}
- _toInitRequest :: (MimeType accept, MimeType contentType) => SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res -> accept -> IO (InitRequest req contentType res accept)
- modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept
- modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept)
- type ExecLoggingT = forall m. MonadIO m => forall a. LoggingT m a -> m a
- nullLogger :: Loc -> LogSource -> LogLevel -> LogStr -> IO ()
- runNullLoggingT :: LoggingT m a -> m a
- errorLevelFilter :: LogSource -> LogLevel -> Bool
- infoLevelFilter :: LogSource -> LogLevel -> Bool
- debugLevelFilter :: LogSource -> LogLevel -> Bool
- minLevelFilter :: LogLevel -> LogSource -> LogLevel -> Bool
- logNST :: (MonadIO m, MonadLogger m) => LogLevel -> Text -> Text -> m ()
- logExceptions :: (MonadLogger m, MonadCatch m, MonadIO m) => Text -> m a -> m a
- runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT
- runExceptionLoggingT :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LoggingT m a -> m a
Config
data SwaggerPetstoreConfig Source #
Constructors
| SwaggerPetstoreConfig | |
Fields
| |
Instances
| Show SwaggerPetstoreConfig Source # | display the config |
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
Arguments
| :: (Produces req accept, MimeType contentType) | |
| => Manager | http-client Connection manager |
| -> SwaggerPetstoreConfig | config |
| -> SwaggerPetstoreRequest req contentType res | request |
| -> accept | "accept" |
| -> 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 # | |
| Foldable MimeResult Source # | |
| Traversable MimeResult Source # | |
| Show res => Show (MimeResult res) Source # | |
pair of unrender/parser error and http response
Constructors
| MimeError | |
Fields
| |
Arguments
| :: (Produces req accept, MimeUnrender accept res, MimeType contentType) | |
| => Manager | http-client Connection manager |
| -> SwaggerPetstoreConfig | config |
| -> SwaggerPetstoreRequest req contentType res | request |
| -> accept | "accept" |
| -> IO (MimeResult res) | response |
send a request returning the MimeResult
Arguments
| :: (Produces req accept, MimeUnrender accept res, MimeType contentType) | |
| => Manager | http-client Connection manager |
| -> SwaggerPetstoreConfig | config |
| -> SwaggerPetstoreRequest req contentType res | request |
| -> accept | "accept" |
| -> IO (Either MimeError res) | response |
like dispatchMime, but only returns the decoded http body
Unsafe
Arguments
| :: (MimeType accept, MimeType contentType) | |
| => Manager | http-client Connection manager |
| -> SwaggerPetstoreConfig | config |
| -> SwaggerPetstoreRequest req contentType res | request |
| -> accept | "accept" |
| -> 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)
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 | |
Fields | |
Instances
| Show (InitRequest req contentType res accept) Source # | |
Arguments
| :: (MimeType accept, MimeType contentType) | |
| => SwaggerPetstoreConfig | config |
| -> SwaggerPetstoreRequest req contentType res | request |
| -> accept | "accept" |
| -> 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)