module TD.Query.CreateNewBasicGroupChat
(CreateNewBasicGroupChat(..)
, defaultCreateNewBasicGroupChat
) 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
data CreateNewBasicGroupChat
= CreateNewBasicGroupChat
{ CreateNewBasicGroupChat -> Maybe [Int]
user_ids :: Maybe [Int]
, CreateNewBasicGroupChat -> Maybe Text
title :: Maybe T.Text
, CreateNewBasicGroupChat -> Maybe Int
message_auto_delete_time :: Maybe Int
}
deriving (CreateNewBasicGroupChat -> CreateNewBasicGroupChat -> Bool
(CreateNewBasicGroupChat -> CreateNewBasicGroupChat -> Bool)
-> (CreateNewBasicGroupChat -> CreateNewBasicGroupChat -> Bool)
-> Eq CreateNewBasicGroupChat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateNewBasicGroupChat -> CreateNewBasicGroupChat -> Bool
== :: CreateNewBasicGroupChat -> CreateNewBasicGroupChat -> Bool
$c/= :: CreateNewBasicGroupChat -> CreateNewBasicGroupChat -> Bool
/= :: CreateNewBasicGroupChat -> CreateNewBasicGroupChat -> Bool
Eq, Int -> CreateNewBasicGroupChat -> ShowS
[CreateNewBasicGroupChat] -> ShowS
CreateNewBasicGroupChat -> String
(Int -> CreateNewBasicGroupChat -> ShowS)
-> (CreateNewBasicGroupChat -> String)
-> ([CreateNewBasicGroupChat] -> ShowS)
-> Show CreateNewBasicGroupChat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateNewBasicGroupChat -> ShowS
showsPrec :: Int -> CreateNewBasicGroupChat -> ShowS
$cshow :: CreateNewBasicGroupChat -> String
show :: CreateNewBasicGroupChat -> String
$cshowList :: [CreateNewBasicGroupChat] -> ShowS
showList :: [CreateNewBasicGroupChat] -> ShowS
Show)
instance I.ShortShow CreateNewBasicGroupChat where
shortShow :: CreateNewBasicGroupChat -> String
shortShow
CreateNewBasicGroupChat
{ user_ids :: CreateNewBasicGroupChat -> Maybe [Int]
user_ids = Maybe [Int]
user_ids_
, title :: CreateNewBasicGroupChat -> Maybe Text
title = Maybe Text
title_
, message_auto_delete_time :: CreateNewBasicGroupChat -> Maybe Int
message_auto_delete_time = Maybe Int
message_auto_delete_time_
}
= String
"CreateNewBasicGroupChat"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
user_ids_
, String
"title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
, 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_
]
instance AT.ToJSON CreateNewBasicGroupChat where
toJSON :: CreateNewBasicGroupChat -> Value
toJSON
CreateNewBasicGroupChat
{ user_ids :: CreateNewBasicGroupChat -> Maybe [Int]
user_ids = Maybe [Int]
user_ids_
, title :: CreateNewBasicGroupChat -> Maybe Text
title = Maybe Text
title_
, message_auto_delete_time :: CreateNewBasicGroupChat -> Maybe Int
message_auto_delete_time = Maybe Int
message_auto_delete_time_
}
= [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
"createNewBasicGroupChat"
, Key
"user_ids" Key -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Int]
user_ids_
, 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
"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_
]
defaultCreateNewBasicGroupChat :: CreateNewBasicGroupChat
defaultCreateNewBasicGroupChat :: CreateNewBasicGroupChat
defaultCreateNewBasicGroupChat =
CreateNewBasicGroupChat
{ user_ids :: Maybe [Int]
user_ids = Maybe [Int]
forall a. Maybe a
Nothing
, title :: Maybe Text
title = Maybe Text
forall a. Maybe a
Nothing
, message_auto_delete_time :: Maybe Int
message_auto_delete_time = Maybe Int
forall a. Maybe a
Nothing
}