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