module TD.Query.ToggleGiftIsSaved
(ToggleGiftIsSaved(..)
, defaultToggleGiftIsSaved
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data ToggleGiftIsSaved
= ToggleGiftIsSaved
{ ToggleGiftIsSaved -> Maybe Int
sender_user_id :: Maybe Int
, ToggleGiftIsSaved -> Maybe Int
message_id :: Maybe Int
, ToggleGiftIsSaved -> Maybe Bool
is_saved :: Maybe Bool
}
deriving (ToggleGiftIsSaved -> ToggleGiftIsSaved -> Bool
(ToggleGiftIsSaved -> ToggleGiftIsSaved -> Bool)
-> (ToggleGiftIsSaved -> ToggleGiftIsSaved -> Bool)
-> Eq ToggleGiftIsSaved
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleGiftIsSaved -> ToggleGiftIsSaved -> Bool
== :: ToggleGiftIsSaved -> ToggleGiftIsSaved -> Bool
$c/= :: ToggleGiftIsSaved -> ToggleGiftIsSaved -> Bool
/= :: ToggleGiftIsSaved -> ToggleGiftIsSaved -> Bool
Eq, Int -> ToggleGiftIsSaved -> ShowS
[ToggleGiftIsSaved] -> ShowS
ToggleGiftIsSaved -> String
(Int -> ToggleGiftIsSaved -> ShowS)
-> (ToggleGiftIsSaved -> String)
-> ([ToggleGiftIsSaved] -> ShowS)
-> Show ToggleGiftIsSaved
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleGiftIsSaved -> ShowS
showsPrec :: Int -> ToggleGiftIsSaved -> ShowS
$cshow :: ToggleGiftIsSaved -> String
show :: ToggleGiftIsSaved -> String
$cshowList :: [ToggleGiftIsSaved] -> ShowS
showList :: [ToggleGiftIsSaved] -> ShowS
Show)
instance I.ShortShow ToggleGiftIsSaved where
shortShow :: ToggleGiftIsSaved -> String
shortShow
ToggleGiftIsSaved
{ sender_user_id :: ToggleGiftIsSaved -> Maybe Int
sender_user_id = Maybe Int
sender_user_id_
, message_id :: ToggleGiftIsSaved -> Maybe Int
message_id = Maybe Int
message_id_
, is_saved :: ToggleGiftIsSaved -> Maybe Bool
is_saved = Maybe Bool
is_saved_
}
= String
"ToggleGiftIsSaved"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"sender_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
sender_user_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
, String
"is_saved" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_saved_
]
instance AT.ToJSON ToggleGiftIsSaved where
toJSON :: ToggleGiftIsSaved -> Value
toJSON
ToggleGiftIsSaved
{ sender_user_id :: ToggleGiftIsSaved -> Maybe Int
sender_user_id = Maybe Int
sender_user_id_
, message_id :: ToggleGiftIsSaved -> Maybe Int
message_id = Maybe Int
message_id_
, is_saved :: ToggleGiftIsSaved -> Maybe Bool
is_saved = Maybe Bool
is_saved_
}
= [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
"toggleGiftIsSaved"
, Key
"sender_user_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
sender_user_id_
, Key
"message_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
message_id_
, Key
"is_saved" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_saved_
]
defaultToggleGiftIsSaved :: ToggleGiftIsSaved
defaultToggleGiftIsSaved :: ToggleGiftIsSaved
defaultToggleGiftIsSaved =
ToggleGiftIsSaved
{ sender_user_id :: Maybe Int
sender_user_id = Maybe Int
forall a. Maybe a
Nothing
, message_id :: Maybe Int
message_id = Maybe Int
forall a. Maybe a
Nothing
, is_saved :: Maybe Bool
is_saved = Maybe Bool
forall a. Maybe a
Nothing
}