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