{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "edgeDeploymentId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "deviceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "deviceName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
        },
        "flowId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "flowName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
        },
        "creationDate": {
            "type": "string",
            "format": "date-time"
        },
        "lastUpdated": {
            "type": "string",
            "format": "date-time"
        },
        "currentVersion": {
            "type": [
                "string",
                "null"
            ],
            "minLength": 1,
            "maxLength": 255
        },
        "desiredVersion": {
            "type": [
                "string",
                "null"
            ],
            "minLength": 1,
            "maxLength": 255
        },
        "logs": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "sourceType": {
                        "type": "string",
                        "enum": [
                            "flow",
                            "user",
                            "device",
                            "apiToken",
                            "notebook"
                        ]
                    },
                    "sourceId": {
                        "type": "string",
                        "pattern": "^[A-Fa-f\\d]{24}$"
                    },
                    "date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "changeType": {
                        "type": "string",
                        "enum": [
                            "current",
                            "desired"
                        ]
                    },
                    "newValue": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "maxLength": 255
                    },
                    "previousValue": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "maxLength": 255
                    },
                    "attemptedValue": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 1,
                        "maxLength": 255
                    },
                    "error": {
                        "type": "string"
                    }
                }
            }
        }
    }
}