module TD.Query.ToggleSupergroupJoinToSendMessages
(ToggleSupergroupJoinToSendMessages(..)
, defaultToggleSupergroupJoinToSendMessages
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data ToggleSupergroupJoinToSendMessages
= ToggleSupergroupJoinToSendMessages
{ ToggleSupergroupJoinToSendMessages -> Maybe Int
supergroup_id :: Maybe Int
, ToggleSupergroupJoinToSendMessages -> Maybe Bool
join_to_send_messages :: Maybe Bool
}
deriving (ToggleSupergroupJoinToSendMessages
-> ToggleSupergroupJoinToSendMessages -> Bool
(ToggleSupergroupJoinToSendMessages
-> ToggleSupergroupJoinToSendMessages -> Bool)
-> (ToggleSupergroupJoinToSendMessages
-> ToggleSupergroupJoinToSendMessages -> Bool)
-> Eq ToggleSupergroupJoinToSendMessages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleSupergroupJoinToSendMessages
-> ToggleSupergroupJoinToSendMessages -> Bool
== :: ToggleSupergroupJoinToSendMessages
-> ToggleSupergroupJoinToSendMessages -> Bool
$c/= :: ToggleSupergroupJoinToSendMessages
-> ToggleSupergroupJoinToSendMessages -> Bool
/= :: ToggleSupergroupJoinToSendMessages
-> ToggleSupergroupJoinToSendMessages -> Bool
Eq, Int -> ToggleSupergroupJoinToSendMessages -> ShowS
[ToggleSupergroupJoinToSendMessages] -> ShowS
ToggleSupergroupJoinToSendMessages -> String
(Int -> ToggleSupergroupJoinToSendMessages -> ShowS)
-> (ToggleSupergroupJoinToSendMessages -> String)
-> ([ToggleSupergroupJoinToSendMessages] -> ShowS)
-> Show ToggleSupergroupJoinToSendMessages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleSupergroupJoinToSendMessages -> ShowS
showsPrec :: Int -> ToggleSupergroupJoinToSendMessages -> ShowS
$cshow :: ToggleSupergroupJoinToSendMessages -> String
show :: ToggleSupergroupJoinToSendMessages -> String
$cshowList :: [ToggleSupergroupJoinToSendMessages] -> ShowS
showList :: [ToggleSupergroupJoinToSendMessages] -> ShowS
Show)
instance I.ShortShow ToggleSupergroupJoinToSendMessages where
shortShow :: ToggleSupergroupJoinToSendMessages -> String
shortShow
ToggleSupergroupJoinToSendMessages
{ supergroup_id :: ToggleSupergroupJoinToSendMessages -> Maybe Int
supergroup_id = Maybe Int
supergroup_id_
, join_to_send_messages :: ToggleSupergroupJoinToSendMessages -> Maybe Bool
join_to_send_messages = Maybe Bool
join_to_send_messages_
}
= String
"ToggleSupergroupJoinToSendMessages"
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
"join_to_send_messages" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
join_to_send_messages_
]
instance AT.ToJSON ToggleSupergroupJoinToSendMessages where
toJSON :: ToggleSupergroupJoinToSendMessages -> Value
toJSON
ToggleSupergroupJoinToSendMessages
{ supergroup_id :: ToggleSupergroupJoinToSendMessages -> Maybe Int
supergroup_id = Maybe Int
supergroup_id_
, join_to_send_messages :: ToggleSupergroupJoinToSendMessages -> Maybe Bool
join_to_send_messages = Maybe Bool
join_to_send_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
"toggleSupergroupJoinToSendMessages"
, 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
"join_to_send_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
join_to_send_messages_
]
defaultToggleSupergroupJoinToSendMessages :: ToggleSupergroupJoinToSendMessages
defaultToggleSupergroupJoinToSendMessages :: ToggleSupergroupJoinToSendMessages
defaultToggleSupergroupJoinToSendMessages =
ToggleSupergroupJoinToSendMessages
{ supergroup_id :: Maybe Int
supergroup_id = Maybe Int
forall a. Maybe a
Nothing
, join_to_send_messages :: Maybe Bool
join_to_send_messages = Maybe Bool
forall a. Maybe a
Nothing
}