module TD.Query.GetChatSparseMessagePositions
(GetChatSparseMessagePositions(..)
, defaultGetChatSparseMessagePositions
) 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.SearchMessagesFilter as SearchMessagesFilter
data GetChatSparseMessagePositions
= GetChatSparseMessagePositions
{ GetChatSparseMessagePositions -> Maybe Int
chat_id :: Maybe Int
, GetChatSparseMessagePositions -> Maybe SearchMessagesFilter
_filter :: Maybe SearchMessagesFilter.SearchMessagesFilter
, GetChatSparseMessagePositions -> Maybe Int
from_message_id :: Maybe Int
, GetChatSparseMessagePositions -> Maybe Int
limit :: Maybe Int
, GetChatSparseMessagePositions -> Maybe Int
saved_messages_topic_id :: Maybe Int
}
deriving (GetChatSparseMessagePositions
-> GetChatSparseMessagePositions -> Bool
(GetChatSparseMessagePositions
-> GetChatSparseMessagePositions -> Bool)
-> (GetChatSparseMessagePositions
-> GetChatSparseMessagePositions -> Bool)
-> Eq GetChatSparseMessagePositions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatSparseMessagePositions
-> GetChatSparseMessagePositions -> Bool
== :: GetChatSparseMessagePositions
-> GetChatSparseMessagePositions -> Bool
$c/= :: GetChatSparseMessagePositions
-> GetChatSparseMessagePositions -> Bool
/= :: GetChatSparseMessagePositions
-> GetChatSparseMessagePositions -> Bool
Eq, Int -> GetChatSparseMessagePositions -> ShowS
[GetChatSparseMessagePositions] -> ShowS
GetChatSparseMessagePositions -> String
(Int -> GetChatSparseMessagePositions -> ShowS)
-> (GetChatSparseMessagePositions -> String)
-> ([GetChatSparseMessagePositions] -> ShowS)
-> Show GetChatSparseMessagePositions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatSparseMessagePositions -> ShowS
showsPrec :: Int -> GetChatSparseMessagePositions -> ShowS
$cshow :: GetChatSparseMessagePositions -> String
show :: GetChatSparseMessagePositions -> String
$cshowList :: [GetChatSparseMessagePositions] -> ShowS
showList :: [GetChatSparseMessagePositions] -> ShowS
Show)
instance I.ShortShow GetChatSparseMessagePositions where
shortShow :: GetChatSparseMessagePositions -> String
shortShow
GetChatSparseMessagePositions
{ chat_id :: GetChatSparseMessagePositions -> Maybe Int
chat_id = Maybe Int
chat_id_
, _filter :: GetChatSparseMessagePositions -> Maybe SearchMessagesFilter
_filter = Maybe SearchMessagesFilter
_filter_
, from_message_id :: GetChatSparseMessagePositions -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, limit :: GetChatSparseMessagePositions -> Maybe Int
limit = Maybe Int
limit_
, saved_messages_topic_id :: GetChatSparseMessagePositions -> Maybe Int
saved_messages_topic_id = Maybe Int
saved_messages_topic_id_
}
= String
"GetChatSparseMessagePositions"
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
"_filter" String -> Maybe SearchMessagesFilter -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe SearchMessagesFilter
_filter_
, String
"from_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
from_message_id_
, String
"limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
, 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_
]
instance AT.ToJSON GetChatSparseMessagePositions where
toJSON :: GetChatSparseMessagePositions -> Value
toJSON
GetChatSparseMessagePositions
{ chat_id :: GetChatSparseMessagePositions -> Maybe Int
chat_id = Maybe Int
chat_id_
, _filter :: GetChatSparseMessagePositions -> Maybe SearchMessagesFilter
_filter = Maybe SearchMessagesFilter
_filter_
, from_message_id :: GetChatSparseMessagePositions -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, limit :: GetChatSparseMessagePositions -> Maybe Int
limit = Maybe Int
limit_
, saved_messages_topic_id :: GetChatSparseMessagePositions -> Maybe Int
saved_messages_topic_id = Maybe Int
saved_messages_topic_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
"getChatSparseMessagePositions"
, 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
"filter" Key -> Maybe SearchMessagesFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe SearchMessagesFilter
_filter_
, 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
"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_
, 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_
]
defaultGetChatSparseMessagePositions :: GetChatSparseMessagePositions
defaultGetChatSparseMessagePositions :: GetChatSparseMessagePositions
defaultGetChatSparseMessagePositions =
GetChatSparseMessagePositions
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, _filter :: Maybe SearchMessagesFilter
_filter = Maybe SearchMessagesFilter
forall a. Maybe a
Nothing
, from_message_id :: Maybe Int
from_message_id = Maybe Int
forall a. Maybe a
Nothing
, limit :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Nothing
, saved_messages_topic_id :: Maybe Int
saved_messages_topic_id = Maybe Int
forall a. Maybe a
Nothing
}