list method

Future<ListContactGroupsResponse> list({
  1. String? groupFields,
  2. int? pageSize,
  3. String? pageToken,
  4. String? syncToken,
  5. String? $fields,
})

List all contact groups owned by the authenticated user.

Members of the contact groups are not populated.

Request parameters:

groupFields - Optional. A field mask to restrict which fields on the group are returned. Defaults to metadata, groupType, memberCount, and name if not set or set to empty. Valid fields are: * clientData * groupType * memberCount * metadata * name

pageSize - Optional. The maximum number of resources to return. Valid values are between 1 and 1000, inclusive. Defaults to 30 if not set or set to 0.

pageToken - Optional. The next_page_token value returned from a previous call to [ListContactGroups](/people/api/rest/v1/contactgroups/list). Requests the next page of resources.

syncToken - Optional. A sync token, returned by a previous call to contactgroups.list. Only resources changed since the sync token was created will be returned.

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

Completes with a ListContactGroupsResponse.

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

  const url_ = 'v1/contactGroups';

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