{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-container-registry/json-schema/azure-container-registry-run-schema.json",
  "title": "Run",
  "description": "Run resource properties",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-container-registry-runs-api-openapi.yml#/components/schemas/Run",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/ProxyResource"
    }
  ],
  "properties": {
    "properties": {
      "$ref": "#/$defs/RunProperties",
      "description": "The properties of a run.",
      "x-ms-client-flatten": true
    }
  },
  "$defs": {
    "AgentProperties": {
      "description": "The properties that determine the run agent configuration.",
      "type": "object",
      "properties": {
        "cpu": {
          "format": "int32",
          "description": "The CPU configuration in terms of number of cores required for the run.",
          "type": "integer"
        }
      }
    },
    "ImageDescriptor": {
      "description": "Properties for a registry image.",
      "type": "object",
      "properties": {
        "registry": {
          "description": "The registry login server.",
          "type": "string"
        },
        "repository": {
          "description": "The repository name.",
          "type": "string"
        },
        "tag": {
          "description": "The tag name.",
          "type": "string"
        },
        "digest": {
          "description": "The sha256-based digest of the image manifest.",
          "type": "string"
        }
      }
    },
    "ImageUpdateTrigger": {
      "description": "The image update trigger that caused a build.",
      "type": "object",
      "properties": {
        "id": {
          "description": "The unique ID of the trigger.",
          "type": "string"
        },
        "timestamp": {
          "format": "date-time",
          "description": "The timestamp when the image update happened.",
          "type": "string"
        },
        "images": {
          "description": "The list of image updates that caused the build.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ImageDescriptor"
          }
        }
      }
    },
    "PlatformProperties": {
      "description": "The platform properties against which the run has to happen.",
      "required": [
        "os"
      ],
      "type": "object",
      "properties": {
        "os": {
          "description": "The operating system type required for the run.",
          "enum": [
            "Windows",
            "Linux"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "OS",
            "modelAsString": true
          }
        },
        "architecture": {
          "description": "The OS architecture.",
          "enum": [
            "amd64",
            "x86",
            "arm"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "Architecture",
            "modelAsString": true
          }
        },
        "variant": {
          "description": "Variant of the CPU.",
          "enum": [
            "v6",
            "v7",
            "v8"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "Variant",
            "modelAsString": true
          }
        }
      }
    },
    "ProxyResource": {
      "description": "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags.",
      "properties": {
        "id": {
          "description": "The resource ID.",
          "type": "string",
          "readOnly": true
        },
        "name": {
          "description": "The name of the resource.",
          "type": "string",
          "readOnly": true
        },
        "type": {
          "description": "The type of the resource.",
          "type": "string",
          "readOnly": true
        }
      },
      "x-ms-azure-resource": true
    },
    "RunProperties": {
      "description": "The properties for a run.",
      "type": "object",
      "properties": {
        "runId": {
          "description": "The unique identifier for the run.",
          "type": "string"
        },
        "status": {
          "description": "The current status of the run.",
          "enum": [
            "Queued",
            "Started",
            "Running",
            "Succeeded",
            "Failed",
            "Canceled",
            "Error",
            "Timeout"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "RunStatus",
            "modelAsString": true
          }
        },
        "lastUpdatedTime": {
          "format": "date-time",
          "description": "The last updated time for the run.",
          "type": "string"
        },
        "runType": {
          "description": "The type of run.",
          "enum": [
            "QuickBuild",
            "QuickRun",
            "AutoBuild",
            "AutoRun"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "RunType",
            "modelAsString": true
          }
        },
        "createTime": {
          "format": "date-time",
          "description": "The time the run was scheduled.",
          "type": "string"
        },
        "startTime": {
          "format": "date-time",
          "description": "The time the run started.",
          "type": "string"
        },
        "finishTime": {
          "format": "date-time",
          "description": "The time the run finished.",
          "type": "string"
        },
        "outputImages": {
          "description": "The list of all images that were generated from the run. This is applicable if the run generates base image dependencies.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ImageDescriptor"
          }
        },
        "task": {
          "description": "The task against which run was scheduled.",
          "type": "string"
        },
        "imageUpdateTrigger": {
          "$ref": "#/$defs/ImageUpdateTrigger",
          "description": "The image update trigger that caused the run. This is applicable if the task has base image trigger configured."
        },
        "sourceTrigger": {
          "$ref": "#/$defs/SourceTriggerDescriptor",
          "description": "The source trigger that caused the run."
        },
        "platform": {
          "$ref": "#/$defs/PlatformProperties",
          "description": "The platform properties against which the run will happen."
        },
        "agentConfiguration": {
          "$ref": "#/$defs/AgentProperties",
          "description": "The machine configuration of the run agent."
        },
        "sourceRegistryAuth": {
          "description": "The scope of the credentials that were used to login to the source registry during this run.",
          "type": "string"
        },
        "customRegistries": {
          "description": "The list of custom registries that were logged in during this run.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "runErrorMessage": {
          "description": "The error message received from backend systems after the run is scheduled.",
          "type": "string",
          "readOnly": true
        },
        "provisioningState": {
          "description": "The provisioning state of a run.",
          "enum": [
            "Creating",
            "Updating",
            "Deleting",
            "Succeeded",
            "Failed",
            "Canceled"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "ProvisioningState",
            "modelAsString": true
          }
        },
        "isArchiveEnabled": {
          "description": "The value that indicates whether archiving is enabled or not.",
          "default": false,
          "type": "boolean"
        },
        "timerTrigger": {
          "$ref": "#/$defs/TimerTriggerDescriptor",
          "description": "The timer trigger that caused the run."
        }
      }
    },
    "SourceTriggerDescriptor": {
      "description": "The source trigger that caused a run.",
      "type": "object",
      "properties": {
        "id": {
          "description": "The unique ID of the trigger.",
          "type": "string"
        },
        "eventType": {
          "description": "The event type of the trigger.",
          "type": "string"
        },
        "commitId": {
          "description": "The unique ID that identifies a commit.",
          "type": "string"
        },
        "pullRequestId": {
          "description": "The unique ID that identifies pull request.",
          "type": "string"
        },
        "repositoryUrl": {
          "description": "The repository URL.",
          "type": "string"
        },
        "branchName": {
          "description": "The branch name in the repository.",
          "type": "string"
        },
        "providerType": {
          "description": "The source control provider type.",
          "type": "string"
        }
      }
    },
    "TimerTriggerDescriptor": {
      "type": "object",
      "properties": {
        "timerTriggerName": {
          "description": "The timer trigger name that caused the run.",
          "type": "string"
        },
        "scheduleOccurrence": {
          "description": "The occurrence that triggered the run.",
          "type": "string"
        }
      }
    }
  }
}