{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/linkbreakers-com/json-schema/linkbreakers-com-job-schema.json",
  "title": "Job",
  "description": "A long-running operation.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/linkbreakers-com-jobs-api-openapi.yml#/components/schemas/Job",
  "properties": {
    "completedAt": {
      "description": "When the job finished, once it has.",
      "format": "date-time",
      "type": "string"
    },
    "createdAt": {
      "description": "When the job was accepted.",
      "format": "date-time",
      "type": "string"
    },
    "error": {
      "$ref": "#/$defs/JobError",
      "description": "Set when status is JOB_STATUS_FAILED."
    },
    "id": {
      "description": "Job ID (UUID).",
      "type": "string"
    },
    "itemCount": {
      "description": "How many items the job was submitted with.",
      "format": "int32",
      "type": "integer"
    },
    "linksBulkCreate": {
      "$ref": "#/$defs/LinksBulkCreateResult",
      "description": "Set when a JOB_TYPE_LINKS_BULK_CREATE job succeeded."
    },
    "status": {
      "description": "Where a job stands.\n\n - JOB_STATUS_UNSPECIFIED: Not set.\n - JOB_STATUS_PENDING: Accepted and waiting to run.\n - JOB_STATUS_RUNNING: Running now.\n - JOB_STATUS_SUCCEEDED: Finished; the result is set.\n - JOB_STATUS_FAILED: Finished without doing its work; error says why. Nothing was created.",
      "enum": [
        "JOB_STATUS_UNSPECIFIED",
        "JOB_STATUS_PENDING",
        "JOB_STATUS_RUNNING",
        "JOB_STATUS_SUCCEEDED",
        "JOB_STATUS_FAILED"
      ]
    },
    "statusUrl": {
      "description": "Path to poll for this job's status.",
      "type": "string"
    },
    "type": {
      "description": "What a job does.\n\n - JOB_TYPE_UNSPECIFIED: Not set.\n - JOB_TYPE_LINKS_BULK_CREATE: Creates a batch of links (POST /v1/links/bulk/jobs).",
      "enum": [
        "JOB_TYPE_UNSPECIFIED",
        "JOB_TYPE_LINKS_BULK_CREATE"
      ]
    }
  },
  "type": "object",
  "$defs": {
    "JobError": {
      "description": "Why a job failed.",
      "properties": {
        "codeType": {
          "description": "Stable error code, the same codeType a synchronous call would return.",
          "type": "string"
        },
        "message": {
          "description": "Human-readable explanation.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "LinksBulkCreateResult": {
      "description": "Result of a JOB_TYPE_LINKS_BULK_CREATE job.",
      "properties": {
        "linkIds": {
          "description": "IDs of the created links, in the order they were submitted. Fetch each\nwith GET /v1/links/{id}.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  }
}