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