listGroups method
Returns summaries of the organization's groups.
May throw EntityNotFoundException.
May throw InvalidParameterException.
May throw OrganizationNotFoundException.
May throw OrganizationStateException.
Parameter organizationId :
The identifier for the organization under which the groups exist.
Parameter filters :
Limit the search results based on the filter criteria. Only one filter per
request is supported.
Parameter maxResults :
The maximum number of results to return in a single call.
Parameter nextToken :
The token to use to retrieve the next page of results. The first call does
not contain any tokens.
Implementation
Future<ListGroupsResponse> listGroups({
required String organizationId,
ListGroupsFilters? filters,
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': 'WorkMailService.ListGroups'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'OrganizationId': organizationId,
if (filters != null) 'Filters': filters,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListGroupsResponse.fromJson(jsonResponse.body);
}