# Class DatabaseAdminClient (6.118.0)

6.118.0 (latest) 6.116.0 6.111.1 6.108.0 6.107.0 6.103.0 6.102.1 6.101.1 6.100.0 6.99.0 6.98.1 6.97.1 6.96.1 6.95.1 6.94.0 6.93.0 6.89.0 6.88.0 6.87.0 6.86.0 6.85.0 6.83.0 6.82.0 6.80.1 6.79.0 6.77.0 6.74.1 6.72.0 6.71.0 6.69.0 6.68.0 6.66.0 6.65.1 6.62.0 6.60.0 6.58.0 6.57.0 6.56.0 6.55.0 6.54.0 6.53.0 6.52.1 6.51.0 6.50.1 6.49.0 6.25.1 6.24.0 6.23.4 6.22.0 6.21.2 6.20.0 6.19.1 6.18.0 6.17.4 6.14.1

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-spanner/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java) | [Product Reference](https://cloud.google.com/spanner/docs/) |

Service Description: Cloud Spanner Database Admin API

The Cloud Spanner Database Admin API can be used to: \* create, drop, and list databases
\* update the schema of pre-existing databases \* create, delete, copy and list backups for
a database \* restore a database from an existing backup

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName name = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       Database response = databaseAdminClient.getDatabase(name);
     }
     
Note: close() needs to be called on the DatabaseAdminClient object to clean up resources such
as threads. In the example above, try-with-resources is used, which automatically calls close().

