{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alto-vebra/json-schema/alto-vebra-client-data-item-collection-schema.json",
  "title": "ClientDataItemCollection",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alto-vebra-clients-api-openapi.yml#/components/schemas/ClientDataItemCollection",
  "type": "object",
  "properties": {
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ClientData"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "subDwelling": {
          "type": [
            "string",
            "null"
          ]
        },
        "nameNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "street": {
          "type": [
            "string",
            "null"
          ]
        },
        "locality": {
          "type": [
            "string",
            "null"
          ]
        },
        "town": {
          "type": [
            "string",
            "null"
          ]
        },
        "county": {
          "type": [
            "string",
            "null"
          ]
        },
        "postcode": {
          "type": [
            "string",
            "null"
          ]
        },
        "countryCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "uprn": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "ClientData": {
      "type": "object",
      "properties": {
        "contactId": {
          "type": "integer",
          "format": "int32"
        },
        "groupId": {
          "type": "integer",
          "format": "int32"
        },
        "branchId": {
          "type": "integer",
          "format": "int32"
        },
        "people": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Person"
          }
        },
        "address": {
          "allOf": [
            {
              "$ref": "#/$defs/Address"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "EmailAddress": {
      "type": "object",
      "properties": {
        "preferenceOrder": {
          "type": "integer",
          "format": "int32"
        },
        "address": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "Name": {
      "type": "object",
      "properties": {
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "forename": {
          "type": [
            "string",
            "null"
          ]
        },
        "surname": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "Person": {
      "type": "object",
      "properties": {
        "personNo": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "allOf": [
            {
              "$ref": "#/$defs/Name"
            }
          ]
        },
        "phoneNumbers": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Phone"
          }
        },
        "emailAddresses": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/EmailAddress"
          }
        }
      },
      "additionalProperties": false
    },
    "Phone": {
      "type": "object",
      "properties": {
        "preferenceOrder": {
          "type": "integer",
          "format": "int32"
        },
        "type": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "number": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    }
  }
}