module TD.Query.GetChatMember
(GetChatMember(..)
, defaultGetChatMember
) 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.MessageSender as MessageSender
data GetChatMember
= GetChatMember
{ GetChatMember -> Maybe Int
chat_id :: Maybe Int
, GetChatMember -> Maybe MessageSender
member_id :: Maybe MessageSender.MessageSender
}
deriving (GetChatMember -> GetChatMember -> Bool
(GetChatMember -> GetChatMember -> Bool)
-> (GetChatMember -> GetChatMember -> Bool) -> Eq GetChatMember
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatMember -> GetChatMember -> Bool
== :: GetChatMember -> GetChatMember -> Bool
$c/= :: GetChatMember -> GetChatMember -> Bool
/= :: GetChatMember -> GetChatMember -> Bool
Eq, Int -> GetChatMember -> ShowS
[GetChatMember] -> ShowS
GetChatMember -> String
(Int -> GetChatMember -> ShowS)
-> (GetChatMember -> String)
-> ([GetChatMember] -> ShowS)
-> Show GetChatMember
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatMember -> ShowS
showsPrec :: Int -> GetChatMember -> ShowS
$cshow :: GetChatMember -> String
show :: GetChatMember -> String
$cshowList :: [GetChatMember] -> ShowS
showList :: [GetChatMember] -> ShowS
Show)
instance I.ShortShow GetChatMember where
shortShow :: GetChatMember -> String
shortShow
GetChatMember
{ chat_id :: GetChatMember -> Maybe Int
chat_id = Maybe Int
chat_id_
, member_id :: GetChatMember -> Maybe MessageSender
member_id = Maybe MessageSender
member_id_
}
= String
"GetChatMember"
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
"member_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
member_id_
]
instance AT.ToJSON GetChatMember where
toJSON :: GetChatMember -> Value
toJSON
GetChatMember
{ chat_id :: GetChatMember -> Maybe Int
chat_id = Maybe Int
chat_id_
, member_id :: GetChatMember -> Maybe MessageSender
member_id = Maybe MessageSender
member_id_
}
= [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
"getChatMember"
, 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
"member_id" Key -> Maybe MessageSender -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSender
member_id_
]
defaultGetChatMember :: GetChatMember
defaultGetChatMember :: GetChatMember
defaultGetChatMember =
GetChatMember
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, member_id :: Maybe MessageSender
member_id = Maybe MessageSender
forall a. Maybe a
Nothing
}