module TD.Query.AddChatMembers
(AddChatMembers(..)
, defaultAddChatMembers
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data AddChatMembers
= AddChatMembers
{ AddChatMembers -> Maybe Int
chat_id :: Maybe Int
, AddChatMembers -> Maybe [Int]
user_ids :: Maybe [Int]
}
deriving (AddChatMembers -> AddChatMembers -> Bool
(AddChatMembers -> AddChatMembers -> Bool)
-> (AddChatMembers -> AddChatMembers -> Bool) -> Eq AddChatMembers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddChatMembers -> AddChatMembers -> Bool
== :: AddChatMembers -> AddChatMembers -> Bool
$c/= :: AddChatMembers -> AddChatMembers -> Bool
/= :: AddChatMembers -> AddChatMembers -> Bool
Eq, Int -> AddChatMembers -> ShowS
[AddChatMembers] -> ShowS
AddChatMembers -> String
(Int -> AddChatMembers -> ShowS)
-> (AddChatMembers -> String)
-> ([AddChatMembers] -> ShowS)
-> Show AddChatMembers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddChatMembers -> ShowS
showsPrec :: Int -> AddChatMembers -> ShowS
$cshow :: AddChatMembers -> String
show :: AddChatMembers -> String
$cshowList :: [AddChatMembers] -> ShowS
showList :: [AddChatMembers] -> ShowS
Show)
instance I.ShortShow AddChatMembers where
shortShow :: AddChatMembers -> String
shortShow
AddChatMembers
{ chat_id :: AddChatMembers -> Maybe Int
chat_id = Maybe Int
chat_id_
, user_ids :: AddChatMembers -> Maybe [Int]
user_ids = Maybe [Int]
user_ids_
}
= String
"AddChatMembers"
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
"user_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
user_ids_
]
instance AT.ToJSON AddChatMembers where
toJSON :: AddChatMembers -> Value
toJSON
AddChatMembers
{ chat_id :: AddChatMembers -> Maybe Int
chat_id = Maybe Int
chat_id_
, user_ids :: AddChatMembers -> 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
"addChatMembers"
, 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
"user_ids" Key -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Int]
user_ids_
]
defaultAddChatMembers :: AddChatMembers
defaultAddChatMembers :: AddChatMembers
defaultAddChatMembers =
AddChatMembers
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, user_ids :: Maybe [Int]
user_ids = Maybe [Int]
forall a. Maybe a
Nothing
}