module TD.Query.AddChatMember
(AddChatMember(..)
, defaultAddChatMember
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data AddChatMember
= AddChatMember
{ AddChatMember -> Maybe Int
chat_id :: Maybe Int
, AddChatMember -> Maybe Int
user_id :: Maybe Int
, AddChatMember -> Maybe Int
forward_limit :: Maybe Int
}
deriving (AddChatMember -> AddChatMember -> Bool
(AddChatMember -> AddChatMember -> Bool)
-> (AddChatMember -> AddChatMember -> Bool) -> Eq AddChatMember
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddChatMember -> AddChatMember -> Bool
== :: AddChatMember -> AddChatMember -> Bool
$c/= :: AddChatMember -> AddChatMember -> Bool
/= :: AddChatMember -> AddChatMember -> Bool
Eq, Int -> AddChatMember -> ShowS
[AddChatMember] -> ShowS
AddChatMember -> String
(Int -> AddChatMember -> ShowS)
-> (AddChatMember -> String)
-> ([AddChatMember] -> ShowS)
-> Show AddChatMember
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddChatMember -> ShowS
showsPrec :: Int -> AddChatMember -> ShowS
$cshow :: AddChatMember -> String
show :: AddChatMember -> String
$cshowList :: [AddChatMember] -> ShowS
showList :: [AddChatMember] -> ShowS
Show)
instance I.ShortShow AddChatMember where
shortShow :: AddChatMember -> String
shortShow
AddChatMember
{ chat_id :: AddChatMember -> Maybe Int
chat_id = Maybe Int
chat_id_
, user_id :: AddChatMember -> Maybe Int
user_id = Maybe Int
user_id_
, forward_limit :: AddChatMember -> Maybe Int
forward_limit = Maybe Int
forward_limit_
}
= String
"AddChatMember"
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_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"forward_limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
forward_limit_
]
instance AT.ToJSON AddChatMember where
toJSON :: AddChatMember -> Value
toJSON
AddChatMember
{ chat_id :: AddChatMember -> Maybe Int
chat_id = Maybe Int
chat_id_
, user_id :: AddChatMember -> Maybe Int
user_id = Maybe Int
user_id_
, forward_limit :: AddChatMember -> Maybe Int
forward_limit = Maybe Int
forward_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
"addChatMember"
, 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_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
user_id_
, Key
"forward_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
forward_limit_
]
defaultAddChatMember :: AddChatMember
defaultAddChatMember :: AddChatMember
defaultAddChatMember =
AddChatMember
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, user_id :: Maybe Int
user_id = Maybe Int
forall a. Maybe a
Nothing
, forward_limit :: Maybe Int
forward_limit = Maybe Int
forall a. Maybe a
Nothing
}