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