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