watchAll method

Future<Channel> watchAll(
  1. Channel request,
  2. String bucket, {
  3. String? delimiter,
  4. String? endOffset,
  5. bool? includeTrailingDelimiter,
  6. int? maxResults,
  7. String? pageToken,
  8. String? prefix,
  9. String? projection,
  10. String? startOffset,
  11. String? userProject,
  12. bool? versions,
  13. String? $fields,
})

Watch for changes on all objects in a bucket.

request - The metadata request object.

Request parameters:

bucket - Name of the bucket in which to look for objects.

delimiter - Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.

endOffset - Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).

includeTrailingDelimiter - If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.

maxResults - Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.

pageToken - A previously-returned page token representing part of the larger set of results to view.

prefix - Filter results to objects whose names begin with this prefix.

projection - Set of properties to return. Defaults to noAcl. Possible string values are:

  • "full" : Include all properties.
  • "noAcl" : Omit the owner, acl property.

startOffset - Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).

userProject - The project to be billed for this request. Required for Requester Pays buckets.

versions - If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.

$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> watchAll(
  Channel request,
  core.String bucket, {
  core.String? delimiter,
  core.String? endOffset,
  core.bool? includeTrailingDelimiter,
  core.int? maxResults,
  core.String? pageToken,
  core.String? prefix,
  core.String? projection,
  core.String? startOffset,
  core.String? userProject,
  core.bool? versions,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (delimiter != null) 'delimiter': [delimiter],
    if (endOffset != null) 'endOffset': [endOffset],
    if (includeTrailingDelimiter != null)
      'includeTrailingDelimiter': ['${includeTrailingDelimiter}'],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (prefix != null) 'prefix': [prefix],
    if (projection != null) 'projection': [projection],
    if (startOffset != null) 'startOffset': [startOffset],
    if (userProject != null) 'userProject': [userProject],
    if (versions != null) 'versions': ['${versions}'],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'b/' + commons.escapeVariable('$bucket') + '/o/watch';

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