module TD.Query.GetSuggestedFileName
(GetSuggestedFileName(..)
, defaultGetSuggestedFileName
) 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 GetSuggestedFileName
= GetSuggestedFileName
{ GetSuggestedFileName -> Maybe Int
file_id :: Maybe Int
, GetSuggestedFileName -> Maybe Text
directory :: Maybe T.Text
}
deriving (GetSuggestedFileName -> GetSuggestedFileName -> Bool
(GetSuggestedFileName -> GetSuggestedFileName -> Bool)
-> (GetSuggestedFileName -> GetSuggestedFileName -> Bool)
-> Eq GetSuggestedFileName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetSuggestedFileName -> GetSuggestedFileName -> Bool
== :: GetSuggestedFileName -> GetSuggestedFileName -> Bool
$c/= :: GetSuggestedFileName -> GetSuggestedFileName -> Bool
/= :: GetSuggestedFileName -> GetSuggestedFileName -> Bool
Eq, Int -> GetSuggestedFileName -> ShowS
[GetSuggestedFileName] -> ShowS
GetSuggestedFileName -> String
(Int -> GetSuggestedFileName -> ShowS)
-> (GetSuggestedFileName -> String)
-> ([GetSuggestedFileName] -> ShowS)
-> Show GetSuggestedFileName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetSuggestedFileName -> ShowS
showsPrec :: Int -> GetSuggestedFileName -> ShowS
$cshow :: GetSuggestedFileName -> String
show :: GetSuggestedFileName -> String
$cshowList :: [GetSuggestedFileName] -> ShowS
showList :: [GetSuggestedFileName] -> ShowS
Show)
instance I.ShortShow GetSuggestedFileName where
shortShow :: GetSuggestedFileName -> String
shortShow
GetSuggestedFileName
{ file_id :: GetSuggestedFileName -> Maybe Int
file_id = Maybe Int
file_id_
, directory :: GetSuggestedFileName -> Maybe Text
directory = Maybe Text
directory_
}
= String
"GetSuggestedFileName"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"file_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
file_id_
, String
"directory" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
directory_
]
instance AT.ToJSON GetSuggestedFileName where
toJSON :: GetSuggestedFileName -> Value
toJSON
GetSuggestedFileName
{ file_id :: GetSuggestedFileName -> Maybe Int
file_id = Maybe Int
file_id_
, directory :: GetSuggestedFileName -> Maybe Text
directory = Maybe Text
directory_
}
= [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
"getSuggestedFileName"
, Key
"file_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
file_id_
, Key
"directory" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
directory_
]
defaultGetSuggestedFileName :: GetSuggestedFileName
defaultGetSuggestedFileName :: GetSuggestedFileName
defaultGetSuggestedFileName =
GetSuggestedFileName
{ file_id :: Maybe Int
file_id = Maybe Int
forall a. Maybe a
Nothing
, directory :: Maybe Text
directory = Maybe Text
forall a. Maybe a
Nothing
}