module Ecluse.Core.Server.Pipeline.Packument.Response (
MetadataResponse,
metadataReplies,
keepPrivateUnauthorised,
) where
import Network.HTTP.Types (ResponseHeaders)
import Ecluse.Core.Server.Contract (
ResponseChoice (FirstResponse, SecondResponse),
ResponseValue,
responseValue,
)
import Ecluse.Core.Server.Pipeline.Packument (PackumentReplies (..))
import Ecluse.Core.Server.Response (Refusal, ServeDecision)
type MetadataResponse refusal =
ResponseChoice
(ResponseValue LByteString)
( ResponseChoice
(ResponseValue ())
( ResponseChoice
(ResponseValue refusal)
( ResponseChoice
(ResponseValue refusal)
( ResponseChoice
(ResponseValue refusal)
( ResponseChoice
(ResponseValue refusal)
( ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))
)
)
)
)
)
)
metadataReplies ::
([ServeDecision] -> Text) ->
(Refusal -> refusal) ->
PackumentReplies (MetadataResponse refusal)
metadataReplies :: forall refusal.
([ServeDecision] -> Text)
-> (Refusal -> refusal)
-> PackumentReplies (MetadataResponse refusal)
metadataReplies [ServeDecision] -> Text
deniedText Refusal -> refusal
refusalBody =
PackumentReplies
{ packumentDeniedText :: [ServeDecision] -> Text
packumentDeniedText = [ServeDecision] -> Text
deniedText
, packumentOk :: ResponseHeaders
-> LByteString
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentOk = \ResponseHeaders
headers LByteString
body -> ResponseValue LByteString
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall a b. a -> ResponseChoice a b
FirstResponse (ResponseHeaders -> LByteString -> ResponseValue LByteString
forall a. ResponseHeaders -> a -> ResponseValue a
responseValue ResponseHeaders
headers LByteString
body)
, packumentNotModified :: ResponseHeaders
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentNotModified = \ResponseHeaders
headers -> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseValue ()
-> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
forall a b. a -> ResponseChoice a b
FirstResponse (ResponseHeaders -> () -> ResponseValue ()
forall a. ResponseHeaders -> a -> ResponseValue a
responseValue ResponseHeaders
headers ()))
, packumentUnauthorised :: ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentUnauthorised = \ResponseHeaders
headers Refusal
message -> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
-> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseValue refusal
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
forall a b. a -> ResponseChoice a b
FirstResponse (ResponseHeaders -> Refusal -> ResponseValue refusal
refusalValue ResponseHeaders
headers Refusal
message)))
, packumentPrivateRefused :: Int
-> ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentPrivateRefused = (ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))))
-> Int
-> ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall a b. a -> b -> a
const ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall {a} {a} {a} {b}.
ResponseHeaders
-> Refusal
-> ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b)))
forbiddenReply
, packumentForbidden :: ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentForbidden = ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall {a} {a} {a} {b}.
ResponseHeaders
-> Refusal
-> ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b)))
forbiddenReply
, packumentDenied :: ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentDenied = ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall {a} {a} {a} {a} {b}.
ResponseHeaders
-> Refusal
-> ResponseChoice
a
(ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b))))
notFoundReply
, packumentNotFound :: ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentNotFound = ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall {a} {a} {a} {a} {b}.
ResponseHeaders
-> Refusal
-> ResponseChoice
a
(ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b))))
notFoundReply
, packumentNotAcceptable :: ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentNotAcceptable = \ResponseHeaders
headers Refusal
message -> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
-> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseValue refusal
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))
forall a b. a -> ResponseChoice a b
FirstResponse (ResponseHeaders -> Refusal -> ResponseValue refusal
refusalValue ResponseHeaders
headers Refusal
message))))))
, packumentInternal :: ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentInternal = \ResponseHeaders
headers Refusal
message -> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
-> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseValue refusal
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))
forall a b. a -> ResponseChoice a b
FirstResponse (ResponseHeaders -> Refusal -> ResponseValue refusal
refusalValue ResponseHeaders
headers Refusal
message)))))))
, packumentBadGateway :: ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentBadGateway = \ResponseHeaders
headers Refusal
message -> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
-> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice (ResponseValue refusal) (ResponseValue refusal)
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseValue refusal
-> ResponseChoice (ResponseValue refusal) (ResponseValue refusal)
forall a b. a -> ResponseChoice a b
FirstResponse (ResponseHeaders -> Refusal -> ResponseValue refusal
refusalValue ResponseHeaders
headers Refusal
message))))))))
, packumentUnavailable :: ResponseHeaders
-> Refusal
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
packumentUnavailable = \ResponseHeaders
headers Refusal
message -> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
-> ResponseChoice
(ResponseValue LByteString)
(ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
-> ResponseChoice
(ResponseValue ())
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal)))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal) (ResponseValue refusal))))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal)))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice (ResponseValue refusal) (ResponseValue refusal)
-> ResponseChoice
(ResponseValue refusal)
(ResponseChoice (ResponseValue refusal) (ResponseValue refusal))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseValue refusal
-> ResponseChoice (ResponseValue refusal) (ResponseValue refusal)
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseHeaders -> Refusal -> ResponseValue refusal
refusalValue ResponseHeaders
headers Refusal
message))))))))
}
where
forbiddenReply :: ResponseHeaders
-> Refusal
-> ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b)))
forbiddenReply ResponseHeaders
headers Refusal
message = ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b))
-> ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b)))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice a (ResponseChoice (ResponseValue refusal) b)
-> ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice (ResponseValue refusal) b
-> ResponseChoice a (ResponseChoice (ResponseValue refusal) b)
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseValue refusal -> ResponseChoice (ResponseValue refusal) b
forall a b. a -> ResponseChoice a b
FirstResponse (ResponseHeaders -> Refusal -> ResponseValue refusal
refusalValue ResponseHeaders
headers Refusal
message))))
notFoundReply :: ResponseHeaders
-> Refusal
-> ResponseChoice
a
(ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b))))
notFoundReply ResponseHeaders
headers Refusal
message = ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b)))
-> ResponseChoice
a
(ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b))))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b))
-> ResponseChoice
a
(ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b)))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice a (ResponseChoice (ResponseValue refusal) b)
-> ResponseChoice
a (ResponseChoice a (ResponseChoice (ResponseValue refusal) b))
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseChoice (ResponseValue refusal) b
-> ResponseChoice a (ResponseChoice (ResponseValue refusal) b)
forall a b. b -> ResponseChoice a b
SecondResponse (ResponseValue refusal -> ResponseChoice (ResponseValue refusal) b
forall a b. a -> ResponseChoice a b
FirstResponse (ResponseHeaders -> Refusal -> ResponseValue refusal
refusalValue ResponseHeaders
headers Refusal
message)))))
refusalValue :: ResponseHeaders -> Refusal -> ResponseValue refusal
refusalValue ResponseHeaders
headers Refusal
message = ResponseHeaders -> refusal -> ResponseValue refusal
forall a. ResponseHeaders -> a -> ResponseValue a
responseValue ResponseHeaders
headers (Refusal -> refusal
refusalBody Refusal
message)
keepPrivateUnauthorised :: PackumentReplies response -> Int -> ResponseHeaders -> Refusal -> response
keepPrivateUnauthorised :: forall response.
PackumentReplies response
-> Int -> ResponseHeaders -> Refusal -> response
keepPrivateUnauthorised PackumentReplies response
replies Int
code
| Int
code Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
401 = PackumentReplies response -> ResponseHeaders -> Refusal -> response
forall response.
PackumentReplies response -> ResponseHeaders -> Refusal -> response
packumentUnauthorised PackumentReplies response
replies
| Bool
otherwise = PackumentReplies response -> ResponseHeaders -> Refusal -> response
forall response.
PackumentReplies response -> ResponseHeaders -> Refusal -> response
packumentForbidden PackumentReplies response
replies