watch method
Watches for changes in users list.
request
- The metadata request object.
Request parameters:
customFieldMask
- Comma-separated list of schema names. All fields from
these schemas are fetched. This should only be set when projection=custom.
customer
- Immutable ID of the Google Workspace account. In case of
multi-domain, to fetch all users for a customer, fill this field instead
of domain.
domain
- Name of the domain. Fill this field to get users from only this
domain. To return all users in a multi-domain fill customer field
instead."
event
- Events to watch for.
Possible string values are:
- "add" : User Created Event
- "delete" : User Deleted Event
- "makeAdmin" : User Admin Status Change Event
- "undelete" : User Undeleted Event
- "update" : User Updated Event
maxResults
- Maximum number of results to return.
Value must be between "1" and "500".
orderBy
- Column to use for sorting results
Possible string values are:
- "email" : Primary email of the user.
- "familyName" : User's family name.
- "givenName" : User's given name.
pageToken
- Token to specify next page in the list
projection
- What subset of fields to fetch for this user.
Possible string values are:
- "basic" : Do not include any custom fields for the user.
- "custom" : Include custom fields from schemas mentioned in customFieldMask.
- "full" : Include all fields associated with this user.
query
- Query string search. Should be of the form "". Complete
documentation is at https:
//developers.google.com/admin-sdk/directory/v1/guides/search-users
showDeleted
- If set to true, retrieves the list of deleted users.
(Default: false)
sortOrder
- Whether to return results in ascending or descending order.
Possible string values are:
- "ASCENDING" : Ascending order.
- "DESCENDING" : Descending order.
viewType
- Whether to fetch the administrator-only or domain-wide public
view of the user. For more information, see [Retrieve a user as a
non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).
Possible string values are:
- "admin_view" : Results include both administrator-only and domain-public fields.
- "domain_public" : Results only include fields for the user that are publicly visible to other users in the domain.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Channel.
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<Channel> watch(
Channel request, {
core.String? customFieldMask,
core.String? customer,
core.String? domain,
core.String? event,
core.int? maxResults,
core.String? orderBy,
core.String? pageToken,
core.String? projection,
core.String? query,
core.String? showDeleted,
core.String? sortOrder,
core.String? viewType,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (customFieldMask != null) 'customFieldMask': [customFieldMask],
if (customer != null) 'customer': [customer],
if (domain != null) 'domain': [domain],
if (event != null) 'event': [event],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (orderBy != null) 'orderBy': [orderBy],
if (pageToken != null) 'pageToken': [pageToken],
if (projection != null) 'projection': [projection],
if (query != null) 'query': [query],
if (showDeleted != null) 'showDeleted': [showDeleted],
if (sortOrder != null) 'sortOrder': [sortOrder],
if (viewType != null) 'viewType': [viewType],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'admin/directory/v1/users/watch';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Channel.fromJson(response_ as core.Map<core.String, core.dynamic>);
}