Skip to content

ActionField

Record in Oadm.Sdk.Actions · Oadm.Sdk.dll

One setting of an action. ActionField.Key is the JSON property in the settings; ActionField.Label the form label. ActionField.OffEdge marks a setting that belongs to “When the rule turns off” (shown only for stateful rules).

public sealed record ActionField(string Key, string Label, ActionFieldType Type)

Guide: Event rules

Parameters

  • Key: The JSON property of the setting.
  • Label: The form label.
  • Type: The kind of input.
IReadOnlyList<string> Accept { get; init; }

File name endings a ActionFieldType.File field takes (“.cfg”); empty = any.

string? AlsoVisibleWhenKey { get; init; }

Also shown while this field has ActionField.AlsoVisibleWhenValue (SDK 0.12.0): either condition shows it.

string? AlsoVisibleWhenValue { get; init; }

One value, or several separated by “|”.

IReadOnlyList<ActionChoice> Choices { get; init; }

The choices of a ActionFieldType.Choice field.

bool ChoicesFromDevice { get; init; }

A ActionFieldType.DynamicChoice whose choices are read from one device the user picks (“Read from device”), e.g. the applications installed on a camera. Compliance checks only.

string? Default { get; init; }

Value of a new action (string, number or bool as JSON text, e.g. “5” or “true”); null = empty.

string? EmptyText { get; init; }

The error of a required field left empty; null = “Enter” and the label, for a label that does not read in a sentence.

ActionFieldFormat Format { get; init; }

What a ActionFieldType.Text field must hold, checked while the user types and on the server.

string? Hint { get; init; }

Help text below the input.

string Key { get; init; }

The JSON property of the setting.

string Label { get; init; }

The form label.

string? Language { get; init; }

Fixed language of a ActionFieldType.Code field: “json”, “xml”, “html”, “text”.

string? LanguageKey { get; init; }

The field whose value is the language of this ActionFieldType.Code field.

int Max { get; init; }

The largest value of a ActionFieldType.Number field.

int MaxLength { get; init; }

Longest text (Text, Multiline, Password).

int Min { get; init; }

The smallest value of a ActionFieldType.Number field.

bool OffEdge { get; init; }

The setting of the “When the rule turns off” part.

IReadOnlyList<string> RecipientTypes { get; init; }

The ids of the RecipientTypes a ActionFieldType.Recipient field takes.

bool Required { get; init; }

The rule cannot be saved without a value.

ActionFieldType Type { get; init; }

The kind of input.

string? VisibleWhenKey { get; init; }

Shown only while the Choice / Bool field ActionField.VisibleWhenKey has the value ActionField.VisibleWhenValue.

string? VisibleWhenValue { get; init; }

One value, or several separated by “|” (“basic|digest”).

static ActionField Bool(string key, string label, bool defaultValue = false)

A check box.

static ActionField Choice(string key, string label, IReadOnlyList<ActionChoice> choices, string? defaultValue = null)

A select with fixed choices.

static ActionField ClientCertificate(string key, string label, bool required = false)

A certificate with its key from PKI’s list; nothing chosen means no client certificate unless required.

static ActionField Code(string key, string label, string? languageKey = null, bool required = false)

A body in the code editor; languageKey names the field whose value is its language.

static ActionField DynamicChoice(string key, string label, bool required = true)

A select whose choices come from IActionPlugin.ListChoicesAsync while the rule is edited.

static ActionField File(string key, string label, IReadOnlyList<string> accept, int maxBytes, bool required = true)

A file of at most maxBytes bytes with one of the accept endings.

static ActionField KeyValues(string key, string label)

Name and value rows (headers, query parameters); read them with ActionInvocation.GetPairs.

static ActionField Multiline(string key, string label, bool required = false)

Several lines of text.

static ActionField Number(string key, string label, int min, int max, int defaultValue)

A whole number from min to max.

static ActionField Password(string key, string label, bool required = false)

A password: stored encrypted and never sent back to a client.

static ActionField Recipient(string key, string label, IReadOnlyList<string> typeIds)

A required select of the recipients of typeIds (SDK 0.11.0). Before a run the host merges the chosen recipient’s fields into the settings under their own keys, so ActionInvocation.Get reads them. One per action: the keys of a second recipient would replace those of the first.

static ActionField Text(string key, string label, bool required = false, string? defaultValue = null)

One line of text.

static ActionField TrustedCertificate(string key, string label)

A CA or imported certificate from PKI’s list; nothing chosen means the operating system’s trusted roots.