{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gxplex.com/api/v1/schema/timemap.json",
  "title": "Memento held for a tracked row document",
  "description": "The document served at /api/v1/timemap.json. Items are carried under `items`.",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://gxplex.com/api/v1/schema/envelope.json"
    }
  ],
  "properties": {
    "collection": {
      "const": "timemap"
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      },
      "description": "Every memento held for a tracked row this document carries."
    }
  },
  "required": [
    "items"
  ],
  "additionalProperties": true,
  "$defs": {
    "item": {
      "type": "object",
      "title": "Memento held for a tracked row",
      "description": "One third-party capture this record held on an observation of the row. Where display is withheld, the capture's address, target and instant are null and `display` states the basis; the archive host and the publisher host are published either way.",
      "properties": {
        "uri": {
          "type": [
            "string",
            "null"
          ],
          "description": "The archive's address for the capture. Null where display is withheld."
        },
        "archive_host": {
          "type": "string",
          "description": "The archive serving the capture."
        },
        "target_host": {
          "type": "string",
          "description": "The publisher host the capture is of."
        },
        "target": {
          "type": [
            "string",
            "null"
          ],
          "description": "The captured address. Null where display is withheld."
        },
        "datetime": {
          "type": [
            "string",
            "null"
          ],
          "description": "The archive's capture instant in the RFC 7089 form. Null where display is withheld."
        },
        "datetime_iso": {
          "type": [
            "string",
            "null"
          ],
          "description": "The same instant in ISO 8601. Null where display is withheld."
        },
        "display": {
          "type": "object",
          "description": "The display verdict for the capture and the filing it was decided on."
        },
        "recorded_first_day": {
          "type": "string",
          "format": "date",
          "description": "The first day this record held the capture on an observation of the row. Not a capture day."
        },
        "recorded_last_day": {
          "type": "string",
          "format": "date",
          "description": "The last such day."
        },
        "recorded_on_days": {
          "type": "integer",
          "description": "Distinct days this record held the capture."
        }
      },
      "required": [
        "uri",
        "archive_host",
        "target_host",
        "target",
        "datetime",
        "datetime_iso",
        "display",
        "recorded_first_day",
        "recorded_last_day",
        "recorded_on_days"
      ],
      "additionalProperties": true
    }
  }
}
