module TD.Query.GetSupergroupMembers
(GetSupergroupMembers(..)
, defaultGetSupergroupMembers
) 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.SupergroupMembersFilter as SupergroupMembersFilter
data GetSupergroupMembers
= GetSupergroupMembers
{ GetSupergroupMembers -> Maybe Int
supergroup_id :: Maybe Int
, GetSupergroupMembers -> Maybe SupergroupMembersFilter
_filter :: Maybe SupergroupMembersFilter.SupergroupMembersFilter
, GetSupergroupMembers -> Maybe Int
offset :: Maybe Int
, GetSupergroupMembers -> Maybe Int
limit :: Maybe Int
}
deriving (GetSupergroupMembers -> GetSupergroupMembers -> Bool
(GetSupergroupMembers -> GetSupergroupMembers -> Bool)
-> (GetSupergroupMembers -> GetSupergroupMembers -> Bool)
-> Eq GetSupergroupMembers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetSupergroupMembers -> GetSupergroupMembers -> Bool
== :: GetSupergroupMembers -> GetSupergroupMembers -> Bool
$c/= :: GetSupergroupMembers -> GetSupergroupMembers -> Bool
/= :: GetSupergroupMembers -> GetSupergroupMembers -> Bool
Eq, Int -> GetSupergroupMembers -> ShowS
[GetSupergroupMembers] -> ShowS
GetSupergroupMembers -> String
(Int -> GetSupergroupMembers -> ShowS)
-> (GetSupergroupMembers -> String)
-> ([GetSupergroupMembers] -> ShowS)
-> Show GetSupergroupMembers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetSupergroupMembers -> ShowS
showsPrec :: Int -> GetSupergroupMembers -> ShowS
$cshow :: GetSupergroupMembers -> String
show :: GetSupergroupMembers -> String
$cshowList :: [GetSupergroupMembers] -> ShowS
showList :: [GetSupergroupMembers] -> ShowS
Show)
instance I.ShortShow GetSupergroupMembers where
shortShow :: GetSupergroupMembers -> String
shortShow
GetSupergroupMembers
{ supergroup_id :: GetSupergroupMembers -> Maybe Int
supergroup_id = Maybe Int
supergroup_id_
, _filter :: GetSupergroupMembers -> Maybe SupergroupMembersFilter
_filter = Maybe SupergroupMembersFilter
_filter_
, offset :: GetSupergroupMembers -> Maybe Int
offset = Maybe Int
offset_
, limit :: GetSupergroupMembers -> Maybe Int
limit = Maybe Int
limit_
}
= String
"GetSupergroupMembers"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"supergroup_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
supergroup_id_
, String
"_filter" String -> Maybe SupergroupMembersFilter -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe SupergroupMembersFilter
_filter_
, 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 GetSupergroupMembers where
toJSON :: GetSupergroupMembers -> Value
toJSON
GetSupergroupMembers
{ supergroup_id :: GetSupergroupMembers -> Maybe Int
supergroup_id = Maybe Int
supergroup_id_
, _filter :: GetSupergroupMembers -> Maybe SupergroupMembersFilter
_filter = Maybe SupergroupMembersFilter
_filter_
, offset :: GetSupergroupMembers -> Maybe Int
offset = Maybe Int
offset_
, limit :: GetSupergroupMembers -> 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
"getSupergroupMembers"
, Key
"supergroup_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
supergroup_id_
, Key
"filter" Key -> Maybe SupergroupMembersFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe SupergroupMembersFilter
_filter_
, 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_
]
defaultGetSupergroupMembers :: GetSupergroupMembers
defaultGetSupergroupMembers :: GetSupergroupMembers
defaultGetSupergroupMembers =
GetSupergroupMembers
{ supergroup_id :: Maybe Int
supergroup_id = Maybe Int
forall a. Maybe a
Nothing
, _filter :: Maybe SupergroupMembersFilter
_filter = Maybe SupergroupMembersFilter
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
}