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