module TD.Query.RecoverPassword
(RecoverPassword(..)
, defaultRecoverPassword
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
data RecoverPassword
= RecoverPassword
{ RecoverPassword -> Maybe Text
recovery_code :: Maybe T.Text
, RecoverPassword -> Maybe Text
new_password :: Maybe T.Text
, RecoverPassword -> Maybe Text
new_hint :: Maybe T.Text
}
deriving (RecoverPassword -> RecoverPassword -> Bool
(RecoverPassword -> RecoverPassword -> Bool)
-> (RecoverPassword -> RecoverPassword -> Bool)
-> Eq RecoverPassword
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RecoverPassword -> RecoverPassword -> Bool
== :: RecoverPassword -> RecoverPassword -> Bool
$c/= :: RecoverPassword -> RecoverPassword -> Bool
/= :: RecoverPassword -> RecoverPassword -> Bool
Eq, Int -> RecoverPassword -> ShowS
[RecoverPassword] -> ShowS
RecoverPassword -> String
(Int -> RecoverPassword -> ShowS)
-> (RecoverPassword -> String)
-> ([RecoverPassword] -> ShowS)
-> Show RecoverPassword
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RecoverPassword -> ShowS
showsPrec :: Int -> RecoverPassword -> ShowS
$cshow :: RecoverPassword -> String
show :: RecoverPassword -> String
$cshowList :: [RecoverPassword] -> ShowS
showList :: [RecoverPassword] -> ShowS
Show)
instance I.ShortShow RecoverPassword where
shortShow :: RecoverPassword -> String
shortShow
RecoverPassword
{ recovery_code :: RecoverPassword -> Maybe Text
recovery_code = Maybe Text
recovery_code_
, new_password :: RecoverPassword -> Maybe Text
new_password = Maybe Text
new_password_
, new_hint :: RecoverPassword -> Maybe Text
new_hint = Maybe Text
new_hint_
}
= String
"RecoverPassword"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"recovery_code" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
recovery_code_
, String
"new_password" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
new_password_
, String
"new_hint" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
new_hint_
]
instance AT.ToJSON RecoverPassword where
toJSON :: RecoverPassword -> Value
toJSON
RecoverPassword
{ recovery_code :: RecoverPassword -> Maybe Text
recovery_code = Maybe Text
recovery_code_
, new_password :: RecoverPassword -> Maybe Text
new_password = Maybe Text
new_password_
, new_hint :: RecoverPassword -> Maybe Text
new_hint = Maybe Text
new_hint_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"recoverPassword"
, Key
"recovery_code" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
recovery_code_
, Key
"new_password" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
new_password_
, Key
"new_hint" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
new_hint_
]
defaultRecoverPassword :: RecoverPassword
defaultRecoverPassword :: RecoverPassword
defaultRecoverPassword =
RecoverPassword
{ recovery_code :: Maybe Text
recovery_code = Maybe Text
forall a. Maybe a
Nothing
, new_password :: Maybe Text
new_password = Maybe Text
forall a. Maybe a
Nothing
, new_hint :: Maybe Text
new_hint = Maybe Text
forall a. Maybe a
Nothing
}