list method

Future<ListOtherContactsResponse> list({
  1. int? pageSize,
  2. String? pageToken,
  3. String? readMask,
  4. bool? requestSyncToken,
  5. List<String>? sources,
  6. String? syncToken,
  7. String? $fields,
})

List all "Other contacts", that is contacts that are not in a contact group.

"Other contacts" are typically auto created contacts from interactions. Sync tokens expire 7 days after the full sync. A request with an expired sync token will get an error with an google.rpc.ErrorInfo with reason "EXPIRED_SYNC_TOKEN". In the case of such an error clients should make a full sync request without a sync_token. The first page of a full sync request has an additional quota. If the quota is exceeded, a 429 error will be returned. This quota is fixed and can not be increased. When the sync_token is specified, resources deleted since the last sync will be returned as a person with PersonMetadata.deleted set to true. When the page_token or sync_token is specified, all other request parameters must match the first call. Writes may have a propagation delay of several minutes for sync requests. Incremental syncs are not intended for read-after-write use cases. See example usage at [List the user's other contacts that have changed](/people/v1/other-contacts#list_the_users_other_contacts_that_have_changed).

Request parameters:

pageSize - Optional. The number of "Other contacts" to include in the response. Valid values are between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.

pageToken - Optional. A page token, received from a previous response next_page_token. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to otherContacts.list must match the first call that provided the page token.

readMask - Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. What values are valid depend on what ReadSourceType is used. If READ_SOURCE_TYPE_CONTACT is used, valid values are: * emailAddresses * metadata * names * phoneNumbers * photos If READ_SOURCE_TYPE_PROFILE is used, valid values are: * addresses * ageRanges * biographies * birthdays

  • calendarUrls * clientData * coverPhotos * emailAddresses * events * externalIds * genders * imClients * interests * locales * locations * memberships * metadata * miscKeywords * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * sipAddresses * skills
  • urls * userDefined

requestSyncToken - Optional. Whether the response should return next_sync_token on the last page of results. It can be used to get incremental changes since the last request by setting it on the request sync_token. More details about sync behavior at otherContacts.list.

sources - Optional. A mask of what source types to return. Defaults to READ_SOURCE_TYPE_CONTACT if not set. Possible values for this field are: * READ_SOURCE_TYPE_CONTACT * READ_SOURCE_TYPE_CONTACT,READ_SOURCE_TYPE_PROFILE Specifying READ_SOURCE_TYPE_PROFILE without specifying READ_SOURCE_TYPE_CONTACT is not permitted.

syncToken - Optional. A sync token, received from a previous response next_sync_token Provide this to retrieve only the resources changed since the last request. When syncing, all other parameters provided to otherContacts.list must match the first call that provided the sync token. More details about sync behavior at otherContacts.list.

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

Completes with a ListOtherContactsResponse.

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

  const url_ = 'v1/otherContacts';

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