patch method

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

Updates a backup schedule.

request - The metadata request object.

Request parameters:

name - Identifier. Output only for the CreateBackupSchedule operation. Required for the UpdateBackupSchedule operation. A globally unique identifier for the backup schedule which cannot be changed. Values are of the form projects//instances//databases//backupSchedules/a-z*[a-z0-9] The final segment of the name must be between 2 and 60 characters in length. Value must have pattern ^projects/\[^/\]+/instances/\[^/\]+/databases/\[^/\]+/backupSchedules/\[^/\]+$.

updateMask - Required. A mask specifying which fields in the BackupSchedule resource should be updated. This mask is relative to the BackupSchedule resource, not to the request message. The field mask must always be specified; this prevents any future fields from being erased accidentally.

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

Completes with a BackupSchedule.

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<BackupSchedule> patch(
  BackupSchedule 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_ = 'v1/' + core.Uri.encodeFull('$name');

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