{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gloat/json-schema/gloat-bulk-task-automation-status-response-schema.json",
  "title": "BulkTaskAutomationStatusResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gloat-job-architecture-job-code-tasks-api-openapi.yml#/components/schemas/BulkTaskAutomationStatusResponse",
  "properties": {
    "tasks": {
      "items": {
        "$ref": "#/$defs/TaskAutomationBulkResult"
      },
      "type": "array",
      "title": "Tasks",
      "description": "Results per task"
    },
    "totalSuccess": {
      "type": "integer",
      "title": "Totalsuccess",
      "description": "Total successful updates across all tasks"
    },
    "totalFailures": {
      "type": "integer",
      "title": "Totalfailures",
      "description": "Total failed updates across all tasks"
    }
  },
  "type": "object",
  "required": [
    "tasks",
    "totalSuccess",
    "totalFailures"
  ],
  "$defs": {
    "AutomationStatus": {
      "type": "string",
      "enum": [
        "full",
        "high",
        "moderate",
        "low",
        "not_automating",
        "in_progress",
        "no_status"
      ],
      "title": "AutomationStatus",
      "description": "Enum representing the automation status levels for tasks.\n\nEach level corresponds to a specific automation score that impacts AI calculations.\nScores are defined in the AUTOMATION_STATUS_SCORES constant."
    },
    "TaskAutomationBulkResult": {
      "properties": {
        "taskId": {
          "type": "string",
          "title": "Taskid",
          "description": "Task ID"
        },
        "successCount": {
          "type": "integer",
          "title": "Successcount",
          "description": "Number of successful updates"
        },
        "failureCount": {
          "type": "integer",
          "title": "Failurecount",
          "description": "Number of failed updates"
        },
        "results": {
          "items": {
            "$ref": "#/$defs/TaskJobCodeAutomationResult"
          },
          "type": "array",
          "title": "Results",
          "description": "Individual results per job code"
        }
      },
      "type": "object",
      "required": [
        "taskId",
        "successCount",
        "failureCount",
        "results"
      ],
      "title": "TaskAutomationBulkResult",
      "description": "Results for all job code updates of a single task.\n\nAggregates per-job-code results with success/failure counts."
    },
    "TaskAutomationStatusRead": {
      "properties": {
        "jobCodeId": {
          "type": "string",
          "title": "Jobcodeid",
          "description": "Job code identifier"
        },
        "taskId": {
          "type": "string",
          "title": "Taskid",
          "description": "Task identifier"
        },
        "status": {
          "$ref": "#/$defs/AutomationStatus",
          "description": "Current automation status"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "title": "Timestamp",
          "description": "When the status was last updated"
        },
        "modifiedBy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Modifiedby",
          "description": "User ID who modified the status"
        },
        "modifiedByName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Modifiedbyname",
          "description": "Name of user who modified the status"
        }
      },
      "type": "object",
      "required": [
        "jobCodeId",
        "taskId",
        "status",
        "timestamp"
      ],
      "title": "TaskAutomationStatusRead",
      "description": "Response model for task automation status.\n\nReturns the status - score calculations are done at query time based on status value."
    },
    "TaskJobCodeAutomationResult": {
      "properties": {
        "jobCodeId": {
          "type": "string",
          "title": "Jobcodeid",
          "description": "Job code ID"
        },
        "taskId": {
          "type": "string",
          "title": "Taskid",
          "description": "Task ID"
        },
        "status": {
          "type": "integer",
          "title": "Status",
          "description": "HTTP status code (200 = success, 404 = not found, etc.)"
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail",
          "description": "Error detail if status is not 200"
        },
        "automationStatus": {
          "anyOf": [
            {
              "$ref": "#/$defs/TaskAutomationStatusRead"
            },
            {
              "type": "null"
            }
          ],
          "description": "Updated automation status (only on success)"
        }
      },
      "type": "object",
      "required": [
        "jobCodeId",
        "taskId",
        "status"
      ],
      "title": "TaskJobCodeAutomationResult",
      "description": "Result for a single task-job_code automation status update.\n\nContains HTTP status code, optional error detail, and the automation status on success."
    }
  }
}