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