{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iot-device-defender/json-schema/amazon-iot-device-defender-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-device-defender-test-authorization-api-openapi.yml#/components/schemas/TestAuthorizationResponse",
  "type": "object",
  "properties": {
    "authResults": {
      "allOf": [
        {
          "$ref": "#/$defs/AuthResults"
        },
        {
          "description": "The authentication results."
        }
      ]
    }
  },
  "$defs": {
    "ActionType": {
      "type": "string",
      "enum": [
        "PUBLISH",
        "SUBSCRIBE",
        "RECEIVE",
        "CONNECT"
      ]
    },
    "Allowed": {
      "type": "object",
      "properties": {
        "policies": {
          "allOf": [
            {
              "$ref": "#/$defs/Policies"
            },
            {
              "description": "A list of policies that allowed the authentication."
            }
          ]
        }
      },
      "description": "Contains information that allowed the authorization."
    },
    "AuthDecision": {
      "type": "string",
      "enum": [
        "ALLOWED",
        "EXPLICIT_DENY",
        "IMPLICIT_DENY"
      ]
    },
    "AuthInfo": {
      "type": "object",
      "required": [
        "resources"
      ],
      "properties": {
        "actionType": {
          "allOf": [
            {
              "$ref": "#/$defs/ActionType"
            },
            {
              "description": "The type of action for which the principal is being authorized."
            }
          ]
        },
        "resources": {
          "allOf": [
            {
              "$ref": "#/$defs/Resources"
            },
            {
              "description": "The resources for which the principal is being authorized to perform the specified action."
            }
          ]
        }
      },
      "description": "A collection of authorization information."
    },
    "AuthResult": {
      "type": "object",
      "properties": {
        "authInfo": {
          "allOf": [
            {
              "$ref": "#/$defs/AuthInfo"
            },
            {
              "description": "Authorization information."
            }
          ]
        },
        "allowed": {
          "allOf": [
            {
              "$ref": "#/$defs/Allowed"
            },
            {
              "description": "The policies and statements that allowed the specified action."
            }
          ]
        },
        "denied": {
          "allOf": [
            {
              "$ref": "#/$defs/Denied"
            },
            {
              "description": "The policies and statements that denied the specified action."
            }
          ]
        },
        "authDecision": {
          "allOf": [
            {
              "$ref": "#/$defs/AuthDecision"
            },
            {
              "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": {
          "allOf": [
            {
              "$ref": "#/$defs/MissingContextValues"
            },
            {
              "description": "Contains any missing context values found while evaluating policy."
            }
          ]
        }
      },
      "description": "The authorizer result."
    },
    "AuthResults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AuthResult"
      }
    },
    "Denied": {
      "type": "object",
      "properties": {
        "implicitDeny": {
          "allOf": [
            {
              "$ref": "#/$defs/ImplicitDeny"
            },
            {
              "description": "Information that implicitly denies the authorization. When a policy doesn't explicitly deny or allow an action on a resource it is considered an implicit deny."
            }
          ]
        },
        "explicitDeny": {
          "allOf": [
            {
              "$ref": "#/$defs/ExplicitDeny"
            },
            {
              "description": "Information that explicitly denies the authorization. "
            }
          ]
        }
      },
      "description": "Contains information that denied the authorization."
    },
    "ExplicitDeny": {
      "type": "object",
      "properties": {
        "policies": {
          "allOf": [
            {
              "$ref": "#/$defs/Policies"
            },
            {
              "description": "The policies that denied the authorization."
            }
          ]
        }
      },
      "description": "Information that explicitly denies authorization."
    },
    "ImplicitDeny": {
      "type": "object",
      "properties": {
        "policies": {
          "allOf": [
            {
              "$ref": "#/$defs/Policies"
            },
            {
              "description": "Policies that don't contain a matching allow or deny statement for the specified action on the specified resource. "
            }
          ]
        }
      },
      "description": "Information that implicitly denies authorization. When policy doesn't explicitly deny or allow an action on a resource it is considered an implicit deny."
    },
    "MissingContextValue": {
      "type": "string"
    },
    "MissingContextValues": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MissingContextValue"
      }
    },
    "Policies": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Policy"
      }
    },
    "Policy": {
      "type": "object",
      "properties": {
        "policyName": {
          "allOf": [
            {
              "$ref": "#/$defs/PolicyName"
            },
            {
              "description": "The policy name."
            }
          ]
        },
        "policyArn": {
          "allOf": [
            {
              "$ref": "#/$defs/PolicyArn"
            },
            {
              "description": "The policy ARN."
            }
          ]
        }
      },
      "description": "Describes an IoT policy."
    },
    "PolicyArn": {
      "type": "string"
    },
    "PolicyName": {
      "type": "string",
      "pattern": "[\\w+=,.@-]+",
      "minLength": 1,
      "maxLength": 128
    },
    "Resource": {
      "type": "string",
      "pattern": "[\\s\\S]*",
      "maxLength": 2048
    },
    "Resources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Resource"
      }
    }
  }
}