{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "items": {
            "type": "array",
            "items": {
                "title": "Edge Deployment",
                "description": "Schema for a single deployment of an edge workflow to an edge device",
                "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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "count": {
            "type": "integer"
        },
        "totalCount": {
            "type": "integer"
        },
        "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "deviceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "flowId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
        }
    }
}