listGroupMembers method

Future<ListGroupMembersResponse> listGroupMembers({
  1. required String groupId,
  2. required String organizationId,
  3. int? maxResults,
  4. String? nextToken,
})

Returns an overview of the members of a group. Users and groups can be members of a group.

May throw EntityNotFoundException. May throw EntityStateException. May throw InvalidParameterException. May throw OrganizationNotFoundException. May throw OrganizationStateException.

Parameter groupId : The identifier for the group to which the members (users or groups) are associated.

Parameter organizationId : The identifier for the organization under which the group exists.

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<ListGroupMembersResponse> listGroupMembers({
  required String groupId,
  required String organizationId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(groupId, 'groupId');
  _s.validateStringLength(
    'groupId',
    groupId,
    12,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(organizationId, 'organizationId');
  _s.validateStringLength(
    'organizationId',
    organizationId,
    34,
    34,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.ListGroupMembers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GroupId': groupId,
      'OrganizationId': organizationId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListGroupMembersResponse.fromJson(jsonResponse.body);
}