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