module TD.Query.GetForumTopicHistory
(GetForumTopicHistory(..)
, defaultGetForumTopicHistory
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data GetForumTopicHistory
= GetForumTopicHistory
{ GetForumTopicHistory -> Maybe Int
chat_id :: Maybe Int
, GetForumTopicHistory -> Maybe Int
forum_topic_id :: Maybe Int
, GetForumTopicHistory -> Maybe Int
from_message_id :: Maybe Int
, GetForumTopicHistory -> Maybe Int
offset :: Maybe Int
, GetForumTopicHistory -> Maybe Int
limit :: Maybe Int
}
deriving (GetForumTopicHistory -> GetForumTopicHistory -> Bool
(GetForumTopicHistory -> GetForumTopicHistory -> Bool)
-> (GetForumTopicHistory -> GetForumTopicHistory -> Bool)
-> Eq GetForumTopicHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetForumTopicHistory -> GetForumTopicHistory -> Bool
== :: GetForumTopicHistory -> GetForumTopicHistory -> Bool
$c/= :: GetForumTopicHistory -> GetForumTopicHistory -> Bool
/= :: GetForumTopicHistory -> GetForumTopicHistory -> Bool
Eq, Int -> GetForumTopicHistory -> ShowS
[GetForumTopicHistory] -> ShowS
GetForumTopicHistory -> String
(Int -> GetForumTopicHistory -> ShowS)
-> (GetForumTopicHistory -> String)
-> ([GetForumTopicHistory] -> ShowS)
-> Show GetForumTopicHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetForumTopicHistory -> ShowS
showsPrec :: Int -> GetForumTopicHistory -> ShowS
$cshow :: GetForumTopicHistory -> String
show :: GetForumTopicHistory -> String
$cshowList :: [GetForumTopicHistory] -> ShowS
showList :: [GetForumTopicHistory] -> ShowS
Show)
instance I.ShortShow GetForumTopicHistory where
shortShow :: GetForumTopicHistory -> String
shortShow
GetForumTopicHistory
{ chat_id :: GetForumTopicHistory -> Maybe Int
chat_id = Maybe Int
chat_id_
, forum_topic_id :: GetForumTopicHistory -> Maybe Int
forum_topic_id = Maybe Int
forum_topic_id_
, from_message_id :: GetForumTopicHistory -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, offset :: GetForumTopicHistory -> Maybe Int
offset = Maybe Int
offset_
, limit :: GetForumTopicHistory -> Maybe Int
limit = Maybe Int
limit_
}
= String
"GetForumTopicHistory"
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
"forum_topic_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
forum_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 GetForumTopicHistory where
toJSON :: GetForumTopicHistory -> Value
toJSON
GetForumTopicHistory
{ chat_id :: GetForumTopicHistory -> Maybe Int
chat_id = Maybe Int
chat_id_
, forum_topic_id :: GetForumTopicHistory -> Maybe Int
forum_topic_id = Maybe Int
forum_topic_id_
, from_message_id :: GetForumTopicHistory -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, offset :: GetForumTopicHistory -> Maybe Int
offset = Maybe Int
offset_
, limit :: GetForumTopicHistory -> 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
"getForumTopicHistory"
, 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
"forum_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
forum_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_
]
defaultGetForumTopicHistory :: GetForumTopicHistory
defaultGetForumTopicHistory :: GetForumTopicHistory
defaultGetForumTopicHistory =
GetForumTopicHistory
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, forum_topic_id :: Maybe Int
forum_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
}