getPolicy method
Returns information about the specified AWS Firewall Manager policy.
May throw ResourceNotFoundException. May throw InvalidOperationException. May throw InternalErrorException. May throw InvalidTypeException.
Parameter policyId
:
The ID of the AWS Firewall Manager policy that you want the details for.
Implementation
Future<GetPolicyResponse> getPolicy({
required String policyId,
}) async {
ArgumentError.checkNotNull(policyId, 'policyId');
_s.validateStringLength(
'policyId',
policyId,
36,
36,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSFMS_20180101.GetPolicy'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'PolicyId': policyId,
},
);
return GetPolicyResponse.fromJson(jsonResponse.body);
}