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