{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/modoboa/json-schema/modoboa-alarm-schema.json",
  "title": "Alarm",
  "description": "Serializer for Alarm related endpoints.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/modoboa-alarms-api-openapi.yml#/components/schemas/Alarm",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "domain": {
      "allOf": [
        {
          "$ref": "#/$defs/AlarmDomain"
        }
      ],
      "readOnly": true
    },
    "mailbox": {
      "allOf": [
        {
          "$ref": "#/$defs/AlarmMailbox"
        }
      ],
      "readOnly": true
    },
    "created": {
      "type": "string",
      "format": "date-time"
    },
    "closed": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/AlarmStatusEnum"
        }
      ],
      "minimum": -9223372036854775808,
      "maximum": 9223372036854775807
    },
    "title": {
      "type": "string"
    },
    "internal_name": {
      "type": "string",
      "maxLength": 120
    }
  },
  "required": [
    "domain",
    "id",
    "internal_name",
    "mailbox",
    "title"
  ],
  "$defs": {
    "AlarmDomain": {
      "type": "object",
      "description": "Minimal domain representation exposed through alarms.",
      "properties": {
        "pk": {
          "type": "integer",
          "readOnly": true,
          "title": "ID"
        },
        "name": {
          "type": "string",
          "description": "The domain name",
          "maxLength": 253
        }
      },
      "required": [
        "name",
        "pk"
      ]
    },
    "AlarmMailbox": {
      "type": "object",
      "description": "Minimal mailbox representation exposed through alarms.",
      "properties": {
        "pk": {
          "type": "integer",
          "readOnly": true,
          "title": "ID"
        },
        "address": {
          "type": "string",
          "description": "Mailbox address (without the @domain.tld part)",
          "maxLength": 252
        }
      },
      "required": [
        "address",
        "pk"
      ]
    },
    "AlarmStatusEnum": {
      "enum": [
        1,
        2
      ],
      "type": "integer",
      "description": "* `1` - Opened\n* `2` - Closed"
    }
  }
}