{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/passportcraft-com/json-schema/passportcraft-com-unit-reading-schema.json",
  "title": "UnitReading",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/passportcraft-com-openapi.json#/components/schemas/UnitReading",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "unit_reading"
    },
    "id": {
      "type": "string",
      "maxLength": 255
    },
    "name": {
      "type": "string",
      "maxLength": 255
    },
    "organization_id": {
      "type": "string",
      "maxLength": 255
    },
    "passport_id": {
      "type": "string",
      "maxLength": 255
    },
    "unit_id": {
      "type": "string",
      "maxLength": 255
    },
    "passport": {
      "type": "string",
      "maxLength": 255
    },
    "unit": {
      "type": "string",
      "maxLength": 255
    },
    "livemode": {
      "type": "boolean"
    },
    "field": {
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "object",
          "properties": {
            "value": {
              "type": "number"
            },
            "unit": {
              "type": "string"
            }
          },
          "required": [
            "value",
            "unit"
          ],
          "additionalProperties": {}
        }
      ]
    },
    "observed_on": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "source": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "measurement",
            "brand_statement"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "document_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ]
    },
    "recorded_by": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ]
    },
    "recorded_actor_type": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "user",
            "api_key"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "recorded_via": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "editor",
            "api"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "recorded_at": {
      "type": "string"
    },
    "legacy_import": {
      "type": "boolean"
    }
  },
  "required": [
    "object",
    "id",
    "name",
    "organization_id",
    "passport_id",
    "unit_id",
    "passport",
    "unit",
    "livemode",
    "field",
    "value",
    "observed_on",
    "source",
    "note",
    "document_id",
    "recorded_by",
    "recorded_actor_type",
    "recorded_via",
    "recorded_at",
    "legacy_import"
  ],
  "additionalProperties": {}
}