{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hubris-pw/json-schema/hubris-pw-video-job-schema.json",
  "title": "VideoJob",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hubris-pw-openapi.json#/components/schemas/VideoJob",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "in_progress",
        "completed",
        "failed"
      ]
    },
    "created": {
      "type": "integer",
      "description": "Время создания задачи, Unix-секунды."
    },
    "unsigned_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "Только при `completed`: адрес скачивания `GET /v1/videos/{id}/content?index=0`. Несмотря на имя, нужен тот же ключ."
    },
    "usage": {
      "type": "object",
      "properties": {
        "cost": {
          "type": "integer",
          "description": "При `completed`: итоговое списание, копейки."
        },
        "estimated_cost": {
          "type": "integer",
          "description": "Пока задача в работе: сумма, удержанная под задачу, копейки (верхняя оценка; если сверка прошла раньше готовности — уже списанная). После готовности приходит `cost`, разница возвращается на баланс."
        }
      }
    },
    "error": {
      "type": "string",
      "description": "Только при `failed`: нейтральный текст. Удержание возвращается целиком."
    }
  },
  "required": [
    "id",
    "status",
    "created"
  ]
}