listGroups method
Returns a list of all groups in the account, displaying their names, unique IDs, and ARNs. The groups from all Regions are returned.
May throw InternalServerException.
May throw ValidationException.
Parameter maxResults :
Specify this parameter to limit how many groups are returned each time you
use the ListGroups operation. If you omit this parameter, the
default of 20 is used.
Parameter nextToken :
A token that indicates that there is more data available. You can use this
token in a subsequent operation to retrieve the next set of results.
Implementation
Future<ListGroupsResponse> listGroups({
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
20,
);
final $payload = <String, dynamic>{
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/groups',
exceptionFnMap: _exceptionFns,
);
return ListGroupsResponse.fromJson(response);
}