-- | Client and Server
module OryKratos.API
  ( Config (..),
    OryKratosBackend (..),
    createOryKratosClient,
    runOryKratosServer,
    runOryKratosMiddlewareServer,
    runOryKratosClient,
    runOryKratosClientWithManager,
    callOryKratos,
    OryKratosClient,
    OryKratosClientError (..),

    -- ** Servant
    OryKratosAPI,
  )
where

import Control.Monad.Catch (Exception, MonadThrow, throwM)
import Control.Monad.Except (ExceptT, runExceptT)
import Control.Monad.IO.Class
import Control.Monad.Trans.Reader (ReaderT (..))
import Data.Aeson (Value)
import Data.Coerce (coerce)
import Data.Function ((&))
import Data.Proxy (Proxy (..))
import Data.Text (Text)
import qualified Data.Text as T
import GHC.Exts (IsString (..))
import Network.HTTP.Client (Manager, newManager)
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Network.Wai (Middleware)
import qualified Network.Wai.Handler.Warp as Warp
import OryKratos.Types hiding (error)
import Servant (ServerError, serve)
import Servant.API
import Servant.Client
  ( ClientEnv,
    ClientError,
    client,
    mkClientEnv,
    parseBaseUrl,
  )
import Servant.Client.Core (baseUrlHost, baseUrlPort)
import Servant.Client.Internal.HttpClient (ClientM (..))
import Servant.Server (Application, Handler (..))
import Servant.Server.StaticFiles (serveDirectoryFileServer)
import Prelude

