{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yappy-biz/json-schema/yappy-biz-job-schema.json",
  "title": "Job",
  "description": "An asynchronous export. Poll until status is completed, then read result.url.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yappy-biz-openapi.json#/components/schemas/Job",
  "type": "object",
  "required": [
    "object",
    "id",
    "status",
    "resource",
    "poll_url"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "job",
      "description": "Type discriminator."
    },
    "id": {
      "type": "string",
      "description": "Job identifier."
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "completed",
        "failed"
      ],
      "description": "Where the job is now."
    },
    "resource": {
      "type": "string",
      "description": "What is being exported."
    },
    "format": {
      "type": "string",
      "description": "The artifact format."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When it was accepted."
    },
    "poll_url": {
      "type": "string",
      "format": "uri",
      "description": "Where to poll this job."
    },
    "retry_after": {
      "type": "integer",
      "description": "Seconds to wait before polling again."
    },
    "result": {
      "type": [
        "object",
        "null"
      ],
      "description": "Present once status is completed.",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The finished artifact."
        },
        "content_type": {
          "type": "string",
          "description": "Media type of the artifact."
        },
        "item_count": {
          "type": "integer",
          "description": "How many items it contains."
        }
      }
    },
    "error": {
      "type": [
        "object",
        "null"
      ],
      "description": "Present once status is failed."
    }
  }
}