linnet-0.4.0.1: Lightweight library for building HTTP API

Safe HaskellNone
LanguageHaskell2010

Linnet.Endpoints.Params

Synopsis

Documentation

param :: forall a m. (DecodeEntity a, MonadThrow m) => ByteString -> Endpoint m a Source #

Endpoint that tries to decode parameter name from the request query string. Always matches, but may throw an exception in case:

  • Parameter is not presented in request query
  • There was a parameter decoding error

paramMaybe :: forall a m. (DecodeEntity a, MonadThrow m) => ByteString -> Endpoint m (Maybe a) Source #

Endpoint that tries to decode parameter name from the request query string. Always matches, but may throw an exception in case:

  • There was a parameter decoding error

params :: forall a m. (DecodeEntity a, MonadThrow m) => ByteString -> Endpoint m [a] Source #

Endpoint that tries to decode all parameters name from the request query string. Always matches, but may throw an exception in case:

  • There was a parameter decoding error of at least one parameter value

paramsNel :: forall a m. (DecodeEntity a, MonadThrow m) => ByteString -> Endpoint m (NonEmpty a) Source #

Endpoint that tries to decode all parameters name from the request query string. Always matches, but may throw an exception in case:

  • There was a parameter decoding error of at least one parameter value
  • All parameters are empty or missing in request query