getPolicyGeneration method

Future<GetPolicyGenerationResponse> getPolicyGeneration({
  1. required String policyEngineId,
  2. required String policyGenerationId,
})

Retrieves information about a policy generation request within the AgentCore Policy system. Policy generation converts natural language descriptions into Cedar policy statements using AI-powered translation, enabling non-technical users to create policies.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter policyEngineId : The identifier of the policy engine associated with the policy generation request. This provides the context for the generation operation and schema validation.

Parameter policyGenerationId : The unique identifier of the policy generation request to be retrieved. This must be a valid generation ID from a previous StartPolicyGeneration call.

Implementation

Future<GetPolicyGenerationResponse> getPolicyGeneration({
  required String policyEngineId,
  required String policyGenerationId,
}) async {
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/policy-engines/${Uri.encodeComponent(policyEngineId)}/policy-generations/${Uri.encodeComponent(policyGenerationId)}',
    exceptionFnMap: _exceptionFns,
  );
  return GetPolicyGenerationResponse.fromJson(response);
}