{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aws-security-hub/json-schema/aws-security-hub-get-recommended-policy-v2-response-schema.json",
  "title": "GetRecommendedPolicyV2Response",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aws-security-hub-operations-api-openapi.yml#/components/schemas/GetRecommendedPolicyV2Response",
  "type": "object",
  "properties": {
    "NextToken": {
      "type": "string",
      "description": "The pagination token to use to request the next page of results."
    },
    "RecommendationType": {
      "type": "string",
      "enum": [
        "UNUSED_PERMISSION_RECOMMENDATION"
      ],
      "description": "The type of recommendation for the finding."
    },
    "RecommendationSteps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RecommendationStep"
      },
      "description": "The recommended steps to take to resolve the finding."
    },
    "Error": {
      "$ref": "#/$defs/RecommendationError"
    },
    "Status": {
      "type": "string",
      "enum": [
        "IN_PROGRESS",
        "SUCCEEDED",
        "FAILED"
      ],
      "description": "The current status of the recommended policy retrieval."
    },
    "ResourceArn": {
      "type": "string",
      "description": "The ARN of the resource of the finding."
    }
  },
  "$defs": {
    "RecommendationError": {
      "type": "object",
      "properties": {
        "Code": {
          "type": "string",
          "description": "The error code for a failed retrieval of a recommended policy for a finding."
        },
        "Message": {
          "type": "string",
          "description": "The error message for a failed retrieval of a recommended policy for a finding."
        }
      }
    },
    "RecommendationStep": {
      "type": "object",
      "properties": {
        "UnusedPermissions": {
          "$ref": "#/$defs/UnusedPermissionsRecommendationStep"
        }
      },
      "description": "Exactly one member is set."
    },
    "UnusedPermissionsRecommendationStep": {
      "type": "object",
      "properties": {
        "RecommendedAction": {
          "type": "string",
          "description": "A recommendation of whether to create or detach a policy for an unused permissions finding."
        },
        "ExistingPolicy": {
          "type": "string",
          "description": "The contents of the existing policy identified by ExistingPolicyId which needs to be replaced, when the RecommendedAction is CREATE_POLICY."
        },
        "ExistingPolicyId": {
          "type": "string",
          "description": "The ID of an existing policy to be replaced or detached."
        },
        "PolicyUpdatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The time at which the existing policy for the unused permissions finding was last updated."
        },
        "RecommendedPolicy": {
          "type": "string",
          "description": "The contents of the least-privileged recommended replacement for ExistingPolicyId, when the RecommendedAction is CREATE_POLICY."
        }
      }
    }
  }
}