listRuleGroups method

Future<ListRuleGroupsResponse> listRuleGroups({
  1. ResourceManagedType? managedType,
  2. int? maxResults,
  3. String? nextToken,
  4. ResourceManagedStatus? scope,
  5. SubscriptionStatus? subscriptionStatus,
  6. RuleGroupType? type,
})

Retrieves the metadata for the rule groups that you have defined. Depending on your setting for max results and the number of rule groups, a single call might not return the full list.

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

Parameter managedType : Indicates the general category of the Amazon Web Services managed rule group.

Parameter maxResults : The maximum number of objects that you want Network Firewall to return for this request. If more objects are available, in the response, Network Firewall provides a NextToken value that you can use in a subsequent call to get the next batch of objects.

Parameter nextToken : When you request a list of objects with a MaxResults setting, if the number of objects that are still available for retrieval exceeds the maximum you requested, Network Firewall returns a NextToken value in the response. To retrieve the next batch of objects, use the token returned from the prior request in your next request.

Parameter scope : The scope of the request. The default setting of ACCOUNT or a setting of NULL returns all of the rule groups in your account. A setting of MANAGED returns all available managed rule groups.

Parameter subscriptionStatus : Filters the results to show only rule groups with the specified subscription status. Use this to find subscribed or unsubscribed rule groups.

Parameter type : Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains stateless rules. If it is stateful, it contains stateful rules.

Implementation

Future<ListRuleGroupsResponse> listRuleGroups({
  ResourceManagedType? managedType,
  int? maxResults,
  String? nextToken,
  ResourceManagedStatus? scope,
  SubscriptionStatus? subscriptionStatus,
  RuleGroupType? type,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'NetworkFirewall_20201112.ListRuleGroups'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (managedType != null) 'ManagedType': managedType.value,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (scope != null) 'Scope': scope.value,
      if (subscriptionStatus != null)
        'SubscriptionStatus': subscriptionStatus.value,
      if (type != null) 'Type': type.value,
    },
  );

  return ListRuleGroupsResponse.fromJson(jsonResponse.body);
}