updateSnapshot method

Future<Snapshot> updateSnapshot({
  1. int retries = 5,
  2. required Snapshot snapshot,
  3. required String updateMask,
})

Updates an existing snapshot. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

The snapshot name can be just the simple name or it can be the fully quantified name in the format: projects/{project}/snapshots/{snap}.

Implementation

Future<Snapshot> updateSnapshot({
  int retries = 5,
  required Snapshot snapshot,
  required String updateMask,
}) async {
  assert(_initialized);

  _logger.fine('[updateSnapshot]: start');
  try {
    return await _execute(
      executor: () async {
        final result = await _pubsubApi.projects.snapshots.patch(
          UpdateSnapshotRequest(
            snapshot: snapshot,
            updateMask: updateMask,
          ),
          snapshot.name!,
        );

        return result;
      },
      retries: retries,
    );
  } finally {
    _logger.fine('[updateSnapshot]: complete');
  }
}