module TD.Query.RegisterUser
(RegisterUser(..)
, defaultRegisterUser
) 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 RegisterUser
= RegisterUser
{ RegisterUser -> Maybe Text
first_name :: Maybe T.Text
, RegisterUser -> Maybe Text
last_name :: Maybe T.Text
, RegisterUser -> Maybe Bool
disable_notification :: Maybe Bool
}
deriving (RegisterUser -> RegisterUser -> Bool
(RegisterUser -> RegisterUser -> Bool)
-> (RegisterUser -> RegisterUser -> Bool) -> Eq RegisterUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RegisterUser -> RegisterUser -> Bool
== :: RegisterUser -> RegisterUser -> Bool
$c/= :: RegisterUser -> RegisterUser -> Bool
/= :: RegisterUser -> RegisterUser -> Bool
Eq, Int -> RegisterUser -> ShowS
[RegisterUser] -> ShowS
RegisterUser -> String
(Int -> RegisterUser -> ShowS)
-> (RegisterUser -> String)
-> ([RegisterUser] -> ShowS)
-> Show RegisterUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RegisterUser -> ShowS
showsPrec :: Int -> RegisterUser -> ShowS
$cshow :: RegisterUser -> String
show :: RegisterUser -> String
$cshowList :: [RegisterUser] -> ShowS
showList :: [RegisterUser] -> ShowS
Show)
instance I.ShortShow RegisterUser where
shortShow :: RegisterUser -> String
shortShow
RegisterUser
{ first_name :: RegisterUser -> Maybe Text
first_name = Maybe Text
first_name_
, last_name :: RegisterUser -> Maybe Text
last_name = Maybe Text
last_name_
, disable_notification :: RegisterUser -> Maybe Bool
disable_notification = Maybe Bool
disable_notification_
}
= String
"RegisterUser"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"first_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
first_name_
, String
"last_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
last_name_
, String
"disable_notification" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
disable_notification_
]
instance AT.ToJSON RegisterUser where
toJSON :: RegisterUser -> Value
toJSON
RegisterUser
{ first_name :: RegisterUser -> Maybe Text
first_name = Maybe Text
first_name_
, last_name :: RegisterUser -> Maybe Text
last_name = Maybe Text
last_name_
, disable_notification :: RegisterUser -> Maybe Bool
disable_notification = Maybe Bool
disable_notification_
}
= [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
"registerUser"
, Key
"first_name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
first_name_
, Key
"last_name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
last_name_
, Key
"disable_notification" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
disable_notification_
]
defaultRegisterUser :: RegisterUser
defaultRegisterUser :: RegisterUser
defaultRegisterUser =
RegisterUser
{ first_name :: Maybe Text
first_name = Maybe Text
forall a. Maybe a
Nothing
, last_name :: Maybe Text
last_name = Maybe Text
forall a. Maybe a
Nothing
, disable_notification :: Maybe Bool
disable_notification = Maybe Bool
forall a. Maybe a
Nothing
}