Skip to content

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).
string ContentType { get; init; }

The media type, e.g. “application/pdf”, “text/csv”, “application/x-pem-file”.

string FileName { get; init; }

The file name the caller is told (no folder); the download’s own name wins when the file is fetched.

string Method { get; init; }

The download method (ICorePluginDownloads.OpenDownloadAsync), e.g. “export”.

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).

const string Property = "file"

The property of the answer that holds the file.