{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/viridi-parente/main/json-schema/viridi-parente-customer-schema.json",
  "title": "Customer",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/viridi-parente-customer-controller-api-openapi.yml#/components/schemas/Customer",
  "properties": {
    "id": {
      "$ref": "#/$defs/CustomerId",
      "description": "JSON object with the customer Id. Specify this field to update the customer. Referencing non-existing customer Id will cause error. Omit this field to create new customer."
    },
    "createdTime": {
      "type": "integer",
      "format": "int64",
      "description": "Timestamp of the customer creation, in milliseconds",
      "readOnly": true
    },
    "country": {
      "type": "string",
      "description": "Country"
    },
    "state": {
      "type": "string",
      "description": "State"
    },
    "city": {
      "type": "string",
      "description": "City"
    },
    "address": {
      "type": "string",
      "description": "Address Line 1"
    },
    "address2": {
      "type": "string",
      "description": "Address Line 2"
    },
    "zip": {
      "type": "string",
      "description": "Zip code"
    },
    "phone": {
      "type": "string",
      "description": "Phone number"
    },
    "email": {
      "type": "string",
      "description": "Email"
    },
    "title": {
      "type": "string",
      "description": "Title of the customer"
    },
    "tenantId": {
      "$ref": "#/$defs/TenantId",
      "description": "JSON object with Tenant Id"
    },
    "name": {
      "type": "string",
      "description": "Name of the customer. Read-only, duplicated from title for backward compatibility",
      "readOnly": true
    },
    "additionalInfo": {
      "$ref": "#/$defs/JsonNode",
      "description": "Additional parameters of the device"
    }
  },
  "required": [
    "email",
    "title"
  ],
  "$defs": {
    "CustomerId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "description": "string",
          "enum": [
            "CUSTOMER"
          ]
        }
      },
      "required": [
        "entityType",
        "id"
      ]
    },
    "JsonNode": {
      "description": "A value representing the any type (object or primitive)"
    },
    "TenantId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "description": "string",
          "enum": [
            "TENANT"
          ]
        }
      },
      "required": [
        "entityType",
        "id"
      ]
    }
  }
}