PluginToolFile
Record in Oadm.Sdk.Plugins · Oadm.Sdk.dll
The file a tool’s answer hands the caller (PluginTool.ReturnsFile): which of the plugin’s downloads makes it, with which payload, and what the caller is told before it fetches it. Put it into the answer’s file property; the host turns it into a file reference. The names of the JSON fields are fixed, whatever the plugin’s serializer options.
public sealed record PluginToolFile(string Method, string? PayloadJson, string FileName, string ContentType, long? Size = null)Parameters
Method: The download method (ICorePluginDownloads.OpenDownloadAsync), e.g. “export”.PayloadJson: Its payload as JSON; the download checks it again with the caller’s rights.FileName: The file name the caller is told (no folder); the download’s own name wins when the file is fetched.ContentType: The media type, e.g. “application/pdf”, “text/csv”, “application/x-pem-file”.Size: The size in bytes when known before the download (an estimate is not a size: leave it null).
Properties
Section titled “Properties”ContentType
Section titled “ContentType”string ContentType { get; init; }The media type, e.g. “application/pdf”, “text/csv”, “application/x-pem-file”.
FileName
Section titled “FileName”string FileName { get; init; }The file name the caller is told (no folder); the download’s own name wins when the file is fetched.
Method
Section titled “Method”string Method { get; init; }The download method (ICorePluginDownloads.OpenDownloadAsync), e.g. “export”.
PayloadJson
Section titled “PayloadJson”string? PayloadJson { get; init; }Its payload as JSON; the download checks it again with the caller’s rights.
long? Size { get; init; }The size in bytes when known before the download (an estimate is not a size: leave it null).
Fields
Section titled “Fields”Property
Section titled “Property”const string Property = "file"The property of the answer that holds the file.