{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "definitions": {
        "data": {
            "media": {
                "binaryEncoding": "base64"
            },
            "type": "string"
        },
        "fileName": {
            "type": "string"
        },
        "mediaType": {
            "description": "keep in synch with the trait document_asStream",
            "enum": [
                "application/pdf",
                "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                "application/msword",
                "application/rtf",
                "text/plain",
                "image/png",
                "image/jpeg",
                "image/gif",
                "text/html",
                "audio/x-mpeg-3",
                "video/x-msvideo",
                "video/mp4"
            ]
        },
        "via": {
            "description": "the mechanism via which the file was uploaded - either 'device' or the fqdn of a cloud storage platform (e.g. dropbox.com)",
            "type": "string"
        }
    },
    "description": "details for a previously uploaded file",
    "properties": {
        "dateUploaded": {
            "_format": "date-time",
            "description": "the date and time the file was uploaded",
            "type": "string"
        },
        "fileName": {
            "$ref": "#/definitions/fileName"
        },
        "md5": {
            "description": "hash of the file's binary content",
            "type": "string"
        },
        "mediaType": {
            "$ref": "#/definitions/mediaType"
        },
        "preSignedUri": {
            "_format": "uri",
            "description": "pre-signed link as per http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html to access the raw data. Includes file name as the trailing component so that browsers name the download correctly.",
            "type": "string"
        },
        "size": {
            "type": "integer"
        },
        "via": {
            "$ref": "#/definitions/via"
        }
    },
    "required": [
        "fileName",
        "size",
        "mediaType",
        "preSignedUri"
    ],
    "type": "object"
}