{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "number",
      "const": 1
    },
    "identity": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$",
          "description": "Resource identifier returned by the operation."
        },
        "selection": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8192
        },
        "workspace_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Workspace that owns this record."
        },
        "project_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Project that owns this record."
        },
        "from": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "to": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "kinds": {
          "minItems": 1,
          "maxItems": 4,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "found",
              "back",
              "lost",
              "missing"
            ]
          }
        },
        "through_sequence": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "retention_floor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "issued_at": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "expires_at": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        }
      },
      "required": [
        "id",
        "selection",
        "workspace_id",
        "project_id",
        "from",
        "to",
        "kinds",
        "through_sequence",
        "retention_floor",
        "issued_at",
        "expires_at"
      ],
      "additionalProperties": false
    },
    "coverage": {
      "type": "object",
      "properties": {
        "basis": {
          "type": "string",
          "const": "retained_watch_transition_events"
        },
        "clock": {
          "type": "string",
          "const": "event_recorded_at"
        },
        "unit": {
          "type": "string",
          "const": "watch_transition_events"
        },
        "whole_web_coverage": {
          "type": "boolean",
          "const": false,
          "description": "False: these results do not measure the whole web."
        },
        "unique_physical_links": {
          "type": "boolean",
          "const": false
        },
        "includes_archived_watches": {
          "type": "boolean",
          "const": true
        },
        "scan_limited": {
          "type": "boolean",
          "const": false
        },
        "retained_selection_complete": {
          "type": "boolean",
          "const": true
        },
        "historical_completeness": {
          "type": "string",
          "enum": [
            "no_recorded_retention_gap",
            "retention_gap"
          ]
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "basis",
        "clock",
        "unit",
        "whole_web_coverage",
        "unique_physical_links",
        "includes_archived_watches",
        "scan_limited",
        "retained_selection_complete",
        "historical_completeness",
        "limitations"
      ],
      "additionalProperties": false,
      "description": "Dataset scope and completeness, including limits on what these results establish."
    },
    "total_records": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "items": {
      "maxItems": 200,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "sequence": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Project that owns this record."
          },
          "watch_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "event_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "recorded_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "found",
              "back",
              "lost",
              "missing"
            ]
          }
        },
        "required": [
          "event_id",
          "sequence",
          "project_id",
          "watch_id",
          "event_type",
          "recorded_at",
          "kind"
        ],
        "additionalProperties": false,
        "description": "Records in this bounded page."
      },
      "description": "Records in this bounded page."
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 8192,
          "description": "Opaque continuation for the same listing; null means no further page."
        },
        {
          "type": "null"
        }
      ],
      "description": "Opaque continuation for the same listing; null means no further page."
    },
    "has_more": {
      "type": "boolean",
      "description": "True when another page is available."
    },
    "format": {
      "type": "string",
      "enum": [
        "json",
        "csv"
      ]
    },
    "csv": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "schema_version",
    "identity",
    "coverage",
    "total_records",
    "items",
    "next_cursor",
    "has_more",
    "format",
    "csv"
  ],
  "additionalProperties": {}
}
