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