module TD.Query.DeleteChatHistory
(DeleteChatHistory(..)
, defaultDeleteChatHistory
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data DeleteChatHistory
= DeleteChatHistory
{ DeleteChatHistory -> Maybe Int
chat_id :: Maybe Int
, DeleteChatHistory -> Maybe Bool
remove_from_chat_list :: Maybe Bool
, DeleteChatHistory -> Maybe Bool
revoke :: Maybe Bool
}
deriving (DeleteChatHistory -> DeleteChatHistory -> Bool
(DeleteChatHistory -> DeleteChatHistory -> Bool)
-> (DeleteChatHistory -> DeleteChatHistory -> Bool)
-> Eq DeleteChatHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteChatHistory -> DeleteChatHistory -> Bool
== :: DeleteChatHistory -> DeleteChatHistory -> Bool
$c/= :: DeleteChatHistory -> DeleteChatHistory -> Bool
/= :: DeleteChatHistory -> DeleteChatHistory -> Bool
Eq, Int -> DeleteChatHistory -> ShowS
[DeleteChatHistory] -> ShowS
DeleteChatHistory -> String
(Int -> DeleteChatHistory -> ShowS)
-> (DeleteChatHistory -> String)
-> ([DeleteChatHistory] -> ShowS)
-> Show DeleteChatHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteChatHistory -> ShowS
showsPrec :: Int -> DeleteChatHistory -> ShowS
$cshow :: DeleteChatHistory -> String
show :: DeleteChatHistory -> String
$cshowList :: [DeleteChatHistory] -> ShowS
showList :: [DeleteChatHistory] -> ShowS
Show)
instance I.ShortShow DeleteChatHistory where
shortShow :: DeleteChatHistory -> String
shortShow
DeleteChatHistory
{ chat_id :: DeleteChatHistory -> Maybe Int
chat_id = Maybe Int
chat_id_
, remove_from_chat_list :: DeleteChatHistory -> Maybe Bool
remove_from_chat_list = Maybe Bool
remove_from_chat_list_
, revoke :: DeleteChatHistory -> Maybe Bool
revoke = Maybe Bool
revoke_
}
= String
"DeleteChatHistory"
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_
, String
"remove_from_chat_list" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
remove_from_chat_list_
, String
"revoke" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
revoke_
]
instance AT.ToJSON DeleteChatHistory where
toJSON :: DeleteChatHistory -> Value
toJSON
DeleteChatHistory
{ chat_id :: DeleteChatHistory -> Maybe Int
chat_id = Maybe Int
chat_id_
, remove_from_chat_list :: DeleteChatHistory -> Maybe Bool
remove_from_chat_list = Maybe Bool
remove_from_chat_list_
, revoke :: DeleteChatHistory -> Maybe Bool
revoke = Maybe Bool
revoke_
}
= [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
"deleteChatHistory"
, 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_
, Key
"remove_from_chat_list" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
remove_from_chat_list_
, Key
"revoke" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
revoke_
]
defaultDeleteChatHistory :: DeleteChatHistory
defaultDeleteChatHistory :: DeleteChatHistory
defaultDeleteChatHistory =
DeleteChatHistory
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, remove_from_chat_list :: Maybe Bool
remove_from_chat_list = Maybe Bool
forall a. Maybe a
Nothing
, revoke :: Maybe Bool
revoke = Maybe Bool
forall a. Maybe a
Nothing
}