{
    "title": "events",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.event.Events",
    "type": "object",
    "required": [
        "events",
        "deliveryDate"
    ],
    "properties": {
        "events": {
            "type": "array",
            "items": {
                "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"
                            ],
                            "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",
                                        "JOBRESOURCE",
                                        "SCHEDULE",
                                        "CALENDAR",
                                        "DAILYPLAN",
                                        "ORDERHISTORY",
                                        "TASKHISTORY",
                                        "FILETRANSFER",
                                        "MONITORINGNOTIFICATION",
                                        "MONITORINGCONTROLLER",
                                        "MONITORINGAGENT"
                                    ]
                                },
                                "workflow": {
                                    "javaType": "com.sos.controller.model.workflow.WorkflowId",
                                    "type": "object",
                                    "required": [
                                        "path"
                                    ],
                                    "properties": {
                                        "path": {
                                            "type": "string",
                                            "pattern": "^[^<>]*$",
                                            "maxLength": 255
                                        },
                                        "versionId": {
                                            "type": "string",
                                            "pattern": "^[^<>]*$",
                                            "maxLength": 255
                                        }
                                    },
                                    "additionalProperties": false
                                },
                                "accessToken": {
                                    "type": "string",
                                    "pattern": "^[1-9a-fA-F_]{32}$",
                                    "maxLength": 32,
                                    "minLength": 32
                                },
                                "message": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "deliveryDate": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    }
                }
            }
        },
        "deliveryDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        }
    }
}