listGroups method
Lists all groups in the identity store. Returns a paginated list of
complete Group objects. Filtering for a Group by
the DisplayName attribute is deprecated. Instead, use the
GetGroupId API action.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter identityStoreId :
The globally unique identifier for the identity store, such as
d-1234567890. In this example, d- is a fixed
prefix, and 1234567890 is a randomly generated string that
contains numbers and lower case letters. This value is generated at the
time that a new identity store is created.
Parameter filters :
A list of Filter objects, which is used in the
ListUsers and ListGroups requests.
Parameter maxResults :
The maximum number of results to be returned per request. This parameter
is used in the ListUsers and ListGroups
requests to specify how many results to return in one page. The length
limit is 50 characters.
Parameter nextToken :
The pagination token used for the ListUsers and
ListGroups API operations. This value is generated by the
identity store service. It is returned in the API response if the total
results are more than the size of one page. This token is also returned
when it is used in the API request to search for the next page.
Implementation
Future<ListGroupsResponse> listGroups({
required String identityStoreId,
List<Filter>? 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': 'AWSIdentityStore.ListGroups'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'IdentityStoreId': identityStoreId,
if (filters != null) 'Filters': filters,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListGroupsResponse.fromJson(jsonResponse.body);
}