module TD.Query.UnpinAllChatMessages
(UnpinAllChatMessages(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data UnpinAllChatMessages
= UnpinAllChatMessages
{ UnpinAllChatMessages -> Maybe Int
chat_id :: Maybe Int
}
deriving (UnpinAllChatMessages -> UnpinAllChatMessages -> Bool
(UnpinAllChatMessages -> UnpinAllChatMessages -> Bool)
-> (UnpinAllChatMessages -> UnpinAllChatMessages -> Bool)
-> Eq UnpinAllChatMessages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UnpinAllChatMessages -> UnpinAllChatMessages -> Bool
== :: UnpinAllChatMessages -> UnpinAllChatMessages -> Bool
$c/= :: UnpinAllChatMessages -> UnpinAllChatMessages -> Bool
/= :: UnpinAllChatMessages -> UnpinAllChatMessages -> Bool
Eq, Int -> UnpinAllChatMessages -> ShowS
[UnpinAllChatMessages] -> ShowS
UnpinAllChatMessages -> String
(Int -> UnpinAllChatMessages -> ShowS)
-> (UnpinAllChatMessages -> String)
-> ([UnpinAllChatMessages] -> ShowS)
-> Show UnpinAllChatMessages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UnpinAllChatMessages -> ShowS
showsPrec :: Int -> UnpinAllChatMessages -> ShowS
$cshow :: UnpinAllChatMessages -> String
show :: UnpinAllChatMessages -> String
$cshowList :: [UnpinAllChatMessages] -> ShowS
showList :: [UnpinAllChatMessages] -> ShowS
Show)
instance I.ShortShow UnpinAllChatMessages where
shortShow :: UnpinAllChatMessages -> String
shortShow
UnpinAllChatMessages
{ chat_id :: UnpinAllChatMessages -> Maybe Int
chat_id = Maybe Int
chat_id_
}
= String
"UnpinAllChatMessages"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
]
instance AT.ToJSON UnpinAllChatMessages where
toJSON :: UnpinAllChatMessages -> Value
toJSON
UnpinAllChatMessages
{ chat_id :: UnpinAllChatMessages -> Maybe Int
chat_id = Maybe Int
chat_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
"unpinAllChatMessages"
, Key
"chat_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
chat_id_
]