{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-automation/json-schema/microsoft-azure-automation-job-schema.json",
  "title": "Job",
  "description": "Definition of the job.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-automation-job-api-openapi.yml#/components/schemas/Job",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/JobProperties",
      "description": "The properties of the job.",
      "x-ms-client-flatten": true
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/ProxyResource"
    }
  ],
  "$defs": {
    "JobProperties": {
      "type": "object",
      "description": "Definition of job properties.",
      "properties": {
        "runbook": {
          "$ref": "#/$defs/RunbookAssociationProperty",
          "description": "Gets or sets the runbook."
        },
        "startedBy": {
          "type": "string",
          "description": "Gets or sets the job started by."
        },
        "runOn": {
          "type": "string",
          "description": "Gets or sets the runOn which specifies the group name where the job is to be executed."
        },
        "jobRuntimeEnvironment": {
          "$ref": "#/$defs/JobRuntimeEnvironment",
          "description": "Runtime Environment Property"
        },
        "jobId": {
          "type": "string",
          "format": "uuid",
          "description": "Gets or sets the id of the job."
        },
        "creationTime": {
          "type": "string",
          "format": "date-time",
          "description": "Gets or sets the creation time of the job."
        },
        "status": {
          "$ref": "#/$defs/JobStatus",
          "description": "Gets or sets the status of the job."
        },
        "statusDetails": {
          "type": "string",
          "description": "Gets or sets the status details of the job."
        },
        "startTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Gets or sets the start time of the job."
        },
        "endTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Gets or sets the end time of the job."
        },
        "exception": {
          "type": "string",
          "description": "Gets or sets the exception of the job."
        },
        "lastModifiedTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Gets or sets the last modified time of the job."
        },
        "lastStatusModifiedTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Gets or sets the last status modified time of the job."
        },
        "parameters": {
          "type": "object",
          "description": "Gets or sets the parameters of the job.",
          "additionalProperties": {
            "type": "string"
          }
        },
        "provisioningState": {
          "$ref": "#/$defs/JobProvisioningState",
          "description": "The current provisioning state of the job.",
          "readOnly": true
        }
      }
    },
    "JobProvisioningState": {
      "type": "string",
      "description": "The provisioning state of the resource.",
      "enum": [
        "Failed",
        "Succeeded",
        "Suspended",
        "Processing"
      ],
      "x-ms-enum": {
        "name": "JobProvisioningState",
        "modelAsString": true,
        "values": [
          {
            "name": "Failed",
            "value": "Failed",
            "description": "Failed"
          },
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "Succeeded"
          },
          {
            "name": "Suspended",
            "value": "Suspended",
            "description": "Suspended"
          },
          {
            "name": "Processing",
            "value": "Processing",
            "description": "Processing"
          }
        ]
      }
    },
    "JobRuntimeEnvironment": {
      "type": "object",
      "description": "The runbook property associated with the entity.",
      "properties": {
        "runtimeEnvironmentName": {
          "type": "string",
          "description": "Name of Runtime Environment."
        }
      }
    },
    "JobStatus": {
      "type": "string",
      "description": "Gets or sets the status of the job.",
      "enum": [
        "New",
        "Activating",
        "Running",
        "Completed",
        "Failed",
        "Stopped",
        "Blocked",
        "Suspended",
        "Disconnected",
        "Suspending",
        "Stopping",
        "Resuming",
        "Removing"
      ],
      "x-ms-enum": {
        "name": "JobStatus",
        "modelAsString": true,
        "values": [
          {
            "name": "New",
            "value": "New",
            "description": "New"
          },
          {
            "name": "Activating",
            "value": "Activating",
            "description": "Activating"
          },
          {
            "name": "Running",
            "value": "Running",
            "description": "Running"
          },
          {
            "name": "Completed",
            "value": "Completed",
            "description": "Completed"
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "Failed"
          },
          {
            "name": "Stopped",
            "value": "Stopped",
            "description": "Stopped"
          },
          {
            "name": "Blocked",
            "value": "Blocked",
            "description": "Blocked"
          },
          {
            "name": "Suspended",
            "value": "Suspended",
            "description": "Suspended"
          },
          {
            "name": "Disconnected",
            "value": "Disconnected",
            "description": "Disconnected"
          },
          {
            "name": "Suspending",
            "value": "Suspending",
            "description": "Suspending"
          },
          {
            "name": "Stopping",
            "value": "Stopping",
            "description": "Stopping"
          },
          {
            "name": "Resuming",
            "value": "Resuming",
            "description": "Resuming"
          },
          {
            "name": "Removing",
            "value": "Removing",
            "description": "Removing"
          }
        ]
      }
    },
    "ProxyResource": {
      "type": "object",
      "title": "Proxy Resource",
      "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location",
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    },
    "RunbookAssociationProperty": {
      "type": "object",
      "description": "The runbook property associated with the entity.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Gets or sets the name of the runbook."
        }
      }
    }
  }
}