{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tomorrowlives-com/json-schema/tomorrowlives-com-job-status-schema.json",
  "title": "JobStatus",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tomorrowlives-com-openapi.json#/components/schemas/JobStatus",
  "type": "object",
  "properties": {
    "job": {
      "type": "string"
    },
    "verb": {
      "type": "string"
    },
    "units": {
      "type": "integer",
      "description": "The price while it waits or runs; once it ends, what it was charged"
    },
    "status": {
      "$ref": "#/$defs/JobState"
    },
    "queued": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "finished_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "retry_after_s": {
      "type": "integer",
      "description": "While queued or running: when to ask again"
    },
    "result": {
      "description": "Once ok: what the engine printed, as JSON"
    },
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "http_status": {
      "type": "integer",
      "description": "For refused or failed: the status an immediate call would have had"
    },
    "files_expire_at": {
      "type": "string",
      "format": "date-time"
    },
    "files": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/File"
      }
    }
  },
  "$defs": {
    "File": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "bytes": {
          "type": "integer"
        },
        "content_type": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "url_expires_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "JobState": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "ok",
        "refused",
        "failed",
        "cancelled",
        "expired"
      ]
    }
  }
}