{
    "title": "task in history collection",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.job.TaskHistoryItem",
    "type": "object",
    "required": [
        "surveyDate",
        "workflow",
        "job",
        "startTime",
        "position",
        "sequence",
        "retryCounter",
        "state",
        "criticality",
        "taskId",
        "agentUrl"
    ],
    "properties": {
        "surveyDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "controllerId": {
            "type": "string"
        },
        "job": {
            "type": "string"
        },
        "workflow": {
            "type": "string"
        },
        "orderId": {
            "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"
        },
        "sequence": {
            "type": "integer",
            "minimum": 0
        },
        "retryCounter": {
            "type": "integer",
            "minimum": 0
        },
        "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
        },
        "error": {
            "javaType": "com.sos.joc.model.common.Err",
            "type": "object",
            "required": [
                "code",
                "message"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "arguments": {
            "description": "a map for arbitrary key-value pairs",
            "javaType": "com.sos.inventory.model.common.Variables",
            "type": "object",
            "additionalProperties": true
        }
    }
}