module Network.Wai.Middleware.ProblemDetails.Internal.Defaults
(
    problemDetails400
  , problemDetails401
  , problemDetails403
  , problemDetails404
  , problemDetails409
)
where

import           Network.Wai.Middleware.ProblemDetails.Internal.Types

import           Data.Default
import           Data.Function                                        ((&))
import           Data.Maybe                                           (fromJust)
import           Network.URI                                          (parseURI)

problemDetails404 :: ProblemDetails
problemDetails404 :: ProblemDetails
problemDetails404 = forall a. Default a => a
def
  forall a b. a -> (a -> b) -> b
& Int -> ProblemDetails -> ProblemDetails
setStatus Int
404
  forall a b. a -> (a -> b) -> b
& Text -> ProblemDetails -> ProblemDetails
setTitle Text
"Not Found"
  forall a b. a -> (a -> b) -> b
& URI -> ProblemDetails -> ProblemDetails
setType (forall a. HasCallStack => Maybe a -> a
fromJust forall a b. (a -> b) -> a -> b
$ String -> Maybe URI
parseURI String
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404")

problemDetails400 :: ProblemDetails
problemDetails400 :: ProblemDetails
problemDetails400 = forall a. Default a => a
def
  forall a b. a -> (a -> b) -> b
& Int -> ProblemDetails -> ProblemDetails
setStatus Int
400
  forall a b. a -> (a -> b) -> b
& Text -> ProblemDetails -> ProblemDetails
setTitle Text
"Bad Request"
  forall a b. a -> (a -> b) -> b
& URI -> ProblemDetails -> ProblemDetails
setType (forall a. HasCallStack => Maybe a -> a
fromJust forall a b. (a -> b) -> a -> b
$ String -> Maybe URI
parseURI String
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400")

problemDetails401 :: ProblemDetails
problemDetails401 :: ProblemDetails
problemDetails401 = forall a. Default a => a
def
  forall a b. a -> (a -> b) -> b
& Int -> ProblemDetails -> ProblemDetails
setStatus Int
401
  forall a b. a -> (a -> b) -> b
& Text -> ProblemDetails -> ProblemDetails
setTitle Text
"Unauthorized"
  forall a b. a -> (a -> b) -> b
& URI -> ProblemDetails -> ProblemDetails
setType (forall a. HasCallStack => Maybe a -> a
fromJust forall a b. (a -> b) -> a -> b
$ String -> Maybe URI
parseURI String
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401")

problemDetails403 :: ProblemDetails
problemDetails403 :: ProblemDetails
problemDetails403 = forall a. Default a => a
def
  forall a b. a -> (a -> b) -> b
& Int -> ProblemDetails -> ProblemDetails
setStatus Int
403
  forall a b. a -> (a -> b) -> b
& Text -> ProblemDetails -> ProblemDetails
setTitle Text
"Forbidden"
  forall a b. a -> (a -> b) -> b
& URI -> ProblemDetails -> ProblemDetails
setType (forall a. HasCallStack => Maybe a -> a
fromJust forall a b. (a -> b) -> a -> b
$ String -> Maybe URI
parseURI String
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403")

problemDetails409 :: ProblemDetails
problemDetails409 :: ProblemDetails
problemDetails409 = forall a. Default a => a
def
  forall a b. a -> (a -> b) -> b
& Int -> ProblemDetails -> ProblemDetails
setStatus Int
409
  forall a b. a -> (a -> b) -> b
& Text -> ProblemDetails -> ProblemDetails
setTitle Text
"Conflict"
  forall a b. a -> (a -> b) -> b
& URI -> ProblemDetails -> ProblemDetails
setType (forall a. HasCallStack => Maybe a -> a
fromJust forall a b. (a -> b) -> a -> b
$ String -> Maybe URI
parseURI String
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409")