{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fantasypundit-lol/json-schema/fantasypundit-lol-commentary-job-schema.json",
  "title": "CommentaryJob",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fantasypundit-lol-openapi.json#/components/schemas/CommentaryJob",
  "type": "object",
  "required": [
    "id",
    "status",
    "progress",
    "leagueId"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "processing",
        "completed",
        "failed"
      ]
    },
    "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "leagueId": {
      "type": "string"
    },
    "gameweek": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 38
    },
    "deferredUntilFinal": {
      "type": "boolean"
    },
    "pollAfterSeconds": {
      "type": "integer",
      "minimum": 2
    },
    "commentary": {
      "description": "The complete published commentary when status is completed.",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true
    },
    "leagueUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "textShareUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "error": {
      "oneOf": [
        {
          "$ref": "#/$defs/Error"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "additionalProperties": true,
  "$defs": {
    "Error": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "retryAfterSeconds": {
          "type": "integer",
          "minimum": 1,
          "description": "Minimum whole seconds to wait before retrying the same write request."
        },
        "resetAt": {
          "type": "string",
          "format": "date-time",
          "description": "The earliest advertised time to retry the same write request."
        }
      },
      "additionalProperties": false
    }
  }
}