{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Resource identifier returned by the operation."
    },
    "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."
    },
    "subject": {
      "type": "string",
      "enum": [
        "link",
        "target",
        "citation"
      ]
    },
    "observation_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "digest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "verified",
        "failed"
      ],
      "description": "Resource lifecycle status."
    },
    "attempts": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Provider send attempts recorded for this delivery."
    },
    "created_at": {
      "type": "string",
      "description": "UTC timestamp when the record was created."
    },
    "last_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "queryBase64": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1024
        },
        {
          "type": "null"
        }
      ]
    },
    "responseBase64": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 21848
        },
        {
          "type": "null"
        }
      ]
    },
    "verification": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "verified": {
              "type": "boolean",
              "const": true
            },
            "authority": {
              "type": "string",
              "const": "FreeTSA"
            },
            "method": {
              "type": "string",
              "const": "rfc3161-pinned-tsa"
            },
            "digest": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "anchored_at": {
              "type": "string"
            },
            "serial": {
              "type": "string"
            },
            "certificate_sha256": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "revocation_checked": {
              "type": "boolean",
              "const": false
            },
            "trust": {
              "type": "string"
            }
          },
          "required": [
            "verified",
            "authority",
            "method",
            "digest",
            "anchored_at",
            "serial",
            "certificate_sha256",
            "revocation_checked",
            "trust"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "workspace_id",
    "project_id",
    "subject",
    "observation_id",
    "digest",
    "status",
    "attempts",
    "created_at",
    "last_error",
    "queryBase64",
    "responseBase64",
    "verification"
  ],
  "additionalProperties": {}
}
