{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-inspector/json-schema/amazon-inspector-batch-get-account-status-response-schema.json",
  "title": "BatchGetAccountStatusResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-inspector-status-api-openapi.yml#/components/schemas/BatchGetAccountStatusResponse",
  "type": "object",
  "properties": {
    "accounts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AccountState"
      },
      "description": "An array of objects that provide details on the status of Amazon Inspector for each of the requested accounts."
    },
    "failedAccounts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FailedAccount"
      },
      "description": "An array of objects detailing any accounts that failed to enable Amazon Inspector and why."
    }
  },
  "required": [
    "accounts"
  ],
  "$defs": {
    "AccountState": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "description": "The Amazon Web Services account ID."
        },
        "state": {
          "$ref": "#/$defs/State"
        },
        "resourceState": {
          "$ref": "#/$defs/ResourceState"
        }
      },
      "required": [
        "accountId",
        "state",
        "resourceState"
      ]
    },
    "FailedAccount": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "description": "The Amazon Web Services account ID."
        },
        "status": {
          "type": "string",
          "description": "The status of Amazon Inspector for the account."
        },
        "resourceStatus": {
          "$ref": "#/$defs/ResourceStatus"
        },
        "errorCode": {
          "type": "string",
          "description": "The error code explaining why the account failed to enable Amazon Inspector."
        },
        "errorMessage": {
          "type": "string",
          "description": "The error message received when the account failed to enable Amazon Inspector."
        }
      },
      "required": [
        "accountId",
        "errorCode",
        "errorMessage"
      ]
    },
    "ResourceState": {
      "type": "object",
      "properties": {
        "ec2": {
          "$ref": "#/$defs/State"
        },
        "ecr": {
          "$ref": "#/$defs/State"
        },
        "lambda": {
          "$ref": "#/$defs/State"
        },
        "lambdaCode": {
          "$ref": "#/$defs/State"
        },
        "codeRepository": {
          "$ref": "#/$defs/State"
        },
        "ami": {
          "$ref": "#/$defs/State"
        }
      },
      "required": [
        "ec2",
        "ecr"
      ]
    },
    "ResourceStatus": {
      "type": "object",
      "properties": {
        "ec2": {
          "type": "string",
          "description": "The status of Amazon Inspector scanning for Amazon EC2 resources."
        },
        "ecr": {
          "type": "string",
          "description": "The status of Amazon Inspector scanning for Amazon ECR resources."
        },
        "lambda": {
          "type": "string",
          "description": "The status of Amazon Inspector scanning for Amazon Web Services Lambda function."
        },
        "lambdaCode": {
          "type": "string",
          "description": "The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions."
        },
        "codeRepository": {
          "type": "string",
          "description": "The status of Amazon Inspector scanning for code repositories."
        },
        "ami": {
          "type": "string",
          "description": "The status of Amazon Machine Image (AMI) scanning for the account."
        }
      },
      "required": [
        "ec2",
        "ecr"
      ]
    },
    "State": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "The status of Amazon Inspector for the account."
        },
        "errorCode": {
          "type": "string",
          "description": "The error code explaining why the account failed to enable Amazon Inspector."
        },
        "errorMessage": {
          "type": "string",
          "description": "The error message received when the account failed to enable Amazon Inspector."
        }
      },
      "required": [
        "status",
        "errorCode",
        "errorMessage"
      ]
    }
  }
}