module TD.Query.SetPassword
(SetPassword(..)
, defaultSetPassword
) 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 SetPassword
= SetPassword
{ SetPassword -> Maybe Text
old_password :: Maybe T.Text
, SetPassword -> Maybe Text
new_password :: Maybe T.Text
, SetPassword -> Maybe Text
new_hint :: Maybe T.Text
, SetPassword -> Maybe Bool
set_recovery_email_address :: Maybe Bool
, SetPassword -> Maybe Text
new_recovery_email_address :: Maybe T.Text
}
deriving (SetPassword -> SetPassword -> Bool
(SetPassword -> SetPassword -> Bool)
-> (SetPassword -> SetPassword -> Bool) -> Eq SetPassword
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetPassword -> SetPassword -> Bool
== :: SetPassword -> SetPassword -> Bool
$c/= :: SetPassword -> SetPassword -> Bool
/= :: SetPassword -> SetPassword -> Bool
Eq, Int -> SetPassword -> ShowS
[SetPassword] -> ShowS
SetPassword -> String
(Int -> SetPassword -> ShowS)
-> (SetPassword -> String)
-> ([SetPassword] -> ShowS)
-> Show SetPassword
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetPassword -> ShowS
showsPrec :: Int -> SetPassword -> ShowS
$cshow :: SetPassword -> String
show :: SetPassword -> String
$cshowList :: [SetPassword] -> ShowS
showList :: [SetPassword] -> ShowS
Show)
instance I.ShortShow SetPassword where
shortShow :: SetPassword -> String
shortShow
SetPassword
{ old_password :: SetPassword -> Maybe Text
old_password = Maybe Text
old_password_
, new_password :: SetPassword -> Maybe Text
new_password = Maybe Text
new_password_
, new_hint :: SetPassword -> Maybe Text
new_hint = Maybe Text
new_hint_
, set_recovery_email_address :: SetPassword -> Maybe Bool
set_recovery_email_address = Maybe Bool
set_recovery_email_address_
, new_recovery_email_address :: SetPassword -> Maybe Text
new_recovery_email_address = Maybe Text
new_recovery_email_address_
}
= String
"SetPassword"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"old_password" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
old_password_
, 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_
, String
"set_recovery_email_address" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
set_recovery_email_address_
, String
"new_recovery_email_address" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
new_recovery_email_address_
]
instance AT.ToJSON SetPassword where
toJSON :: SetPassword -> Value
toJSON
SetPassword
{ old_password :: SetPassword -> Maybe Text
old_password = Maybe Text
old_password_
, new_password :: SetPassword -> Maybe Text
new_password = Maybe Text
new_password_
, new_hint :: SetPassword -> Maybe Text
new_hint = Maybe Text
new_hint_
, set_recovery_email_address :: SetPassword -> Maybe Bool
set_recovery_email_address = Maybe Bool
set_recovery_email_address_
, new_recovery_email_address :: SetPassword -> Maybe Text
new_recovery_email_address = Maybe Text
new_recovery_email_address_
}
= [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
"setPassword"
, Key
"old_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
old_password_
, 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_
, Key
"set_recovery_email_address" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
set_recovery_email_address_
, Key
"new_recovery_email_address" 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_recovery_email_address_
]
defaultSetPassword :: SetPassword
defaultSetPassword :: SetPassword
defaultSetPassword =
SetPassword
{ old_password :: Maybe Text
old_password = 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
, set_recovery_email_address :: Maybe Bool
set_recovery_email_address = Maybe Bool
forall a. Maybe a
Nothing
, new_recovery_email_address :: Maybe Text
new_recovery_email_address = Maybe Text
forall a. Maybe a
Nothing
}