{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE NoFieldSelectors #-}
module WikiMusic.Interaction.Model.User
( MakeResetPasswordLinkResponse (..),
DoPasswordResetRequest (..),
UserError (..),
InviteUsersRequest (..),
DeleteUsersRequest (..),
)
where
import Data.Aeson hiding (Success)
import Data.OpenApi
import Keuringsdienst (ValidationResult)
import Optics
import Relude
import WikiMusic.Model.Auth
newtype MakeResetPasswordLinkResponse = MakeResetPasswordLinkResponse
{ MakeResetPasswordLinkResponse -> Text
user :: Text
}
deriving (MakeResetPasswordLinkResponse
-> MakeResetPasswordLinkResponse -> Bool
(MakeResetPasswordLinkResponse
-> MakeResetPasswordLinkResponse -> Bool)
-> (MakeResetPasswordLinkResponse
-> MakeResetPasswordLinkResponse -> Bool)
-> Eq MakeResetPasswordLinkResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MakeResetPasswordLinkResponse
-> MakeResetPasswordLinkResponse -> Bool
== :: MakeResetPasswordLinkResponse
-> MakeResetPasswordLinkResponse -> Bool
$c/= :: MakeResetPasswordLinkResponse
-> MakeResetPasswordLinkResponse -> Bool
/= :: MakeResetPasswordLinkResponse
-> MakeResetPasswordLinkResponse -> Bool
Eq, Int -> MakeResetPasswordLinkResponse -> ShowS
[MakeResetPasswordLinkResponse] -> ShowS
MakeResetPasswordLinkResponse -> String
(Int -> MakeResetPasswordLinkResponse -> ShowS)
-> (MakeResetPasswordLinkResponse -> String)
-> ([MakeResetPasswordLinkResponse] -> ShowS)
-> Show MakeResetPasswordLinkResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MakeResetPasswordLinkResponse -> ShowS
showsPrec :: Int -> MakeResetPasswordLinkResponse -> ShowS
$cshow :: MakeResetPasswordLinkResponse -> String
show :: MakeResetPasswordLinkResponse -> String
$cshowList :: [MakeResetPasswordLinkResponse] -> ShowS
showList :: [MakeResetPasswordLinkResponse] -> ShowS
Show, (forall x.
MakeResetPasswordLinkResponse
-> Rep MakeResetPasswordLinkResponse x)
-> (forall x.
Rep MakeResetPasswordLinkResponse x
-> MakeResetPasswordLinkResponse)
-> Generic MakeResetPasswordLinkResponse
forall x.
Rep MakeResetPasswordLinkResponse x
-> MakeResetPasswordLinkResponse
forall x.
MakeResetPasswordLinkResponse
-> Rep MakeResetPasswordLinkResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
MakeResetPasswordLinkResponse
-> Rep MakeResetPasswordLinkResponse x
from :: forall x.
MakeResetPasswordLinkResponse
-> Rep MakeResetPasswordLinkResponse x
$cto :: forall x.
Rep MakeResetPasswordLinkResponse x
-> MakeResetPasswordLinkResponse
to :: forall x.
Rep MakeResetPasswordLinkResponse x
-> MakeResetPasswordLinkResponse
Generic, Maybe MakeResetPasswordLinkResponse
Value -> Parser [MakeResetPasswordLinkResponse]
Value -> Parser MakeResetPasswordLinkResponse
(Value -> Parser MakeResetPasswordLinkResponse)
-> (Value -> Parser [MakeResetPasswordLinkResponse])
-> Maybe MakeResetPasswordLinkResponse
-> FromJSON MakeResetPasswordLinkResponse
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser MakeResetPasswordLinkResponse
parseJSON :: Value -> Parser MakeResetPasswordLinkResponse
$cparseJSONList :: Value -> Parser [MakeResetPasswordLinkResponse]
parseJSONList :: Value -> Parser [MakeResetPasswordLinkResponse]
$comittedField :: Maybe MakeResetPasswordLinkResponse
omittedField :: Maybe MakeResetPasswordLinkResponse
FromJSON, [MakeResetPasswordLinkResponse] -> Value
[MakeResetPasswordLinkResponse] -> Encoding
MakeResetPasswordLinkResponse -> Bool
MakeResetPasswordLinkResponse -> Value
MakeResetPasswordLinkResponse -> Encoding
(MakeResetPasswordLinkResponse -> Value)
-> (MakeResetPasswordLinkResponse -> Encoding)
-> ([MakeResetPasswordLinkResponse] -> Value)
-> ([MakeResetPasswordLinkResponse] -> Encoding)
-> (MakeResetPasswordLinkResponse -> Bool)
-> ToJSON MakeResetPasswordLinkResponse
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: MakeResetPasswordLinkResponse -> Value
toJSON :: MakeResetPasswordLinkResponse -> Value
$ctoEncoding :: MakeResetPasswordLinkResponse -> Encoding
toEncoding :: MakeResetPasswordLinkResponse -> Encoding
$ctoJSONList :: [MakeResetPasswordLinkResponse] -> Value
toJSONList :: [MakeResetPasswordLinkResponse] -> Value
$ctoEncodingList :: [MakeResetPasswordLinkResponse] -> Encoding
toEncodingList :: [MakeResetPasswordLinkResponse] -> Encoding
$comitField :: MakeResetPasswordLinkResponse -> Bool
omitField :: MakeResetPasswordLinkResponse -> Bool
ToJSON, Typeable MakeResetPasswordLinkResponse
Typeable MakeResetPasswordLinkResponse =>
(Proxy MakeResetPasswordLinkResponse
-> Declare (Definitions Schema) NamedSchema)
-> ToSchema MakeResetPasswordLinkResponse
Proxy MakeResetPasswordLinkResponse
-> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a =>
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy MakeResetPasswordLinkResponse
-> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy MakeResetPasswordLinkResponse
-> Declare (Definitions Schema) NamedSchema
ToSchema)
makeFieldLabelsNoPrefix ''MakeResetPasswordLinkResponse
data DoPasswordResetRequest = DoPasswordResetRequest
{ DoPasswordResetRequest -> Text
email :: Text,
DoPasswordResetRequest -> Text
token :: Text,
DoPasswordResetRequest -> Text
password :: Text,
DoPasswordResetRequest -> Text
passwordConfirm :: Text
}
deriving (DoPasswordResetRequest -> DoPasswordResetRequest -> Bool
(DoPasswordResetRequest -> DoPasswordResetRequest -> Bool)
-> (DoPasswordResetRequest -> DoPasswordResetRequest -> Bool)
-> Eq DoPasswordResetRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DoPasswordResetRequest -> DoPasswordResetRequest -> Bool
== :: DoPasswordResetRequest -> DoPasswordResetRequest -> Bool
$c/= :: DoPasswordResetRequest -> DoPasswordResetRequest -> Bool
/= :: DoPasswordResetRequest -> DoPasswordResetRequest -> Bool
Eq, Int -> DoPasswordResetRequest -> ShowS
[DoPasswordResetRequest] -> ShowS
DoPasswordResetRequest -> String
(Int -> DoPasswordResetRequest -> ShowS)
-> (DoPasswordResetRequest -> String)
-> ([DoPasswordResetRequest] -> ShowS)
-> Show DoPasswordResetRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DoPasswordResetRequest -> ShowS
showsPrec :: Int -> DoPasswordResetRequest -> ShowS
$cshow :: DoPasswordResetRequest -> String
show :: DoPasswordResetRequest -> String
$cshowList :: [DoPasswordResetRequest] -> ShowS
showList :: [DoPasswordResetRequest] -> ShowS
Show, (forall x. DoPasswordResetRequest -> Rep DoPasswordResetRequest x)
-> (forall x.
Rep DoPasswordResetRequest x -> DoPasswordResetRequest)
-> Generic DoPasswordResetRequest
forall x. Rep DoPasswordResetRequest x -> DoPasswordResetRequest
forall x. DoPasswordResetRequest -> Rep DoPasswordResetRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DoPasswordResetRequest -> Rep DoPasswordResetRequest x
from :: forall x. DoPasswordResetRequest -> Rep DoPasswordResetRequest x
$cto :: forall x. Rep DoPasswordResetRequest x -> DoPasswordResetRequest
to :: forall x. Rep DoPasswordResetRequest x -> DoPasswordResetRequest
Generic, Maybe DoPasswordResetRequest
Value -> Parser [DoPasswordResetRequest]
Value -> Parser DoPasswordResetRequest
(Value -> Parser DoPasswordResetRequest)
-> (Value -> Parser [DoPasswordResetRequest])
-> Maybe DoPasswordResetRequest
-> FromJSON DoPasswordResetRequest
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser DoPasswordResetRequest
parseJSON :: Value -> Parser DoPasswordResetRequest
$cparseJSONList :: Value -> Parser [DoPasswordResetRequest]
parseJSONList :: Value -> Parser [DoPasswordResetRequest]
$comittedField :: Maybe DoPasswordResetRequest
omittedField :: Maybe DoPasswordResetRequest
FromJSON, [DoPasswordResetRequest] -> Value
[DoPasswordResetRequest] -> Encoding
DoPasswordResetRequest -> Bool
DoPasswordResetRequest -> Value
DoPasswordResetRequest -> Encoding
(DoPasswordResetRequest -> Value)
-> (DoPasswordResetRequest -> Encoding)
-> ([DoPasswordResetRequest] -> Value)
-> ([DoPasswordResetRequest] -> Encoding)
-> (DoPasswordResetRequest -> Bool)
-> ToJSON DoPasswordResetRequest
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: DoPasswordResetRequest -> Value
toJSON :: DoPasswordResetRequest -> Value
$ctoEncoding :: DoPasswordResetRequest -> Encoding
toEncoding :: DoPasswordResetRequest -> Encoding
$ctoJSONList :: [DoPasswordResetRequest] -> Value
toJSONList :: [DoPasswordResetRequest] -> Value
$ctoEncodingList :: [DoPasswordResetRequest] -> Encoding
toEncodingList :: [DoPasswordResetRequest] -> Encoding
$comitField :: DoPasswordResetRequest -> Bool
omitField :: DoPasswordResetRequest -> Bool
ToJSON, Typeable DoPasswordResetRequest
Typeable DoPasswordResetRequest =>
(Proxy DoPasswordResetRequest
-> Declare (Definitions Schema) NamedSchema)
-> ToSchema DoPasswordResetRequest
Proxy DoPasswordResetRequest
-> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a =>
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy DoPasswordResetRequest
-> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy DoPasswordResetRequest
-> Declare (Definitions Schema) NamedSchema
ToSchema)
makeFieldLabelsNoPrefix ''DoPasswordResetRequest
data UserError
= ValidationFailedError (Map Text ValidationResult)
| AccessUnauthorizedError
| SomeError Text
deriving ((forall x. UserError -> Rep UserError x)
-> (forall x. Rep UserError x -> UserError) -> Generic UserError
forall x. Rep UserError x -> UserError
forall x. UserError -> Rep UserError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UserError -> Rep UserError x
from :: forall x. UserError -> Rep UserError x
$cto :: forall x. Rep UserError x -> UserError
to :: forall x. Rep UserError x -> UserError
Generic, UserError -> UserError -> Bool
(UserError -> UserError -> Bool)
-> (UserError -> UserError -> Bool) -> Eq UserError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UserError -> UserError -> Bool
== :: UserError -> UserError -> Bool
$c/= :: UserError -> UserError -> Bool
/= :: UserError -> UserError -> Bool
Eq, Int -> UserError -> ShowS
[UserError] -> ShowS
UserError -> String
(Int -> UserError -> ShowS)
-> (UserError -> String)
-> ([UserError] -> ShowS)
-> Show UserError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UserError -> ShowS
showsPrec :: Int -> UserError -> ShowS
$cshow :: UserError -> String
show :: UserError -> String
$cshowList :: [UserError] -> ShowS
showList :: [UserError] -> ShowS
Show)
data InviteUsersRequest = InviteUsersRequest
{ InviteUsersRequest -> Text
displayName :: Text,
InviteUsersRequest -> Text
email :: Text,
InviteUsersRequest -> UserRole
role :: UserRole,
InviteUsersRequest -> Maybe Text
description :: Maybe Text
}
deriving (InviteUsersRequest -> InviteUsersRequest -> Bool
(InviteUsersRequest -> InviteUsersRequest -> Bool)
-> (InviteUsersRequest -> InviteUsersRequest -> Bool)
-> Eq InviteUsersRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InviteUsersRequest -> InviteUsersRequest -> Bool
== :: InviteUsersRequest -> InviteUsersRequest -> Bool
$c/= :: InviteUsersRequest -> InviteUsersRequest -> Bool
/= :: InviteUsersRequest -> InviteUsersRequest -> Bool
Eq, Int -> InviteUsersRequest -> ShowS
[InviteUsersRequest] -> ShowS
InviteUsersRequest -> String
(Int -> InviteUsersRequest -> ShowS)
-> (InviteUsersRequest -> String)
-> ([InviteUsersRequest] -> ShowS)
-> Show InviteUsersRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InviteUsersRequest -> ShowS
showsPrec :: Int -> InviteUsersRequest -> ShowS
$cshow :: InviteUsersRequest -> String
show :: InviteUsersRequest -> String
$cshowList :: [InviteUsersRequest] -> ShowS
showList :: [InviteUsersRequest] -> ShowS
Show, (forall x. InviteUsersRequest -> Rep InviteUsersRequest x)
-> (forall x. Rep InviteUsersRequest x -> InviteUsersRequest)
-> Generic InviteUsersRequest
forall x. Rep InviteUsersRequest x -> InviteUsersRequest
forall x. InviteUsersRequest -> Rep InviteUsersRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InviteUsersRequest -> Rep InviteUsersRequest x
from :: forall x. InviteUsersRequest -> Rep InviteUsersRequest x
$cto :: forall x. Rep InviteUsersRequest x -> InviteUsersRequest
to :: forall x. Rep InviteUsersRequest x -> InviteUsersRequest
Generic, Maybe InviteUsersRequest
Value -> Parser [InviteUsersRequest]
Value -> Parser InviteUsersRequest
(Value -> Parser InviteUsersRequest)
-> (Value -> Parser [InviteUsersRequest])
-> Maybe InviteUsersRequest
-> FromJSON InviteUsersRequest
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser InviteUsersRequest
parseJSON :: Value -> Parser InviteUsersRequest
$cparseJSONList :: Value -> Parser [InviteUsersRequest]
parseJSONList :: Value -> Parser [InviteUsersRequest]
$comittedField :: Maybe InviteUsersRequest
omittedField :: Maybe InviteUsersRequest
FromJSON, [InviteUsersRequest] -> Value
[InviteUsersRequest] -> Encoding
InviteUsersRequest -> Bool
InviteUsersRequest -> Value
InviteUsersRequest -> Encoding
(InviteUsersRequest -> Value)
-> (InviteUsersRequest -> Encoding)
-> ([InviteUsersRequest] -> Value)
-> ([InviteUsersRequest] -> Encoding)
-> (InviteUsersRequest -> Bool)
-> ToJSON InviteUsersRequest
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: InviteUsersRequest -> Value
toJSON :: InviteUsersRequest -> Value
$ctoEncoding :: InviteUsersRequest -> Encoding
toEncoding :: InviteUsersRequest -> Encoding
$ctoJSONList :: [InviteUsersRequest] -> Value
toJSONList :: [InviteUsersRequest] -> Value
$ctoEncodingList :: [InviteUsersRequest] -> Encoding
toEncodingList :: [InviteUsersRequest] -> Encoding
$comitField :: InviteUsersRequest -> Bool
omitField :: InviteUsersRequest -> Bool
ToJSON, Typeable InviteUsersRequest
Typeable InviteUsersRequest =>
(Proxy InviteUsersRequest
-> Declare (Definitions Schema) NamedSchema)
-> ToSchema InviteUsersRequest
Proxy InviteUsersRequest
-> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a =>
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy InviteUsersRequest
-> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy InviteUsersRequest
-> Declare (Definitions Schema) NamedSchema
ToSchema)
makeFieldLabelsNoPrefix ''InviteUsersRequest
newtype DeleteUsersRequest = DeleteUsersRequest
{ DeleteUsersRequest -> Text
email :: Text
}
deriving (DeleteUsersRequest -> DeleteUsersRequest -> Bool
(DeleteUsersRequest -> DeleteUsersRequest -> Bool)
-> (DeleteUsersRequest -> DeleteUsersRequest -> Bool)
-> Eq DeleteUsersRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteUsersRequest -> DeleteUsersRequest -> Bool
== :: DeleteUsersRequest -> DeleteUsersRequest -> Bool
$c/= :: DeleteUsersRequest -> DeleteUsersRequest -> Bool
/= :: DeleteUsersRequest -> DeleteUsersRequest -> Bool
Eq, Int -> DeleteUsersRequest -> ShowS
[DeleteUsersRequest] -> ShowS
DeleteUsersRequest -> String
(Int -> DeleteUsersRequest -> ShowS)
-> (DeleteUsersRequest -> String)
-> ([DeleteUsersRequest] -> ShowS)
-> Show DeleteUsersRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteUsersRequest -> ShowS
showsPrec :: Int -> DeleteUsersRequest -> ShowS
$cshow :: DeleteUsersRequest -> String
show :: DeleteUsersRequest -> String
$cshowList :: [DeleteUsersRequest] -> ShowS
showList :: [DeleteUsersRequest] -> ShowS
Show, (forall x. DeleteUsersRequest -> Rep DeleteUsersRequest x)
-> (forall x. Rep DeleteUsersRequest x -> DeleteUsersRequest)
-> Generic DeleteUsersRequest
forall x. Rep DeleteUsersRequest x -> DeleteUsersRequest
forall x. DeleteUsersRequest -> Rep DeleteUsersRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DeleteUsersRequest -> Rep DeleteUsersRequest x
from :: forall x. DeleteUsersRequest -> Rep DeleteUsersRequest x
$cto :: forall x. Rep DeleteUsersRequest x -> DeleteUsersRequest
to :: forall x. Rep DeleteUsersRequest x -> DeleteUsersRequest
Generic, Maybe DeleteUsersRequest
Value -> Parser [DeleteUsersRequest]
Value -> Parser DeleteUsersRequest
(Value -> Parser DeleteUsersRequest)
-> (Value -> Parser [DeleteUsersRequest])
-> Maybe DeleteUsersRequest
-> FromJSON DeleteUsersRequest
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser DeleteUsersRequest
parseJSON :: Value -> Parser DeleteUsersRequest
$cparseJSONList :: Value -> Parser [DeleteUsersRequest]
parseJSONList :: Value -> Parser [DeleteUsersRequest]
$comittedField :: Maybe DeleteUsersRequest
omittedField :: Maybe DeleteUsersRequest
FromJSON, [DeleteUsersRequest] -> Value
[DeleteUsersRequest] -> Encoding
DeleteUsersRequest -> Bool
DeleteUsersRequest -> Value
DeleteUsersRequest -> Encoding
(DeleteUsersRequest -> Value)
-> (DeleteUsersRequest -> Encoding)
-> ([DeleteUsersRequest] -> Value)
-> ([DeleteUsersRequest] -> Encoding)
-> (DeleteUsersRequest -> Bool)
-> ToJSON DeleteUsersRequest
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: DeleteUsersRequest -> Value
toJSON :: DeleteUsersRequest -> Value
$ctoEncoding :: DeleteUsersRequest -> Encoding
toEncoding :: DeleteUsersRequest -> Encoding
$ctoJSONList :: [DeleteUsersRequest] -> Value
toJSONList :: [DeleteUsersRequest] -> Value
$ctoEncodingList :: [DeleteUsersRequest] -> Encoding
toEncodingList :: [DeleteUsersRequest] -> Encoding
$comitField :: DeleteUsersRequest -> Bool
omitField :: DeleteUsersRequest -> Bool
ToJSON, Typeable DeleteUsersRequest
Typeable DeleteUsersRequest =>
(Proxy DeleteUsersRequest
-> Declare (Definitions Schema) NamedSchema)
-> ToSchema DeleteUsersRequest
Proxy DeleteUsersRequest
-> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a =>
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy DeleteUsersRequest
-> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy DeleteUsersRequest
-> Declare (Definitions Schema) NamedSchema
ToSchema)
makeFieldLabelsNoPrefix ''DeleteUsersRequest