list method

Future<ListGroupsResponse> list({
  1. int? pageSize,
  2. String? pageToken,
  3. String? parent,
  4. String? view,
  5. String? $fields,
})

Lists the Group resources under a customer or namespace.

Request parameters:

pageSize - The maximum number of results to return. Note that the number of results returned may be less than this value even if there are more available results. To fetch all results, clients must continue calling this method repeatedly until the response no longer contains a next_page_token. If unspecified, defaults to 200 for View.BASIC and to 50 for View.FULL. Must not be greater than 1000 for View.BASIC or 500 for View.FULL.

pageToken - The next_page_token value returned from a previous list request, if any.

parent - Required. The parent resource under which to list all Group resources. Must be of the form identitysources/{identity_source} for external- identity-mapped groups or customers/{customer_id} for Google Groups. The customer_id must begin with "C" (for example, 'C046psxkn'). Find your customer ID.

view - The level of detail to be returned. If unspecified, defaults to View.BASIC. Possible string values are:

  • "VIEW_UNSPECIFIED" : Default. Should not be used.
  • "BASIC" : Only basic resource information is returned.
  • "FULL" : All resource information is returned.

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

Completes with a ListGroupsResponse.

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<ListGroupsResponse> list({
  core.int? pageSize,
  core.String? pageToken,
  core.String? parent,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (parent != null) 'parent': [parent],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/groups';

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