{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-inspector/json-schema/amazon-inspector-describe-assessment-runs-response-schema.json",
  "title": "DescribeAssessmentRunsResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-inspector-assessment-run-api-openapi.yml#/components/schemas/DescribeAssessmentRunsResponse",
  "type": "object",
  "properties": {
    "assessmentRuns": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AssessmentRun"
      },
      "description": "Information about the assessment run."
    },
    "failedItems": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/FailedItemDetails"
      },
      "description": "Assessment run details that cannot be described. An error code is provided for each failed item."
    }
  },
  "required": [
    "assessmentRuns",
    "failedItems"
  ],
  "$defs": {
    "AssessmentRun": {
      "type": "object",
      "properties": {
        "arn": {
          "type": "string",
          "description": "The ARN of the assessment run."
        },
        "name": {
          "type": "string",
          "description": "The auto-generated name for the assessment run."
        },
        "assessmentTemplateArn": {
          "type": "string",
          "description": "The ARN of the assessment template that is associated with the assessment run."
        },
        "state": {
          "type": "string",
          "enum": [
            "CREATED",
            "START_DATA_COLLECTION_PENDING",
            "START_DATA_COLLECTION_IN_PROGRESS",
            "COLLECTING_DATA",
            "STOP_DATA_COLLECTION_PENDING",
            "DATA_COLLECTED",
            "START_EVALUATING_RULES_PENDING",
            "EVALUATING_RULES",
            "FAILED",
            "ERROR",
            "COMPLETED",
            "COMPLETED_WITH_ERRORS",
            "CANCELED"
          ],
          "description": "The state of the assessment run."
        },
        "durationInSeconds": {
          "type": "integer",
          "description": "The duration of the assessment run."
        },
        "rulesPackageArns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The rules packages selected for the assessment run."
        },
        "userAttributesForFindings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Attribute"
          },
          "description": "The user-defined attributes that are assigned to every generated finding."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The time when StartAssessmentRun was called."
        },
        "startedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The time when StartAssessmentRun was called."
        },
        "completedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The assessment run completion time that corresponds to the rules packages evaluation completion time or failure."
        },
        "stateChangedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The last time when the assessment run's state changed."
        },
        "dataCollected": {
          "type": "boolean",
          "description": "A Boolean value (true or false) that specifies whether the process of collecting data from the agents is completed."
        },
        "stateChanges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentRunStateChange"
          },
          "description": "A list of the assessment run state changes."
        },
        "notifications": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AssessmentRunNotification"
          },
          "description": "A list of notifications for the event subscriptions. A notification about a particular generated finding is added to this list only once."
        },
        "findingCounts": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          },
          "description": "Provides a total count of generated findings per severity."
        }
      },
      "required": [
        "arn",
        "name",
        "assessmentTemplateArn",
        "state",
        "durationInSeconds",
        "rulesPackageArns",
        "userAttributesForFindings",
        "createdAt",
        "stateChangedAt",
        "dataCollected",
        "stateChanges",
        "notifications",
        "findingCounts"
      ]
    },
    "AssessmentRunNotification": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date-time",
          "description": "The date of the notification."
        },
        "event": {
          "type": "string",
          "enum": [
            "ASSESSMENT_RUN_STARTED",
            "ASSESSMENT_RUN_COMPLETED",
            "ASSESSMENT_RUN_STATE_CHANGED",
            "FINDING_REPORTED",
            "OTHER"
          ],
          "description": "The event for which a notification is sent."
        },
        "message": {
          "type": "string",
          "description": "The message included in the notification."
        },
        "error": {
          "type": "boolean",
          "description": "The Boolean value that specifies whether the notification represents an error."
        },
        "snsTopicArn": {
          "type": "string",
          "description": "The SNS topic to which the SNS notification is sent."
        },
        "snsPublishStatusCode": {
          "type": "string",
          "enum": [
            "SUCCESS",
            "TOPIC_DOES_NOT_EXIST",
            "ACCESS_DENIED",
            "INTERNAL_ERROR"
          ],
          "description": "The status code of the SNS notification."
        }
      },
      "required": [
        "date",
        "event",
        "error"
      ]
    },
    "AssessmentRunStateChange": {
      "type": "object",
      "properties": {
        "stateChangedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The last time the assessment run state changed."
        },
        "state": {
          "type": "string",
          "enum": [
            "CREATED",
            "START_DATA_COLLECTION_PENDING",
            "START_DATA_COLLECTION_IN_PROGRESS",
            "COLLECTING_DATA",
            "STOP_DATA_COLLECTION_PENDING",
            "DATA_COLLECTED",
            "START_EVALUATING_RULES_PENDING",
            "EVALUATING_RULES",
            "FAILED",
            "ERROR",
            "COMPLETED",
            "COMPLETED_WITH_ERRORS",
            "CANCELED"
          ],
          "description": "The assessment run state."
        }
      },
      "required": [
        "stateChangedAt",
        "state"
      ]
    },
    "Attribute": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The attribute key."
        },
        "value": {
          "type": "string",
          "description": "The value assigned to the attribute key."
        }
      },
      "required": [
        "key"
      ]
    },
    "FailedItemDetails": {
      "type": "object",
      "properties": {
        "failureCode": {
          "type": "string",
          "enum": [
            "INVALID_ARN",
            "DUPLICATE_ARN",
            "ITEM_DOES_NOT_EXIST",
            "ACCESS_DENIED",
            "LIMIT_EXCEEDED",
            "INTERNAL_ERROR"
          ],
          "description": "The status code of a failed item."
        },
        "retryable": {
          "type": "boolean",
          "description": "Indicates whether you can immediately retry a request for this item for a specified resource."
        }
      },
      "required": [
        "failureCode",
        "retryable"
      ]
    }
  }
}