module TD.Query.BanGroupCallParticipants
(BanGroupCallParticipants(..)
, defaultBanGroupCallParticipants
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data BanGroupCallParticipants
= BanGroupCallParticipants
{ BanGroupCallParticipants -> Maybe Int
group_call_id :: Maybe Int
, BanGroupCallParticipants -> Maybe [Int]
user_ids :: Maybe [Int]
}
deriving (BanGroupCallParticipants -> BanGroupCallParticipants -> Bool
(BanGroupCallParticipants -> BanGroupCallParticipants -> Bool)
-> (BanGroupCallParticipants -> BanGroupCallParticipants -> Bool)
-> Eq BanGroupCallParticipants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BanGroupCallParticipants -> BanGroupCallParticipants -> Bool
== :: BanGroupCallParticipants -> BanGroupCallParticipants -> Bool
$c/= :: BanGroupCallParticipants -> BanGroupCallParticipants -> Bool
/= :: BanGroupCallParticipants -> BanGroupCallParticipants -> Bool
Eq, Int -> BanGroupCallParticipants -> ShowS
[BanGroupCallParticipants] -> ShowS
BanGroupCallParticipants -> String
(Int -> BanGroupCallParticipants -> ShowS)
-> (BanGroupCallParticipants -> String)
-> ([BanGroupCallParticipants] -> ShowS)
-> Show BanGroupCallParticipants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BanGroupCallParticipants -> ShowS
showsPrec :: Int -> BanGroupCallParticipants -> ShowS
$cshow :: BanGroupCallParticipants -> String
show :: BanGroupCallParticipants -> String
$cshowList :: [BanGroupCallParticipants] -> ShowS
showList :: [BanGroupCallParticipants] -> ShowS
Show)
instance I.ShortShow BanGroupCallParticipants where
shortShow :: BanGroupCallParticipants -> String
shortShow
BanGroupCallParticipants
{ group_call_id :: BanGroupCallParticipants -> Maybe Int
group_call_id = Maybe Int
group_call_id_
, user_ids :: BanGroupCallParticipants -> Maybe [Int]
user_ids = Maybe [Int]
user_ids_
}
= String
"BanGroupCallParticipants"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"group_call_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
group_call_id_
, String
"user_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
user_ids_
]
instance AT.ToJSON BanGroupCallParticipants where
toJSON :: BanGroupCallParticipants -> Value
toJSON
BanGroupCallParticipants
{ group_call_id :: BanGroupCallParticipants -> Maybe Int
group_call_id = Maybe Int
group_call_id_
, user_ids :: BanGroupCallParticipants -> Maybe [Int]
user_ids = Maybe [Int]
user_ids_
}
= [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
"banGroupCallParticipants"
, Key
"group_call_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
group_call_id_
, Key
"user_ids" Key -> Maybe [Value] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= ([Int] -> [Value]) -> Maybe [Int] -> Maybe [Value]
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Int -> Value) -> [Int] -> [Value]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Value
I.writeInt64 ) Maybe [Int]
user_ids_
]
defaultBanGroupCallParticipants :: BanGroupCallParticipants
defaultBanGroupCallParticipants :: BanGroupCallParticipants
defaultBanGroupCallParticipants =
BanGroupCallParticipants
{ group_call_id :: Maybe Int
group_call_id = Maybe Int
forall a. Maybe a
Nothing
, user_ids :: Maybe [Int]
user_ids = Maybe [Int]
forall a. Maybe a
Nothing
}