module TD.Query.ToggleSupergroupSignMessages
(ToggleSupergroupSignMessages(..)
, defaultToggleSupergroupSignMessages
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data ToggleSupergroupSignMessages
= ToggleSupergroupSignMessages
{ ToggleSupergroupSignMessages -> Maybe Int
supergroup_id :: Maybe Int
, ToggleSupergroupSignMessages -> Maybe Bool
sign_messages :: Maybe Bool
, ToggleSupergroupSignMessages -> Maybe Bool
show_message_sender :: Maybe Bool
}
deriving (ToggleSupergroupSignMessages
-> ToggleSupergroupSignMessages -> Bool
(ToggleSupergroupSignMessages
-> ToggleSupergroupSignMessages -> Bool)
-> (ToggleSupergroupSignMessages
-> ToggleSupergroupSignMessages -> Bool)
-> Eq ToggleSupergroupSignMessages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleSupergroupSignMessages
-> ToggleSupergroupSignMessages -> Bool
== :: ToggleSupergroupSignMessages
-> ToggleSupergroupSignMessages -> Bool
$c/= :: ToggleSupergroupSignMessages
-> ToggleSupergroupSignMessages -> Bool
/= :: ToggleSupergroupSignMessages
-> ToggleSupergroupSignMessages -> Bool
Eq, Int -> ToggleSupergroupSignMessages -> ShowS
[ToggleSupergroupSignMessages] -> ShowS
ToggleSupergroupSignMessages -> String
(Int -> ToggleSupergroupSignMessages -> ShowS)
-> (ToggleSupergroupSignMessages -> String)
-> ([ToggleSupergroupSignMessages] -> ShowS)
-> Show ToggleSupergroupSignMessages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleSupergroupSignMessages -> ShowS
showsPrec :: Int -> ToggleSupergroupSignMessages -> ShowS
$cshow :: ToggleSupergroupSignMessages -> String
show :: ToggleSupergroupSignMessages -> String
$cshowList :: [ToggleSupergroupSignMessages] -> ShowS
showList :: [ToggleSupergroupSignMessages] -> ShowS
Show)
instance I.ShortShow ToggleSupergroupSignMessages where
shortShow :: ToggleSupergroupSignMessages -> String
shortShow
ToggleSupergroupSignMessages
{ supergroup_id :: ToggleSupergroupSignMessages -> Maybe Int
supergroup_id = Maybe Int
supergroup_id_
, sign_messages :: ToggleSupergroupSignMessages -> Maybe Bool
sign_messages = Maybe Bool
sign_messages_
, show_message_sender :: ToggleSupergroupSignMessages -> Maybe Bool
show_message_sender = Maybe Bool
show_message_sender_
}
= String
"ToggleSupergroupSignMessages"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"supergroup_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
supergroup_id_
, String
"sign_messages" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
sign_messages_
, String
"show_message_sender" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_message_sender_
]
instance AT.ToJSON ToggleSupergroupSignMessages where
toJSON :: ToggleSupergroupSignMessages -> Value
toJSON
ToggleSupergroupSignMessages
{ supergroup_id :: ToggleSupergroupSignMessages -> Maybe Int
supergroup_id = Maybe Int
supergroup_id_
, sign_messages :: ToggleSupergroupSignMessages -> Maybe Bool
sign_messages = Maybe Bool
sign_messages_
, show_message_sender :: ToggleSupergroupSignMessages -> Maybe Bool
show_message_sender = Maybe Bool
show_message_sender_
}
= [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
"toggleSupergroupSignMessages"
, Key
"supergroup_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
supergroup_id_
, Key
"sign_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
sign_messages_
, Key
"show_message_sender" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
show_message_sender_
]
defaultToggleSupergroupSignMessages :: ToggleSupergroupSignMessages
defaultToggleSupergroupSignMessages :: ToggleSupergroupSignMessages
defaultToggleSupergroupSignMessages =
ToggleSupergroupSignMessages
{ supergroup_id :: Maybe Int
supergroup_id = Maybe Int
forall a. Maybe a
Nothing
, sign_messages :: Maybe Bool
sign_messages = Maybe Bool
forall a. Maybe a
Nothing
, show_message_sender :: Maybe Bool
show_message_sender = Maybe Bool
forall a. Maybe a
Nothing
}