RuleDefinition
Class in Oadm.Sdk.Events · Oadm.Sdk.dll
An event rule as clients edit it (definition JSON of gRPC EventService).
public sealed class RuleDefinitionProperties
Section titled “Properties”Actions
Section titled “Actions”List<RuleAction> Actions { get; set; }The actions, run in order.
Conditions
Section titled “Conditions”List<RuleCondition> Conditions { get; set; }The conditions; the first is the trigger.
CooldownSeconds
Section titled “CooldownSeconds”int CooldownSeconds { get; set; }Per device: at least this long between two “turns on” (0..3600).
Enabled
Section titled “Enabled”bool Enabled { get; set; }Turned on.
Guid Id { get; set; }The rule id; empty for a new rule.
MaxRunsPerMinute
Section titled “MaxRunsPerMinute”int MaxRunsPerMinute { get; set; }For the whole rule: at most this many action runs per minute (1..1000).
string Name { get; set; }The rule name.
Methods
Section titled “Methods”RuleDefinition Clone()A copy.
FromJson
Section titled “FromJson”static RuleDefinition FromJson(string json)Throws JsonException for text that is not a rule.
ToJson
Section titled “ToJson”string ToJson()The rule as JSON.
Fields
Section titled “Fields”DefaultCooldownSeconds
Section titled “DefaultCooldownSeconds”const int DefaultCooldownSeconds = 10Default dead time per device.
DefaultMaxRunsPerMinute
Section titled “DefaultMaxRunsPerMinute”const int DefaultMaxRunsPerMinute = 60Default limit of action runs per minute.
static readonly JsonSerializerOptions JsonThe JSON format of rules (camelCase).
MaxActions
Section titled “MaxActions”const int MaxActions = 5Most actions per rule.
MaxConditions
Section titled “MaxConditions”const int MaxConditions = 10Most conditions per rule.
MaxNameLength
Section titled “MaxNameLength”const int MaxNameLength = 64Longest rule name.