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