getPolicy method
Retrieves detailed information about a specific policy within the AgentCore Policy system. This operation returns the complete policy definition, metadata, and current status, allowing administrators to review and manage policy configurations.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter policyEngineId :
The identifier of the policy engine that manages the policy to be
retrieved.
Parameter policyId :
The unique identifier of the policy to be retrieved. This must be a valid
policy ID that exists within the specified policy engine.
Implementation
Future<GetPolicyResponse> getPolicy({
required String policyEngineId,
required String policyId,
}) async {
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/policy-engines/${Uri.encodeComponent(policyEngineId)}/policies/${Uri.encodeComponent(policyId)}',
exceptionFnMap: _exceptionFns,
);
return GetPolicyResponse.fromJson(response);
}