module TD.Query.DeleteGiftCollection
(DeleteGiftCollection(..)
, defaultDeleteGiftCollection
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.MessageSender as MessageSender
data DeleteGiftCollection
= DeleteGiftCollection
{ DeleteGiftCollection -> Maybe MessageSender
owner_id :: Maybe MessageSender.MessageSender
, DeleteGiftCollection -> Maybe Int
collection_id :: Maybe Int
}
deriving (DeleteGiftCollection -> DeleteGiftCollection -> Bool
(DeleteGiftCollection -> DeleteGiftCollection -> Bool)
-> (DeleteGiftCollection -> DeleteGiftCollection -> Bool)
-> Eq DeleteGiftCollection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteGiftCollection -> DeleteGiftCollection -> Bool
== :: DeleteGiftCollection -> DeleteGiftCollection -> Bool
$c/= :: DeleteGiftCollection -> DeleteGiftCollection -> Bool
/= :: DeleteGiftCollection -> DeleteGiftCollection -> Bool
Eq, Int -> DeleteGiftCollection -> ShowS
[DeleteGiftCollection] -> ShowS
DeleteGiftCollection -> String
(Int -> DeleteGiftCollection -> ShowS)
-> (DeleteGiftCollection -> String)
-> ([DeleteGiftCollection] -> ShowS)
-> Show DeleteGiftCollection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteGiftCollection -> ShowS
showsPrec :: Int -> DeleteGiftCollection -> ShowS
$cshow :: DeleteGiftCollection -> String
show :: DeleteGiftCollection -> String
$cshowList :: [DeleteGiftCollection] -> ShowS
showList :: [DeleteGiftCollection] -> ShowS
Show)
instance I.ShortShow DeleteGiftCollection where
shortShow :: DeleteGiftCollection -> String
shortShow
DeleteGiftCollection
{ owner_id :: DeleteGiftCollection -> Maybe MessageSender
owner_id = Maybe MessageSender
owner_id_
, collection_id :: DeleteGiftCollection -> Maybe Int
collection_id = Maybe Int
collection_id_
}
= String
"DeleteGiftCollection"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"owner_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
owner_id_
, String
"collection_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
collection_id_
]
instance AT.ToJSON DeleteGiftCollection where
toJSON :: DeleteGiftCollection -> Value
toJSON
DeleteGiftCollection
{ owner_id :: DeleteGiftCollection -> Maybe MessageSender
owner_id = Maybe MessageSender
owner_id_
, collection_id :: DeleteGiftCollection -> Maybe Int
collection_id = Maybe Int
collection_id_
}
= [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
"deleteGiftCollection"
, Key
"owner_id" Key -> Maybe MessageSender -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSender
owner_id_
, Key
"collection_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
collection_id_
]
defaultDeleteGiftCollection :: DeleteGiftCollection
defaultDeleteGiftCollection :: DeleteGiftCollection
defaultDeleteGiftCollection =
DeleteGiftCollection
{ owner_id :: Maybe MessageSender
owner_id = Maybe MessageSender
forall a. Maybe a
Nothing
, collection_id :: Maybe Int
collection_id = Maybe Int
forall a. Maybe a
Nothing
}