listPolicies method
Returns an array of PolicySummary objects.
May throw InternalErrorException.
May throw InvalidOperationException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
Parameter maxResults :
Specifies the number of PolicySummary objects that you want
Firewall Manager to return for this request. If you have more
PolicySummary objects than the number that you specify for
MaxResults, the response includes a NextToken
value that you can use to get another batch of PolicySummary
objects.
Parameter nextToken :
If you specify a value for MaxResults and you have more
PolicySummary objects than the number that you specify for
MaxResults, Firewall Manager returns a NextToken
value in the response that allows you to list another group of
PolicySummary objects. For the second and subsequent
ListPolicies requests, specify the value of
NextToken from the previous response to get information about
another batch of PolicySummary objects.
Implementation
Future<ListPoliciesResponse> listPolicies({
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSFMS_20180101.ListPolicies'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListPoliciesResponse.fromJson(jsonResponse.body);
}