watch method

Future<Channel> watch(
  1. Channel request,
  2. String calendarId, {
  3. int? maxResults,
  4. String? pageToken,
  5. bool? showDeleted,
  6. String? syncToken,
  7. String? $fields,
})

Watch for changes to ACL resources.

request - The metadata request object.

Request parameters:

calendarId - Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword.

maxResults - Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.

pageToken - Token specifying which result page to return. Optional.

showDeleted - Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False.

syncToken - Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries.

$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 calendarId, {
  core.int? maxResults,
  core.String? pageToken,
  core.bool? showDeleted,
  core.String? syncToken,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (showDeleted != null) 'showDeleted': ['${showDeleted}'],
    if (syncToken != null) 'syncToken': [syncToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'calendars/' + commons.escapeVariable('$calendarId') + '/acl/watch';

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