getPolicy method

Future<GetPolicyResponse> getPolicy({
  1. required String policyName,
})

Gets information about the specified policy with the policy document of the default version.

May throw ResourceNotFoundException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.

Parameter policyName : The name of the policy.

Implementation

Future<GetPolicyResponse> getPolicy({
  required String policyName,
}) async {
  ArgumentError.checkNotNull(policyName, 'policyName');
  _s.validateStringLength(
    'policyName',
    policyName,
    1,
    128,
    isRequired: true,
  );
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/policies/${Uri.encodeComponent(policyName)}',
    exceptionFnMap: _exceptionFns,
  );
  return GetPolicyResponse.fromJson(response);
}