{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emporix/json-schema/emporix-index-job-schema.json",
  "title": "IndexJob",
  "description": "One index build or deletion job.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-index-jobs-api-openapi.yml#/components/schemas/IndexJob",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Job id."
    },
    "status": {
      "type": "string",
      "description": "Current state of the job.",
      "enum": [
        "in_progress",
        "success",
        "failure"
      ]
    },
    "type": {
      "type": "string",
      "description": "Kind of index change.",
      "enum": [
        "create_index",
        "update_index",
        "delete_index"
      ]
    },
    "indexId": {
      "type": "string",
      "description": "Index id."
    },
    "message": {
      "type": "string",
      "description": "Text recorded when the job started."
    },
    "response": {
      "type": "string",
      "description": "Result text recorded when the job finishes."
    },
    "metadata": {
      "$ref": "#/$defs/ResourceMetadata"
    }
  },
  "$defs": {
    "ResourceMetadata": {
      "type": "object",
      "description": "Version and timestamps for a stored resource.",
      "properties": {
        "version": {
          "type": "integer",
          "description": "Stored version. The first version is 1."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "Time when the resource was created."
        },
        "modifiedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Time when the resource was last modified."
        }
      }
    }
  }
}