{
    "title": "if",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.inventory.model.instruction.IfElse",
    "type": "object",
    "extends": {
        "javaType": "com.sos.inventory.model.instruction.CaseWhen",
        "type": "object",
        "required": [
            "cases"
        ],
        "extends": {
            "javaType": "com.sos.inventory.model.instruction.Instruction",
            "type": "object",
            "required": [
                "TYPE"
            ],
            "properties": {
                "TYPE": {
                    "javaType": "com.sos.inventory.model.instruction.InstructionType",
                    "type": "string",
                    "enum": [
                        "Execute.Named",
                        "If",
                        "Try",
                        "Fork",
                        "ForkList",
                        "Finish",
                        "Fail",
                        "Retry",
                        "Lock",
                        "Prompt",
                        "PostNotice",
                        "PostNotices",
                        "ExpectNotice",
                        "ExpectNotices",
                        "ConsumeNotices",
                        "ImplicitEnd",
                        "AddOrder",
                        "Cycle",
                        "StickySubagent",
                        "Options",
                        "Break",
                        "CaseWhen",
                        "Sleep"
                    ]
                },
                "position": {
                    "description": "Actually, each even item is a string, each odd item is an integer",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "string"
                            }
                        ]
                    }
                },
                "positionString": {
                    "type": "string",
                    "pattern": "^[^<>]*$",
                    "maxLength": 255
                },
                "label": {
                    "type": "string",
                    "pattern": "^[^<>]*$",
                    "maxLength": 255
                },
                "state": {
                    "javaType": "com.sos.inventory.model.instruction.InstructionState",
                    "type": "object",
                    "required": [
                        "severity",
                        "_text"
                    ],
                    "properties": {
                        "severity": {
                            "type": "integer"
                        },
                        "_text": {
                            "javaType": "com.sos.inventory.model.instruction.InstructionStateText",
                            "type": "string",
                            "enum": [
                                "SKIPPED",
                                "STOPPED",
                                "STOPPED_AND_SKIPPED"
                            ]
                        }
                    },
                    "additionalProperties": false
                }
            },
            "additionalProperties": false
        },
        "properties": {
            "cases": {
                "alias": "ifThens",
                "type": "array",
                "minItems": 1,
                "items": {
                    "javaType": "com.sos.inventory.model.instruction.When",
                    "type": "object",
                    "required": [
                        "predicate",
                        "then"
                    ],
                    "properties": {
                        "predicate": {
                            "type": "string",
                            "minLength": 1
                        },
                        "then": {
                            "type": "object",
                            "javaType": "com.sos.inventory.model.instruction.Instructions",
                            "required": [
                                "instructions"
                            ],
                            "properties": {
                                "instructions": {
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                        "javaType": "com.sos.inventory.model.instruction.Instruction",
                                        "type": "object",
                                        "required": [
                                            "TYPE"
                                        ],
                                        "properties": {
                                            "TYPE": {
                                                "javaType": "com.sos.inventory.model.instruction.InstructionType",
                                                "type": "string",
                                                "enum": [
                                                    "Execute.Named",
                                                    "If",
                                                    "Try",
                                                    "Fork",
                                                    "ForkList",
                                                    "Finish",
                                                    "Fail",
                                                    "Retry",
                                                    "Lock",
                                                    "Prompt",
                                                    "PostNotice",
                                                    "PostNotices",
                                                    "ExpectNotice",
                                                    "ExpectNotices",
                                                    "ConsumeNotices",
                                                    "ImplicitEnd",
                                                    "AddOrder",
                                                    "Cycle",
                                                    "StickySubagent",
                                                    "Options",
                                                    "Break",
                                                    "CaseWhen"
                                                ]
                                            },
                                            "position": {
                                                "description": "Actually, each even item is a string, each odd item is an integer",
                                                "type": "array",
                                                "minItems": 1,
                                                "items": {
                                                    "anyOf": [
                                                        {
                                                            "type": "integer"
                                                        },
                                                        {
                                                            "type": "string"
                                                        }
                                                    ]
                                                }
                                            },
                                            "positionString": {
                                                "type": "string",
                                                "pattern": "^[^<>]*$",
                                                "maxLength": 255
                                            },
                                            "label": {
                                                "type": "string",
                                                "pattern": "^[^<>]*$",
                                                "maxLength": 255
                                            },
                                            "state": {
                                                "javaType": "com.sos.inventory.model.instruction.InstructionState",
                                                "type": "object",
                                                "required": [
                                                    "severity",
                                                    "_text"
                                                ],
                                                "properties": {
                                                    "severity": {
                                                        "type": "integer"
                                                    },
                                                    "_text": {
                                                        "javaType": "com.sos.inventory.model.instruction.InstructionStateText",
                                                        "type": "string",
                                                        "enum": [
                                                            "SKIPPED",
                                                            "STOPPED",
                                                            "STOPPED_AND_SKIPPED"
                                                        ]
                                                    }
                                                },
                                                "additionalProperties": false
                                            }
                                        },
                                        "additionalProperties": false
                                    }
                                }
                            },
                            "additionalProperties": false
                        }
                    },
                    "additionalProperties": false
                }
            },
            "else": {
                "type": "object",
                "javaType": "com.sos.inventory.model.instruction.OptionalInstructions",
                "description": "only for the validation, not used as pojo",
                "required": [
                    "instructions"
                ],
                "properties": {
                    "instructions": {
                        "type": "array",
                        "items": {
                            "javaType": "com.sos.inventory.model.instruction.Instruction",
                            "type": "object",
                            "required": [
                                "TYPE"
                            ],
                            "properties": {
                                "TYPE": {
                                    "javaType": "com.sos.inventory.model.instruction.InstructionType",
                                    "type": "string",
                                    "enum": [
                                        "Execute.Named",
                                        "If",
                                        "Try",
                                        "Fork",
                                        "ForkList",
                                        "Finish",
                                        "Fail",
                                        "Retry",
                                        "Lock",
                                        "Prompt",
                                        "PostNotice",
                                        "PostNotices",
                                        "ExpectNotice",
                                        "ExpectNotices",
                                        "ConsumeNotices",
                                        "ImplicitEnd",
                                        "AddOrder",
                                        "Cycle",
                                        "StickySubagent",
                                        "Options",
                                        "Break",
                                        "CaseWhen",
                                        "Sleep"
                                    ]
                                },
                                "position": {
                                    "description": "Actually, each even item is a string, each odd item is an integer",
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                        "anyOf": [
                                            {
                                                "type": "integer"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ]
                                    }
                                },
                                "positionString": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                },
                                "label": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                },
                                "state": {
                                    "javaType": "com.sos.inventory.model.instruction.InstructionState",
                                    "type": "object",
                                    "required": [
                                        "severity",
                                        "_text"
                                    ],
                                    "properties": {
                                        "severity": {
                                            "type": "integer"
                                        },
                                        "_text": {
                                            "javaType": "com.sos.inventory.model.instruction.InstructionStateText",
                                            "type": "string",
                                            "enum": [
                                                "SKIPPED",
                                                "STOPPED",
                                                "STOPPED_AND_SKIPPED"
                                            ]
                                        }
                                    },
                                    "additionalProperties": false
                                }
                            },
                            "additionalProperties": false
                        }
                    }
                },
                "additionalProperties": false
            }
        },
        "additionalProperties": false
    },
    "required": [
        "predicate",
        "then"
    ],
    "description": "instruction with fixed property 'TYPE':'If'",
    "properties": {
        "predicate": {
            "type": "string",
            "minLength": 1
        },
        "then": {
            "type": "object",
            "javaType": "com.sos.inventory.model.instruction.Instructions",
            "required": [
                "instructions"
            ],
            "properties": {
                "instructions": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "javaType": "com.sos.inventory.model.instruction.Instruction",
                        "type": "object",
                        "required": [
                            "TYPE"
                        ],
                        "properties": {
                            "TYPE": {
                                "javaType": "com.sos.inventory.model.instruction.InstructionType",
                                "type": "string",
                                "enum": [
                                    "Execute.Named",
                                    "If",
                                    "Try",
                                    "Fork",
                                    "ForkList",
                                    "Finish",
                                    "Fail",
                                    "Retry",
                                    "Lock",
                                    "Prompt",
                                    "PostNotice",
                                    "PostNotices",
                                    "ExpectNotice",
                                    "ExpectNotices",
                                    "ConsumeNotices",
                                    "ImplicitEnd",
                                    "AddOrder",
                                    "Cycle",
                                    "StickySubagent",
                                    "Options",
                                    "Break",
                                    "CaseWhen",
                                    "Sleep"
                                ]
                            },
                            "position": {
                                "description": "Actually, each even item is a string, each odd item is an integer",
                                "type": "array",
                                "minItems": 1,
                                "items": {
                                    "anyOf": [
                                        {
                                            "type": "integer"
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            },
                            "positionString": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255
                            },
                            "label": {
                                "type": "string",
                                "pattern": "^[^<>]*$",
                                "maxLength": 255
                            },
                            "state": {
                                "javaType": "com.sos.inventory.model.instruction.InstructionState",
                                "type": "object",
                                "required": [
                                    "severity",
                                    "_text"
                                ],
                                "properties": {
                                    "severity": {
                                        "type": "integer"
                                    },
                                    "_text": {
                                        "javaType": "com.sos.inventory.model.instruction.InstructionStateText",
                                        "type": "string",
                                        "enum": [
                                            "SKIPPED",
                                            "STOPPED",
                                            "STOPPED_AND_SKIPPED"
                                        ]
                                    }
                                },
                                "additionalProperties": false
                            }
                        },
                        "additionalProperties": false
                    }
                }
            },
            "additionalProperties": false
        }
    },
    "additionalProperties": false
}