watch method

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

Watch for changes to Settings resources.

request - The metadata request object.

Request parameters:

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.

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. 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.int? maxResults,
  core.String? pageToken,
  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 (syncToken != null) 'syncToken': [syncToken],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'users/me/settings/watch';

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