module TD.Query.CreateNewSupergroupChat
(CreateNewSupergroupChat(..)
, defaultCreateNewSupergroupChat
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
import qualified TD.Data.ChatLocation as ChatLocation
data CreateNewSupergroupChat
= CreateNewSupergroupChat
{ CreateNewSupergroupChat -> Maybe Text
title :: Maybe T.Text
, CreateNewSupergroupChat -> Maybe Bool
is_forum :: Maybe Bool
, CreateNewSupergroupChat -> Maybe Bool
is_channel :: Maybe Bool
, CreateNewSupergroupChat -> Maybe Text
description :: Maybe T.Text
, CreateNewSupergroupChat -> Maybe ChatLocation
location :: Maybe ChatLocation.ChatLocation
, CreateNewSupergroupChat -> Maybe Int
message_auto_delete_time :: Maybe Int
, CreateNewSupergroupChat -> Maybe Bool
for_import :: Maybe Bool
}
deriving (CreateNewSupergroupChat -> CreateNewSupergroupChat -> Bool
(CreateNewSupergroupChat -> CreateNewSupergroupChat -> Bool)
-> (CreateNewSupergroupChat -> CreateNewSupergroupChat -> Bool)
-> Eq CreateNewSupergroupChat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateNewSupergroupChat -> CreateNewSupergroupChat -> Bool
== :: CreateNewSupergroupChat -> CreateNewSupergroupChat -> Bool
$c/= :: CreateNewSupergroupChat -> CreateNewSupergroupChat -> Bool
/= :: CreateNewSupergroupChat -> CreateNewSupergroupChat -> Bool
Eq, Int -> CreateNewSupergroupChat -> ShowS
[CreateNewSupergroupChat] -> ShowS
CreateNewSupergroupChat -> String
(Int -> CreateNewSupergroupChat -> ShowS)
-> (CreateNewSupergroupChat -> String)
-> ([CreateNewSupergroupChat] -> ShowS)
-> Show CreateNewSupergroupChat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateNewSupergroupChat -> ShowS
showsPrec :: Int -> CreateNewSupergroupChat -> ShowS
$cshow :: CreateNewSupergroupChat -> String
show :: CreateNewSupergroupChat -> String
$cshowList :: [CreateNewSupergroupChat] -> ShowS
showList :: [CreateNewSupergroupChat] -> ShowS
Show)
instance I.ShortShow CreateNewSupergroupChat where
shortShow :: CreateNewSupergroupChat -> String
shortShow
CreateNewSupergroupChat
{ title :: CreateNewSupergroupChat -> Maybe Text
title = Maybe Text
title_
, is_forum :: CreateNewSupergroupChat -> Maybe Bool
is_forum = Maybe Bool
is_forum_
, is_channel :: CreateNewSupergroupChat -> Maybe Bool
is_channel = Maybe Bool
is_channel_
, description :: CreateNewSupergroupChat -> Maybe Text
description = Maybe Text
description_
, location :: CreateNewSupergroupChat -> Maybe ChatLocation
location = Maybe ChatLocation
location_
, message_auto_delete_time :: CreateNewSupergroupChat -> Maybe Int
message_auto_delete_time = Maybe Int
message_auto_delete_time_
, for_import :: CreateNewSupergroupChat -> Maybe Bool
for_import = Maybe Bool
for_import_
}
= String
"CreateNewSupergroupChat"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
, String
"is_forum" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_forum_
, String
"is_channel" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_channel_
, String
"description" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
description_
, String
"location" String -> Maybe ChatLocation -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatLocation
location_
, String
"message_auto_delete_time" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_auto_delete_time_
, String
"for_import" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
for_import_
]
instance AT.ToJSON CreateNewSupergroupChat where
toJSON :: CreateNewSupergroupChat -> Value
toJSON
CreateNewSupergroupChat
{ title :: CreateNewSupergroupChat -> Maybe Text
title = Maybe Text
title_
, is_forum :: CreateNewSupergroupChat -> Maybe Bool
is_forum = Maybe Bool
is_forum_
, is_channel :: CreateNewSupergroupChat -> Maybe Bool
is_channel = Maybe Bool
is_channel_
, description :: CreateNewSupergroupChat -> Maybe Text
description = Maybe Text
description_
, location :: CreateNewSupergroupChat -> Maybe ChatLocation
location = Maybe ChatLocation
location_
, message_auto_delete_time :: CreateNewSupergroupChat -> Maybe Int
message_auto_delete_time = Maybe Int
message_auto_delete_time_
, for_import :: CreateNewSupergroupChat -> Maybe Bool
for_import = Maybe Bool
for_import_
}
= [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
"createNewSupergroupChat"
, Key
"title" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
title_
, 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_
, Key
"is_channel" 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_channel_
, Key
"description" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
description_
, Key
"location" Key -> Maybe ChatLocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ChatLocation
location_
, Key
"message_auto_delete_time" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
message_auto_delete_time_
, Key
"for_import" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
for_import_
]
defaultCreateNewSupergroupChat :: CreateNewSupergroupChat
defaultCreateNewSupergroupChat :: CreateNewSupergroupChat
defaultCreateNewSupergroupChat =
CreateNewSupergroupChat
{ title :: Maybe Text
title = Maybe Text
forall a. Maybe a
Nothing
, is_forum :: Maybe Bool
is_forum = Maybe Bool
forall a. Maybe a
Nothing
, is_channel :: Maybe Bool
is_channel = Maybe Bool
forall a. Maybe a
Nothing
, description :: Maybe Text
description = Maybe Text
forall a. Maybe a
Nothing
, location :: Maybe ChatLocation
location = Maybe ChatLocation
forall a. Maybe a
Nothing
, message_auto_delete_time :: Maybe Int
message_auto_delete_time = Maybe Int
forall a. Maybe a
Nothing
, for_import :: Maybe Bool
for_import = Maybe Bool
forall a. Maybe a
Nothing
}