module TD.Query.SetMessageSenderBlockList
(SetMessageSenderBlockList(..)
, defaultSetMessageSenderBlockList
) 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.BlockList as BlockList
data SetMessageSenderBlockList
= SetMessageSenderBlockList
{ SetMessageSenderBlockList -> Maybe MessageSender
sender_id :: Maybe MessageSender.MessageSender
, SetMessageSenderBlockList -> Maybe BlockList
block_list :: Maybe BlockList.BlockList
}
deriving (SetMessageSenderBlockList -> SetMessageSenderBlockList -> Bool
(SetMessageSenderBlockList -> SetMessageSenderBlockList -> Bool)
-> (SetMessageSenderBlockList -> SetMessageSenderBlockList -> Bool)
-> Eq SetMessageSenderBlockList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetMessageSenderBlockList -> SetMessageSenderBlockList -> Bool
== :: SetMessageSenderBlockList -> SetMessageSenderBlockList -> Bool
$c/= :: SetMessageSenderBlockList -> SetMessageSenderBlockList -> Bool
/= :: SetMessageSenderBlockList -> SetMessageSenderBlockList -> Bool
Eq, Int -> SetMessageSenderBlockList -> ShowS
[SetMessageSenderBlockList] -> ShowS
SetMessageSenderBlockList -> String
(Int -> SetMessageSenderBlockList -> ShowS)
-> (SetMessageSenderBlockList -> String)
-> ([SetMessageSenderBlockList] -> ShowS)
-> Show SetMessageSenderBlockList
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetMessageSenderBlockList -> ShowS
showsPrec :: Int -> SetMessageSenderBlockList -> ShowS
$cshow :: SetMessageSenderBlockList -> String
show :: SetMessageSenderBlockList -> String
$cshowList :: [SetMessageSenderBlockList] -> ShowS
showList :: [SetMessageSenderBlockList] -> ShowS
Show)
instance I.ShortShow SetMessageSenderBlockList where
shortShow :: SetMessageSenderBlockList -> String
shortShow
SetMessageSenderBlockList
{ sender_id :: SetMessageSenderBlockList -> Maybe MessageSender
sender_id = Maybe MessageSender
sender_id_
, block_list :: SetMessageSenderBlockList -> Maybe BlockList
block_list = Maybe BlockList
block_list_
}
= String
"SetMessageSenderBlockList"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"sender_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
sender_id_
, String
"block_list" String -> Maybe BlockList -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe BlockList
block_list_
]
instance AT.ToJSON SetMessageSenderBlockList where
toJSON :: SetMessageSenderBlockList -> Value
toJSON
SetMessageSenderBlockList
{ sender_id :: SetMessageSenderBlockList -> Maybe MessageSender
sender_id = Maybe MessageSender
sender_id_
, block_list :: SetMessageSenderBlockList -> Maybe BlockList
block_list = Maybe BlockList
block_list_
}
= [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
"setMessageSenderBlockList"
, Key
"sender_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
sender_id_
, Key
"block_list" Key -> Maybe BlockList -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe BlockList
block_list_
]
defaultSetMessageSenderBlockList :: SetMessageSenderBlockList
defaultSetMessageSenderBlockList :: SetMessageSenderBlockList
defaultSetMessageSenderBlockList =
SetMessageSenderBlockList
{ sender_id :: Maybe MessageSender
sender_id = Maybe MessageSender
forall a. Maybe a
Nothing
, block_list :: Maybe BlockList
block_list = Maybe BlockList
forall a. Maybe a
Nothing
}