module TD.Query.DeleteChatMessagesBySender
(DeleteChatMessagesBySender(..)
, defaultDeleteChatMessagesBySender
) 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 DeleteChatMessagesBySender
= DeleteChatMessagesBySender
{ DeleteChatMessagesBySender -> Maybe Int
chat_id :: Maybe Int
, DeleteChatMessagesBySender -> Maybe MessageSender
sender_id :: Maybe MessageSender.MessageSender
}
deriving (DeleteChatMessagesBySender -> DeleteChatMessagesBySender -> Bool
(DeleteChatMessagesBySender -> DeleteChatMessagesBySender -> Bool)
-> (DeleteChatMessagesBySender
-> DeleteChatMessagesBySender -> Bool)
-> Eq DeleteChatMessagesBySender
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteChatMessagesBySender -> DeleteChatMessagesBySender -> Bool
== :: DeleteChatMessagesBySender -> DeleteChatMessagesBySender -> Bool
$c/= :: DeleteChatMessagesBySender -> DeleteChatMessagesBySender -> Bool
/= :: DeleteChatMessagesBySender -> DeleteChatMessagesBySender -> Bool
Eq, Int -> DeleteChatMessagesBySender -> ShowS
[DeleteChatMessagesBySender] -> ShowS
DeleteChatMessagesBySender -> String
(Int -> DeleteChatMessagesBySender -> ShowS)
-> (DeleteChatMessagesBySender -> String)
-> ([DeleteChatMessagesBySender] -> ShowS)
-> Show DeleteChatMessagesBySender
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteChatMessagesBySender -> ShowS
showsPrec :: Int -> DeleteChatMessagesBySender -> ShowS
$cshow :: DeleteChatMessagesBySender -> String
show :: DeleteChatMessagesBySender -> String
$cshowList :: [DeleteChatMessagesBySender] -> ShowS
showList :: [DeleteChatMessagesBySender] -> ShowS
Show)
instance I.ShortShow DeleteChatMessagesBySender where
shortShow :: DeleteChatMessagesBySender -> String
shortShow
DeleteChatMessagesBySender
{ chat_id :: DeleteChatMessagesBySender -> Maybe Int
chat_id = Maybe Int
chat_id_
, sender_id :: DeleteChatMessagesBySender -> Maybe MessageSender
sender_id = Maybe MessageSender
sender_id_
}
= String
"DeleteChatMessagesBySender"
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
"sender_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
sender_id_
]
instance AT.ToJSON DeleteChatMessagesBySender where
toJSON :: DeleteChatMessagesBySender -> Value
toJSON
DeleteChatMessagesBySender
{ chat_id :: DeleteChatMessagesBySender -> Maybe Int
chat_id = Maybe Int
chat_id_
, sender_id :: DeleteChatMessagesBySender -> Maybe MessageSender
sender_id = Maybe MessageSender
sender_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
"deleteChatMessagesBySender"
, 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
"sender_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
sender_id_
]
defaultDeleteChatMessagesBySender :: DeleteChatMessagesBySender
defaultDeleteChatMessagesBySender :: DeleteChatMessagesBySender
defaultDeleteChatMessagesBySender =
DeleteChatMessagesBySender
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, sender_id :: Maybe MessageSender
sender_id = Maybe MessageSender
forall a. Maybe a
Nothing
}