{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/onclarity-com/json-schema/onclarity-com-src-cloud-functions-schemas-run-response-schema.json",
  "title": "RunResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/onclarity-com-cloud-functions-admin-api-openapi.yml#/components/schemas/src__cloud_functions__schemas__RunResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "function_id": {
      "type": "integer",
      "title": "Function Id"
    },
    "version": {
      "type": "integer",
      "title": "Version"
    },
    "trigger_type": {
      "$ref": "#/$defs/RunTrigger"
    },
    "mode": {
      "$ref": "#/$defs/src__cloud_functions__constants__RunMode"
    },
    "status": {
      "$ref": "#/$defs/src__cloud_functions__constants__RunStatus"
    },
    "input": {
      "additionalProperties": true,
      "type": "object",
      "title": "Input"
    },
    "output": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "title": "Output"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "log_tail": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Log Tail"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Started At"
    },
    "finished_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Finished At"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Duration Ms"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "scheduled_for": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Scheduled For",
      "description": "The schedule slot of a scheduled run."
    }
  },
  "type": "object",
  "required": [
    "id",
    "function_id",
    "version",
    "trigger_type",
    "mode",
    "status",
    "input",
    "output",
    "error",
    "log_tail",
    "started_at",
    "finished_at",
    "duration_ms",
    "created_at"
  ],
  "$defs": {
    "RunTrigger": {
      "type": "string",
      "enum": [
        "manual",
        "schedule",
        "http"
      ],
      "title": "RunTrigger"
    },
    "src__cloud_functions__constants__RunMode": {
      "type": "string",
      "enum": [
        "sync",
        "async"
      ],
      "title": "RunMode"
    },
    "src__cloud_functions__constants__RunStatus": {
      "type": "string",
      "enum": [
        "running",
        "succeeded",
        "failed",
        "timed_out"
      ],
      "title": "RunStatus"
    }
  }
}