{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "description": "The rate (rated) settings",
    "markdownDescription": "The [rate](https://docs.halon.io/hsl/functions.html#core.rate) (`rated`) settings",
    "additionalProperties": false,
    "required": [
        "version"
    ],
    "properties": {
        "version": {
            "type": "string",
            "enum": [
                "10.1"
            ],
            "description": "The software version the configuration was created for"
        },
        "peers": {
            "type": "array",
            "description": "rated peers",
            "markdownDescription": "`rated` peers",
            "minItems": 1,
            "items": {
                "anyOf": [
                    {
                        "$ref": "#/definitions/ipv4"
                    },
                    {
                        "$ref": "#/definitions/ipv6"
                    },
                    {
                        "type": "string",
                        "description": "Hostname"
                    },
                    {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "address"
                        ],
                        "properties": {
                            "address": {
                                "type": "string",
                                "description": "Hostname"
                            },
                            "expand": {
                                "type": "boolean",
                                "default": false,
                                "description": "Add all IP addresses for the hostname as unique peers (If an IP address that is assigned to a local network interface is included it will be skipped)"
                            }
                        }
                    }
                ]
            }
        }
    },
    "definitions": {
        "ipv4": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|#.*|.*[*].*)$)(?:(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(\\.(?!$)|$)){4}$",
            "minLength": 7
        },
        "ipv6": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|#.*|.*[*].*)$)(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$",
            "minLength": 3
        }
    }
}