module TD.Query.GetChatMessageCalendar
(GetChatMessageCalendar(..)
, defaultGetChatMessageCalendar
) 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 GetChatMessageCalendar
= GetChatMessageCalendar
{ GetChatMessageCalendar -> Maybe Int
chat_id :: Maybe Int
, GetChatMessageCalendar -> Maybe SearchMessagesFilter
_filter :: Maybe SearchMessagesFilter.SearchMessagesFilter
, GetChatMessageCalendar -> Maybe Int
from_message_id :: Maybe Int
, GetChatMessageCalendar -> Maybe Int
saved_messages_topic_id :: Maybe Int
}
deriving (GetChatMessageCalendar -> GetChatMessageCalendar -> Bool
(GetChatMessageCalendar -> GetChatMessageCalendar -> Bool)
-> (GetChatMessageCalendar -> GetChatMessageCalendar -> Bool)
-> Eq GetChatMessageCalendar
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatMessageCalendar -> GetChatMessageCalendar -> Bool
== :: GetChatMessageCalendar -> GetChatMessageCalendar -> Bool
$c/= :: GetChatMessageCalendar -> GetChatMessageCalendar -> Bool
/= :: GetChatMessageCalendar -> GetChatMessageCalendar -> Bool
Eq, Int -> GetChatMessageCalendar -> ShowS
[GetChatMessageCalendar] -> ShowS
GetChatMessageCalendar -> String
(Int -> GetChatMessageCalendar -> ShowS)
-> (GetChatMessageCalendar -> String)
-> ([GetChatMessageCalendar] -> ShowS)
-> Show GetChatMessageCalendar
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatMessageCalendar -> ShowS
showsPrec :: Int -> GetChatMessageCalendar -> ShowS
$cshow :: GetChatMessageCalendar -> String
show :: GetChatMessageCalendar -> String
$cshowList :: [GetChatMessageCalendar] -> ShowS
showList :: [GetChatMessageCalendar] -> ShowS
Show)
instance I.ShortShow GetChatMessageCalendar where
shortShow :: GetChatMessageCalendar -> String
shortShow
GetChatMessageCalendar
{ chat_id :: GetChatMessageCalendar -> Maybe Int
chat_id = Maybe Int
chat_id_
, _filter :: GetChatMessageCalendar -> Maybe SearchMessagesFilter
_filter = Maybe SearchMessagesFilter
_filter_
, from_message_id :: GetChatMessageCalendar -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, saved_messages_topic_id :: GetChatMessageCalendar -> Maybe Int
saved_messages_topic_id = Maybe Int
saved_messages_topic_id_
}
= String
"GetChatMessageCalendar"
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
"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 GetChatMessageCalendar where
toJSON :: GetChatMessageCalendar -> Value
toJSON
GetChatMessageCalendar
{ chat_id :: GetChatMessageCalendar -> Maybe Int
chat_id = Maybe Int
chat_id_
, _filter :: GetChatMessageCalendar -> Maybe SearchMessagesFilter
_filter = Maybe SearchMessagesFilter
_filter_
, from_message_id :: GetChatMessageCalendar -> Maybe Int
from_message_id = Maybe Int
from_message_id_
, saved_messages_topic_id :: GetChatMessageCalendar -> 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
"getChatMessageCalendar"
, 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
"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_
]
defaultGetChatMessageCalendar :: GetChatMessageCalendar
defaultGetChatMessageCalendar :: GetChatMessageCalendar
defaultGetChatMessageCalendar =
GetChatMessageCalendar
{ 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
, saved_messages_topic_id :: Maybe Int
saved_messages_topic_id = Maybe Int
forall a. Maybe a
Nothing
}