{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wavehouse-cloud/json-schema/wavehouse-cloud-udpexample-view-schema.json",
  "title": "UDPExampleView",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wavehouse-cloud-openapi.json#/components/schemas/UDPExampleView",
  "additionalProperties": false,
  "properties": {
    "ack_fields": {
      "description": "the downlink's layout, in order",
      "items": {
        "$ref": "#/$defs/UDPExampleFieldView"
      },
      "type": "array"
    },
    "acks": {
      "description": "one entry per status, in numeric order",
      "items": {
        "$ref": "#/$defs/UDPExampleAckView"
      },
      "type": "array"
    },
    "addresses": {
      "description": "the canonical static endpoint: anycast addresses, IPv4 and IPv6, that never change — hard-code one",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "content_encoding": {
      "type": "string"
    },
    "content_type": {
      "type": "string"
    },
    "datagram_hex": {
      "type": "string"
    },
    "datagram_len": {
      "description": "bytes on the wire; keep a real datagram under about 1200 so it is never fragmented",
      "format": "int64",
      "type": "integer"
    },
    "dedupe_window_seconds": {
      "description": "a byte-identical resend (same nonce, same bytes) within this many seconds is answered stored and stored once; a different payload under the same nonce is a new reading",
      "format": "int64",
      "type": "integer"
    },
    "device_id": {
      "type": "string"
    },
    "encoding_note": {
      "description": "present only when the device compresses: the sample payload stands in for compressed bytes",
      "type": "string"
    },
    "fields": {
      "description": "the uplink's layout, in order, covering every byte",
      "items": {
        "$ref": "#/$defs/UDPExampleFieldView"
      },
      "type": "array"
    },
    "hostname": {
      "description": "an optional DNS name for this deployment, when configured; addresses are the endpoint, not a fallback",
      "type": "string"
    },
    "nonce_hex": {
      "type": "string"
    },
    "nonce_len": {
      "format": "int64",
      "type": "integer"
    },
    "nonce_note": {
      "description": "what the sample nonce is, and what the device must send in its place",
      "type": "string"
    },
    "payload_hex": {
      "type": "string"
    },
    "payload_source": {
      "description": "table: one row of the device's table, built from its columns; otherwise a generic sample because the device has no table yet, the engine has no such table yet, or its schema could not be read",
      "enum": [
        "table",
        "no_table",
        "table_missing",
        "schema_unavailable"
      ],
      "type": "string"
    },
    "payload_text": {
      "description": "the sample payload as text — one NDJSON line, one JSON object, or one CSV row",
      "type": "string"
    },
    "port": {
      "format": "int64",
      "type": "integer"
    },
    "provisioned": {
      "description": "false when this deployment has no UDP listener; the example is still exact",
      "type": "boolean"
    },
    "sealed": {
      "description": "the payload is encrypted, so the datagram carries ciphertext where the payload would be",
      "type": "boolean"
    },
    "suite": {
      "type": "string"
    },
    "table": {
      "type": "string"
    },
    "tag_len": {
      "format": "int64",
      "type": "integer"
    },
    "timestamp_columns": {
      "description": "the sample's DateTime columns: each takes Unix seconds or an RFC 3339 string",
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "device_id",
    "suite",
    "nonce_len",
    "tag_len",
    "sealed",
    "table",
    "content_type",
    "provisioned",
    "addresses",
    "port",
    "payload_text",
    "payload_source",
    "timestamp_columns",
    "dedupe_window_seconds",
    "payload_hex",
    "nonce_hex",
    "nonce_note",
    "datagram_hex",
    "datagram_len",
    "fields",
    "ack_fields",
    "acks"
  ],
  "type": "object",
  "$defs": {
    "UDPExampleAckView": {
      "additionalProperties": false,
      "properties": {
        "hex": {
          "type": "string"
        },
        "name": {
          "description": "stored | throttled | disabled",
          "type": "string"
        },
        "status": {
          "description": "0 stored, 1 throttled (retry later), 2 disabled (stop)",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "status",
        "name",
        "hex"
      ],
      "type": "object"
    },
    "UDPExampleFieldView": {
      "additionalProperties": false,
      "properties": {
        "field": {
          "description": "device_id | nonce | payload | ciphertext | tag | status",
          "type": "string"
        },
        "hex": {
          "type": "string"
        },
        "length": {
          "format": "int64",
          "type": "integer"
        },
        "offset": {
          "description": "bytes from the start of the datagram",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "field",
        "offset",
        "length",
        "hex"
      ],
      "type": "object"
    }
  }
}