{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wavehouse-cloud/json-schema/wavehouse-cloud-udpdevice-read-view-schema.json",
  "title": "UDPDeviceReadView",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wavehouse-cloud-openapi.json#/components/schemas/UDPDeviceReadView",
  "additionalProperties": false,
  "properties": {
    "bytes_per_second": {
      "description": "bytes per second the edge accepts; 0 is unlimited",
      "format": "int64",
      "type": "integer"
    },
    "content_encoding": {
      "description": "gzip or zstd when the device compresses; empty otherwise",
      "enum": [
        "",
        "gzip",
        "zstd"
      ],
      "type": "string"
    },
    "content_type": {
      "description": "the media type the payload is posted to the engine under",
      "type": "string"
    },
    "created_at": {
      "format": "date-time",
      "type": "string"
    },
    "created_by": {
      "type": "string"
    },
    "enabled": {
      "type": "boolean"
    },
    "expires_at": {
      "description": "absent when the device does not expire",
      "format": "date-time",
      "type": "string"
    },
    "health": {
      "description": "the device's one status, decided from the fields above at the response's time (worst first: failing, offline, late, waiting, receiving, paused, expired, revoked); null for an active device while its traffic cannot be read",
      "enum": [
        "failing",
        "offline",
        "late",
        "waiting",
        "receiving",
        "paused",
        "expired",
        "revoked",
        null
      ],
      "type": [
        "string",
        "null"
      ]
    },
    "health_since": {
      "description": "when the device took its health: revoked_at, expires_at, last_stored_at + late_after_seconds or offline_after_seconds, the first failure after last_stored_at (to the minute), or created_at while waiting; null where that is not known (receiving, paused, or a start older than the 35 days read)",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "description": "16 hex characters — the 8 bytes that lead every datagram",
      "type": "string"
    },
    "last_failed_at": {
      "description": "the edge's time for the newest datagram from this device refused for a problem: an edge outcome but stored, duplicate, throttled, disabled, or a worker outcome but stored; null with none in the last 35 days, or while that history cannot be read",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "last_seen_at": {
      "description": "batched: it trails live traffic by up to a minute",
      "format": "date-time",
      "type": "string"
    },
    "last_stored_at": {
      "description": "the edge's time for the newest datagram from this device the worker stored; null with none in the last 35 days, or while that history cannot be read",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "late_after_seconds": {
      "description": "the device is late once now − last_stored_at exceeds this: 3 × usual_gap_seconds, never under 600; null when it never is (no usual gap, or not active)",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "name": {
      "type": "string"
    },
    "nonce_len": {
      "enum": [
        0,
        4,
        8,
        12,
        16,
        24
      ],
      "format": "int64",
      "type": "integer"
    },
    "offline_after_seconds": {
      "description": "the device is offline once now − last_stored_at exceeds this: 10 × usual_gap_seconds, never under 3600; null when it never is (no usual gap, or not active)",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "project_id": {
      "description": "the project the device sends to",
      "pattern": "^[6789bcdfghjkmnpqrtwz]{20}$",
      "type": "string"
    },
    "rate_per_second": {
      "description": "datagrams per second the edge accepts; 0 is unlimited",
      "format": "double",
      "type": "number"
    },
    "revoked_at": {
      "description": "present once revoked",
      "format": "date-time",
      "type": "string"
    },
    "status": {
      "description": "active | disabled | revoked | expired",
      "type": "string"
    },
    "suite": {
      "enum": [
        "none",
        "hmac-sha1-96",
        "aes128-cbc-hmac-sha1-96",
        "hmac-sha256-128",
        "aes128-gcm",
        "aes256-gcm",
        "chacha20-poly1305",
        "xchacha20-poly1305"
      ],
      "type": "string"
    },
    "table": {
      "description": "empty until set with update-udp-device; until then the edge drops the device's datagrams unanswered",
      "type": "string"
    },
    "usual_gap_seconds": {
      "description": "the median gap, in seconds, between the minutes this device's datagrams were stored in over the 7 days up to last_stored_at; null with fewer than 3 gaps, or while that history cannot be read",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    }
  },
  "required": [
    "last_stored_at",
    "last_failed_at",
    "usual_gap_seconds",
    "late_after_seconds",
    "offline_after_seconds",
    "health",
    "health_since",
    "id",
    "project_id",
    "name",
    "suite",
    "nonce_len",
    "content_type",
    "table",
    "rate_per_second",
    "bytes_per_second",
    "enabled",
    "status",
    "created_at"
  ],
  "type": "object"
}