{
    "title": "Change connection request v1",
    "description": "Upgrades or downgrades connection",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "https://api.nextpertise.nl/schemas/broadband/change_connection_request_v1.json",
    "allOf": [
        {
            "type": "object",
            "properties": {
                "carrier": {
                    "title": "Product ID",
                    "description": "Identifies an individual product by numeric id.",
                    "type": "integer",
                    "minimum": 0
                },
                "circuit": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "circuit": {
                                "title": "Product ID",
                                "description": "Identifies an individual product by numeric id.",
                                "type": "integer",
                                "minimum": 0
                            },
                            "tags": {
                                "type": "array",
                                "items": {
                                    "type": "string",
                                    "pattern": "[a-zA-Z0-9\\/=:_-]+"
                                }
                            },
                            "vlan": {
                                "type": "integer"
                            },
                            "vci": {
                                "type": "integer"
                            },
                            "vpi": {
                                "type": "integer"
                            },
                            "nid": {
                                "title": "Broadband NID",
                                "description": "Carrier or circuit identification. To harmonize the way ordered broadband products are identified.",
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "pattern": "^[0-9]{4}[A-Z]{2}[0-9]{5}[0-9A-Z]{4}$"
                            }
                        },
                        "required": [
                            "circuit"
                        ]
                    }
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "[a-zA-Z0-9\\/=:_-]+"
                    }
                },
                "contact_name": {
                    "type": "string"
                },
                "contact_phonenumber": {
                    "title": "Telephone number",
                    "description": "Dutch national telephone number",
                    "type": [
                        "string",
                        "null"
                    ],
                    "pattern": "^0([1-7][0-9]|85|88)[0-9]{7}$"
                },
                "additional_contact_phonenumber": {
                    "title": "Telephone number",
                    "description": "Dutch national telephone number",
                    "type": [
                        "string",
                        "null"
                    ],
                    "pattern": "^0([1-7][0-9]|85|88)[0-9]{7}$"
                },
                "custwishdate": {
                    "title": "Optional date",
                    "description": "Optional date in international format YYYY-MM-DD",
                    "oneOf": [
                        {
                            "title": "Date",
                            "description": "Date in international format YYYY-MM-DD",
                            "type": [
                                "string",
                                "null"
                            ],
                            "pattern": "^[1-9][0-9]{3}-[01][0-9]-[0-3][0-9]$"
                        },
                        {
                            "type": [
                                "null",
                                "one of"
                            ]
                        }
                    ],
                    "type": "one of"
                },
                "nid": {
                    "title": "Broadband NID",
                    "description": "Carrier or circuit identification. To harmonize the way ordered broadband products are identified.",
                    "type": [
                        "string",
                        "null"
                    ],
                    "pattern": "^[0-9]{4}[A-Z]{2}[0-9]{5}[0-9A-Z]{4}$"
                }
            },
            "required": [
                "nid",
                "circuit",
                "contact_name",
                "contact_phonenumber"
            ]
        }
    ],
    "type": "all of"
}