{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-verified-permissions/json-schema/amazon-verified-permissions-batch-is-authorized-with-token-output-schema.json",
  "title": "BatchIsAuthorizedWithTokenOutput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-verified-permissions-batchisauthorizedwithtoken-api-openapi.yml#/components/schemas/BatchIsAuthorizedWithTokenOutput",
  "type": "object",
  "properties": {
    "principal": {
      "$ref": "#/$defs/EntityIdentifier"
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BatchIsAuthorizedWithTokenOutputItem"
      },
      "description": "A series of Allow or Deny decisions for each request, and the policies that produced them. These results are returned in the order they were requested."
    }
  },
  "required": [
    "results"
  ],
  "$defs": {
    "ActionIdentifier": {
      "type": "object",
      "properties": {
        "actionType": {
          "type": "string",
          "description": "The type of an action."
        },
        "actionId": {
          "type": "string",
          "description": "The ID of an action."
        }
      },
      "required": [
        "actionType",
        "actionId"
      ]
    },
    "AttributeValue": {
      "type": "object",
      "properties": {
        "boolean": {
          "type": "boolean",
          "description": "An attribute value of Boolean type. Example: {\"boolean\": true}"
        },
        "entityIdentifier": {
          "$ref": "#/$defs/EntityIdentifier"
        },
        "long": {
          "type": "integer",
          "description": "An attribute value of Long type. Example: {\"long\": 0}"
        },
        "string": {
          "type": "string",
          "description": "An attribute value of String type. Example: {\"string\": \"abc\"}"
        },
        "set": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AttributeValue"
          },
          "description": "An attribute value of Set type. Example: {\"set\": [ {} ] }"
        },
        "record": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/AttributeValue"
          },
          "description": "An attribute value of Record type. Example: {\"record\": { \"keyName\": {} } }"
        },
        "ipaddr": {
          "type": "string",
          "description": "An attribute value of ipaddr type. Example: {\"ip\": \"192.168.1.100\"}"
        },
        "decimal": {
          "type": "string",
          "description": "An attribute value of decimal type. Example: {\"decimal\": \"1.1\"}"
        },
        "datetime": {
          "type": "string",
          "description": "An attribute value of datetime type. Example: {\"datetime\": \"2024-10-15T11:35:00Z\"}"
        },
        "duration": {
          "type": "string",
          "description": "An attribute value of duration type. Example: {\"duration\": \"1h30m\"}"
        }
      },
      "description": "Exactly one member is set."
    },
    "BatchIsAuthorizedWithTokenInputItem": {
      "type": "object",
      "properties": {
        "action": {
          "$ref": "#/$defs/ActionIdentifier"
        },
        "resource": {
          "$ref": "#/$defs/EntityIdentifier"
        },
        "context": {
          "$ref": "#/$defs/ContextDefinition"
        }
      }
    },
    "BatchIsAuthorizedWithTokenOutputItem": {
      "type": "object",
      "properties": {
        "request": {
          "$ref": "#/$defs/BatchIsAuthorizedWithTokenInputItem"
        },
        "decision": {
          "type": "string",
          "enum": [
            "ALLOW",
            "DENY"
          ],
          "description": "An authorization decision that indicates if the authorization request should be allowed or denied."
        },
        "determiningPolicies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeterminingPolicyItem"
          },
          "description": "The list of determining policies used to make the authorization decision. For example, if there are two matching policies, where one is a forbid and the other is a permit, then the forbid policy will be the determining policy. In the case of multiple matching permit policies then there would be multiple determining policies. In the case that no policies match, and hence the response is DENY, there would be no determining policies."
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EvaluationErrorItem"
          },
          "description": "Errors that occurred while making an authorization decision. For example, a policy might reference an entity or attribute that doesn't exist in the request."
        }
      },
      "required": [
        "request",
        "decision",
        "determiningPolicies",
        "errors"
      ]
    },
    "ContextDefinition": {
      "type": "object",
      "properties": {
        "contextMap": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/AttributeValue"
          },
          "description": "An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value. Example: \"contextMap\":{\"&lt;KeyName1&gt;\":{\"boolean\":true},\"&lt;KeyName2&gt;\":{\"long\":1234}}"
        },
        "cedarJson": {
          "type": "string",
          "description": "A Cedar JSON string representation of the context needed to successfully evaluate an authorization request. Example: {\"cedarJson\":\"{\\\"&lt;KeyName1&gt;\\\": true, \\\"&lt;KeyName2&gt;\\\": 1234}\" }"
        }
      },
      "description": "Exactly one member is set."
    },
    "DeterminingPolicyItem": {
      "type": "object",
      "properties": {
        "policyId": {
          "type": "string",
          "description": "The Id of a policy that determined to an authorization decision. Example: \"policyId\":\"SPEXAMPLEabcdefg111111\""
        }
      },
      "required": [
        "policyId"
      ]
    },
    "EntityIdentifier": {
      "type": "object",
      "properties": {
        "entityType": {
          "type": "string",
          "description": "The type of an entity. Example: \"entityType\":\"typeName\""
        },
        "entityId": {
          "type": "string",
          "description": "The identifier of an entity. \"entityId\":\"identifier\""
        }
      },
      "required": [
        "entityType",
        "entityId"
      ]
    },
    "EvaluationErrorItem": {
      "type": "object",
      "properties": {
        "errorDescription": {
          "type": "string",
          "description": "The error description."
        }
      },
      "required": [
        "errorDescription"
      ]
    }
  }
}