listGroupMembershipsForMember method

Future<ListGroupMembershipsForMemberResponse> listGroupMembershipsForMember({
  1. required String identityStoreId,
  2. required MemberId memberId,
  3. int? maxResults,
  4. String? nextToken,
})

For the specified member 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 identityStoreId : The globally unique identifier for the identity store.

Parameter memberId : An object that contains the identifier of a group member. Setting the UserID field to the specific identifier for a user indicates that the user is a member of the group.

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, 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<ListGroupMembershipsForMemberResponse> listGroupMembershipsForMember({
  required String identityStoreId,
  required MemberId memberId,
  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.ListGroupMembershipsForMember'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'IdentityStoreId': identityStoreId,
      'MemberId': memberId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListGroupMembershipsForMemberResponse.fromJson(jsonResponse.body);
}