module TD.Query.GetDirectMessagesChatTopicHistory
(GetDirectMessagesChatTopicHistory(..)
, defaultGetDirectMessagesChatTopicHistory
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data GetDirectMessagesChatTopicHistory
= GetDirectMessagesChatTopicHistory
{ GetDirectMessagesChatTopicHistory -> Maybe Int
chat_id :: Maybe Int
, GetDirectMessagesChatTopicHistory -> Maybe Int
topic_id :: Maybe Int
, GetDirectMessagesChatTopicHistory -> Maybe Int
from_message_id :: Maybe Int
, GetDirectMessagesChatTopicHistory -> Maybe Int
offset :: Maybe Int
, GetDirectMessagesChatTopicHistory -> Maybe Int
limit :: Maybe Int
}
deriving (GetDirectMessagesChatTopicHistory
-> GetDirectMessagesChatTopicHistory -> Bool
(GetDirectMessagesChatTopicHistory
-> GetDirectMessagesChatTopicHistory -> Bool)
-> (GetDirectMessagesChatTopicHistory
-> GetDirectMessagesChatTopicHistory -> Bool)
-> Eq GetDirectMessagesChatTopicHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetDirectMessagesChatTopicHistory
-> GetDirectMessagesChatTopicHistory -> Bool
== :: GetDirectMessagesChatTopicHistory
-> GetDirectMessagesChatTopicHistory -> Bool
$c/= :: GetDirectMessagesChatTopicHistory
-> GetDirectMessagesChatTopicHistory -> Bool
/= :: GetDirectMessagesChatTopicHistory
-> GetDirectMessagesChatTopicHistory -> Bool
Eq, Int -> GetDirectMessagesChatTopicHistory -> ShowS
[GetDirectMessagesChatTopicHistory] -> ShowS
GetDirectMessagesChatTopicHistory -> String
(Int -> GetDirectMessagesChatTopicHistory -> ShowS)
-> (GetDirectMessagesChatTopicHistory -> String)
-> ([GetDirectMessagesChatTopicHistory] -> ShowS)
-> Show GetDirectMessagesChatTopicHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetDirectMessagesChatTopicHistory -> ShowS
showsPrec :: Int -> GetDirectMessagesChatTopicHistory -> ShowS
$cshow :: GetDirectMessagesChatTopicHistory -> String
show :: GetDirectMessagesChatTopicHistory -> String
$cshowList :: [GetDirectMessagesChatTopicHistory] -> ShowS
showList :: [GetDirectMessagesChatTopicHistory] -> ShowS
Show)
instance I.ShortShow GetDirectMessagesChatTopicHistory where
shortShow :: GetDirectMessagesChatTopicHistory -> String
shortShow
GetDirectMessagesChatTopicHistory
{ chat_id :: GetDirectMessagesChatTopicHistory -> Maybe Int
chat_id = Maybe Int
chat_id_
, topic_id :: GetDirectMessagesChatTopicHistory -> Maybe Int
topic_id = Maybe Int
topic_id_
, from_message_id :: GetDirectMessagesChatTopicHistory -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, offset :: GetDirectMessagesChatTopicHistory -> Maybe Int
offset = Maybe Int
offset_
, limit :: GetDirectMessagesChatTopicHistory -> Maybe Int
limit = Maybe Int
limit_
}
= String
"GetDirectMessagesChatTopicHistory"
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
"topic_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
topic_id_
, String
"from_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
from_message_id_
, String
"offset" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
offset_
, String
"limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
]
instance AT.ToJSON GetDirectMessagesChatTopicHistory where
toJSON :: GetDirectMessagesChatTopicHistory -> Value
toJSON
GetDirectMessagesChatTopicHistory
{ chat_id :: GetDirectMessagesChatTopicHistory -> Maybe Int
chat_id = Maybe Int
chat_id_
, topic_id :: GetDirectMessagesChatTopicHistory -> Maybe Int
topic_id = Maybe Int
topic_id_
, from_message_id :: GetDirectMessagesChatTopicHistory -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, offset :: GetDirectMessagesChatTopicHistory -> Maybe Int
offset = Maybe Int
offset_
, limit :: GetDirectMessagesChatTopicHistory -> Maybe Int
limit = Maybe Int
limit_
}
= [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
"getDirectMessagesChatTopicHistory"
, 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
"topic_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
topic_id_
, Key
"from_message_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
from_message_id_
, Key
"offset" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
offset_
, Key
"limit" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
limit_
]
defaultGetDirectMessagesChatTopicHistory :: GetDirectMessagesChatTopicHistory
defaultGetDirectMessagesChatTopicHistory :: GetDirectMessagesChatTopicHistory
defaultGetDirectMessagesChatTopicHistory =
GetDirectMessagesChatTopicHistory
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, topic_id :: Maybe Int
topic_id = Maybe Int
forall a. Maybe a
Nothing
, from_message_id :: Maybe Int
from_message_id = Maybe Int
forall a. Maybe a
Nothing
, offset :: Maybe Int
offset = Maybe Int
forall a. Maybe a
Nothing
, limit :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Nothing
}