listRuleSets method

Future<ListRuleSetsResponse> listRuleSets({
  1. String? nextToken,
  2. int? pageSize,
})

List rule sets for this account.

May throw ValidationException.

Parameter nextToken : If you received a pagination token from a previous call to this API, you can provide it here to continue paginating through the next page of results.

Parameter pageSize : The maximum number of rule set resources that are returned per call. You can use NextToken to obtain further rule sets.

Implementation

Future<ListRuleSetsResponse> listRuleSets({
  String? nextToken,
  int? pageSize,
}) async {
  _s.validateNumRange(
    'pageSize',
    pageSize,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'MailManagerSvc.ListRuleSets'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (nextToken != null) 'NextToken': nextToken,
      if (pageSize != null) 'PageSize': pageSize,
    },
  );

  return ListRuleSetsResponse.fromJson(jsonResponse.body);
}