-- | List of elements parsed from a query.
newtype QueryList (p :: CollectionFormat) a = QueryList
  { QueryList p a -> [a]
fromQueryList :: [a]
  }
  deriving stock (Functor (QueryList p)
Foldable (QueryList p)
Functor (QueryList p)
-> Foldable (QueryList p)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> QueryList p a -> f (QueryList p b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    QueryList p (f a) -> f (QueryList p a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> QueryList p a -> m (QueryList p b))
-> (forall (m :: * -> *) a.
    Monad m =>
    QueryList p (m a) -> m (QueryList p a))
-> Traversable (QueryList p)
(a -> f b) -> QueryList p a -> f (QueryList p b)
forall (p :: CollectionFormat). Functor (QueryList p)
forall (p :: CollectionFormat). Foldable (QueryList p)
forall (p :: CollectionFormat) (m :: * -> *) a.
Monad m =>
QueryList p (m a) -> m (QueryList p a)
forall (p :: CollectionFormat) (f :: * -> *) a.
Applicative f =>
QueryList p (f a) -> f (QueryList p a)
forall (p :: CollectionFormat) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> QueryList p a -> m (QueryList p b)
forall (p :: CollectionFormat) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> QueryList p a -> f (QueryList p b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
QueryList p (m a) -> m (QueryList p a)
forall (f :: * -> *) a.
Applicative f =>
QueryList p (f a) -> f (QueryList p a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> QueryList p a -> m (QueryList p b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> QueryList p a -> f (QueryList p b)
sequence :: QueryList p (m a) -> m (QueryList p a)
$csequence :: forall (p :: CollectionFormat) (m :: * -> *) a.
Monad m =>
QueryList p (m a) -> m (QueryList p a)
mapM :: (a -> m b) -> QueryList p a -> m (QueryList p b)
$cmapM :: forall (p :: CollectionFormat) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> QueryList p a -> m (QueryList p b)
sequenceA :: QueryList p (f a) -> f (QueryList p a)
$csequenceA :: forall (p :: CollectionFormat) (f :: * -> *) a.
Applicative f =>
QueryList p (f a) -> f (QueryList p a)
traverse :: (a -> f b) -> QueryList p a -> f (QueryList p b)
$ctraverse :: forall (p :: CollectionFormat) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> QueryList p a -> f (QueryList p b)
$cp2Traversable :: forall (p :: CollectionFormat). Foldable (QueryList p)
$cp1Traversable :: forall (p :: CollectionFormat). Functor (QueryList p)
Traversable)
  deriving newtype (a -> QueryList p b -> QueryList p a
(a -> b) -> QueryList p a -> QueryList p b
(forall a b. (a -> b) -> QueryList p a -> QueryList p b)
-> (forall a b. a -> QueryList p b -> QueryList p a)
-> Functor (QueryList p)
forall a b. a -> QueryList p b -> QueryList p a
forall a b. (a -> b) -> QueryList p a -> QueryList p b
forall (p :: CollectionFormat) a b.
a -> QueryList p b -> QueryList p a
forall (p :: CollectionFormat) a b.
(a -> b) -> QueryList p a -> QueryList p b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> QueryList p b -> QueryList p a
$c<$ :: forall (p :: CollectionFormat) a b.
a -> QueryList p b -> QueryList p a
fmap :: (a -> b) -> QueryList p a -> QueryList p b
$cfmap :: forall (p :: CollectionFormat) a b.
(a -> b) -> QueryList p a -> QueryList p b
Functor, Functor (QueryList p)
a -> QueryList p a
Functor (QueryList p)
-> (forall a. a -> QueryList p a)
-> (forall a b.
    QueryList p (a -> b) -> QueryList p a -> QueryList p b)
-> (forall a b c.
    (a -> b -> c) -> QueryList p a -> QueryList p b -> QueryList p c)
-> (forall a b. QueryList p a -> QueryList p b -> QueryList p b)
-> (forall a b. QueryList p a -> QueryList p b -> QueryList p a)
-> Applicative (QueryList p)
QueryList p a -> QueryList p b -> QueryList p b
QueryList p a -> QueryList p b -> QueryList p a
QueryList p (a -> b) -> QueryList p a -> QueryList p b
(a -> b -> c) -> QueryList p a -> QueryList p b -> QueryList p c
forall a. a -> QueryList p a
forall a b. QueryList p a -> QueryList p b -> QueryList p a
forall a b. QueryList p a -> QueryList p b -> QueryList p b
forall a b. QueryList p (a -> b) -> QueryList p a -> QueryList p b
forall a b c.
(a -> b -> c) -> QueryList p a -> QueryList p b -> QueryList p c
forall (p :: CollectionFormat). Functor (QueryList p)
forall (p :: CollectionFormat) a. a -> QueryList p a
forall (p :: CollectionFormat) a b.
QueryList p a -> QueryList p b -> QueryList p a
forall (p :: CollectionFormat) a b.
QueryList p a -> QueryList p b -> QueryList p b
forall (p :: CollectionFormat) a b.
QueryList p (a -> b) -> QueryList p a -> QueryList p b
forall (p :: CollectionFormat) a b c.
(a -> b -> c) -> QueryList p a -> QueryList p b -> QueryList p c
forall (f :: * -> *).
Functor f
-> (forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
<* :: QueryList p a -> QueryList p b -> QueryList p a
$c<* :: forall (p :: CollectionFormat) a b.
QueryList p a -> QueryList p b -> QueryList p a
*> :: QueryList p a -> QueryList p b -> QueryList p b
$c*> :: forall (p :: CollectionFormat) a b.
QueryList p a -> QueryList p b -> QueryList p b
liftA2 :: (a -> b -> c) -> QueryList p a -> QueryList p b -> QueryList p c
$cliftA2 :: forall (p :: CollectionFormat) a b c.
(a -> b -> c) -> QueryList p a -> QueryList p b -> QueryList p c
<*> :: QueryList p (a -> b) -> QueryList p a -> QueryList p b
$c<*> :: forall (p :: CollectionFormat) a b.
QueryList p (a -> b) -> QueryList p a -> QueryList p b
pure :: a -> QueryList p a
$cpure :: forall (p :: CollectionFormat) a. a -> QueryList p a
$cp1Applicative :: forall (p :: CollectionFormat). Functor (QueryList p)
Applicative, Applicative (QueryList p)
a -> QueryList p a
Applicative (QueryList p)
-> (forall a b.
    QueryList p a -> (a -> QueryList p b) -> QueryList p b)
-> (forall a b. QueryList p a -> QueryList p b -> QueryList p b)
-> (forall a. a -> QueryList p a)
-> Monad (QueryList p)
QueryList p a -> (a -> QueryList p b) -> QueryList p b
QueryList p a -> QueryList p b -> QueryList p b
forall a. a -> QueryList p a
forall a b. QueryList p a -> QueryList p b -> QueryList p b
forall a b. QueryList p a -> (a -> QueryList p b) -> QueryList p b
forall (p :: CollectionFormat). Applicative (QueryList p)
forall (p :: CollectionFormat) a. a -> QueryList p a
forall (p :: CollectionFormat) a b.
QueryList p a -> QueryList p b -> QueryList p b
forall (p :: CollectionFormat) a b.
QueryList p a -> (a -> QueryList p b) -> QueryList p b
forall (m :: * -> *).
Applicative m
-> (forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
return :: a -> QueryList p a
$creturn :: forall (p :: CollectionFormat) a. a -> QueryList p a
>> :: QueryList p a -> QueryList p b -> QueryList p b
$c>> :: forall (p :: CollectionFormat) a b.
QueryList p a -> QueryList p b -> QueryList p b
>>= :: QueryList p a -> (a -> QueryList p b) -> QueryList p b
$c>>= :: forall (p :: CollectionFormat) a b.
QueryList p a -> (a -> QueryList p b) -> QueryList p b
$cp1Monad :: forall (p :: CollectionFormat). Applicative (QueryList p)
Monad, a -> QueryList p a -> Bool
QueryList p m -> m
QueryList p a -> [a]
QueryList p a -> Bool
QueryList p a -> Int
QueryList p a -> a
QueryList p a -> a
QueryList p a -> a
QueryList p a -> a
(a -> m) -> QueryList p a -> m
(a -> m) -> QueryList p a -> m
(a -> b -> b) -> b -> QueryList p a -> b
(a -> b -> b) -> b -> QueryList p a -> b
(b -> a -> b) -> b -> QueryList p a -> b
(b -> a -> b) -> b -> QueryList p a -> b
(a -> a -> a) -> QueryList p a -> a
(a -> a -> a) -> QueryList p a -> a
(forall m. Monoid m => QueryList p m -> m)
-> (forall m a. Monoid m => (a -> m) -> QueryList p a -> m)
-> (forall m a. Monoid m => (a -> m) -> QueryList p a -> m)
-> (forall a b. (a -> b -> b) -> b -> QueryList p a -> b)
-> (forall a b. (a -> b -> b) -> b -> QueryList p a -> b)
-> (forall b a. (b -> a -> b) -> b -> QueryList p a -> b)
-> (forall b a. (b -> a -> b) -> b -> QueryList p a -> b)
-> (forall a. (a -> a -> a) -> QueryList p a -> a)
-> (forall a. (a -> a -> a) -> QueryList p a -> a)
-> (forall a. QueryList p a -> [a])
-> (forall a. QueryList p a -> Bool)
-> (forall a. QueryList p a -> Int)
-> (forall a. Eq a => a -> QueryList p a -> Bool)
-> (forall a. Ord a => QueryList p a -> a)
-> (forall a. Ord a => QueryList p a -> a)
-> (forall a. Num a => QueryList p a -> a)
-> (forall a. Num a => QueryList p a -> a)
-> Foldable (QueryList p)
forall a. Eq a => a -> QueryList p a -> Bool
forall a. Num a => QueryList p a -> a
forall a. Ord a => QueryList p a -> a
forall m. Monoid m => QueryList p m -> m
forall a. QueryList p a -> Bool
forall a. QueryList p a -> Int
forall a. QueryList p a -> [a]
forall a. (a -> a -> a) -> QueryList p a -> a
forall m a. Monoid m => (a -> m) -> QueryList p a -> m
forall b a. (b -> a -> b) -> b -> QueryList p a -> b
forall a b. (a -> b -> b) -> b -> QueryList p a -> b
forall (p :: CollectionFormat) a.
Eq a =>
a -> QueryList p a -> Bool
forall (p :: CollectionFormat) a. Num a => QueryList p a -> a
forall (p :: CollectionFormat) a. Ord a => QueryList p a -> a
forall (p :: CollectionFormat) m. Monoid m => QueryList p m -> m
forall (p :: CollectionFormat) a. QueryList p a -> Bool
forall (p :: CollectionFormat) a. QueryList p a -> Int
forall (p :: CollectionFormat) a. QueryList p a -> [a]
forall (p :: CollectionFormat) a.
(a -> a -> a) -> QueryList p a -> a
forall (p :: CollectionFormat) m a.
Monoid m =>
(a -> m) -> QueryList p a -> m
forall (p :: CollectionFormat) b a.
(b -> a -> b) -> b -> QueryList p a -> b
forall (p :: CollectionFormat) a b.
(a -> b -> b) -> b -> QueryList p a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: QueryList p a -> a
$cproduct :: forall (p :: CollectionFormat) a. Num a => QueryList p a -> a
sum :: QueryList p a -> a
$csum :: forall (p :: CollectionFormat) a. Num a => QueryList p a -> a
minimum :: QueryList p a -> a
$cminimum :: forall (p :: CollectionFormat) a. Ord a => QueryList p a -> a
maximum :: QueryList p a -> a
$cmaximum :: forall (p :: CollectionFormat) a. Ord a => QueryList p a -> a
elem :: a -> QueryList p a -> Bool
$celem :: forall (p :: CollectionFormat) a.
Eq a =>
a -> QueryList p a -> Bool
length :: QueryList p a -> Int
$clength :: forall (p :: CollectionFormat) a. QueryList p a -> Int
null :: QueryList p a -> Bool
$cnull :: forall (p :: CollectionFormat) a. QueryList p a -> Bool
toList :: QueryList p a -> [a]
$ctoList :: forall (p :: CollectionFormat) a. QueryList p a -> [a]
foldl1 :: (a -> a -> a) -> QueryList p a -> a
$cfoldl1 :: forall (p :: CollectionFormat) a.
(a -> a -> a) -> QueryList p a -> a
foldr1 :: (a -> a -> a) -> QueryList p a -> a
$cfoldr1 :: forall (p :: CollectionFormat) a.
(a -> a -> a) -> QueryList p a -> a
foldl' :: (b -> a -> b) -> b -> QueryList p a -> b
$cfoldl' :: forall (p :: CollectionFormat) b a.
(b -> a -> b) -> b -> QueryList p a -> b
foldl :: (b -> a -> b) -> b -> QueryList p a -> b
$cfoldl :: forall (p :: CollectionFormat) b a.
(b -> a -> b) -> b -> QueryList p a -> b
foldr' :: (a -> b -> b) -> b -> QueryList p a -> b
$cfoldr' :: forall (p :: CollectionFormat) a b.
(a -> b -> b) -> b -> QueryList p a -> b
foldr :: (a -> b -> b) -> b -> QueryList p a -> b
$cfoldr :: forall (p :: CollectionFormat) a b.
(a -> b -> b) -> b -> QueryList p a -> b
foldMap' :: (a -> m) -> QueryList p a -> m
$cfoldMap' :: forall (p :: CollectionFormat) m a.
Monoid m =>
(a -> m) -> QueryList p a -> m
foldMap :: (a -> m) -> QueryList p a -> m
$cfoldMap :: forall (p :: CollectionFormat) m a.
Monoid m =>
(a -> m) -> QueryList p a -> m
fold :: QueryList p m -> m
$cfold :: forall (p :: CollectionFormat) m. Monoid m => QueryList p m -> m
Foldable)

-- | Formats in which a list can be encoded into a HTTP path.
data CollectionFormat
  = -- | CSV format for multiple parameters.
    CommaSeparated
  | -- | Also called "SSV"
    SpaceSeparated
  | -- | Also called "TSV"
    TabSeparated
  | -- | `value1|value2|value2`
    PipeSeparated
  | -- | Using multiple GET parameters, e.g. `foo=bar&foo=baz`. Only for GET params.
    MultiParamArray

instance FromHttpApiData a => FromHttpApiData (QueryList 'CommaSeparated a) where
  parseQueryParam :: Text -> Either Text (QueryList 'CommaSeparated a)
parseQueryParam = Char -> Text -> Either Text (QueryList 'CommaSeparated a)
forall a (p :: CollectionFormat).
FromHttpApiData a =>
Char -> Text -> Either Text (QueryList p a)
parseSeparatedQueryList Char
','

instance FromHttpApiData a => FromHttpApiData (QueryList 'TabSeparated a) where
  parseQueryParam :: Text -> Either Text (QueryList 'TabSeparated a)
parseQueryParam = Char -> Text -> Either Text (QueryList 'TabSeparated a)
forall a (p :: CollectionFormat).
FromHttpApiData a =>
Char -> Text -> Either Text (QueryList p a)
parseSeparatedQueryList Char
'\t'

instance FromHttpApiData a => FromHttpApiData (QueryList 'SpaceSeparated a) where
  parseQueryParam :: Text -> Either Text (QueryList 'SpaceSeparated a)
parseQueryParam = Char -> Text -> Either Text (QueryList 'SpaceSeparated a)
forall a (p :: CollectionFormat).
FromHttpApiData a =>
Char -> Text -> Either Text (QueryList p a)
parseSeparatedQueryList Char
' '

instance FromHttpApiData a => FromHttpApiData (QueryList 'PipeSeparated a) where
  parseQueryParam :: Text -> Either Text (QueryList 'PipeSeparated a)
parseQueryParam = Char -> Text -> Either Text (QueryList 'PipeSeparated a)
forall a (p :: CollectionFormat).
FromHttpApiData a =>
Char -> Text -> Either Text (QueryList p a)
parseSeparatedQueryList Char
'|'

instance FromHttpApiData a => FromHttpApiData (QueryList 'MultiParamArray a) where
  parseQueryParam :: Text -> Either Text (QueryList 'MultiParamArray a)
parseQueryParam = [Char] -> Text -> Either Text (QueryList 'MultiParamArray a)
forall a. HasCallStack => [Char] -> a
Prelude.error [Char]
"unimplemented FromHttpApiData for MultiParamArray collection format"

parseSeparatedQueryList :: FromHttpApiData a => Char -> Text -> Either Text (QueryList p a)
parseSeparatedQueryList :: Char -> Text -> Either Text (QueryList p a)
parseSeparatedQueryList Char
char = ([a] -> QueryList p a)
-> Either Text [a] -> Either Text (QueryList p a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap [a] -> QueryList p a
forall (p :: CollectionFormat) a. [a] -> QueryList p a
QueryList (Either Text [a] -> Either Text (QueryList p a))
-> (Text -> Either Text [a]) -> Text -> Either Text (QueryList p a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Text -> Either Text a) -> [Text] -> Either Text [a]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Text -> Either Text a
forall a. FromHttpApiData a => Text -> Either Text a
parseQueryParam ([Text] -> Either Text [a])
-> (Text -> [Text]) -> Text -> Either Text [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Bool) -> Text -> [Text]
T.split (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
char)

instance ToHttpApiData a => ToHttpApiData (QueryList 'CommaSeparated a) where
  toQueryParam :: QueryList 'CommaSeparated a -> Text
toQueryParam = Char -> QueryList 'CommaSeparated a -> Text
forall a (p :: CollectionFormat).
ToHttpApiData a =>
Char -> QueryList p a -> Text
formatSeparatedQueryList Char
','

instance ToHttpApiData a => ToHttpApiData (QueryList 'TabSeparated a) where
  toQueryParam :: QueryList 'TabSeparated a -> Text
toQueryParam = Char -> QueryList 'TabSeparated a -> Text
forall a (p :: CollectionFormat).
ToHttpApiData a =>
Char -> QueryList p a -> Text
formatSeparatedQueryList Char
'\t'

instance ToHttpApiData a => ToHttpApiData (QueryList 'SpaceSeparated a) where
  toQueryParam :: QueryList 'SpaceSeparated a -> Text
toQueryParam = Char -> QueryList 'SpaceSeparated a -> Text
forall a (p :: CollectionFormat).
ToHttpApiData a =>
Char -> QueryList p a -> Text
formatSeparatedQueryList Char
' '

instance ToHttpApiData a => ToHttpApiData (QueryList 'PipeSeparated a) where
  toQueryParam :: QueryList 'PipeSeparated a -> Text
toQueryParam = Char -> QueryList 'PipeSeparated a -> Text
forall a (p :: CollectionFormat).
ToHttpApiData a =>
Char -> QueryList p a -> Text
formatSeparatedQueryList Char
'|'

instance ToHttpApiData a => ToHttpApiData (QueryList 'MultiParamArray a) where
  toQueryParam :: QueryList 'MultiParamArray a -> Text
toQueryParam = [Char] -> QueryList 'MultiParamArray a -> Text
forall a. HasCallStack => [Char] -> a
Prelude.error [Char]
"unimplemented ToHttpApiData for MultiParamArray collection format"

formatSeparatedQueryList :: ToHttpApiData a => Char -> QueryList p a -> Text
formatSeparatedQueryList :: Char -> QueryList p a -> Text
formatSeparatedQueryList Char
char = Text -> [Text] -> Text
T.intercalate (Char -> Text
T.singleton Char
char) ([Text] -> Text)
-> (QueryList p a -> [Text]) -> QueryList p a -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> Text) -> [a] -> [Text]
forall a b. (a -> b) -> [a] -> [b]
map a -> Text
forall a. ToHttpApiData a => a -> Text
toQueryParam ([a] -> [Text])
-> (QueryList p a -> [a]) -> QueryList p a -> [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QueryList p a -> [a]
forall (p :: CollectionFormat) a. QueryList p a -> [a]
fromQueryList

-- | Servant type-level API, generated from the OpenAPI spec for OryKratos.
type OryKratosAPI =
  "identities" :> ReqBody '[JSON] CreateIdentity :> Verb 'POST 200 '[JSON] Identity -- 'createIdentity' route
    :<|> "recovery" :> "link" :> ReqBody '[JSON] CreateRecoveryLink :> Verb 'POST 200 '[JSON] RecoveryLink -- 'createRecoveryLink' route
    :<|> "identities" :> Capture "id" Text :> Verb 'DELETE 200 '[JSON] NoContent -- 'deleteIdentity' route
    :<|> "identities" :> Capture "id" Text :> Verb 'GET 200 '[JSON] Identity -- 'getIdentity' route
    :<|> "identities" :> QueryParam "per_page" Integer :> QueryParam "page" Integer :> Verb 'GET 200 '[JSON] [Identity] -- 'listIdentities' route
    :<|> "metrics" :> "prometheus" :> Verb 'GET 200 '[JSON] NoContent -- 'prometheus' route
    :<|> "identities" :> Capture "id" Text :> ReqBody '[JSON] UpdateIdentity :> Verb 'PUT 200 '[JSON] Identity -- 'updateIdentity' route
    :<|> "health" :> "alive" :> Verb 'GET 200 '[JSON] HealthStatus -- 'isInstanceAlive' route
    :<|> "health" :> "ready" :> Verb 'GET 200 '[JSON] HealthStatus -- 'isInstanceReady' route
    :<|> "schemas" :> Capture "id" Text :> Verb 'GET 200 '[JSON] Value -- 'getSchema' route
    :<|> "self-service" :> "errors" :> QueryParam "error" Text :> Verb 'GET 200 '[JSON] SelfServiceErrorContainer -- 'getSelfServiceError' route
    :<|> "self-service" :> "login" :> "flows" :> QueryParam "id" Text :> Verb 'GET 200 '[JSON] LoginFlow -- 'getSelfServiceLoginFlow' route
    :<|> "self-service" :> "recovery" :> "flows" :> QueryParam "id" Text :> Verb 'GET 200 '[JSON] RecoveryFlow -- 'getSelfServiceRecoveryFlow' route
    :<|> "self-service" :> "registration" :> "flows" :> QueryParam "id" Text :> Verb 'GET 200 '[JSON] RegistrationFlow -- 'getSelfServiceRegistrationFlow' route
    :<|> "self-service" :> "settings" :> "flows" :> QueryParam "id" Text :> Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] SettingsFlow -- 'getSelfServiceSettingsFlow' route
    :<|> "self-service" :> "verification" :> "flows" :> QueryParam "id" Text :> Verb 'GET 200 '[JSON] VerificationFlow -- 'getSelfServiceVerificationFlow' route
    :<|> "self-service" :> "browser" :> "flows" :> "logout" :> Verb 'GET 200 '[JSON] NoContent -- 'initializeSelfServiceBrowserLogoutFlow' route
    :<|> "self-service" :> "login" :> "browser" :> QueryParam "refresh" Bool :> Verb 'GET 200 '[JSON] NoContent -- 'initializeSelfServiceLoginForBrowsers' route
    :<|> "self-service" :> "login" :> "api" :> QueryParam "refresh" Bool :> Verb 'GET 200 '[JSON] LoginFlow -- 'initializeSelfServiceLoginForNativeApps' route
    :<|> "self-service" :> "recovery" :> "browser" :> Verb 'GET 200 '[JSON] NoContent -- 'initializeSelfServiceRecoveryForBrowsers' route
    :<|> "self-service" :> "recovery" :> "api" :> Verb 'GET 200 '[JSON] RecoveryFlow -- 'initializeSelfServiceRecoveryForNativeApps' route
    :<|> "self-service" :> "registration" :> "browser" :> Verb 'GET 200 '[JSON] NoContent -- 'initializeSelfServiceRegistrationForBrowsers' route
    :<|> "self-service" :> "registration" :> "api" :> Verb 'GET 200 '[JSON] RegistrationFlow -- 'initializeSelfServiceRegistrationForNativeApps' route
    :<|> "self-service" :> "settings" :> "browser" :> Verb 'GET 200 '[JSON] NoContent -- 'initializeSelfServiceSettingsForBrowsers' route
    :<|> "self-service" :> "settings" :> "api" :> Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] SettingsFlow -- 'initializeSelfServiceSettingsForNativeApps' route
    :<|> "self-service" :> "verification" :> "browser" :> Verb 'GET 200 '[JSON] NoContent -- 'initializeSelfServiceVerificationForBrowsers' route
    :<|> "self-service" :> "verification" :> "api" :> Verb 'GET 200 '[JSON] VerificationFlow -- 'initializeSelfServiceVerificationForNativeApps' route
    :<|> "sessions" :> ReqBody '[JSON] RevokeSession :> Verb 'DELETE 200 '[JSON] NoContent -- 'revokeSession' route
    :<|> "self-service" :> "login" :> QueryParam "flow" Text :> ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] LoginViaApiResponse -- 'submitSelfServiceLoginFlow' route
    :<|> "self-service" :> "recovery" :> QueryParam "flow" Text :> ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] NoContent -- 'submitSelfServiceRecoveryFlow' route
    :<|> "self-service" :> "recovery" :> "methods" :> "link" :> QueryParam "token" Text :> QueryParam "flow" Text :> ReqBody '[JSON] SubmitSelfServiceRecoveryFlowWithLinkMethod :> Verb 'POST 200 '[JSON] NoContent -- 'submitSelfServiceRecoveryFlowWithLinkMethod' route
    :<|> "self-service" :> "registration" :> QueryParam "flow" Text :> ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] RegistrationViaApiResponse -- 'submitSelfServiceRegistrationFlow' route
    :<|> "self-service" :> "settings" :> QueryParam "flow" Text :> ReqBody '[JSON] Value :> Header "X-Session-Token" Text :> Verb 'POST 200 '[JSON] SettingsViaApiResponse -- 'submitSelfServiceSettingsFlow' route
    :<|> "self-service" :> "verification" :> "methods" :> "link" :> QueryParam "flow" Text :> ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] NoContent -- 'submitSelfServiceVerificationFlow' route
    :<|> "sessions" :> "whoami" :> Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] Session -- 'toSession' route
    :<|> "version" :> Verb 'GET 200 '[JSON] Version -- 'getVersion' route
    :<|> Raw

-- | Server or client configuration, specifying the host and port to query or serve on.
data Config = Config
  { -- | scheme://hostname:port/path, e.g. "http://localhost:8080/"
    Config -> [Char]
configUrl :: String
  }
  deriving stock (Config -> Config -> Bool
(Config -> Config -> Bool)
-> (Config -> Config -> Bool) -> Eq Config
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Config -> Config -> Bool
$c/= :: Config -> Config -> Bool
== :: Config -> Config -> Bool
$c== :: Config -> Config -> Bool
Eq, Eq Config
Eq Config
-> (Config -> Config -> Ordering)
-> (Config -> Config -> Bool)
-> (Config -> Config -> Bool)
-> (Config -> Config -> Bool)
-> (Config -> Config -> Bool)
-> (Config -> Config -> Config)
-> (Config -> Config -> Config)
-> Ord Config
Config -> Config -> Bool
Config -> Config -> Ordering
Config -> Config -> Config
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Config -> Config -> Config
$cmin :: Config -> Config -> Config
max :: Config -> Config -> Config
$cmax :: Config -> Config -> Config
>= :: Config -> Config -> Bool
$c>= :: Config -> Config -> Bool
> :: Config -> Config -> Bool
$c> :: Config -> Config -> Bool
<= :: Config -> Config -> Bool
$c<= :: Config -> Config -> Bool
< :: Config -> Config -> Bool
$c< :: Config -> Config -> Bool
compare :: Config -> Config -> Ordering
$ccompare :: Config -> Config -> Ordering
$cp1Ord :: Eq Config
Ord, Int -> Config -> ShowS
[Config] -> ShowS
Config -> [Char]
(Int -> Config -> ShowS)
-> (Config -> [Char]) -> ([Config] -> ShowS) -> Show Config
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
showList :: [Config] -> ShowS
$cshowList :: [Config] -> ShowS
show :: Config -> [Char]
$cshow :: Config -> [Char]
showsPrec :: Int -> Config -> ShowS
$cshowsPrec :: Int -> Config -> ShowS
Show, ReadPrec [Config]
ReadPrec Config
Int -> ReadS Config
ReadS [Config]
(Int -> ReadS Config)
-> ReadS [Config]
-> ReadPrec Config
-> ReadPrec [Config]
-> Read Config
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Config]
$creadListPrec :: ReadPrec [Config]
readPrec :: ReadPrec Config
$creadPrec :: ReadPrec Config
readList :: ReadS [Config]
$creadList :: ReadS [Config]
readsPrec :: Int -> ReadS Config
$creadsPrec :: Int -> ReadS Config
Read)

-- | Custom exception type for our errors.
newtype OryKratosClientError = OryKratosClientError ClientError
  deriving newtype (Int -> OryKratosClientError -> ShowS
[OryKratosClientError] -> ShowS
OryKratosClientError -> [Char]
(Int -> OryKratosClientError -> ShowS)
-> (OryKratosClientError -> [Char])
-> ([OryKratosClientError] -> ShowS)
-> Show OryKratosClientError
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
showList :: [OryKratosClientError] -> ShowS
$cshowList :: [OryKratosClientError] -> ShowS
show :: OryKratosClientError -> [Char]
$cshow :: OryKratosClientError -> [Char]
showsPrec :: Int -> OryKratosClientError -> ShowS
$cshowsPrec :: Int -> OryKratosClientError -> ShowS
Show, Show OryKratosClientError
Typeable OryKratosClientError
Typeable OryKratosClientError
-> Show OryKratosClientError
-> (OryKratosClientError -> SomeException)
-> (SomeException -> Maybe OryKratosClientError)
-> (OryKratosClientError -> [Char])
-> Exception OryKratosClientError
SomeException -> Maybe OryKratosClientError
OryKratosClientError -> [Char]
OryKratosClientError -> SomeException
forall e.
Typeable e
-> Show e
-> (e -> SomeException)
-> (SomeException -> Maybe e)
-> (e -> [Char])
-> Exception e
displayException :: OryKratosClientError -> [Char]
$cdisplayException :: OryKratosClientError -> [Char]
fromException :: SomeException -> Maybe OryKratosClientError
$cfromException :: SomeException -> Maybe OryKratosClientError
toException :: OryKratosClientError -> SomeException
$ctoException :: OryKratosClientError -> SomeException
$cp2Exception :: Show OryKratosClientError
$cp1Exception :: Typeable OryKratosClientError
Exception)

-- | Configuration, specifying the full url of the service.

-- | Backend for OryKratos.
-- The backend can be used both for the client and the server. The client generated from the OryKratos OpenAPI spec
-- is a backend that executes actions by sending HTTP requests (see @createOryKratosClient@). Alternatively, provided
-- a backend, the API can be served using @runOryKratosMiddlewareServer@.
data OryKratosBackend m = OryKratosBackend
  { -- | This endpoint creates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future.  Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
    OryKratosBackend m -> CreateIdentity -> m Identity
createIdentity :: CreateIdentity -> m Identity,
    -- | This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.
    OryKratosBackend m -> CreateRecoveryLink -> m RecoveryLink
createRecoveryLink :: CreateRecoveryLink -> m RecoveryLink,
    -- | Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already.  Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
    OryKratosBackend m -> Text -> m NoContent
deleteIdentity :: Text -> m NoContent,
    -- | Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
    OryKratosBackend m -> Text -> m Identity
getIdentity :: Text -> m Identity,
    -- | Get a Traits Schema Definition
    OryKratosBackend m -> Text -> m Value
getSchema :: Text -> m Value,
    -- | This endpoint returns the error associated with a user-facing self service errors.  This endpoint supports stub values to help you implement the error UI:  `?error=stub:500` - returns a stub 500 (Internal Server Error) error.  More information can be found at [Ory Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
    OryKratosBackend m -> Maybe Text -> m SelfServiceErrorContainer
getSelfServiceError :: Maybe Text -> m SelfServiceErrorContainer,
    -- | This endpoint returns a login flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
    OryKratosBackend m -> Maybe Text -> m LoginFlow
getSelfServiceLoginFlow :: Maybe Text -> m LoginFlow,
    -- | This endpoint returns a recovery flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
    OryKratosBackend m -> Maybe Text -> m RecoveryFlow
getSelfServiceRecoveryFlow :: Maybe Text -> m RecoveryFlow,
    -- | This endpoint returns a registration flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
    OryKratosBackend m -> Maybe Text -> m RegistrationFlow
getSelfServiceRegistrationFlow :: Maybe Text -> m RegistrationFlow,
    -- | When accessing this endpoint through Ory Kratos' Public API you must ensure that either the Ory Kratos Session Cookie or the Ory Kratos Session Token are set. The public endpoint does not return 404 status codes but instead 403 or 500 to improve data privacy.  You can access this endpoint without credentials when using Ory Kratos' Admin API.  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
    OryKratosBackend m -> Maybe Text -> Maybe Text -> m SettingsFlow
getSelfServiceSettingsFlow :: Maybe Text -> Maybe Text -> m SettingsFlow,
    -- | This endpoint returns a verification flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
    OryKratosBackend m -> Maybe Text -> m VerificationFlow
getSelfServiceVerificationFlow :: Maybe Text -> m VerificationFlow,
    -- | Lists all identities. Does not support search at the moment.  Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
    OryKratosBackend m
-> Maybe Integer -> Maybe Integer -> m [Identity]
listIdentities :: Maybe Integer -> Maybe Integer -> m [Identity],
    -- | ``` metadata: annotations: prometheus.io/port: \"4434\" prometheus.io/path: \"/metrics/prometheus\" ```
    OryKratosBackend m -> m NoContent
prometheus :: m NoContent,
    -- | This endpoint updates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future.  The full identity payload (except credentials) is expected. This endpoint does not support patching.  Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
    OryKratosBackend m -> Text -> UpdateIdentity -> m Identity
updateIdentity :: Text -> UpdateIdentity -> m Identity,
    -- | This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working.  If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
    OryKratosBackend m -> m HealthStatus
isInstanceAlive :: m HealthStatus,
    -- | This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well.  If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
    OryKratosBackend m -> m HealthStatus
isInstanceReady :: m HealthStatus,
    -- | This endpoint initializes a logout flow.  > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  On successful logout, the browser will be redirected (HTTP 302 Found) to the `return_to` parameter of the initial request or fall back to `urls.default_return_to`.  More information can be found at [Ory Kratos User Logout Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-logout).
    OryKratosBackend m -> m NoContent
initializeSelfServiceBrowserLogoutFlow :: m NoContent,
    -- | This endpoint initializes a browser-based user login flow. Once initialized, the browser will be redirected to `selfservice.flows.login.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set.  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
    OryKratosBackend m -> Maybe Bool -> m NoContent
initializeSelfServiceLoginForBrowsers :: Maybe Bool -> m NoContent,
    -- | This endpoint initiates a login flow for API clients such as mobile devices, smart TVs, and so on.  If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set.  To fetch an existing login flow call `/self-service/login/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks, including CSRF login attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
    OryKratosBackend m -> Maybe Bool -> m LoginFlow
initializeSelfServiceLoginForNativeApps :: Maybe Bool -> m LoginFlow,
    -- | This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to `selfservice.flows.recovery.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists, the browser is returned to the configured return URL.  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
    OryKratosBackend m -> m NoContent
initializeSelfServiceRecoveryForBrowsers :: m NoContent,
    -- | This endpoint initiates a recovery flow for API clients such as mobile devices, smart TVs, and so on.  If a valid provided session cookie or session token is provided, a 400 Bad Request error.  To fetch an existing recovery flow call `/self-service/recovery/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
    OryKratosBackend m -> m RecoveryFlow
initializeSelfServiceRecoveryForNativeApps :: m RecoveryFlow,
    -- | This endpoint initializes a browser-based user registration flow. Once initialized, the browser will be redirected to `selfservice.flows.registration.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set.  :::note  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  :::  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
    OryKratosBackend m -> m NoContent
initializeSelfServiceRegistrationForBrowsers :: m NoContent,
    -- | This endpoint initiates a registration flow for API clients such as mobile devices, smart TVs, and so on.  If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set.  To fetch an existing registration flow call `/self-service/registration/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
    OryKratosBackend m -> m RegistrationFlow
initializeSelfServiceRegistrationForNativeApps :: m RegistrationFlow,
    -- | This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to `selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid Ory Kratos Session Cookie is included in the request, a login flow will be initialized.  :::note  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  :::  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
    OryKratosBackend m -> m NoContent
initializeSelfServiceSettingsForBrowsers :: m NoContent,
    -- | This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. You must provide a valid Ory Kratos Session Token for this endpoint to respond with HTTP 200 OK.  To fetch an existing settings flow call `/self-service/settings/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
    OryKratosBackend m -> Maybe Text -> m SettingsFlow
initializeSelfServiceSettingsForNativeApps :: Maybe Text -> m SettingsFlow,
    -- | This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to `selfservice.flows.verification.ui_url` with the flow ID set as the query parameter `?flow=`.  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
    OryKratosBackend m -> m NoContent
initializeSelfServiceVerificationForBrowsers :: m NoContent,
    -- | This endpoint initiates a verification flow for API clients such as mobile devices, smart TVs, and so on.  To fetch an existing verification flow call `/self-service/verification/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
    OryKratosBackend m -> m VerificationFlow
initializeSelfServiceVerificationForNativeApps :: m VerificationFlow,
    -- | Use this endpoint to revoke a session using its token. This endpoint is particularly useful for API clients such as mobile apps to log the user out of the system and invalidate the session.  This endpoint does not remove any HTTP Cookies - use the Browser-Based Self-Service Logout Flow instead.
    OryKratosBackend m -> RevokeSession -> m NoContent
revokeSession :: RevokeSession -> m NoContent,
    -- | Use this endpoint to complete a login flow. This endpoint behaves differently for API and browser flows.  API flows expect `application/json` to be sent in the body and responds with HTTP 200 and a application/json body with the session token on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors.  Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with a HTTP 302 redirect to the post/after login URL or the `return_to` value if it was set and if the login succeeded; a HTTP 302 redirect to the login UI URL with the flow ID containing the validation errors otherwise.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
    OryKratosBackend m -> Maybe Text -> Value -> m LoginViaApiResponse
submitSelfServiceLoginFlow :: Maybe Text -> Value -> m LoginViaApiResponse,
    -- | Use this endpoint to complete a recovery flow. This endpoint behaves differently for API and browser flows and has several states:  `choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent and works with API- and Browser-initiated flows. For API clients it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 302 Found redirect with a fresh recovery flow if the flow was otherwise invalid (e.g. expired). For Browser clients it returns a HTTP 302 Found redirect to the Recovery UI URL with the Recovery Flow ID appended. `sent_email` is the success state after `choose_method` for the `link` method and allows the user to request another recovery email. It works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. `passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow (\"sending a recovery link\") does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Recover UI URL with a new Recovery Flow ID which contains an error message that the recovery link was invalid.  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
    OryKratosBackend m -> Maybe Text -> Value -> m NoContent
submitSelfServiceRecoveryFlow :: Maybe Text -> Value -> m NoContent,
    -- | Use this endpoint to complete a recovery flow using the link method. This endpoint behaves differently for API and browser flows and has several states:  `choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent and works with API- and Browser-initiated flows. For API clients it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 302 Found redirect with a fresh recovery flow if the flow was otherwise invalid (e.g. expired). For Browser clients it returns a HTTP 302 Found redirect to the Recovery UI URL with the Recovery Flow ID appended. `sent_email` is the success state after `choose_method` and allows the user to request another recovery email. It works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. `passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow (\"sending a recovery link\") does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Recover UI URL with a new Recovery Flow ID which contains an error message that the recovery link was invalid.  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
    OryKratosBackend m
-> Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> m NoContent
submitSelfServiceRecoveryFlowWithLinkMethod :: Maybe Text -> Maybe Text -> SubmitSelfServiceRecoveryFlowWithLinkMethod -> m NoContent,
    -- | Use this endpoint to complete a registration flow by sending an identity's traits and password. This endpoint behaves differently for API and browser flows.  API flows expect `application/json` to be sent in the body and respond with HTTP 200 and a application/json body with the created identity success - if the session hook is configured the `session` and `session_token` will also be included; HTTP 302 redirect to a fresh registration flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors.  Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with a HTTP 302 redirect to the post/after registration URL or the `return_to` value if it was set and if the registration succeeded; a HTTP 302 redirect to the registration UI URL with the flow ID containing the validation errors otherwise.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
    OryKratosBackend m
-> Maybe Text -> Value -> m RegistrationViaApiResponse
submitSelfServiceRegistrationFlow :: Maybe Text -> Value -> m RegistrationViaApiResponse,
    -- | Use this endpoint to complete a settings flow by sending an identity's updated password. This endpoint behaves differently for API and browser flows.  API-initiated flows expect `application/json` to be sent in the body and respond with HTTP 200 and an application/json body with the session token on success; HTTP 302 redirect to a fresh settings flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. HTTP 401 when the endpoint is called without a valid session token. HTTP 403 when `selfservice.flows.settings.privileged_session_max_age` was reached. Implies that the user needs to re-authenticate.  Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with a HTTP 302 redirect to the post/after settings URL or the `return_to` value if it was set and if the flow succeeded; a HTTP 302 redirect to the Settings UI URL with the flow ID containing the validation errors otherwise. a HTTP 302 redirect to the login endpoint when `selfservice.flows.settings.privileged_session_max_age` was reached.  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
    OryKratosBackend m
-> Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse
submitSelfServiceSettingsFlow :: Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse,
    -- | Use this endpoint to complete a verification flow. This endpoint behaves differently for API and browser flows and has several states:  `choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent and works with API- and Browser-initiated flows. For API clients it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 302 Found redirect with a fresh verification flow if the flow was otherwise invalid (e.g. expired). For Browser clients it returns a HTTP 302 Found redirect to the Verification UI URL with the Verification Flow ID appended. `sent_email` is the success state after `choose_method` when using the `link` method and allows the user to request another verification email. It works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. `passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow (\"sending a verification link\") does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Verification UI URL with a new Verification Flow ID which contains an error message that the verification link was invalid.  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
    OryKratosBackend m -> Maybe Text -> Value -> m NoContent
submitSelfServiceVerificationFlow :: Maybe Text -> Value -> m NoContent,
    -- | Uses the HTTP Headers in the GET request to determine (e.g. by using checking the cookies) who is authenticated. Returns a session object in the body or 401 if the credentials are invalid or no credentials were sent. Additionally when the request it successful it adds the user ID to the 'X-Kratos-Authenticated-Identity-Id' header in the response.  This endpoint is useful for:  AJAX calls. Remember to send credentials and set up CORS correctly! Reverse proxies and API Gateways Server-side calls - use the `X-Session-Token` header!
    OryKratosBackend m -> Maybe Text -> m Session
toSession :: Maybe Text -> m Session,
    -- | This endpoint returns the service version typically notated using semantic versioning.  If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
    OryKratosBackend m -> m Version
getVersion :: m Version
  }

newtype OryKratosClient a = OryKratosClient
  { OryKratosClient a -> ClientEnv -> ExceptT ClientError IO a
runClient :: ClientEnv -> ExceptT ClientError IO a
  }
  deriving stock (a -> OryKratosClient b -> OryKratosClient a
(a -> b) -> OryKratosClient a -> OryKratosClient b
(forall a b. (a -> b) -> OryKratosClient a -> OryKratosClient b)
-> (forall a b. a -> OryKratosClient b -> OryKratosClient a)
-> Functor OryKratosClient
forall a b. a -> OryKratosClient b -> OryKratosClient a
forall a b. (a -> b) -> OryKratosClient a -> OryKratosClient b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> OryKratosClient b -> OryKratosClient a
$c<$ :: forall a b. a -> OryKratosClient b -> OryKratosClient a
fmap :: (a -> b) -> OryKratosClient a -> OryKratosClient b
$cfmap :: forall a b. (a -> b) -> OryKratosClient a -> OryKratosClient b
Functor)

instance Applicative OryKratosClient where
  pure :: a -> OryKratosClient a
pure a
x = (ClientEnv -> ExceptT ClientError IO a) -> OryKratosClient a
forall a.
(ClientEnv -> ExceptT ClientError IO a) -> OryKratosClient a
OryKratosClient (\ClientEnv
_ -> a -> ExceptT ClientError IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure a
x)
  (OryKratosClient ClientEnv -> ExceptT ClientError IO (a -> b)
f) <*> :: OryKratosClient (a -> b) -> OryKratosClient a -> OryKratosClient b
<*> (OryKratosClient ClientEnv -> ExceptT ClientError IO a
x) =
    (ClientEnv -> ExceptT ClientError IO b) -> OryKratosClient b
forall a.
(ClientEnv -> ExceptT ClientError IO a) -> OryKratosClient a
OryKratosClient (\ClientEnv
env -> ClientEnv -> ExceptT ClientError IO (a -> b)
f ClientEnv
env ExceptT ClientError IO (a -> b)
-> ExceptT ClientError IO a -> ExceptT ClientError IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ClientEnv -> ExceptT ClientError IO a
x ClientEnv
env)

instance Monad OryKratosClient where
  (OryKratosClient ClientEnv -> ExceptT ClientError IO a
a) >>= :: OryKratosClient a -> (a -> OryKratosClient b) -> OryKratosClient b
>>= a -> OryKratosClient b
f =
    (ClientEnv -> ExceptT ClientError IO b) -> OryKratosClient b
forall a.
(ClientEnv -> ExceptT ClientError IO a) -> OryKratosClient a
OryKratosClient
      ( \ClientEnv
env -> do
          a
value <- ClientEnv -> ExceptT ClientError IO a
a ClientEnv
env
          OryKratosClient b -> ClientEnv -> ExceptT ClientError IO b
forall a.
OryKratosClient a -> ClientEnv -> ExceptT ClientError IO a
runClient (a -> OryKratosClient b
f a
value) ClientEnv
env
      )

instance MonadIO OryKratosClient where
  liftIO :: IO a -> OryKratosClient a
liftIO IO a
io = (ClientEnv -> ExceptT ClientError IO a) -> OryKratosClient a
forall a.
(ClientEnv -> ExceptT ClientError IO a) -> OryKratosClient a
OryKratosClient (\ClientEnv
_ -> IO a -> ExceptT ClientError IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO a
io)

createOryKratosClient :: OryKratosBackend OryKratosClient
createOryKratosClient :: OryKratosBackend OryKratosClient
createOryKratosClient = OryKratosBackend :: forall (m :: * -> *).
(CreateIdentity -> m Identity)
-> (CreateRecoveryLink -> m RecoveryLink)
-> (Text -> m NoContent)
-> (Text -> m Identity)
-> (Text -> m Value)
-> (Maybe Text -> m SelfServiceErrorContainer)
-> (Maybe Text -> m LoginFlow)
-> (Maybe Text -> m RecoveryFlow)
-> (Maybe Text -> m RegistrationFlow)
-> (Maybe Text -> Maybe Text -> m SettingsFlow)
-> (Maybe Text -> m VerificationFlow)
-> (Maybe Integer -> Maybe Integer -> m [Identity])
-> m NoContent
-> (Text -> UpdateIdentity -> m Identity)
-> m HealthStatus
-> m HealthStatus
-> m NoContent
-> (Maybe Bool -> m NoContent)
-> (Maybe Bool -> m LoginFlow)
-> m NoContent
-> m RecoveryFlow
-> m NoContent
-> m RegistrationFlow
-> m NoContent
-> (Maybe Text -> m SettingsFlow)
-> m NoContent
-> m VerificationFlow
-> (RevokeSession -> m NoContent)
-> (Maybe Text -> Value -> m LoginViaApiResponse)
-> (Maybe Text -> Value -> m NoContent)
-> (Maybe Text
    -> Maybe Text
    -> SubmitSelfServiceRecoveryFlowWithLinkMethod
    -> m NoContent)
-> (Maybe Text -> Value -> m RegistrationViaApiResponse)
-> (Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse)
-> (Maybe Text -> Value -> m NoContent)
-> (Maybe Text -> m Session)
-> m Version
-> OryKratosBackend m
OryKratosBackend {OryKratosClient NoContent
OryKratosClient VerificationFlow
OryKratosClient RecoveryFlow
OryKratosClient Version
OryKratosClient HealthStatus
OryKratosClient RegistrationFlow
Maybe Bool -> OryKratosClient NoContent
Maybe Bool -> OryKratosClient LoginFlow
Maybe Integer -> Maybe Integer -> OryKratosClient [Identity]
Maybe Text -> OryKratosClient VerificationFlow
Maybe Text -> OryKratosClient RecoveryFlow
Maybe Text -> OryKratosClient SelfServiceErrorContainer
Maybe Text -> OryKratosClient Session
Maybe Text -> OryKratosClient SettingsFlow
Maybe Text -> OryKratosClient RegistrationFlow
Maybe Text -> OryKratosClient LoginFlow
Maybe Text -> Maybe Text -> OryKratosClient SettingsFlow
Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> OryKratosClient NoContent
Maybe Text -> Value -> OryKratosClient NoContent
Maybe Text -> Value -> OryKratosClient RegistrationViaApiResponse
Maybe Text -> Value -> OryKratosClient LoginViaApiResponse
Maybe Text
-> Value -> Maybe Text -> OryKratosClient SettingsViaApiResponse
Text -> OryKratosClient Value
Text -> OryKratosClient NoContent
Text -> OryKratosClient Identity
Text -> UpdateIdentity -> OryKratosClient Identity
RevokeSession -> OryKratosClient NoContent
CreateRecoveryLink -> OryKratosClient RecoveryLink
CreateIdentity -> OryKratosClient Identity
getVersion :: OryKratosClient Version
toSession :: Maybe Text -> OryKratosClient Session
submitSelfServiceVerificationFlow :: Maybe Text -> Value -> OryKratosClient NoContent
submitSelfServiceSettingsFlow :: Maybe Text
-> Value -> Maybe Text -> OryKratosClient SettingsViaApiResponse
submitSelfServiceRegistrationFlow :: Maybe Text -> Value -> OryKratosClient RegistrationViaApiResponse
submitSelfServiceRecoveryFlowWithLinkMethod :: Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> OryKratosClient NoContent
submitSelfServiceRecoveryFlow :: Maybe Text -> Value -> OryKratosClient NoContent
submitSelfServiceLoginFlow :: Maybe Text -> Value -> OryKratosClient LoginViaApiResponse
revokeSession :: RevokeSession -> OryKratosClient NoContent
initializeSelfServiceVerificationForNativeApps :: OryKratosClient VerificationFlow
initializeSelfServiceVerificationForBrowsers :: OryKratosClient NoContent
initializeSelfServiceSettingsForNativeApps :: Maybe Text -> OryKratosClient SettingsFlow
initializeSelfServiceSettingsForBrowsers :: OryKratosClient NoContent
initializeSelfServiceRegistrationForNativeApps :: OryKratosClient RegistrationFlow
initializeSelfServiceRegistrationForBrowsers :: OryKratosClient NoContent
initializeSelfServiceRecoveryForNativeApps :: OryKratosClient RecoveryFlow
initializeSelfServiceRecoveryForBrowsers :: OryKratosClient NoContent
initializeSelfServiceLoginForNativeApps :: Maybe Bool -> OryKratosClient LoginFlow
initializeSelfServiceLoginForBrowsers :: Maybe Bool -> OryKratosClient NoContent
initializeSelfServiceBrowserLogoutFlow :: OryKratosClient NoContent
getSelfServiceVerificationFlow :: Maybe Text -> OryKratosClient VerificationFlow
getSelfServiceSettingsFlow :: Maybe Text -> Maybe Text -> OryKratosClient SettingsFlow
getSelfServiceRegistrationFlow :: Maybe Text -> OryKratosClient RegistrationFlow
getSelfServiceRecoveryFlow :: Maybe Text -> OryKratosClient RecoveryFlow
getSelfServiceLoginFlow :: Maybe Text -> OryKratosClient LoginFlow
getSelfServiceError :: Maybe Text -> OryKratosClient SelfServiceErrorContainer
getSchema :: Text -> OryKratosClient Value
isInstanceReady :: OryKratosClient HealthStatus
isInstanceAlive :: OryKratosClient HealthStatus
updateIdentity :: Text -> UpdateIdentity -> OryKratosClient Identity
prometheus :: OryKratosClient NoContent
listIdentities :: Maybe Integer -> Maybe Integer -> OryKratosClient [Identity]
getIdentity :: Text -> OryKratosClient Identity
deleteIdentity :: Text -> OryKratosClient NoContent
createRecoveryLink :: CreateRecoveryLink -> OryKratosClient RecoveryLink
createIdentity :: CreateIdentity -> OryKratosClient Identity
$sel:getVersion:OryKratosBackend :: OryKratosClient Version
$sel:toSession:OryKratosBackend :: Maybe Text -> OryKratosClient Session
$sel:submitSelfServiceVerificationFlow:OryKratosBackend :: Maybe Text -> Value -> OryKratosClient NoContent
$sel:submitSelfServiceSettingsFlow:OryKratosBackend :: Maybe Text
-> Value -> Maybe Text -> OryKratosClient SettingsViaApiResponse
$sel:submitSelfServiceRegistrationFlow:OryKratosBackend :: Maybe Text -> Value -> OryKratosClient RegistrationViaApiResponse
$sel:submitSelfServiceRecoveryFlowWithLinkMethod:OryKratosBackend :: Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> OryKratosClient NoContent
$sel:submitSelfServiceRecoveryFlow:OryKratosBackend :: Maybe Text -> Value -> OryKratosClient NoContent
$sel:submitSelfServiceLoginFlow:OryKratosBackend :: Maybe Text -> Value -> OryKratosClient LoginViaApiResponse
$sel:revokeSession:OryKratosBackend :: RevokeSession -> OryKratosClient NoContent
$sel:initializeSelfServiceVerificationForNativeApps:OryKratosBackend :: OryKratosClient VerificationFlow
$sel:initializeSelfServiceVerificationForBrowsers:OryKratosBackend :: OryKratosClient NoContent
$sel:initializeSelfServiceSettingsForNativeApps:OryKratosBackend :: Maybe Text -> OryKratosClient SettingsFlow
$sel:initializeSelfServiceSettingsForBrowsers:OryKratosBackend :: OryKratosClient NoContent
$sel:initializeSelfServiceRegistrationForNativeApps:OryKratosBackend :: OryKratosClient RegistrationFlow
$sel:initializeSelfServiceRegistrationForBrowsers:OryKratosBackend :: OryKratosClient NoContent
$sel:initializeSelfServiceRecoveryForNativeApps:OryKratosBackend :: OryKratosClient RecoveryFlow
$sel:initializeSelfServiceRecoveryForBrowsers:OryKratosBackend :: OryKratosClient NoContent
$sel:initializeSelfServiceLoginForNativeApps:OryKratosBackend :: Maybe Bool -> OryKratosClient LoginFlow
$sel:initializeSelfServiceLoginForBrowsers:OryKratosBackend :: Maybe Bool -> OryKratosClient NoContent
$sel:initializeSelfServiceBrowserLogoutFlow:OryKratosBackend :: OryKratosClient NoContent
$sel:isInstanceReady:OryKratosBackend :: OryKratosClient HealthStatus
$sel:isInstanceAlive:OryKratosBackend :: OryKratosClient HealthStatus
$sel:updateIdentity:OryKratosBackend :: Text -> UpdateIdentity -> OryKratosClient Identity
$sel:prometheus:OryKratosBackend :: OryKratosClient NoContent
$sel:listIdentities:OryKratosBackend :: Maybe Integer -> Maybe Integer -> OryKratosClient [Identity]
$sel:getSelfServiceVerificationFlow:OryKratosBackend :: Maybe Text -> OryKratosClient VerificationFlow
$sel:getSelfServiceSettingsFlow:OryKratosBackend :: Maybe Text -> Maybe Text -> OryKratosClient SettingsFlow
$sel:getSelfServiceRegistrationFlow:OryKratosBackend :: Maybe Text -> OryKratosClient RegistrationFlow
$sel:getSelfServiceRecoveryFlow:OryKratosBackend :: Maybe Text -> OryKratosClient RecoveryFlow
$sel:getSelfServiceLoginFlow:OryKratosBackend :: Maybe Text -> OryKratosClient LoginFlow
$sel:getSelfServiceError:OryKratosBackend :: Maybe Text -> OryKratosClient SelfServiceErrorContainer
$sel:getSchema:OryKratosBackend :: Text -> OryKratosClient Value
$sel:getIdentity:OryKratosBackend :: Text -> OryKratosClient Identity
$sel:deleteIdentity:OryKratosBackend :: Text -> OryKratosClient NoContent
$sel:createRecoveryLink:OryKratosBackend :: CreateRecoveryLink -> OryKratosClient RecoveryLink
$sel:createIdentity:OryKratosBackend :: CreateIdentity -> OryKratosClient Identity
..}
  where
    (((CreateIdentity -> ClientM Identity)
-> CreateIdentity -> OryKratosClient Identity
coerce -> CreateIdentity -> OryKratosClient Identity
createIdentity) :<|>
     ((CreateRecoveryLink -> ClientM RecoveryLink)
-> CreateRecoveryLink -> OryKratosClient RecoveryLink
coerce -> CreateRecoveryLink -> OryKratosClient RecoveryLink
createRecoveryLink) :<|>
     ((Text -> ClientM NoContent) -> Text -> OryKratosClient NoContent
coerce -> Text -> OryKratosClient NoContent
deleteIdentity) :<|>
     ((Text -> ClientM Identity) -> Text -> OryKratosClient Identity
coerce -> Text -> OryKratosClient Identity
getIdentity) :<|>
     ((Maybe Integer -> Maybe Integer -> ClientM [Identity])
-> Maybe Integer -> Maybe Integer -> OryKratosClient [Identity]
coerce -> Maybe Integer -> Maybe Integer -> OryKratosClient [Identity]
listIdentities) :<|>
     (ClientM NoContent -> OryKratosClient NoContent
coerce -> OryKratosClient NoContent
prometheus) :<|>
     ((Text -> UpdateIdentity -> ClientM Identity)
-> Text -> UpdateIdentity -> OryKratosClient Identity
coerce -> Text -> UpdateIdentity -> OryKratosClient Identity
updateIdentity) :<|>
     (ClientM HealthStatus -> OryKratosClient HealthStatus
coerce -> OryKratosClient HealthStatus
isInstanceAlive) :<|>
     (ClientM HealthStatus -> OryKratosClient HealthStatus
coerce -> OryKratosClient HealthStatus
isInstanceReady) :<|>
     ((Text -> ClientM Value) -> Text -> OryKratosClient Value
coerce -> Text -> OryKratosClient Value
getSchema) :<|>
     ((Maybe Text -> ClientM SelfServiceErrorContainer)
-> Maybe Text -> OryKratosClient SelfServiceErrorContainer
coerce -> Maybe Text -> OryKratosClient SelfServiceErrorContainer
getSelfServiceError) :<|>
     ((Maybe Text -> ClientM LoginFlow)
-> Maybe Text -> OryKratosClient LoginFlow
coerce -> Maybe Text -> OryKratosClient LoginFlow
getSelfServiceLoginFlow) :<|>
     ((Maybe Text -> ClientM RecoveryFlow)
-> Maybe Text -> OryKratosClient RecoveryFlow
coerce -> Maybe Text -> OryKratosClient RecoveryFlow
getSelfServiceRecoveryFlow) :<|>
     ((Maybe Text -> ClientM RegistrationFlow)
-> Maybe Text -> OryKratosClient RegistrationFlow
coerce -> Maybe Text -> OryKratosClient RegistrationFlow
getSelfServiceRegistrationFlow) :<|>
     ((Maybe Text -> Maybe Text -> ClientM SettingsFlow)
-> Maybe Text -> Maybe Text -> OryKratosClient SettingsFlow
coerce -> Maybe Text -> Maybe Text -> OryKratosClient SettingsFlow
getSelfServiceSettingsFlow) :<|>
     ((Maybe Text -> ClientM VerificationFlow)
-> Maybe Text -> OryKratosClient VerificationFlow
coerce -> Maybe Text -> OryKratosClient VerificationFlow
getSelfServiceVerificationFlow) :<|>
     (ClientM NoContent -> OryKratosClient NoContent
coerce -> OryKratosClient NoContent
initializeSelfServiceBrowserLogoutFlow) :<|>
     ((Maybe Bool -> ClientM NoContent)
-> Maybe Bool -> OryKratosClient NoContent
coerce -> Maybe Bool -> OryKratosClient NoContent
initializeSelfServiceLoginForBrowsers) :<|>
     ((Maybe Bool -> ClientM LoginFlow)
-> Maybe Bool -> OryKratosClient LoginFlow
coerce -> Maybe Bool -> OryKratosClient LoginFlow
initializeSelfServiceLoginForNativeApps) :<|>
     (ClientM NoContent -> OryKratosClient NoContent
coerce -> OryKratosClient NoContent
initializeSelfServiceRecoveryForBrowsers) :<|>
     (ClientM RecoveryFlow -> OryKratosClient RecoveryFlow
coerce -> OryKratosClient RecoveryFlow
initializeSelfServiceRecoveryForNativeApps) :<|>
     (ClientM NoContent -> OryKratosClient NoContent
coerce -> OryKratosClient NoContent
initializeSelfServiceRegistrationForBrowsers) :<|>
     (ClientM RegistrationFlow -> OryKratosClient RegistrationFlow
coerce -> OryKratosClient RegistrationFlow
initializeSelfServiceRegistrationForNativeApps) :<|>
     (ClientM NoContent -> OryKratosClient NoContent
coerce -> OryKratosClient NoContent
initializeSelfServiceSettingsForBrowsers) :<|>
     ((Maybe Text -> ClientM SettingsFlow)
-> Maybe Text -> OryKratosClient SettingsFlow
coerce -> Maybe Text -> OryKratosClient SettingsFlow
initializeSelfServiceSettingsForNativeApps) :<|>
     (ClientM NoContent -> OryKratosClient NoContent
coerce -> OryKratosClient NoContent
initializeSelfServiceVerificationForBrowsers) :<|>
     (ClientM VerificationFlow -> OryKratosClient VerificationFlow
coerce -> OryKratosClient VerificationFlow
initializeSelfServiceVerificationForNativeApps) :<|>
     ((RevokeSession -> ClientM NoContent)
-> RevokeSession -> OryKratosClient NoContent
coerce -> RevokeSession -> OryKratosClient NoContent
revokeSession) :<|>
     ((Maybe Text -> Value -> ClientM LoginViaApiResponse)
-> Maybe Text -> Value -> OryKratosClient LoginViaApiResponse
coerce -> Maybe Text -> Value -> OryKratosClient LoginViaApiResponse
submitSelfServiceLoginFlow) :<|>
     ((Maybe Text -> Value -> ClientM NoContent)
-> Maybe Text -> Value -> OryKratosClient NoContent
coerce -> Maybe Text -> Value -> OryKratosClient NoContent
submitSelfServiceRecoveryFlow) :<|>
     ((Maybe Text
 -> Maybe Text
 -> SubmitSelfServiceRecoveryFlowWithLinkMethod
 -> ClientM NoContent)
-> Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> OryKratosClient NoContent
coerce -> Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> OryKratosClient NoContent
submitSelfServiceRecoveryFlowWithLinkMethod) :<|>
     ((Maybe Text -> Value -> ClientM RegistrationViaApiResponse)
-> Maybe Text
-> Value
-> OryKratosClient RegistrationViaApiResponse
coerce -> Maybe Text -> Value -> OryKratosClient RegistrationViaApiResponse
submitSelfServiceRegistrationFlow) :<|>
     ((Maybe Text
 -> Value -> Maybe Text -> ClientM SettingsViaApiResponse)
-> Maybe Text
-> Value
-> Maybe Text
-> OryKratosClient SettingsViaApiResponse
coerce -> Maybe Text
-> Value -> Maybe Text -> OryKratosClient SettingsViaApiResponse
submitSelfServiceSettingsFlow) :<|>
     ((Maybe Text -> Value -> ClientM NoContent)
-> Maybe Text -> Value -> OryKratosClient NoContent
coerce -> Maybe Text -> Value -> OryKratosClient NoContent
submitSelfServiceVerificationFlow) :<|>
     ((Maybe Text -> ClientM Session)
-> Maybe Text -> OryKratosClient Session
coerce -> Maybe Text -> OryKratosClient Session
toSession) :<|>
     (ClientM Version -> OryKratosClient Version
coerce -> OryKratosClient Version
getVersion) :<|>
     ByteString -> ClientM Response
_) = Proxy OryKratosAPI -> Client ClientM OryKratosAPI
forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (Proxy OryKratosAPI
forall k (t :: k). Proxy t
Proxy :: Proxy OryKratosAPI)

-- | Run requests in the OryKratosClient monad.
runOryKratosClient :: Config -> OryKratosClient a -> ExceptT ClientError IO a
runOryKratosClient :: Config -> OryKratosClient a -> ExceptT ClientError IO a
runOryKratosClient Config
clientConfig OryKratosClient a
cl = do
  Manager
manager <- IO Manager -> ExceptT ClientError IO Manager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Manager -> ExceptT ClientError IO Manager)
-> IO Manager -> ExceptT ClientError IO Manager
forall a b. (a -> b) -> a -> b
$ ManagerSettings -> IO Manager
newManager ManagerSettings
tlsManagerSettings
  Manager -> Config -> OryKratosClient a -> ExceptT ClientError IO a
forall a.
Manager -> Config -> OryKratosClient a -> ExceptT ClientError IO a
runOryKratosClientWithManager Manager
manager Config
clientConfig OryKratosClient a
cl

-- | Run requests in the OryKratosClient monad using a custom manager.
runOryKratosClientWithManager :: Manager -> Config -> OryKratosClient a -> ExceptT ClientError IO a
runOryKratosClientWithManager :: Manager -> Config -> OryKratosClient a -> ExceptT ClientError IO a
runOryKratosClientWithManager Manager
manager Config {[Char]
configUrl :: [Char]
$sel:configUrl:Config :: Config -> [Char]
..} OryKratosClient a
cl = do
  BaseUrl
url <- [Char] -> ExceptT ClientError IO BaseUrl
forall (m :: * -> *). MonadThrow m => [Char] -> m BaseUrl
parseBaseUrl [Char]
configUrl
  OryKratosClient a -> ClientEnv -> ExceptT ClientError IO a
forall a.
OryKratosClient a -> ClientEnv -> ExceptT ClientError IO a
runClient OryKratosClient a
cl (ClientEnv -> ExceptT ClientError IO a)
-> ClientEnv -> ExceptT ClientError IO a
forall a b. (a -> b) -> a -> b
$ Manager -> BaseUrl -> ClientEnv
mkClientEnv Manager
manager BaseUrl
url

-- | Like @runClient@, but returns the response or throws
--   a OryKratosClientError
callOryKratos ::
  (MonadIO m, MonadThrow m) =>
  ClientEnv ->
  OryKratosClient a ->
  m a
callOryKratos :: ClientEnv -> OryKratosClient a -> m a
callOryKratos ClientEnv
env OryKratosClient a
f = do
  Either ClientError a
res <- IO (Either ClientError a) -> m (Either ClientError a)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Either ClientError a) -> m (Either ClientError a))
-> IO (Either ClientError a) -> m (Either ClientError a)
forall a b. (a -> b) -> a -> b
$ ExceptT ClientError IO a -> IO (Either ClientError a)
forall e (m :: * -> *) a. ExceptT e m a -> m (Either e a)
runExceptT (ExceptT ClientError IO a -> IO (Either ClientError a))
-> ExceptT ClientError IO a -> IO (Either ClientError a)
forall a b. (a -> b) -> a -> b
$ OryKratosClient a -> ClientEnv -> ExceptT ClientError IO a
forall a.
OryKratosClient a -> ClientEnv -> ExceptT ClientError IO a
runClient OryKratosClient a
f ClientEnv
env
  case Either ClientError a
res of
    Left ClientError
err -> OryKratosClientError -> m a
forall (m :: * -> *) e a. (MonadThrow m, Exception e) => e -> m a
throwM (ClientError -> OryKratosClientError
OryKratosClientError ClientError
err)
    Right a
response -> a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure a
response

requestMiddlewareId :: Application -> Application
requestMiddlewareId :: Application -> Application
requestMiddlewareId Application
a = Application
a

-- | Run the OryKratos server at the provided host and port.
runOryKratosServer ::
  (MonadIO m, MonadThrow m) =>
  Config ->
  OryKratosBackend (ExceptT ServerError IO) ->
  m ()
runOryKratosServer :: Config -> OryKratosBackend (ExceptT ServerError IO) -> m ()
runOryKratosServer Config
config =
  Config
-> (Application -> Application)
-> OryKratosBackend (ExceptT ServerError IO)
-> m ()
forall (m :: * -> *).
(MonadIO m, MonadThrow m) =>
Config
-> (Application -> Application)
-> OryKratosBackend (ExceptT ServerError IO)
-> m ()
runOryKratosMiddlewareServer Config
config Application -> Application
requestMiddlewareId

-- | Run the OryKratos server at the provided host and port.
runOryKratosMiddlewareServer ::
  (MonadIO m, MonadThrow m) =>
  Config ->
  Middleware ->
  OryKratosBackend (ExceptT ServerError IO) ->
  m ()
runOryKratosMiddlewareServer :: Config
-> (Application -> Application)
-> OryKratosBackend (ExceptT ServerError IO)
-> m ()
runOryKratosMiddlewareServer Config {[Char]
configUrl :: [Char]
$sel:configUrl:Config :: Config -> [Char]
..} Application -> Application
middleware OryKratosBackend (ExceptT ServerError IO)
backend = do
  BaseUrl
url <- [Char] -> m BaseUrl
forall (m :: * -> *). MonadThrow m => [Char] -> m BaseUrl
parseBaseUrl [Char]
configUrl
  let warpSettings :: Settings
warpSettings =
        Settings
Warp.defaultSettings
          Settings -> (Settings -> Settings) -> Settings
forall a b. a -> (a -> b) -> b
& Int -> Settings -> Settings
Warp.setPort (BaseUrl -> Int
baseUrlPort BaseUrl
url)
          Settings -> (Settings -> Settings) -> Settings
forall a b. a -> (a -> b) -> b
& HostPreference -> Settings -> Settings
Warp.setHost ([Char] -> HostPreference
forall a. IsString a => [Char] -> a
fromString ([Char] -> HostPreference) -> [Char] -> HostPreference
forall a b. (a -> b) -> a -> b
$ BaseUrl -> [Char]
baseUrlHost BaseUrl
url)
  IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Settings -> Application -> IO ()
Warp.runSettings Settings
warpSettings (Application -> IO ()) -> Application -> IO ()
forall a b. (a -> b) -> a -> b
$ Application -> Application
middleware (Application -> Application) -> Application -> Application
forall a b. (a -> b) -> a -> b
$ Proxy OryKratosAPI -> Server OryKratosAPI -> Application
forall api.
HasServer api '[] =>
Proxy api -> Server api -> Application
serve (Proxy OryKratosAPI
forall k (t :: k). Proxy t
Proxy :: Proxy OryKratosAPI) (OryKratosBackend (ExceptT ServerError IO)
-> (CreateIdentity -> Handler Identity)
   :<|> ((CreateRecoveryLink -> Handler RecoveryLink)
         :<|> ((Text -> Handler NoContent)
               :<|> ((Text -> Handler Identity)
                     :<|> ((Maybe Integer -> Maybe Integer -> Handler [Identity])
                           :<|> (Handler NoContent
                                 :<|> ((Text -> UpdateIdentity -> Handler Identity)
                                       :<|> (Handler HealthStatus
                                             :<|> (Handler HealthStatus
                                                   :<|> ((Text -> Handler Value)
                                                         :<|> ((Maybe Text
                                                                -> Handler
                                                                     SelfServiceErrorContainer)
                                                               :<|> ((Maybe Text
                                                                      -> Handler LoginFlow)
                                                                     :<|> ((Maybe Text
                                                                            -> Handler RecoveryFlow)
                                                                           :<|> ((Maybe Text
                                                                                  -> Handler
                                                                                       RegistrationFlow)
                                                                                 :<|> ((Maybe Text
                                                                                        -> Maybe
                                                                                             Text
                                                                                        -> Handler
                                                                                             SettingsFlow)
                                                                                       :<|> ((Maybe
                                                                                                Text
                                                                                              -> Handler
                                                                                                   VerificationFlow)
                                                                                             :<|> (Handler
                                                                                                     NoContent
                                                                                                   :<|> ((Maybe
                                                                                                            Bool
                                                                                                          -> Handler
                                                                                                               NoContent)
                                                                                                         :<|> ((Maybe
                                                                                                                  Bool
                                                                                                                -> Handler
                                                                                                                     LoginFlow)
                                                                                                               :<|> (Handler
                                                                                                                       NoContent
                                                                                                                     :<|> (Handler
                                                                                                                             RecoveryFlow
                                                                                                                           :<|> (Handler
                                                                                                                                   NoContent
                                                                                                                                 :<|> (Handler
                                                                                                                                         RegistrationFlow
                                                                                                                                       :<|> (Handler
                                                                                                                                               NoContent
                                                                                                                                             :<|> ((Maybe
                                                                                                                                                      Text
                                                                                                                                                    -> Handler
                                                                                                                                                         SettingsFlow)
                                                                                                                                                   :<|> (Handler
                                                                                                                                                           NoContent
                                                                                                                                                         :<|> (Handler
                                                                                                                                                                 VerificationFlow
                                                                                                                                                               :<|> ((RevokeSession
                                                                                                                                                                      -> Handler
                                                                                                                                                                           NoContent)
                                                                                                                                                                     :<|> ((Maybe
                                                                                                                                                                              Text
                                                                                                                                                                            -> Value
                                                                                                                                                                            -> Handler
                                                                                                                                                                                 LoginViaApiResponse)
                                                                                                                                                                           :<|> ((Maybe
                                                                                                                                                                                    Text
                                                                                                                                                                                  -> Value
                                                                                                                                                                                  -> Handler
                                                                                                                                                                                       NoContent)
                                                                                                                                                                                 :<|> ((Maybe
                                                                                                                                                                                          Text
                                                                                                                                                                                        -> Maybe
                                                                                                                                                                                             Text
                                                                                                                                                                                        -> SubmitSelfServiceRecoveryFlowWithLinkMethod
                                                                                                                                                                                        -> Handler
                                                                                                                                                                                             NoContent)
                                                                                                                                                                                       :<|> ((Maybe
                                                                                                                                                                                                Text
                                                                                                                                                                                              -> Value
                                                                                                                                                                                              -> Handler
                                                                                                                                                                                                   RegistrationViaApiResponse)
                                                                                                                                                                                             :<|> ((Maybe
                                                                                                                                                                                                      Text
                                                                                                                                                                                                    -> Value
                                                                                                                                                                                                    -> Maybe
                                                                                                                                                                                                         Text
                                                                                                                                                                                                    -> Handler
                                                                                                                                                                                                         SettingsViaApiResponse)
                                                                                                                                                                                                   :<|> ((Maybe
                                                                                                                                                                                                            Text
                                                                                                                                                                                                          -> Value
                                                                                                                                                                                                          -> Handler
                                                                                                                                                                                                               NoContent)
                                                                                                                                                                                                         :<|> ((Maybe
                                                                                                                                                                                                                  Text
                                                                                                                                                                                                                -> Handler
                                                                                                                                                                                                                     Session)
                                                                                                                                                                                                               :<|> (Handler
                                                                                                                                                                                                                       Version
                                                                                                                                                                                                                     :<|> Tagged
                                                                                                                                                                                                                            Handler
                                                                                                                                                                                                                            Application)))))))))))))))))))))))))))))))))))
forall a (m :: * -> *) a a a a a a a a a a a a a a a a a a a a a a
       a a a a a a a a a a a a a (m :: * -> *).
(Coercible a (CreateIdentity -> m Identity),
 Coercible a (CreateRecoveryLink -> m RecoveryLink),
 Coercible a (Text -> m NoContent),
 Coercible a (Text -> m Identity),
 Coercible a (Maybe Integer -> Maybe Integer -> m [Identity]),
 Coercible a (m NoContent),
 Coercible a (Text -> UpdateIdentity -> m Identity),
 Coercible a (m HealthStatus), Coercible a (m HealthStatus),
 Coercible a (Text -> m Value),
 Coercible a (Maybe Text -> m SelfServiceErrorContainer),
 Coercible a (Maybe Text -> m LoginFlow),
 Coercible a (Maybe Text -> m RecoveryFlow),
 Coercible a (Maybe Text -> m RegistrationFlow),
 Coercible a (Maybe Text -> Maybe Text -> m SettingsFlow),
 Coercible a (Maybe Text -> m VerificationFlow),
 Coercible a (m NoContent), Coercible a (Maybe Bool -> m NoContent),
 Coercible a (Maybe Bool -> m LoginFlow), Coercible a (m NoContent),
 Coercible a (m RecoveryFlow), Coercible a (m NoContent),
 Coercible a (m RegistrationFlow), Coercible a (m NoContent),
 Coercible a (Maybe Text -> m SettingsFlow),
 Coercible a (m NoContent), Coercible a (m VerificationFlow),
 Coercible a (RevokeSession -> m NoContent),
 Coercible a (Maybe Text -> Value -> m LoginViaApiResponse),
 Coercible a (Maybe Text -> Value -> m NoContent),
 Coercible
   a
   (Maybe Text
    -> Maybe Text
    -> SubmitSelfServiceRecoveryFlowWithLinkMethod
    -> m NoContent),
 Coercible a (Maybe Text -> Value -> m RegistrationViaApiResponse),
 Coercible
   a (Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse),
 Coercible a (Maybe Text -> Value -> m NoContent),
 Coercible a (Maybe Text -> m Session), Coercible a (m Version)) =>
OryKratosBackend m
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> (a
                                                                                                                                                                                       :<|> (a
                                                                                                                                                                                             :<|> (a
                                                                                                                                                                                                   :<|> (a
                                                                                                                                                                                                         :<|> (a
                                                                                                                                                                                                               :<|> (a
                                                                                                                                                                                                                     :<|> Tagged
                                                                                                                                                                                                                            m
                                                                                                                                                                                                                            Application)))))))))))))))))))))))))))))))))))
serverFromBackend OryKratosBackend (ExceptT ServerError IO)
backend)
  where
    serverFromBackend :: OryKratosBackend m
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> (a
                                                                                                                                                                                       :<|> (a
                                                                                                                                                                                             :<|> (a
                                                                                                                                                                                                   :<|> (a
                                                                                                                                                                                                         :<|> (a
                                                                                                                                                                                                               :<|> (a
                                                                                                                                                                                                                     :<|> Tagged
                                                                                                                                                                                                                            m
                                                                                                                                                                                                                            Application)))))))))))))))))))))))))))))))))))
serverFromBackend OryKratosBackend {m NoContent
m VerificationFlow
m RecoveryFlow
m Version
m HealthStatus
m RegistrationFlow
Maybe Bool -> m NoContent
Maybe Bool -> m LoginFlow
Maybe Integer -> Maybe Integer -> m [Identity]
Maybe Text -> m VerificationFlow
Maybe Text -> m RecoveryFlow
Maybe Text -> m SelfServiceErrorContainer
Maybe Text -> m Session
Maybe Text -> m SettingsFlow
Maybe Text -> m RegistrationFlow
Maybe Text -> m LoginFlow
Maybe Text -> Maybe Text -> m SettingsFlow
Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> m NoContent
Maybe Text -> Value -> m NoContent
Maybe Text -> Value -> m RegistrationViaApiResponse
Maybe Text -> Value -> m LoginViaApiResponse
Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse
Text -> m Value
Text -> m NoContent
Text -> m Identity
Text -> UpdateIdentity -> m Identity
RevokeSession -> m NoContent
CreateRecoveryLink -> m RecoveryLink
CreateIdentity -> m Identity
getVersion :: m Version
toSession :: Maybe Text -> m Session
submitSelfServiceVerificationFlow :: Maybe Text -> Value -> m NoContent
submitSelfServiceSettingsFlow :: Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse
submitSelfServiceRegistrationFlow :: Maybe Text -> Value -> m RegistrationViaApiResponse
submitSelfServiceRecoveryFlowWithLinkMethod :: Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> m NoContent
submitSelfServiceRecoveryFlow :: Maybe Text -> Value -> m NoContent
submitSelfServiceLoginFlow :: Maybe Text -> Value -> m LoginViaApiResponse
revokeSession :: RevokeSession -> m NoContent
initializeSelfServiceVerificationForNativeApps :: m VerificationFlow
initializeSelfServiceVerificationForBrowsers :: m NoContent
initializeSelfServiceSettingsForNativeApps :: Maybe Text -> m SettingsFlow
initializeSelfServiceSettingsForBrowsers :: m NoContent
initializeSelfServiceRegistrationForNativeApps :: m RegistrationFlow
initializeSelfServiceRegistrationForBrowsers :: m NoContent
initializeSelfServiceRecoveryForNativeApps :: m RecoveryFlow
initializeSelfServiceRecoveryForBrowsers :: m NoContent
initializeSelfServiceLoginForNativeApps :: Maybe Bool -> m LoginFlow
initializeSelfServiceLoginForBrowsers :: Maybe Bool -> m NoContent
initializeSelfServiceBrowserLogoutFlow :: m NoContent
isInstanceReady :: m HealthStatus
isInstanceAlive :: m HealthStatus
updateIdentity :: Text -> UpdateIdentity -> m Identity
prometheus :: m NoContent
listIdentities :: Maybe Integer -> Maybe Integer -> m [Identity]
getSelfServiceVerificationFlow :: Maybe Text -> m VerificationFlow
getSelfServiceSettingsFlow :: Maybe Text -> Maybe Text -> m SettingsFlow
getSelfServiceRegistrationFlow :: Maybe Text -> m RegistrationFlow
getSelfServiceRecoveryFlow :: Maybe Text -> m RecoveryFlow
getSelfServiceLoginFlow :: Maybe Text -> m LoginFlow
getSelfServiceError :: Maybe Text -> m SelfServiceErrorContainer
getSchema :: Text -> m Value
getIdentity :: Text -> m Identity
deleteIdentity :: Text -> m NoContent
createRecoveryLink :: CreateRecoveryLink -> m RecoveryLink
createIdentity :: CreateIdentity -> m Identity
$sel:getVersion:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m Version
$sel:toSession:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> Maybe Text -> m Session
$sel:submitSelfServiceVerificationFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> Value -> m NoContent
$sel:submitSelfServiceSettingsFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m
-> Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse
$sel:submitSelfServiceRegistrationFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m
-> Maybe Text -> Value -> m RegistrationViaApiResponse
$sel:submitSelfServiceRecoveryFlowWithLinkMethod:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m
-> Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> m NoContent
$sel:submitSelfServiceRecoveryFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> Value -> m NoContent
$sel:submitSelfServiceLoginFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> Value -> m LoginViaApiResponse
$sel:revokeSession:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> RevokeSession -> m NoContent
$sel:initializeSelfServiceVerificationForNativeApps:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m VerificationFlow
$sel:initializeSelfServiceVerificationForBrowsers:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m NoContent
$sel:initializeSelfServiceSettingsForNativeApps:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> m SettingsFlow
$sel:initializeSelfServiceSettingsForBrowsers:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m NoContent
$sel:initializeSelfServiceRegistrationForNativeApps:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m RegistrationFlow
$sel:initializeSelfServiceRegistrationForBrowsers:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m NoContent
$sel:initializeSelfServiceRecoveryForNativeApps:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m RecoveryFlow
$sel:initializeSelfServiceRecoveryForBrowsers:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m NoContent
$sel:initializeSelfServiceLoginForNativeApps:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Bool -> m LoginFlow
$sel:initializeSelfServiceLoginForBrowsers:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Bool -> m NoContent
$sel:initializeSelfServiceBrowserLogoutFlow:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m NoContent
$sel:isInstanceReady:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m HealthStatus
$sel:isInstanceAlive:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m HealthStatus
$sel:updateIdentity:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Text -> UpdateIdentity -> m Identity
$sel:prometheus:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> m NoContent
$sel:listIdentities:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m
-> Maybe Integer -> Maybe Integer -> m [Identity]
$sel:getSelfServiceVerificationFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> m VerificationFlow
$sel:getSelfServiceSettingsFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> Maybe Text -> m SettingsFlow
$sel:getSelfServiceRegistrationFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> m RegistrationFlow
$sel:getSelfServiceRecoveryFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> m RecoveryFlow
$sel:getSelfServiceLoginFlow:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> m LoginFlow
$sel:getSelfServiceError:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> Maybe Text -> m SelfServiceErrorContainer
$sel:getSchema:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> Text -> m Value
$sel:getIdentity:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> Text -> m Identity
$sel:deleteIdentity:OryKratosBackend :: forall (m :: * -> *). OryKratosBackend m -> Text -> m NoContent
$sel:createRecoveryLink:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> CreateRecoveryLink -> m RecoveryLink
$sel:createIdentity:OryKratosBackend :: forall (m :: * -> *).
OryKratosBackend m -> CreateIdentity -> m Identity
..} =
      (CreateIdentity -> m Identity) -> a
coerce CreateIdentity -> m Identity
createIdentity a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> (a
                                                                                                                                                                      :<|> (a
                                                                                                                                                                            :<|> (a
                                                                                                                                                                                  :<|> (a
                                                                                                                                                                                        :<|> (a
                                                                                                                                                                                              :<|> (a
                                                                                                                                                                                                    :<|> (a
                                                                                                                                                                                                          :<|> (a
                                                                                                                                                                                                                :<|> Tagged
                                                                                                                                                                                                                       m
                                                                                                                                                                                                                       Application)))))))))))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> (a
                                                                                                                                                                                       :<|> (a
                                                                                                                                                                                             :<|> (a
                                                                                                                                                                                                   :<|> (a
                                                                                                                                                                                                         :<|> (a
                                                                                                                                                                                                               :<|> (a
                                                                                                                                                                                                                     :<|> Tagged
                                                                                                                                                                                                                            m
                                                                                                                                                                                                                            Application)))))))))))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (CreateRecoveryLink -> m RecoveryLink) -> a
coerce CreateRecoveryLink -> m RecoveryLink
createRecoveryLink a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> (a
                                                                                                                                                                      :<|> (a
                                                                                                                                                                            :<|> (a
                                                                                                                                                                                  :<|> (a
                                                                                                                                                                                        :<|> (a
                                                                                                                                                                                              :<|> (a
                                                                                                                                                                                                    :<|> (a
                                                                                                                                                                                                          :<|> Tagged
                                                                                                                                                                                                                 m
                                                                                                                                                                                                                 Application))))))))))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> (a
                                                                                                                                                                                       :<|> (a
                                                                                                                                                                                             :<|> (a
                                                                                                                                                                                                   :<|> (a
                                                                                                                                                                                                         :<|> (a
                                                                                                                                                                                                               :<|> Tagged
                                                                                                                                                                                                                      m
                                                                                                                                                                                                                      Application))))))))))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Text -> m NoContent) -> a
coerce Text -> m NoContent
deleteIdentity a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> (a
                                                                                                                                                                      :<|> (a
                                                                                                                                                                            :<|> (a
                                                                                                                                                                                  :<|> (a
                                                                                                                                                                                        :<|> (a
                                                                                                                                                                                              :<|> (a
                                                                                                                                                                                                    :<|> Tagged
                                                                                                                                                                                                           m
                                                                                                                                                                                                           Application)))))))))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> (a
                                                                                                                                                                                       :<|> (a
                                                                                                                                                                                             :<|> (a
                                                                                                                                                                                                   :<|> (a
                                                                                                                                                                                                         :<|> Tagged
                                                                                                                                                                                                                m
                                                                                                                                                                                                                Application)))))))))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Text -> m Identity) -> a
coerce Text -> m Identity
getIdentity a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> (a
                                                                                                                                                                      :<|> (a
                                                                                                                                                                            :<|> (a
                                                                                                                                                                                  :<|> (a
                                                                                                                                                                                        :<|> (a
                                                                                                                                                                                              :<|> Tagged
                                                                                                                                                                                                     m
                                                                                                                                                                                                     Application))))))))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> (a
                                                                                                                                                                                       :<|> (a
                                                                                                                                                                                             :<|> (a
                                                                                                                                                                                                   :<|> Tagged
                                                                                                                                                                                                          m
                                                                                                                                                                                                          Application))))))))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Integer -> Maybe Integer -> m [Identity]) -> a
coerce Maybe Integer -> Maybe Integer -> m [Identity]
listIdentities a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> (a
                                                                                                                                                                      :<|> (a
                                                                                                                                                                            :<|> (a
                                                                                                                                                                                  :<|> (a
                                                                                                                                                                                        :<|> Tagged
                                                                                                                                                                                               m
                                                                                                                                                                                               Application)))))))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> (a
                                                                                                                                                                                       :<|> (a
                                                                                                                                                                                             :<|> Tagged
                                                                                                                                                                                                    m
                                                                                                                                                                                                    Application)))))))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m NoContent -> a
coerce m NoContent
prometheus a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> (a
                                                                                                                                                                      :<|> (a
                                                                                                                                                                            :<|> (a
                                                                                                                                                                                  :<|> Tagged
                                                                                                                                                                                         m
                                                                                                                                                                                         Application))))))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> (a
                                                                                                                                                                                       :<|> Tagged
                                                                                                                                                                                              m
                                                                                                                                                                                              Application))))))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Text -> UpdateIdentity -> m Identity) -> a
coerce Text -> UpdateIdentity -> m Identity
updateIdentity a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> (a
                                                                                                                                                                      :<|> (a
                                                                                                                                                                            :<|> Tagged
                                                                                                                                                                                   m
                                                                                                                                                                                   Application)))))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> (a
                                                                                                                                                                                 :<|> Tagged
                                                                                                                                                                                        m
                                                                                                                                                                                        Application)))))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m HealthStatus -> a
coerce m HealthStatus
isInstanceAlive a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> (a
                                                                                                                                                                      :<|> Tagged
                                                                                                                                                                             m
                                                                                                                                                                             Application))))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> (a
                                                                                                                                                                           :<|> Tagged
                                                                                                                                                                                  m
                                                                                                                                                                                  Application))))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m HealthStatus -> a
coerce m HealthStatus
isInstanceReady a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> (a
                                                                                                                                                                :<|> Tagged
                                                                                                                                                                       m
                                                                                                                                                                       Application)))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> (a
                                                                                                                                                                     :<|> Tagged
                                                                                                                                                                            m
                                                                                                                                                                            Application)))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Text -> m Value) -> a
coerce Text -> m Value
getSchema a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> (a
                                                                                                                                                          :<|> Tagged
                                                                                                                                                                 m
                                                                                                                                                                 Application))))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> (a
                                                                                                                                                               :<|> Tagged
                                                                                                                                                                      m
                                                                                                                                                                      Application))))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> m SelfServiceErrorContainer) -> a
coerce Maybe Text -> m SelfServiceErrorContainer
getSelfServiceError a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> (a
                                                                                                                                                    :<|> Tagged
                                                                                                                                                           m
                                                                                                                                                           Application)))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> (a
                                                                                                                                                         :<|> Tagged
                                                                                                                                                                m
                                                                                                                                                                Application)))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> m LoginFlow) -> a
coerce Maybe Text -> m LoginFlow
getSelfServiceLoginFlow a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> (a
                                                                                                                                              :<|> Tagged
                                                                                                                                                     m
                                                                                                                                                     Application))))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> (a
                                                                                                                                                   :<|> Tagged
                                                                                                                                                          m
                                                                                                                                                          Application))))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> m RecoveryFlow) -> a
coerce Maybe Text -> m RecoveryFlow
getSelfServiceRecoveryFlow a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> (a
                                                                                                                                        :<|> Tagged
                                                                                                                                               m
                                                                                                                                               Application)))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> (a
                                                                                                                                             :<|> Tagged
                                                                                                                                                    m
                                                                                                                                                    Application)))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> m RegistrationFlow) -> a
coerce Maybe Text -> m RegistrationFlow
getSelfServiceRegistrationFlow a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> (a
                                                                                                                                  :<|> Tagged
                                                                                                                                         m
                                                                                                                                         Application))))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> (a
                                                                                                                                       :<|> Tagged
                                                                                                                                              m
                                                                                                                                              Application))))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> Maybe Text -> m SettingsFlow) -> a
coerce Maybe Text -> Maybe Text -> m SettingsFlow
getSelfServiceSettingsFlow a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> (a
                                                                                                                            :<|> Tagged
                                                                                                                                   m
                                                                                                                                   Application)))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> (a
                                                                                                                                 :<|> Tagged
                                                                                                                                        m
                                                                                                                                        Application)))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> m VerificationFlow) -> a
coerce Maybe Text -> m VerificationFlow
getSelfServiceVerificationFlow a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> (a
                                                                                                                      :<|> Tagged
                                                                                                                             m
                                                                                                                             Application))))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> (a
                                                                                                                           :<|> Tagged
                                                                                                                                  m
                                                                                                                                  Application))))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m NoContent -> a
coerce m NoContent
initializeSelfServiceBrowserLogoutFlow a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> (a
                                                                                                                :<|> Tagged
                                                                                                                       m
                                                                                                                       Application)))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> (a
                                                                                                                     :<|> Tagged
                                                                                                                            m
                                                                                                                            Application)))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Bool -> m NoContent) -> a
coerce Maybe Bool -> m NoContent
initializeSelfServiceLoginForBrowsers a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> (a
                                                                                                          :<|> Tagged
                                                                                                                 m
                                                                                                                 Application))))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> (a
                                                                                                               :<|> Tagged
                                                                                                                      m
                                                                                                                      Application))))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Bool -> m LoginFlow) -> a
coerce Maybe Bool -> m LoginFlow
initializeSelfServiceLoginForNativeApps a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> (a
                                                                                                    :<|> Tagged
                                                                                                           m
                                                                                                           Application)))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> (a
                                                                                                         :<|> Tagged
                                                                                                                m
                                                                                                                Application)))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m NoContent -> a
coerce m NoContent
initializeSelfServiceRecoveryForBrowsers a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> (a
                                                                                              :<|> Tagged
                                                                                                     m
                                                                                                     Application))))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> (a
                                                                                                   :<|> Tagged
                                                                                                          m
                                                                                                          Application))))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m RecoveryFlow -> a
coerce m RecoveryFlow
initializeSelfServiceRecoveryForNativeApps a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> (a
                                                                                        :<|> Tagged
                                                                                               m
                                                                                               Application)))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> (a
                                                                                             :<|> Tagged
                                                                                                    m
                                                                                                    Application)))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m NoContent -> a
coerce m NoContent
initializeSelfServiceRegistrationForBrowsers a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> (a
                                                                                  :<|> Tagged
                                                                                         m
                                                                                         Application))))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> (a
                                                                                       :<|> Tagged
                                                                                              m
                                                                                              Application))))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m RegistrationFlow -> a
coerce m RegistrationFlow
initializeSelfServiceRegistrationForNativeApps a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> (a
                                                                            :<|> Tagged
                                                                                   m
                                                                                   Application)))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> (a
                                                                                 :<|> Tagged
                                                                                        m
                                                                                        Application)))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m NoContent -> a
coerce m NoContent
initializeSelfServiceSettingsForBrowsers a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> (a
                                                                      :<|> Tagged
                                                                             m
                                                                             Application))))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> (a
                                                                           :<|> Tagged
                                                                                  m
                                                                                  Application))))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> m SettingsFlow) -> a
coerce Maybe Text -> m SettingsFlow
initializeSelfServiceSettingsForNativeApps a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a
                                              :<|> (a
                                                    :<|> (a
                                                          :<|> (a
                                                                :<|> Tagged m Application)))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a
                                                               :<|> (a
                                                                     :<|> Tagged
                                                                            m Application)))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m NoContent -> a
coerce m NoContent
initializeSelfServiceVerificationForBrowsers a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a
                                  :<|> (a
                                        :<|> (a :<|> (a :<|> (a :<|> Tagged m Application))))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a
                                       :<|> (a
                                             :<|> (a
                                                   :<|> (a
                                                         :<|> (a :<|> Tagged m Application))))))))))
forall a b. a -> b -> a :<|> b
:<|>
       m VerificationFlow -> a
coerce m VerificationFlow
initializeSelfServiceVerificationForNativeApps a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a
                            :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application)))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a
                                 :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application)))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (RevokeSession -> m NoContent) -> a
coerce RevokeSession -> m NoContent
revokeSession a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a
                      :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application))))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a
                           :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application))))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> Value -> m LoginViaApiResponse) -> a
coerce Maybe Text -> Value -> m LoginViaApiResponse
submitSelfServiceLoginFlow a
-> (a
    :<|> (a
          :<|> (a
                :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application)))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a
                     :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application)))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> Value -> m NoContent) -> a
coerce Maybe Text -> Value -> m NoContent
submitSelfServiceRecoveryFlow a
-> (a
    :<|> (a
          :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application))))))
-> a
   :<|> (a
         :<|> (a
               :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application))))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text
 -> Maybe Text
 -> SubmitSelfServiceRecoveryFlowWithLinkMethod
 -> m NoContent)
-> a
coerce Maybe Text
-> Maybe Text
-> SubmitSelfServiceRecoveryFlowWithLinkMethod
-> m NoContent
submitSelfServiceRecoveryFlowWithLinkMethod a
-> (a
    :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application)))))
-> a
   :<|> (a
         :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application)))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> Value -> m RegistrationViaApiResponse) -> a
coerce Maybe Text -> Value -> m RegistrationViaApiResponse
submitSelfServiceRegistrationFlow a
-> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application))))
-> a :<|> (a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application))))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse)
-> a
coerce Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse
submitSelfServiceSettingsFlow a
-> (a :<|> (a :<|> (a :<|> Tagged m Application)))
-> a :<|> (a :<|> (a :<|> (a :<|> Tagged m Application)))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> Value -> m NoContent) -> a
coerce Maybe Text -> Value -> m NoContent
submitSelfServiceVerificationFlow a
-> (a :<|> (a :<|> Tagged m Application))
-> a :<|> (a :<|> (a :<|> Tagged m Application))
forall a b. a -> b -> a :<|> b
:<|>
       (Maybe Text -> m Session) -> a
coerce Maybe Text -> m Session
toSession a
-> (a :<|> Tagged m Application)
-> a :<|> (a :<|> Tagged m Application)
forall a b. a -> b -> a :<|> b
:<|>
       m Version -> a
coerce m Version
getVersion a -> Tagged m Application -> a :<|> Tagged m Application
forall a b. a -> b -> a :<|> b
:<|>
       [Char] -> ServerT Raw m
forall (m :: * -> *). [Char] -> ServerT Raw m
serveDirectoryFileServer [Char]
"static"