{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iot-core/json-schema/amazon-iot-core-test-authorization-response-schema.json",
  "title": "TestAuthorizationResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iot-core-test-authorization-api-openapi.yml#/components/schemas/TestAuthorizationResponse",
  "type": "object",
  "properties": {
    "authResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AuthResult"
      },
      "description": "The authentication results."
    }
  },
  "$defs": {
    "Allowed": {
      "type": "object",
      "properties": {
        "policies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Policy"
          },
          "description": "A list of policies that allowed the authentication."
        }
      }
    },
    "AuthInfo": {
      "type": "object",
      "properties": {
        "actionType": {
          "type": "string",
          "enum": [
            "PUBLISH",
            "SUBSCRIBE",
            "RECEIVE",
            "CONNECT"
          ],
          "description": "The type of action for which the principal is being authorized."
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The resources for which the principal is being authorized to perform the specified action."
        }
      },
      "required": [
        "resources"
      ]
    },
    "AuthResult": {
      "type": "object",
      "properties": {
        "authInfo": {
          "$ref": "#/$defs/AuthInfo"
        },
        "allowed": {
          "$ref": "#/$defs/Allowed"
        },
        "denied": {
          "$ref": "#/$defs/Denied"
        },
        "authDecision": {
          "type": "string",
          "enum": [
            "ALLOWED",
            "EXPLICIT_DENY",
            "IMPLICIT_DENY"
          ],
          "description": "The final authorization decision of this scenario. Multiple statements are taken into account when determining the authorization decision. An explicit deny statement can override multiple allow statements."
        },
        "missingContextValues": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Contains any missing context values found while evaluating policy."
        }
      }
    },
    "Denied": {
      "type": "object",
      "properties": {
        "implicitDeny": {
          "$ref": "#/$defs/ImplicitDeny"
        },
        "explicitDeny": {
          "$ref": "#/$defs/ExplicitDeny"
        }
      }
    },
    "ExplicitDeny": {
      "type": "object",
      "properties": {
        "policies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Policy"
          },
          "description": "The policies that denied the authorization."
        }
      }
    },
    "ImplicitDeny": {
      "type": "object",
      "properties": {
        "policies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Policy"
          },
          "description": "Policies that don't contain a matching allow or deny statement for the specified action on the specified resource."
        }
      }
    },
    "Policy": {
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string",
          "description": "The policy name."
        },
        "policyArn": {
          "type": "string",
          "description": "The policy ARN."
        }
      }
    }
  }
}