create method

Future<Operation> create(
  1. Backup request,
  2. String parent, {
  3. String? backupId,
  4. String? $fields,
})

Starts creating a new Cloud Bigtable Backup.

The returned backup long-running operation can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup.

request - The metadata request object.

Request parameters:

parent - Required. This must be one of the clusters in the instance in which this table is located. The backup will be stored in this cluster. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}. Value must have pattern ^projects/\[^/\]+/instances/\[^/\]+/clusters/\[^/\]+$.

backupId - Required. The id of the backup to be created. The backup_id along with the parent parent are combined as {parent}/backups/{backup_id} to create the full backup name, of the form: projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}. This string must be between 1 and 50 characters in length and match the regex _a-zA-Z0-9*.

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

Completes with a Operation.

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

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

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