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