module TD.Query.GetChatFolderChatCount
(GetChatFolderChatCount(..)
) 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 GetChatFolderChatCount
= GetChatFolderChatCount
{ GetChatFolderChatCount -> Maybe ChatFolder
folder :: Maybe ChatFolder.ChatFolder
}
deriving (GetChatFolderChatCount -> GetChatFolderChatCount -> Bool
(GetChatFolderChatCount -> GetChatFolderChatCount -> Bool)
-> (GetChatFolderChatCount -> GetChatFolderChatCount -> Bool)
-> Eq GetChatFolderChatCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatFolderChatCount -> GetChatFolderChatCount -> Bool
== :: GetChatFolderChatCount -> GetChatFolderChatCount -> Bool
$c/= :: GetChatFolderChatCount -> GetChatFolderChatCount -> Bool
/= :: GetChatFolderChatCount -> GetChatFolderChatCount -> Bool
Eq, Int -> GetChatFolderChatCount -> ShowS
[GetChatFolderChatCount] -> ShowS
GetChatFolderChatCount -> String
(Int -> GetChatFolderChatCount -> ShowS)
-> (GetChatFolderChatCount -> String)
-> ([GetChatFolderChatCount] -> ShowS)
-> Show GetChatFolderChatCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatFolderChatCount -> ShowS
showsPrec :: Int -> GetChatFolderChatCount -> ShowS
$cshow :: GetChatFolderChatCount -> String
show :: GetChatFolderChatCount -> String
$cshowList :: [GetChatFolderChatCount] -> ShowS
showList :: [GetChatFolderChatCount] -> ShowS
Show)
instance I.ShortShow GetChatFolderChatCount where
shortShow :: GetChatFolderChatCount -> String
shortShow
GetChatFolderChatCount
{ folder :: GetChatFolderChatCount -> Maybe ChatFolder
folder = Maybe ChatFolder
folder_
}
= String
"GetChatFolderChatCount"
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 GetChatFolderChatCount where
toJSON :: GetChatFolderChatCount -> Value
toJSON
GetChatFolderChatCount
{ folder :: GetChatFolderChatCount -> 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
"getChatFolderChatCount"
, 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_
]