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