{
    "$schema": "http://json-schema.org/draft-04/schema",
    "additionalProperties": false,
    "definitions": {
        "crudOutcome": {
            "additionalProperties": false,
            "properties": {
                "failed": {
                    "description": "how many objects in the set have so far been unsuccessfully [operation]",
                    "type": "integer"
                },
                "failureDetails": {
                    "items": {
                        "$ref": "#/definitions/failureDetail"
                    },
                    "type": "array"
                },
                "operation": {
                    "enum": [
                        "Created",
                        "Updated",
                        "Closed"
                    ]
                },
                "succeeded": {
                    "description": "how many objects in the set have so far been successfully [operation]",
                    "type": "integer"
                }
            },
            "required": [
                "operation",
                "succeeded",
                "failed"
            ],
            "type": "object"
        },
        "crudOutcomes": {
            "items": {
                "$ref": "#/definitions/crudOutcome"
            },
            "type": "array"
        },
        "failureDetail": {
            "additionalProperties": false,
            "description": "details of why a single object failed the crud operation (create or whatever)",
            "properties": {
                "code": {
                    "description": "A code, e.g. on a job or job ad, that uniquely identifies the object",
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            },
            "required": [
                "code",
                "message"
            ],
            "type": "object"
        }
    },
    "description": "the status of a previously launched upload",
    "properties": {
        "id": {
            "description": "id of the upload operation",
            "type": "integer"
        },
        "results": {
            "$ref": "#/definitions/crudOutcomes"
        },
        "started": {
            "_format": "date-time",
            "type": "string"
        },
        "status": {
            "enum": [
                "Queued",
                "Underway",
                "Complete",
                "Error"
            ]
        }
    },
    "required": [
        "id",
        "started",
        "status",
        "results"
    ],
    "type": "object"
}