patch method
Updates a pending or completed Backup.
request - The metadata request object.
Request parameters:
name - Output only for the CreateBackup operation. Required for the
UpdateBackup operation. A globally unique identifier for the backup which
cannot be changed. Values are of the form
projects/{project}/instances/{instance}/backups/a-z*[a-z0-9] The final
segment of the name must be between 2 and 60 characters in length. The
backup is stored in the location(s) specified in the instance
configuration of the instance containing the backup, identified by the
prefix of the backup name of the form
projects/{project}/instances/{instance}.
Value must have pattern
^projects/\[^/\]+/instances/\[^/\]+/backups/\[^/\]+$.
updateMask - Required. A mask specifying which fields (for example,
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>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + 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>);
}