{
    "additionalProperties": false,
    "definitions": {
        "healthMonitorType": {
            "oneOf": [
                {
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "minLength": 1,
                            "type": "string"
                        }
                    },
                    "required": [
                        "name"
                    ]
                },
                {
                    "additionalProperties": false,
                    "properties": {
                        "interval": {
                            "maximum": 86400,
                            "minimum": 1,
                            "type": "integer"
                        },
                        "name": {
                            "minLength": 1,
                            "type": "string"
                        },
                        "recv": {
                            "minLength": 1,
                            "type": "string"
                        },
                        "send": {
                            "minLength": 1,
                            "type": "string"
                        },
                        "timeout": {
                            "maximum": 86400,
                            "minimum": 1,
                            "type": "integer"
                        },
                        "type": {
                            "enum": [
                                "http",
                                "tcp"
                            ],
                            "type": "string"
                        }
                    },
                    "required": [
                        "name",
                        "type"
                    ]
                }
            ],
            "type": "object"
        },
        "policyType": {
            "minLength": 1,
            "type": "string"
        },
        "poolType": {
            "additionalProperties": false,
            "anyOf": [
                {
                    "required": [
                        "balance"
                    ]
                },
                {
                    "required": [
                        "healthMonitors"
                    ]
                }
            ],
            "properties": {
                "balance": {
                    "minLength": 1,
                    "type": "string"
                },
                "healthMonitors": {
                    "additionalItems": false,
                    "items": {
                        "$ref": "#/definitions/healthMonitorType"
                    },
                    "minItems": 1,
                    "type": "array"
                }
            },
            "type": "object"
        },
        "profileType": {
            "minLength": 1,
            "type": "string"
        },
        "sslProfileType": {
            "minLength": 1,
            "type": "string"
        },
        "virtualServerType": {
            "additionalProperties": false,
            "anyOf": [
                {
                    "required": [
                        "profiles"
                    ]
                },
                {
                    "required": [
                        "policies"
                    ]
                },
                {
                    "required": [
                        "sslProfiles"
                    ]
                }
            ],
            "properties": {
                "policies": {
                    "items": {
                        "$ref": "#/definitions/policyType"
                    },
                    "minItems": 1,
                    "type": "array"
                },
                "profiles": {
                    "items": {
                        "$ref": "#/definitions/profileType"
                    },
                    "minItems": 1,
                    "type": "array"
                },
                "sslProfiles": {
                    "items": {
                        "$ref": "#/definitions/sslProfileType"
                    },
                    "minItems": 1,
                    "type": "array"
                }
            },
            "type": "object"
        }
    },
    "properties": {
        "plans": {
            "items": {
                "additionalProperties": false,
                "anyOf": [
                    {
                        "required": [
                            "pool"
                        ]
                    },
                    {
                        "required": [
                            "virtualServer"
                        ]
                    }
                ],
                "properties": {
                    "description": {
                        "minLength": 1,
                        "type": "string"
                    },
                    "name": {
                        "minLength": 1,
                        "type": "string"
                    },
                    "pool": {
                        "$ref": "#/definitions/poolType"
                    },
                    "virtualServer": {
                        "$ref": "#/definitions/virtualServerType"
                    }
                },
                "required": [
                    "name",
                    "description"
                ]
            },
            "minItems": 1,
            "type": "array"
        }
    },
    "required": [
        "plans"
    ],
    "type": "object"
}