{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hupe1980.github.io/flexpool/schemas/events/v1/de.flexpool.alarm.raised.json",
  "title": "de.flexpool.alarm.raised",
  "description": "The `data` of `de.flexpool.alarm.raised`: an alarm was raised: its condition holds. It names a pool, a connection or an asset by id, never a person; an alarm about one unit in a home is still sent as `confidential`, GDPR, `standard` (envelope attributes). Subject and partition key: the alarm id.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "alarm",
    "priority",
    "title",
    "action",
    "respond_minutes",
    "since",
    "affected"
  ],
  "properties": {
    "alarm": {
      "description": "`<rule>/<subject>`, such as `alarm.asset-offline/bess-kiel-1`.",
      "type": "string",
      "pattern": "^alarm\\.[a-z0-9-]+/\\S*$",
      "maxLength": 256
    },
    "priority": {
      "description": "1 (act now) to 3.",
      "type": "integer",
      "minimum": 1,
      "maximum": 3
    },
    "title": {
      "description": "What is wrong, in German and English.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "de",
        "en"
      ],
      "properties": {
        "de": {
          "type": "string",
          "minLength": 1
        },
        "en": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "action": {
      "description": "What to do, in German and English.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "de",
        "en"
      ],
      "properties": {
        "de": {
          "type": "string",
          "minLength": 1
        },
        "en": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "respond_minutes": {
      "description": "Within how many minutes a person should respond.",
      "type": "integer",
      "minimum": 0
    },
    "since": {
      "description": "When the condition began, UTC.",
      "type": "string",
      "format": "date-time",
      "pattern": "Z$"
    },
    "affected": {
      "description": "How many assets the alarm covers.",
      "type": "integer",
      "minimum": 0
    },
    "link": {
      "description": "The alarm in the operator desk, when the desk's URL is configured.",
      "type": "string",
      "format": "uri"
    }
  }
}
