{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "definitions": {
        "sourceType": {
            "type": "string",
            "enum": [
                "flow",
                "user",
                "device"
            ]
        },
        "level": {
            "type": "string",
            "enum": [
                "info",
                "warning",
                "error",
                "critical"
            ]
        },
        "state": {
            "type": "string",
            "enum": [
                "new",
                "acknowledged",
                "resolved"
            ]
        },
        "subject": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
        },
        "message": {
            "type": "string"
        }
    },
    "properties": {
        "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "eventId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "creationDate": {
            "type": "string",
            "format": "date-time"
        },
        "lastUpdated": {
            "type": "string",
            "format": "date-time"
        },
        "sourceType": {
            "$ref": "#/definitions/sourceType"
        },
        "sourceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "level": {
            "$ref": "#/definitions/level"
        },
        "state": {
            "$ref": "#/definitions/state"
        },
        "subject": {
            "$ref": "#/definitions/subject"
        },
        "message": {
            "$ref": "#/definitions/message"
        }
    }
}