{
    "title": "monitoring collection of notifications",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "",
    "javaType": "com.sos.joc.model.monitoring.NotificationsAnswer",
    "type": "object",
    "required": [
        "deliveryDate",
        "notifications"
    ],
    "properties": {
        "deliveryDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "notifications": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.monitoring.NotificationItem",
                "type": "object",
                "required": [
                    "notificationId",
                    "type",
                    "hasMonitors",
                    "created",
                    "controllerId",
                    "orderId",
                    "workflow"
                ],
                "properties": {
                    "notificationId": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "recoveredNotificationId": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "type": {
                        "javaType": "com.sos.joc.model.common.MonitoringNotificationTypeText",
                        "type": "string",
                        "enum": [
                            "SUCCESS",
                            "ERROR",
                            "WARNING",
                            "RECOVERED",
                            "ACKNOWLEDGED"
                        ]
                    },
                    "created": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "hasMonitors": {
                        "type": "boolean"
                    },
                    "controllerId": {
                        "type": "string"
                    },
                    "orderId": {
                        "type": "string"
                    },
                    "workflow": {
                        "description": "absolute path of an object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "message": {
                        "type": "string"
                    },
                    "job": {
                        "javaType": "com.sos.joc.model.monitoring.NotificationItemJobItem",
                        "type": "object",
                        "required": [
                            "job",
                            "startTime",
                            "position",
                            "state",
                            "criticality",
                            "taskId",
                            "agentUrl"
                        ],
                        "properties": {
                            "job": {
                                "type": "string"
                            },
                            "startTime": {
                                "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                "type": "string",
                                "format": "date-time"
                            },
                            "endTime": {
                                "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                "type": "string",
                                "format": "date-time"
                            },
                            "position": {
                                "type": "string"
                            },
                            "state": {
                                "javaType": "com.sos.joc.model.common.HistoryState",
                                "type": "object",
                                "required": [
                                    "severity",
                                    "_text"
                                ],
                                "properties": {
                                    "severity": {
                                        "description": "0=successful, 1=incomplete, 2=failed with a green/yellow/red representation",
                                        "type": "integer"
                                    },
                                    "_text": {
                                        "javaType": "com.sos.joc.model.common.HistoryStateText",
                                        "type": "string",
                                        "enum": [
                                            "SUCCESSFUL",
                                            "INCOMPLETE",
                                            "FAILED"
                                        ]
                                    }
                                }
                            },
                            "criticality": {
                                "type": "string"
                            },
                            "taskId": {
                                "type": "number",
                                "format": "utc-millisec",
                                "minimum": 0
                            },
                            "agentUrl": {
                                "type": "string"
                            },
                            "exitCode": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    },
                    "acknowledgement": {
                        "javaType": "com.sos.joc.model.monitoring.NotificationItemAcknowledgementItem",
                        "type": "object",
                        "required": [
                            "account",
                            "created"
                        ],
                        "properties": {
                            "account": {
                                "type": "string"
                            },
                            "comment": {
                                "type": "string"
                            },
                            "created": {
                                "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                "type": "string",
                                "format": "date-time"
                            }
                        }
                    }
                }
            }
        }
    }
}