listDirectoryPeople method

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

Provides a list of domain profiles and domain contacts in the authenticated user's domain directory.

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 directory people that have changed](/people/v1/directory#list_the_directory_people_that_have_changed).

Request parameters:

mergeSources - Optional. Additional data to merge into the directory sources if they are connected through verified join keys such as email addresses or phone numbers.

pageSize - Optional. The number of people 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 people.listDirectoryPeople 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. 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. 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 people.listDirectoryPeople.

sources - Required. Directory sources to return.

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 people.listDirectoryPeople must match the first call that provided the sync token. More details about sync behavior at people.listDirectoryPeople.

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

Completes with a ListDirectoryPeopleResponse.

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<ListDirectoryPeopleResponse> listDirectoryPeople({
  core.List<core.String>? mergeSources,
  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 (mergeSources != null) 'mergeSources': mergeSources,
    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/people:listDirectoryPeople';

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