describeFirewallPolicy method

Future<DescribeFirewallPolicyResponse> describeFirewallPolicy({
  1. String? firewallPolicyArn,
  2. String? firewallPolicyName,
})

Returns the data objects for the specified firewall policy.

May throw InternalServerError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter firewallPolicyArn : The Amazon Resource Name (ARN) of the firewall policy.

You must specify the ARN or the name, and you can specify both.

Parameter firewallPolicyName : The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.

You must specify the ARN or the name, and you can specify both.

Implementation

Future<DescribeFirewallPolicyResponse> describeFirewallPolicy({
  String? firewallPolicyArn,
  String? firewallPolicyName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'NetworkFirewall_20201112.DescribeFirewallPolicy'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (firewallPolicyArn != null) 'FirewallPolicyArn': firewallPolicyArn,
      if (firewallPolicyName != null)
        'FirewallPolicyName': firewallPolicyName,
    },
  );

  return DescribeFirewallPolicyResponse.fromJson(jsonResponse.body);
}