module TD.Query.GetSavedMessagesTopicHistory
(GetSavedMessagesTopicHistory(..)
, defaultGetSavedMessagesTopicHistory
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data GetSavedMessagesTopicHistory
= GetSavedMessagesTopicHistory
{ GetSavedMessagesTopicHistory -> Maybe Int
saved_messages_topic_id :: Maybe Int
, GetSavedMessagesTopicHistory -> Maybe Int
from_message_id :: Maybe Int
, GetSavedMessagesTopicHistory -> Maybe Int
offset :: Maybe Int
, GetSavedMessagesTopicHistory -> Maybe Int
limit :: Maybe Int
}
deriving (GetSavedMessagesTopicHistory
-> GetSavedMessagesTopicHistory -> Bool
(GetSavedMessagesTopicHistory
-> GetSavedMessagesTopicHistory -> Bool)
-> (GetSavedMessagesTopicHistory
-> GetSavedMessagesTopicHistory -> Bool)
-> Eq GetSavedMessagesTopicHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetSavedMessagesTopicHistory
-> GetSavedMessagesTopicHistory -> Bool
== :: GetSavedMessagesTopicHistory
-> GetSavedMessagesTopicHistory -> Bool
$c/= :: GetSavedMessagesTopicHistory
-> GetSavedMessagesTopicHistory -> Bool
/= :: GetSavedMessagesTopicHistory
-> GetSavedMessagesTopicHistory -> Bool
Eq, Int -> GetSavedMessagesTopicHistory -> ShowS
[GetSavedMessagesTopicHistory] -> ShowS
GetSavedMessagesTopicHistory -> String
(Int -> GetSavedMessagesTopicHistory -> ShowS)
-> (GetSavedMessagesTopicHistory -> String)
-> ([GetSavedMessagesTopicHistory] -> ShowS)
-> Show GetSavedMessagesTopicHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetSavedMessagesTopicHistory -> ShowS
showsPrec :: Int -> GetSavedMessagesTopicHistory -> ShowS
$cshow :: GetSavedMessagesTopicHistory -> String
show :: GetSavedMessagesTopicHistory -> String
$cshowList :: [GetSavedMessagesTopicHistory] -> ShowS
showList :: [GetSavedMessagesTopicHistory] -> ShowS
Show)
instance I.ShortShow GetSavedMessagesTopicHistory where
shortShow :: GetSavedMessagesTopicHistory -> String
shortShow
GetSavedMessagesTopicHistory
{ saved_messages_topic_id :: GetSavedMessagesTopicHistory -> Maybe Int
saved_messages_topic_id = Maybe Int
saved_messages_topic_id_
, from_message_id :: GetSavedMessagesTopicHistory -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, offset :: GetSavedMessagesTopicHistory -> Maybe Int
offset = Maybe Int
offset_
, limit :: GetSavedMessagesTopicHistory -> Maybe Int
limit = Maybe Int
limit_
}
= String
"GetSavedMessagesTopicHistory"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"saved_messages_topic_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
saved_messages_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 GetSavedMessagesTopicHistory where
toJSON :: GetSavedMessagesTopicHistory -> Value
toJSON
GetSavedMessagesTopicHistory
{ saved_messages_topic_id :: GetSavedMessagesTopicHistory -> Maybe Int
saved_messages_topic_id = Maybe Int
saved_messages_topic_id_
, from_message_id :: GetSavedMessagesTopicHistory -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, offset :: GetSavedMessagesTopicHistory -> Maybe Int
offset = Maybe Int
offset_
, limit :: GetSavedMessagesTopicHistory -> 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
"getSavedMessagesTopicHistory"
, Key
"saved_messages_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
saved_messages_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_
]
defaultGetSavedMessagesTopicHistory :: GetSavedMessagesTopicHistory
defaultGetSavedMessagesTopicHistory :: GetSavedMessagesTopicHistory
defaultGetSavedMessagesTopicHistory =
GetSavedMessagesTopicHistory
{ saved_messages_topic_id :: Maybe Int
saved_messages_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
}