{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "resource_type": {
      "type": "string",
      "enum": [
        "watch",
        "target",
        "project"
      ]
    },
    "resource_id": {
      "type": "string"
    },
    "project_id": {
      "type": "string",
      "description": "Project that owns this record."
    },
    "counts": {
      "type": "object",
      "properties": {
        "watches": {
          "type": "number"
        },
        "targets": {
          "type": "number"
        },
        "jobs": {
          "type": "number"
        },
        "target_jobs": {
          "type": "number"
        },
        "observations": {
          "type": "number"
        },
        "target_observations": {
          "type": "number"
        },
        "events": {
          "type": "number"
        },
        "target_events": {
          "type": "number"
        }
      },
      "additionalProperties": {}
    },
    "blockers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": {}
      }
    },
    "eligible": {
      "type": "boolean"
    },
    "confirmation": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "description": "Saved lifecycle or evidence state, as enumerated for this record."
    },
    "receipt": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Resource identifier returned by the operation."
            },
            "workspace_id": {
              "type": "string",
              "description": "Workspace that owns this record."
            },
            "project_id": {
              "type": "string",
              "description": "Project that owns this record."
            },
            "resource_type": {
              "type": "string",
              "enum": [
                "watch",
                "target",
                "project"
              ]
            },
            "resource_id": {
              "type": "string"
            },
            "requested_at": {
              "type": "string"
            },
            "requested_by": {
              "type": "string"
            },
            "state": {
              "type": "string",
              "enum": [
                "pending",
                "completed"
              ],
              "description": "Saved lifecycle or evidence state, as enumerated for this record."
            },
            "replayed": {
              "description": "True when the response reuses an earlier request with the same idempotency value.",
              "type": "boolean"
            }
          },
          "required": [
            "id",
            "workspace_id",
            "project_id",
            "resource_type",
            "resource_id",
            "requested_at",
            "requested_by",
            "state"
          ],
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "scope": {
      "type": "string"
    }
  },
  "required": [
    "resource_type",
    "resource_id",
    "project_id",
    "counts",
    "blockers",
    "eligible",
    "confirmation",
    "state",
    "receipt",
    "scope"
  ],
  "additionalProperties": {}
}
