list method

Future<Members> list(
  1. String groupKey, {
  2. bool? includeDerivedMembership,
  3. int? maxResults,
  4. String? pageToken,
  5. String? roles,
  6. String? $fields,
})

Retrieves a paginated list of all members in a group.

This method times out after 60 minutes. For more information, see Troubleshoot error codes.

Request parameters:

groupKey - Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.

includeDerivedMembership - Whether to list indirect memberships. Default: false.

maxResults - Maximum number of results to return. Max allowed value is 200.

pageToken - Token to specify next page in the list.

roles - The roles query parameter allows you to retrieve group members by role. Allowed values are OWNER, MANAGER, and MEMBER.

$fields - Selector specifying which fields to include in a partial response.

Completes with a Members.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<Members> list(
  core.String groupKey, {
  core.bool? includeDerivedMembership,
  core.int? maxResults,
  core.String? pageToken,
  core.String? roles,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (includeDerivedMembership != null)
      'includeDerivedMembership': ['${includeDerivedMembership}'],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (roles != null) 'roles': [roles],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'admin/directory/v1/groups/' +
      commons.escapeVariable('$groupKey') +
      '/members';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return Members.fromJson(response_ as core.Map<core.String, core.dynamic>);
}