{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-kms/json-schema/amazon-kms-list-grants-response-schema.json",
  "title": "ListGrantsResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-kms-grant-api-openapi.yml#/components/schemas/ListGrantsResponse",
  "type": "object",
  "properties": {
    "Grants": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GrantListEntry"
      },
      "description": "A list of grants."
    },
    "NextMarker": {
      "type": "string",
      "description": "When Truncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent request."
    },
    "Truncated": {
      "type": "boolean",
      "description": "A flag that indicates whether there are more items in the list. When this value is true, the list in this response is truncated. To get more items, pass the value of the NextMarker element in this response to the Marker parameter in a subsequent request."
    }
  },
  "$defs": {
    "GrantConstraints": {
      "type": "object",
      "properties": {
        "EncryptionContextSubset": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A list of key-value pairs that must be included in the encryption context of the cryptographic operation request. The grant allows the cryptographic operation only when the encryption context in the request includes the key-value pairs specified in this constraint, although it can include additional key-value pairs."
        },
        "EncryptionContextEquals": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A list of key-value pairs that must match the encryption context in the cryptographic operation request. The grant allows the operation only when the encryption context in the request is the same as the encryption context specified in this constraint."
        },
        "SourceArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of an Amazon Web Services resource on behalf of which the request is made. This is effectively the same as having the aws:SourceArn global condition key in the grant. The SourceArn constraint ensures that the principal can use the KMS key only when the request is made on behalf of the specified resource."
        }
      }
    },
    "GrantListEntry": {
      "type": "object",
      "properties": {
        "KeyId": {
          "type": "string",
          "description": "The unique identifier for the KMS key to which the grant applies."
        },
        "GrantId": {
          "type": "string",
          "description": "The unique identifier for the grant."
        },
        "Name": {
          "type": "string",
          "description": "The friendly name that identifies the grant. If a name was provided in the CreateGrant request, that name is returned. Otherwise this value is null."
        },
        "CreationDate": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time when the grant was created."
        },
        "GranteePrincipal": {
          "type": "string",
          "description": "The identity that gets the permissions in the grant. When a grant is created with the GranteePrincipal field, the ListGrants response usually contains the user or role designated as the grantee principal in the grant. However, if the grantee principal is an Amazon Web Services service, the GranteePrincipal field contains an Amazon Web Services service principal, which might correspond to several different grantee principals, such as an IAM user, IAM role, or Amazon Web Services account."
        },
        "RetiringPrincipal": {
          "type": "string",
          "description": "The principal that can retire the grant."
        },
        "IssuingAccount": {
          "type": "string",
          "description": "The Amazon Web Services account under which the grant was issued."
        },
        "Operations": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "Decrypt",
              "Encrypt",
              "GenerateDataKey",
              "GenerateDataKeyWithoutPlaintext",
              "ReEncryptFrom",
              "ReEncryptTo",
              "Sign",
              "Verify",
              "GetPublicKey",
              "CreateGrant",
              "RetireGrant",
              "DescribeKey",
              "GenerateDataKeyPair",
              "GenerateDataKeyPairWithoutPlaintext",
              "GenerateMac",
              "VerifyMac",
              "DeriveSharedSecret",
              "Encapsulate",
              "Decapsulate"
            ]
          },
          "description": "The list of operations permitted by the grant."
        },
        "Constraints": {
          "$ref": "#/$defs/GrantConstraints"
        },
        "GranteeServicePrincipal": {
          "type": "string",
          "description": "The Amazon Web Services service principal that gets the permissions in the grant."
        },
        "RetiringServicePrincipal": {
          "type": "string",
          "description": "The Amazon Web Services service principal that can retire the grant."
        }
      }
    }
  }
}