streamFetchInvalidations method

Future<StreamFetchInvalidationsResponse> streamFetchInvalidations(
  1. StreamFetchInvalidationsRequest request,
  2. String project,
  3. String namespace, {
  4. String? $fields,
})

Streaming endpoint which allows a client to subscribe to a stream of Fetch invalidation events.

These events tell the client that a previous Fetch response is no longer valid (ex: a new Template was published) and that they should perform a new Fetch request to get the latest data.

request - The metadata request object.

Request parameters:

project - Required. The Firebase project ID or project number. (NOTE: These identifiers can be retrieved from the Firebase console.)

namespace - Required. The string "firebase".

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

Completes with a StreamFetchInvalidationsResponse.

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<StreamFetchInvalidationsResponse> streamFetchInvalidations(
  StreamFetchInvalidationsRequest request,
  core.String project,
  core.String namespace, {
  core.String? $fields,
}) async {
  final _body = convert.json.encode(request);
  final _queryParams = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final _url = 'v1/projects/' +
      commons.escapeVariable('$project') +
      '/namespaces/' +
      commons.escapeVariable('$namespace') +
      ':streamFetchInvalidations';

  final _response = await _requester.request(
    _url,
    'POST',
    body: _body,
    queryParams: _queryParams,
  );
  return StreamFetchInvalidationsResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}