listGroupMemberships method

Future<ListGroupMembershipsResponse> listGroupMemberships({
  1. required String groupId,
  2. required String identityStoreId,
  3. int? maxResults,
  4. String? nextToken,
})

For the specified group in the specified identity store, returns the list of all GroupMembership objects and returns results in paginated form.

May throw ResourceNotFoundException. May throw ValidationException.

Parameter groupId : The identifier for a group in the identity store.

Parameter identityStoreId : The globally unique identifier for the identity store.

Parameter maxResults : The maximum number of results to be returned per request. This parameter is used in all List requests to specify how many results to return in one page.

Parameter nextToken : The pagination token used for the ListUsers, ListGroups and ListGroupMemberships 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<ListGroupMembershipsResponse> listGroupMemberships({
  required String groupId,
  required String identityStoreId,
  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.ListGroupMemberships'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GroupId': groupId,
      'IdentityStoreId': identityStoreId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListGroupMembershipsResponse.fromJson(jsonResponse.body);
}