module TD.Query.SearchSecretMessages
(SearchSecretMessages(..)
, defaultSearchSecretMessages
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
import qualified TD.Data.SearchMessagesFilter as SearchMessagesFilter
data SearchSecretMessages
= SearchSecretMessages
{ SearchSecretMessages -> Maybe Int
chat_id :: Maybe Int
, SearchSecretMessages -> Maybe Text
query :: Maybe T.Text
, SearchSecretMessages -> Maybe Text
offset :: Maybe T.Text
, SearchSecretMessages -> Maybe Int
limit :: Maybe Int
, SearchSecretMessages -> Maybe SearchMessagesFilter
_filter :: Maybe SearchMessagesFilter.SearchMessagesFilter
}
deriving (SearchSecretMessages -> SearchSecretMessages -> Bool
(SearchSecretMessages -> SearchSecretMessages -> Bool)
-> (SearchSecretMessages -> SearchSecretMessages -> Bool)
-> Eq SearchSecretMessages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchSecretMessages -> SearchSecretMessages -> Bool
== :: SearchSecretMessages -> SearchSecretMessages -> Bool
$c/= :: SearchSecretMessages -> SearchSecretMessages -> Bool
/= :: SearchSecretMessages -> SearchSecretMessages -> Bool
Eq, Int -> SearchSecretMessages -> ShowS
[SearchSecretMessages] -> ShowS
SearchSecretMessages -> String
(Int -> SearchSecretMessages -> ShowS)
-> (SearchSecretMessages -> String)
-> ([SearchSecretMessages] -> ShowS)
-> Show SearchSecretMessages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchSecretMessages -> ShowS
showsPrec :: Int -> SearchSecretMessages -> ShowS
$cshow :: SearchSecretMessages -> String
show :: SearchSecretMessages -> String
$cshowList :: [SearchSecretMessages] -> ShowS
showList :: [SearchSecretMessages] -> ShowS
Show)
instance I.ShortShow SearchSecretMessages where
shortShow :: SearchSecretMessages -> String
shortShow
SearchSecretMessages
{ chat_id :: SearchSecretMessages -> Maybe Int
chat_id = Maybe Int
chat_id_
, query :: SearchSecretMessages -> Maybe Text
query = Maybe Text
query_
, offset :: SearchSecretMessages -> Maybe Text
offset = Maybe Text
offset_
, limit :: SearchSecretMessages -> Maybe Int
limit = Maybe Int
limit_
, _filter :: SearchSecretMessages -> Maybe SearchMessagesFilter
_filter = Maybe SearchMessagesFilter
_filter_
}
= String
"SearchSecretMessages"
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
"query" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
query_
, String
"offset" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
offset_
, String
"limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
, String
"_filter" String -> Maybe SearchMessagesFilter -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe SearchMessagesFilter
_filter_
]
instance AT.ToJSON SearchSecretMessages where
toJSON :: SearchSecretMessages -> Value
toJSON
SearchSecretMessages
{ chat_id :: SearchSecretMessages -> Maybe Int
chat_id = Maybe Int
chat_id_
, query :: SearchSecretMessages -> Maybe Text
query = Maybe Text
query_
, offset :: SearchSecretMessages -> Maybe Text
offset = Maybe Text
offset_
, limit :: SearchSecretMessages -> Maybe Int
limit = Maybe Int
limit_
, _filter :: SearchSecretMessages -> Maybe SearchMessagesFilter
_filter = Maybe SearchMessagesFilter
_filter_
}
= [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
"searchSecretMessages"
, 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
"query" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
query_
, Key
"offset" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
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_
, 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_
]
defaultSearchSecretMessages :: SearchSecretMessages
defaultSearchSecretMessages :: SearchSecretMessages
defaultSearchSecretMessages =
SearchSecretMessages
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, query :: Maybe Text
query = Maybe Text
forall a. Maybe a
Nothing
, offset :: Maybe Text
offset = Maybe Text
forall a. Maybe a
Nothing
, limit :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Nothing
, _filter :: Maybe SearchMessagesFilter
_filter = Maybe SearchMessagesFilter
forall a. Maybe a
Nothing
}