patch method

Future<Backup> patch(
  1. Backup request,
  2. String name, {
  3. String? updateMask,
  4. String? $fields,
})

Updates a pending or completed Cloud Bigtable Backup.

request - The metadata request object.

Request parameters:

name - A globally unique identifier for the backup which cannot be changed. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}/ backups/_a-zA-Z0-9* The final segment of the name must be between 1 and 50 characters in length. The backup is stored in the cluster identified by the prefix of the backup name of the form projects/{project}/instances/{instance}/clusters/{cluster}. Value must have pattern ^projects/\[^/\]+/instances/\[^/\]+/clusters/\[^/\]+/backups/\[^/\]+$.

updateMask - Required. A mask specifying which fields (e.g. expire_time) in the Backup resource should be updated. This mask is relative to the Backup resource, not to the request message. The field mask must always be specified; this prevents any future fields from being erased accidentally by clients that do not know about them.

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

Completes with a Backup.

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<Backup> patch(
  Backup request,
  core.String name, {
  core.String? updateMask,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (updateMask != null) 'updateMask': [updateMask],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/' + core.Uri.encodeFull('$name');

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