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