searchDirectoryPeople method

Future<SearchDirectoryPeopleResponse> searchDirectoryPeople({
  1. List<String>? mergeSources,
  2. int? pageSize,
  3. String? pageToken,
  4. String? query,
  5. String? readMask,
  6. List<String>? sources,
  7. String? $fields,
})

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

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 500, 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 SearchDirectoryPeople must match the first call that provided the page token.

query - Required. Prefix query that matches fields in the person. Does NOT use the read_mask for determining what fields to match.

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

sources - Required. Directory sources to return.

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

Completes with a SearchDirectoryPeopleResponse.

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<SearchDirectoryPeopleResponse> searchDirectoryPeople({
  core.List<core.String>? mergeSources,
  core.int? pageSize,
  core.String? pageToken,
  core.String? query,
  core.String? readMask,
  core.List<core.String>? sources,
  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 (query != null) 'query': [query],
    if (readMask != null) 'readMask': [readMask],
    if (sources != null) 'sources': sources,
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/people:searchDirectoryPeople';

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