{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-benchmark-ingestion-operation-page-schema.json",
  "title": "BenchmarkIngestionOperationPage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-benchmark-ingestion-api-openapi.yml#/components/schemas/BenchmarkIngestionOperationPage",
  "properties": {
    "items": {
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/BenchmarkIngestionTaskResult"
          },
          {
            "$ref": "#/$defs/BenchmarkIngestionRuntimeResult"
          },
          {
            "$ref": "#/$defs/BenchmarkIngestionFailure"
          }
        ]
      },
      "type": "array",
      "title": "Items"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Cursor"
    }
  },
  "type": "object",
  "required": [
    "items",
    "next_cursor"
  ],
  "$defs": {
    "BenchmarkIngestionFailure": {
      "properties": {
        "stage": {
          "type": "string",
          "enum": [
            "verifying",
            "registering",
            "building"
          ],
          "title": "Stage"
        },
        "resource_type": {
          "type": "string",
          "enum": [
            "submission",
            "upload",
            "task",
            "runtime"
          ],
          "title": "Resource Type"
        },
        "resource_id": {
          "type": "string",
          "title": "Resource Id"
        },
        "code": {
          "type": "string",
          "title": "Code"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "retryable": {
          "type": "boolean",
          "title": "Retryable"
        },
        "provider_status_code": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 599.0,
              "minimum": 100.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider Status Code"
        },
        "affected_tasks_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Affected Tasks Cursor"
        },
        "resolved": {
          "type": "boolean",
          "title": "Resolved",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "stage",
        "resource_type",
        "resource_id",
        "code",
        "message",
        "retryable"
      ],
      "title": "BenchmarkIngestionFailure"
    },
    "BenchmarkIngestionRuntimeResult": {
      "properties": {
        "runtime_id": {
          "type": "string",
          "title": "Runtime Id"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "building",
            "ready",
            "failed"
          ],
          "title": "Status"
        },
        "provider_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider Ref"
        }
      },
      "type": "object",
      "required": [
        "runtime_id",
        "status"
      ],
      "title": "BenchmarkIngestionRuntimeResult"
    },
    "BenchmarkIngestionTaskResult": {
      "properties": {
        "task_id": {
          "type": "string",
          "title": "Task Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "runtime_id": {
          "type": "string",
          "title": "Runtime Id"
        },
        "action": {
          "type": "string",
          "enum": [
            "added",
            "updated",
            "skipped"
          ],
          "title": "Action"
        }
      },
      "type": "object",
      "required": [
        "task_id",
        "name",
        "runtime_id",
        "action"
      ],
      "title": "BenchmarkIngestionTaskResult"
    }
  }
}