module TD.Query.CreateBasicGroupChat
(CreateBasicGroupChat(..)
, defaultCreateBasicGroupChat
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data CreateBasicGroupChat
= CreateBasicGroupChat
{ CreateBasicGroupChat -> Maybe Int
basic_group_id :: Maybe Int
, CreateBasicGroupChat -> Maybe Bool
force :: Maybe Bool
}
deriving (CreateBasicGroupChat -> CreateBasicGroupChat -> Bool
(CreateBasicGroupChat -> CreateBasicGroupChat -> Bool)
-> (CreateBasicGroupChat -> CreateBasicGroupChat -> Bool)
-> Eq CreateBasicGroupChat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateBasicGroupChat -> CreateBasicGroupChat -> Bool
== :: CreateBasicGroupChat -> CreateBasicGroupChat -> Bool
$c/= :: CreateBasicGroupChat -> CreateBasicGroupChat -> Bool
/= :: CreateBasicGroupChat -> CreateBasicGroupChat -> Bool
Eq, Int -> CreateBasicGroupChat -> ShowS
[CreateBasicGroupChat] -> ShowS
CreateBasicGroupChat -> String
(Int -> CreateBasicGroupChat -> ShowS)
-> (CreateBasicGroupChat -> String)
-> ([CreateBasicGroupChat] -> ShowS)
-> Show CreateBasicGroupChat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateBasicGroupChat -> ShowS
showsPrec :: Int -> CreateBasicGroupChat -> ShowS
$cshow :: CreateBasicGroupChat -> String
show :: CreateBasicGroupChat -> String
$cshowList :: [CreateBasicGroupChat] -> ShowS
showList :: [CreateBasicGroupChat] -> ShowS
Show)
instance I.ShortShow CreateBasicGroupChat where
shortShow :: CreateBasicGroupChat -> String
shortShow
CreateBasicGroupChat
{ basic_group_id :: CreateBasicGroupChat -> Maybe Int
basic_group_id = Maybe Int
basic_group_id_
, force :: CreateBasicGroupChat -> Maybe Bool
force = Maybe Bool
force_
}
= String
"CreateBasicGroupChat"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"basic_group_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
basic_group_id_
, String
"force" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
force_
]
instance AT.ToJSON CreateBasicGroupChat where
toJSON :: CreateBasicGroupChat -> Value
toJSON
CreateBasicGroupChat
{ basic_group_id :: CreateBasicGroupChat -> Maybe Int
basic_group_id = Maybe Int
basic_group_id_
, force :: CreateBasicGroupChat -> 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
"createBasicGroupChat"
, Key
"basic_group_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
basic_group_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_
]
defaultCreateBasicGroupChat :: CreateBasicGroupChat
defaultCreateBasicGroupChat :: CreateBasicGroupChat
defaultCreateBasicGroupChat =
CreateBasicGroupChat
{ basic_group_id :: Maybe Int
basic_group_id = Maybe Int
forall a. Maybe a
Nothing
, force :: Maybe Bool
force = Maybe Bool
forall a. Maybe a
Nothing
}