{
    "title": "agent schema for agents to transfer (ex-/import or converter for JobScheduler 1 objects)",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.agent.transfer.Agent",
    "type": "object",
    "oneOf": [
        {
            "required": [
                "agentCluster"
            ]
        },
        {
            "required": [
                "standaloneAgent"
            ]
        }
    ],
    "properties": {
        "agentCluster": {
            "javaType": "com.sos.joc.model.agent.ClusterAgent",
            "type": "object",
            "extends": {
                "javaType": "com.sos.joc.model.agent.Agent",
                "type": "object",
                "required": [
                    "agentId",
                    "agentName",
                    "url"
                ],
                "properties": {
                    "controllerId": {
                        "type": "string",
                        "pattern": "^[^/\\<>?:\"|*]*$",
                        "maxLength": 100
                    },
                    "agentId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "agentName": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "agentNameAliases": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                            "type": "string",
                            "pattern": "^[^<>]*$",
                            "maxLength": 255
                        }
                    },
                    "url": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "isClusterWatcher": {
                        "type": "boolean",
                        "default": false
                    },
                    "title": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "hidden": {
                        "type": "boolean",
                        "default": false
                    },
                    "disabled": {
                        "type": "boolean",
                        "default": false
                    },
                    "syncState": {
                        "javaType": "com.sos.controller.model.common.SyncState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.controller.model.common.SyncStateText",
                                "description": "SUSPENDED, OUTSTANDING only for Workflows",
                                "type": "string",
                                "enum": [
                                    "IN_SYNC",
                                    "NOT_IN_SYNC",
                                    "NOT_DEPLOYED",
                                    "SUSPENDED",
                                    "OUTSTANDING",
                                    "UNKNOWN"
                                ]
                            }
                        }
                    },
                    "deployed": {
                        "type": "boolean",
                        "default": false
                    },
                    "ordering": {
                        "type": "integer",
                        "minimum": 1
                    }
                },
                "additionalProperties": false
            },
            "required": [
                "agentId",
                "agentName",
                "subagents"
            ],
            "properties": {
                "subagents": {
                    "type": "array",
                    "items": {
                        "javaType": "com.sos.joc.model.agent.SubAgent",
                        "type": "object",
                        "required": [
                            "subagentId",
                            "url",
                            "isDirector"
                        ],
                        "properties": {
                            "agentId": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255,
                                "minLength": 1
                            },
                            "subagentId": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255,
                                "minLength": 1
                            },
                            "url": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255,
                                "minLength": 1
                            },
                            "isDirector": {
                                "javaType": "com.sos.joc.model.agent.SubagentDirectorType",
                                "type": "string",
                                "enum": [
                                    "NO_DIRECTOR",
                                    "PRIMARY_DIRECTOR",
                                    "SECONDARY_DIRECTOR"
                                ],
                                "default": "NO_DIRECTOR"
                            },
                            "title": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255
                            },
                            "syncState": {
                                "javaType": "com.sos.controller.model.common.SyncState",
                                "type": "object",
                                "required": [
                                    "severity",
                                    "_text"
                                ],
                                "properties": {
                                    "severity": {
                                        "type": "integer"
                                    },
                                    "_text": {
                                        "javaType": "com.sos.controller.model.common.SyncStateText",
                                        "description": "SUSPENDED, OUTSTANDING only for Workflows",
                                        "type": "string",
                                        "enum": [
                                            "IN_SYNC",
                                            "NOT_IN_SYNC",
                                            "NOT_DEPLOYED",
                                            "SUSPENDED",
                                            "OUTSTANDING",
                                            "UNKNOWN"
                                        ]
                                    }
                                }
                            },
                            "disabled": {
                                "type": "boolean",
                                "default": false
                            },
                            "deployed": {
                                "type": "boolean",
                                "default": false
                            },
                            "isClusterWatcher": {
                                "type": "boolean",
                                "default": false
                            },
                            "withGenerateSubagentCluster": {
                                "type": "boolean",
                                "default": false
                            },
                            "ordering": {
                                "alias": "position",
                                "type": "integer",
                                "minimum": 1
                            }
                        },
                        "additionalProperties": false
                    }
                }
            },
            "additionalProperties": false
        },
        "subagentClusters": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.agent.SubagentCluster",
                "type": "object",
                "required": [
                    "agentId",
                    "subagentClusterId",
                    "subagentIds"
                ],
                "properties": {
                    "controllerId": {
                        "type": "string",
                        "pattern": "^[^/\\<>?:\"|*]*$",
                        "maxLength": 100
                    },
                    "agentId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "subagentClusterId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "title": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "deployed": {
                        "type": "boolean",
                        "default": false
                    },
                    "syncState": {
                        "javaType": "com.sos.controller.model.common.SyncState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.controller.model.common.SyncStateText",
                                "description": "SUSPENDED, OUTSTANDING only for Workflows",
                                "type": "string",
                                "enum": [
                                    "IN_SYNC",
                                    "NOT_IN_SYNC",
                                    "NOT_DEPLOYED",
                                    "SUSPENDED",
                                    "OUTSTANDING",
                                    "UNKNOWN"
                                ]
                            }
                        }
                    },
                    "ordering": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "subagentIds": {
                        "type": "array",
                        "items": {
                            "javaType": "com.sos.joc.model.agent.SubAgentId",
                            "type": "object",
                            "required": [
                                "subagentId",
                                "priority"
                            ],
                            "properties": {
                                "subagentId": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255,
                                    "minLength": 1
                                },
                                "priority": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 1024
                                }
                            },
                            "additionalProperties": false
                        }
                    }
                },
                "additionalProperties": false
            }
        },
        "standaloneAgent": {
            "javaType": "com.sos.joc.model.agent.Agent",
            "type": "object",
            "required": [
                "agentId",
                "agentName",
                "url"
            ],
            "properties": {
                "controllerId": {
                    "type": "string",
                    "pattern": "^[^/\\<>?:\"|*]*$",
                    "maxLength": 100
                },
                "agentId": {
                    "type": "string",
                    "pattern": "^[^<>]*$",
                    "maxLength": 255,
                    "minLength": 1
                },
                "agentName": {
                    "type": "string",
                    "pattern": "^[^<>]*$",
                    "maxLength": 255,
                    "minLength": 1
                },
                "agentNameAliases": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    }
                },
                "url": {
                    "type": "string",
                    "pattern": "^[^<>]*$",
                    "maxLength": 255,
                    "minLength": 1
                },
                "isClusterWatcher": {
                    "type": "boolean",
                    "default": false
                },
                "title": {
                    "type": "string",
                    "pattern": "^[^<>]*$",
                    "maxLength": 255
                },
                "hidden": {
                    "type": "boolean",
                    "default": false
                },
                "disabled": {
                    "type": "boolean",
                    "default": false
                },
                "syncState": {
                    "javaType": "com.sos.controller.model.common.SyncState",
                    "type": "object",
                    "required": [
                        "severity",
                        "_text"
                    ],
                    "properties": {
                        "severity": {
                            "type": "integer"
                        },
                        "_text": {
                            "javaType": "com.sos.controller.model.common.SyncStateText",
                            "description": "SUSPENDED, OUTSTANDING only for Workflows",
                            "type": "string",
                            "enum": [
                                "IN_SYNC",
                                "NOT_IN_SYNC",
                                "NOT_DEPLOYED",
                                "SUSPENDED",
                                "OUTSTANDING",
                                "UNKNOWN"
                            ]
                        }
                    }
                },
                "deployed": {
                    "type": "boolean",
                    "default": false
                },
                "ordering": {
                    "type": "integer",
                    "minimum": 1
                }
            },
            "additionalProperties": false
        }
    }
}