module TD.Query.DeleteAccount
(DeleteAccount(..)
, defaultDeleteAccount
) 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 DeleteAccount
= DeleteAccount
{ DeleteAccount -> Maybe Text
reason :: Maybe T.Text
, DeleteAccount -> Maybe Text
password :: Maybe T.Text
}
deriving (DeleteAccount -> DeleteAccount -> Bool
(DeleteAccount -> DeleteAccount -> Bool)
-> (DeleteAccount -> DeleteAccount -> Bool) -> Eq DeleteAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteAccount -> DeleteAccount -> Bool
== :: DeleteAccount -> DeleteAccount -> Bool
$c/= :: DeleteAccount -> DeleteAccount -> Bool
/= :: DeleteAccount -> DeleteAccount -> Bool
Eq, Int -> DeleteAccount -> ShowS
[DeleteAccount] -> ShowS
DeleteAccount -> String
(Int -> DeleteAccount -> ShowS)
-> (DeleteAccount -> String)
-> ([DeleteAccount] -> ShowS)
-> Show DeleteAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteAccount -> ShowS
showsPrec :: Int -> DeleteAccount -> ShowS
$cshow :: DeleteAccount -> String
show :: DeleteAccount -> String
$cshowList :: [DeleteAccount] -> ShowS
showList :: [DeleteAccount] -> ShowS
Show)
instance I.ShortShow DeleteAccount where
shortShow :: DeleteAccount -> String
shortShow
DeleteAccount
{ reason :: DeleteAccount -> Maybe Text
reason = Maybe Text
reason_
, password :: DeleteAccount -> Maybe Text
password = Maybe Text
password_
}
= String
"DeleteAccount"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"reason" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
reason_
, String
"password" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
password_
]
instance AT.ToJSON DeleteAccount where
toJSON :: DeleteAccount -> Value
toJSON
DeleteAccount
{ reason :: DeleteAccount -> Maybe Text
reason = Maybe Text
reason_
, password :: DeleteAccount -> Maybe Text
password = Maybe Text
password_
}
= [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
"deleteAccount"
, Key
"reason" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
reason_
, Key
"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
password_
]
defaultDeleteAccount :: DeleteAccount
defaultDeleteAccount :: DeleteAccount
defaultDeleteAccount =
DeleteAccount
{ reason :: Maybe Text
reason = Maybe Text
forall a. Maybe a
Nothing
, password :: Maybe Text
password = Maybe Text
forall a. Maybe a
Nothing
}