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