module TD.Query.PreliminaryUploadFile
(PreliminaryUploadFile(..)
, defaultPreliminaryUploadFile
) 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.InputFile as InputFile
import qualified TD.Data.FileType as FileType
data PreliminaryUploadFile
= PreliminaryUploadFile
{ PreliminaryUploadFile -> Maybe InputFile
file :: Maybe InputFile.InputFile
, PreliminaryUploadFile -> Maybe FileType
file_type :: Maybe FileType.FileType
, PreliminaryUploadFile -> Maybe Int
priority :: Maybe Int
}
deriving (PreliminaryUploadFile -> PreliminaryUploadFile -> Bool
(PreliminaryUploadFile -> PreliminaryUploadFile -> Bool)
-> (PreliminaryUploadFile -> PreliminaryUploadFile -> Bool)
-> Eq PreliminaryUploadFile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PreliminaryUploadFile -> PreliminaryUploadFile -> Bool
== :: PreliminaryUploadFile -> PreliminaryUploadFile -> Bool
$c/= :: PreliminaryUploadFile -> PreliminaryUploadFile -> Bool
/= :: PreliminaryUploadFile -> PreliminaryUploadFile -> Bool
Eq, Int -> PreliminaryUploadFile -> ShowS
[PreliminaryUploadFile] -> ShowS
PreliminaryUploadFile -> String
(Int -> PreliminaryUploadFile -> ShowS)
-> (PreliminaryUploadFile -> String)
-> ([PreliminaryUploadFile] -> ShowS)
-> Show PreliminaryUploadFile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PreliminaryUploadFile -> ShowS
showsPrec :: Int -> PreliminaryUploadFile -> ShowS
$cshow :: PreliminaryUploadFile -> String
show :: PreliminaryUploadFile -> String
$cshowList :: [PreliminaryUploadFile] -> ShowS
showList :: [PreliminaryUploadFile] -> ShowS
Show)
instance I.ShortShow PreliminaryUploadFile where
shortShow :: PreliminaryUploadFile -> String
shortShow
PreliminaryUploadFile
{ file :: PreliminaryUploadFile -> Maybe InputFile
file = Maybe InputFile
file_
, file_type :: PreliminaryUploadFile -> Maybe FileType
file_type = Maybe FileType
file_type_
, priority :: PreliminaryUploadFile -> Maybe Int
priority = Maybe Int
priority_
}
= String
"PreliminaryUploadFile"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"file" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
file_
, String
"file_type" String -> Maybe FileType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FileType
file_type_
, String
"priority" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
priority_
]
instance AT.ToJSON PreliminaryUploadFile where
toJSON :: PreliminaryUploadFile -> Value
toJSON
PreliminaryUploadFile
{ file :: PreliminaryUploadFile -> Maybe InputFile
file = Maybe InputFile
file_
, file_type :: PreliminaryUploadFile -> Maybe FileType
file_type = Maybe FileType
file_type_
, priority :: PreliminaryUploadFile -> Maybe Int
priority = Maybe Int
priority_
}
= [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
"preliminaryUploadFile"
, Key
"file" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
file_
, Key
"file_type" Key -> Maybe FileType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FileType
file_type_
, Key
"priority" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
priority_
]
defaultPreliminaryUploadFile :: PreliminaryUploadFile
defaultPreliminaryUploadFile :: PreliminaryUploadFile
defaultPreliminaryUploadFile =
PreliminaryUploadFile
{ file :: Maybe InputFile
file = Maybe InputFile
forall a. Maybe a
Nothing
, file_type :: Maybe FileType
file_type = Maybe FileType
forall a. Maybe a
Nothing
, priority :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Nothing
}