{
    "title": "event",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.event.Event",
    "type": "object",
    "required": [
        "eventId",
        "eventSnapshots",
        "deliveryDate"
    ],
    "properties": {
        "controllerId": {
            "type": "string",
            "pattern": "^[^/\\<>?:\"|*]*$",
            "maxLength": 100
        },
        "error": {
            "javaType": "com.sos.joc.model.common.Err",
            "type": "object",
            "required": [
                "code",
                "message"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "eventId": {
            "type": "number",
            "format": "utc-millisec",
            "minimum": 0
        },
        "eventSnapshots": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.event.EventSnapshot",
                "type": "object",
                "required": [
                    "eventType",
                    "objectType"
                ],
                "javaInterfaces": [
                    "com.sos.joc.model.common.IEventObject"
                ],
                "properties": {
                    "path": {
                        "description": "absolute path of an object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "eventId": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "eventType": {
                        "description": "e.g. JOCStateChanged, ControllerStateChanged, WorkflowStateChanged, JobStateChanged, InventoryUpdated",
                        "type": "string"
                    },
                    "objectType": {
                        "javaType": "com.sos.joc.model.event.EventType",
                        "type": "string",
                        "enum": [
                            "JOCCLUSTER",
                            "CONTROLLER",
                            "CONTROLLERCLUSTER",
                            "AGENT",
                            "PROBLEM",
                            "FOLDER",
                            "WORKFLOW",
                            "ORDER",
                            "LOCK",
                            "JOB",
                            "FILEORDERSOURCE",
                            "NOTICEBOARD",
                            "JOBCLASS",
                            "JOBTEMPLATE",
                            "JOBRESOURCE",
                            "SCHEDULE",
                            "INCLUDESCRIPT",
                            "CALENDAR",
                            "DAILYPLAN",
                            "ORDERHISTORY",
                            "TASKHISTORY",
                            "FILETRANSFER",
                            "MONITORINGNOTIFICATION",
                            "MONITORINGCONTROLLER",
                            "MONITORINGAGENT",
                            "AUDITLOG"
                        ]
                    },
                    "workflow": {
                        "javaType": "com.sos.controller.model.workflow.WorkflowId",
                        "type": "object",
                        "required": [
                            "path"
                        ],
                        "properties": {
                            "path": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255,
                                "minLength": 1
                            },
                            "versionId": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255
                            }
                        },
                        "additionalProperties": false
                    },
                    "accessToken": {
                        "type": "string",
                        "pattern": "^[1-9a-fA-F_]{32}$",
                        "maxLength": 32,
                        "minLength": 32
                    },
                    "message": {
                        "type": "string"
                    }
                },
                "additionalProperties": false
            }
        },
        "eventsFromMonitoring": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.event.EventMonitoring",
                "type": "object",
                "required": [
                    "level",
                    "category",
                    "subCategory",
                    "timestamp"
                ],
                "javaInterfaces": [
                    "com.sos.joc.model.common.IEventObject"
                ],
                "properties": {
                    "eventId": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "level": {
                        "javaType": "com.sos.monitoring.notification.NotificationType",
                        "type": "string",
                        "enum": [
                            "SUCCESS",
                            "ERROR",
                            "WARNING",
                            "RECOVERED",
                            "ACKNOWLEDGED"
                        ]
                    },
                    "category": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 100
                    },
                    "subCategory": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "request": {
                        "type": "string"
                    },
                    "timestamp": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "message": {
                        "type": "string"
                    }
                },
                "additionalProperties": false
            }
        },
        "deliveryDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        }
    },
    "additionalProperties": false
}