module TD.Query.DeleteChatFolder
(DeleteChatFolder(..)
, defaultDeleteChatFolder
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data DeleteChatFolder
= DeleteChatFolder
{ DeleteChatFolder -> Maybe Int
chat_folder_id :: Maybe Int
, DeleteChatFolder -> Maybe [Int]
leave_chat_ids :: Maybe [Int]
}
deriving (DeleteChatFolder -> DeleteChatFolder -> Bool
(DeleteChatFolder -> DeleteChatFolder -> Bool)
-> (DeleteChatFolder -> DeleteChatFolder -> Bool)
-> Eq DeleteChatFolder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteChatFolder -> DeleteChatFolder -> Bool
== :: DeleteChatFolder -> DeleteChatFolder -> Bool
$c/= :: DeleteChatFolder -> DeleteChatFolder -> Bool
/= :: DeleteChatFolder -> DeleteChatFolder -> Bool
Eq, Int -> DeleteChatFolder -> ShowS
[DeleteChatFolder] -> ShowS
DeleteChatFolder -> String
(Int -> DeleteChatFolder -> ShowS)
-> (DeleteChatFolder -> String)
-> ([DeleteChatFolder] -> ShowS)
-> Show DeleteChatFolder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteChatFolder -> ShowS
showsPrec :: Int -> DeleteChatFolder -> ShowS
$cshow :: DeleteChatFolder -> String
show :: DeleteChatFolder -> String
$cshowList :: [DeleteChatFolder] -> ShowS
showList :: [DeleteChatFolder] -> ShowS
Show)
instance I.ShortShow DeleteChatFolder where
shortShow :: DeleteChatFolder -> String
shortShow
DeleteChatFolder
{ chat_folder_id :: DeleteChatFolder -> Maybe Int
chat_folder_id = Maybe Int
chat_folder_id_
, leave_chat_ids :: DeleteChatFolder -> Maybe [Int]
leave_chat_ids = Maybe [Int]
leave_chat_ids_
}
= String
"DeleteChatFolder"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_folder_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_folder_id_
, String
"leave_chat_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
leave_chat_ids_
]
instance AT.ToJSON DeleteChatFolder where
toJSON :: DeleteChatFolder -> Value
toJSON
DeleteChatFolder
{ chat_folder_id :: DeleteChatFolder -> Maybe Int
chat_folder_id = Maybe Int
chat_folder_id_
, leave_chat_ids :: DeleteChatFolder -> Maybe [Int]
leave_chat_ids = Maybe [Int]
leave_chat_ids_
}
= [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
"deleteChatFolder"
, Key
"chat_folder_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
chat_folder_id_
, Key
"leave_chat_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]
leave_chat_ids_
]
defaultDeleteChatFolder :: DeleteChatFolder
defaultDeleteChatFolder :: DeleteChatFolder
defaultDeleteChatFolder =
DeleteChatFolder
{ chat_folder_id :: Maybe Int
chat_folder_id = Maybe Int
forall a. Maybe a
Nothing
, leave_chat_ids :: Maybe [Int]
leave_chat_ids = Maybe [Int]
forall a. Maybe a
Nothing
}