| Method | Description | Method Variants |
|---|---|---|
| ListDatabases | Lists Cloud Spanner databases. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listDatabases(ListDatabasesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listDatabases(InstanceName parent) - listDatabases(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listDatabasesPagedCallable() - listDatabasesCallable() |
| CreateDatabase | Creates a new Cloud Spanner database and starts to prepare it for serving. The returned long-running operation will have a name of the format `<database_name>/operations/<operation_id>` and can be used to track preparation of the database. The metadata field type is CreateDatabaseMetadata. The response field type is Database, if successful. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createDatabaseAsync(CreateDatabaseRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createDatabaseAsync(InstanceName parent, String createStatement) - createDatabaseAsync(String parent, String createStatement) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createDatabaseOperationCallable() - createDatabaseCallable() |
| GetDatabase | Gets the state of a Cloud Spanner database. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getDatabase(GetDatabaseRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getDatabase(DatabaseName name) - getDatabase(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getDatabaseCallable() |
| UpdateDatabase | Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the database. If the named database does not exist, returns `NOT_FOUND`. While the operation is pending: \* The database's reconciling field is set to true. \* Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata's cancel_time is set, the updates are reverted, and the operation terminates with a `CANCELLED` status. \* New UpdateDatabase requests will return a `FAILED_PRECONDITION` error until the pending operation is done (returns successfully or with error). \* Reading the database via the API continues to give the pre-request values. Upon completion of the returned operation: \* The new values are in effect and readable via the API. \* The database's reconciling field becomes false. The returned long-running operation will have a name of the format `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>` and can be used to track the database modification. The metadata field type is UpdateDatabaseMetadata. The response field type is Database, if successful. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateDatabaseAsync(UpdateDatabaseRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - updateDatabaseAsync(Database database, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateDatabaseOperationCallable() - updateDatabaseCallable() |
| UpdateDatabaseDdl | Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name of the format `<database_name>/operations/<operation_id>` and can be used to track execution of the schema change(s). The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateDatabaseDdlAsync(UpdateDatabaseDdlRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - updateDatabaseDdlAsync(DatabaseName database, List\<String\> statements) - updateDatabaseDdlAsync(String database, List\<String\> statements) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateDatabaseDdlOperationCallable() - updateDatabaseDdlCallable() |
| DropDatabase | Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`. Note: Cloud Spanner might continue to accept requests for a few seconds after the database has been deleted. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - dropDatabase(DropDatabaseRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - dropDatabase(DatabaseName database) - dropDatabase(String database) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - dropDatabaseCallable() |
| GetDatabaseDdl | Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the Operations API. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getDatabaseDdl(GetDatabaseDdlRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getDatabaseDdl(DatabaseName database) - getDatabaseDdl(String database) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getDatabaseDdlCallable() |
| SetIamPolicy | Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.setIamPolicy` permission on resource. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - setIamPolicy(SetIamPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - setIamPolicy(ResourceName resource, Policy policy) - setIamPolicy(String resource, Policy policy) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - setIamPolicyCallable() |
| GetIamPolicy | Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set. Authorization requires `spanner.databases.getIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.getIamPolicy` permission on resource. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getIamPolicy(GetIamPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getIamPolicy(ResourceName resource) - getIamPolicy(String resource) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getIamPolicyCallable() |
| TestIamPermissions | Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list` permission on the containing instance. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - testIamPermissions(TestIamPermissionsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - testIamPermissions(ResourceName resource, List\<String\> permissions) - testIamPermissions(String resource, List\<String\> permissions) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - testIamPermissionsCallable() |
| CreateBackup | Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>` and 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. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createBackupAsync(CreateBackupRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createBackupAsync(InstanceName parent, Backup backup, String backupId) - createBackupAsync(String parent, Backup backup, String backupId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createBackupOperationCallable() - createBackupCallable() |
| CopyBackup | Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>` and can be used to track copying of the backup. The operation is associated with the destination backup. The metadata field type is CopyBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the copying and delete the destination backup. Concurrent CopyBackup requests can run on the same source backup. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - copyBackupAsync(CopyBackupRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - copyBackupAsync(InstanceName parent, String backupId, BackupName sourceBackup, Timestamp expireTime) - copyBackupAsync(InstanceName parent, String backupId, String sourceBackup, Timestamp expireTime) - copyBackupAsync(String parent, String backupId, BackupName sourceBackup, Timestamp expireTime) - copyBackupAsync(String parent, String backupId, String sourceBackup, Timestamp expireTime) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - copyBackupOperationCallable() - copyBackupCallable() |
| GetBackup | Gets metadata on a pending or completed Backup. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getBackup(GetBackupRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getBackup(BackupName name) - getBackup(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getBackupCallable() |
| UpdateBackup | Updates a pending or completed Backup. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateBackup(UpdateBackupRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateBackup(Backup backup, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateBackupCallable() |
| DeleteBackup | Deletes a pending or completed Backup. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteBackup(DeleteBackupRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteBackup(BackupName name) - deleteBackup(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteBackupCallable() |
| ListBackups | Lists completed and pending backups. Backups returned are ordered by `create_time` in descending order, starting from the most recent `create_time`. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listBackups(ListBackupsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listBackups(InstanceName parent) - listBackups(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listBackupsPagedCallable() - listBackupsCallable() |
| RestoreDatabase | Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database long-running operation has a name of the format `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - restoreDatabaseAsync(RestoreDatabaseRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - restoreDatabaseAsync(InstanceName parent, String databaseId, BackupName backup) - restoreDatabaseAsync(InstanceName parent, String databaseId, String backup) - restoreDatabaseAsync(String parent, String databaseId, BackupName backup) - restoreDatabaseAsync(String parent, String databaseId, String backup) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - restoreDatabaseOperationCallable() - restoreDatabaseCallable() |
| ListDatabaseOperations | Lists database longrunning-operations. A database operation has a name of the form `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`. The long-running operation metadata field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listDatabaseOperations(ListDatabaseOperationsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listDatabaseOperations(InstanceName parent) - listDatabaseOperations(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listDatabaseOperationsPagedCallable() - listDatabaseOperationsCallable() |
| ListBackupOperations | Lists the backup long-running operations in the given instance. A backup operation has a name of the form `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`. The long-running operation metadata field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by `operation.metadata.value.progress.start_time` in descending order starting from the most recently started operation. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listBackupOperations(ListBackupOperationsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listBackupOperations(InstanceName parent) - listBackupOperations(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listBackupOperationsPagedCallable() - listBackupOperationsCallable() |
| ListDatabaseRoles | Lists Cloud Spanner database roles. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listDatabaseRoles(ListDatabaseRolesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listDatabaseRoles(DatabaseName parent) - listDatabaseRoles(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listDatabaseRolesPagedCallable() - listDatabaseRolesCallable() |
| AddSplitPoints | Adds split points to specified tables, indexes of a database. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - addSplitPoints(AddSplitPointsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - addSplitPoints(DatabaseName database, List\<SplitPoints\> splitPoints) - addSplitPoints(String database, List\<SplitPoints\> splitPoints) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - addSplitPointsCallable() |
| CreateBackupSchedule | Creates a new backup schedule. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createBackupSchedule(CreateBackupScheduleRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createBackupSchedule(DatabaseName parent, BackupSchedule backupSchedule, String backupScheduleId) - createBackupSchedule(String parent, BackupSchedule backupSchedule, String backupScheduleId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createBackupScheduleCallable() |
| GetBackupSchedule | Gets backup schedule for the input schedule name. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getBackupSchedule(GetBackupScheduleRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getBackupSchedule(BackupScheduleName name) - getBackupSchedule(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getBackupScheduleCallable() |
| UpdateBackupSchedule | Updates a backup schedule. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateBackupSchedule(UpdateBackupScheduleRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateBackupSchedule(BackupSchedule backupSchedule, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateBackupScheduleCallable() |
| DeleteBackupSchedule | Deletes a backup schedule. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteBackupSchedule(DeleteBackupScheduleRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - deleteBackupSchedule(BackupScheduleName name) - deleteBackupSchedule(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteBackupScheduleCallable() |
| ListBackupSchedules | Lists all the backup schedules for the database. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listBackupSchedules(ListBackupSchedulesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listBackupSchedules(DatabaseName parent) - listBackupSchedules(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listBackupSchedulesPagedCallable() - listBackupSchedulesCallable() |
| InternalUpdateGraphOperation | This is an internal API called by Spanner Graph jobs. You should never need to call this API directly. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - internalUpdateGraphOperation(InternalUpdateGraphOperationRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - internalUpdateGraphOperation(DatabaseName database, String operationId) - internalUpdateGraphOperation(String database, String operationId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - internalUpdateGraphOperationCallable() |
[Methods]

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with
these names, this class includes a format method for each type of name, and additionally a parse
method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of DatabaseAdminSettings to
create(). For example:

To customize credentials:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     DatabaseAdminSettings databaseAdminSettings =
         DatabaseAdminSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create(databaseAdminSettings);
     
To customize the endpoint:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     DatabaseAdminSettings databaseAdminSettings =
         DatabaseAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
     DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create(databaseAdminSettings);
     
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
the wire:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     DatabaseAdminSettings databaseAdminSettings =
         DatabaseAdminSettings.newHttpJsonBuilder().build();
     DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create(databaseAdminSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> DatabaseAdminClient

## Static Methods

### create()

    public static final DatabaseAdminClient create()

Constructs an instance of DatabaseAdminClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(DatabaseAdminSettings settings)

    public static final DatabaseAdminClient create(DatabaseAdminSettings settings)

Constructs an instance of DatabaseAdminClient, using the given settings. The channels are
created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(DatabaseAdminStub stub)

    public static final DatabaseAdminClient create(DatabaseAdminStub stub)

Constructs an instance of DatabaseAdminClient, using the given stub for making calls. This is
for advanced usage - prefer using create(DatabaseAdminSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.stub.DatabaseAdminStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient` |   |

## Constructors

### DatabaseAdminClient(DatabaseAdminSettings settings)

    protected DatabaseAdminClient(DatabaseAdminSettings settings)

Constructs an instance of DatabaseAdminClient, using the given settings. This is protected so
that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminSettings` |

### DatabaseAdminClient(DatabaseAdminStub stub)

    protected DatabaseAdminClient(DatabaseAdminStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.stub.DatabaseAdminStub` |

## Methods

### addSplitPoints(AddSplitPointsRequest request)

    public final AddSplitPointsResponse addSplitPoints(AddSplitPointsRequest request)

Adds split points to specified tables, indexes of a database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       AddSplitPointsRequest request =
           AddSplitPointsRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .addAllSplitPoints(new ArrayList<SplitPoints>())
               .setInitiator("initiator-248987089")
               .build();
       AddSplitPointsResponse response = databaseAdminClient.addSplitPoints(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.AddSplitPointsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.AddSplitPointsResponse` |   |

### addSplitPoints(DatabaseName database, List\<SplitPoints\> splitPoints)

    public final AddSplitPointsResponse addSplitPoints(DatabaseName database, List<SplitPoints> splitPoints)

Adds split points to specified tables, indexes of a database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       List<SplitPoints> splitPoints = new ArrayList<>();
       AddSplitPointsResponse response = databaseAdminClient.addSplitPoints(database, splitPoints);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Required. The database on whose tables/indexes split points are to be added. Values are of the form `projects/<project>/instances/<instance>/databases/<database>`. |
| `splitPoints` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.SplitPoints>` Required. The split points to add. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.AddSplitPointsResponse` |   |

### addSplitPoints(String database, List\<SplitPoints\> splitPoints)

    public final AddSplitPointsResponse addSplitPoints(String database, List<SplitPoints> splitPoints)

Adds split points to specified tables, indexes of a database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       List<SplitPoints> splitPoints = new ArrayList<>();
       AddSplitPointsResponse response = databaseAdminClient.addSplitPoints(database, splitPoints);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The database on whose tables/indexes split points are to be added. Values are of the form `projects/<project>/instances/<instance>/databases/<database>`. |
| `splitPoints` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.SplitPoints>` Required. The split points to add. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.AddSplitPointsResponse` |   |

### addSplitPointsCallable()

    public final UnaryCallable<AddSplitPointsRequest,AddSplitPointsResponse> addSplitPointsCallable()

Adds split points to specified tables, indexes of a database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       AddSplitPointsRequest request =
           AddSplitPointsRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .addAllSplitPoints(new ArrayList<SplitPoints>())
               .setInitiator("initiator-248987089")
               .build();
       ApiFuture<AddSplitPointsResponse> future =
           databaseAdminClient.addSplitPointsCallable().futureCall(request);
       // Do something.
       AddSplitPointsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.AddSplitPointsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.AddSplitPointsResponse>` |   |

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### copyBackupAsync(CopyBackupRequest request)

    public final OperationFuture<Backup,CopyBackupMetadata> copyBackupAsync(CopyBackupRequest request)

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and can be used to track copying of the backup. The operation is associated with the
destination backup. The metadata field type is
CopyBackupMetadata. The
response field type is
Backup, if successful. Cancelling the returned
operation will stop the copying and delete the destination backup. Concurrent CopyBackup
requests can run on the same source backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CopyBackupRequest request =
           CopyBackupRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setBackupId("backupId2121930365")
               .setSourceBackup(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .setExpireTime(Timestamp.newBuilder().build())
               .setEncryptionConfig(CopyBackupEncryptionConfig.newBuilder().build())
               .build();
       Backup response = databaseAdminClient.copyBackupAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupMetadata>` |   |

### copyBackupAsync(InstanceName parent, String backupId, BackupName sourceBackup, Timestamp expireTime)

    public final OperationFuture<Backup,CopyBackupMetadata> copyBackupAsync(InstanceName parent, String backupId, BackupName sourceBackup, Timestamp expireTime)

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and can be used to track copying of the backup. The operation is associated with the
destination backup. The metadata field type is
CopyBackupMetadata. The
response field type is
Backup, if successful. Cancelling the returned
operation will stop the copying and delete the destination backup. Concurrent CopyBackup
requests can run on the same source backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       String backupId = "backupId2121930365";
       BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       Timestamp expireTime = Timestamp.newBuilder().build();
       Backup response =
           databaseAdminClient.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The name of the destination instance that will contain the backup copy. Values are of the form: `projects/<project>/instances/<instance>`. |
| `backupId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the backup copy. The `backup_id` appended to `parent` forms the full backup_uri of the form `projects/<project>/instances/<instance>/backups/<backup>`. |
| `sourceBackup` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupName` Required. The source backup to be copied. The source backup needs to be in READY state for it to be copied. Once CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration until CopyBackup is finished. Values are of the form: `projects/<project>/instances/<instance>/backups/<backup>`. |
| `expireTime` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` Required. The expiration time of the backup in microsecond granularity. The expiration time must be at least 6 hours and at most 366 days from the `create_time` of the source backup. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupMetadata>` |   |

### copyBackupAsync(InstanceName parent, String backupId, String sourceBackup, Timestamp expireTime)

    public final OperationFuture<Backup,CopyBackupMetadata> copyBackupAsync(InstanceName parent, String backupId, String sourceBackup, Timestamp expireTime)

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and can be used to track copying of the backup. The operation is associated with the
destination backup. The metadata field type is
CopyBackupMetadata. The
response field type is
Backup, if successful. Cancelling the returned
operation will stop the copying and delete the destination backup. Concurrent CopyBackup
requests can run on the same source backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       String backupId = "backupId2121930365";
       String sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       Timestamp expireTime = Timestamp.newBuilder().build();
       Backup response =
           databaseAdminClient.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The name of the destination instance that will contain the backup copy. Values are of the form: `projects/<project>/instances/<instance>`. |
| `backupId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the backup copy. The `backup_id` appended to `parent` forms the full backup_uri of the form `projects/<project>/instances/<instance>/backups/<backup>`. |
| `sourceBackup` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The source backup to be copied. The source backup needs to be in READY state for it to be copied. Once CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration until CopyBackup is finished. Values are of the form: `projects/<project>/instances/<instance>/backups/<backup>`. |
| `expireTime` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` Required. The expiration time of the backup in microsecond granularity. The expiration time must be at least 6 hours and at most 366 days from the `create_time` of the source backup. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupMetadata>` |   |

### copyBackupAsync(String parent, String backupId, BackupName sourceBackup, Timestamp expireTime)

    public final OperationFuture<Backup,CopyBackupMetadata> copyBackupAsync(String parent, String backupId, BackupName sourceBackup, Timestamp expireTime)

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and can be used to track copying of the backup. The operation is associated with the
destination backup. The metadata field type is
CopyBackupMetadata. The
response field type is
Backup, if successful. Cancelling the returned
operation will stop the copying and delete the destination backup. Concurrent CopyBackup
requests can run on the same source backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       String backupId = "backupId2121930365";
       BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       Timestamp expireTime = Timestamp.newBuilder().build();
       Backup response =
           databaseAdminClient.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the destination instance that will contain the backup copy. Values are of the form: `projects/<project>/instances/<instance>`. |
| `backupId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the backup copy. The `backup_id` appended to `parent` forms the full backup_uri of the form `projects/<project>/instances/<instance>/backups/<backup>`. |
| `sourceBackup` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupName` Required. The source backup to be copied. The source backup needs to be in READY state for it to be copied. Once CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration until CopyBackup is finished. Values are of the form: `projects/<project>/instances/<instance>/backups/<backup>`. |
| `expireTime` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` Required. The expiration time of the backup in microsecond granularity. The expiration time must be at least 6 hours and at most 366 days from the `create_time` of the source backup. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupMetadata>` |   |

### copyBackupAsync(String parent, String backupId, String sourceBackup, Timestamp expireTime)

    public final OperationFuture<Backup,CopyBackupMetadata> copyBackupAsync(String parent, String backupId, String sourceBackup, Timestamp expireTime)

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and can be used to track copying of the backup. The operation is associated with the
destination backup. The metadata field type is
CopyBackupMetadata. The
response field type is
Backup, if successful. Cancelling the returned
operation will stop the copying and delete the destination backup. Concurrent CopyBackup
requests can run on the same source backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       String backupId = "backupId2121930365";
       String sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       Timestamp expireTime = Timestamp.newBuilder().build();
       Backup response =
           databaseAdminClient.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the destination instance that will contain the backup copy. Values are of the form: `projects/<project>/instances/<instance>`. |
| `backupId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the backup copy. The `backup_id` appended to `parent` forms the full backup_uri of the form `projects/<project>/instances/<instance>/backups/<backup>`. |
| `sourceBackup` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The source backup to be copied. The source backup needs to be in READY state for it to be copied. Once CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration until CopyBackup is finished. Values are of the form: `projects/<project>/instances/<instance>/backups/<backup>`. |
| `expireTime` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` Required. The expiration time of the backup in microsecond granularity. The expiration time must be at least 6 hours and at most 366 days from the `create_time` of the source backup. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupMetadata>` |   |

### copyBackupCallable()

    public final UnaryCallable<CopyBackupRequest,Operation> copyBackupCallable()

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and can be used to track copying of the backup. The operation is associated with the
destination backup. The metadata field type is
CopyBackupMetadata. The
response field type is
Backup, if successful. Cancelling the returned
operation will stop the copying and delete the destination backup. Concurrent CopyBackup
requests can run on the same source backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CopyBackupRequest request =
           CopyBackupRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setBackupId("backupId2121930365")
               .setSourceBackup(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .setExpireTime(Timestamp.newBuilder().build())
               .setEncryptionConfig(CopyBackupEncryptionConfig.newBuilder().build())
               .build();
       ApiFuture<Operation> future = databaseAdminClient.copyBackupCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### copyBackupOperationCallable()

    public final OperationCallable<CopyBackupRequest,Backup,CopyBackupMetadata> copyBackupOperationCallable()

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and can be used to track copying of the backup. The operation is associated with the
destination backup. The metadata field type is
CopyBackupMetadata. The
response field type is
Backup, if successful. Cancelling the returned
operation will stop the copying and delete the destination backup. Concurrent CopyBackup
requests can run on the same source backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CopyBackupRequest request =
           CopyBackupRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setBackupId("backupId2121930365")
               .setSourceBackup(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .setExpireTime(Timestamp.newBuilder().build())
               .setEncryptionConfig(CopyBackupEncryptionConfig.newBuilder().build())
               .build();
       OperationFuture<Backup, CopyBackupMetadata> future =
           databaseAdminClient.copyBackupOperationCallable().futureCall(request);
       // Do something.
       Backup response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupMetadata>` |   |

### createBackupAsync(CreateBackupRequest request)

    public final OperationFuture<Backup,CreateBackupMetadata> createBackupAsync(CreateBackupRequest request)

Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and 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. There can be only one pending backup
creation per database. Backup creation of different databases can run concurrently.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CreateBackupRequest request =
           CreateBackupRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setBackupId("backupId2121930365")
               .setBackup(Backup.newBuilder().build())
               .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build())
               .build();
       Backup response = databaseAdminClient.createBackupAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupMetadata>` |   |

### createBackupAsync(InstanceName parent, Backup backup, String backupId)

    public final OperationFuture<Backup,CreateBackupMetadata> createBackupAsync(InstanceName parent, Backup backup, String backupId)

Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and 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. There can be only one pending backup
creation per database. Backup creation of different databases can run concurrently.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       Backup backup = Backup.newBuilder().build();
       String backupId = "backupId2121930365";
       Backup response = databaseAdminClient.createBackupAsync(parent, backup, backupId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The name of the instance in which the backup will be created. This must be the same instance that contains the database the backup will be created from. The backup will be stored in the location(s) specified in the instance configuration of this instance. Values are of the form `projects/<project>/instances/<instance>`. |
| `backup` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup` Required. The backup to create. |
| `backupId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the backup to be created. The `backup_id` appended to `parent` forms the full backup name of the form `projects/<project>/instances/<instance>/backups/<backup_id>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupMetadata>` |   |

### createBackupAsync(String parent, Backup backup, String backupId)

    public final OperationFuture<Backup,CreateBackupMetadata> createBackupAsync(String parent, Backup backup, String backupId)

Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and 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. There can be only one pending backup
creation per database. Backup creation of different databases can run concurrently.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       Backup backup = Backup.newBuilder().build();
       String backupId = "backupId2121930365";
       Backup response = databaseAdminClient.createBackupAsync(parent, backup, backupId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the instance in which the backup will be created. This must be the same instance that contains the database the backup will be created from. The backup will be stored in the location(s) specified in the instance configuration of this instance. Values are of the form `projects/<project>/instances/<instance>`. |
| `backup` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup` Required. The backup to create. |
| `backupId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the backup to be created. The `backup_id` appended to `parent` forms the full backup name of the form `projects/<project>/instances/<instance>/backups/<backup_id>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupMetadata>` |   |

### createBackupCallable()

    public final UnaryCallable<CreateBackupRequest,Operation> createBackupCallable()

Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and 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. There can be only one pending backup
creation per database. Backup creation of different databases can run concurrently.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CreateBackupRequest request =
           CreateBackupRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setBackupId("backupId2121930365")
               .setBackup(Backup.newBuilder().build())
               .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build())
               .build();
       ApiFuture<Operation> future = databaseAdminClient.createBackupCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createBackupOperationCallable()

    public final OperationCallable<CreateBackupRequest,Backup,CreateBackupMetadata> createBackupOperationCallable()

Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
and 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. There can be only one pending backup
creation per database. Backup creation of different databases can run concurrently.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CreateBackupRequest request =
           CreateBackupRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setBackupId("backupId2121930365")
               .setBackup(Backup.newBuilder().build())
               .setEncryptionConfig(CreateBackupEncryptionConfig.newBuilder().build())
               .build();
       OperationFuture<Backup, CreateBackupMetadata> future =
           databaseAdminClient.createBackupOperationCallable().futureCall(request);
       // Do something.
       Backup response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupMetadata>` |   |

### createBackupSchedule(CreateBackupScheduleRequest request)

    public final BackupSchedule createBackupSchedule(CreateBackupScheduleRequest request)

Creates a new backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CreateBackupScheduleRequest request =
           CreateBackupScheduleRequest.newBuilder()
               .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setBackupScheduleId("backupScheduleId1704974708")
               .setBackupSchedule(BackupSchedule.newBuilder().build())
               .build();
       BackupSchedule response = databaseAdminClient.createBackupSchedule(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupScheduleRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` |   |

### createBackupSchedule(DatabaseName parent, BackupSchedule backupSchedule, String backupScheduleId)

    public final BackupSchedule createBackupSchedule(DatabaseName parent, BackupSchedule backupSchedule, String backupScheduleId)

Creates a new backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
       String backupScheduleId = "backupScheduleId1704974708";
       BackupSchedule response =
           databaseAdminClient.createBackupSchedule(parent, backupSchedule, backupScheduleId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Required. The name of the database that this backup schedule applies to. |
| `backupSchedule` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` Required. The backup schedule to create. |
| `backupScheduleId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Id to use for the backup schedule. The `backup_schedule_id` appended to `parent` forms the full backup schedule name of the form `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` |   |

### createBackupSchedule(String parent, BackupSchedule backupSchedule, String backupScheduleId)

    public final BackupSchedule createBackupSchedule(String parent, BackupSchedule backupSchedule, String backupScheduleId)

Creates a new backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
       String backupScheduleId = "backupScheduleId1704974708";
       BackupSchedule response =
           databaseAdminClient.createBackupSchedule(parent, backupSchedule, backupScheduleId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the database that this backup schedule applies to. |
| `backupSchedule` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` Required. The backup schedule to create. |
| `backupScheduleId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The Id to use for the backup schedule. The `backup_schedule_id` appended to `parent` forms the full backup schedule name of the form `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` |   |

### createBackupScheduleCallable()

    public final UnaryCallable<CreateBackupScheduleRequest,BackupSchedule> createBackupScheduleCallable()

Creates a new backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CreateBackupScheduleRequest request =
           CreateBackupScheduleRequest.newBuilder()
               .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setBackupScheduleId("backupScheduleId1704974708")
               .setBackupSchedule(BackupSchedule.newBuilder().build())
               .build();
       ApiFuture<BackupSchedule> future =
           databaseAdminClient.createBackupScheduleCallable().futureCall(request);
       // Do something.
       BackupSchedule response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateBackupScheduleRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule>` |   |

### createDatabaseAsync(CreateDatabaseRequest request)

    public final OperationFuture<Database,CreateDatabaseMetadata> createDatabaseAsync(CreateDatabaseRequest request)

Creates a new Cloud Spanner database and starts to prepare it for serving. The returned
long-running operation will have a name of the format
`<database_name>/operations/<operation_id>` and can be used to track preparation of
the database. The metadata field type is
CreateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CreateDatabaseRequest request =
           CreateDatabaseRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setCreateStatement("createStatement744686547")
               .addAllExtraStatements(new ArrayList<String>())
               .setEncryptionConfig(EncryptionConfig.newBuilder().build())
               .setDatabaseDialect(DatabaseDialect.forNumber(0))
               .setProtoDescriptors(ByteString.EMPTY)
               .build();
       Database response = databaseAdminClient.createDatabaseAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateDatabaseRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateDatabaseMetadata>` |   |

### createDatabaseAsync(InstanceName parent, String createStatement)

    public final OperationFuture<Database,CreateDatabaseMetadata> createDatabaseAsync(InstanceName parent, String createStatement)

Creates a new Cloud Spanner database and starts to prepare it for serving. The returned
long-running operation will have a name of the format
`<database_name>/operations/<operation_id>` and can be used to track preparation of
the database. The metadata field type is
CreateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       String createStatement = "createStatement744686547";
       Database response = databaseAdminClient.createDatabaseAsync(parent, createStatement).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The name of the instance that will serve the new database. Values are of the form `projects/<project>/instances/<instance>`. |
| `createStatement` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. A `CREATE DATABASE` statement, which specifies the ID of the new database. The database ID must conform to the regular expression `a-z*[a-z0-9]` and be between 2 and 30 characters in length. If the database ID is a reserved word or if it contains a hyphen, the database ID must be enclosed in backticks (\`` ` \`\`). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateDatabaseMetadata>` |   |

### createDatabaseAsync(String parent, String createStatement)

    public final OperationFuture<Database,CreateDatabaseMetadata> createDatabaseAsync(String parent, String createStatement)

Creates a new Cloud Spanner database and starts to prepare it for serving. The returned
long-running operation will have a name of the format
`<database_name>/operations/<operation_id>` and can be used to track preparation of
the database. The metadata field type is
CreateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       String createStatement = "createStatement744686547";
       Database response = databaseAdminClient.createDatabaseAsync(parent, createStatement).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the instance that will serve the new database. Values are of the form `projects/<project>/instances/<instance>`. |
| `createStatement` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. A `CREATE DATABASE` statement, which specifies the ID of the new database. The database ID must conform to the regular expression `a-z*[a-z0-9]` and be between 2 and 30 characters in length. If the database ID is a reserved word or if it contains a hyphen, the database ID must be enclosed in backticks (\`` ` \`\`). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateDatabaseMetadata>` |   |

### createDatabaseCallable()

    public final UnaryCallable<CreateDatabaseRequest,Operation> createDatabaseCallable()

Creates a new Cloud Spanner database and starts to prepare it for serving. The returned
long-running operation will have a name of the format
`<database_name>/operations/<operation_id>` and can be used to track preparation of
the database. The metadata field type is
CreateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CreateDatabaseRequest request =
           CreateDatabaseRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setCreateStatement("createStatement744686547")
               .addAllExtraStatements(new ArrayList<String>())
               .setEncryptionConfig(EncryptionConfig.newBuilder().build())
               .setDatabaseDialect(DatabaseDialect.forNumber(0))
               .setProtoDescriptors(ByteString.EMPTY)
               .build();
       ApiFuture<Operation> future =
           databaseAdminClient.createDatabaseCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateDatabaseRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createDatabaseOperationCallable()

    public final OperationCallable<CreateDatabaseRequest,Database,CreateDatabaseMetadata> createDatabaseOperationCallable()

Creates a new Cloud Spanner database and starts to prepare it for serving. The returned
long-running operation will have a name of the format
`<database_name>/operations/<operation_id>` and can be used to track preparation of
the database. The metadata field type is
CreateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       CreateDatabaseRequest request =
           CreateDatabaseRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setCreateStatement("createStatement744686547")
               .addAllExtraStatements(new ArrayList<String>())
               .setEncryptionConfig(EncryptionConfig.newBuilder().build())
               .setDatabaseDialect(DatabaseDialect.forNumber(0))
               .setProtoDescriptors(ByteString.EMPTY)
               .build();
       OperationFuture<Database, CreateDatabaseMetadata> future =
           databaseAdminClient.createDatabaseOperationCallable().futureCall(request);
       // Do something.
       Database response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateDatabaseRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CreateDatabaseMetadata>` |   |

### deleteBackup(BackupName name)

    public final void deleteBackup(BackupName name)

Deletes a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       databaseAdminClient.deleteBackup(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupName` Required. Name of the backup to delete. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. |

### deleteBackup(DeleteBackupRequest request)

    public final void deleteBackup(DeleteBackupRequest request)

Deletes a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DeleteBackupRequest request =
           DeleteBackupRequest.newBuilder()
               .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .build();
       databaseAdminClient.deleteBackup(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DeleteBackupRequest` The request object containing all of the parameters for the API call. |

### deleteBackup(String name)

    public final void deleteBackup(String name)

Deletes a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       databaseAdminClient.deleteBackup(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Name of the backup to delete. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. |

### deleteBackupCallable()

    public final UnaryCallable<DeleteBackupRequest,Empty> deleteBackupCallable()

Deletes a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DeleteBackupRequest request =
           DeleteBackupRequest.newBuilder()
               .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .build();
       ApiFuture<Empty> future = databaseAdminClient.deleteBackupCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DeleteBackupRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### deleteBackupSchedule(BackupScheduleName name)

    public final void deleteBackupSchedule(BackupScheduleName name)

Deletes a backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       BackupScheduleName name =
           BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]");
       databaseAdminClient.deleteBackupSchedule(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupScheduleName` Required. The name of the schedule to delete. Values are of the form `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. |

### deleteBackupSchedule(DeleteBackupScheduleRequest request)

    public final void deleteBackupSchedule(DeleteBackupScheduleRequest request)

Deletes a backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DeleteBackupScheduleRequest request =
           DeleteBackupScheduleRequest.newBuilder()
               .setName(
                   BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]")
                       .toString())
               .build();
       databaseAdminClient.deleteBackupSchedule(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest` The request object containing all of the parameters for the API call. |

### deleteBackupSchedule(String name)

    public final void deleteBackupSchedule(String name)

Deletes a backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String name =
           BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]").toString();
       databaseAdminClient.deleteBackupSchedule(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the schedule to delete. Values are of the form `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. |

### deleteBackupScheduleCallable()

    public final UnaryCallable<DeleteBackupScheduleRequest,Empty> deleteBackupScheduleCallable()

Deletes a backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DeleteBackupScheduleRequest request =
           DeleteBackupScheduleRequest.newBuilder()
               .setName(
                   BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]")
                       .toString())
               .build();
       ApiFuture<Empty> future =
           databaseAdminClient.deleteBackupScheduleCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DeleteBackupScheduleRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### dropDatabase(DatabaseName database)

    public final void dropDatabase(DatabaseName database)

Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
retained according to their `expire_time`. Note: Cloud Spanner might continue to accept
requests for a few seconds after the database has been deleted.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       databaseAdminClient.dropDatabase(database);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Required. The database to be dropped. |

### dropDatabase(DropDatabaseRequest request)

    public final void dropDatabase(DropDatabaseRequest request)

Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
retained according to their `expire_time`. Note: Cloud Spanner might continue to accept
requests for a few seconds after the database has been deleted.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DropDatabaseRequest request =
           DropDatabaseRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .build();
       databaseAdminClient.dropDatabase(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DropDatabaseRequest` The request object containing all of the parameters for the API call. |

### dropDatabase(String database)

    public final void dropDatabase(String database)

Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
retained according to their `expire_time`. Note: Cloud Spanner might continue to accept
requests for a few seconds after the database has been deleted.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       databaseAdminClient.dropDatabase(database);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The database to be dropped. |

### dropDatabaseCallable()

    public final UnaryCallable<DropDatabaseRequest,Empty> dropDatabaseCallable()

Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
retained according to their `expire_time`. Note: Cloud Spanner might continue to accept
requests for a few seconds after the database has been deleted.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DropDatabaseRequest request =
           DropDatabaseRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .build();
       ApiFuture<Empty> future = databaseAdminClient.dropDatabaseCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DropDatabaseRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### getBackup(BackupName name)

    public final Backup getBackup(BackupName name)

Gets metadata on a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       Backup response = databaseAdminClient.getBackup(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupName` Required. Name of the backup. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup` |   |

### getBackup(GetBackupRequest request)

    public final Backup getBackup(GetBackupRequest request)

Gets metadata on a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetBackupRequest request =
           GetBackupRequest.newBuilder()
               .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .build();
       Backup response = databaseAdminClient.getBackup(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetBackupRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup` |   |

### getBackup(String name)

    public final Backup getBackup(String name)

Gets metadata on a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       Backup response = databaseAdminClient.getBackup(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Name of the backup. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup` |   |

### getBackupCallable()

    public final UnaryCallable<GetBackupRequest,Backup> getBackupCallable()

Gets metadata on a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetBackupRequest request =
           GetBackupRequest.newBuilder()
               .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .build();
       ApiFuture<Backup> future = databaseAdminClient.getBackupCallable().futureCall(request);
       // Do something.
       Backup response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetBackupRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup>` |   |

### getBackupSchedule(BackupScheduleName name)

    public final BackupSchedule getBackupSchedule(BackupScheduleName name)

Gets backup schedule for the input schedule name.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       BackupScheduleName name =
           BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]");
       BackupSchedule response = databaseAdminClient.getBackupSchedule(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupScheduleName` Required. The name of the schedule to retrieve. Values are of the form `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` |   |

### getBackupSchedule(GetBackupScheduleRequest request)

    public final BackupSchedule getBackupSchedule(GetBackupScheduleRequest request)

Gets backup schedule for the input schedule name.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetBackupScheduleRequest request =
           GetBackupScheduleRequest.newBuilder()
               .setName(
                   BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]")
                       .toString())
               .build();
       BackupSchedule response = databaseAdminClient.getBackupSchedule(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetBackupScheduleRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` |   |

### getBackupSchedule(String name)

    public final BackupSchedule getBackupSchedule(String name)

Gets backup schedule for the input schedule name.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String name =
           BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]").toString();
       BackupSchedule response = databaseAdminClient.getBackupSchedule(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the schedule to retrieve. Values are of the form `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` |   |

### getBackupScheduleCallable()

    public final UnaryCallable<GetBackupScheduleRequest,BackupSchedule> getBackupScheduleCallable()

Gets backup schedule for the input schedule name.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetBackupScheduleRequest request =
           GetBackupScheduleRequest.newBuilder()
               .setName(
                   BackupScheduleName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SCHEDULE]")
                       .toString())
               .build();
       ApiFuture<BackupSchedule> future =
           databaseAdminClient.getBackupScheduleCallable().futureCall(request);
       // Do something.
       BackupSchedule response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetBackupScheduleRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule>` |   |

### getDatabase(DatabaseName name)

    public final Database getDatabase(DatabaseName name)

Gets the state of a Cloud Spanner database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName name = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       Database response = databaseAdminClient.getDatabase(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Required. The name of the requested database. Values are of the form `projects/<project>/instances/<instance>/databases/<database>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database` |   |

### getDatabase(GetDatabaseRequest request)

    public final Database getDatabase(GetDatabaseRequest request)

Gets the state of a Cloud Spanner database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetDatabaseRequest request =
           GetDatabaseRequest.newBuilder()
               .setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .build();
       Database response = databaseAdminClient.getDatabase(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetDatabaseRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database` |   |

### getDatabase(String name)

    public final Database getDatabase(String name)

Gets the state of a Cloud Spanner database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String name = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       Database response = databaseAdminClient.getDatabase(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the requested database. Values are of the form `projects/<project>/instances/<instance>/databases/<database>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database` |   |

### getDatabaseCallable()

    public final UnaryCallable<GetDatabaseRequest,Database> getDatabaseCallable()

Gets the state of a Cloud Spanner database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetDatabaseRequest request =
           GetDatabaseRequest.newBuilder()
               .setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .build();
       ApiFuture<Database> future = databaseAdminClient.getDatabaseCallable().futureCall(request);
       // Do something.
       Database response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetDatabaseRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database>` |   |

### getDatabaseDdl(DatabaseName database)

    public final GetDatabaseDdlResponse getDatabaseDdl(DatabaseName database)

Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This
method does not show pending schema updates, those may be queried using the
Operations API.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       GetDatabaseDdlResponse response = databaseAdminClient.getDatabaseDdl(database);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Required. The database whose schema we wish to get. Values are of the form `projects/<project>/instances/<instance>/databases/<database>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetDatabaseDdlResponse` |   |

### getDatabaseDdl(GetDatabaseDdlRequest request)

    public final GetDatabaseDdlResponse getDatabaseDdl(GetDatabaseDdlRequest request)

Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This
method does not show pending schema updates, those may be queried using the
Operations API.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetDatabaseDdlRequest request =
           GetDatabaseDdlRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .build();
       GetDatabaseDdlResponse response = databaseAdminClient.getDatabaseDdl(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetDatabaseDdlRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetDatabaseDdlResponse` |   |

### getDatabaseDdl(String database)

    public final GetDatabaseDdlResponse getDatabaseDdl(String database)

Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This
method does not show pending schema updates, those may be queried using the
Operations API.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       GetDatabaseDdlResponse response = databaseAdminClient.getDatabaseDdl(database);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The database whose schema we wish to get. Values are of the form `projects/<project>/instances/<instance>/databases/<database>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetDatabaseDdlResponse` |   |

### getDatabaseDdlCallable()

    public final UnaryCallable<GetDatabaseDdlRequest,GetDatabaseDdlResponse> getDatabaseDdlCallable()

Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This
method does not show pending schema updates, those may be queried using the
Operations API.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetDatabaseDdlRequest request =
           GetDatabaseDdlRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .build();
       ApiFuture<GetDatabaseDdlResponse> future =
           databaseAdminClient.getDatabaseDdlCallable().futureCall(request);
       // Do something.
       GetDatabaseDdlResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetDatabaseDdlRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.GetDatabaseDdlResponse>` |   |

### getHttpJsonOperationsClient()

    public final OperationsClient getHttpJsonOperationsClient()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.httpjson.longrunning.OperationsClient.html` |   |

### getIamPolicy(ResourceName resource)

    public final Policy getIamPolicy(ResourceName resource)

Gets the access control policy for a database or backup resource. Returns an empty policy if a
database or backup exists but does not have a policy set.

Authorization requires `spanner.databases.getIamPolicy` permission on
resource. For backups, authorization requires
`spanner.backups.getIamPolicy` permission on
resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       Policy response = databaseAdminClient.getIamPolicy(resource);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicy(GetIamPolicyRequest request)

    public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a database or backup resource. Returns an empty policy if a
database or backup exists but does not have a policy set.

Authorization requires `spanner.databases.getIamPolicy` permission on
resource. For backups, authorization requires
`spanner.backups.getIamPolicy` permission on
resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       Policy response = databaseAdminClient.getIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.GetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicy(String resource)

    public final Policy getIamPolicy(String resource)

Gets the access control policy for a database or backup resource. Returns an empty policy if a
database or backup exists but does not have a policy set.

Authorization requires `spanner.databases.getIamPolicy` permission on
resource. For backups, authorization requires
`spanner.backups.getIamPolicy` permission on
resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       Policy response = databaseAdminClient.getIamPolicy(resource);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicyCallable()

    public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a database or backup resource. Returns an empty policy if a
database or backup exists but does not have a policy set.

Authorization requires `spanner.databases.getIamPolicy` permission on
resource. For backups, authorization requires
`spanner.backups.getIamPolicy` permission on
resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       ApiFuture<Policy> future = databaseAdminClient.getIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### getOperationsClient()

    public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.OperationsClient.html` |   |

### getSettings()

    public final DatabaseAdminSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminSettings` |   |

### getStub()

    public DatabaseAdminStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.stub.DatabaseAdminStub` |   |

### internalUpdateGraphOperation(DatabaseName database, String operationId)

    public final InternalUpdateGraphOperationResponse internalUpdateGraphOperation(DatabaseName database, String operationId)

This is an internal API called by Spanner Graph jobs. You should never need to call this API
directly.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       String operationId = "operationId129704162";
       InternalUpdateGraphOperationResponse response =
           databaseAdminClient.internalUpdateGraphOperation(database, operationId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Internal field, do not use directly. |
| `operationId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Internal field, do not use directly. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse` |   |

### internalUpdateGraphOperation(InternalUpdateGraphOperationRequest request)

    public final InternalUpdateGraphOperationResponse internalUpdateGraphOperation(InternalUpdateGraphOperationRequest request)

This is an internal API called by Spanner Graph jobs. You should never need to call this API
directly.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InternalUpdateGraphOperationRequest request =
           InternalUpdateGraphOperationRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setOperationId("operationId129704162")
               .setVmIdentityToken("vmIdentityToken-417652124")
               .setProgress(-1001078227)
               .setStatus(Status.newBuilder().build())
               .build();
       InternalUpdateGraphOperationResponse response =
           databaseAdminClient.internalUpdateGraphOperation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse` |   |

### internalUpdateGraphOperation(String database, String operationId)

    public final InternalUpdateGraphOperationResponse internalUpdateGraphOperation(String database, String operationId)

This is an internal API called by Spanner Graph jobs. You should never need to call this API
directly.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       String operationId = "operationId129704162";
       InternalUpdateGraphOperationResponse response =
           databaseAdminClient.internalUpdateGraphOperation(database, operationId);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Internal field, do not use directly. |
| `operationId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Internal field, do not use directly. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse` |   |

### internalUpdateGraphOperationCallable()

    public final UnaryCallable<InternalUpdateGraphOperationRequest,InternalUpdateGraphOperationResponse> internalUpdateGraphOperationCallable()

This is an internal API called by Spanner Graph jobs. You should never need to call this API
directly.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InternalUpdateGraphOperationRequest request =
           InternalUpdateGraphOperationRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setOperationId("operationId129704162")
               .setVmIdentityToken("vmIdentityToken-417652124")
               .setProgress(-1001078227)
               .setStatus(Status.newBuilder().build())
               .build();
       ApiFuture<InternalUpdateGraphOperationResponse> future =
           databaseAdminClient.internalUpdateGraphOperationCallable().futureCall(request);
       // Do something.
       InternalUpdateGraphOperationResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse>` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listBackupOperations(InstanceName parent)

    public final DatabaseAdminClient.ListBackupOperationsPagedResponse listBackupOperations(InstanceName parent)

Lists the backup long-running operations in the given instance.
A backup operation has a name of the form
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations. Operations
returned are ordered by `operation.metadata.value.progress.start_time` in descending order
starting from the most recently started operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       for (Operation element : databaseAdminClient.listBackupOperations(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The instance of the backup operations. Values are of the form `projects/<project>/instances/<instance>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse` |   |

### listBackupOperations(ListBackupOperationsRequest request)

    public final DatabaseAdminClient.ListBackupOperationsPagedResponse listBackupOperations(ListBackupOperationsRequest request)

Lists the backup long-running operations in the given instance.
A backup operation has a name of the form
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations. Operations
returned are ordered by `operation.metadata.value.progress.start_time` in descending order
starting from the most recently started operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupOperationsRequest request =
           ListBackupOperationsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Operation element : databaseAdminClient.listBackupOperations(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupOperationsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse` |   |

### listBackupOperations(String parent)

    public final DatabaseAdminClient.ListBackupOperationsPagedResponse listBackupOperations(String parent)

Lists the backup long-running operations in the given instance.
A backup operation has a name of the form
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations. Operations
returned are ordered by `operation.metadata.value.progress.start_time` in descending order
starting from the most recently started operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       for (Operation element : databaseAdminClient.listBackupOperations(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The instance of the backup operations. Values are of the form `projects/<project>/instances/<instance>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse` |   |

### listBackupOperationsCallable()

    public final UnaryCallable<ListBackupOperationsRequest,ListBackupOperationsResponse> listBackupOperationsCallable()

Lists the backup long-running operations in the given instance.
A backup operation has a name of the form
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations. Operations
returned are ordered by `operation.metadata.value.progress.start_time` in descending order
starting from the most recently started operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupOperationsRequest request =
           ListBackupOperationsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListBackupOperationsResponse response =
             databaseAdminClient.listBackupOperationsCallable().call(request);
         for (Operation element : response.getOperationsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupOperationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupOperationsResponse>` |   |

### listBackupOperationsPagedCallable()

    public final UnaryCallable<ListBackupOperationsRequest,DatabaseAdminClient.ListBackupOperationsPagedResponse> listBackupOperationsPagedCallable()

Lists the backup long-running operations in the given instance.
A backup operation has a name of the form
`projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations. Operations
returned are ordered by `operation.metadata.value.progress.start_time` in descending order
starting from the most recently started operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupOperationsRequest request =
           ListBackupOperationsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Operation> future =
           databaseAdminClient.listBackupOperationsPagedCallable().futureCall(request);
       // Do something.
       for (Operation element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupOperationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse>` |   |

### listBackupSchedules(DatabaseName parent)

    public final DatabaseAdminClient.ListBackupSchedulesPagedResponse listBackupSchedules(DatabaseName parent)

Lists all the backup schedules for the database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       for (BackupSchedule element : databaseAdminClient.listBackupSchedules(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Required. Database is the parent resource whose backup schedules should be listed. Values are of the form projects/\<project\>/instances/\<instance\>/databases/\<database\> |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse` |   |

### listBackupSchedules(ListBackupSchedulesRequest request)

    public final DatabaseAdminClient.ListBackupSchedulesPagedResponse listBackupSchedules(ListBackupSchedulesRequest request)

Lists all the backup schedules for the database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupSchedulesRequest request =
           ListBackupSchedulesRequest.newBuilder()
               .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (BackupSchedule element : databaseAdminClient.listBackupSchedules(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupSchedulesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse` |   |

### listBackupSchedules(String parent)

    public final DatabaseAdminClient.ListBackupSchedulesPagedResponse listBackupSchedules(String parent)

Lists all the backup schedules for the database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       for (BackupSchedule element : databaseAdminClient.listBackupSchedules(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Database is the parent resource whose backup schedules should be listed. Values are of the form projects/\<project\>/instances/\<instance\>/databases/\<database\> |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse` |   |

### listBackupSchedulesCallable()

    public final UnaryCallable<ListBackupSchedulesRequest,ListBackupSchedulesResponse> listBackupSchedulesCallable()

Lists all the backup schedules for the database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupSchedulesRequest request =
           ListBackupSchedulesRequest.newBuilder()
               .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListBackupSchedulesResponse response =
             databaseAdminClient.listBackupSchedulesCallable().call(request);
         for (BackupSchedule element : response.getBackupSchedulesList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupSchedulesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupSchedulesResponse>` |   |

### listBackupSchedulesPagedCallable()

    public final UnaryCallable<ListBackupSchedulesRequest,DatabaseAdminClient.ListBackupSchedulesPagedResponse> listBackupSchedulesPagedCallable()

Lists all the backup schedules for the database.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupSchedulesRequest request =
           ListBackupSchedulesRequest.newBuilder()
               .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<BackupSchedule> future =
           databaseAdminClient.listBackupSchedulesPagedCallable().futureCall(request);
       // Do something.
       for (BackupSchedule element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupSchedulesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupSchedulesPagedResponse>` |   |

### listBackups(InstanceName parent)

    public final DatabaseAdminClient.ListBackupsPagedResponse listBackups(InstanceName parent)

Lists completed and pending backups. Backups returned are ordered by `create_time` in
descending order, starting from the most recent `create_time`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       for (Backup element : databaseAdminClient.listBackups(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The instance to list backups from. Values are of the form `projects/<project>/instances/<instance>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse` |   |

### listBackups(ListBackupsRequest request)

    public final DatabaseAdminClient.ListBackupsPagedResponse listBackups(ListBackupsRequest request)

Lists completed and pending backups. Backups returned are ordered by `create_time` in
descending order, starting from the most recent `create_time`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupsRequest request =
           ListBackupsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Backup element : databaseAdminClient.listBackups(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse` |   |

### listBackups(String parent)

    public final DatabaseAdminClient.ListBackupsPagedResponse listBackups(String parent)

Lists completed and pending backups. Backups returned are ordered by `create_time` in
descending order, starting from the most recent `create_time`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       for (Backup element : databaseAdminClient.listBackups(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The instance to list backups from. Values are of the form `projects/<project>/instances/<instance>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse` |   |

### listBackupsCallable()

    public final UnaryCallable<ListBackupsRequest,ListBackupsResponse> listBackupsCallable()

Lists completed and pending backups. Backups returned are ordered by `create_time` in
descending order, starting from the most recent `create_time`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupsRequest request =
           ListBackupsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListBackupsResponse response = databaseAdminClient.listBackupsCallable().call(request);
         for (Backup element : response.getBackupsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupsResponse>` |   |

### listBackupsPagedCallable()

    public final UnaryCallable<ListBackupsRequest,DatabaseAdminClient.ListBackupsPagedResponse> listBackupsPagedCallable()

Lists completed and pending backups. Backups returned are ordered by `create_time` in
descending order, starting from the most recent `create_time`.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListBackupsRequest request =
           ListBackupsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Backup> future = databaseAdminClient.listBackupsPagedCallable().futureCall(request);
       // Do something.
       for (Backup element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListBackupsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse>` |   |

### listDatabaseOperations(InstanceName parent)

    public final DatabaseAdminClient.ListDatabaseOperationsPagedResponse listDatabaseOperations(InstanceName parent)

Lists database longrunning-operations. A database operation has
a name of the form
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       for (Operation element : databaseAdminClient.listDatabaseOperations(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The instance of the database operations. Values are of the form `projects/<project>/instances/<instance>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse` |   |

### listDatabaseOperations(ListDatabaseOperationsRequest request)

    public final DatabaseAdminClient.ListDatabaseOperationsPagedResponse listDatabaseOperations(ListDatabaseOperationsRequest request)

Lists database longrunning-operations. A database operation has
a name of the form
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabaseOperationsRequest request =
           ListDatabaseOperationsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Operation element : databaseAdminClient.listDatabaseOperations(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse` |   |

### listDatabaseOperations(String parent)

    public final DatabaseAdminClient.ListDatabaseOperationsPagedResponse listDatabaseOperations(String parent)

Lists database longrunning-operations. A database operation has
a name of the form
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       for (Operation element : databaseAdminClient.listDatabaseOperations(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The instance of the database operations. Values are of the form `projects/<project>/instances/<instance>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse` |   |

### listDatabaseOperationsCallable()

    public final UnaryCallable<ListDatabaseOperationsRequest,ListDatabaseOperationsResponse> listDatabaseOperationsCallable()

Lists database longrunning-operations. A database operation has
a name of the form
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabaseOperationsRequest request =
           ListDatabaseOperationsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListDatabaseOperationsResponse response =
             databaseAdminClient.listDatabaseOperationsCallable().call(request);
         for (Operation element : response.getOperationsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse>` |   |

### listDatabaseOperationsPagedCallable()

    public final UnaryCallable<ListDatabaseOperationsRequest,DatabaseAdminClient.ListDatabaseOperationsPagedResponse> listDatabaseOperationsPagedCallable()

Lists database longrunning-operations. A database operation has
a name of the form
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
The long-running operation metadata field type
`metadata.type_url` describes the type of the metadata. Operations returned include those that
have completed/failed/canceled within the last 7 days, and pending operations.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabaseOperationsRequest request =
           ListDatabaseOperationsRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Operation> future =
           databaseAdminClient.listDatabaseOperationsPagedCallable().futureCall(request);
       // Do something.
       for (Operation element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse>` |   |

### listDatabaseRoles(DatabaseName parent)

    public final DatabaseAdminClient.ListDatabaseRolesPagedResponse listDatabaseRoles(DatabaseName parent)

Lists Cloud Spanner database roles.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       for (DatabaseRole element : databaseAdminClient.listDatabaseRoles(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Required. The database whose roles should be listed. Values are of the form `projects/<project>/instances/<instance>/databases/<database>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse` |   |

### listDatabaseRoles(ListDatabaseRolesRequest request)

    public final DatabaseAdminClient.ListDatabaseRolesPagedResponse listDatabaseRoles(ListDatabaseRolesRequest request)

Lists Cloud Spanner database roles.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabaseRolesRequest request =
           ListDatabaseRolesRequest.newBuilder()
               .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (DatabaseRole element : databaseAdminClient.listDatabaseRoles(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabaseRolesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse` |   |

### listDatabaseRoles(String parent)

    public final DatabaseAdminClient.ListDatabaseRolesPagedResponse listDatabaseRoles(String parent)

Lists Cloud Spanner database roles.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       for (DatabaseRole element : databaseAdminClient.listDatabaseRoles(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The database whose roles should be listed. Values are of the form `projects/<project>/instances/<instance>/databases/<database>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse` |   |

### listDatabaseRolesCallable()

    public final UnaryCallable<ListDatabaseRolesRequest,ListDatabaseRolesResponse> listDatabaseRolesCallable()

Lists Cloud Spanner database roles.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabaseRolesRequest request =
           ListDatabaseRolesRequest.newBuilder()
               .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListDatabaseRolesResponse response =
             databaseAdminClient.listDatabaseRolesCallable().call(request);
         for (DatabaseRole element : response.getDatabaseRolesList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabaseRolesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabaseRolesResponse>` |   |

### listDatabaseRolesPagedCallable()

    public final UnaryCallable<ListDatabaseRolesRequest,DatabaseAdminClient.ListDatabaseRolesPagedResponse> listDatabaseRolesPagedCallable()

Lists Cloud Spanner database roles.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabaseRolesRequest request =
           ListDatabaseRolesRequest.newBuilder()
               .setParent(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<DatabaseRole> future =
           databaseAdminClient.listDatabaseRolesPagedCallable().futureCall(request);
       // Do something.
       for (DatabaseRole element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabaseRolesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseRolesPagedResponse>` |   |

### listDatabases(InstanceName parent)

    public final DatabaseAdminClient.ListDatabasesPagedResponse listDatabases(InstanceName parent)

Lists Cloud Spanner databases.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       for (Database element : databaseAdminClient.listDatabases(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The instance whose databases should be listed. Values are of the form `projects/<project>/instances/<instance>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse` |   |

### listDatabases(ListDatabasesRequest request)

    public final DatabaseAdminClient.ListDatabasesPagedResponse listDatabases(ListDatabasesRequest request)

Lists Cloud Spanner databases.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabasesRequest request =
           ListDatabasesRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Database element : databaseAdminClient.listDatabases(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabasesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse` |   |

### listDatabases(String parent)

    public final DatabaseAdminClient.ListDatabasesPagedResponse listDatabases(String parent)

Lists Cloud Spanner databases.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       for (Database element : databaseAdminClient.listDatabases(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The instance whose databases should be listed. Values are of the form `projects/<project>/instances/<instance>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse` |   |

### listDatabasesCallable()

    public final UnaryCallable<ListDatabasesRequest,ListDatabasesResponse> listDatabasesCallable()

Lists Cloud Spanner databases.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabasesRequest request =
           ListDatabasesRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListDatabasesResponse response = databaseAdminClient.listDatabasesCallable().call(request);
         for (Database element : response.getDatabasesList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabasesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabasesResponse>` |   |

### listDatabasesPagedCallable()

    public final UnaryCallable<ListDatabasesRequest,DatabaseAdminClient.ListDatabasesPagedResponse> listDatabasesPagedCallable()

Lists Cloud Spanner databases.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ListDatabasesRequest request =
           ListDatabasesRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Database> future =
           databaseAdminClient.listDatabasesPagedCallable().futureCall(request);
       // Do something.
       for (Database element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.ListDatabasesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse>` |   |

### restoreDatabaseAsync(InstanceName parent, String databaseId, BackupName backup)

    public final OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabaseAsync(InstanceName parent, String databaseId, BackupName backup)

Create a new database by restoring from a completed backup. The new database must be in the
same project and in an instance with the same instance configuration as the instance containing
the backup. The returned database long-running operation has a
name of the format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
and can be used to track the progress of the operation, and to cancel it. The
metadata field type is
RestoreDatabaseMetadata. The
response type is
Database, if successful. Cancelling the returned
operation will stop the restore and delete the database. There can be only one database being
restored into an instance at a time. Once the restore operation completes, a new restore
operation can be initiated, without waiting for the optimize operation associated with the
first restore to complete.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       String databaseId = "databaseId1688905718";
       BackupName backup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       Database response =
           databaseAdminClient.restoreDatabaseAsync(parent, databaseId, backup).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The name of the instance in which to create the restored database. This instance must be in the same project and have the same instance configuration as the instance containing the source backup. Values are of the form `projects/<project>/instances/<instance>`. |
| `databaseId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the database to create and restore to. This database must not already exist. The `database_id` appended to `parent` forms the full database name of the form `projects/<project>/instances/<instance>/databases/<database_id>`. |
| `backup` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupName` Name of the backup from which to restore. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseMetadata>` |   |

### restoreDatabaseAsync(InstanceName parent, String databaseId, String backup)

    public final OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabaseAsync(InstanceName parent, String databaseId, String backup)

Create a new database by restoring from a completed backup. The new database must be in the
same project and in an instance with the same instance configuration as the instance containing
the backup. The returned database long-running operation has a
name of the format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
and can be used to track the progress of the operation, and to cancel it. The
metadata field type is
RestoreDatabaseMetadata. The
response type is
Database, if successful. Cancelling the returned
operation will stop the restore and delete the database. There can be only one database being
restored into an instance at a time. Once the restore operation completes, a new restore
operation can be initiated, without waiting for the optimize operation associated with the
first restore to complete.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
       String databaseId = "databaseId1688905718";
       String backup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       Database response =
           databaseAdminClient.restoreDatabaseAsync(parent, databaseId, backup).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.InstanceName` Required. The name of the instance in which to create the restored database. This instance must be in the same project and have the same instance configuration as the instance containing the source backup. Values are of the form `projects/<project>/instances/<instance>`. |
| `databaseId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the database to create and restore to. This database must not already exist. The `database_id` appended to `parent` forms the full database name of the form `projects/<project>/instances/<instance>/databases/<database_id>`. |
| `backup` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Name of the backup from which to restore. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseMetadata>` |   |

### restoreDatabaseAsync(RestoreDatabaseRequest request)

    public final OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabaseAsync(RestoreDatabaseRequest request)

Create a new database by restoring from a completed backup. The new database must be in the
same project and in an instance with the same instance configuration as the instance containing
the backup. The returned database long-running operation has a
name of the format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
and can be used to track the progress of the operation, and to cancel it. The
metadata field type is
RestoreDatabaseMetadata. The
response type is
Database, if successful. Cancelling the returned
operation will stop the restore and delete the database. There can be only one database being
restored into an instance at a time. Once the restore operation completes, a new restore
operation can be initiated, without waiting for the optimize operation associated with the
first restore to complete.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       RestoreDatabaseRequest request =
           RestoreDatabaseRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setDatabaseId("databaseId1688905718")
               .setEncryptionConfig(RestoreDatabaseEncryptionConfig.newBuilder().build())
               .build();
       Database response = databaseAdminClient.restoreDatabaseAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseMetadata>` |   |

### restoreDatabaseAsync(String parent, String databaseId, BackupName backup)

    public final OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabaseAsync(String parent, String databaseId, BackupName backup)

Create a new database by restoring from a completed backup. The new database must be in the
same project and in an instance with the same instance configuration as the instance containing
the backup. The returned database long-running operation has a
name of the format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
and can be used to track the progress of the operation, and to cancel it. The
metadata field type is
RestoreDatabaseMetadata. The
response type is
Database, if successful. Cancelling the returned
operation will stop the restore and delete the database. There can be only one database being
restored into an instance at a time. Once the restore operation completes, a new restore
operation can be initiated, without waiting for the optimize operation associated with the
first restore to complete.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       String databaseId = "databaseId1688905718";
       BackupName backup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       Database response =
           databaseAdminClient.restoreDatabaseAsync(parent, databaseId, backup).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the instance in which to create the restored database. This instance must be in the same project and have the same instance configuration as the instance containing the source backup. Values are of the form `projects/<project>/instances/<instance>`. |
| `databaseId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the database to create and restore to. This database must not already exist. The `database_id` appended to `parent` forms the full database name of the form `projects/<project>/instances/<instance>/databases/<database_id>`. |
| `backup` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupName` Name of the backup from which to restore. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseMetadata>` |   |

### restoreDatabaseAsync(String parent, String databaseId, String backup)

    public final OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabaseAsync(String parent, String databaseId, String backup)

Create a new database by restoring from a completed backup. The new database must be in the
same project and in an instance with the same instance configuration as the instance containing
the backup. The returned database long-running operation has a
name of the format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
and can be used to track the progress of the operation, and to cancel it. The
metadata field type is
RestoreDatabaseMetadata. The
response type is
Database, if successful. Cancelling the returned
operation will stop the restore and delete the database. There can be only one database being
restored into an instance at a time. Once the restore operation completes, a new restore
operation can be initiated, without waiting for the optimize operation associated with the
first restore to complete.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
       String databaseId = "databaseId1688905718";
       String backup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       Database response =
           databaseAdminClient.restoreDatabaseAsync(parent, databaseId, backup).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the instance in which to create the restored database. This instance must be in the same project and have the same instance configuration as the instance containing the source backup. Values are of the form `projects/<project>/instances/<instance>`. |
| `databaseId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The id of the database to create and restore to. This database must not already exist. The `database_id` appended to `parent` forms the full database name of the form `projects/<project>/instances/<instance>/databases/<database_id>`. |
| `backup` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Name of the backup from which to restore. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseMetadata>` |   |

### restoreDatabaseCallable()

    public final UnaryCallable<RestoreDatabaseRequest,Operation> restoreDatabaseCallable()

Create a new database by restoring from a completed backup. The new database must be in the
same project and in an instance with the same instance configuration as the instance containing
the backup. The returned database long-running operation has a
name of the format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
and can be used to track the progress of the operation, and to cancel it. The
metadata field type is
RestoreDatabaseMetadata. The
response type is
Database, if successful. Cancelling the returned
operation will stop the restore and delete the database. There can be only one database being
restored into an instance at a time. Once the restore operation completes, a new restore
operation can be initiated, without waiting for the optimize operation associated with the
first restore to complete.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       RestoreDatabaseRequest request =
           RestoreDatabaseRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setDatabaseId("databaseId1688905718")
               .setEncryptionConfig(RestoreDatabaseEncryptionConfig.newBuilder().build())
               .build();
       ApiFuture<Operation> future =
           databaseAdminClient.restoreDatabaseCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### restoreDatabaseOperationCallable()

    public final OperationCallable<RestoreDatabaseRequest,Database,RestoreDatabaseMetadata> restoreDatabaseOperationCallable()

Create a new database by restoring from a completed backup. The new database must be in the
same project and in an instance with the same instance configuration as the instance containing
the backup. The returned database long-running operation has a
name of the format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
and can be used to track the progress of the operation, and to cancel it. The
metadata field type is
RestoreDatabaseMetadata. The
response type is
Database, if successful. Cancelling the returned
operation will stop the restore and delete the database. There can be only one database being
restored into an instance at a time. Once the restore operation completes, a new restore
operation can be initiated, without waiting for the optimize operation associated with the
first restore to complete.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       RestoreDatabaseRequest request =
           RestoreDatabaseRequest.newBuilder()
               .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
               .setDatabaseId("databaseId1688905718")
               .setEncryptionConfig(RestoreDatabaseEncryptionConfig.newBuilder().build())
               .build();
       OperationFuture<Database, RestoreDatabaseMetadata> future =
           databaseAdminClient.restoreDatabaseOperationCallable().futureCall(request);
       // Do something.
       Database response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.RestoreDatabaseMetadata>` |   |

### setIamPolicy(ResourceName resource, Policy policy)

    public final Policy setIamPolicy(ResourceName resource, Policy policy)

Sets the access control policy on a database or backup resource. Replaces any existing policy.

Authorization requires `spanner.databases.setIamPolicy` permission on
resource. For backups, authorization requires
`spanner.backups.setIamPolicy` permission on
resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       Policy policy = Policy.newBuilder().build();
       Policy response = databaseAdminClient.setIamPolicy(resource, policy);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `com.google.iam.v1.Policy` REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicy(SetIamPolicyRequest request)

    public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on a database or backup resource. Replaces any existing policy.

Authorization requires `spanner.databases.setIamPolicy` permission on
resource. For backups, authorization requires
`spanner.backups.setIamPolicy` permission on
resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Policy response = databaseAdminClient.setIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.SetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicy(String resource, Policy policy)

    public final Policy setIamPolicy(String resource, Policy policy)

Sets the access control policy on a database or backup resource. Replaces any existing policy.

Authorization requires `spanner.databases.setIamPolicy` permission on
resource. For backups, authorization requires
`spanner.backups.setIamPolicy` permission on
resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       Policy policy = Policy.newBuilder().build();
       Policy response = databaseAdminClient.setIamPolicy(resource, policy);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `com.google.iam.v1.Policy` REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicyCallable()

    public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on a database or backup resource. Replaces any existing policy.

Authorization requires `spanner.databases.setIamPolicy` permission on
resource. For backups, authorization requires
`spanner.backups.setIamPolicy` permission on
resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Policy> future = databaseAdminClient.setIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### testIamPermissions(ResourceName resource, List\<String\> permissions)

    public final TestIamPermissionsResponse testIamPermissions(ResourceName resource, List<String> permissions)

Returns permissions that the caller has on the specified database or backup resource.

Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND
error if the user has `spanner.databases.list` permission on the containing Cloud Spanner
instance. Otherwise returns an empty set of permissions. Calling this method on a backup that
does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list`
permission on the containing instance.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
       List<String> permissions = new ArrayList<>();
       TestIamPermissionsResponse response =
           databaseAdminClient.testIamPermissions(resource, permissions);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
| `permissions` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` The set of permissions to check for the `resource`. Permissions with wildcards (such as '\*' or 'storage.\*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissions(TestIamPermissionsRequest request)

    public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns permissions that the caller has on the specified database or backup resource.

Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND
error if the user has `spanner.databases.list` permission on the containing Cloud Spanner
instance. Otherwise returns an empty set of permissions. Calling this method on a backup that
does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list`
permission on the containing instance.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       TestIamPermissionsResponse response = databaseAdminClient.testIamPermissions(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.TestIamPermissionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissions(String resource, List\<String\> permissions)

    public final TestIamPermissionsResponse testIamPermissions(String resource, List<String> permissions)

Returns permissions that the caller has on the specified database or backup resource.

Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND
error if the user has `spanner.databases.list` permission on the containing Cloud Spanner
instance. Otherwise returns an empty set of permissions. Calling this method on a backup that
does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list`
permission on the containing instance.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString();
       List<String> permissions = new ArrayList<>();
       TestIamPermissionsResponse response =
           databaseAdminClient.testIamPermissions(resource, permissions);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
| `permissions` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` The set of permissions to check for the `resource`. Permissions with wildcards (such as '\*' or 'storage.\*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissionsCallable()

    public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns permissions that the caller has on the specified database or backup resource.

Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND
error if the user has `spanner.databases.list` permission on the containing Cloud Spanner
instance. Otherwise returns an empty set of permissions. Calling this method on a backup that
does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list`
permission on the containing instance.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       ApiFuture<TestIamPermissionsResponse> future =
           databaseAdminClient.testIamPermissionsCallable().futureCall(request);
       // Do something.
       TestIamPermissionsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>` |   |

### updateBackup(Backup backup, FieldMask updateMask)

    public final Backup updateBackup(Backup backup, FieldMask updateMask)

Updates a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       Backup backup = Backup.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Backup response = databaseAdminClient.updateBackup(backup, updateMask);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `backup` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup` Required. The backup to update. `backup.name`, and the fields to be updated as specified by `update_mask` are required. Other fields are ignored. Update is only supported for the following fields: \* `backup.expire_time`. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` 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. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup` |   |

### updateBackup(UpdateBackupRequest request)

    public final Backup updateBackup(UpdateBackupRequest request)

Updates a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateBackupRequest request =
           UpdateBackupRequest.newBuilder()
               .setBackup(Backup.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Backup response = databaseAdminClient.updateBackup(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateBackupRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup` |   |

### updateBackupCallable()

    public final UnaryCallable<UpdateBackupRequest,Backup> updateBackupCallable()

Updates a pending or completed Backup.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateBackupRequest request =
           UpdateBackupRequest.newBuilder()
               .setBackup(Backup.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Backup> future = databaseAdminClient.updateBackupCallable().futureCall(request);
       // Do something.
       Backup response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateBackupRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Backup>` |   |

### updateBackupSchedule(BackupSchedule backupSchedule, FieldMask updateMask)

    public final BackupSchedule updateBackupSchedule(BackupSchedule backupSchedule, FieldMask updateMask)

Updates a backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       BackupSchedule response =
           databaseAdminClient.updateBackupSchedule(backupSchedule, updateMask);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `backupSchedule` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` Required. The backup schedule to update. `backup_schedule.name`, and the fields to be updated as specified by `update_mask` are required. Other fields are ignored. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` 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. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` |   |

### updateBackupSchedule(UpdateBackupScheduleRequest request)

    public final BackupSchedule updateBackupSchedule(UpdateBackupScheduleRequest request)

Updates a backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateBackupScheduleRequest request =
           UpdateBackupScheduleRequest.newBuilder()
               .setBackupSchedule(BackupSchedule.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       BackupSchedule response = databaseAdminClient.updateBackupSchedule(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule` |   |

### updateBackupScheduleCallable()

    public final UnaryCallable<UpdateBackupScheduleRequest,BackupSchedule> updateBackupScheduleCallable()

Updates a backup schedule.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateBackupScheduleRequest request =
           UpdateBackupScheduleRequest.newBuilder()
               .setBackupSchedule(BackupSchedule.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<BackupSchedule> future =
           databaseAdminClient.updateBackupScheduleCallable().futureCall(request);
       // Do something.
       BackupSchedule response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateBackupScheduleRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.BackupSchedule>` |   |

### updateDatabaseAsync(Database database, FieldMask updateMask)

    public final OperationFuture<Database,UpdateDatabaseMetadata> updateDatabaseAsync(Database database, FieldMask updateMask)

Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the
database. If the named database does not exist, returns `NOT_FOUND`.

While the operation is pending:

\* The database's reconciling
field is set to true. \* Cancelling the operation is best-effort. If the cancellation
succeeds, the operation metadata's
cancel_time is set, the
updates are reverted, and the operation terminates with a `CANCELLED` status. \* New
UpdateDatabase requests will return a `FAILED_PRECONDITION` error until the pending operation
is done (returns successfully or with error). \* Reading the database via the API continues
to give the pre-request values.

Upon completion of the returned operation:

\* The new values are in effect and readable via the API. \* The database's
reconciling field becomes false.

The returned long-running operation will have a name of the
format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
and can be used to track the database modification. The
metadata field type is
UpdateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       Database database = Database.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Database response = databaseAdminClient.updateDatabaseAsync(database, updateMask).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database` Required. The database to update. The `name` field of the database is of the form `projects/<project>/instances/<instance>/databases/<database>`. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Required. The list of fields to update. Currently, only `enable_drop_protection` field can be updated. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseMetadata>` |   |

### updateDatabaseAsync(UpdateDatabaseRequest request)

    public final OperationFuture<Database,UpdateDatabaseMetadata> updateDatabaseAsync(UpdateDatabaseRequest request)

Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the
database. If the named database does not exist, returns `NOT_FOUND`.

While the operation is pending:

\* The database's reconciling
field is set to true. \* Cancelling the operation is best-effort. If the cancellation
succeeds, the operation metadata's
cancel_time is set, the
updates are reverted, and the operation terminates with a `CANCELLED` status. \* New
UpdateDatabase requests will return a `FAILED_PRECONDITION` error until the pending operation
is done (returns successfully or with error). \* Reading the database via the API continues
to give the pre-request values.

Upon completion of the returned operation:

\* The new values are in effect and readable via the API. \* The database's
reconciling field becomes false.

The returned long-running operation will have a name of the
format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
and can be used to track the database modification. The
metadata field type is
UpdateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateDatabaseRequest request =
           UpdateDatabaseRequest.newBuilder()
               .setDatabase(Database.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Database response = databaseAdminClient.updateDatabaseAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseMetadata>` |   |

### updateDatabaseCallable()

    public final UnaryCallable<UpdateDatabaseRequest,Operation> updateDatabaseCallable()

Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the
database. If the named database does not exist, returns `NOT_FOUND`.

While the operation is pending:

\* The database's reconciling
field is set to true. \* Cancelling the operation is best-effort. If the cancellation
succeeds, the operation metadata's
cancel_time is set, the
updates are reverted, and the operation terminates with a `CANCELLED` status. \* New
UpdateDatabase requests will return a `FAILED_PRECONDITION` error until the pending operation
is done (returns successfully or with error). \* Reading the database via the API continues
to give the pre-request values.

Upon completion of the returned operation:

\* The new values are in effect and readable via the API. \* The database's
reconciling field becomes false.

The returned long-running operation will have a name of the
format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
and can be used to track the database modification. The
metadata field type is
UpdateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateDatabaseRequest request =
           UpdateDatabaseRequest.newBuilder()
               .setDatabase(Database.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Operation> future =
           databaseAdminClient.updateDatabaseCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### updateDatabaseDdlAsync(DatabaseName database, List\<String\> statements)

    public final OperationFuture<Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdlAsync(DatabaseName database, List<String> statements)

Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns,
indexes, etc. The returned long-running operation will have a
name of the format `<database_name>/operations/<operation_id>` and can be used to
track execution of the schema change(s). The metadata
field type is
UpdateDatabaseDdlMetadata. The
operation has no response.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
       List<String> statements = new ArrayList<>();
       databaseAdminClient.updateDatabaseDdlAsync(database, statements).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.DatabaseName` Required. The database to update. |
| `statements` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` Required. DDL statements to be applied to the database. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>` |   |

### updateDatabaseDdlAsync(UpdateDatabaseDdlRequest request)

    public final OperationFuture<Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdlAsync(UpdateDatabaseDdlRequest request)

Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns,
indexes, etc. The returned long-running operation will have a
name of the format `<database_name>/operations/<operation_id>` and can be used to
track execution of the schema change(s). The metadata
field type is
UpdateDatabaseDdlMetadata. The
operation has no response.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateDatabaseDdlRequest request =
           UpdateDatabaseDdlRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .addAllStatements(new ArrayList<String>())
               .setOperationId("operationId129704162")
               .setProtoDescriptors(ByteString.EMPTY)
               .setThroughputMode(true)
               .build();
       databaseAdminClient.updateDatabaseDdlAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>` |   |

### updateDatabaseDdlAsync(String database, List\<String\> statements)

    public final OperationFuture<Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdlAsync(String database, List<String> statements)

Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns,
indexes, etc. The returned long-running operation will have a
name of the format `<database_name>/operations/<operation_id>` and can be used to
track execution of the schema change(s). The metadata
field type is
UpdateDatabaseDdlMetadata. The
operation has no response.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
       List<String> statements = new ArrayList<>();
       databaseAdminClient.updateDatabaseDdlAsync(database, statements).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `database` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The database to update. |
| `statements` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` Required. DDL statements to be applied to the database. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>` |   |

### updateDatabaseDdlCallable()

    public final UnaryCallable<UpdateDatabaseDdlRequest,Operation> updateDatabaseDdlCallable()

Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns,
indexes, etc. The returned long-running operation will have a
name of the format `<database_name>/operations/<operation_id>` and can be used to
track execution of the schema change(s). The metadata
field type is
UpdateDatabaseDdlMetadata. The
operation has no response.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateDatabaseDdlRequest request =
           UpdateDatabaseDdlRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .addAllStatements(new ArrayList<String>())
               .setOperationId("operationId129704162")
               .setProtoDescriptors(ByteString.EMPTY)
               .setThroughputMode(true)
               .build();
       ApiFuture<Operation> future =
           databaseAdminClient.updateDatabaseDdlCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### updateDatabaseDdlOperationCallable()

    public final OperationCallable<UpdateDatabaseDdlRequest,Empty,UpdateDatabaseDdlMetadata> updateDatabaseDdlOperationCallable()

Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns,
indexes, etc. The returned long-running operation will have a
name of the format `<database_name>/operations/<operation_id>` and can be used to
track execution of the schema change(s). The metadata
field type is
UpdateDatabaseDdlMetadata. The
operation has no response.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateDatabaseDdlRequest request =
           UpdateDatabaseDdlRequest.newBuilder()
               .setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
               .addAllStatements(new ArrayList<String>())
               .setOperationId("operationId129704162")
               .setProtoDescriptors(ByteString.EMPTY)
               .setThroughputMode(true)
               .build();
       OperationFuture<Empty, UpdateDatabaseDdlMetadata> future =
           databaseAdminClient.updateDatabaseDdlOperationCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>` |   |

### updateDatabaseOperationCallable()

    public final OperationCallable<UpdateDatabaseRequest,Database,UpdateDatabaseMetadata> updateDatabaseOperationCallable()

Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the
database. If the named database does not exist, returns `NOT_FOUND`.

While the operation is pending:

\* The database's reconciling
field is set to true. \* Cancelling the operation is best-effort. If the cancellation
succeeds, the operation metadata's
cancel_time is set, the
updates are reverted, and the operation terminates with a `CANCELLED` status. \* New
UpdateDatabase requests will return a `FAILED_PRECONDITION` error until the pending operation
is done (returns successfully or with error). \* Reading the database via the API continues
to give the pre-request values.

Upon completion of the returned operation:

\* The new values are in effect and readable via the API. \* The database's
reconciling field becomes false.

The returned long-running operation will have a name of the
format
`projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
and can be used to track the database modification. The
metadata field type is
UpdateDatabaseMetadata. The
response field type is
Database, if successful.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
       UpdateDatabaseRequest request =
           UpdateDatabaseRequest.newBuilder()
               .setDatabase(Database.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       OperationFuture<Database, UpdateDatabaseMetadata> future =
           databaseAdminClient.updateDatabaseOperationCallable().futureCall(request);
       // Do something.
       Database response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.Database,https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.UpdateDatabaseMetadata>` |   |