From 5643c22a4531dac75b9fac5b128eb714a27920a0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 12 Mar 2020 19:45:50 -0700 Subject: [PATCH] feat: add Backups protos and APIs (#97) * feat: add Backups protos and APIs * Ignore DatabaseOrBuilder interface change. This is an auto-generated interface only intended to be used internally. Co-authored-by: Shanika Kuruppu --- .../database/v1/DatabaseAdminClient.java | 1526 ++++++++++- .../database/v1/DatabaseAdminSettings.java | 148 ++ .../admin/database/v1/package-info.java | 3 +- .../database/v1/stub/DatabaseAdminStub.java | 78 + .../v1/stub/DatabaseAdminStubSettings.java | 517 ++++ .../v1/stub/GrpcDatabaseAdminStub.java | 328 +++ .../database/v1/DatabaseAdminClientTest.java | 419 ++- .../database/v1/MockDatabaseAdminImpl.java | 131 + .../admin/database/v1/DatabaseAdminGrpc.java | 1438 +++++++++- .../clirr-ignored-differences.xml | 34 + .../spanner/admin/database/v1/Backup.java | 2338 +++++++++++++++++ .../spanner/admin/database/v1/BackupInfo.java | 1091 ++++++++ .../database/v1/BackupInfoOrBuilder.java | 113 + .../spanner/admin/database/v1/BackupName.java | 210 ++ .../admin/database/v1/BackupOrBuilder.java | 321 +++ .../admin/database/v1/BackupProto.java | 263 ++ .../admin/database/v1/CommonProto.java | 80 + .../database/v1/CreateBackupMetadata.java | 1491 +++++++++++ .../v1/CreateBackupMetadataOrBuilder.java | 178 ++ .../database/v1/CreateBackupRequest.java | 1173 +++++++++ .../v1/CreateBackupRequestOrBuilder.java | 134 + .../database/v1/CreateDatabaseRequest.java | 52 +- .../v1/CreateDatabaseRequestOrBuilder.java | 16 +- .../spanner/admin/database/v1/Database.java | 677 ++++- .../admin/database/v1/DatabaseOrBuilder.java | 94 +- .../database/v1/DeleteBackupRequest.java | 663 +++++ .../v1/DeleteBackupRequestOrBuilder.java | 58 + .../admin/database/v1/GetBackupRequest.java | 663 +++++ .../v1/GetBackupRequestOrBuilder.java | 58 + .../v1/ListBackupOperationsRequest.java | 1349 ++++++++++ .../ListBackupOperationsRequestOrBuilder.java | 188 ++ .../v1/ListBackupOperationsResponse.java | 1329 ++++++++++ ...ListBackupOperationsResponseOrBuilder.java | 145 + .../admin/database/v1/ListBackupsRequest.java | 1312 +++++++++ .../v1/ListBackupsRequestOrBuilder.java | 180 ++ .../database/v1/ListBackupsResponse.java | 1159 ++++++++ .../v1/ListBackupsResponseOrBuilder.java | 111 + .../v1/ListDatabaseOperationsRequest.java | 1367 ++++++++++ ...istDatabaseOperationsRequestOrBuilder.java | 192 ++ .../v1/ListDatabaseOperationsResponse.java | 1240 +++++++++ ...stDatabaseOperationsResponseOrBuilder.java | 125 + .../admin/database/v1/OperationProgress.java | 1093 ++++++++ .../v1/OperationProgressOrBuilder.java | 112 + .../v1/OptimizeRestoredDatabaseMetadata.java | 929 +++++++ ...mizeRestoredDatabaseMetadataOrBuilder.java | 85 + .../database/v1/RestoreDatabaseMetadata.java | 2105 +++++++++++++++ .../v1/RestoreDatabaseMetadataOrBuilder.java | 264 ++ .../database/v1/RestoreDatabaseRequest.java | 1163 ++++++++ .../v1/RestoreDatabaseRequestOrBuilder.java | 122 + .../admin/database/v1/RestoreInfo.java | 994 +++++++ .../database/v1/RestoreInfoOrBuilder.java | 90 + .../admin/database/v1/RestoreSourceType.java | 154 ++ .../v1/SpannerDatabaseAdminProto.java | 377 ++- .../database/v1/UpdateBackupRequest.java | 1120 ++++++++ .../v1/UpdateBackupRequestOrBuilder.java | 125 + .../spanner/admin/database/v1/backup.proto | 363 +++ .../spanner/admin/database/v1/common.proto | 43 + .../database/v1/spanner_database_admin.proto | 364 ++- synth.metadata | 12 +- 59 files changed, 32199 insertions(+), 308 deletions(-) create mode 100644 proto-google-cloud-spanner-admin-database-v1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupName.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponse.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponseOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponse.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponseOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponse.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponseOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgress.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgressOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfo.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfoOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreSourceType.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequest.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequestOrBuilder.java create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto create mode 100644 proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/common.proto diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java index 4650ca762a..e40a5fa701 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java @@ -39,17 +39,33 @@ import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.BackupName; +import com.google.spanner.admin.database.v1.CreateBackupMetadata; +import com.google.spanner.admin.database.v1.CreateBackupRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DatabaseName; +import com.google.spanner.admin.database.v1.DeleteBackupRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; +import com.google.spanner.admin.database.v1.GetBackupRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.InstanceName; +import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupsRequest; +import com.google.spanner.admin.database.v1.ListBackupsResponse; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse; import com.google.spanner.admin.database.v1.ListDatabasesRequest; import com.google.spanner.admin.database.v1.ListDatabasesResponse; +import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; +import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; +import com.google.spanner.admin.database.v1.UpdateBackupRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import java.io.IOException; @@ -62,7 +78,8 @@ * Service Description: Cloud Spanner Database Admin API * *

The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also - * enables updating the schema of pre-existing databases. + * enables updating the schema of pre-existing databases. It can be also used to create, delete and + * list backups for a database and to restore 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: @@ -631,7 +648,8 @@ public final UnaryCallable updateDatabaseDd // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Drops (aka deletes) a Cloud Spanner database. + * Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be + * retained according to their `expire_time`. * *

Sample code: * @@ -655,7 +673,8 @@ public final void dropDatabase(DatabaseName database) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Drops (aka deletes) a Cloud Spanner database. + * Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be + * retained according to their `expire_time`. * *

Sample code: * @@ -676,7 +695,8 @@ public final void dropDatabase(String database) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Drops (aka deletes) a Cloud Spanner database. + * Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be + * retained according to their `expire_time`. * *

Sample code: * @@ -699,7 +719,8 @@ public final void dropDatabase(DropDatabaseRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Drops (aka deletes) a Cloud Spanner database. + * Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be + * retained according to their `expire_time`. * *

Sample code: * @@ -821,16 +842,18 @@ public final GetDatabaseDdlResponse getDatabaseDdl(GetDatabaseDdlRequest request // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the access control policy on a database resource. Replaces any existing policy. + * Sets the access control policy on a database or backup resource. Replaces any existing policy. * *

Authorization requires `spanner.databases.setIamPolicy` permission on + * [resource][google.iam.v1.SetIamPolicyRequest.resource]. For backups, authorization requires + * `spanner.backups.setIamPolicy` permission on * [resource][google.iam.v1.SetIamPolicyRequest.resource]. * *

Sample code: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   Policy policy = Policy.newBuilder().build();
    *   Policy response = databaseAdminClient.setIamPolicy(resource, policy);
    * }
@@ -854,16 +877,18 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the access control policy on a database resource. Replaces any existing policy.
+   * Sets the access control policy on a database or backup resource. Replaces any existing policy.
    *
    * 

Authorization requires `spanner.databases.setIamPolicy` permission on + * [resource][google.iam.v1.SetIamPolicyRequest.resource]. For backups, authorization requires + * `spanner.backups.setIamPolicy` permission on * [resource][google.iam.v1.SetIamPolicyRequest.resource]. * *

Sample code: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   Policy policy = Policy.newBuilder().build();
    *   Policy response = databaseAdminClient.setIamPolicy(resource.toString(), policy);
    * }
@@ -884,16 +909,18 @@ public final Policy setIamPolicy(String resource, Policy policy) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the access control policy on a database resource. Replaces any existing policy.
+   * Sets the access control policy on a database or backup resource. Replaces any existing policy.
    *
    * 

Authorization requires `spanner.databases.setIamPolicy` permission on + * [resource][google.iam.v1.SetIamPolicyRequest.resource]. For backups, authorization requires + * `spanner.backups.setIamPolicy` permission on * [resource][google.iam.v1.SetIamPolicyRequest.resource]. * *

Sample code: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   Policy policy = Policy.newBuilder().build();
    *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -912,16 +939,18 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Sets the access control policy on a database resource. Replaces any existing policy.
+   * Sets the access control policy on a database or backup resource. Replaces any existing policy.
    *
    * 

Authorization requires `spanner.databases.setIamPolicy` permission on + * [resource][google.iam.v1.SetIamPolicyRequest.resource]. For backups, authorization requires + * `spanner.backups.setIamPolicy` permission on * [resource][google.iam.v1.SetIamPolicyRequest.resource]. * *

Sample code: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   Policy policy = Policy.newBuilder().build();
    *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -939,17 +968,19 @@ public final UnaryCallable setIamPolicyCallable() {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Gets the access control policy for a database resource. Returns an empty policy if a database
-   * exists but does not have a policy set.
+   * 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][google.iam.v1.GetIamPolicyRequest.resource]. For backups, authorization requires + * `spanner.backups.getIamPolicy` permission on * [resource][google.iam.v1.GetIamPolicyRequest.resource]. * *

Sample code: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   Policy response = databaseAdminClient.getIamPolicy(resource);
    * }
    * 
@@ -968,17 +999,19 @@ public final Policy getIamPolicy(ResourceName resource) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets the access control policy for a database resource. Returns an empty policy if a database - * exists but does not have a policy set. + * 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][google.iam.v1.GetIamPolicyRequest.resource]. For backups, authorization requires + * `spanner.backups.getIamPolicy` permission on * [resource][google.iam.v1.GetIamPolicyRequest.resource]. * *

Sample code: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   Policy response = databaseAdminClient.getIamPolicy(resource.toString());
    * }
    * 
@@ -994,17 +1027,19 @@ public final Policy getIamPolicy(String resource) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets the access control policy for a database resource. Returns an empty policy if a database - * exists but does not have a policy set. + * 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][google.iam.v1.GetIamPolicyRequest.resource]. For backups, authorization requires + * `spanner.backups.getIamPolicy` permission on * [resource][google.iam.v1.GetIamPolicyRequest.resource]. * *

Sample code: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
    *     .setResource(resource.toString())
    *     .build();
@@ -1021,17 +1056,19 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Gets the access control policy for a database resource. Returns an empty policy if a database
-   * exists but does not have a policy set.
+   * 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][google.iam.v1.GetIamPolicyRequest.resource]. For backups, authorization requires + * `spanner.backups.getIamPolicy` permission on * [resource][google.iam.v1.GetIamPolicyRequest.resource]. * *

Sample code: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
    *     .setResource(resource.toString())
    *     .build();
@@ -1047,17 +1084,19 @@ public final UnaryCallable getIamPolicyCallable() {
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns permissions that the caller has on the specified database resource.
+   * 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. + * 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: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   List<String> permissions = new ArrayList<>();
    *   TestIamPermissionsResponse response = databaseAdminClient.testIamPermissions(resource, permissions);
    * }
@@ -1082,17 +1121,19 @@ public final TestIamPermissionsResponse testIamPermissions(
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns permissions that the caller has on the specified database resource.
+   * 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. + * 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: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   List<String> permissions = new ArrayList<>();
    *   TestIamPermissionsResponse response = databaseAdminClient.testIamPermissions(resource.toString(), permissions);
    * }
@@ -1117,17 +1158,19 @@ public final TestIamPermissionsResponse testIamPermissions(
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns permissions that the caller has on the specified database resource.
+   * 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. + * 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: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   List<String> permissions = new ArrayList<>();
    *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -1146,17 +1189,19 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Returns permissions that the caller has on the specified database resource.
+   * 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. + * 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: * *


    * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
-   *   ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    *   List<String> permissions = new ArrayList<>();
    *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
    *     .setResource(resource.toString())
@@ -1173,6 +1218,1159 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
     return stub.testIamPermissionsCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Starts creating a new Cloud Spanner Backup. The returned backup [long-running
+   * operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
+   * [response][google.longrunning.Operation.response] field type is
+   * [Backup][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "";
+   *   Backup response = databaseAdminClient.createBackupAsync(parent, backup, backupId).get();
+   * }
+   * 
+ * + * @param parent 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>`. + * @param backup Required. The backup to create. + * @param backupId 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>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createBackupAsync( + InstanceName parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts creating a new Cloud Spanner Backup. The returned backup [long-running + * operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   Backup backup = Backup.newBuilder().build();
+   *   String backupId = "";
+   *   Backup response = databaseAdminClient.createBackupAsync(parent.toString(), backup, backupId).get();
+   * }
+   * 
+ * + * @param parent 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>`. + * @param backup Required. The backup to create. + * @param backupId 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>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createBackupAsync( + String parent, Backup backup, String backupId) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent) + .setBackup(backup) + .setBackupId(backupId) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts creating a new Cloud Spanner Backup. The returned backup [long-running + * operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String backupId = "";
+   *   Backup backup = Backup.newBuilder().build();
+   *   CreateBackupRequest request = CreateBackupRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setBackupId(backupId)
+   *     .setBackup(backup)
+   *     .build();
+   *   Backup response = databaseAdminClient.createBackupAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createBackupAsync( + CreateBackupRequest request) { + return createBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts creating a new Cloud Spanner Backup. The returned backup [long-running + * operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String backupId = "";
+   *   Backup backup = Backup.newBuilder().build();
+   *   CreateBackupRequest request = CreateBackupRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setBackupId(backupId)
+   *     .setBackup(backup)
+   *     .build();
+   *   OperationFuture<Backup, CreateBackupMetadata> future = databaseAdminClient.createBackupOperationCallable().futureCall(request);
+   *   // Do something
+   *   Backup response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createBackupOperationCallable() { + return stub.createBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts creating a new Cloud Spanner Backup. The returned backup [long-running + * operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String backupId = "";
+   *   Backup backup = Backup.newBuilder().build();
+   *   CreateBackupRequest request = CreateBackupRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setBackupId(backupId)
+   *     .setBackup(backup)
+   *     .build();
+   *   ApiFuture<Operation> future = databaseAdminClient.createBackupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   Backup response = databaseAdminClient.getBackup(name);
+   * }
+   * 
+ * + * @param name Required. Name of the backup. Values are of the form + * `projects/<project>/instances/<instance>/backups/<backup>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(BackupName name) { + GetBackupRequest request = + GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   Backup response = databaseAdminClient.getBackup(name.toString());
+   * }
+   * 
+ * + * @param name Required. Name of the backup. Values are of the form + * `projects/<project>/instances/<instance>/backups/<backup>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(String name) { + GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   GetBackupRequest request = GetBackupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Backup response = databaseAdminClient.getBackup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(GetBackupRequest request) { + return getBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   GetBackupRequest request = GetBackupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Backup> future = databaseAdminClient.getBackupCallable().futureCall(request);
+   *   // Do something
+   *   Backup response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Backup response = databaseAdminClient.updateBackup(backup, updateMask);
+   * }
+   * 
+ * + * @param 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`. + * @param updateMask Required. A mask specifying which fields (e.g. `expire_time`) in the Backup + * resource should be updated. This mask is relative to the Backup resource, not to the + * request message. The field mask must always be specified; this prevents any future fields + * from being erased accidentally by clients that do not know about them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup updateBackup(Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateBackupRequest request = UpdateBackupRequest.newBuilder()
+   *     .setBackup(backup)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Backup response = databaseAdminClient.updateBackup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup updateBackup(UpdateBackupRequest request) { + return updateBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateBackupRequest request = UpdateBackupRequest.newBuilder()
+   *     .setBackup(backup)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Backup> future = databaseAdminClient.updateBackupCallable().futureCall(request);
+   *   // Do something
+   *   Backup response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateBackupCallable() { + return stub.updateBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   databaseAdminClient.deleteBackup(name);
+   * }
+   * 
+ * + * @param name Required. Name of the backup to delete. Values are of the form + * `projects/<project>/instances/<instance>/backups/<backup>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackup(BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   databaseAdminClient.deleteBackup(name.toString());
+   * }
+   * 
+ * + * @param name Required. Name of the backup to delete. Values are of the form + * `projects/<project>/instances/<instance>/backups/<backup>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackup(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + deleteBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   DeleteBackupRequest request = DeleteBackupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   databaseAdminClient.deleteBackup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackup(DeleteBackupRequest request) { + deleteBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   DeleteBackupRequest request = DeleteBackupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = databaseAdminClient.deleteBackupCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists completed and pending backups. Backups returned are ordered by `create_time` in + * descending order, starting from the most recent `create_time`. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (Backup element : databaseAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The instance to list backups from. Values are of the form + * `projects/<project>/instances/<instance>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(InstanceName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists completed and pending backups. Backups returned are ordered by `create_time` in + * descending order, starting from the most recent `create_time`. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (Backup element : databaseAdminClient.listBackups(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The instance to list backups from. Values are of the form + * `projects/<project>/instances/<instance>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists completed and pending backups. Backups returned are ordered by `create_time` in + * descending order, starting from the most recent `create_time`. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListBackupsRequest request = ListBackupsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Backup element : databaseAdminClient.listBackups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists completed and pending backups. Backups returned are ordered by `create_time` in + * descending order, starting from the most recent `create_time`. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListBackupsRequest request = ListBackupsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListBackupsPagedResponse> future = databaseAdminClient.listBackupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Backup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listBackupsPagedCallable() { + return stub.listBackupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists completed and pending backups. Backups returned are ordered by `create_time` in + * descending order, starting from the most recent `create_time`. + * + *

Sample code: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListBackupsRequest request = ListBackupsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .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;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Database][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String databaseId = "";
+   *   BackupName backup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   Database response = databaseAdminClient.restoreDatabaseAsync(parent, databaseId, backup).get();
+   * }
+   * 
+ * + * @param parent 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>`. + * @param databaseId 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>`. + * @param backup Name of the backup from which to restore. Values are of the form + * `projects/<project>/instances/<instance>/backups/<backup>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture restoreDatabaseAsync( + InstanceName parent, String databaseId, BackupName backup) { + RestoreDatabaseRequest request = + RestoreDatabaseRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDatabaseId(databaseId) + .setBackup(backup == null ? null : backup.toString()) + .build(); + return restoreDatabaseAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Database][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String databaseId = "";
+   *   BackupName backup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
+   *   Database response = databaseAdminClient.restoreDatabaseAsync(parent.toString(), databaseId, backup.toString()).get();
+   * }
+   * 
+ * + * @param parent 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>`. + * @param databaseId 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>`. + * @param backup Name of the backup from which to restore. Values are of the form + * `projects/<project>/instances/<instance>/backups/<backup>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture restoreDatabaseAsync( + String parent, String databaseId, String backup) { + RestoreDatabaseRequest request = + RestoreDatabaseRequest.newBuilder() + .setParent(parent) + .setDatabaseId(databaseId) + .setBackup(backup) + .build(); + return restoreDatabaseAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Database][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String databaseId = "";
+   *   RestoreDatabaseRequest request = RestoreDatabaseRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setDatabaseId(databaseId)
+   *     .build();
+   *   Database response = databaseAdminClient.restoreDatabaseAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture restoreDatabaseAsync( + RestoreDatabaseRequest request) { + return restoreDatabaseOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Database][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String databaseId = "";
+   *   RestoreDatabaseRequest request = RestoreDatabaseRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setDatabaseId(databaseId)
+   *     .build();
+   *   OperationFuture<Database, RestoreDatabaseMetadata> future = databaseAdminClient.restoreDatabaseOperationCallable().futureCall(request);
+   *   // Do something
+   *   Database response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + restoreDatabaseOperationCallable() { + return stub.restoreDatabaseOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is + * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Database][google.spanner.admin.database.v1.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String databaseId = "";
+   *   RestoreDatabaseRequest request = RestoreDatabaseRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setDatabaseId(databaseId)
+   *     .build();
+   *   ApiFuture<Operation> future = databaseAdminClient.restoreDatabaseCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable restoreDatabaseCallable() { + return stub.restoreDatabaseCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists database [longrunning-operations][google.longrunning.Operation]. A database operation has + * a name of the form + * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`. + * The long-running operation [metadata][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (Operation element : databaseAdminClient.listDatabaseOperations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The instance of the database operations. Values are of the form + * `projects/<project>/instances/<instance>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatabaseOperationsPagedResponse listDatabaseOperations(InstanceName parent) { + ListDatabaseOperationsRequest request = + ListDatabaseOperationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDatabaseOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists database [longrunning-operations][google.longrunning.Operation]. A database operation has + * a name of the form + * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`. + * The long-running operation [metadata][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (Operation element : databaseAdminClient.listDatabaseOperations(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The instance of the database operations. Values are of the form + * `projects/<project>/instances/<instance>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatabaseOperationsPagedResponse listDatabaseOperations(String parent) { + ListDatabaseOperationsRequest request = + ListDatabaseOperationsRequest.newBuilder().setParent(parent).build(); + return listDatabaseOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists database [longrunning-operations][google.longrunning.Operation]. A database operation has + * a name of the form + * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`. + * The long-running operation [metadata][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListDatabaseOperationsRequest request = ListDatabaseOperationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Operation element : databaseAdminClient.listDatabaseOperations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatabaseOperationsPagedResponse listDatabaseOperations( + ListDatabaseOperationsRequest request) { + return listDatabaseOperationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists database [longrunning-operations][google.longrunning.Operation]. A database operation has + * a name of the form + * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`. + * The long-running operation [metadata][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListDatabaseOperationsRequest request = ListDatabaseOperationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListDatabaseOperationsPagedResponse> future = databaseAdminClient.listDatabaseOperationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Operation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listDatabaseOperationsPagedCallable() { + return stub.listDatabaseOperationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists database [longrunning-operations][google.longrunning.Operation]. A database operation has + * a name of the form + * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`. + * The long-running operation [metadata][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListDatabaseOperationsRequest request = ListDatabaseOperationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .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;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listDatabaseOperationsCallable() { + return stub.listDatabaseOperationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (Operation element : databaseAdminClient.listBackupOperations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The instance of the backup operations. Values are of the form + * `projects/<project>/instances/<instance>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupOperationsPagedResponse listBackupOperations(InstanceName parent) { + ListBackupOperationsRequest request = + ListBackupOperationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackupOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (Operation element : databaseAdminClient.listBackupOperations(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The instance of the backup operations. Values are of the form + * `projects/<project>/instances/<instance>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupOperationsPagedResponse listBackupOperations(String parent) { + ListBackupOperationsRequest request = + ListBackupOperationsRequest.newBuilder().setParent(parent).build(); + return listBackupOperations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListBackupOperationsRequest request = ListBackupOperationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Operation element : databaseAdminClient.listBackupOperations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupOperationsPagedResponse listBackupOperations( + ListBackupOperationsRequest request) { + return listBackupOperationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListBackupOperationsRequest request = ListBackupOperationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListBackupOperationsPagedResponse> future = databaseAdminClient.listBackupOperationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Operation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listBackupOperationsPagedCallable() { + return stub.listBackupOperationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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: + * + *


+   * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListBackupOperationsRequest request = ListBackupOperationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .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;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listBackupOperationsCallable() { + return stub.listBackupOperationsCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists Cloud Spanner databases. @@ -1335,6 +2533,260 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } + public static class ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListBackupsPagedResponse apply(ListBackupsPage input) { + return new ListBackupsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + PageContext context, + ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + PageContext context, + ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListDatabaseOperationsPagedResponse + extends AbstractPagedListResponse< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + Operation, + ListDatabaseOperationsPage, + ListDatabaseOperationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDatabaseOperationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListDatabaseOperationsPagedResponse apply(ListDatabaseOperationsPage input) { + return new ListDatabaseOperationsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListDatabaseOperationsPagedResponse(ListDatabaseOperationsPage page) { + super(page, ListDatabaseOperationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDatabaseOperationsPage + extends AbstractPage< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + Operation, + ListDatabaseOperationsPage> { + + private ListDatabaseOperationsPage( + PageContext + context, + ListDatabaseOperationsResponse response) { + super(context, response); + } + + private static ListDatabaseOperationsPage createEmptyPage() { + return new ListDatabaseOperationsPage(null, null); + } + + @Override + protected ListDatabaseOperationsPage createPage( + PageContext + context, + ListDatabaseOperationsResponse response) { + return new ListDatabaseOperationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDatabaseOperationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + Operation, + ListDatabaseOperationsPage, + ListDatabaseOperationsFixedSizeCollection> { + + private ListDatabaseOperationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDatabaseOperationsFixedSizeCollection createEmptyCollection() { + return new ListDatabaseOperationsFixedSizeCollection(null, 0); + } + + @Override + protected ListDatabaseOperationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDatabaseOperationsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBackupOperationsPagedResponse + extends AbstractPagedListResponse< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + Operation, + ListBackupOperationsPage, + ListBackupOperationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupOperationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListBackupOperationsPagedResponse apply(ListBackupOperationsPage input) { + return new ListBackupOperationsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListBackupOperationsPagedResponse(ListBackupOperationsPage page) { + super(page, ListBackupOperationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupOperationsPage + extends AbstractPage< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + Operation, + ListBackupOperationsPage> { + + private ListBackupOperationsPage( + PageContext context, + ListBackupOperationsResponse response) { + super(context, response); + } + + private static ListBackupOperationsPage createEmptyPage() { + return new ListBackupOperationsPage(null, null); + } + + @Override + protected ListBackupOperationsPage createPage( + PageContext context, + ListBackupOperationsResponse response) { + return new ListBackupOperationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupOperationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + Operation, + ListBackupOperationsPage, + ListBackupOperationsFixedSizeCollection> { + + private ListBackupOperationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupOperationsFixedSizeCollection createEmptyCollection() { + return new ListBackupOperationsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupOperationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupOperationsFixedSizeCollection(pages, collectionSize); + } + } + public static class ListDatabasesPagedResponse extends AbstractPagedListResponse< ListDatabasesRequest, diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java index 9b894043a2..2b74ae4ba3 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java @@ -15,6 +15,9 @@ */ package com.google.cloud.spanner.admin.database.v1; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse; import com.google.api.core.ApiFunction; @@ -37,15 +40,29 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; +import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.CreateBackupMetadata; +import com.google.spanner.admin.database.v1.CreateBackupRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; +import com.google.spanner.admin.database.v1.DeleteBackupRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; +import com.google.spanner.admin.database.v1.GetBackupRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupsRequest; +import com.google.spanner.admin.database.v1.ListBackupsResponse; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse; import com.google.spanner.admin.database.v1.ListDatabasesRequest; import com.google.spanner.admin.database.v1.ListDatabasesResponse; +import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; +import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; +import com.google.spanner.admin.database.v1.UpdateBackupRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import java.io.IOException; @@ -143,6 +160,71 @@ public UnaryCallSettings getIamPolicySettings() { return ((DatabaseAdminStubSettings) getStubSettings()).testIamPermissionsSettings(); } + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createBackupOperationSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).createBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).deleteBackupSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to restoreDatabase. */ + public UnaryCallSettings restoreDatabaseSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).restoreDatabaseSettings(); + } + + /** Returns the object with the settings used for calls to restoreDatabase. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + restoreDatabaseOperationSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).restoreDatabaseOperationSettings(); + } + + /** Returns the object with the settings used for calls to listDatabaseOperations. */ + public PagedCallSettings< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + ListDatabaseOperationsPagedResponse> + listDatabaseOperationsSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).listDatabaseOperationsSettings(); + } + + /** Returns the object with the settings used for calls to listBackupOperations. */ + public PagedCallSettings< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + ListBackupOperationsPagedResponse> + listBackupOperationsSettings() { + return ((DatabaseAdminStubSettings) getStubSettings()).listBackupOperationsSettings(); + } + /** Returns the object with the settings used for calls to listDatabases. */ public PagedCallSettings listDatabasesSettings() { @@ -305,6 +387,72 @@ public UnaryCallSettings.Builder getIamPolicySettin return getStubSettingsBuilder().testIamPermissionsSettings(); } + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createBackupOperationSettings() { + return getStubSettingsBuilder().createBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to restoreDatabase. */ + public UnaryCallSettings.Builder restoreDatabaseSettings() { + return getStubSettingsBuilder().restoreDatabaseSettings(); + } + + /** Returns the builder for the settings used for calls to restoreDatabase. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreDatabaseOperationSettings() { + return getStubSettingsBuilder().restoreDatabaseOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listDatabaseOperations. */ + public PagedCallSettings.Builder< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + ListDatabaseOperationsPagedResponse> + listDatabaseOperationsSettings() { + return getStubSettingsBuilder().listDatabaseOperationsSettings(); + } + + /** Returns the builder for the settings used for calls to listBackupOperations. */ + public PagedCallSettings.Builder< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + ListBackupOperationsPagedResponse> + listBackupOperationsSettings() { + return getStubSettingsBuilder().listBackupOperationsSettings(); + } + /** Returns the builder for the settings used for calls to listDatabases. */ public PagedCallSettings.Builder< ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse> diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java index a086f7883c..678de33279 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java @@ -24,7 +24,8 @@ *

Service Description: Cloud Spanner Database Admin API * *

The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also - * enables updating the schema of pre-existing databases. + * enables updating the schema of pre-existing databases. It can be also used to create, delete and + * list backups for a database and to restore from an existing backup. * *

Sample for DatabaseAdminClient: * diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java index 4e5bc08210..7f54ffbfca 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.spanner.admin.database.v1.stub; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse; import com.google.api.core.BetaApi; @@ -29,15 +32,29 @@ import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; +import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.CreateBackupMetadata; +import com.google.spanner.admin.database.v1.CreateBackupRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; +import com.google.spanner.admin.database.v1.DeleteBackupRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; +import com.google.spanner.admin.database.v1.GetBackupRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupsRequest; +import com.google.spanner.admin.database.v1.ListBackupsResponse; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse; import com.google.spanner.admin.database.v1.ListDatabasesRequest; import com.google.spanner.admin.database.v1.ListDatabasesResponse; +import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; +import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; +import com.google.spanner.admin.database.v1.UpdateBackupRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import javax.annotation.Generated; @@ -103,6 +120,67 @@ public UnaryCallable getIamPolicyCallable() { throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupOperationCallable()"); + } + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + restoreDatabaseOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreDatabaseOperationCallable()"); + } + + public UnaryCallable restoreDatabaseCallable() { + throw new UnsupportedOperationException("Not implemented: restoreDatabaseCallable()"); + } + + public UnaryCallable + listDatabaseOperationsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listDatabaseOperationsPagedCallable()"); + } + + public UnaryCallable + listDatabaseOperationsCallable() { + throw new UnsupportedOperationException("Not implemented: listDatabaseOperationsCallable()"); + } + + public UnaryCallable + listBackupOperationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupOperationsPagedCallable()"); + } + + public UnaryCallable + listBackupOperationsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupOperationsCallable()"); + } + public UnaryCallable listDatabasesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listDatabasesPagedCallable()"); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java index 03cee855cf..3549b6c5fe 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java @@ -15,6 +15,9 @@ */ package com.google.cloud.spanner.admin.database.v1.stub; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse; import com.google.api.core.ApiFunction; @@ -54,15 +57,29 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; +import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.CreateBackupMetadata; +import com.google.spanner.admin.database.v1.CreateBackupRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; +import com.google.spanner.admin.database.v1.DeleteBackupRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; +import com.google.spanner.admin.database.v1.GetBackupRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupsRequest; +import com.google.spanner.admin.database.v1.ListBackupsResponse; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse; import com.google.spanner.admin.database.v1.ListDatabasesRequest; import com.google.spanner.admin.database.v1.ListDatabasesResponse; +import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; +import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; +import com.google.spanner.admin.database.v1.UpdateBackupRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import java.io.IOException; @@ -125,6 +142,27 @@ public class DatabaseAdminStubSettings extends StubSettings getIamPolicySettings; private final UnaryCallSettings testIamPermissionsSettings; + private final UnaryCallSettings createBackupSettings; + private final OperationCallSettings + createBackupOperationSettings; + private final UnaryCallSettings getBackupSettings; + private final UnaryCallSettings updateBackupSettings; + private final UnaryCallSettings deleteBackupSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings restoreDatabaseSettings; + private final OperationCallSettings + restoreDatabaseOperationSettings; + private final PagedCallSettings< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + ListDatabaseOperationsPagedResponse> + listDatabaseOperationsSettings; + private final PagedCallSettings< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + ListBackupOperationsPagedResponse> + listBackupOperationsSettings; private final PagedCallSettings< ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse> listDatabasesSettings; @@ -184,6 +222,69 @@ public UnaryCallSettings getIamPolicySettings() { return testIamPermissionsSettings; } + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to restoreDatabase. */ + public UnaryCallSettings restoreDatabaseSettings() { + return restoreDatabaseSettings; + } + + /** Returns the object with the settings used for calls to restoreDatabase. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + restoreDatabaseOperationSettings() { + return restoreDatabaseOperationSettings; + } + + /** Returns the object with the settings used for calls to listDatabaseOperations. */ + public PagedCallSettings< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + ListDatabaseOperationsPagedResponse> + listDatabaseOperationsSettings() { + return listDatabaseOperationsSettings; + } + + /** Returns the object with the settings used for calls to listBackupOperations. */ + public PagedCallSettings< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + ListBackupOperationsPagedResponse> + listBackupOperationsSettings() { + return listBackupOperationsSettings; + } + /** Returns the object with the settings used for calls to listDatabases. */ public PagedCallSettings listDatabasesSettings() { @@ -270,9 +371,137 @@ protected DatabaseAdminStubSettings(Builder settingsBuilder) throws IOException setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + createBackupSettings = settingsBuilder.createBackupSettings().build(); + createBackupOperationSettings = settingsBuilder.createBackupOperationSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + restoreDatabaseSettings = settingsBuilder.restoreDatabaseSettings().build(); + restoreDatabaseOperationSettings = settingsBuilder.restoreDatabaseOperationSettings().build(); + listDatabaseOperationsSettings = settingsBuilder.listDatabaseOperationsSettings().build(); + listBackupOperationsSettings = settingsBuilder.listBackupOperationsSettings().build(); listDatabasesSettings = settingsBuilder.listDatabasesSettings().build(); } + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList() != null + ? payload.getBackupsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListDatabaseOperationsRequest, ListDatabaseOperationsResponse, Operation> + LIST_DATABASE_OPERATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListDatabaseOperationsRequest, ListDatabaseOperationsResponse, Operation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDatabaseOperationsRequest injectToken( + ListDatabaseOperationsRequest payload, String token) { + return ListDatabaseOperationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDatabaseOperationsRequest injectPageSize( + ListDatabaseOperationsRequest payload, int pageSize) { + return ListDatabaseOperationsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListDatabaseOperationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDatabaseOperationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDatabaseOperationsResponse payload) { + return payload.getOperationsList() != null + ? payload.getOperationsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListBackupOperationsRequest, ListBackupOperationsResponse, Operation> + LIST_BACKUP_OPERATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListBackupOperationsRequest, ListBackupOperationsResponse, Operation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupOperationsRequest injectToken( + ListBackupOperationsRequest payload, String token) { + return ListBackupOperationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupOperationsRequest injectPageSize( + ListBackupOperationsRequest payload, int pageSize) { + return ListBackupOperationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupOperationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupOperationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupOperationsResponse payload) { + return payload.getOperationsList() != null + ? payload.getOperationsList() + : ImmutableList.of(); + } + }; + private static final PagedListDescriptor LIST_DATABASES_PAGE_STR_DESC = new PagedListDescriptor() { @@ -309,6 +538,70 @@ public Iterable extractResources(ListDatabasesResponse payload) { } }; + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + ListDatabaseOperationsPagedResponse> + LIST_DATABASE_OPERATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + ListDatabaseOperationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListDatabaseOperationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_DATABASE_OPERATIONS_PAGE_STR_DESC, request, context); + return ListDatabaseOperationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + ListBackupOperationsPagedResponse> + LIST_BACKUP_OPERATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + ListBackupOperationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupOperationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_BACKUP_OPERATIONS_PAGE_STR_DESC, request, context); + return ListBackupOperationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse> LIST_DATABASES_PAGE_STR_FACT = @@ -348,6 +641,30 @@ public static class Builder extends StubSettings.Builder getIamPolicySettings; private final UnaryCallSettings.Builder testIamPermissionsSettings; + private final UnaryCallSettings.Builder createBackupSettings; + private final OperationCallSettings.Builder + createBackupOperationSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder + restoreDatabaseSettings; + private final OperationCallSettings.Builder< + RestoreDatabaseRequest, Database, RestoreDatabaseMetadata> + restoreDatabaseOperationSettings; + private final PagedCallSettings.Builder< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + ListDatabaseOperationsPagedResponse> + listDatabaseOperationsSettings; + private final PagedCallSettings.Builder< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + ListBackupOperationsPagedResponse> + listBackupOperationsSettings; private final PagedCallSettings.Builder< ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse> listDatabasesSettings; @@ -413,6 +730,28 @@ protected Builder(ClientContext clientContext) { testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createBackupOperationSettings = OperationCallSettings.newBuilder(); + + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + + restoreDatabaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + restoreDatabaseOperationSettings = OperationCallSettings.newBuilder(); + + listDatabaseOperationsSettings = + PagedCallSettings.newBuilder(LIST_DATABASE_OPERATIONS_PAGE_STR_FACT); + + listBackupOperationsSettings = + PagedCallSettings.newBuilder(LIST_BACKUP_OPERATIONS_PAGE_STR_FACT); + listDatabasesSettings = PagedCallSettings.newBuilder(LIST_DATABASES_PAGE_STR_FACT); unaryMethodSettingsBuilders = @@ -425,6 +764,14 @@ protected Builder(ClientContext clientContext) { setIamPolicySettings, getIamPolicySettings, testIamPermissionsSettings, + createBackupSettings, + getBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listBackupsSettings, + restoreDatabaseSettings, + listDatabaseOperationsSettings, + listBackupOperationsSettings, listDatabasesSettings); initDefaults(this); @@ -481,6 +828,46 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listBackupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .restoreDatabaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listDatabaseOperationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listBackupOperationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .listDatabasesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) @@ -532,6 +919,52 @@ private static Builder initDefaults(Builder builder) { .setMaxRpcTimeout(Duration.ZERO) // ignored .setTotalTimeout(Duration.ofMillis(86400000L)) .build())); + builder + .createBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateBackupMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(20000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(172800000L)) + .build())); + builder + .restoreDatabaseOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Database.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(RestoreDatabaseMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(20000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); return builder; } @@ -549,6 +982,16 @@ protected Builder(DatabaseAdminStubSettings settings) { setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + createBackupSettings = settings.createBackupSettings.toBuilder(); + createBackupOperationSettings = settings.createBackupOperationSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + restoreDatabaseSettings = settings.restoreDatabaseSettings.toBuilder(); + restoreDatabaseOperationSettings = settings.restoreDatabaseOperationSettings.toBuilder(); + listDatabaseOperationsSettings = settings.listDatabaseOperationsSettings.toBuilder(); + listBackupOperationsSettings = settings.listBackupOperationsSettings.toBuilder(); listDatabasesSettings = settings.listDatabasesSettings.toBuilder(); unaryMethodSettingsBuilders = @@ -561,6 +1004,14 @@ protected Builder(DatabaseAdminStubSettings settings) { setIamPolicySettings, getIamPolicySettings, testIamPermissionsSettings, + createBackupSettings, + getBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listBackupsSettings, + restoreDatabaseSettings, + listDatabaseOperationsSettings, + listBackupOperationsSettings, listDatabasesSettings); } @@ -639,6 +1090,72 @@ public UnaryCallSettings.Builder getIamPolicySettin return testIamPermissionsSettings; } + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to restoreDatabase. */ + public UnaryCallSettings.Builder restoreDatabaseSettings() { + return restoreDatabaseSettings; + } + + /** Returns the builder for the settings used for calls to restoreDatabase. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + restoreDatabaseOperationSettings() { + return restoreDatabaseOperationSettings; + } + + /** Returns the builder for the settings used for calls to listDatabaseOperations. */ + public PagedCallSettings.Builder< + ListDatabaseOperationsRequest, + ListDatabaseOperationsResponse, + ListDatabaseOperationsPagedResponse> + listDatabaseOperationsSettings() { + return listDatabaseOperationsSettings; + } + + /** Returns the builder for the settings used for calls to listBackupOperations. */ + public PagedCallSettings.Builder< + ListBackupOperationsRequest, + ListBackupOperationsResponse, + ListBackupOperationsPagedResponse> + listBackupOperationsSettings() { + return listBackupOperationsSettings; + } + /** Returns the builder for the settings used for calls to listDatabases. */ public PagedCallSettings.Builder< ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse> diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java index b1a7eed41e..be44d2be02 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java @@ -15,6 +15,9 @@ */ package com.google.cloud.spanner.admin.database.v1.stub; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse; import com.google.api.core.BetaApi; @@ -35,15 +38,29 @@ import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; +import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.CreateBackupMetadata; +import com.google.spanner.admin.database.v1.CreateBackupRequest; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; +import com.google.spanner.admin.database.v1.DeleteBackupRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; +import com.google.spanner.admin.database.v1.GetBackupRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupsRequest; +import com.google.spanner.admin.database.v1.ListBackupsResponse; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse; import com.google.spanner.admin.database.v1.ListDatabasesRequest; import com.google.spanner.admin.database.v1.ListDatabasesResponse; +import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata; +import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; +import com.google.spanner.admin.database.v1.UpdateBackupRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import io.grpc.MethodDescriptor; @@ -130,6 +147,77 @@ public class GrpcDatabaseAdminStub extends DatabaseAdminStub { .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.spanner.admin.database.v1.DatabaseAdmin/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.spanner.admin.database.v1.DatabaseAdmin/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.spanner.admin.database.v1.DatabaseAdmin/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.spanner.admin.database.v1.DatabaseAdmin/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.spanner.admin.database.v1.DatabaseAdmin/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + restoreDatabaseMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.spanner.admin.database.v1.DatabaseAdmin/RestoreDatabase") + .setRequestMarshaller( + ProtoUtils.marshaller(RestoreDatabaseRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + ListDatabaseOperationsRequest, ListDatabaseOperationsResponse> + listDatabaseOperationsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/ListDatabaseOperations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDatabaseOperationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDatabaseOperationsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listBackupOperationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin/ListBackupOperations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListBackupOperationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupOperationsResponse.getDefaultInstance())) + .build(); private static final MethodDescriptor listDatabasesMethodDescriptor = MethodDescriptor.newBuilder() @@ -157,6 +245,26 @@ public class GrpcDatabaseAdminStub extends DatabaseAdminStub { private final UnaryCallable getIamPolicyCallable; private final UnaryCallable testIamPermissionsCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable updateBackupCallable; + private final UnaryCallable deleteBackupCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable restoreDatabaseCallable; + private final OperationCallable + restoreDatabaseOperationCallable; + private final UnaryCallable + listDatabaseOperationsCallable; + private final UnaryCallable + listDatabaseOperationsPagedCallable; + private final UnaryCallable + listBackupOperationsCallable; + private final UnaryCallable + listBackupOperationsPagedCallable; private final UnaryCallable listDatabasesCallable; private final UnaryCallable listDatabasesPagedCallable; @@ -307,6 +415,113 @@ public Map extract(TestIamPermissionsRequest request) { } }) .build(); + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("backup.name", String.valueOf(request.getBackup().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteBackupRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListBackupsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings restoreDatabaseTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreDatabaseMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RestoreDatabaseRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listDatabaseOperationsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listDatabaseOperationsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListDatabaseOperationsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listBackupOperationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupOperationsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListBackupOperationsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); GrpcCallSettings listDatabasesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listDatabasesMethodDescriptor) @@ -361,6 +576,59 @@ public Map extract(ListDatabasesRequest request) { testIamPermissionsTransportSettings, settings.testIamPermissionsSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + this.operationsStub); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.restoreDatabaseCallable = + callableFactory.createUnaryCallable( + restoreDatabaseTransportSettings, settings.restoreDatabaseSettings(), clientContext); + this.restoreDatabaseOperationCallable = + callableFactory.createOperationCallable( + restoreDatabaseTransportSettings, + settings.restoreDatabaseOperationSettings(), + clientContext, + this.operationsStub); + this.listDatabaseOperationsCallable = + callableFactory.createUnaryCallable( + listDatabaseOperationsTransportSettings, + settings.listDatabaseOperationsSettings(), + clientContext); + this.listDatabaseOperationsPagedCallable = + callableFactory.createPagedCallable( + listDatabaseOperationsTransportSettings, + settings.listDatabaseOperationsSettings(), + clientContext); + this.listBackupOperationsCallable = + callableFactory.createUnaryCallable( + listBackupOperationsTransportSettings, + settings.listBackupOperationsSettings(), + clientContext); + this.listBackupOperationsPagedCallable = + callableFactory.createPagedCallable( + listBackupOperationsTransportSettings, + settings.listBackupOperationsSettings(), + clientContext); this.listDatabasesCallable = callableFactory.createUnaryCallable( listDatabasesTransportSettings, settings.listDatabasesSettings(), clientContext); @@ -421,6 +689,66 @@ public UnaryCallable getIamPolicyCallable() { return testIamPermissionsCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + restoreDatabaseOperationCallable() { + return restoreDatabaseOperationCallable; + } + + public UnaryCallable restoreDatabaseCallable() { + return restoreDatabaseCallable; + } + + public UnaryCallable + listDatabaseOperationsPagedCallable() { + return listDatabaseOperationsPagedCallable; + } + + public UnaryCallable + listDatabaseOperationsCallable() { + return listDatabaseOperationsCallable; + } + + public UnaryCallable + listBackupOperationsPagedCallable() { + return listBackupOperationsPagedCallable; + } + + public UnaryCallable + listBackupOperationsCallable() { + return listBackupOperationsCallable; + } + public UnaryCallable listDatabasesPagedCallable() { return listDatabasesPagedCallable; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java index b8ea11249d..e26a20c171 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java @@ -15,6 +15,9 @@ */ package com.google.cloud.spanner.admin.database.v1; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse; import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -37,16 +40,30 @@ import com.google.protobuf.Any; import com.google.protobuf.ByteString; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.BackupName; +import com.google.spanner.admin.database.v1.CreateBackupRequest; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DatabaseName; +import com.google.spanner.admin.database.v1.DeleteBackupRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; +import com.google.spanner.admin.database.v1.GetBackupRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; import com.google.spanner.admin.database.v1.InstanceName; +import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupsRequest; +import com.google.spanner.admin.database.v1.ListBackupsResponse; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse; import com.google.spanner.admin.database.v1.ListDatabasesRequest; import com.google.spanner.admin.database.v1.ListDatabasesResponse; +import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; +import com.google.spanner.admin.database.v1.UpdateBackupRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import io.grpc.Status; import io.grpc.StatusRuntimeException; @@ -323,7 +340,7 @@ public void setIamPolicyTest() { Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); mockDatabaseAdmin.addResponse(expectedResponse); - ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); Policy policy = Policy.newBuilder().build(); Policy actualResponse = client.setIamPolicy(resource, policy); @@ -348,7 +365,7 @@ public void setIamPolicyExceptionTest() throws Exception { mockDatabaseAdmin.addException(exception); try { - ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); Policy policy = Policy.newBuilder().build(); client.setIamPolicy(resource, policy); @@ -366,7 +383,7 @@ public void getIamPolicyTest() { Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); mockDatabaseAdmin.addResponse(expectedResponse); - ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); Policy actualResponse = client.getIamPolicy(resource); Assert.assertEquals(expectedResponse, actualResponse); @@ -389,7 +406,7 @@ public void getIamPolicyExceptionTest() throws Exception { mockDatabaseAdmin.addException(exception); try { - ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); client.getIamPolicy(resource); Assert.fail("No exception raised"); @@ -404,7 +421,7 @@ public void testIamPermissionsTest() { TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); mockDatabaseAdmin.addResponse(expectedResponse); - ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); List permissions = new ArrayList<>(); TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); @@ -429,7 +446,7 @@ public void testIamPermissionsExceptionTest() throws Exception { mockDatabaseAdmin.addException(exception); try { - ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); List permissions = new ArrayList<>(); client.testIamPermissions(resource, permissions); @@ -439,6 +456,396 @@ public void testIamPermissionsExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void createBackupTest() throws Exception { + String database = "database1789464955"; + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + long sizeBytes = 1796325715L; + Backup expectedResponse = + Backup.newBuilder() + .setDatabase(database) + .setName(name.toString()) + .setSizeBytes(sizeBytes) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDatabaseAdmin.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId1355353272"; + + Backup actualResponse = client.createBackupAsync(parent, backup, backupId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = (CreateBackupRequest) actualRequests.get(0); + + Assert.assertEquals(parent, InstanceName.parse(actualRequest.getParent())); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + Backup backup = Backup.newBuilder().build(); + String backupId = "backupId1355353272"; + + client.createBackupAsync(parent, backup, backupId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void getBackupTest() { + String database = "database1789464955"; + BackupName name2 = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + long sizeBytes = 1796325715L; + Backup expectedResponse = + Backup.newBuilder() + .setDatabase(database) + .setName(name2.toString()) + .setSizeBytes(sizeBytes) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = (GetBackupRequest) actualRequests.get(0); + + Assert.assertEquals(name, BackupName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBackupTest() { + String database = "database1789464955"; + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + long sizeBytes = 1796325715L; + Backup expectedResponse = + Backup.newBuilder() + .setDatabase(database) + .setName(name.toString()) + .setSizeBytes(sizeBytes) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackup(backup, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupRequest actualRequest = (UpdateBackupRequest) actualRequests.get(0); + + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateBackup(backup, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteBackupTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + + client.deleteBackup(name); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = (DeleteBackupRequest) actualRequests.get(0); + + Assert.assertEquals(name, BackupName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listBackupsTest() { + String nextPageToken = ""; + Backup backupsElement = Backup.newBuilder().build(); + List backups = Arrays.asList(backupsElement); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBackups(backups) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = (ListBackupsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, InstanceName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void restoreDatabaseTest() throws Exception { + DatabaseName name = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); + Database expectedResponse = Database.newBuilder().setName(name.toString()).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDatabaseAdmin.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String databaseId = "databaseId816491103"; + BackupName backup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + + Database actualResponse = client.restoreDatabaseAsync(parent, databaseId, backup).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreDatabaseRequest actualRequest = (RestoreDatabaseRequest) actualRequests.get(0); + + Assert.assertEquals(parent, InstanceName.parse(actualRequest.getParent())); + Assert.assertEquals(databaseId, actualRequest.getDatabaseId()); + Assert.assertEquals(backup, BackupName.parse(actualRequest.getBackup())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void restoreDatabaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String databaseId = "databaseId816491103"; + BackupName backup = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); + + client.restoreDatabaseAsync(parent, databaseId, backup).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void listDatabaseOperationsTest() { + String nextPageToken = ""; + Operation operationsElement = Operation.newBuilder().build(); + List operations = Arrays.asList(operationsElement); + ListDatabaseOperationsResponse expectedResponse = + ListDatabaseOperationsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllOperations(operations) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + ListDatabaseOperationsPagedResponse pagedListResponse = client.listDatabaseOperations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOperationsList().get(0), resources.get(0)); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDatabaseOperationsRequest actualRequest = + (ListDatabaseOperationsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, InstanceName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listDatabaseOperationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + client.listDatabaseOperations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listBackupOperationsTest() { + String nextPageToken = ""; + Operation operationsElement = Operation.newBuilder().build(); + List operations = Arrays.asList(operationsElement); + ListBackupOperationsResponse expectedResponse = + ListBackupOperationsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllOperations(operations) + .build(); + mockDatabaseAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + ListBackupOperationsPagedResponse pagedListResponse = client.listBackupOperations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOperationsList().get(0), resources.get(0)); + + List actualRequests = mockDatabaseAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupOperationsRequest actualRequest = (ListBackupOperationsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, InstanceName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listBackupOperationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDatabaseAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + client.listBackupOperations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void listDatabasesTest() { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java index a3c9edbb63..7373d64a35 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java @@ -24,15 +24,27 @@ import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; +import com.google.spanner.admin.database.v1.Backup; +import com.google.spanner.admin.database.v1.CreateBackupRequest; import com.google.spanner.admin.database.v1.CreateDatabaseRequest; import com.google.spanner.admin.database.v1.Database; import com.google.spanner.admin.database.v1.DatabaseAdminGrpc.DatabaseAdminImplBase; +import com.google.spanner.admin.database.v1.DeleteBackupRequest; import com.google.spanner.admin.database.v1.DropDatabaseRequest; +import com.google.spanner.admin.database.v1.GetBackupRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest; import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse; import com.google.spanner.admin.database.v1.GetDatabaseRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsRequest; +import com.google.spanner.admin.database.v1.ListBackupOperationsResponse; +import com.google.spanner.admin.database.v1.ListBackupsRequest; +import com.google.spanner.admin.database.v1.ListBackupsResponse; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest; +import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse; import com.google.spanner.admin.database.v1.ListDatabasesRequest; import com.google.spanner.admin.database.v1.ListDatabasesResponse; +import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; +import com.google.spanner.admin.database.v1.UpdateBackupRequest; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import io.grpc.stub.StreamObserver; import java.util.ArrayList; @@ -203,4 +215,123 @@ public void testIamPermissions( responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } } + + @Override + public void createBackup( + CreateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext((Backup) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateBackup(UpdateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext((Backup) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteBackup(DeleteBackupRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext((ListBackupsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void restoreDatabase( + RestoreDatabaseRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listDatabaseOperations( + ListDatabaseOperationsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListDatabaseOperationsResponse) { + requests.add(request); + responseObserver.onNext((ListDatabaseOperationsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listBackupOperations( + ListBackupOperationsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListBackupOperationsResponse) { + requests.add(request); + responseObserver.onNext((ListBackupOperationsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } } diff --git a/grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java b/grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java index fb3ed96965..25ca282376 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java +++ b/grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java @@ -29,7 +29,8 @@ * Cloud Spanner Database Admin API * The Cloud Spanner Database Admin API can be used to create, drop, and * list databases. It also enables updating the schema of pre-existing - * databases. + * databases. It can be also used to create, delete and list backups for a + * database and to restore from an existing backup. *

*/ @javax.annotation.Generated( @@ -539,6 +540,471 @@ private DatabaseAdminGrpc() {} return getTestIamPermissionsMethod; } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateBackupMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.CreateBackupRequest, + com.google.longrunning.Operation> + METHOD_CREATE_BACKUP = getCreateBackupMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.CreateBackupRequest, + com.google.longrunning.Operation> + getCreateBackupMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.CreateBackupRequest, + com.google.longrunning.Operation> + getCreateBackupMethod() { + return getCreateBackupMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.CreateBackupRequest, + com.google.longrunning.Operation> + getCreateBackupMethodHelper() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.CreateBackupRequest, + com.google.longrunning.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = DatabaseAdminGrpc.getCreateBackupMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getCreateBackupMethod = DatabaseAdminGrpc.getCreateBackupMethod) == null) { + DatabaseAdminGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin", "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.CreateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetBackupMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.GetBackupRequest, + com.google.spanner.admin.database.v1.Backup> + METHOD_GET_BACKUP = getGetBackupMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.GetBackupRequest, + com.google.spanner.admin.database.v1.Backup> + getGetBackupMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.GetBackupRequest, + com.google.spanner.admin.database.v1.Backup> + getGetBackupMethod() { + return getGetBackupMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.GetBackupRequest, + com.google.spanner.admin.database.v1.Backup> + getGetBackupMethodHelper() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.GetBackupRequest, + com.google.spanner.admin.database.v1.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = DatabaseAdminGrpc.getGetBackupMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getGetBackupMethod = DatabaseAdminGrpc.getGetBackupMethod) == null) { + DatabaseAdminGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin", "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.GetBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.Backup.getDefaultInstance())) + .setSchemaDescriptor(new DatabaseAdminMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateBackupMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.UpdateBackupRequest, + com.google.spanner.admin.database.v1.Backup> + METHOD_UPDATE_BACKUP = getUpdateBackupMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.UpdateBackupRequest, + com.google.spanner.admin.database.v1.Backup> + getUpdateBackupMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.UpdateBackupRequest, + com.google.spanner.admin.database.v1.Backup> + getUpdateBackupMethod() { + return getUpdateBackupMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.UpdateBackupRequest, + com.google.spanner.admin.database.v1.Backup> + getUpdateBackupMethodHelper() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.UpdateBackupRequest, + com.google.spanner.admin.database.v1.Backup> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = DatabaseAdminGrpc.getUpdateBackupMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getUpdateBackupMethod = DatabaseAdminGrpc.getUpdateBackupMethod) == null) { + DatabaseAdminGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin", "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.UpdateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.Backup.getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteBackupMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.DeleteBackupRequest, com.google.protobuf.Empty> + METHOD_DELETE_BACKUP = getDeleteBackupMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod() { + return getDeleteBackupMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethodHelper() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = DatabaseAdminGrpc.getDeleteBackupMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getDeleteBackupMethod = DatabaseAdminGrpc.getDeleteBackupMethod) == null) { + DatabaseAdminGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin", "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.DeleteBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListBackupsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupsRequest, + com.google.spanner.admin.database.v1.ListBackupsResponse> + METHOD_LIST_BACKUPS = getListBackupsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupsRequest, + com.google.spanner.admin.database.v1.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupsRequest, + com.google.spanner.admin.database.v1.ListBackupsResponse> + getListBackupsMethod() { + return getListBackupsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupsRequest, + com.google.spanner.admin.database.v1.ListBackupsResponse> + getListBackupsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupsRequest, + com.google.spanner.admin.database.v1.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = DatabaseAdminGrpc.getListBackupsMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getListBackupsMethod = DatabaseAdminGrpc.getListBackupsMethod) == null) { + DatabaseAdminGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin", "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.ListBackupsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.ListBackupsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new DatabaseAdminMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRestoreDatabaseMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.RestoreDatabaseRequest, + com.google.longrunning.Operation> + METHOD_RESTORE_DATABASE = getRestoreDatabaseMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.RestoreDatabaseRequest, + com.google.longrunning.Operation> + getRestoreDatabaseMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.RestoreDatabaseRequest, + com.google.longrunning.Operation> + getRestoreDatabaseMethod() { + return getRestoreDatabaseMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.RestoreDatabaseRequest, + com.google.longrunning.Operation> + getRestoreDatabaseMethodHelper() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.RestoreDatabaseRequest, + com.google.longrunning.Operation> + getRestoreDatabaseMethod; + if ((getRestoreDatabaseMethod = DatabaseAdminGrpc.getRestoreDatabaseMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getRestoreDatabaseMethod = DatabaseAdminGrpc.getRestoreDatabaseMethod) == null) { + DatabaseAdminGrpc.getRestoreDatabaseMethod = + getRestoreDatabaseMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin", "RestoreDatabase")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.RestoreDatabaseRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("RestoreDatabase")) + .build(); + } + } + } + return getRestoreDatabaseMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListDatabaseOperationsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse> + METHOD_LIST_DATABASE_OPERATIONS = getListDatabaseOperationsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse> + getListDatabaseOperationsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse> + getListDatabaseOperationsMethod() { + return getListDatabaseOperationsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse> + getListDatabaseOperationsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse> + getListDatabaseOperationsMethod; + if ((getListDatabaseOperationsMethod = DatabaseAdminGrpc.getListDatabaseOperationsMethod) + == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getListDatabaseOperationsMethod = DatabaseAdminGrpc.getListDatabaseOperationsMethod) + == null) { + DatabaseAdminGrpc.getListDatabaseOperationsMethod = + getListDatabaseOperationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin", + "ListDatabaseOperations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("ListDatabaseOperations")) + .build(); + } + } + } + return getListDatabaseOperationsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListBackupOperationsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupOperationsRequest, + com.google.spanner.admin.database.v1.ListBackupOperationsResponse> + METHOD_LIST_BACKUP_OPERATIONS = getListBackupOperationsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupOperationsRequest, + com.google.spanner.admin.database.v1.ListBackupOperationsResponse> + getListBackupOperationsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupOperationsRequest, + com.google.spanner.admin.database.v1.ListBackupOperationsResponse> + getListBackupOperationsMethod() { + return getListBackupOperationsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupOperationsRequest, + com.google.spanner.admin.database.v1.ListBackupOperationsResponse> + getListBackupOperationsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.spanner.admin.database.v1.ListBackupOperationsRequest, + com.google.spanner.admin.database.v1.ListBackupOperationsResponse> + getListBackupOperationsMethod; + if ((getListBackupOperationsMethod = DatabaseAdminGrpc.getListBackupOperationsMethod) == null) { + synchronized (DatabaseAdminGrpc.class) { + if ((getListBackupOperationsMethod = DatabaseAdminGrpc.getListBackupOperationsMethod) + == null) { + DatabaseAdminGrpc.getListBackupOperationsMethod = + getListBackupOperationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.spanner.admin.database.v1.DatabaseAdmin", + "ListBackupOperations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.spanner.admin.database.v1.ListBackupOperationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DatabaseAdminMethodDescriptorSupplier("ListBackupOperations")) + .build(); + } + } + } + return getListBackupOperationsMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static DatabaseAdminStub newStub(io.grpc.Channel channel) { return new DatabaseAdminStub(channel); @@ -563,7 +1029,8 @@ public static DatabaseAdminFutureStub newFutureStub(io.grpc.Channel channel) { * Cloud Spanner Database Admin API * The Cloud Spanner Database Admin API can be used to create, drop, and * list databases. It also enables updating the schema of pre-existing - * databases. + * databases. It can be also used to create, delete and list backups for a + * database and to restore from an existing backup. *
*/ public abstract static class DatabaseAdminImplBase implements io.grpc.BindableService { @@ -640,6 +1107,8 @@ public void updateDatabaseDdl( * *
      * Drops (aka deletes) a Cloud Spanner database.
+     * Completed backups for the database will be retained according to their
+     * `expire_time`.
      * 
*/ public void dropDatabase( @@ -668,10 +1137,12 @@ public void getDatabaseDdl( * * *
-     * Sets the access control policy on a database resource.
+     * Sets the access control policy on a database or backup resource.
      * Replaces any existing policy.
      * Authorization requires `spanner.databases.setIamPolicy`
      * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
+     * For backups, authorization requires `spanner.backups.setIamPolicy`
+     * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
      * 
*/ public void setIamPolicy( @@ -684,11 +1155,13 @@ public void setIamPolicy( * * *
-     * Gets the access control policy for a database resource.
-     * Returns an empty policy if a database exists but does
-     * not have a policy set.
+     * 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][google.iam.v1.GetIamPolicyRequest.resource].
+     * For backups, authorization requires `spanner.backups.getIamPolicy`
+     * permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
      * 
*/ public void getIamPolicy( @@ -701,11 +1174,15 @@ public void getIamPolicy( * * *
-     * Returns permissions that the caller has on the specified database resource.
+     * 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.
      * 
*/ public void testIamPermissions( @@ -715,6 +1192,160 @@ public void testIamPermissions( asyncUnimplementedUnaryCall(getTestIamPermissionsMethodHelper(), responseObserver); } + /** + * + * + *
+     * Starts creating a new Cloud Spanner Backup.
+     * The returned backup [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Backup][google.spanner.admin.database.v1.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.
+     * 
+ */ + public void createBackup( + com.google.spanner.admin.database.v1.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateBackupMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public void getBackup( + com.google.spanner.admin.database.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetBackupMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public void updateBackup( + com.google.spanner.admin.database.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateBackupMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public void deleteBackup( + com.google.spanner.admin.database.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteBackupMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists completed and pending backups.
+     * Backups returned are ordered by `create_time` in descending order,
+     * starting from the most recent `create_time`.
+     * 
+ */ + public void listBackups( + com.google.spanner.admin.database.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListBackupsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type
+     * is [Database][google.spanner.admin.database.v1.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.
+     * 
+ */ + public void restoreDatabase( + com.google.spanner.admin.database.v1.RestoreDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRestoreDatabaseMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists database [longrunning-operations][google.longrunning.Operation].
+     * A database operation has a name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
+     * The long-running operation
+     * [metadata][google.longrunning.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.
+     * 
+ */ + public void listDatabaseOperations( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest request, + io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListDatabaseOperationsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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.
+     * 
+ */ + public void listBackupOperations( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest request, + io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListBackupOperationsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListBackupOperationsMethodHelper(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -775,6 +1406,57 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse>( this, METHODID_TEST_IAM_PERMISSIONS))) + .addMethod( + getCreateBackupMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.CreateBackupRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_BACKUP))) + .addMethod( + getGetBackupMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.GetBackupRequest, + com.google.spanner.admin.database.v1.Backup>(this, METHODID_GET_BACKUP))) + .addMethod( + getUpdateBackupMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.UpdateBackupRequest, + com.google.spanner.admin.database.v1.Backup>(this, METHODID_UPDATE_BACKUP))) + .addMethod( + getDeleteBackupMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.DeleteBackupRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_BACKUP))) + .addMethod( + getListBackupsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.ListBackupsRequest, + com.google.spanner.admin.database.v1.ListBackupsResponse>( + this, METHODID_LIST_BACKUPS))) + .addMethod( + getRestoreDatabaseMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.RestoreDatabaseRequest, + com.google.longrunning.Operation>(this, METHODID_RESTORE_DATABASE))) + .addMethod( + getListDatabaseOperationsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse>( + this, METHODID_LIST_DATABASE_OPERATIONS))) + .addMethod( + getListBackupOperationsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.spanner.admin.database.v1.ListBackupOperationsRequest, + com.google.spanner.admin.database.v1.ListBackupOperationsResponse>( + this, METHODID_LIST_BACKUP_OPERATIONS))) .build(); } } @@ -786,7 +1468,8 @@ public final io.grpc.ServerServiceDefinition bindService() { * Cloud Spanner Database Admin API * The Cloud Spanner Database Admin API can be used to create, drop, and * list databases. It also enables updating the schema of pre-existing - * databases. + * databases. It can be also used to create, delete and list backups for a + * database and to restore from an existing backup. *
*/ public static final class DatabaseAdminStub extends io.grpc.stub.AbstractStub { @@ -807,15 +1490,182 @@ protected DatabaseAdminStub build(io.grpc.Channel channel, io.grpc.CallOptions c * * *
-     * Lists Cloud Spanner databases.
+     * Lists Cloud Spanner databases.
+     * 
+ */ + public void listDatabases( + com.google.spanner.admin.database.v1.ListDatabasesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListDatabasesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new Cloud Spanner database and starts to prepare it for serving.
+     * The returned [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Database][google.spanner.admin.database.v1.Database], if successful.
+     * 
+ */ + public void createDatabase( + com.google.spanner.admin.database.v1.CreateDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateDatabaseMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the state of a Cloud Spanner database.
+     * 
+ */ + public void getDatabase( + com.google.spanner.admin.database.v1.GetDatabaseRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetDatabaseMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the schema of a Cloud Spanner database by
+     * creating/altering/dropping tables, columns, indexes, etc. The returned
+     * [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].  The operation has no response.
+     * 
+ */ + public void updateDatabaseDdl( + com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateDatabaseDdlMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Drops (aka deletes) a Cloud Spanner database.
+     * Completed backups for the database will be retained according to their
+     * `expire_time`.
+     * 
+ */ + public void dropDatabase( + com.google.spanner.admin.database.v1.DropDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDropDatabaseMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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][google.longrunning.Operations] API.
+     * 
+ */ + public void getDatabaseDdl( + com.google.spanner.admin.database.v1.GetDatabaseDdlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetDatabaseDdlMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on a database or backup resource.
+     * Replaces any existing policy.
+     * Authorization requires `spanner.databases.setIamPolicy`
+     * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
+     * For backups, authorization requires `spanner.backups.setIamPolicy`
+     * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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][google.iam.v1.GetIamPolicyRequest.resource].
+     * For backups, authorization requires `spanner.backups.getIamPolicy`
+     * permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
      * 
*/ - public void listDatabases( - com.google.spanner.admin.database.v1.ListDatabasesRequest request, - io.grpc.stub.StreamObserver + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getListDatabasesMethodHelper(), getCallOptions()), + getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), request, responseObserver); } @@ -824,21 +1674,25 @@ public void listDatabases( * * *
-     * Creates a new Cloud Spanner database and starts to prepare it for serving.
-     * The returned [long-running operation][google.longrunning.Operation] will
-     * have a name of the format `<database_name>/operations/<operation_id>` and
-     * can be used to track preparation of the database. The
+     * Starts creating a new Cloud Spanner Backup.
+     * The returned backup [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is
-     * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
      * [response][google.longrunning.Operation.response] field type is
-     * [Database][google.spanner.admin.database.v1.Database], if successful.
+     * [Backup][google.spanner.admin.database.v1.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.
      * 
*/ - public void createDatabase( - com.google.spanner.admin.database.v1.CreateDatabaseRequest request, + public void createBackup( + com.google.spanner.admin.database.v1.CreateBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getCreateDatabaseMethodHelper(), getCallOptions()), + getChannel().newCall(getCreateBackupMethodHelper(), getCallOptions()), request, responseObserver); } @@ -847,15 +1701,14 @@ public void createDatabase( * * *
-     * Gets the state of a Cloud Spanner database.
+     * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
      * 
*/ - public void getDatabase( - com.google.spanner.admin.database.v1.GetDatabaseRequest request, - io.grpc.stub.StreamObserver - responseObserver) { + public void getBackup( + com.google.spanner.admin.database.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getGetDatabaseMethodHelper(), getCallOptions()), + getChannel().newCall(getGetBackupMethodHelper(), getCallOptions()), request, responseObserver); } @@ -864,20 +1717,14 @@ public void getDatabase( * * *
-     * Updates the schema of a Cloud Spanner database by
-     * creating/altering/dropping tables, columns, indexes, etc. The returned
-     * [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is
-     * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].  The operation has no response.
+     * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
      * 
*/ - public void updateDatabaseDdl( - com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void updateBackup( + com.google.spanner.admin.database.v1.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getUpdateDatabaseDdlMethodHelper(), getCallOptions()), + getChannel().newCall(getUpdateBackupMethodHelper(), getCallOptions()), request, responseObserver); } @@ -886,14 +1733,14 @@ public void updateDatabaseDdl( * * *
-     * Drops (aka deletes) a Cloud Spanner database.
+     * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
      * 
*/ - public void dropDatabase( - com.google.spanner.admin.database.v1.DropDatabaseRequest request, + public void deleteBackup( + com.google.spanner.admin.database.v1.DeleteBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getDropDatabaseMethodHelper(), getCallOptions()), + getChannel().newCall(getDeleteBackupMethodHelper(), getCallOptions()), request, responseObserver); } @@ -902,17 +1749,17 @@ public void dropDatabase( * * *
-     * 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][google.longrunning.Operations] API.
+     * Lists completed and pending backups.
+     * Backups returned are ordered by `create_time` in descending order,
+     * starting from the most recent `create_time`.
      * 
*/ - public void getDatabaseDdl( - com.google.spanner.admin.database.v1.GetDatabaseDdlRequest request, - io.grpc.stub.StreamObserver + public void listBackups( + com.google.spanner.admin.database.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getGetDatabaseDdlMethodHelper(), getCallOptions()), + getChannel().newCall(getListBackupsMethodHelper(), getCallOptions()), request, responseObserver); } @@ -921,17 +1768,30 @@ public void getDatabaseDdl( * * *
-     * Sets the access control policy on a database resource.
-     * Replaces any existing policy.
-     * Authorization requires `spanner.databases.setIamPolicy`
-     * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
+     * 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type
+     * is [Database][google.spanner.admin.database.v1.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.
      * 
*/ - public void setIamPolicy( - com.google.iam.v1.SetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void restoreDatabase( + com.google.spanner.admin.database.v1.RestoreDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getSetIamPolicyMethodHelper(), getCallOptions()), + getChannel().newCall(getRestoreDatabaseMethodHelper(), getCallOptions()), request, responseObserver); } @@ -940,18 +1800,23 @@ public void setIamPolicy( * * *
-     * Gets the access control policy for a database resource.
-     * Returns an empty policy if a database exists but does
-     * not have a policy set.
-     * Authorization requires `spanner.databases.getIamPolicy` permission on
-     * [resource][google.iam.v1.GetIamPolicyRequest.resource].
+     * Lists database [longrunning-operations][google.longrunning.Operation].
+     * A database operation has a name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
+     * The long-running operation
+     * [metadata][google.longrunning.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.
      * 
*/ - public void getIamPolicy( - com.google.iam.v1.GetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void listDatabaseOperations( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest request, + io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse> + responseObserver) { asyncUnaryCall( - getChannel().newCall(getGetIamPolicyMethodHelper(), getCallOptions()), + getChannel().newCall(getListDatabaseOperationsMethodHelper(), getCallOptions()), request, responseObserver); } @@ -960,19 +1825,25 @@ public void getIamPolicy( * * *
-     * Returns permissions that the caller has on the specified database 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.
+     * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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.
      * 
*/ - public void testIamPermissions( - com.google.iam.v1.TestIamPermissionsRequest request, - io.grpc.stub.StreamObserver + public void listBackupOperations( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest request, + io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListBackupOperationsResponse> responseObserver) { asyncUnaryCall( - getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), + getChannel().newCall(getListBackupOperationsMethodHelper(), getCallOptions()), request, responseObserver); } @@ -985,7 +1856,8 @@ public void testIamPermissions( * Cloud Spanner Database Admin API * The Cloud Spanner Database Admin API can be used to create, drop, and * list databases. It also enables updating the schema of pre-existing - * databases. + * databases. It can be also used to create, delete and list backups for a + * database and to restore from an existing backup. *
*/ public static final class DatabaseAdminBlockingStub @@ -1074,6 +1946,8 @@ public com.google.longrunning.Operation updateDatabaseDdl( * *
      * Drops (aka deletes) a Cloud Spanner database.
+     * Completed backups for the database will be retained according to their
+     * `expire_time`.
      * 
*/ public com.google.protobuf.Empty dropDatabase( @@ -1101,10 +1975,12 @@ public com.google.spanner.admin.database.v1.GetDatabaseDdlResponse getDatabaseDd * * *
-     * Sets the access control policy on a database resource.
+     * Sets the access control policy on a database or backup resource.
      * Replaces any existing policy.
      * Authorization requires `spanner.databases.setIamPolicy`
      * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
+     * For backups, authorization requires `spanner.backups.setIamPolicy`
+     * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
      * 
*/ public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { @@ -1116,11 +1992,13 @@ public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyReque * * *
-     * Gets the access control policy for a database resource.
-     * Returns an empty policy if a database exists but does
-     * not have a policy set.
+     * 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][google.iam.v1.GetIamPolicyRequest.resource].
+     * For backups, authorization requires `spanner.backups.getIamPolicy`
+     * permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
      * 
*/ public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { @@ -1132,11 +2010,15 @@ public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyReque * * *
-     * Returns permissions that the caller has on the specified database resource.
+     * 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.
      * 
*/ public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( @@ -1144,6 +2026,155 @@ public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( return blockingUnaryCall( getChannel(), getTestIamPermissionsMethodHelper(), getCallOptions(), request); } + + /** + * + * + *
+     * Starts creating a new Cloud Spanner Backup.
+     * The returned backup [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Backup][google.spanner.admin.database.v1.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.
+     * 
+ */ + public com.google.longrunning.Operation createBackup( + com.google.spanner.admin.database.v1.CreateBackupRequest request) { + return blockingUnaryCall( + getChannel(), getCreateBackupMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public com.google.spanner.admin.database.v1.Backup getBackup( + com.google.spanner.admin.database.v1.GetBackupRequest request) { + return blockingUnaryCall(getChannel(), getGetBackupMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public com.google.spanner.admin.database.v1.Backup updateBackup( + com.google.spanner.admin.database.v1.UpdateBackupRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateBackupMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public com.google.protobuf.Empty deleteBackup( + com.google.spanner.admin.database.v1.DeleteBackupRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteBackupMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists completed and pending backups.
+     * Backups returned are ordered by `create_time` in descending order,
+     * starting from the most recent `create_time`.
+     * 
+ */ + public com.google.spanner.admin.database.v1.ListBackupsResponse listBackups( + com.google.spanner.admin.database.v1.ListBackupsRequest request) { + return blockingUnaryCall( + getChannel(), getListBackupsMethodHelper(), getCallOptions(), 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type
+     * is [Database][google.spanner.admin.database.v1.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.
+     * 
+ */ + public com.google.longrunning.Operation restoreDatabase( + com.google.spanner.admin.database.v1.RestoreDatabaseRequest request) { + return blockingUnaryCall( + getChannel(), getRestoreDatabaseMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists database [longrunning-operations][google.longrunning.Operation].
+     * A database operation has a name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
+     * The long-running operation
+     * [metadata][google.longrunning.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.
+     * 
+ */ + public com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + listDatabaseOperations( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest request) { + return blockingUnaryCall( + getChannel(), getListDatabaseOperationsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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.
+     * 
+ */ + public com.google.spanner.admin.database.v1.ListBackupOperationsResponse listBackupOperations( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest request) { + return blockingUnaryCall( + getChannel(), getListBackupOperationsMethodHelper(), getCallOptions(), request); + } } /** @@ -1153,7 +2184,8 @@ public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( * Cloud Spanner Database Admin API * The Cloud Spanner Database Admin API can be used to create, drop, and * list databases. It also enables updating the schema of pre-existing - * databases. + * databases. It can be also used to create, delete and list backups for a + * database and to restore from an existing backup. *
*/ public static final class DatabaseAdminFutureStub @@ -1244,6 +2276,8 @@ protected DatabaseAdminFutureStub build( * *
      * Drops (aka deletes) a Cloud Spanner database.
+     * Completed backups for the database will be retained according to their
+     * `expire_time`.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture @@ -1272,10 +2306,12 @@ protected DatabaseAdminFutureStub build( * * *
-     * Sets the access control policy on a database resource.
+     * Sets the access control policy on a database or backup resource.
      * Replaces any existing policy.
      * Authorization requires `spanner.databases.setIamPolicy`
      * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
+     * For backups, authorization requires `spanner.backups.setIamPolicy`
+     * permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
      * 
*/ public com.google.common.util.concurrent.ListenableFuture @@ -1288,11 +2324,13 @@ protected DatabaseAdminFutureStub build( * * *
-     * Gets the access control policy for a database resource.
-     * Returns an empty policy if a database exists but does
-     * not have a policy set.
+     * 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][google.iam.v1.GetIamPolicyRequest.resource].
+     * For backups, authorization requires `spanner.backups.getIamPolicy`
+     * permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
      * 
*/ public com.google.common.util.concurrent.ListenableFuture @@ -1305,11 +2343,15 @@ protected DatabaseAdminFutureStub build( * * *
-     * Returns permissions that the caller has on the specified database resource.
+     * 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.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< @@ -1318,6 +2360,162 @@ protected DatabaseAdminFutureStub build( return futureUnaryCall( getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), request); } + + /** + * + * + *
+     * Starts creating a new Cloud Spanner Backup.
+     * The returned backup [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Backup][google.spanner.admin.database.v1.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBackup(com.google.spanner.admin.database.v1.CreateBackupRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateBackupMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.Backup> + getBackup(com.google.spanner.admin.database.v1.GetBackupRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetBackupMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.Backup> + updateBackup(com.google.spanner.admin.database.v1.UpdateBackupRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateBackupMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.spanner.admin.database.v1.DeleteBackupRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteBackupMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists completed and pending backups.
+     * Backups returned are ordered by `create_time` in descending order,
+     * starting from the most recent `create_time`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.ListBackupsResponse> + listBackups(com.google.spanner.admin.database.v1.ListBackupsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListBackupsMethodHelper(), getCallOptions()), 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][google.longrunning.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][google.longrunning.Operation.metadata] field type is
+     * [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type
+     * is [Database][google.spanner.admin.database.v1.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restoreDatabase(com.google.spanner.admin.database.v1.RestoreDatabaseRequest request) { + return futureUnaryCall( + getChannel().newCall(getRestoreDatabaseMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists database [longrunning-operations][google.longrunning.Operation].
+     * A database operation has a name of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
+     * The long-running operation
+     * [metadata][google.longrunning.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse> + listDatabaseOperations( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListDatabaseOperationsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.spanner.admin.database.v1.ListBackupOperationsResponse> + listBackupOperations( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListBackupOperationsMethodHelper(), getCallOptions()), request); + } } private static final int METHODID_LIST_DATABASES = 0; @@ -1329,6 +2527,14 @@ protected DatabaseAdminFutureStub build( private static final int METHODID_SET_IAM_POLICY = 6; private static final int METHODID_GET_IAM_POLICY = 7; private static final int METHODID_TEST_IAM_PERMISSIONS = 8; + private static final int METHODID_CREATE_BACKUP = 9; + private static final int METHODID_GET_BACKUP = 10; + private static final int METHODID_UPDATE_BACKUP = 11; + private static final int METHODID_DELETE_BACKUP = 12; + private static final int METHODID_LIST_BACKUPS = 13; + private static final int METHODID_RESTORE_DATABASE = 14; + private static final int METHODID_LIST_DATABASE_OPERATIONS = 15; + private static final int METHODID_LIST_BACKUP_OPERATIONS = 16; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1398,6 +2604,54 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.spanner.admin.database.v1.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.spanner.admin.database.v1.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.spanner.admin.database.v1.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.spanner.admin.database.v1.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.spanner.admin.database.v1.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListBackupsResponse>) + responseObserver); + break; + case METHODID_RESTORE_DATABASE: + serviceImpl.restoreDatabase( + (com.google.spanner.admin.database.v1.RestoreDatabaseRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_DATABASE_OPERATIONS: + serviceImpl.listDatabaseOperations( + (com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse>) + responseObserver); + break; + case METHODID_LIST_BACKUP_OPERATIONS: + serviceImpl.listBackupOperations( + (com.google.spanner.admin.database.v1.ListBackupOperationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.spanner.admin.database.v1.ListBackupOperationsResponse>) + responseObserver); + break; default: throw new AssertionError(); } @@ -1471,6 +2725,14 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getSetIamPolicyMethodHelper()) .addMethod(getGetIamPolicyMethodHelper()) .addMethod(getTestIamPermissionsMethodHelper()) + .addMethod(getCreateBackupMethodHelper()) + .addMethod(getGetBackupMethodHelper()) + .addMethod(getUpdateBackupMethodHelper()) + .addMethod(getDeleteBackupMethodHelper()) + .addMethod(getListBackupsMethodHelper()) + .addMethod(getRestoreDatabaseMethodHelper()) + .addMethod(getListDatabaseOperationsMethodHelper()) + .addMethod(getListBackupOperationsMethodHelper()) .build(); } } diff --git a/proto-google-cloud-spanner-admin-database-v1/clirr-ignored-differences.xml b/proto-google-cloud-spanner-admin-database-v1/clirr-ignored-differences.xml new file mode 100644 index 0000000000..e041533fa5 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/clirr-ignored-differences.xml @@ -0,0 +1,34 @@ + + + + + 7012 + com/google/spanner/admin/database/v1/DatabaseOrBuilder + * getCreateTime() + + + 7012 + com/google/spanner/admin/database/v1/DatabaseOrBuilder + * getCreateTimeOrBuilder() + + + 7012 + com/google/spanner/admin/database/v1/DatabaseOrBuilder + * getRestoreInfo() + + + 7012 + com/google/spanner/admin/database/v1/DatabaseOrBuilder + * getRestoreInfoOrBuilder() + + + 7012 + com/google/spanner/admin/database/v1/DatabaseOrBuilder + * hasCreateTime() + + + 7012 + com/google/spanner/admin/database/v1/DatabaseOrBuilder + * hasRestoreInfo() + + diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java new file mode 100644 index 0000000000..6c3d71ffb9 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java @@ -0,0 +1,2338 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * A backup of a Cloud Spanner database.
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.Backup} + */ +public final class Backup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Backup() { + database_ = ""; + name_ = ""; + state_ = 0; + referencingDatabases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Backup(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Backup( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + database_ = s; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + sizeBytes_ = input.readInt64(); + break; + } + case 48: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + referencingDatabases_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + referencingDatabases_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + referencingDatabases_ = referencingDatabases_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.Backup.class, + com.google.spanner.admin.database.v1.Backup.Builder.class); + } + + /** + * + * + *
+   * Indicates the current state of the backup.
+   * 
+ * + * Protobuf enum {@code google.spanner.admin.database.v1.Backup.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The pending backup is still being created. Operations on the
+     * backup may fail with `FAILED_PRECONDITION` in this state.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The backup is complete and ready for use.
+     * 
+ * + * READY = 2; + */ + READY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The pending backup is still being created. Operations on the
+     * backup may fail with `FAILED_PRECONDITION` in this state.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * The backup is complete and ready for use.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CREATING; + case 2: + return READY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.admin.database.v1.Backup.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.admin.database.v1.Backup.State) + } + + public static final int DATABASE_FIELD_NUMBER = 2; + private volatile java.lang.Object database_; + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * Name of the database from which this backup was
+   * created. This needs to be in the same instance as the backup.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>`.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * Name of the database from which this backup was
+   * created. This needs to be in the same instance as the backup.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>`.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+   * operation. The expiration time of the backup, with microseconds
+   * granularity that must be at least 6 hours and at most 366 days
+   * from the time the CreateBackup request is processed. 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.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+   * operation. The expiration time of the backup, with microseconds
+   * granularity that must be at least 6 hours and at most 366 days
+   * from the time the CreateBackup request is processed. 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.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+   * operation. The expiration time of the backup, with microseconds
+   * granularity that must be at least 6 hours and at most 366 days
+   * from the time the CreateBackup request is processed. 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.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+   * A globally unique identifier for the backup which cannot be
+   * changed. Values are of the form
+   * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+   * The final segment of the name must be between 2 and 60 characters
+   * in length.
+   * The backup is stored in the location(s) specified in the instance
+   * configuration of the instance containing the backup, identified
+   * by the prefix of the backup name of the form
+   * `projects/<project>/instances/<instance>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+   * A globally unique identifier for the backup which cannot be
+   * changed. Values are of the form
+   * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+   * The final segment of the name must be between 2 and 60 characters
+   * in length.
+   * The backup is stored in the location(s) specified in the instance
+   * configuration of the instance containing the backup, identified
+   * by the prefix of the backup name of the form
+   * `projects/<project>/instances/<instance>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The backup will contain an externally consistent
+   * copy of the database at the timestamp specified by
+   * `create_time`. `create_time` is approximately the time the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The backup will contain an externally consistent
+   * copy of the database at the timestamp specified by
+   * `create_time`. `create_time` is approximately the time the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The backup will contain an externally consistent
+   * copy of the database at the timestamp specified by
+   * `create_time`. `create_time` is approximately the time the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int SIZE_BYTES_FIELD_NUMBER = 5; + private long sizeBytes_; + /** + * + * + *
+   * Output only. Size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + public long getSizeBytes() { + return sizeBytes_; + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + public com.google.spanner.admin.database.v1.Backup.State getState() { + @SuppressWarnings("deprecation") + com.google.spanner.admin.database.v1.Backup.State result = + com.google.spanner.admin.database.v1.Backup.State.valueOf(state_); + return result == null ? com.google.spanner.admin.database.v1.Backup.State.UNRECOGNIZED : result; + } + + public static final int REFERENCING_DATABASES_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList referencingDatabases_; + /** + * + * + *
+   * Output only. The names of the restored databases that reference the backup.
+   * The database names are of
+   * the form `projects/<project>/instances/<instance>/databases/<database>`.
+   * Referencing databases may exist in different instances. The existence of
+   * any referencing database prevents the backup from being deleted. When a
+   * restored database from the backup enters the `READY` state, the reference
+   * to the backup is removed.
+   * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the referencingDatabases. + */ + public com.google.protobuf.ProtocolStringList getReferencingDatabasesList() { + return referencingDatabases_; + } + /** + * + * + *
+   * Output only. The names of the restored databases that reference the backup.
+   * The database names are of
+   * the form `projects/<project>/instances/<instance>/databases/<database>`.
+   * Referencing databases may exist in different instances. The existence of
+   * any referencing database prevents the backup from being deleted. When a
+   * restored database from the backup enters the `READY` state, the reference
+   * to the backup is removed.
+   * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of referencingDatabases. + */ + public int getReferencingDatabasesCount() { + return referencingDatabases_.size(); + } + /** + * + * + *
+   * Output only. The names of the restored databases that reference the backup.
+   * The database names are of
+   * the form `projects/<project>/instances/<instance>/databases/<database>`.
+   * Referencing databases may exist in different instances. The existence of
+   * any referencing database prevents the backup from being deleted. When a
+   * restored database from the backup enters the `READY` state, the reference
+   * to the backup is removed.
+   * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The referencingDatabases at the given index. + */ + public java.lang.String getReferencingDatabases(int index) { + return referencingDatabases_.get(index); + } + /** + * + * + *
+   * Output only. The names of the restored databases that reference the backup.
+   * The database names are of
+   * the form `projects/<project>/instances/<instance>/databases/<database>`.
+   * Referencing databases may exist in different instances. The existence of
+   * any referencing database prevents the backup from being deleted. When a
+   * restored database from the backup enters the `READY` state, the reference
+   * to the backup is removed.
+   * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the referencingDatabases at the given index. + */ + public com.google.protobuf.ByteString getReferencingDatabasesBytes(int index) { + return referencingDatabases_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, database_); + } + if (expireTime_ != null) { + output.writeMessage(3, getExpireTime()); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (sizeBytes_ != 0L) { + output.writeInt64(5, sizeBytes_); + } + if (state_ != com.google.spanner.admin.database.v1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, state_); + } + for (int i = 0; i < referencingDatabases_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 7, referencingDatabases_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, database_); + } + if (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExpireTime()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (sizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, sizeBytes_); + } + if (state_ != com.google.spanner.admin.database.v1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + { + int dataSize = 0; + for (int i = 0; i < referencingDatabases_.size(); i++) { + dataSize += computeStringSizeNoTag(referencingDatabases_.getRaw(i)); + } + size += dataSize; + size += 1 * getReferencingDatabasesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.Backup)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.Backup other = + (com.google.spanner.admin.database.v1.Backup) obj; + + if (!getDatabase().equals(other.getDatabase())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (getSizeBytes() != other.getSizeBytes()) return false; + if (state_ != other.state_) return false; + if (!getReferencingDatabasesList().equals(other.getReferencingDatabasesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeBytes()); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (getReferencingDatabasesCount() > 0) { + hash = (37 * hash) + REFERENCING_DATABASES_FIELD_NUMBER; + hash = (53 * hash) + getReferencingDatabasesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.Backup parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.Backup parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.Backup parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.admin.database.v1.Backup prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A backup of a Cloud Spanner database.
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.Backup) + com.google.spanner.admin.database.v1.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.Backup.class, + com.google.spanner.admin.database.v1.Backup.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.Backup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + database_ = ""; + + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + sizeBytes_ = 0L; + + state_ = 0; + + referencingDatabases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_Backup_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.Backup getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.Backup build() { + com.google.spanner.admin.database.v1.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.Backup buildPartial() { + com.google.spanner.admin.database.v1.Backup result = + new com.google.spanner.admin.database.v1.Backup(this); + int from_bitField0_ = bitField0_; + result.database_ = database_; + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.build(); + } + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.sizeBytes_ = sizeBytes_; + result.state_ = state_; + if (((bitField0_ & 0x00000001) != 0)) { + referencingDatabases_ = referencingDatabases_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.referencingDatabases_ = referencingDatabases_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.Backup) { + return mergeFrom((com.google.spanner.admin.database.v1.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.Backup other) { + if (other == com.google.spanner.admin.database.v1.Backup.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.getSizeBytes() != 0L) { + setSizeBytes(other.getSizeBytes()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.referencingDatabases_.isEmpty()) { + if (referencingDatabases_.isEmpty()) { + referencingDatabases_ = other.referencingDatabases_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReferencingDatabasesIsMutable(); + referencingDatabases_.addAll(other.referencingDatabases_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.Backup parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.spanner.admin.database.v1.Backup) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Name of the database from which this backup was
+     * created. This needs to be in the same instance as the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>`.
+     * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Name of the database from which this backup was
+     * created. This needs to be in the same instance as the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>`.
+     * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Name of the database from which this backup was
+     * created. This needs to be in the same instance as the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>`.
+     * 
+ * + * string database = 2; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Name of the database from which this backup was
+     * created. This needs to be in the same instance as the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>`.
+     * 
+ * + * string database = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Name of the database from which this backup was
+     * created. This needs to be in the same instance as the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/databases/<database>`.
+     * 
+ * + * string database = 2; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+     * operation. The expiration time of the backup, with microseconds
+     * granularity that must be at least 6 hours and at most 366 days
+     * from the time the CreateBackup request is processed. 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.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters
+     * in length.
+     * The backup is stored in the location(s) specified in the instance
+     * configuration of the instance containing the backup, identified
+     * by the prefix of the backup name of the form
+     * `projects/<project>/instances/<instance>`.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters
+     * in length.
+     * The backup is stored in the location(s) specified in the instance
+     * configuration of the instance containing the backup, identified
+     * by the prefix of the backup name of the form
+     * `projects/<project>/instances/<instance>`.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters
+     * in length.
+     * The backup is stored in the location(s) specified in the instance
+     * configuration of the instance containing the backup, identified
+     * by the prefix of the backup name of the form
+     * `projects/<project>/instances/<instance>`.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters
+     * in length.
+     * The backup is stored in the location(s) specified in the instance
+     * configuration of the instance containing the backup, identified
+     * by the prefix of the backup name of the form
+     * `projects/<project>/instances/<instance>`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+     * The final segment of the name must be between 2 and 60 characters
+     * in length.
+     * The backup is stored in the location(s) specified in the instance
+     * configuration of the instance containing the backup, identified
+     * by the prefix of the backup name of the form
+     * `projects/<project>/instances/<instance>`.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The backup will contain an externally consistent
+     * copy of the database at the timestamp specified by
+     * `create_time`. `create_time` is approximately the time the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private long sizeBytes_; + /** + * + * + *
+     * Output only. Size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + public long getSizeBytes() { + return sizeBytes_; + } + /** + * + * + *
+     * Output only. Size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeBytes to set. + * @return This builder for chaining. + */ + public Builder setSizeBytes(long value) { + + sizeBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeBytes() { + + sizeBytes_ = 0L; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + public com.google.spanner.admin.database.v1.Backup.State getState() { + @SuppressWarnings("deprecation") + com.google.spanner.admin.database.v1.Backup.State result = + com.google.spanner.admin.database.v1.Backup.State.valueOf(state_); + return result == null + ? com.google.spanner.admin.database.v1.Backup.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.spanner.admin.database.v1.Backup.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList referencingDatabases_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureReferencingDatabasesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + referencingDatabases_ = new com.google.protobuf.LazyStringArrayList(referencingDatabases_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the referencingDatabases. + */ + public com.google.protobuf.ProtocolStringList getReferencingDatabasesList() { + return referencingDatabases_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of referencingDatabases. + */ + public int getReferencingDatabasesCount() { + return referencingDatabases_.size(); + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The referencingDatabases at the given index. + */ + public java.lang.String getReferencingDatabases(int index) { + return referencingDatabases_.get(index); + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the referencingDatabases at the given index. + */ + public com.google.protobuf.ByteString getReferencingDatabasesBytes(int index) { + return referencingDatabases_.getByteString(index); + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The referencingDatabases to set. + * @return This builder for chaining. + */ + public Builder setReferencingDatabases(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencingDatabasesIsMutable(); + referencingDatabases_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The referencingDatabases to add. + * @return This builder for chaining. + */ + public Builder addReferencingDatabases(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencingDatabasesIsMutable(); + referencingDatabases_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The referencingDatabases to add. + * @return This builder for chaining. + */ + public Builder addAllReferencingDatabases(java.lang.Iterable values) { + ensureReferencingDatabasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, referencingDatabases_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearReferencingDatabases() { + referencingDatabases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The names of the restored databases that reference the backup.
+     * The database names are of
+     * the form `projects/<project>/instances/<instance>/databases/<database>`.
+     * Referencing databases may exist in different instances. The existence of
+     * any referencing database prevents the backup from being deleted. When a
+     * restored database from the backup enters the `READY` state, the reference
+     * to the backup is removed.
+     * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the referencingDatabases to add. + * @return This builder for chaining. + */ + public Builder addReferencingDatabasesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureReferencingDatabasesIsMutable(); + referencingDatabases_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.Backup) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.Backup) + private static final com.google.spanner.admin.database.v1.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.Backup(); + } + + public static com.google.spanner.admin.database.v1.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Backup(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java new file mode 100644 index 0000000000..8e9bcfc842 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java @@ -0,0 +1,1091 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * Information about a backup.
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.BackupInfo} + */ +public final class BackupInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.BackupInfo) + BackupInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use BackupInfo.newBuilder() to construct. + private BackupInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BackupInfo() { + backup_ = ""; + sourceDatabase_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BackupInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BackupInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + backup_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceDatabase_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_BackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_BackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.BackupInfo.class, + com.google.spanner.admin.database.v1.BackupInfo.Builder.class); + } + + public static final int BACKUP_FIELD_NUMBER = 1; + private volatile java.lang.Object backup_; + /** + * + * + *
+   * Name of the backup.
+   * 
+ * + * string backup = 1; + * + * @return The backup. + */ + public java.lang.String getBackup() { + java.lang.Object ref = backup_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backup_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the backup.
+   * 
+ * + * string backup = 1; + * + * @return The bytes for backup. + */ + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = backup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The backup contains an externally consistent copy of `source_database` at
+   * the timestamp specified by `create_time`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The backup contains an externally consistent copy of `source_database` at
+   * the timestamp specified by `create_time`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The backup contains an externally consistent copy of `source_database` at
+   * the timestamp specified by `create_time`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int SOURCE_DATABASE_FIELD_NUMBER = 3; + private volatile java.lang.Object sourceDatabase_; + /** + * + * + *
+   * Name of the database the backup was created from.
+   * 
+ * + * string source_database = 3; + * + * @return The sourceDatabase. + */ + public java.lang.String getSourceDatabase() { + java.lang.Object ref = sourceDatabase_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceDatabase_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the database the backup was created from.
+   * 
+ * + * string source_database = 3; + * + * @return The bytes for sourceDatabase. + */ + public com.google.protobuf.ByteString getSourceDatabaseBytes() { + java.lang.Object ref = sourceDatabase_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceDatabase_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getBackupBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, backup_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (!getSourceDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sourceDatabase_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getBackupBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, backup_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (!getSourceDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sourceDatabase_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.BackupInfo)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.BackupInfo other = + (com.google.spanner.admin.database.v1.BackupInfo) obj; + + if (!getBackup().equals(other.getBackup())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getSourceDatabase().equals(other.getSourceDatabase())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + SOURCE_DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getSourceDatabase().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.BackupInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.admin.database.v1.BackupInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information about a backup.
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.BackupInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.BackupInfo) + com.google.spanner.admin.database.v1.BackupInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_BackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_BackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.BackupInfo.class, + com.google.spanner.admin.database.v1.BackupInfo.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.BackupInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + backup_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + sourceDatabase_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_BackupInfo_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupInfo getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupInfo build() { + com.google.spanner.admin.database.v1.BackupInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupInfo buildPartial() { + com.google.spanner.admin.database.v1.BackupInfo result = + new com.google.spanner.admin.database.v1.BackupInfo(this); + result.backup_ = backup_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.sourceDatabase_ = sourceDatabase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.BackupInfo) { + return mergeFrom((com.google.spanner.admin.database.v1.BackupInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.BackupInfo other) { + if (other == com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance()) + return this; + if (!other.getBackup().isEmpty()) { + backup_ = other.backup_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getSourceDatabase().isEmpty()) { + sourceDatabase_ = other.sourceDatabase_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.BackupInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.spanner.admin.database.v1.BackupInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object backup_ = ""; + /** + * + * + *
+     * Name of the backup.
+     * 
+ * + * string backup = 1; + * + * @return The backup. + */ + public java.lang.String getBackup() { + java.lang.Object ref = backup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the backup.
+     * 
+ * + * string backup = 1; + * + * @return The bytes for backup. + */ + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = backup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the backup.
+     * 
+ * + * string backup = 1; + * + * @param value The backup to set. + * @return This builder for chaining. + */ + public Builder setBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + backup_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the backup.
+     * 
+ * + * string backup = 1; + * + * @return This builder for chaining. + */ + public Builder clearBackup() { + + backup_ = getDefaultInstance().getBackup(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the backup.
+     * 
+ * + * string backup = 1; + * + * @param value The bytes for backup to set. + * @return This builder for chaining. + */ + public Builder setBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + backup_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The backup contains an externally consistent copy of `source_database` at
+     * the timestamp specified by `create_time`.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object sourceDatabase_ = ""; + /** + * + * + *
+     * Name of the database the backup was created from.
+     * 
+ * + * string source_database = 3; + * + * @return The sourceDatabase. + */ + public java.lang.String getSourceDatabase() { + java.lang.Object ref = sourceDatabase_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceDatabase_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the database the backup was created from.
+     * 
+ * + * string source_database = 3; + * + * @return The bytes for sourceDatabase. + */ + public com.google.protobuf.ByteString getSourceDatabaseBytes() { + java.lang.Object ref = sourceDatabase_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceDatabase_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the database the backup was created from.
+     * 
+ * + * string source_database = 3; + * + * @param value The sourceDatabase to set. + * @return This builder for chaining. + */ + public Builder setSourceDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceDatabase_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the database the backup was created from.
+     * 
+ * + * string source_database = 3; + * + * @return This builder for chaining. + */ + public Builder clearSourceDatabase() { + + sourceDatabase_ = getDefaultInstance().getSourceDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the database the backup was created from.
+     * 
+ * + * string source_database = 3; + * + * @param value The bytes for sourceDatabase to set. + * @return This builder for chaining. + */ + public Builder setSourceDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceDatabase_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.BackupInfo) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.BackupInfo) + private static final com.google.spanner.admin.database.v1.BackupInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.BackupInfo(); + } + + public static com.google.spanner.admin.database.v1.BackupInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BackupInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.BackupInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java new file mode 100644 index 0000000000..250b63bc12 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface BackupInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.BackupInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the backup.
+   * 
+ * + * string backup = 1; + * + * @return The backup. + */ + java.lang.String getBackup(); + /** + * + * + *
+   * Name of the backup.
+   * 
+ * + * string backup = 1; + * + * @return The bytes for backup. + */ + com.google.protobuf.ByteString getBackupBytes(); + + /** + * + * + *
+   * The backup contains an externally consistent copy of `source_database` at
+   * the timestamp specified by `create_time`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The backup contains an externally consistent copy of `source_database` at
+   * the timestamp specified by `create_time`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The backup contains an externally consistent copy of `source_database` at
+   * the timestamp specified by `create_time`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Name of the database the backup was created from.
+   * 
+ * + * string source_database = 3; + * + * @return The sourceDatabase. + */ + java.lang.String getSourceDatabase(); + /** + * + * + *
+   * Name of the database the backup was created from.
+   * 
+ * + * string source_database = 3; + * + * @return The bytes for sourceDatabase. + */ + com.google.protobuf.ByteString getSourceDatabaseBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupName.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupName.java new file mode 100644 index 0000000000..58ce4aae1f --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupName.java @@ -0,0 +1,210 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.spanner.admin.database.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class BackupName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/backups/{backup}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String instance; + private final String backup; + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public static BackupName of(String project, String instance, String backup) { + return newBuilder().setProject(project).setInstance(instance).setBackup(backup).build(); + } + + public static String format(String project, String instance, String backup) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setBackup(backup) + .build() + .toString(); + } + + public static BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance"), matchMap.get("backup")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("instance", instance); + fieldMapBuilder.put("backup", backup); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "instance", instance, "backup", backup); + } + + /** Builder for BackupName. */ + public static class Builder { + + private String project; + private String instance; + private String backup; + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder() {} + + private Builder(BackupName backupName) { + project = backupName.project; + instance = backupName.instance; + backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BackupName) { + BackupName that = (BackupName) o; + return (this.project.equals(that.project)) + && (this.instance.equals(that.instance)) + && (this.backup.equals(that.backup)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= instance.hashCode(); + h *= 1000003; + h ^= backup.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java new file mode 100644 index 0000000000..e7050198c7 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java @@ -0,0 +1,321 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * Name of the database from which this backup was
+   * created. This needs to be in the same instance as the backup.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>`.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * Name of the database from which this backup was
+   * created. This needs to be in the same instance as the backup.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/databases/<database>`.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+   * operation. The expiration time of the backup, with microseconds
+   * granularity that must be at least 6 hours and at most 366 days
+   * from the time the CreateBackup request is processed. 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.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+   * operation. The expiration time of the backup, with microseconds
+   * granularity that must be at least 6 hours and at most 366 days
+   * from the time the CreateBackup request is processed. 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.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+   * operation. The expiration time of the backup, with microseconds
+   * granularity that must be at least 6 hours and at most 366 days
+   * from the time the CreateBackup request is processed. 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.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+   * A globally unique identifier for the backup which cannot be
+   * changed. Values are of the form
+   * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+   * The final segment of the name must be between 2 and 60 characters
+   * in length.
+   * The backup is stored in the location(s) specified in the instance
+   * configuration of the instance containing the backup, identified
+   * by the prefix of the backup name of the form
+   * `projects/<project>/instances/<instance>`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
+   * A globally unique identifier for the backup which cannot be
+   * changed. Values are of the form
+   * `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
+   * The final segment of the name must be between 2 and 60 characters
+   * in length.
+   * The backup is stored in the location(s) specified in the instance
+   * configuration of the instance containing the backup, identified
+   * by the prefix of the backup name of the form
+   * `projects/<project>/instances/<instance>`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The backup will contain an externally consistent
+   * copy of the database at the timestamp specified by
+   * `create_time`. `create_time` is approximately the time the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The backup will contain an externally consistent
+   * copy of the database at the timestamp specified by
+   * `create_time`. `create_time` is approximately the time the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The backup will contain an externally consistent
+   * copy of the database at the timestamp specified by
+   * `create_time`. `create_time` is approximately the time the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + long getSizeBytes(); + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.spanner.admin.database.v1.Backup.State getState(); + + /** + * + * + *
+   * Output only. The names of the restored databases that reference the backup.
+   * The database names are of
+   * the form `projects/<project>/instances/<instance>/databases/<database>`.
+   * Referencing databases may exist in different instances. The existence of
+   * any referencing database prevents the backup from being deleted. When a
+   * restored database from the backup enters the `READY` state, the reference
+   * to the backup is removed.
+   * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the referencingDatabases. + */ + java.util.List getReferencingDatabasesList(); + /** + * + * + *
+   * Output only. The names of the restored databases that reference the backup.
+   * The database names are of
+   * the form `projects/<project>/instances/<instance>/databases/<database>`.
+   * Referencing databases may exist in different instances. The existence of
+   * any referencing database prevents the backup from being deleted. When a
+   * restored database from the backup enters the `READY` state, the reference
+   * to the backup is removed.
+   * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of referencingDatabases. + */ + int getReferencingDatabasesCount(); + /** + * + * + *
+   * Output only. The names of the restored databases that reference the backup.
+   * The database names are of
+   * the form `projects/<project>/instances/<instance>/databases/<database>`.
+   * Referencing databases may exist in different instances. The existence of
+   * any referencing database prevents the backup from being deleted. When a
+   * restored database from the backup enters the `READY` state, the reference
+   * to the backup is removed.
+   * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The referencingDatabases at the given index. + */ + java.lang.String getReferencingDatabases(int index); + /** + * + * + *
+   * Output only. The names of the restored databases that reference the backup.
+   * The database names are of
+   * the form `projects/<project>/instances/<instance>/databases/<database>`.
+   * Referencing databases may exist in different instances. The existence of
+   * any referencing database prevents the backup from being deleted. When a
+   * restored database from the backup enters the `READY` state, the reference
+   * to the backup is removed.
+   * 
+ * + * repeated string referencing_databases = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the referencingDatabases at the given index. + */ + com.google.protobuf.ByteString getReferencingDatabasesBytes(int index); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java new file mode 100644 index 0000000000..11c21828fc --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java @@ -0,0 +1,263 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public final class BackupProto { + private BackupProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_Backup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_BackupInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_BackupInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/spanner/admin/database/v1/backu" + + "p.proto\022 google.spanner.admin.database.v" + + "1\032\037google/api/field_behavior.proto\032\031goog" + + "le/api/resource.proto\032#google/longrunnin" + + "g/operations.proto\032 google/protobuf/fiel" + + "d_mask.proto\032\037google/protobuf/timestamp." + + "proto\032-google/spanner/admin/database/v1/" + + "common.proto\032\034google/api/annotations.pro" + + "to\"\247\003\n\006Backup\022\020\n\010database\030\002 \001(\t\022/\n\013expir" + + "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "\022\014\n\004name\030\001 \001(\t\0224\n\013create_time\030\004 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\003\340A\003\022\027\n\nsize_byt" + + "es\030\005 \001(\003B\003\340A\003\022B\n\005state\030\006 \001(\0162..google.sp" + + "anner.admin.database.v1.Backup.StateB\003\340A" + + "\003\022\"\n\025referencing_databases\030\007 \003(\tB\003\340A\003\"7\n" + + "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATIN" + + "G\020\001\022\t\n\005READY\020\002:\\\352AY\n\035spanner.googleapis." + + "com/Backup\0228projects/{project}/instances" + + "/{instance}/backups/{backup}\"\245\001\n\023CreateB" + + "ackupRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037sp" + + "anner.googleapis.com/Instance\022\026\n\tbackup_" + + "id\030\002 \001(\tB\003\340A\002\022=\n\006backup\030\003 \001(\0132(.google.s" + + "panner.admin.database.v1.BackupB\003\340A\002\"\256\001\n" + + "\024CreateBackupMetadata\022\014\n\004name\030\001 \001(\t\022\020\n\010d" + + "atabase\030\002 \001(\t\022E\n\010progress\030\003 \001(\01323.google" + + ".spanner.admin.database.v1.OperationProg" + + "ress\022/\n\013cancel_time\030\004 \001(\0132\032.google.proto" + + "buf.Timestamp\"\212\001\n\023UpdateBackupRequest\022=\n" + + "\006backup\030\001 \001(\0132(.google.spanner.admin.dat" + + "abase.v1.BackupB\003\340A\002\0224\n\013update_mask\030\002 \001(" + + "\0132\032.google.protobuf.FieldMaskB\003\340A\002\"G\n\020Ge" + + "tBackupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035sp" + + "anner.googleapis.com/Backup\"J\n\023DeleteBac" + + "kupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035spanne" + + "r.googleapis.com/Backup\"\204\001\n\022ListBackupsR" + + "equest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner." + + "googleapis.com/Instance\022\016\n\006filter\030\002 \001(\t\022" + + "\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"i" + + "\n\023ListBackupsResponse\0229\n\007backups\030\001 \003(\0132(" + + ".google.spanner.admin.database.v1.Backup" + + "\022\027\n\017next_page_token\030\002 \001(\t\"\215\001\n\033ListBackup" + + "OperationsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A" + + "!\n\037spanner.googleapis.com/Instance\022\016\n\006fi" + + "lter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_to" + + "ken\030\004 \001(\t\"j\n\034ListBackupOperationsRespons" + + "e\0221\n\noperations\030\001 \003(\0132\035.google.longrunni" + + "ng.Operation\022\027\n\017next_page_token\030\002 \001(\t\"f\n" + + "\nBackupInfo\022\016\n\006backup\030\001 \001(\t\022/\n\013create_ti" + + "me\030\002 \001(\0132\032.google.protobuf.Timestamp\022\027\n\017" + + "source_database\030\003 \001(\tB\321\001\n$com.google.spa" + + "nner.admin.database.v1B\013BackupProtoP\001ZHg" + + "oogle.golang.org/genproto/googleapis/spa" + + "nner/admin/database/v1;database\252\002&Google" + + ".Cloud.Spanner.Admin.Database.V1\312\002&Googl" + + "e\\Cloud\\Spanner\\Admin\\Database\\V1b\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.spanner.admin.database.v1.CommonProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_spanner_admin_database_v1_Backup_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_spanner_admin_database_v1_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_Backup_descriptor, + new java.lang.String[] { + "Database", + "ExpireTime", + "Name", + "CreateTime", + "SizeBytes", + "State", + "ReferencingDatabases", + }); + internal_static_google_spanner_admin_database_v1_CreateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_spanner_admin_database_v1_CreateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_CreateBackupRequest_descriptor, + new java.lang.String[] { + "Parent", "BackupId", "Backup", + }); + internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_descriptor, + new java.lang.String[] { + "Name", "Database", "Progress", "CancelTime", + }); + internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_descriptor, + new java.lang.String[] { + "Backup", "UpdateMask", + }); + internal_static_google_spanner_admin_database_v1_GetBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_spanner_admin_database_v1_GetBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_GetBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_spanner_admin_database_v1_ListBackupsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_spanner_admin_database_v1_ListBackupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_ListBackupsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_spanner_admin_database_v1_ListBackupsResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_spanner_admin_database_v1_ListBackupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_ListBackupsResponse_descriptor, + new java.lang.String[] { + "Backups", "NextPageToken", + }); + internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_descriptor, + new java.lang.String[] { + "Operations", "NextPageToken", + }); + internal_static_google_spanner_admin_database_v1_BackupInfo_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_spanner_admin_database_v1_BackupInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_BackupInfo_descriptor, + new java.lang.String[] { + "Backup", "CreateTime", "SourceDatabase", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.spanner.admin.database.v1.CommonProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java new file mode 100644 index 0000000000..0ea75df21d --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java @@ -0,0 +1,80 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/common.proto + +package com.google.spanner.admin.database.v1; + +public final class CommonProto { + private CommonProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_OperationProgress_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_OperationProgress_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/spanner/admin/database/v1/commo" + + "n.proto\022 google.spanner.admin.database.v" + + "1\032\037google/api/field_behavior.proto\032\037goog" + + "le/protobuf/timestamp.proto\032\034google/api/" + + "annotations.proto\"\213\001\n\021OperationProgress\022" + + "\030\n\020progress_percent\030\001 \001(\005\022.\n\nstart_time\030" + + "\002 \001(\0132\032.google.protobuf.Timestamp\022,\n\010end" + + "_time\030\003 \001(\0132\032.google.protobuf.TimestampB" + + "\321\001\n$com.google.spanner.admin.database.v1" + + "B\013CommonProtoP\001ZHgoogle.golang.org/genpr" + + "oto/googleapis/spanner/admin/database/v1" + + ";database\252\002&Google.Cloud.Spanner.Admin.D" + + "atabase.V1\312\002&Google\\Cloud\\Spanner\\Admin\\" + + "Database\\V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_spanner_admin_database_v1_OperationProgress_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_spanner_admin_database_v1_OperationProgress_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_OperationProgress_descriptor, + new java.lang.String[] { + "ProgressPercent", "StartTime", "EndTime", + }); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java new file mode 100644 index 0000000000..18894be36e --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java @@ -0,0 +1,1491 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * Metadata type for the operation returned by
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.CreateBackupMetadata} + */ +public final class CreateBackupMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.CreateBackupMetadata) + CreateBackupMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupMetadata.newBuilder() to construct. + private CreateBackupMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupMetadata() { + name_ = ""; + database_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateBackupMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + database_ = s; + break; + } + case 26: + { + com.google.spanner.admin.database.v1.OperationProgress.Builder subBuilder = null; + if (progress_ != null) { + subBuilder = progress_.toBuilder(); + } + progress_ = + input.readMessage( + com.google.spanner.admin.database.v1.OperationProgress.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progress_); + progress_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (cancelTime_ != null) { + subBuilder = cancelTime_.toBuilder(); + } + cancelTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cancelTime_); + cancelTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.CreateBackupMetadata.class, + com.google.spanner.admin.database.v1.CreateBackupMetadata.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The name of the backup being created.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the backup being created.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FIELD_NUMBER = 2; + private volatile java.lang.Object database_; + /** + * + * + *
+   * The name of the database the backup is created from.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the database the backup is created from.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROGRESS_FIELD_NUMBER = 3; + private com.google.spanner.admin.database.v1.OperationProgress progress_; + /** + * + * + *
+   * The progress of the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return progress_ != null; + } + /** + * + * + *
+   * The progress of the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + * + * @return The progress. + */ + public com.google.spanner.admin.database.v1.OperationProgress getProgress() { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } + /** + * + * + *
+   * The progress of the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + public com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder() { + return getProgress(); + } + + public static final int CANCEL_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp cancelTime_; + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + * + * @return Whether the cancelTime field is set. + */ + public boolean hasCancelTime() { + return cancelTime_ != null; + } + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + * + * @return The cancelTime. + */ + public com.google.protobuf.Timestamp getCancelTime() { + return cancelTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : cancelTime_; + } + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCancelTimeOrBuilder() { + return getCancelTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, database_); + } + if (progress_ != null) { + output.writeMessage(3, getProgress()); + } + if (cancelTime_ != null) { + output.writeMessage(4, getCancelTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, database_); + } + if (progress_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getProgress()); + } + if (cancelTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCancelTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.CreateBackupMetadata)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.CreateBackupMetadata other = + (com.google.spanner.admin.database.v1.CreateBackupMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (hasProgress() != other.hasProgress()) return false; + if (hasProgress()) { + if (!getProgress().equals(other.getProgress())) return false; + } + if (hasCancelTime() != other.hasCancelTime()) return false; + if (hasCancelTime()) { + if (!getCancelTime().equals(other.getCancelTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + if (hasProgress()) { + hash = (37 * hash) + PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getProgress().hashCode(); + } + if (hasCancelTime()) { + hash = (37 * hash) + CANCEL_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCancelTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.CreateBackupMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata type for the operation returned by
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.CreateBackupMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.CreateBackupMetadata) + com.google.spanner.admin.database.v1.CreateBackupMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.CreateBackupMetadata.class, + com.google.spanner.admin.database.v1.CreateBackupMetadata.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.CreateBackupMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + database_ = ""; + + if (progressBuilder_ == null) { + progress_ = null; + } else { + progress_ = null; + progressBuilder_ = null; + } + if (cancelTimeBuilder_ == null) { + cancelTime_ = null; + } else { + cancelTime_ = null; + cancelTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupMetadata_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupMetadata getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.CreateBackupMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupMetadata build() { + com.google.spanner.admin.database.v1.CreateBackupMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupMetadata buildPartial() { + com.google.spanner.admin.database.v1.CreateBackupMetadata result = + new com.google.spanner.admin.database.v1.CreateBackupMetadata(this); + result.name_ = name_; + result.database_ = database_; + if (progressBuilder_ == null) { + result.progress_ = progress_; + } else { + result.progress_ = progressBuilder_.build(); + } + if (cancelTimeBuilder_ == null) { + result.cancelTime_ = cancelTime_; + } else { + result.cancelTime_ = cancelTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.CreateBackupMetadata) { + return mergeFrom((com.google.spanner.admin.database.v1.CreateBackupMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.CreateBackupMetadata other) { + if (other == com.google.spanner.admin.database.v1.CreateBackupMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (other.hasProgress()) { + mergeProgress(other.getProgress()); + } + if (other.hasCancelTime()) { + mergeCancelTime(other.getCancelTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.CreateBackupMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.CreateBackupMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * The name of the database the backup is created from.
+     * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the database the backup is created from.
+     * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the database the backup is created from.
+     * 
+ * + * string database = 2; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database the backup is created from.
+     * 
+ * + * string database = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database the backup is created from.
+     * 
+ * + * string database = 2; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private com.google.spanner.admin.database.v1.OperationProgress progress_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder> + progressBuilder_; + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return progressBuilder_ != null || progress_ != null; + } + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + * + * @return The progress. + */ + public com.google.spanner.admin.database.v1.OperationProgress getProgress() { + if (progressBuilder_ == null) { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } else { + return progressBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + public Builder setProgress(com.google.spanner.admin.database.v1.OperationProgress value) { + if (progressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progress_ = value; + onChanged(); + } else { + progressBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + public Builder setProgress( + com.google.spanner.admin.database.v1.OperationProgress.Builder builderForValue) { + if (progressBuilder_ == null) { + progress_ = builderForValue.build(); + onChanged(); + } else { + progressBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + public Builder mergeProgress(com.google.spanner.admin.database.v1.OperationProgress value) { + if (progressBuilder_ == null) { + if (progress_ != null) { + progress_ = + com.google.spanner.admin.database.v1.OperationProgress.newBuilder(progress_) + .mergeFrom(value) + .buildPartial(); + } else { + progress_ = value; + } + onChanged(); + } else { + progressBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + public Builder clearProgress() { + if (progressBuilder_ == null) { + progress_ = null; + onChanged(); + } else { + progress_ = null; + progressBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + public com.google.spanner.admin.database.v1.OperationProgress.Builder getProgressBuilder() { + + onChanged(); + return getProgressFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + public com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder() { + if (progressBuilder_ != null) { + return progressBuilder_.getMessageOrBuilder(); + } else { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } + } + /** + * + * + *
+     * The progress of the
+     * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder> + getProgressFieldBuilder() { + if (progressBuilder_ == null) { + progressBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder>( + getProgress(), getParentForChildren(), isClean()); + progress_ = null; + } + return progressBuilder_; + } + + private com.google.protobuf.Timestamp cancelTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + cancelTimeBuilder_; + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + * + * @return Whether the cancelTime field is set. + */ + public boolean hasCancelTime() { + return cancelTimeBuilder_ != null || cancelTime_ != null; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + * + * @return The cancelTime. + */ + public com.google.protobuf.Timestamp getCancelTime() { + if (cancelTimeBuilder_ == null) { + return cancelTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : cancelTime_; + } else { + return cancelTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + public Builder setCancelTime(com.google.protobuf.Timestamp value) { + if (cancelTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cancelTime_ = value; + onChanged(); + } else { + cancelTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + public Builder setCancelTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (cancelTimeBuilder_ == null) { + cancelTime_ = builderForValue.build(); + onChanged(); + } else { + cancelTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + public Builder mergeCancelTime(com.google.protobuf.Timestamp value) { + if (cancelTimeBuilder_ == null) { + if (cancelTime_ != null) { + cancelTime_ = + com.google.protobuf.Timestamp.newBuilder(cancelTime_).mergeFrom(value).buildPartial(); + } else { + cancelTime_ = value; + } + onChanged(); + } else { + cancelTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + public Builder clearCancelTime() { + if (cancelTimeBuilder_ == null) { + cancelTime_ = null; + onChanged(); + } else { + cancelTime_ = null; + cancelTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCancelTimeBuilder() { + + onChanged(); + return getCancelTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCancelTimeOrBuilder() { + if (cancelTimeBuilder_ != null) { + return cancelTimeBuilder_.getMessageOrBuilder(); + } else { + return cancelTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : cancelTime_; + } + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCancelTimeFieldBuilder() { + if (cancelTimeBuilder_ == null) { + cancelTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCancelTime(), getParentForChildren(), isClean()); + cancelTime_ = null; + } + return cancelTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.CreateBackupMetadata) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.CreateBackupMetadata) + private static final com.google.spanner.admin.database.v1.CreateBackupMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.CreateBackupMetadata(); + } + + public static com.google.spanner.admin.database.v1.CreateBackupMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateBackupMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java new file mode 100644 index 0000000000..5034e3af02 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java @@ -0,0 +1,178 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface CreateBackupMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.CreateBackupMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the backup being created.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the backup being created.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The name of the database the backup is created from.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * The name of the database the backup is created from.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * The progress of the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + * + * @return Whether the progress field is set. + */ + boolean hasProgress(); + /** + * + * + *
+   * The progress of the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + * + * @return The progress. + */ + com.google.spanner.admin.database.v1.OperationProgress getProgress(); + /** + * + * + *
+   * The progress of the
+   * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 3; + */ + com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder(); + + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + * + * @return Whether the cancelTime field is set. + */ + boolean hasCancelTime(); + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + * + * @return The cancelTime. + */ + com.google.protobuf.Timestamp getCancelTime(); + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCancelTimeOrBuilder(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequest.java new file mode 100644 index 0000000000..988fb812fe --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequest.java @@ -0,0 +1,1173 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.CreateBackupRequest} + */ +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + backupId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + backupId_ = s; + break; + } + case 26: + { + com.google.spanner.admin.database.v1.Backup.Builder subBuilder = null; + if (backup_ != null) { + subBuilder = backup_.toBuilder(); + } + backup_ = + input.readMessage( + com.google.spanner.admin.database.v1.Backup.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(backup_); + backup_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.CreateBackupRequest.class, + com.google.spanner.admin.database.v1.CreateBackupRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * 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>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * 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>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object backupId_; + /** + * + * + *
+   * 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>`.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } + } + /** + * + * + *
+   * 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>`.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 3; + private com.google.spanner.admin.database.v1.Backup backup_; + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.spanner.admin.database.v1.Backup getBackup() { + return backup_ == null + ? com.google.spanner.admin.database.v1.Backup.getDefaultInstance() + : backup_; + } + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.BackupOrBuilder getBackupOrBuilder() { + return getBackup(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getBackupIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupId_); + } + if (backup_ != null) { + output.writeMessage(3, getBackup()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getBackupIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupId_); + } + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackup()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.CreateBackupRequest other = + (com.google.spanner.admin.database.v1.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getBackupId().equals(other.getBackupId())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupId().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.CreateBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.CreateBackupRequest) + com.google.spanner.admin.database.v1.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.CreateBackupRequest.class, + com.google.spanner.admin.database.v1.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.CreateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + backupId_ = ""; + + if (backupBuilder_ == null) { + backup_ = null; + } else { + backup_ = null; + backupBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupRequest getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupRequest build() { + com.google.spanner.admin.database.v1.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupRequest buildPartial() { + com.google.spanner.admin.database.v1.CreateBackupRequest result = + new com.google.spanner.admin.database.v1.CreateBackupRequest(this); + result.parent_ = parent_; + result.backupId_ = backupId_; + if (backupBuilder_ == null) { + result.backup_ = backup_; + } else { + result.backup_ = backupBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.CreateBackupRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.CreateBackupRequest other) { + if (other == com.google.spanner.admin.database.v1.CreateBackupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getBackupId().isEmpty()) { + backupId_ = other.backupId_; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.CreateBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.CreateBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object backupId_ = ""; + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + backupId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + + backupId_ = getDefaultInstance().getBackupId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + backupId_ = value; + onChanged(); + return this; + } + + private com.google.spanner.admin.database.v1.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return backupBuilder_ != null || backup_ != null; + } + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.spanner.admin.database.v1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.spanner.admin.database.v1.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.spanner.admin.database.v1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + onChanged(); + } else { + backupBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.spanner.admin.database.v1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + onChanged(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.spanner.admin.database.v1.Backup value) { + if (backupBuilder_ == null) { + if (backup_ != null) { + backup_ = + com.google.spanner.admin.database.v1.Backup.newBuilder(backup_) + .mergeFrom(value) + .buildPartial(); + } else { + backup_ = value; + } + onChanged(); + } else { + backupBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + if (backupBuilder_ == null) { + backup_ = null; + onChanged(); + } else { + backup_ = null; + backupBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.Backup.Builder getBackupBuilder() { + + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.spanner.admin.database.v1.Backup.getDefaultInstance() + : backup_; + } + } + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.CreateBackupRequest) + private static final com.google.spanner.admin.database.v1.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.CreateBackupRequest(); + } + + public static com.google.spanner.admin.database.v1.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateBackupRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequestOrBuilder.java new file mode 100644 index 0000000000..6fe0b49af6 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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>`.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + java.lang.String getBackupId(); + /** + * + * + *
+   * 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>`.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + com.google.protobuf.ByteString getBackupIdBytes(); + + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.spanner.admin.database.v1.Backup getBackup(); + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.spanner.admin.database.v1.BackupOrBuilder getBackupOrBuilder(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java index 9dde0799a9..ca9fdbd1ce 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java @@ -248,13 +248,13 @@ public com.google.protobuf.ByteString getCreateStatementBytes() { * * *
-   * An optional list of DDL statements to run inside the newly created
+   * Optional. A list of DDL statements to run inside the newly created
    * database. Statements can create tables, indexes, etc. These
    * statements execute atomically with the creation of the database:
    * if there is an error in any statement, the database is not created.
    * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return A list containing the extraStatements. */ @@ -265,13 +265,13 @@ public com.google.protobuf.ProtocolStringList getExtraStatementsList() { * * *
-   * An optional list of DDL statements to run inside the newly created
+   * Optional. A list of DDL statements to run inside the newly created
    * database. Statements can create tables, indexes, etc. These
    * statements execute atomically with the creation of the database:
    * if there is an error in any statement, the database is not created.
    * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The count of extraStatements. */ @@ -282,13 +282,13 @@ public int getExtraStatementsCount() { * * *
-   * An optional list of DDL statements to run inside the newly created
+   * Optional. A list of DDL statements to run inside the newly created
    * database. Statements can create tables, indexes, etc. These
    * statements execute atomically with the creation of the database:
    * if there is an error in any statement, the database is not created.
    * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param index The index of the element to return. * @return The extraStatements at the given index. @@ -300,13 +300,13 @@ public java.lang.String getExtraStatements(int index) { * * *
-   * An optional list of DDL statements to run inside the newly created
+   * Optional. A list of DDL statements to run inside the newly created
    * database. Statements can create tables, indexes, etc. These
    * statements execute atomically with the creation of the database:
    * if there is an error in any statement, the database is not created.
    * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param index The index of the value to return. * @return The bytes of the extraStatements at the given index. @@ -946,13 +946,13 @@ private void ensureExtraStatementsIsMutable() { * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return A list containing the extraStatements. */ @@ -963,13 +963,13 @@ public com.google.protobuf.ProtocolStringList getExtraStatementsList() { * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The count of extraStatements. */ @@ -980,13 +980,13 @@ public int getExtraStatementsCount() { * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param index The index of the element to return. * @return The extraStatements at the given index. @@ -998,13 +998,13 @@ public java.lang.String getExtraStatements(int index) { * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param index The index of the value to return. * @return The bytes of the extraStatements at the given index. @@ -1016,13 +1016,13 @@ public com.google.protobuf.ByteString getExtraStatementsBytes(int index) { * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param index The index to set the value at. * @param value The extraStatements to set. @@ -1041,13 +1041,13 @@ public Builder setExtraStatements(int index, java.lang.String value) { * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The extraStatements to add. * @return This builder for chaining. @@ -1065,13 +1065,13 @@ public Builder addExtraStatements(java.lang.String value) { * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param values The extraStatements to add. * @return This builder for chaining. @@ -1086,13 +1086,13 @@ public Builder addAllExtraStatements(java.lang.Iterable values * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1106,13 +1106,13 @@ public Builder clearExtraStatements() { * * *
-     * An optional list of DDL statements to run inside the newly created
+     * Optional. A list of DDL statements to run inside the newly created
      * database. Statements can create tables, indexes, etc. These
      * statements execute atomically with the creation of the database:
      * if there is an error in any statement, the database is not created.
      * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes of the extraStatements to add. * @return This builder for chaining. diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java index 0f8efbed33..9b839b9e9a 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java @@ -91,13 +91,13 @@ public interface CreateDatabaseRequestOrBuilder * * *
-   * An optional list of DDL statements to run inside the newly created
+   * Optional. A list of DDL statements to run inside the newly created
    * database. Statements can create tables, indexes, etc. These
    * statements execute atomically with the creation of the database:
    * if there is an error in any statement, the database is not created.
    * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return A list containing the extraStatements. */ @@ -106,13 +106,13 @@ public interface CreateDatabaseRequestOrBuilder * * *
-   * An optional list of DDL statements to run inside the newly created
+   * Optional. A list of DDL statements to run inside the newly created
    * database. Statements can create tables, indexes, etc. These
    * statements execute atomically with the creation of the database:
    * if there is an error in any statement, the database is not created.
    * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The count of extraStatements. */ @@ -121,13 +121,13 @@ public interface CreateDatabaseRequestOrBuilder * * *
-   * An optional list of DDL statements to run inside the newly created
+   * Optional. A list of DDL statements to run inside the newly created
    * database. Statements can create tables, indexes, etc. These
    * statements execute atomically with the creation of the database:
    * if there is an error in any statement, the database is not created.
    * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param index The index of the element to return. * @return The extraStatements at the given index. @@ -137,13 +137,13 @@ public interface CreateDatabaseRequestOrBuilder * * *
-   * An optional list of DDL statements to run inside the newly created
+   * Optional. A list of DDL statements to run inside the newly created
    * database. Statements can create tables, indexes, etc. These
    * statements execute atomically with the creation of the database:
    * if there is an error in any statement, the database is not created.
    * 
* - * repeated string extra_statements = 3; + * repeated string extra_statements = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param index The index of the value to return. * @return The bytes of the extraStatements at the given index. diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java index 20cd841007..f9d10c3ae9 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java @@ -83,6 +83,37 @@ private Database( int rawValue = input.readEnum(); state_ = rawValue; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.spanner.admin.database.v1.RestoreInfo.Builder subBuilder = null; + if (restoreInfo_ != null) { + subBuilder = restoreInfo_.toBuilder(); + } + restoreInfo_ = + input.readMessage( + com.google.spanner.admin.database.v1.RestoreInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(restoreInfo_); + restoreInfo_ = subBuilder.buildPartial(); + } + break; } default: @@ -160,6 +191,22 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * READY = 2; */ READY(2), + /** + * + * + *
+     * The database is fully created and ready for use, but is still
+     * being optimized for performance and cannot handle full load.
+     * In this state, the database still references the backup
+     * it was restore from, preventing the backup
+     * from being deleted. When optimizations are complete, the full performance
+     * of the database will be restored, and the database will transition to
+     * `READY` state.
+     * 
+ * + * READY_OPTIMIZING = 3; + */ + READY_OPTIMIZING(3), UNRECOGNIZED(-1), ; @@ -194,6 +241,22 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * READY = 2; */ public static final int READY_VALUE = 2; + /** + * + * + *
+     * The database is fully created and ready for use, but is still
+     * being optimized for performance and cannot handle full load.
+     * In this state, the database still references the backup
+     * it was restore from, preventing the backup
+     * from being deleted. When optimizations are complete, the full performance
+     * of the database will be restored, and the database will transition to
+     * `READY` state.
+     * 
+ * + * READY_OPTIMIZING = 3; + */ + public static final int READY_OPTIMIZING_VALUE = 3; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -225,6 +288,8 @@ public static State forNumber(int value) { return CREATING; case 2: return READY; + case 3: + return READY_OPTIMIZING; default: return null; } @@ -287,7 +352,7 @@ private State(int value) { * identify the database. *
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -313,7 +378,7 @@ public java.lang.String getName() { * identify the database. *
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -338,7 +403,9 @@ public com.google.protobuf.ByteString getNameBytes() { * Output only. The current database state. *
* - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The enum numeric value on the wire for state. */ @@ -352,7 +419,9 @@ public int getStateValue() { * Output only. The current database state. *
* - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The state. */ @@ -365,6 +434,106 @@ public com.google.spanner.admin.database.v1.Database.State getState() { : result; } + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. If exists, the time at which the database creation started.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. If exists, the time at which the database creation started.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. If exists, the time at which the database creation started.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int RESTORE_INFO_FIELD_NUMBER = 4; + private com.google.spanner.admin.database.v1.RestoreInfo restoreInfo_; + /** + * + * + *
+   * Output only. Applicable only for restored databases. Contains information
+   * about the restore source.
+   * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the restoreInfo field is set. + */ + public boolean hasRestoreInfo() { + return restoreInfo_ != null; + } + /** + * + * + *
+   * Output only. Applicable only for restored databases. Contains information
+   * about the restore source.
+   * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The restoreInfo. + */ + public com.google.spanner.admin.database.v1.RestoreInfo getRestoreInfo() { + return restoreInfo_ == null + ? com.google.spanner.admin.database.v1.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } + /** + * + * + *
+   * Output only. Applicable only for restored databases. Contains information
+   * about the restore source.
+   * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.spanner.admin.database.v1.RestoreInfoOrBuilder getRestoreInfoOrBuilder() { + return getRestoreInfo(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -386,6 +555,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.spanner.admin.database.v1.Database.State.STATE_UNSPECIFIED.getNumber()) { output.writeEnum(2, state_); } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (restoreInfo_ != null) { + output.writeMessage(4, getRestoreInfo()); + } unknownFields.writeTo(output); } @@ -402,6 +577,12 @@ public int getSerializedSize() { != com.google.spanner.admin.database.v1.Database.State.STATE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (restoreInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRestoreInfo()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -420,6 +601,14 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (state_ != other.state_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasRestoreInfo() != other.hasRestoreInfo()) return false; + if (hasRestoreInfo()) { + if (!getRestoreInfo().equals(other.getRestoreInfo())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -435,6 +624,14 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasRestoreInfo()) { + hash = (37 * hash) + RESTORE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRestoreInfo().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -584,6 +781,18 @@ public Builder clear() { state_ = 0; + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (restoreInfoBuilder_ == null) { + restoreInfo_ = null; + } else { + restoreInfo_ = null; + restoreInfoBuilder_ = null; + } return this; } @@ -613,6 +822,16 @@ public com.google.spanner.admin.database.v1.Database buildPartial() { new com.google.spanner.admin.database.v1.Database(this); result.name_ = name_; result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (restoreInfoBuilder_ == null) { + result.restoreInfo_ = restoreInfo_; + } else { + result.restoreInfo_ = restoreInfoBuilder_.build(); + } onBuilt(); return result; } @@ -669,6 +888,12 @@ public Builder mergeFrom(com.google.spanner.admin.database.v1.Database other) { if (other.state_ != 0) { setStateValue(other.getStateValue()); } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasRestoreInfo()) { + mergeRestoreInfo(other.getRestoreInfo()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -710,7 +935,7 @@ public Builder mergeFrom( * identify the database. *
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -736,7 +961,7 @@ public java.lang.String getName() { * identify the database. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -762,7 +987,7 @@ public com.google.protobuf.ByteString getNameBytes() { * identify the database. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The name to set. * @return This builder for chaining. @@ -787,7 +1012,7 @@ public Builder setName(java.lang.String value) { * identify the database. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -808,7 +1033,7 @@ public Builder clearName() { * identify the database. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -832,7 +1057,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * Output only. The current database state. * * - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The enum numeric value on the wire for state. */ @@ -846,7 +1073,9 @@ public int getStateValue() { * Output only. The current database state. * * - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @param value The enum numeric value on the wire for state to set. * @return This builder for chaining. @@ -863,7 +1092,9 @@ public Builder setStateValue(int value) { * Output only. The current database state. * * - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The state. */ @@ -882,7 +1113,9 @@ public com.google.spanner.admin.database.v1.Database.State getState() { * Output only. The current database state. * * - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @param value The state to set. * @return This builder for chaining. @@ -903,7 +1136,9 @@ public Builder setState(com.google.spanner.admin.database.v1.Database.State valu * Output only. The current database state. * * - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return This builder for chaining. */ @@ -914,6 +1149,420 @@ public Builder clearState() { return this; } + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. If exists, the time at which the database creation started.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.spanner.admin.database.v1.RestoreInfo restoreInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.RestoreInfo, + com.google.spanner.admin.database.v1.RestoreInfo.Builder, + com.google.spanner.admin.database.v1.RestoreInfoOrBuilder> + restoreInfoBuilder_; + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the restoreInfo field is set. + */ + public boolean hasRestoreInfo() { + return restoreInfoBuilder_ != null || restoreInfo_ != null; + } + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The restoreInfo. + */ + public com.google.spanner.admin.database.v1.RestoreInfo getRestoreInfo() { + if (restoreInfoBuilder_ == null) { + return restoreInfo_ == null + ? com.google.spanner.admin.database.v1.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } else { + return restoreInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRestoreInfo(com.google.spanner.admin.database.v1.RestoreInfo value) { + if (restoreInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restoreInfo_ = value; + onChanged(); + } else { + restoreInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRestoreInfo( + com.google.spanner.admin.database.v1.RestoreInfo.Builder builderForValue) { + if (restoreInfoBuilder_ == null) { + restoreInfo_ = builderForValue.build(); + onChanged(); + } else { + restoreInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeRestoreInfo(com.google.spanner.admin.database.v1.RestoreInfo value) { + if (restoreInfoBuilder_ == null) { + if (restoreInfo_ != null) { + restoreInfo_ = + com.google.spanner.admin.database.v1.RestoreInfo.newBuilder(restoreInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + restoreInfo_ = value; + } + onChanged(); + } else { + restoreInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearRestoreInfo() { + if (restoreInfoBuilder_ == null) { + restoreInfo_ = null; + onChanged(); + } else { + restoreInfo_ = null; + restoreInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.spanner.admin.database.v1.RestoreInfo.Builder getRestoreInfoBuilder() { + + onChanged(); + return getRestoreInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.spanner.admin.database.v1.RestoreInfoOrBuilder getRestoreInfoOrBuilder() { + if (restoreInfoBuilder_ != null) { + return restoreInfoBuilder_.getMessageOrBuilder(); + } else { + return restoreInfo_ == null + ? com.google.spanner.admin.database.v1.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } + } + /** + * + * + *
+     * Output only. Applicable only for restored databases. Contains information
+     * about the restore source.
+     * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.RestoreInfo, + com.google.spanner.admin.database.v1.RestoreInfo.Builder, + com.google.spanner.admin.database.v1.RestoreInfoOrBuilder> + getRestoreInfoFieldBuilder() { + if (restoreInfoBuilder_ == null) { + restoreInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.RestoreInfo, + com.google.spanner.admin.database.v1.RestoreInfo.Builder, + com.google.spanner.admin.database.v1.RestoreInfoOrBuilder>( + getRestoreInfo(), getParentForChildren(), isClean()); + restoreInfo_ = null; + } + return restoreInfoBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java index a067ee4266..4c4869319f 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java @@ -34,7 +34,7 @@ public interface DatabaseOrBuilder * identify the database. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -50,7 +50,7 @@ public interface DatabaseOrBuilder * identify the database. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -63,7 +63,9 @@ public interface DatabaseOrBuilder * Output only. The current database state. * * - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The enum numeric value on the wire for state. */ @@ -75,9 +77,93 @@ public interface DatabaseOrBuilder * Output only. The current database state. * * - * .google.spanner.admin.database.v1.Database.State state = 2; + * + * .google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The state. */ com.google.spanner.admin.database.v1.Database.State getState(); + + /** + * + * + *
+   * Output only. If exists, the time at which the database creation started.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. If exists, the time at which the database creation started.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. If exists, the time at which the database creation started.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Applicable only for restored databases. Contains information
+   * about the restore source.
+   * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the restoreInfo field is set. + */ + boolean hasRestoreInfo(); + /** + * + * + *
+   * Output only. Applicable only for restored databases. Contains information
+   * about the restore source.
+   * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The restoreInfo. + */ + com.google.spanner.admin.database.v1.RestoreInfo getRestoreInfo(); + /** + * + * + *
+   * Output only. Applicable only for restored databases. Contains information
+   * about the restore source.
+   * 
+ * + * + * .google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.spanner.admin.database.v1.RestoreInfoOrBuilder getRestoreInfoOrBuilder(); } diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequest.java new file mode 100644 index 0000000000..c4be22ef45 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequest.java @@ -0,0 +1,663 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.DeleteBackupRequest} + */ +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.DeleteBackupRequest.class, + com.google.spanner.admin.database.v1.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the backup to delete.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the backup to delete.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.DeleteBackupRequest other = + (com.google.spanner.admin.database.v1.DeleteBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.DeleteBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.DeleteBackupRequest) + com.google.spanner.admin.database.v1.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.DeleteBackupRequest.class, + com.google.spanner.admin.database.v1.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.DeleteBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.DeleteBackupRequest build() { + com.google.spanner.admin.database.v1.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.DeleteBackupRequest buildPartial() { + com.google.spanner.admin.database.v1.DeleteBackupRequest result = + new com.google.spanner.admin.database.v1.DeleteBackupRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.DeleteBackupRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.DeleteBackupRequest other) { + if (other == com.google.spanner.admin.database.v1.DeleteBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.DeleteBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.DeleteBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the backup to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the backup to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the backup to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the backup to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the backup to delete.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.DeleteBackupRequest) + private static final com.google.spanner.admin.database.v1.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.DeleteBackupRequest(); + } + + public static com.google.spanner.admin.database.v1.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteBackupRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequestOrBuilder.java new file mode 100644 index 0000000000..8aff1d1bce --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the backup to delete.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the backup to delete.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequest.java new file mode 100644 index 0000000000..97f34ed23d --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequest.java @@ -0,0 +1,663 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.GetBackupRequest} + */ +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.GetBackupRequest.class, + com.google.spanner.admin.database.v1.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the backup.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the backup.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.GetBackupRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.GetBackupRequest other = + (com.google.spanner.admin.database.v1.GetBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.GetBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.GetBackupRequest) + com.google.spanner.admin.database.v1.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.GetBackupRequest.class, + com.google.spanner.admin.database.v1.GetBackupRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.GetBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.GetBackupRequest getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.GetBackupRequest build() { + com.google.spanner.admin.database.v1.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.GetBackupRequest buildPartial() { + com.google.spanner.admin.database.v1.GetBackupRequest result = + new com.google.spanner.admin.database.v1.GetBackupRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.GetBackupRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.GetBackupRequest other) { + if (other == com.google.spanner.admin.database.v1.GetBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.GetBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.GetBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the backup.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.GetBackupRequest) + private static final com.google.spanner.admin.database.v1.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.GetBackupRequest(); + } + + public static com.google.spanner.admin.database.v1.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBackupRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequestOrBuilder.java new file mode 100644 index 0000000000..d27620cd0f --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the backup.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the backup.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java new file mode 100644 index 0000000000..fac83d2127 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java @@ -0,0 +1,1349 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for
+ * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupOperationsRequest} + */ +public final class ListBackupOperationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListBackupOperationsRequest) + ListBackupOperationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupOperationsRequest.newBuilder() to construct. + private ListBackupOperationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupOperationsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupOperationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBackupOperationsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest.class, + com.google.spanner.admin.database.v1.ListBackupOperationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The instance of the backup operations. Values are of
+   * the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The instance of the backup operations. Values are of
+   * the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * An expression that filters the list of returned backup operations.
+   * A filter expression consists of a field name, a
+   * comparison operator, and a value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [operation][google.longrunning.Operation]
+   * are eligible for filtering:
+   *   * `name` - The name of the long-running operation
+   *   * `done` - False if the operation is in progress, else true.
+   *   * `metadata.@type` - the type of metadata. For example, the type string
+   *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+   *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+   *   * `metadata.<field_name>` - any field in metadata.value.
+   *   * `error` - Error associated with the long-running operation.
+   *   * `response.@type` - the type of response.
+   *   * `response.<field_name>` - any field in response.value.
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic, but
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `done:true` - The operation is complete.
+   *   * `metadata.database:prod` - The database the backup was taken from has
+   *      a name containing the string "prod".
+   *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+   *     `(metadata.name:howl) AND` <br/>
+   *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+   *     `(error:*)` - Returns operations where:
+   *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+   *     * The backup name contains the string "howl".
+   *     * The operation started before 2018-03-28T14:50:00Z.
+   *     * The operation resulted in an error.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * An expression that filters the list of returned backup operations.
+   * A filter expression consists of a field name, a
+   * comparison operator, and a value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [operation][google.longrunning.Operation]
+   * are eligible for filtering:
+   *   * `name` - The name of the long-running operation
+   *   * `done` - False if the operation is in progress, else true.
+   *   * `metadata.@type` - the type of metadata. For example, the type string
+   *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+   *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+   *   * `metadata.<field_name>` - any field in metadata.value.
+   *   * `error` - Error associated with the long-running operation.
+   *   * `response.@type` - the type of response.
+   *   * `response.<field_name>` - any field in response.value.
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic, but
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `done:true` - The operation is complete.
+   *   * `metadata.database:prod` - The database the backup was taken from has
+   *      a name containing the string "prod".
+   *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+   *     `(metadata.name:howl) AND` <br/>
+   *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+   *     `(error:*)` - Returns operations where:
+   *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+   *     * The backup name contains the string "howl".
+   *     * The operation started before 2018-03-28T14:50:00Z.
+   *     * The operation resulted in an error.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * Number of operations to be returned in the response. If 0 or
+   * less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+   * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+   * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.ListBackupOperationsRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.ListBackupOperationsRequest other = + (com.google.spanner.admin.database.v1.ListBackupOperationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for
+   * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupOperationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.ListBackupOperationsRequest) + com.google.spanner.admin.database.v1.ListBackupOperationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest.class, + com.google.spanner.admin.database.v1.ListBackupOperationsRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.ListBackupOperationsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupOperationsRequest + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.ListBackupOperationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupOperationsRequest build() { + com.google.spanner.admin.database.v1.ListBackupOperationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupOperationsRequest buildPartial() { + com.google.spanner.admin.database.v1.ListBackupOperationsRequest result = + new com.google.spanner.admin.database.v1.ListBackupOperationsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.ListBackupOperationsRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.ListBackupOperationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.ListBackupOperationsRequest other) { + if (other + == com.google.spanner.admin.database.v1.ListBackupOperationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.ListBackupOperationsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.ListBackupOperationsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The instance of the backup operations. Values are of
+     * the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The instance of the backup operations. Values are of
+     * the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The instance of the backup operations. Values are of
+     * the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance of the backup operations. Values are of
+     * the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance of the backup operations. Values are of
+     * the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * An expression that filters the list of returned backup operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `metadata.database:prod` - The database the backup was taken from has
+     *      a name containing the string "prod".
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+     *     `(metadata.name:howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Returns operations where:
+     *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+     *     * The backup name contains the string "howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An expression that filters the list of returned backup operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `metadata.database:prod` - The database the backup was taken from has
+     *      a name containing the string "prod".
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+     *     `(metadata.name:howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Returns operations where:
+     *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+     *     * The backup name contains the string "howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An expression that filters the list of returned backup operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `metadata.database:prod` - The database the backup was taken from has
+     *      a name containing the string "prod".
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+     *     `(metadata.name:howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Returns operations where:
+     *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+     *     * The backup name contains the string "howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression that filters the list of returned backup operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `metadata.database:prod` - The database the backup was taken from has
+     *      a name containing the string "prod".
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+     *     `(metadata.name:howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Returns operations where:
+     *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+     *     * The backup name contains the string "howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * An expression that filters the list of returned backup operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `metadata.database:prod` - The database the backup was taken from has
+     *      a name containing the string "prod".
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+     *     `(metadata.name:howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Returns operations where:
+     *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+     *     * The backup name contains the string "howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Number of operations to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Number of operations to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of operations to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+     * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+     * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+     * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+     * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+     * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.ListBackupOperationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListBackupOperationsRequest) + private static final com.google.spanner.admin.database.v1.ListBackupOperationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListBackupOperationsRequest(); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupOperationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBackupOperationsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupOperationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java new file mode 100644 index 0000000000..4f43eba288 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface ListBackupOperationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListBackupOperationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance of the backup operations. Values are of
+   * the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The instance of the backup operations. Values are of
+   * the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * An expression that filters the list of returned backup operations.
+   * A filter expression consists of a field name, a
+   * comparison operator, and a value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [operation][google.longrunning.Operation]
+   * are eligible for filtering:
+   *   * `name` - The name of the long-running operation
+   *   * `done` - False if the operation is in progress, else true.
+   *   * `metadata.@type` - the type of metadata. For example, the type string
+   *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+   *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+   *   * `metadata.<field_name>` - any field in metadata.value.
+   *   * `error` - Error associated with the long-running operation.
+   *   * `response.@type` - the type of response.
+   *   * `response.<field_name>` - any field in response.value.
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic, but
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `done:true` - The operation is complete.
+   *   * `metadata.database:prod` - The database the backup was taken from has
+   *      a name containing the string "prod".
+   *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+   *     `(metadata.name:howl) AND` <br/>
+   *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+   *     `(error:*)` - Returns operations where:
+   *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+   *     * The backup name contains the string "howl".
+   *     * The operation started before 2018-03-28T14:50:00Z.
+   *     * The operation resulted in an error.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * An expression that filters the list of returned backup operations.
+   * A filter expression consists of a field name, a
+   * comparison operator, and a value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [operation][google.longrunning.Operation]
+   * are eligible for filtering:
+   *   * `name` - The name of the long-running operation
+   *   * `done` - False if the operation is in progress, else true.
+   *   * `metadata.@type` - the type of metadata. For example, the type string
+   *      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
+   *      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
+   *   * `metadata.<field_name>` - any field in metadata.value.
+   *   * `error` - Error associated with the long-running operation.
+   *   * `response.@type` - the type of response.
+   *   * `response.<field_name>` - any field in response.value.
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic, but
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `done:true` - The operation is complete.
+   *   * `metadata.database:prod` - The database the backup was taken from has
+   *      a name containing the string "prod".
+   *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
+   *     `(metadata.name:howl) AND` <br/>
+   *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+   *     `(error:*)` - Returns operations where:
+   *     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
+   *     * The backup name contains the string "howl".
+   *     * The operation started before 2018-03-28T14:50:00Z.
+   *     * The operation resulted in an error.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Number of operations to be returned in the response. If 0 or
+   * less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+   * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
+   * from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponse.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponse.java new file mode 100644 index 0000000000..55d243d80d --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponse.java @@ -0,0 +1,1329 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The response for
+ * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupOperationsResponse} + */ +public final class ListBackupOperationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListBackupOperationsResponse) + ListBackupOperationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupOperationsResponse.newBuilder() to construct. + private ListBackupOperationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupOperationsResponse() { + operations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupOperationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBackupOperationsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + operations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + operations_.add( + input.readMessage(com.google.longrunning.Operation.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupOperationsResponse.class, + com.google.spanner.admin.database.v1.ListBackupOperationsResponse.Builder.class); + } + + public static final int OPERATIONS_FIELD_NUMBER = 1; + private java.util.List operations_; + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List getOperationsList() { + return operations_; + } + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List + getOperationsOrBuilderList() { + return operations_; + } + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public int getOperationsCount() { + return operations_.size(); + } + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation getOperations(int index) { + return operations_.get(index); + } + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int index) { + return operations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+   * call to fetch more of the matching metadata.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+   * call to fetch more of the matching metadata.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < operations_.size(); i++) { + output.writeMessage(1, operations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < operations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, operations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.ListBackupOperationsResponse)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.ListBackupOperationsResponse other = + (com.google.spanner.admin.database.v1.ListBackupOperationsResponse) obj; + + if (!getOperationsList().equals(other.getOperationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOperationsCount() > 0) { + hash = (37 * hash) + OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getOperationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.ListBackupOperationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for
+   * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupOperationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.ListBackupOperationsResponse) + com.google.spanner.admin.database.v1.ListBackupOperationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupOperationsResponse.class, + com.google.spanner.admin.database.v1.ListBackupOperationsResponse.Builder.class); + } + + // Construct using + // com.google.spanner.admin.database.v1.ListBackupOperationsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOperationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + operationsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupOperationsResponse_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupOperationsResponse + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.ListBackupOperationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupOperationsResponse build() { + com.google.spanner.admin.database.v1.ListBackupOperationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupOperationsResponse buildPartial() { + com.google.spanner.admin.database.v1.ListBackupOperationsResponse result = + new com.google.spanner.admin.database.v1.ListBackupOperationsResponse(this); + int from_bitField0_ = bitField0_; + if (operationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.operations_ = operations_; + } else { + result.operations_ = operationsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.ListBackupOperationsResponse) { + return mergeFrom((com.google.spanner.admin.database.v1.ListBackupOperationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.ListBackupOperationsResponse other) { + if (other + == com.google.spanner.admin.database.v1.ListBackupOperationsResponse.getDefaultInstance()) + return this; + if (operationsBuilder_ == null) { + if (!other.operations_.isEmpty()) { + if (operations_.isEmpty()) { + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOperationsIsMutable(); + operations_.addAll(other.operations_); + } + onChanged(); + } + } else { + if (!other.operations_.isEmpty()) { + if (operationsBuilder_.isEmpty()) { + operationsBuilder_.dispose(); + operationsBuilder_ = null; + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + operationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOperationsFieldBuilder() + : null; + } else { + operationsBuilder_.addAllMessages(other.operations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.ListBackupOperationsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.ListBackupOperationsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List operations_ = + java.util.Collections.emptyList(); + + private void ensureOperationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + operations_ = new java.util.ArrayList(operations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder> + operationsBuilder_; + + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List getOperationsList() { + if (operationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(operations_); + } else { + return operationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public int getOperationsCount() { + if (operationsBuilder_ == null) { + return operations_.size(); + } else { + return operationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation getOperations(int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); + } else { + return operationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder setOperations(int index, com.google.longrunning.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.set(index, value); + onChanged(); + } else { + operationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder setOperations( + int index, com.google.longrunning.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.set(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addOperations(com.google.longrunning.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(value); + onChanged(); + } else { + operationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addOperations(int index, com.google.longrunning.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(index, value); + onChanged(); + } else { + operationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addOperations(com.google.longrunning.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addOperations( + int index, com.google.longrunning.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addAllOperations( + java.lang.Iterable values) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, operations_); + onChanged(); + } else { + operationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder clearOperations() { + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + operationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder removeOperations(int index) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.remove(index); + onChanged(); + } else { + operationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation.Builder getOperationsBuilder(int index) { + return getOperationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); + } else { + return operationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List + getOperationsOrBuilderList() { + if (operationsBuilder_ != null) { + return operationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(operations_); + } + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation.Builder addOperationsBuilder() { + return getOperationsFieldBuilder() + .addBuilder(com.google.longrunning.Operation.getDefaultInstance()); + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation.Builder addOperationsBuilder(int index) { + return getOperationsFieldBuilder() + .addBuilder(index, com.google.longrunning.Operation.getDefaultInstance()); + } + /** + * + * + *
+     * The list of matching backup [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the backup's name and the operation's
+     * [metadata][google.longrunning.Operation.metadata] will be of type
+     * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+     * pending or have completed/failed/canceled within the last 7 days.
+     * Operations returned are ordered by
+     * `operation.metadata.value.progress.start_time` in descending order starting
+     * from the most recently started operation.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List getOperationsBuilderList() { + return getOperationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder> + getOperationsFieldBuilder() { + if (operationsBuilder_ == null) { + operationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder>( + operations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + operations_ = null; + } + return operationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.ListBackupOperationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListBackupOperationsResponse) + private static final com.google.spanner.admin.database.v1.ListBackupOperationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListBackupOperationsResponse(); + } + + public static com.google.spanner.admin.database.v1.ListBackupOperationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupOperationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBackupOperationsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupOperationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponseOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponseOrBuilder.java new file mode 100644 index 0000000000..05c3031f8d --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponseOrBuilder.java @@ -0,0 +1,145 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface ListBackupOperationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListBackupOperationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + java.util.List getOperationsList(); + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + com.google.longrunning.Operation getOperations(int index); + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + int getOperationsCount(); + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + java.util.List getOperationsOrBuilderList(); + /** + * + * + *
+   * The list of matching backup [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the backup's name and the operation's
+   * [metadata][google.longrunning.Operation.metadata] will be of type
+   * [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
+   * pending or have completed/failed/canceled within the last 7 days.
+   * Operations returned are ordered by
+   * `operation.metadata.value.progress.start_time` in descending order starting
+   * from the most recently started operation.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int index); + + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+   * call to fetch more of the matching metadata.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
+   * call to fetch more of the matching metadata.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequest.java new file mode 100644 index 0000000000..33b32bd56f --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequest.java @@ -0,0 +1,1312 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupsRequest} + */ +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBackupsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupsRequest.class, + com.google.spanner.admin.database.v1.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The instance to list backups from.  Values are of the
+   * form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The instance to list backups from.  Values are of the
+   * form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * An expression that filters the list of returned backups.
+   * A filter expression consists of a field name, a comparison operator, and a
+   * value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+   *   * `name`
+   *   * `database`
+   *   * `state`
+   *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   *   * `size_bytes`
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic, but
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `name:Howl` - The backup's name contains the string "howl".
+   *   * `database:prod`
+   *          - The database's name contains the string "prod".
+   *   * `state:CREATING` - The backup is pending creation.
+   *   * `state:READY` - The backup is fully created and ready for use.
+   *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+   *          - The backup name contains the string "howl" and `create_time`
+   *              of the backup is before 2018-03-28T14:50:00Z.
+   *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+   *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+   *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * An expression that filters the list of returned backups.
+   * A filter expression consists of a field name, a comparison operator, and a
+   * value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+   *   * `name`
+   *   * `database`
+   *   * `state`
+   *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   *   * `size_bytes`
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic, but
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `name:Howl` - The backup's name contains the string "howl".
+   *   * `database:prod`
+   *          - The database's name contains the string "prod".
+   *   * `state:CREATING` - The backup is pending creation.
+   *   * `state:READY` - The backup is fully created and ready for use.
+   *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+   *          - The backup name contains the string "howl" and `create_time`
+   *              of the backup is before 2018-03-28T14:50:00Z.
+   *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+   *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+   *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * Number of backups to be returned in the response. If 0 or
+   * less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+   * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+   * `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+   * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+   * `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.ListBackupsRequest other = + (com.google.spanner.admin.database.v1.ListBackupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.ListBackupsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.ListBackupsRequest) + com.google.spanner.admin.database.v1.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupsRequest.class, + com.google.spanner.admin.database.v1.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.ListBackupsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupsRequest getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupsRequest build() { + com.google.spanner.admin.database.v1.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupsRequest buildPartial() { + com.google.spanner.admin.database.v1.ListBackupsRequest result = + new com.google.spanner.admin.database.v1.ListBackupsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.ListBackupsRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.ListBackupsRequest other) { + if (other == com.google.spanner.admin.database.v1.ListBackupsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.ListBackupsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.ListBackupsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The instance to list backups from.  Values are of the
+     * form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The instance to list backups from.  Values are of the
+     * form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The instance to list backups from.  Values are of the
+     * form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to list backups from.  Values are of the
+     * form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to list backups from.  Values are of the
+     * form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * An expression that filters the list of returned backups.
+     * A filter expression consists of a field name, a comparison operator, and a
+     * value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+     *   * `name`
+     *   * `database`
+     *   * `state`
+     *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `size_bytes`
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `name:Howl` - The backup's name contains the string "howl".
+     *   * `database:prod`
+     *          - The database's name contains the string "prod".
+     *   * `state:CREATING` - The backup is pending creation.
+     *   * `state:READY` - The backup is fully created and ready for use.
+     *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+     *          - The backup name contains the string "howl" and `create_time`
+     *              of the backup is before 2018-03-28T14:50:00Z.
+     *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+     *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+     *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An expression that filters the list of returned backups.
+     * A filter expression consists of a field name, a comparison operator, and a
+     * value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+     *   * `name`
+     *   * `database`
+     *   * `state`
+     *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `size_bytes`
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `name:Howl` - The backup's name contains the string "howl".
+     *   * `database:prod`
+     *          - The database's name contains the string "prod".
+     *   * `state:CREATING` - The backup is pending creation.
+     *   * `state:READY` - The backup is fully created and ready for use.
+     *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+     *          - The backup name contains the string "howl" and `create_time`
+     *              of the backup is before 2018-03-28T14:50:00Z.
+     *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+     *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+     *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An expression that filters the list of returned backups.
+     * A filter expression consists of a field name, a comparison operator, and a
+     * value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+     *   * `name`
+     *   * `database`
+     *   * `state`
+     *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `size_bytes`
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `name:Howl` - The backup's name contains the string "howl".
+     *   * `database:prod`
+     *          - The database's name contains the string "prod".
+     *   * `state:CREATING` - The backup is pending creation.
+     *   * `state:READY` - The backup is fully created and ready for use.
+     *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+     *          - The backup name contains the string "howl" and `create_time`
+     *              of the backup is before 2018-03-28T14:50:00Z.
+     *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+     *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+     *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression that filters the list of returned backups.
+     * A filter expression consists of a field name, a comparison operator, and a
+     * value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+     *   * `name`
+     *   * `database`
+     *   * `state`
+     *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `size_bytes`
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `name:Howl` - The backup's name contains the string "howl".
+     *   * `database:prod`
+     *          - The database's name contains the string "prod".
+     *   * `state:CREATING` - The backup is pending creation.
+     *   * `state:READY` - The backup is fully created and ready for use.
+     *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+     *          - The backup name contains the string "howl" and `create_time`
+     *              of the backup is before 2018-03-28T14:50:00Z.
+     *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+     *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+     *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * An expression that filters the list of returned backups.
+     * A filter expression consists of a field name, a comparison operator, and a
+     * value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+     *   * `name`
+     *   * `database`
+     *   * `state`
+     *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     *   * `size_bytes`
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic, but
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `name:Howl` - The backup's name contains the string "howl".
+     *   * `database:prod`
+     *          - The database's name contains the string "prod".
+     *   * `state:CREATING` - The backup is pending creation.
+     *   * `state:READY` - The backup is fully created and ready for use.
+     *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+     *          - The backup name contains the string "howl" and `create_time`
+     *              of the backup is before 2018-03-28T14:50:00Z.
+     *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+     *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+     *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Number of backups to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Number of backups to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of backups to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+     * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+     * `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+     * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+     * `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+     * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+     * `filter`.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+     * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+     * `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+     * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+     * `filter`.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListBackupsRequest) + private static final com.google.spanner.admin.database.v1.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListBackupsRequest(); + } + + public static com.google.spanner.admin.database.v1.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBackupsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequestOrBuilder.java new file mode 100644 index 0000000000..a31254101d --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequestOrBuilder.java @@ -0,0 +1,180 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance to list backups from.  Values are of the
+   * form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The instance to list backups from.  Values are of the
+   * form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * An expression that filters the list of returned backups.
+   * A filter expression consists of a field name, a comparison operator, and a
+   * value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+   *   * `name`
+   *   * `database`
+   *   * `state`
+   *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   *   * `size_bytes`
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic, but
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `name:Howl` - The backup's name contains the string "howl".
+   *   * `database:prod`
+   *          - The database's name contains the string "prod".
+   *   * `state:CREATING` - The backup is pending creation.
+   *   * `state:READY` - The backup is fully created and ready for use.
+   *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+   *          - The backup name contains the string "howl" and `create_time`
+   *              of the backup is before 2018-03-28T14:50:00Z.
+   *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+   *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+   *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * An expression that filters the list of returned backups.
+   * A filter expression consists of a field name, a comparison operator, and a
+   * value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
+   *   * `name`
+   *   * `database`
+   *   * `state`
+   *   * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   *   * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   *   * `size_bytes`
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic, but
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `name:Howl` - The backup's name contains the string "howl".
+   *   * `database:prod`
+   *          - The database's name contains the string "prod".
+   *   * `state:CREATING` - The backup is pending creation.
+   *   * `state:READY` - The backup is fully created and ready for use.
+   *   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
+   *          - The backup name contains the string "howl" and `create_time`
+   *              of the backup is before 2018-03-28T14:50:00Z.
+   *   * `expire_time < \"2018-03-28T14:50:00Z\"`
+   *          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
+   *   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Number of backups to be returned in the response. If 0 or
+   * less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+   * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+   * `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
+   * previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
+   * `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponse.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponse.java new file mode 100644 index 0000000000..035426ab5f --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponse.java @@ -0,0 +1,1159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The response for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupsResponse} + */ +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBackupsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + backups_.add( + input.readMessage( + com.google.spanner.admin.database.v1.Backup.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupsResponse.class, + com.google.spanner.admin.database.v1.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + private java.util.List backups_; + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public java.util.List getBackupsList() { + return backups_; + } + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public int getBackupsCount() { + return backups_.size(); + } + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public com.google.spanner.admin.database.v1.Backup getBackups(int index) { + return backups_.get(index); + } + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public com.google.spanner.admin.database.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+   * of the matching backups.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+   * of the matching backups.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.ListBackupsResponse other = + (com.google.spanner.admin.database.v1.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.ListBackupsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.ListBackupsResponse) + com.google.spanner.admin.database.v1.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListBackupsResponse.class, + com.google.spanner.admin.database.v1.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.ListBackupsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + backupsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupsResponse getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupsResponse build() { + com.google.spanner.admin.database.v1.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupsResponse buildPartial() { + com.google.spanner.admin.database.v1.ListBackupsResponse result = + new com.google.spanner.admin.database.v1.ListBackupsResponse(this); + int from_bitField0_ = bitField0_; + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.ListBackupsResponse) { + return mergeFrom((com.google.spanner.admin.database.v1.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.ListBackupsResponse other) { + if (other == com.google.spanner.admin.database.v1.ListBackupsResponse.getDefaultInstance()) + return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.ListBackupsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.ListBackupsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public com.google.spanner.admin.database.v1.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.spanner.admin.database.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.spanner.admin.database.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.spanner.admin.database.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.spanner.admin.database.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.spanner.admin.database.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.spanner.admin.database.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public com.google.spanner.admin.database.v1.Backup.Builder getBackupsBuilder(int index) { + return getBackupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public com.google.spanner.admin.database.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public com.google.spanner.admin.database.v1.Backup.Builder addBackupsBuilder() { + return getBackupsFieldBuilder() + .addBuilder(com.google.spanner.admin.database.v1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public com.google.spanner.admin.database.v1.Backup.Builder addBackupsBuilder(int index) { + return getBackupsFieldBuilder() + .addBuilder(index, com.google.spanner.admin.database.v1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * The list of matching backups. Backups returned are ordered by `create_time`
+     * in descending order, starting from the most recent `create_time`.
+     * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + public java.util.List + getBackupsBuilderList() { + return getBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder> + getBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+     * of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+     * of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+     * of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+     * of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+     * of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListBackupsResponse) + private static final com.google.spanner.admin.database.v1.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListBackupsResponse(); + } + + public static com.google.spanner.admin.database.v1.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBackupsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponseOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponseOrBuilder.java new file mode 100644 index 0000000000..fe5c302a0e --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + java.util.List getBackupsList(); + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + com.google.spanner.admin.database.v1.Backup getBackups(int index); + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + int getBackupsCount(); + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + java.util.List + getBackupsOrBuilderList(); + /** + * + * + *
+   * The list of matching backups. Backups returned are ordered by `create_time`
+   * in descending order, starting from the most recent `create_time`.
+   * 
+ * + * repeated .google.spanner.admin.database.v1.Backup backups = 1; + */ + com.google.spanner.admin.database.v1.BackupOrBuilder getBackupsOrBuilder(int index); + + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+   * of the matching backups.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
+   * of the matching backups.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java new file mode 100644 index 0000000000..9233c50f20 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java @@ -0,0 +1,1367 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for
+ * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListDatabaseOperationsRequest} + */ +public final class ListDatabaseOperationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListDatabaseOperationsRequest) + ListDatabaseOperationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDatabaseOperationsRequest.newBuilder() to construct. + private ListDatabaseOperationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDatabaseOperationsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDatabaseOperationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDatabaseOperationsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest.class, + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The instance of the database operations.
+   * Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The instance of the database operations.
+   * Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * An expression that filters the list of returned operations.
+   * A filter expression consists of a field name, a
+   * comparison operator, and a value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [Operation][google.longrunning.Operation]
+   * are eligible for filtering:
+   *   * `name` - The name of the long-running operation
+   *   * `done` - False if the operation is in progress, else true.
+   *   * `metadata.@type` - the type of metadata. For example, the type string
+   *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+   *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+   *   * `metadata.<field_name>` - any field in metadata.value.
+   *   * `error` - Error associated with the long-running operation.
+   *   * `response.@type` - the type of response.
+   *   * `response.<field_name>` - any field in response.value.
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic. However,
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `done:true` - The operation is complete.
+   *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+   *     `(metadata.source_type:BACKUP) AND` <br/>
+   *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+   *     `(metadata.name:restored_howl) AND` <br/>
+   *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+   *     `(error:*)` - Return operations where:
+   *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+   *     * The database is restored from a backup.
+   *     * The backup name contains "backup_howl".
+   *     * The restored database's name contains "restored_howl".
+   *     * The operation started before 2018-03-28T14:50:00Z.
+   *     * The operation resulted in an error.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * An expression that filters the list of returned operations.
+   * A filter expression consists of a field name, a
+   * comparison operator, and a value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [Operation][google.longrunning.Operation]
+   * are eligible for filtering:
+   *   * `name` - The name of the long-running operation
+   *   * `done` - False if the operation is in progress, else true.
+   *   * `metadata.@type` - the type of metadata. For example, the type string
+   *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+   *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+   *   * `metadata.<field_name>` - any field in metadata.value.
+   *   * `error` - Error associated with the long-running operation.
+   *   * `response.@type` - the type of response.
+   *   * `response.<field_name>` - any field in response.value.
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic. However,
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `done:true` - The operation is complete.
+   *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+   *     `(metadata.source_type:BACKUP) AND` <br/>
+   *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+   *     `(metadata.name:restored_howl) AND` <br/>
+   *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+   *     `(error:*)` - Return operations where:
+   *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+   *     * The database is restored from a backup.
+   *     * The backup name contains "backup_howl".
+   *     * The restored database's name contains "restored_howl".
+   *     * The operation started before 2018-03-28T14:50:00Z.
+   *     * The operation resulted in an error.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * Number of operations to be returned in the response. If 0 or
+   * less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+   * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+   * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest other = + (com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for
+   * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListDatabaseOperationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.ListDatabaseOperationsRequest) + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest.class, + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest.Builder.class); + } + + // Construct using + // com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest build() { + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest buildPartial() { + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest result = + new com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) { + return mergeFrom( + (com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest other) { + if (other + == com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The instance of the database operations.
+     * Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The instance of the database operations.
+     * Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The instance of the database operations.
+     * Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance of the database operations.
+     * Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance of the database operations.
+     * Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * An expression that filters the list of returned operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic. However,
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+     *     `(metadata.source_type:BACKUP) AND` <br/>
+     *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+     *     `(metadata.name:restored_howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Return operations where:
+     *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     *     * The database is restored from a backup.
+     *     * The backup name contains "backup_howl".
+     *     * The restored database's name contains "restored_howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An expression that filters the list of returned operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic. However,
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+     *     `(metadata.source_type:BACKUP) AND` <br/>
+     *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+     *     `(metadata.name:restored_howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Return operations where:
+     *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     *     * The database is restored from a backup.
+     *     * The backup name contains "backup_howl".
+     *     * The restored database's name contains "restored_howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An expression that filters the list of returned operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic. However,
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+     *     `(metadata.source_type:BACKUP) AND` <br/>
+     *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+     *     `(metadata.name:restored_howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Return operations where:
+     *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     *     * The database is restored from a backup.
+     *     * The backup name contains "backup_howl".
+     *     * The restored database's name contains "restored_howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression that filters the list of returned operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic. However,
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+     *     `(metadata.source_type:BACKUP) AND` <br/>
+     *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+     *     `(metadata.name:restored_howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Return operations where:
+     *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     *     * The database is restored from a backup.
+     *     * The backup name contains "backup_howl".
+     *     * The restored database's name contains "restored_howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * An expression that filters the list of returned operations.
+     * A filter expression consists of a field name, a
+     * comparison operator, and a value for filtering.
+     * The value must be a string, a number, or a boolean. The comparison operator
+     * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+     * Colon `:` is the contains operator. Filter rules are not case sensitive.
+     * The following fields in the [Operation][google.longrunning.Operation]
+     * are eligible for filtering:
+     *   * `name` - The name of the long-running operation
+     *   * `done` - False if the operation is in progress, else true.
+     *   * `metadata.@type` - the type of metadata. For example, the type string
+     *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+     *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+     *   * `metadata.<field_name>` - any field in metadata.value.
+     *   * `error` - Error associated with the long-running operation.
+     *   * `response.@type` - the type of response.
+     *   * `response.<field_name>` - any field in response.value.
+     * You can combine multiple expressions by enclosing each expression in
+     * parentheses. By default, expressions are combined with AND logic. However,
+     * you can specify AND, OR, and NOT logic explicitly.
+     * Here are a few examples:
+     *   * `done:true` - The operation is complete.
+     *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+     *     `(metadata.source_type:BACKUP) AND` <br/>
+     *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+     *     `(metadata.name:restored_howl) AND` <br/>
+     *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+     *     `(error:*)` - Return operations where:
+     *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+     *     * The database is restored from a backup.
+     *     * The backup name contains "backup_howl".
+     *     * The restored database's name contains "restored_howl".
+     *     * The operation started before 2018-03-28T14:50:00Z.
+     *     * The operation resulted in an error.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Number of operations to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Number of operations to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of operations to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+     * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+     * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+     * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+     * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+     * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.ListDatabaseOperationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListDatabaseOperationsRequest) + private static final com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest(); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDatabaseOperationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDatabaseOperationsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java new file mode 100644 index 0000000000..115dcd7551 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +public interface ListDatabaseOperationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListDatabaseOperationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The instance of the database operations.
+   * Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The instance of the database operations.
+   * Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * An expression that filters the list of returned operations.
+   * A filter expression consists of a field name, a
+   * comparison operator, and a value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [Operation][google.longrunning.Operation]
+   * are eligible for filtering:
+   *   * `name` - The name of the long-running operation
+   *   * `done` - False if the operation is in progress, else true.
+   *   * `metadata.@type` - the type of metadata. For example, the type string
+   *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+   *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+   *   * `metadata.<field_name>` - any field in metadata.value.
+   *   * `error` - Error associated with the long-running operation.
+   *   * `response.@type` - the type of response.
+   *   * `response.<field_name>` - any field in response.value.
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic. However,
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `done:true` - The operation is complete.
+   *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+   *     `(metadata.source_type:BACKUP) AND` <br/>
+   *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+   *     `(metadata.name:restored_howl) AND` <br/>
+   *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+   *     `(error:*)` - Return operations where:
+   *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+   *     * The database is restored from a backup.
+   *     * The backup name contains "backup_howl".
+   *     * The restored database's name contains "restored_howl".
+   *     * The operation started before 2018-03-28T14:50:00Z.
+   *     * The operation resulted in an error.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * An expression that filters the list of returned operations.
+   * A filter expression consists of a field name, a
+   * comparison operator, and a value for filtering.
+   * The value must be a string, a number, or a boolean. The comparison operator
+   * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
+   * Colon `:` is the contains operator. Filter rules are not case sensitive.
+   * The following fields in the [Operation][google.longrunning.Operation]
+   * are eligible for filtering:
+   *   * `name` - The name of the long-running operation
+   *   * `done` - False if the operation is in progress, else true.
+   *   * `metadata.@type` - the type of metadata. For example, the type string
+   *      for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
+   *      `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
+   *   * `metadata.<field_name>` - any field in metadata.value.
+   *   * `error` - Error associated with the long-running operation.
+   *   * `response.@type` - the type of response.
+   *   * `response.<field_name>` - any field in response.value.
+   * You can combine multiple expressions by enclosing each expression in
+   * parentheses. By default, expressions are combined with AND logic. However,
+   * you can specify AND, OR, and NOT logic explicitly.
+   * Here are a few examples:
+   *   * `done:true` - The operation is complete.
+   *   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
+   *     `(metadata.source_type:BACKUP) AND` <br/>
+   *     `(metadata.backup_info.backup:backup_howl) AND` <br/>
+   *     `(metadata.name:restored_howl) AND` <br/>
+   *     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+   *     `(error:*)` - Return operations where:
+   *     * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
+   *     * The database is restored from a backup.
+   *     * The backup name contains "backup_howl".
+   *     * The restored database's name contains "restored_howl".
+   *     * The operation started before 2018-03-28T14:50:00Z.
+   *     * The operation resulted in an error.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Number of operations to be returned in the response. If 0 or
+   * less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+   * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
+   * from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponse.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponse.java new file mode 100644 index 0000000000..1eee660e6a --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponse.java @@ -0,0 +1,1240 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The response for
+ * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListDatabaseOperationsResponse} + */ +public final class ListDatabaseOperationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.ListDatabaseOperationsResponse) + ListDatabaseOperationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDatabaseOperationsResponse.newBuilder() to construct. + private ListDatabaseOperationsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDatabaseOperationsResponse() { + operations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDatabaseOperationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDatabaseOperationsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + operations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + operations_.add( + input.readMessage(com.google.longrunning.Operation.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.class, + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.Builder.class); + } + + public static final int OPERATIONS_FIELD_NUMBER = 1; + private java.util.List operations_; + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List getOperationsList() { + return operations_; + } + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List + getOperationsOrBuilderList() { + return operations_; + } + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public int getOperationsCount() { + return operations_.size(); + } + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation getOperations(int index) { + return operations_.get(index); + } + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int index) { + return operations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+   * call to fetch more of the matching metadata.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+   * call to fetch more of the matching metadata.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < operations_.size(); i++) { + output.writeMessage(1, operations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < operations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, operations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse other = + (com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) obj; + + if (!getOperationsList().equals(other.getOperationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOperationsCount() > 0) { + hash = (37 * hash) + OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getOperationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for
+   * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.ListDatabaseOperationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.ListDatabaseOperationsResponse) + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.class, + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.Builder.class); + } + + // Construct using + // com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOperationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + operationsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse build() { + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse buildPartial() { + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse result = + new com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(this); + int from_bitField0_ = bitField0_; + if (operationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.operations_ = operations_; + } else { + result.operations_ = operationsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) { + return mergeFrom( + (com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse other) { + if (other + == com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + .getDefaultInstance()) return this; + if (operationsBuilder_ == null) { + if (!other.operations_.isEmpty()) { + if (operations_.isEmpty()) { + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOperationsIsMutable(); + operations_.addAll(other.operations_); + } + onChanged(); + } + } else { + if (!other.operations_.isEmpty()) { + if (operationsBuilder_.isEmpty()) { + operationsBuilder_.dispose(); + operationsBuilder_ = null; + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + operationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOperationsFieldBuilder() + : null; + } else { + operationsBuilder_.addAllMessages(other.operations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List operations_ = + java.util.Collections.emptyList(); + + private void ensureOperationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + operations_ = new java.util.ArrayList(operations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder> + operationsBuilder_; + + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List getOperationsList() { + if (operationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(operations_); + } else { + return operationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public int getOperationsCount() { + if (operationsBuilder_ == null) { + return operations_.size(); + } else { + return operationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation getOperations(int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); + } else { + return operationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder setOperations(int index, com.google.longrunning.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.set(index, value); + onChanged(); + } else { + operationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder setOperations( + int index, com.google.longrunning.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.set(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addOperations(com.google.longrunning.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(value); + onChanged(); + } else { + operationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addOperations(int index, com.google.longrunning.Operation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(index, value); + onChanged(); + } else { + operationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addOperations(com.google.longrunning.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addOperations( + int index, com.google.longrunning.Operation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder addAllOperations( + java.lang.Iterable values) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, operations_); + onChanged(); + } else { + operationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder clearOperations() { + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + operationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public Builder removeOperations(int index) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.remove(index); + onChanged(); + } else { + operationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation.Builder getOperationsBuilder(int index) { + return getOperationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); + } else { + return operationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List + getOperationsOrBuilderList() { + if (operationsBuilder_ != null) { + return operationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(operations_); + } + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation.Builder addOperationsBuilder() { + return getOperationsFieldBuilder() + .addBuilder(com.google.longrunning.Operation.getDefaultInstance()); + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public com.google.longrunning.Operation.Builder addOperationsBuilder(int index) { + return getOperationsFieldBuilder() + .addBuilder(index, com.google.longrunning.Operation.getDefaultInstance()); + } + /** + * + * + *
+     * The list of matching database [long-running
+     * operations][google.longrunning.Operation]. Each operation's name will be
+     * prefixed by the database's name. The operation's
+     * [metadata][google.longrunning.Operation.metadata] field type
+     * `metadata.type_url` describes the type of the metadata.
+     * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + public java.util.List getOperationsBuilderList() { + return getOperationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder> + getOperationsFieldBuilder() { + if (operationsBuilder_ == null) { + operationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.longrunning.Operation, + com.google.longrunning.Operation.Builder, + com.google.longrunning.OperationOrBuilder>( + operations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + operations_ = null; + } + return operationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+     * call to fetch more of the matching metadata.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.ListDatabaseOperationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.ListDatabaseOperationsResponse) + private static final com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse(); + } + + public static com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDatabaseOperationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDatabaseOperationsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponseOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponseOrBuilder.java new file mode 100644 index 0000000000..786c6fc231 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponseOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +public interface ListDatabaseOperationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.ListDatabaseOperationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + java.util.List getOperationsList(); + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + com.google.longrunning.Operation getOperations(int index); + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + int getOperationsCount(); + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + java.util.List getOperationsOrBuilderList(); + /** + * + * + *
+   * The list of matching database [long-running
+   * operations][google.longrunning.Operation]. Each operation's name will be
+   * prefixed by the database's name. The operation's
+   * [metadata][google.longrunning.Operation.metadata] field type
+   * `metadata.type_url` describes the type of the metadata.
+   * 
+ * + * repeated .google.longrunning.Operation operations = 1; + */ + com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int index); + + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+   * call to fetch more of the matching metadata.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
+   * call to fetch more of the matching metadata.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgress.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgress.java new file mode 100644 index 0000000000..d31d4ee7d6 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgress.java @@ -0,0 +1,1093 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/common.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * Encapsulates progress related information for a Cloud Spanner long
+ * running operation.
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.OperationProgress} + */ +public final class OperationProgress extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.OperationProgress) + OperationProgressOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationProgress.newBuilder() to construct. + private OperationProgress(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationProgress() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationProgress(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationProgress( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + progressPercent_ = input.readInt32(); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.CommonProto + .internal_static_google_spanner_admin_database_v1_OperationProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.CommonProto + .internal_static_google_spanner_admin_database_v1_OperationProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.OperationProgress.class, + com.google.spanner.admin.database.v1.OperationProgress.Builder.class); + } + + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; + private int progressPercent_; + /** + * + * + *
+   * Percent completion of the operation.
+   * Values are between 0 and 100 inclusive.
+   * 
+ * + * int32 progress_percent = 1; + * + * @return The progressPercent. + */ + public int getProgressPercent() { + return progressPercent_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (progressPercent_ != 0) { + output.writeInt32(1, progressPercent_); + } + if (startTime_ != null) { + output.writeMessage(2, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(3, getEndTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (progressPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, progressPercent_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.OperationProgress)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.OperationProgress other = + (com.google.spanner.admin.database.v1.OperationProgress) obj; + + if (getProgressPercent() != other.getProgressPercent()) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROGRESS_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercent(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.OperationProgress parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.OperationProgress prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Encapsulates progress related information for a Cloud Spanner long
+   * running operation.
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.OperationProgress} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.OperationProgress) + com.google.spanner.admin.database.v1.OperationProgressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.CommonProto + .internal_static_google_spanner_admin_database_v1_OperationProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.CommonProto + .internal_static_google_spanner_admin_database_v1_OperationProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.OperationProgress.class, + com.google.spanner.admin.database.v1.OperationProgress.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.OperationProgress.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + progressPercent_ = 0; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.CommonProto + .internal_static_google_spanner_admin_database_v1_OperationProgress_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.OperationProgress getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.OperationProgress build() { + com.google.spanner.admin.database.v1.OperationProgress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.OperationProgress buildPartial() { + com.google.spanner.admin.database.v1.OperationProgress result = + new com.google.spanner.admin.database.v1.OperationProgress(this); + result.progressPercent_ = progressPercent_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.OperationProgress) { + return mergeFrom((com.google.spanner.admin.database.v1.OperationProgress) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.OperationProgress other) { + if (other == com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance()) + return this; + if (other.getProgressPercent() != 0) { + setProgressPercent(other.getProgressPercent()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.OperationProgress parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.OperationProgress) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int progressPercent_; + /** + * + * + *
+     * Percent completion of the operation.
+     * Values are between 0 and 100 inclusive.
+     * 
+ * + * int32 progress_percent = 1; + * + * @return The progressPercent. + */ + public int getProgressPercent() { + return progressPercent_; + } + /** + * + * + *
+     * Percent completion of the operation.
+     * Values are between 0 and 100 inclusive.
+     * 
+ * + * int32 progress_percent = 1; + * + * @param value The progressPercent to set. + * @return This builder for chaining. + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Percent completion of the operation.
+     * Values are between 0 and 100 inclusive.
+     * 
+ * + * int32 progress_percent = 1; + * + * @return This builder for chaining. + */ + public Builder clearProgressPercent() { + + progressPercent_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.OperationProgress) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.OperationProgress) + private static final com.google.spanner.admin.database.v1.OperationProgress DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.OperationProgress(); + } + + public static com.google.spanner.admin.database.v1.OperationProgress getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationProgress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationProgress(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.OperationProgress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgressOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgressOrBuilder.java new file mode 100644 index 0000000000..df76dbaca0 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgressOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/common.proto + +package com.google.spanner.admin.database.v1; + +public interface OperationProgressOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.OperationProgress) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Percent completion of the operation.
+   * Values are between 0 and 100 inclusive.
+   * 
+ * + * int32 progress_percent = 1; + * + * @return The progressPercent. + */ + int getProgressPercent(); + + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java new file mode 100644 index 0000000000..6db17d6496 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java @@ -0,0 +1,929 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * Metadata type for the long-running operation used to track the progress
+ * of optimizations performed on a newly restored database. This long-running
+ * operation is automatically created by the system after the successful
+ * completion of a database restore, and cannot be cancelled.
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} + */ +public final class OptimizeRestoredDatabaseMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) + OptimizeRestoredDatabaseMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OptimizeRestoredDatabaseMetadata.newBuilder() to construct. + private OptimizeRestoredDatabaseMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OptimizeRestoredDatabaseMetadata() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OptimizeRestoredDatabaseMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OptimizeRestoredDatabaseMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.spanner.admin.database.v1.OperationProgress.Builder subBuilder = null; + if (progress_ != null) { + subBuilder = progress_.toBuilder(); + } + progress_ = + input.readMessage( + com.google.spanner.admin.database.v1.OperationProgress.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progress_); + progress_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.class, + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the restored database being optimized.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the restored database being optimized.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROGRESS_FIELD_NUMBER = 2; + private com.google.spanner.admin.database.v1.OperationProgress progress_; + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return progress_ != null; + } + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + * + * @return The progress. + */ + public com.google.spanner.admin.database.v1.OperationProgress getProgress() { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + public com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder() { + return getProgress(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (progress_ != null) { + output.writeMessage(2, getProgress()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (progress_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProgress()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata other = + (com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasProgress() != other.hasProgress()) return false; + if (hasProgress()) { + if (!getProgress().equals(other.getProgress())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasProgress()) { + hash = (37 * hash) + PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getProgress().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata type for the long-running operation used to track the progress
+   * of optimizations performed on a newly restored database. This long-running
+   * operation is automatically created by the system after the successful
+   * completion of a database restore, and cannot be cancelled.
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.class, + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.Builder.class); + } + + // Construct using + // com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (progressBuilder_ == null) { + progress_ = null; + } else { + progress_ = null; + progressBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata build() { + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata buildPartial() { + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata result = + new com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(this); + result.name_ = name_; + if (progressBuilder_ == null) { + result.progress_ = progress_; + } else { + result.progress_ = progressBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) { + return mergeFrom( + (com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata other) { + if (other + == com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasProgress()) { + mergeProgress(other.getProgress()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the restored database being optimized.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the restored database being optimized.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the restored database being optimized.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the restored database being optimized.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the restored database being optimized.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.spanner.admin.database.v1.OperationProgress progress_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder> + progressBuilder_; + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return progressBuilder_ != null || progress_ != null; + } + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + * + * @return The progress. + */ + public com.google.spanner.admin.database.v1.OperationProgress getProgress() { + if (progressBuilder_ == null) { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } else { + return progressBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + public Builder setProgress(com.google.spanner.admin.database.v1.OperationProgress value) { + if (progressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progress_ = value; + onChanged(); + } else { + progressBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + public Builder setProgress( + com.google.spanner.admin.database.v1.OperationProgress.Builder builderForValue) { + if (progressBuilder_ == null) { + progress_ = builderForValue.build(); + onChanged(); + } else { + progressBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + public Builder mergeProgress(com.google.spanner.admin.database.v1.OperationProgress value) { + if (progressBuilder_ == null) { + if (progress_ != null) { + progress_ = + com.google.spanner.admin.database.v1.OperationProgress.newBuilder(progress_) + .mergeFrom(value) + .buildPartial(); + } else { + progress_ = value; + } + onChanged(); + } else { + progressBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + public Builder clearProgress() { + if (progressBuilder_ == null) { + progress_ = null; + onChanged(); + } else { + progress_ = null; + progressBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + public com.google.spanner.admin.database.v1.OperationProgress.Builder getProgressBuilder() { + + onChanged(); + return getProgressFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + public com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder() { + if (progressBuilder_ != null) { + return progressBuilder_.getMessageOrBuilder(); + } else { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } + } + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder> + getProgressFieldBuilder() { + if (progressBuilder_ == null) { + progressBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder>( + getProgress(), getParentForChildren(), isClean()); + progress_ = null; + } + return progressBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) + private static final com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata(); + } + + public static com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizeRestoredDatabaseMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OptimizeRestoredDatabaseMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java new file mode 100644 index 0000000000..a5a211d446 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +public interface OptimizeRestoredDatabaseMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the restored database being optimized.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the restored database being optimized.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + * + * @return Whether the progress field is set. + */ + boolean hasProgress(); + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + * + * @return The progress. + */ + com.google.spanner.admin.database.v1.OperationProgress getProgress(); + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 2; + */ + com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java new file mode 100644 index 0000000000..d7689dd31c --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java @@ -0,0 +1,2105 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * Metadata type for the long-running operation returned by
+ * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.RestoreDatabaseMetadata} + */ +public final class RestoreDatabaseMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.RestoreDatabaseMetadata) + RestoreDatabaseMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreDatabaseMetadata.newBuilder() to construct. + private RestoreDatabaseMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreDatabaseMetadata() { + name_ = ""; + sourceType_ = 0; + optimizeDatabaseOperationName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreDatabaseMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RestoreDatabaseMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + sourceType_ = rawValue; + break; + } + case 26: + { + com.google.spanner.admin.database.v1.BackupInfo.Builder subBuilder = null; + if (sourceInfoCase_ == 3) { + subBuilder = + ((com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_).toBuilder(); + } + sourceInfo_ = + input.readMessage( + com.google.spanner.admin.database.v1.BackupInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_); + sourceInfo_ = subBuilder.buildPartial(); + } + sourceInfoCase_ = 3; + break; + } + case 34: + { + com.google.spanner.admin.database.v1.OperationProgress.Builder subBuilder = null; + if (progress_ != null) { + subBuilder = progress_.toBuilder(); + } + progress_ = + input.readMessage( + com.google.spanner.admin.database.v1.OperationProgress.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progress_); + progress_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (cancelTime_ != null) { + subBuilder = cancelTime_.toBuilder(); + } + cancelTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cancelTime_); + cancelTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + optimizeDatabaseOperationName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata.class, + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata.Builder.class); + } + + private int sourceInfoCase_ = 0; + private java.lang.Object sourceInfo_; + + public enum SourceInfoCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_INFO(3), + SOURCEINFO_NOT_SET(0); + private final int value; + + private SourceInfoCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceInfoCase valueOf(int value) { + return forNumber(value); + } + + public static SourceInfoCase forNumber(int value) { + switch (value) { + case 3: + return BACKUP_INFO; + case 0: + return SOURCEINFO_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceInfoCase getSourceInfoCase() { + return SourceInfoCase.forNumber(sourceInfoCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the database being created and restored to.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the database being created and restored to.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_TYPE_FIELD_NUMBER = 2; + private int sourceType_; + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @return The enum numeric value on the wire for sourceType. + */ + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @return The sourceType. + */ + public com.google.spanner.admin.database.v1.RestoreSourceType getSourceType() { + @SuppressWarnings("deprecation") + com.google.spanner.admin.database.v1.RestoreSourceType result = + com.google.spanner.admin.database.v1.RestoreSourceType.valueOf(sourceType_); + return result == null + ? com.google.spanner.admin.database.v1.RestoreSourceType.UNRECOGNIZED + : result; + } + + public static final int BACKUP_INFO_FIELD_NUMBER = 3; + /** + * + * + *
+   * Information about the backup used to restore the database.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + * + * @return Whether the backupInfo field is set. + */ + public boolean hasBackupInfo() { + return sourceInfoCase_ == 3; + } + /** + * + * + *
+   * Information about the backup used to restore the database.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + * + * @return The backupInfo. + */ + public com.google.spanner.admin.database.v1.BackupInfo getBackupInfo() { + if (sourceInfoCase_ == 3) { + return (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_; + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + /** + * + * + *
+   * Information about the backup used to restore the database.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + public com.google.spanner.admin.database.v1.BackupInfoOrBuilder getBackupInfoOrBuilder() { + if (sourceInfoCase_ == 3) { + return (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_; + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + + public static final int PROGRESS_FIELD_NUMBER = 4; + private com.google.spanner.admin.database.v1.OperationProgress progress_; + /** + * + * + *
+   * The progress of the
+   * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+   * operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return progress_ != null; + } + /** + * + * + *
+   * The progress of the
+   * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+   * operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + * + * @return The progress. + */ + public com.google.spanner.admin.database.v1.OperationProgress getProgress() { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } + /** + * + * + *
+   * The progress of the
+   * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+   * operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + public com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder() { + return getProgress(); + } + + public static final int CANCEL_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp cancelTime_; + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][google.longrunning.Operation.error] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + * + * @return Whether the cancelTime field is set. + */ + public boolean hasCancelTime() { + return cancelTime_ != null; + } + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][google.longrunning.Operation.error] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + * + * @return The cancelTime. + */ + public com.google.protobuf.Timestamp getCancelTime() { + return cancelTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : cancelTime_; + } + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][google.longrunning.Operation.error] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCancelTimeOrBuilder() { + return getCancelTime(); + } + + public static final int OPTIMIZE_DATABASE_OPERATION_NAME_FIELD_NUMBER = 6; + private volatile java.lang.Object optimizeDatabaseOperationName_; + /** + * + * + *
+   * If exists, the name of the long-running operation that will be used to
+   * track the post-restore optimization process to optimize the performance of
+   * the restored database, and remove the dependency on the restore source.
+   * The name is of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+   * where the <database> is the name of database being created and restored to.
+   * The metadata type of the  long-running operation is
+   * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+   * automatically created by the system after the RestoreDatabase long-running
+   * operation completes successfully. This operation will not be created if the
+   * restore was not successful.
+   * 
+ * + * string optimize_database_operation_name = 6; + * + * @return The optimizeDatabaseOperationName. + */ + public java.lang.String getOptimizeDatabaseOperationName() { + java.lang.Object ref = optimizeDatabaseOperationName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + optimizeDatabaseOperationName_ = s; + return s; + } + } + /** + * + * + *
+   * If exists, the name of the long-running operation that will be used to
+   * track the post-restore optimization process to optimize the performance of
+   * the restored database, and remove the dependency on the restore source.
+   * The name is of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+   * where the <database> is the name of database being created and restored to.
+   * The metadata type of the  long-running operation is
+   * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+   * automatically created by the system after the RestoreDatabase long-running
+   * operation completes successfully. This operation will not be created if the
+   * restore was not successful.
+   * 
+ * + * string optimize_database_operation_name = 6; + * + * @return The bytes for optimizeDatabaseOperationName. + */ + public com.google.protobuf.ByteString getOptimizeDatabaseOperationNameBytes() { + java.lang.Object ref = optimizeDatabaseOperationName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + optimizeDatabaseOperationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (sourceType_ + != com.google.spanner.admin.database.v1.RestoreSourceType.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, sourceType_); + } + if (sourceInfoCase_ == 3) { + output.writeMessage(3, (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_); + } + if (progress_ != null) { + output.writeMessage(4, getProgress()); + } + if (cancelTime_ != null) { + output.writeMessage(5, getCancelTime()); + } + if (!getOptimizeDatabaseOperationNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, optimizeDatabaseOperationName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (sourceType_ + != com.google.spanner.admin.database.v1.RestoreSourceType.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, sourceType_); + } + if (sourceInfoCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_); + } + if (progress_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getProgress()); + } + if (cancelTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCancelTime()); + } + if (!getOptimizeDatabaseOperationNameBytes().isEmpty()) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 6, optimizeDatabaseOperationName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.RestoreDatabaseMetadata)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata other = + (com.google.spanner.admin.database.v1.RestoreDatabaseMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (sourceType_ != other.sourceType_) return false; + if (hasProgress() != other.hasProgress()) return false; + if (hasProgress()) { + if (!getProgress().equals(other.getProgress())) return false; + } + if (hasCancelTime() != other.hasCancelTime()) return false; + if (hasCancelTime()) { + if (!getCancelTime().equals(other.getCancelTime())) return false; + } + if (!getOptimizeDatabaseOperationName().equals(other.getOptimizeDatabaseOperationName())) + return false; + if (!getSourceInfoCase().equals(other.getSourceInfoCase())) return false; + switch (sourceInfoCase_) { + case 3: + if (!getBackupInfo().equals(other.getBackupInfo())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + sourceType_; + if (hasProgress()) { + hash = (37 * hash) + PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getProgress().hashCode(); + } + if (hasCancelTime()) { + hash = (37 * hash) + CANCEL_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCancelTime().hashCode(); + } + hash = (37 * hash) + OPTIMIZE_DATABASE_OPERATION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOptimizeDatabaseOperationName().hashCode(); + switch (sourceInfoCase_) { + case 3: + hash = (37 * hash) + BACKUP_INFO_FIELD_NUMBER; + hash = (53 * hash) + getBackupInfo().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata type for the long-running operation returned by
+   * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.RestoreDatabaseMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.RestoreDatabaseMetadata) + com.google.spanner.admin.database.v1.RestoreDatabaseMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata.class, + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.RestoreDatabaseMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + sourceType_ = 0; + + if (progressBuilder_ == null) { + progress_ = null; + } else { + progress_ = null; + progressBuilder_ = null; + } + if (cancelTimeBuilder_ == null) { + cancelTime_ = null; + } else { + cancelTime_ = null; + cancelTimeBuilder_ = null; + } + optimizeDatabaseOperationName_ = ""; + + sourceInfoCase_ = 0; + sourceInfo_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreDatabaseMetadata + getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.RestoreDatabaseMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreDatabaseMetadata build() { + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreDatabaseMetadata buildPartial() { + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata result = + new com.google.spanner.admin.database.v1.RestoreDatabaseMetadata(this); + result.name_ = name_; + result.sourceType_ = sourceType_; + if (sourceInfoCase_ == 3) { + if (backupInfoBuilder_ == null) { + result.sourceInfo_ = sourceInfo_; + } else { + result.sourceInfo_ = backupInfoBuilder_.build(); + } + } + if (progressBuilder_ == null) { + result.progress_ = progress_; + } else { + result.progress_ = progressBuilder_.build(); + } + if (cancelTimeBuilder_ == null) { + result.cancelTime_ = cancelTime_; + } else { + result.cancelTime_ = cancelTimeBuilder_.build(); + } + result.optimizeDatabaseOperationName_ = optimizeDatabaseOperationName_; + result.sourceInfoCase_ = sourceInfoCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.RestoreDatabaseMetadata) { + return mergeFrom((com.google.spanner.admin.database.v1.RestoreDatabaseMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.RestoreDatabaseMetadata other) { + if (other + == com.google.spanner.admin.database.v1.RestoreDatabaseMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.sourceType_ != 0) { + setSourceTypeValue(other.getSourceTypeValue()); + } + if (other.hasProgress()) { + mergeProgress(other.getProgress()); + } + if (other.hasCancelTime()) { + mergeCancelTime(other.getCancelTime()); + } + if (!other.getOptimizeDatabaseOperationName().isEmpty()) { + optimizeDatabaseOperationName_ = other.optimizeDatabaseOperationName_; + onChanged(); + } + switch (other.getSourceInfoCase()) { + case BACKUP_INFO: + { + mergeBackupInfo(other.getBackupInfo()); + break; + } + case SOURCEINFO_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.RestoreDatabaseMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.RestoreDatabaseMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceInfoCase_ = 0; + private java.lang.Object sourceInfo_; + + public SourceInfoCase getSourceInfoCase() { + return SourceInfoCase.forNumber(sourceInfoCase_); + } + + public Builder clearSourceInfo() { + sourceInfoCase_ = 0; + sourceInfo_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the database being created and restored to.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the database being created and restored to.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the database being created and restored to.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the database being created and restored to.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the database being created and restored to.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int sourceType_ = 0; + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @return The enum numeric value on the wire for sourceType. + */ + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @param value The enum numeric value on the wire for sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceTypeValue(int value) { + sourceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @return The sourceType. + */ + public com.google.spanner.admin.database.v1.RestoreSourceType getSourceType() { + @SuppressWarnings("deprecation") + com.google.spanner.admin.database.v1.RestoreSourceType result = + com.google.spanner.admin.database.v1.RestoreSourceType.valueOf(sourceType_); + return result == null + ? com.google.spanner.admin.database.v1.RestoreSourceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @param value The sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceType(com.google.spanner.admin.database.v1.RestoreSourceType value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearSourceType() { + + sourceType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupInfo, + com.google.spanner.admin.database.v1.BackupInfo.Builder, + com.google.spanner.admin.database.v1.BackupInfoOrBuilder> + backupInfoBuilder_; + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + * + * @return Whether the backupInfo field is set. + */ + public boolean hasBackupInfo() { + return sourceInfoCase_ == 3; + } + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + * + * @return The backupInfo. + */ + public com.google.spanner.admin.database.v1.BackupInfo getBackupInfo() { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 3) { + return (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_; + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } else { + if (sourceInfoCase_ == 3) { + return backupInfoBuilder_.getMessage(); + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + } + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + public Builder setBackupInfo(com.google.spanner.admin.database.v1.BackupInfo value) { + if (backupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInfo_ = value; + onChanged(); + } else { + backupInfoBuilder_.setMessage(value); + } + sourceInfoCase_ = 3; + return this; + } + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + public Builder setBackupInfo( + com.google.spanner.admin.database.v1.BackupInfo.Builder builderForValue) { + if (backupInfoBuilder_ == null) { + sourceInfo_ = builderForValue.build(); + onChanged(); + } else { + backupInfoBuilder_.setMessage(builderForValue.build()); + } + sourceInfoCase_ = 3; + return this; + } + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + public Builder mergeBackupInfo(com.google.spanner.admin.database.v1.BackupInfo value) { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 3 + && sourceInfo_ + != com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance()) { + sourceInfo_ = + com.google.spanner.admin.database.v1.BackupInfo.newBuilder( + (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceInfo_ = value; + } + onChanged(); + } else { + if (sourceInfoCase_ == 3) { + backupInfoBuilder_.mergeFrom(value); + } + backupInfoBuilder_.setMessage(value); + } + sourceInfoCase_ = 3; + return this; + } + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + public Builder clearBackupInfo() { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 3) { + sourceInfoCase_ = 0; + sourceInfo_ = null; + onChanged(); + } + } else { + if (sourceInfoCase_ == 3) { + sourceInfoCase_ = 0; + sourceInfo_ = null; + } + backupInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + public com.google.spanner.admin.database.v1.BackupInfo.Builder getBackupInfoBuilder() { + return getBackupInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + public com.google.spanner.admin.database.v1.BackupInfoOrBuilder getBackupInfoOrBuilder() { + if ((sourceInfoCase_ == 3) && (backupInfoBuilder_ != null)) { + return backupInfoBuilder_.getMessageOrBuilder(); + } else { + if (sourceInfoCase_ == 3) { + return (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_; + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + } + /** + * + * + *
+     * Information about the backup used to restore the database.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupInfo, + com.google.spanner.admin.database.v1.BackupInfo.Builder, + com.google.spanner.admin.database.v1.BackupInfoOrBuilder> + getBackupInfoFieldBuilder() { + if (backupInfoBuilder_ == null) { + if (!(sourceInfoCase_ == 3)) { + sourceInfo_ = com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + backupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupInfo, + com.google.spanner.admin.database.v1.BackupInfo.Builder, + com.google.spanner.admin.database.v1.BackupInfoOrBuilder>( + (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_, + getParentForChildren(), + isClean()); + sourceInfo_ = null; + } + sourceInfoCase_ = 3; + onChanged(); + ; + return backupInfoBuilder_; + } + + private com.google.spanner.admin.database.v1.OperationProgress progress_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder> + progressBuilder_; + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return progressBuilder_ != null || progress_ != null; + } + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + * + * @return The progress. + */ + public com.google.spanner.admin.database.v1.OperationProgress getProgress() { + if (progressBuilder_ == null) { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } else { + return progressBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + public Builder setProgress(com.google.spanner.admin.database.v1.OperationProgress value) { + if (progressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progress_ = value; + onChanged(); + } else { + progressBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + public Builder setProgress( + com.google.spanner.admin.database.v1.OperationProgress.Builder builderForValue) { + if (progressBuilder_ == null) { + progress_ = builderForValue.build(); + onChanged(); + } else { + progressBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + public Builder mergeProgress(com.google.spanner.admin.database.v1.OperationProgress value) { + if (progressBuilder_ == null) { + if (progress_ != null) { + progress_ = + com.google.spanner.admin.database.v1.OperationProgress.newBuilder(progress_) + .mergeFrom(value) + .buildPartial(); + } else { + progress_ = value; + } + onChanged(); + } else { + progressBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + public Builder clearProgress() { + if (progressBuilder_ == null) { + progress_ = null; + onChanged(); + } else { + progress_ = null; + progressBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + public com.google.spanner.admin.database.v1.OperationProgress.Builder getProgressBuilder() { + + onChanged(); + return getProgressFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + public com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder() { + if (progressBuilder_ != null) { + return progressBuilder_.getMessageOrBuilder(); + } else { + return progress_ == null + ? com.google.spanner.admin.database.v1.OperationProgress.getDefaultInstance() + : progress_; + } + } + /** + * + * + *
+     * The progress of the
+     * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+     * operation.
+     * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder> + getProgressFieldBuilder() { + if (progressBuilder_ == null) { + progressBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.OperationProgress, + com.google.spanner.admin.database.v1.OperationProgress.Builder, + com.google.spanner.admin.database.v1.OperationProgressOrBuilder>( + getProgress(), getParentForChildren(), isClean()); + progress_ = null; + } + return progressBuilder_; + } + + private com.google.protobuf.Timestamp cancelTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + cancelTimeBuilder_; + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + * + * @return Whether the cancelTime field is set. + */ + public boolean hasCancelTime() { + return cancelTimeBuilder_ != null || cancelTime_ != null; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + * + * @return The cancelTime. + */ + public com.google.protobuf.Timestamp getCancelTime() { + if (cancelTimeBuilder_ == null) { + return cancelTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : cancelTime_; + } else { + return cancelTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + public Builder setCancelTime(com.google.protobuf.Timestamp value) { + if (cancelTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cancelTime_ = value; + onChanged(); + } else { + cancelTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + public Builder setCancelTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (cancelTimeBuilder_ == null) { + cancelTime_ = builderForValue.build(); + onChanged(); + } else { + cancelTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + public Builder mergeCancelTime(com.google.protobuf.Timestamp value) { + if (cancelTimeBuilder_ == null) { + if (cancelTime_ != null) { + cancelTime_ = + com.google.protobuf.Timestamp.newBuilder(cancelTime_).mergeFrom(value).buildPartial(); + } else { + cancelTime_ = value; + } + onChanged(); + } else { + cancelTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + public Builder clearCancelTime() { + if (cancelTimeBuilder_ == null) { + cancelTime_ = null; + onChanged(); + } else { + cancelTime_ = null; + cancelTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getCancelTimeBuilder() { + + onChanged(); + return getCancelTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCancelTimeOrBuilder() { + if (cancelTimeBuilder_ != null) { + return cancelTimeBuilder_.getMessageOrBuilder(); + } else { + return cancelTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : cancelTime_; + } + } + /** + * + * + *
+     * The time at which cancellation of this operation was received.
+     * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+     * starts asynchronous cancellation on a long-running operation. The server
+     * makes a best effort to cancel the operation, but success is not guaranteed.
+     * Clients can use
+     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+     * other methods to check whether the cancellation succeeded or whether the
+     * operation completed despite cancellation. On successful cancellation,
+     * the operation is not deleted; instead, it becomes an operation with
+     * an [Operation.error][google.longrunning.Operation.error] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+     * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCancelTimeFieldBuilder() { + if (cancelTimeBuilder_ == null) { + cancelTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCancelTime(), getParentForChildren(), isClean()); + cancelTime_ = null; + } + return cancelTimeBuilder_; + } + + private java.lang.Object optimizeDatabaseOperationName_ = ""; + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored database, and remove the dependency on the restore source.
+     * The name is of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+     * where the <database> is the name of database being created and restored to.
+     * The metadata type of the  long-running operation is
+     * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+     * automatically created by the system after the RestoreDatabase long-running
+     * operation completes successfully. This operation will not be created if the
+     * restore was not successful.
+     * 
+ * + * string optimize_database_operation_name = 6; + * + * @return The optimizeDatabaseOperationName. + */ + public java.lang.String getOptimizeDatabaseOperationName() { + java.lang.Object ref = optimizeDatabaseOperationName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + optimizeDatabaseOperationName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored database, and remove the dependency on the restore source.
+     * The name is of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+     * where the <database> is the name of database being created and restored to.
+     * The metadata type of the  long-running operation is
+     * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+     * automatically created by the system after the RestoreDatabase long-running
+     * operation completes successfully. This operation will not be created if the
+     * restore was not successful.
+     * 
+ * + * string optimize_database_operation_name = 6; + * + * @return The bytes for optimizeDatabaseOperationName. + */ + public com.google.protobuf.ByteString getOptimizeDatabaseOperationNameBytes() { + java.lang.Object ref = optimizeDatabaseOperationName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + optimizeDatabaseOperationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored database, and remove the dependency on the restore source.
+     * The name is of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+     * where the <database> is the name of database being created and restored to.
+     * The metadata type of the  long-running operation is
+     * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+     * automatically created by the system after the RestoreDatabase long-running
+     * operation completes successfully. This operation will not be created if the
+     * restore was not successful.
+     * 
+ * + * string optimize_database_operation_name = 6; + * + * @param value The optimizeDatabaseOperationName to set. + * @return This builder for chaining. + */ + public Builder setOptimizeDatabaseOperationName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + optimizeDatabaseOperationName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored database, and remove the dependency on the restore source.
+     * The name is of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+     * where the <database> is the name of database being created and restored to.
+     * The metadata type of the  long-running operation is
+     * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+     * automatically created by the system after the RestoreDatabase long-running
+     * operation completes successfully. This operation will not be created if the
+     * restore was not successful.
+     * 
+ * + * string optimize_database_operation_name = 6; + * + * @return This builder for chaining. + */ + public Builder clearOptimizeDatabaseOperationName() { + + optimizeDatabaseOperationName_ = getDefaultInstance().getOptimizeDatabaseOperationName(); + onChanged(); + return this; + } + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored database, and remove the dependency on the restore source.
+     * The name is of the form
+     * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+     * where the <database> is the name of database being created and restored to.
+     * The metadata type of the  long-running operation is
+     * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+     * automatically created by the system after the RestoreDatabase long-running
+     * operation completes successfully. This operation will not be created if the
+     * restore was not successful.
+     * 
+ * + * string optimize_database_operation_name = 6; + * + * @param value The bytes for optimizeDatabaseOperationName to set. + * @return This builder for chaining. + */ + public Builder setOptimizeDatabaseOperationNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + optimizeDatabaseOperationName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.RestoreDatabaseMetadata) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.RestoreDatabaseMetadata) + private static final com.google.spanner.admin.database.v1.RestoreDatabaseMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.RestoreDatabaseMetadata(); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreDatabaseMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RestoreDatabaseMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreDatabaseMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java new file mode 100644 index 0000000000..8d05e8b6b7 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java @@ -0,0 +1,264 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +public interface RestoreDatabaseMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.RestoreDatabaseMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the database being created and restored to.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the database being created and restored to.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @return The enum numeric value on the wire for sourceType. + */ + int getSourceTypeValue(); + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 2; + * + * @return The sourceType. + */ + com.google.spanner.admin.database.v1.RestoreSourceType getSourceType(); + + /** + * + * + *
+   * Information about the backup used to restore the database.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + * + * @return Whether the backupInfo field is set. + */ + boolean hasBackupInfo(); + /** + * + * + *
+   * Information about the backup used to restore the database.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + * + * @return The backupInfo. + */ + com.google.spanner.admin.database.v1.BackupInfo getBackupInfo(); + /** + * + * + *
+   * Information about the backup used to restore the database.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 3; + */ + com.google.spanner.admin.database.v1.BackupInfoOrBuilder getBackupInfoOrBuilder(); + + /** + * + * + *
+   * The progress of the
+   * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+   * operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + * + * @return Whether the progress field is set. + */ + boolean hasProgress(); + /** + * + * + *
+   * The progress of the
+   * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+   * operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + * + * @return The progress. + */ + com.google.spanner.admin.database.v1.OperationProgress getProgress(); + /** + * + * + *
+   * The progress of the
+   * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
+   * operation.
+   * 
+ * + * .google.spanner.admin.database.v1.OperationProgress progress = 4; + */ + com.google.spanner.admin.database.v1.OperationProgressOrBuilder getProgressOrBuilder(); + + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][google.longrunning.Operation.error] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + * + * @return Whether the cancelTime field is set. + */ + boolean hasCancelTime(); + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][google.longrunning.Operation.error] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + * + * @return The cancelTime. + */ + com.google.protobuf.Timestamp getCancelTime(); + /** + * + * + *
+   * The time at which cancellation of this operation was received.
+   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
+   * starts asynchronous cancellation on a long-running operation. The server
+   * makes a best effort to cancel the operation, but success is not guaranteed.
+   * Clients can use
+   * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
+   * other methods to check whether the cancellation succeeded or whether the
+   * operation completed despite cancellation. On successful cancellation,
+   * the operation is not deleted; instead, it becomes an operation with
+   * an [Operation.error][google.longrunning.Operation.error] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
+   * 
+ * + * .google.protobuf.Timestamp cancel_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getCancelTimeOrBuilder(); + + /** + * + * + *
+   * If exists, the name of the long-running operation that will be used to
+   * track the post-restore optimization process to optimize the performance of
+   * the restored database, and remove the dependency on the restore source.
+   * The name is of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+   * where the <database> is the name of database being created and restored to.
+   * The metadata type of the  long-running operation is
+   * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+   * automatically created by the system after the RestoreDatabase long-running
+   * operation completes successfully. This operation will not be created if the
+   * restore was not successful.
+   * 
+ * + * string optimize_database_operation_name = 6; + * + * @return The optimizeDatabaseOperationName. + */ + java.lang.String getOptimizeDatabaseOperationName(); + /** + * + * + *
+   * If exists, the name of the long-running operation that will be used to
+   * track the post-restore optimization process to optimize the performance of
+   * the restored database, and remove the dependency on the restore source.
+   * The name is of the form
+   * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
+   * where the <database> is the name of database being created and restored to.
+   * The metadata type of the  long-running operation is
+   * [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
+   * automatically created by the system after the RestoreDatabase long-running
+   * operation completes successfully. This operation will not be created if the
+   * restore was not successful.
+   * 
+ * + * string optimize_database_operation_name = 6; + * + * @return The bytes for optimizeDatabaseOperationName. + */ + com.google.protobuf.ByteString getOptimizeDatabaseOperationNameBytes(); + + public com.google.spanner.admin.database.v1.RestoreDatabaseMetadata.SourceInfoCase + getSourceInfoCase(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequest.java new file mode 100644 index 0000000000..16894b794d --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequest.java @@ -0,0 +1,1163 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for
+ * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.RestoreDatabaseRequest} + */ +public final class RestoreDatabaseRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.RestoreDatabaseRequest) + RestoreDatabaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreDatabaseRequest.newBuilder() to construct. + private RestoreDatabaseRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreDatabaseRequest() { + parent_ = ""; + databaseId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreDatabaseRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RestoreDatabaseRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + databaseId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 3; + source_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.RestoreDatabaseRequest.class, + com.google.spanner.admin.database.v1.RestoreDatabaseRequest.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP(3), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 3: + return BACKUP; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * 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>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * 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>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object databaseId_; + /** + * + * + *
+   * 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>`.
+   * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The databaseId. + */ + public java.lang.String getDatabaseId() { + java.lang.Object ref = databaseId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseId_ = s; + return s; + } + } + /** + * + * + *
+   * 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>`.
+   * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for databaseId. + */ + public com.google.protobuf.ByteString getDatabaseIdBytes() { + java.lang.Object ref = databaseId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 3; + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + public java.lang.String getBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 3) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 3) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getDatabaseIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, databaseId_); + } + if (sourceCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getDatabaseIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, databaseId_); + } + if (sourceCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, source_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.RestoreDatabaseRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.RestoreDatabaseRequest other = + (com.google.spanner.admin.database.v1.RestoreDatabaseRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getDatabaseId().equals(other.getDatabaseId())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 3: + if (!getBackup().equals(other.getBackup())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + DATABASE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseId().hashCode(); + switch (sourceCase_) { + case 3: + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.RestoreDatabaseRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for
+   * [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.RestoreDatabaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.RestoreDatabaseRequest) + com.google.spanner.admin.database.v1.RestoreDatabaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.RestoreDatabaseRequest.class, + com.google.spanner.admin.database.v1.RestoreDatabaseRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.RestoreDatabaseRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + databaseId_ = ""; + + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreDatabaseRequest getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.RestoreDatabaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreDatabaseRequest build() { + com.google.spanner.admin.database.v1.RestoreDatabaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreDatabaseRequest buildPartial() { + com.google.spanner.admin.database.v1.RestoreDatabaseRequest result = + new com.google.spanner.admin.database.v1.RestoreDatabaseRequest(this); + result.parent_ = parent_; + result.databaseId_ = databaseId_; + if (sourceCase_ == 3) { + result.source_ = source_; + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.RestoreDatabaseRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.RestoreDatabaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.RestoreDatabaseRequest other) { + if (other == com.google.spanner.admin.database.v1.RestoreDatabaseRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getDatabaseId().isEmpty()) { + databaseId_ = other.databaseId_; + onChanged(); + } + switch (other.getSourceCase()) { + case BACKUP: + { + sourceCase_ = 3; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.RestoreDatabaseRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.RestoreDatabaseRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object databaseId_ = ""; + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The databaseId. + */ + public java.lang.String getDatabaseId() { + java.lang.Object ref = databaseId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for databaseId. + */ + public com.google.protobuf.ByteString getDatabaseIdBytes() { + java.lang.Object ref = databaseId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The databaseId to set. + * @return This builder for chaining. + */ + public Builder setDatabaseId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + databaseId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseId() { + + databaseId_ = getDefaultInstance().getDatabaseId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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>`.
+     * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for databaseId to set. + * @return This builder for chaining. + */ + public Builder setDatabaseIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + databaseId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + public java.lang.String getBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 3) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 3) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The backup to set. + * @return This builder for chaining. + */ + public Builder setBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 3; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBackup() { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for backup to set. + * @return This builder for chaining. + */ + public Builder setBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 3; + source_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.RestoreDatabaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.RestoreDatabaseRequest) + private static final com.google.spanner.admin.database.v1.RestoreDatabaseRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.RestoreDatabaseRequest(); + } + + public static com.google.spanner.admin.database.v1.RestoreDatabaseRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreDatabaseRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RestoreDatabaseRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreDatabaseRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequestOrBuilder.java new file mode 100644 index 0000000000..98e6ad0e61 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequestOrBuilder.java @@ -0,0 +1,122 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +public interface RestoreDatabaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.RestoreDatabaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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>`.
+   * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The databaseId. + */ + java.lang.String getDatabaseId(); + /** + * + * + *
+   * 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>`.
+   * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for databaseId. + */ + com.google.protobuf.ByteString getDatabaseIdBytes(); + + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + java.lang.String getBackup(); + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + com.google.protobuf.ByteString getBackupBytes(); + + public com.google.spanner.admin.database.v1.RestoreDatabaseRequest.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfo.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfo.java new file mode 100644 index 0000000000..e6698baf64 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfo.java @@ -0,0 +1,994 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * Information about the database restore.
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.RestoreInfo} + */ +public final class RestoreInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.RestoreInfo) + RestoreInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestoreInfo.newBuilder() to construct. + private RestoreInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestoreInfo() { + sourceType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RestoreInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + sourceType_ = rawValue; + break; + } + case 18: + { + com.google.spanner.admin.database.v1.BackupInfo.Builder subBuilder = null; + if (sourceInfoCase_ == 2) { + subBuilder = + ((com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_).toBuilder(); + } + sourceInfo_ = + input.readMessage( + com.google.spanner.admin.database.v1.BackupInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_); + sourceInfo_ = subBuilder.buildPartial(); + } + sourceInfoCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.RestoreInfo.class, + com.google.spanner.admin.database.v1.RestoreInfo.Builder.class); + } + + private int sourceInfoCase_ = 0; + private java.lang.Object sourceInfo_; + + public enum SourceInfoCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_INFO(2), + SOURCEINFO_NOT_SET(0); + private final int value; + + private SourceInfoCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceInfoCase valueOf(int value) { + return forNumber(value); + } + + public static SourceInfoCase forNumber(int value) { + switch (value) { + case 2: + return BACKUP_INFO; + case 0: + return SOURCEINFO_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceInfoCase getSourceInfoCase() { + return SourceInfoCase.forNumber(sourceInfoCase_); + } + + public static final int SOURCE_TYPE_FIELD_NUMBER = 1; + private int sourceType_; + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @return The enum numeric value on the wire for sourceType. + */ + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @return The sourceType. + */ + public com.google.spanner.admin.database.v1.RestoreSourceType getSourceType() { + @SuppressWarnings("deprecation") + com.google.spanner.admin.database.v1.RestoreSourceType result = + com.google.spanner.admin.database.v1.RestoreSourceType.valueOf(sourceType_); + return result == null + ? com.google.spanner.admin.database.v1.RestoreSourceType.UNRECOGNIZED + : result; + } + + public static final int BACKUP_INFO_FIELD_NUMBER = 2; + /** + * + * + *
+   * Information about the backup used to restore the database. The backup
+   * may no longer exist.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + * + * @return Whether the backupInfo field is set. + */ + public boolean hasBackupInfo() { + return sourceInfoCase_ == 2; + } + /** + * + * + *
+   * Information about the backup used to restore the database. The backup
+   * may no longer exist.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + * + * @return The backupInfo. + */ + public com.google.spanner.admin.database.v1.BackupInfo getBackupInfo() { + if (sourceInfoCase_ == 2) { + return (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_; + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + /** + * + * + *
+   * Information about the backup used to restore the database. The backup
+   * may no longer exist.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + public com.google.spanner.admin.database.v1.BackupInfoOrBuilder getBackupInfoOrBuilder() { + if (sourceInfoCase_ == 2) { + return (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_; + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceType_ + != com.google.spanner.admin.database.v1.RestoreSourceType.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, sourceType_); + } + if (sourceInfoCase_ == 2) { + output.writeMessage(2, (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceType_ + != com.google.spanner.admin.database.v1.RestoreSourceType.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, sourceType_); + } + if (sourceInfoCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.RestoreInfo)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.RestoreInfo other = + (com.google.spanner.admin.database.v1.RestoreInfo) obj; + + if (sourceType_ != other.sourceType_) return false; + if (!getSourceInfoCase().equals(other.getSourceInfoCase())) return false; + switch (sourceInfoCase_) { + case 2: + if (!getBackupInfo().equals(other.getBackupInfo())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + sourceType_; + switch (sourceInfoCase_) { + case 2: + hash = (37 * hash) + BACKUP_INFO_FIELD_NUMBER; + hash = (53 * hash) + getBackupInfo().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.admin.database.v1.RestoreInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information about the database restore.
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.RestoreInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.RestoreInfo) + com.google.spanner.admin.database.v1.RestoreInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.RestoreInfo.class, + com.google.spanner.admin.database.v1.RestoreInfo.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.RestoreInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sourceType_ = 0; + + sourceInfoCase_ = 0; + sourceInfo_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto + .internal_static_google_spanner_admin_database_v1_RestoreInfo_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreInfo getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.RestoreInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreInfo build() { + com.google.spanner.admin.database.v1.RestoreInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreInfo buildPartial() { + com.google.spanner.admin.database.v1.RestoreInfo result = + new com.google.spanner.admin.database.v1.RestoreInfo(this); + result.sourceType_ = sourceType_; + if (sourceInfoCase_ == 2) { + if (backupInfoBuilder_ == null) { + result.sourceInfo_ = sourceInfo_; + } else { + result.sourceInfo_ = backupInfoBuilder_.build(); + } + } + result.sourceInfoCase_ = sourceInfoCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.RestoreInfo) { + return mergeFrom((com.google.spanner.admin.database.v1.RestoreInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.RestoreInfo other) { + if (other == com.google.spanner.admin.database.v1.RestoreInfo.getDefaultInstance()) + return this; + if (other.sourceType_ != 0) { + setSourceTypeValue(other.getSourceTypeValue()); + } + switch (other.getSourceInfoCase()) { + case BACKUP_INFO: + { + mergeBackupInfo(other.getBackupInfo()); + break; + } + case SOURCEINFO_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.RestoreInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.spanner.admin.database.v1.RestoreInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceInfoCase_ = 0; + private java.lang.Object sourceInfo_; + + public SourceInfoCase getSourceInfoCase() { + return SourceInfoCase.forNumber(sourceInfoCase_); + } + + public Builder clearSourceInfo() { + sourceInfoCase_ = 0; + sourceInfo_ = null; + onChanged(); + return this; + } + + private int sourceType_ = 0; + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @return The enum numeric value on the wire for sourceType. + */ + public int getSourceTypeValue() { + return sourceType_; + } + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @param value The enum numeric value on the wire for sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceTypeValue(int value) { + sourceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @return The sourceType. + */ + public com.google.spanner.admin.database.v1.RestoreSourceType getSourceType() { + @SuppressWarnings("deprecation") + com.google.spanner.admin.database.v1.RestoreSourceType result = + com.google.spanner.admin.database.v1.RestoreSourceType.valueOf(sourceType_); + return result == null + ? com.google.spanner.admin.database.v1.RestoreSourceType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @param value The sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceType(com.google.spanner.admin.database.v1.RestoreSourceType value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearSourceType() { + + sourceType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupInfo, + com.google.spanner.admin.database.v1.BackupInfo.Builder, + com.google.spanner.admin.database.v1.BackupInfoOrBuilder> + backupInfoBuilder_; + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + * + * @return Whether the backupInfo field is set. + */ + public boolean hasBackupInfo() { + return sourceInfoCase_ == 2; + } + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + * + * @return The backupInfo. + */ + public com.google.spanner.admin.database.v1.BackupInfo getBackupInfo() { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 2) { + return (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_; + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } else { + if (sourceInfoCase_ == 2) { + return backupInfoBuilder_.getMessage(); + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + } + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + public Builder setBackupInfo(com.google.spanner.admin.database.v1.BackupInfo value) { + if (backupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInfo_ = value; + onChanged(); + } else { + backupInfoBuilder_.setMessage(value); + } + sourceInfoCase_ = 2; + return this; + } + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + public Builder setBackupInfo( + com.google.spanner.admin.database.v1.BackupInfo.Builder builderForValue) { + if (backupInfoBuilder_ == null) { + sourceInfo_ = builderForValue.build(); + onChanged(); + } else { + backupInfoBuilder_.setMessage(builderForValue.build()); + } + sourceInfoCase_ = 2; + return this; + } + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + public Builder mergeBackupInfo(com.google.spanner.admin.database.v1.BackupInfo value) { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 2 + && sourceInfo_ + != com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance()) { + sourceInfo_ = + com.google.spanner.admin.database.v1.BackupInfo.newBuilder( + (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceInfo_ = value; + } + onChanged(); + } else { + if (sourceInfoCase_ == 2) { + backupInfoBuilder_.mergeFrom(value); + } + backupInfoBuilder_.setMessage(value); + } + sourceInfoCase_ = 2; + return this; + } + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + public Builder clearBackupInfo() { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 2) { + sourceInfoCase_ = 0; + sourceInfo_ = null; + onChanged(); + } + } else { + if (sourceInfoCase_ == 2) { + sourceInfoCase_ = 0; + sourceInfo_ = null; + } + backupInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + public com.google.spanner.admin.database.v1.BackupInfo.Builder getBackupInfoBuilder() { + return getBackupInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + public com.google.spanner.admin.database.v1.BackupInfoOrBuilder getBackupInfoOrBuilder() { + if ((sourceInfoCase_ == 2) && (backupInfoBuilder_ != null)) { + return backupInfoBuilder_.getMessageOrBuilder(); + } else { + if (sourceInfoCase_ == 2) { + return (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_; + } + return com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + } + /** + * + * + *
+     * Information about the backup used to restore the database. The backup
+     * may no longer exist.
+     * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupInfo, + com.google.spanner.admin.database.v1.BackupInfo.Builder, + com.google.spanner.admin.database.v1.BackupInfoOrBuilder> + getBackupInfoFieldBuilder() { + if (backupInfoBuilder_ == null) { + if (!(sourceInfoCase_ == 2)) { + sourceInfo_ = com.google.spanner.admin.database.v1.BackupInfo.getDefaultInstance(); + } + backupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.BackupInfo, + com.google.spanner.admin.database.v1.BackupInfo.Builder, + com.google.spanner.admin.database.v1.BackupInfoOrBuilder>( + (com.google.spanner.admin.database.v1.BackupInfo) sourceInfo_, + getParentForChildren(), + isClean()); + sourceInfo_ = null; + } + sourceInfoCase_ = 2; + onChanged(); + ; + return backupInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.RestoreInfo) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.RestoreInfo) + private static final com.google.spanner.admin.database.v1.RestoreInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.RestoreInfo(); + } + + public static com.google.spanner.admin.database.v1.RestoreInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RestoreInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.RestoreInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfoOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfoOrBuilder.java new file mode 100644 index 0000000000..f1b55bcc5f --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfoOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +public interface RestoreInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.RestoreInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @return The enum numeric value on the wire for sourceType. + */ + int getSourceTypeValue(); + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.spanner.admin.database.v1.RestoreSourceType source_type = 1; + * + * @return The sourceType. + */ + com.google.spanner.admin.database.v1.RestoreSourceType getSourceType(); + + /** + * + * + *
+   * Information about the backup used to restore the database. The backup
+   * may no longer exist.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + * + * @return Whether the backupInfo field is set. + */ + boolean hasBackupInfo(); + /** + * + * + *
+   * Information about the backup used to restore the database. The backup
+   * may no longer exist.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + * + * @return The backupInfo. + */ + com.google.spanner.admin.database.v1.BackupInfo getBackupInfo(); + /** + * + * + *
+   * Information about the backup used to restore the database. The backup
+   * may no longer exist.
+   * 
+ * + * .google.spanner.admin.database.v1.BackupInfo backup_info = 2; + */ + com.google.spanner.admin.database.v1.BackupInfoOrBuilder getBackupInfoOrBuilder(); + + public com.google.spanner.admin.database.v1.RestoreInfo.SourceInfoCase getSourceInfoCase(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreSourceType.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreSourceType.java new file mode 100644 index 0000000000..49a8acb2f6 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreSourceType.java @@ -0,0 +1,154 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/spanner_database_admin.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * Indicates the type of the restore source.
+ * 
+ * + * Protobuf enum {@code google.spanner.admin.database.v1.RestoreSourceType} + */ +public enum RestoreSourceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No restore associated.
+   * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * A backup was used as the source of the restore.
+   * 
+ * + * BACKUP = 1; + */ + BACKUP(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No restore associated.
+   * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * A backup was used as the source of the restore.
+   * 
+ * + * BACKUP = 1; + */ + public static final int BACKUP_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RestoreSourceType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RestoreSourceType forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return BACKUP; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RestoreSourceType findValueByNumber(int number) { + return RestoreSourceType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RestoreSourceType[] VALUES = values(); + + public static RestoreSourceType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RestoreSourceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.admin.database.v1.RestoreSourceType) +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java index 5ef2b6da5e..910a1a9c13 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java @@ -27,6 +27,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_RestoreInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_RestoreInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_spanner_admin_database_v1_Database_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -71,6 +75,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_spanner_admin_database_v1_GetDatabaseDdlResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_spanner_admin_database_v1_GetDatabaseDdlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -89,102 +113,181 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "roto\032\032google/iam/v1/policy.proto\032#google" + "/longrunning/operations.proto\032\033google/pr" + "otobuf/empty.proto\032\037google/protobuf/time" - + "stamp.proto\"\366\001\n\010Database\022\014\n\004name\030\001 \001(\t\022?" - + "\n\005state\030\002 \001(\01620.google.spanner.admin.dat" - + "abase.v1.Database.State\"7\n\005State\022\025\n\021STAT" - + "E_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002" - + ":b\352A_\n\037spanner.googleapis.com/Database\022<" - + "projects/{project}/instances/{instance}/" - + "databases/{database}\"v\n\024ListDatabasesReq" - + "uest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.go" - + "ogleapis.com/Instance\022\021\n\tpage_size\030\003 \001(\005" - + "\022\022\n\npage_token\030\004 \001(\t\"o\n\025ListDatabasesRes" - + "ponse\022=\n\tdatabases\030\001 \003(\0132*.google.spanne" - + "r.admin.database.v1.Database\022\027\n\017next_pag" - + "e_token\030\002 \001(\t\"\211\001\n\025CreateDatabaseRequest\022" - + "7\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googlea" - + "pis.com/Instance\022\035\n\020create_statement\030\002 \001" - + "(\tB\003\340A\002\022\030\n\020extra_statements\030\003 \003(\t\"P\n\026Cre" - + "ateDatabaseMetadata\0226\n\010database\030\001 \001(\tB$\372" - + "A!\n\037spanner.googleapis.com/Database\"K\n\022G" - + "etDatabaseRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n" - + "\037spanner.googleapis.com/Database\"\204\001\n\030Upd" - + "ateDatabaseDdlRequest\0229\n\010database\030\001 \001(\tB" - + "\'\340A\002\372A!\n\037spanner.googleapis.com/Database" - + "\022\027\n\nstatements\030\002 \003(\tB\003\340A\002\022\024\n\014operation_i" - + "d\030\003 \001(\t\"\236\001\n\031UpdateDatabaseDdlMetadata\0226\n" - + "\010database\030\001 \001(\tB$\372A!\n\037spanner.googleapis" - + ".com/Database\022\022\n\nstatements\030\002 \003(\t\0225\n\021com" - + "mit_timestamps\030\003 \003(\0132\032.google.protobuf.T" - + "imestamp\"P\n\023DropDatabaseRequest\0229\n\010datab" - + "ase\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapis.co" - + "m/Database\"R\n\025GetDatabaseDdlRequest\0229\n\010d" - + "atabase\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapi" - + "s.com/Database\",\n\026GetDatabaseDdlResponse" - + "\022\022\n\nstatements\030\001 \003(\t2\255\021\n\rDatabaseAdmin\022\300" - + "\001\n\rListDatabases\0226.google.spanner.admin." - + "database.v1.ListDatabasesRequest\0327.googl" - + "e.spanner.admin.database.v1.ListDatabase" - + "sResponse\">\202\323\344\223\002/\022-/v1/{parent=projects/" - + "*/instances/*}/databases\332A\006parent\022\244\002\n\016Cr" - + "eateDatabase\0227.google.spanner.admin.data" - + "base.v1.CreateDatabaseRequest\032\035.google.l" - + "ongrunning.Operation\"\271\001\202\323\344\223\0022\"-/v1/{pare" - + "nt=projects/*/instances/*}/databases:\001*\332" - + "A\027parent,create_statement\312Ad\n)google.spa" - + "nner.admin.database.v1.Database\0227google." - + "spanner.admin.database.v1.CreateDatabase" - + "Metadata\022\255\001\n\013GetDatabase\0224.google.spanne" - + "r.admin.database.v1.GetDatabaseRequest\032*" - + ".google.spanner.admin.database.v1.Databa" - + "se\"<\202\323\344\223\002/\022-/v1/{name=projects/*/instanc" - + "es/*/databases/*}\332A\004name\022\235\002\n\021UpdateDatab" - + "aseDdl\022:.google.spanner.admin.database.v" - + "1.UpdateDatabaseDdlRequest\032\035.google.long" - + "running.Operation\"\254\001\202\323\344\223\002:25/v1/{databas" - + "e=projects/*/instances/*/databases/*}/dd" - + "l:\001*\332A\023database,statements\312AS\n\025google.pr" - + "otobuf.Empty\022:google.spanner.admin.datab" - + "ase.v1.UpdateDatabaseDdlMetadata\022\243\001\n\014Dro" - + "pDatabase\0225.google.spanner.admin.databas" - + "e.v1.DropDatabaseRequest\032\026.google.protob" - + "uf.Empty\"D\202\323\344\223\0023*1/v1/{database=projects" - + "/*/instances/*/databases/*}\332A\010database\022\315" - + "\001\n\016GetDatabaseDdl\0227.google.spanner.admin" - + ".database.v1.GetDatabaseDdlRequest\0328.goo" - + "gle.spanner.admin.database.v1.GetDatabas" - + "eDdlResponse\"H\202\323\344\223\0027\0225/v1/{database=proj" - + "ects/*/instances/*/databases/*}/ddl\332A\010da" - + "tabase\022\353\001\n\014SetIamPolicy\022\".google.iam.v1." - + "SetIamPolicyRequest\032\025.google.iam.v1.Poli" - + "cy\"\237\001\202\323\344\223\002\206\001\">/v1/{resource=projects/*/i" - + "nstances/*/databases/*}:setIamPolicy:\001*Z" - + "A\"/v1/{resource=projects/*/ins" - + "tances/*/databases/*}:getIamPolicy:\001*ZA\"" - + "\202\323\344\223\002/\022-/v1/{parent=projects" + + "/*/instances/*}/databases\332A\006parent\022\244\002\n\016C" + + "reateDatabase\0227.google.spanner.admin.dat" + + "abase.v1.CreateDatabaseRequest\032\035.google." + + "longrunning.Operation\"\271\001\202\323\344\223\0022\"-/v1/{par" + + "ent=projects/*/instances/*}/databases:\001*" + + "\332A\027parent,create_statement\312Ad\n)google.sp" + + "anner.admin.database.v1.Database\0227google" + + ".spanner.admin.database.v1.CreateDatabas" + + "eMetadata\022\255\001\n\013GetDatabase\0224.google.spann" + + "er.admin.database.v1.GetDatabaseRequest\032" + + "*.google.spanner.admin.database.v1.Datab" + + "ase\"<\202\323\344\223\002/\022-/v1/{name=projects/*/instan" + + "ces/*/databases/*}\332A\004name\022\235\002\n\021UpdateData" + + "baseDdl\022:.google.spanner.admin.database." + + "v1.UpdateDatabaseDdlRequest\032\035.google.lon" + + "grunning.Operation\"\254\001\202\323\344\223\002:25/v1/{databa" + + "se=projects/*/instances/*/databases/*}/d" + + "dl:\001*\332A\023database,statements\312AS\n\025google.p" + + "rotobuf.Empty\022:google.spanner.admin.data" + + "base.v1.UpdateDatabaseDdlMetadata\022\243\001\n\014Dr" + + "opDatabase\0225.google.spanner.admin.databa" + + "se.v1.DropDatabaseRequest\032\026.google.proto" + + "buf.Empty\"D\202\323\344\223\0023*1/v1/{database=project" + + "s/*/instances/*/databases/*}\332A\010database\022" + + "\315\001\n\016GetDatabaseDdl\0227.google.spanner.admi" + + "n.database.v1.GetDatabaseDdlRequest\0328.go" + + "ogle.spanner.admin.database.v1.GetDataba" + + "seDdlResponse\"H\202\323\344\223\0027\0225/v1/{database=pro" + + "jects/*/instances/*/databases/*}/ddl\332A\010d" + + "atabase\022\353\001\n\014SetIamPolicy\022\".google.iam.v1" + + ".SetIamPolicyRequest\032\025.google.iam.v1.Pol" + + "icy\"\237\001\202\323\344\223\002\206\001\">/v1/{resource=projects/*/" + + "instances/*/databases/*}:setIamPolicy:\001*" + + "ZA\"/v1/{resource=projects/*/in" + + "stances/*/databases/*}:getIamPolicy:\001*ZA" + + "\".google.spanner.admin.database.v1.Lis" + + "tBackupOperationsResponse\"E\202\323\344\223\0026\0224/v1/{" + + "parent=projects/*/instances/*}/backupOpe" + + "rations\332A\006parent\032x\312A\026spanner.googleapis." + + "com\322A\\https://www.googleapis.com/auth/cl" + + "oud-platform,https://www.googleapis.com/" + + "auth/spanner.adminB\254\002\n$com.google.spanne" + + "r.admin.database.v1B\031SpannerDatabaseAdmi" + + "nProtoP\001ZHgoogle.golang.org/genproto/goo" + + "gleapis/spanner/admin/database/v1;databa" + + "se\252\002&Google.Cloud.Spanner.Admin.Database" + + ".V1\312\002&Google\\Cloud\\Spanner\\Admin\\Databas" + + "e\\V1\352AJ\n\037spanner.googleapis.com/Instance" + + "\022\'projects/{project}/instances/{instance" + + "}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -199,17 +302,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), + com.google.spanner.admin.database.v1.BackupProto.getDescriptor(), + com.google.spanner.admin.database.v1.CommonProto.getDescriptor(), }); - internal_static_google_spanner_admin_database_v1_Database_descriptor = + internal_static_google_spanner_admin_database_v1_RestoreInfo_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_spanner_admin_database_v1_RestoreInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_RestoreInfo_descriptor, + new java.lang.String[] { + "SourceType", "BackupInfo", "SourceInfo", + }); + internal_static_google_spanner_admin_database_v1_Database_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_google_spanner_admin_database_v1_Database_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_Database_descriptor, new java.lang.String[] { - "Name", "State", + "Name", "State", "CreateTime", "RestoreInfo", }); internal_static_google_spanner_admin_database_v1_ListDatabasesRequest_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(2); internal_static_google_spanner_admin_database_v1_ListDatabasesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_ListDatabasesRequest_descriptor, @@ -217,7 +330,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", }); internal_static_google_spanner_admin_database_v1_ListDatabasesResponse_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(3); internal_static_google_spanner_admin_database_v1_ListDatabasesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_ListDatabasesResponse_descriptor, @@ -225,7 +338,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Databases", "NextPageToken", }); internal_static_google_spanner_admin_database_v1_CreateDatabaseRequest_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(4); internal_static_google_spanner_admin_database_v1_CreateDatabaseRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_CreateDatabaseRequest_descriptor, @@ -233,7 +346,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "CreateStatement", "ExtraStatements", }); internal_static_google_spanner_admin_database_v1_CreateDatabaseMetadata_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_google_spanner_admin_database_v1_CreateDatabaseMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_CreateDatabaseMetadata_descriptor, @@ -241,7 +354,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Database", }); internal_static_google_spanner_admin_database_v1_GetDatabaseRequest_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_google_spanner_admin_database_v1_GetDatabaseRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_GetDatabaseRequest_descriptor, @@ -249,7 +362,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlRequest_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlRequest_descriptor, @@ -257,7 +370,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Database", "Statements", "OperationId", }); internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlMetadata_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(8); internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlMetadata_descriptor, @@ -265,7 +378,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Database", "Statements", "CommitTimestamps", }); internal_static_google_spanner_admin_database_v1_DropDatabaseRequest_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_google_spanner_admin_database_v1_DropDatabaseRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_DropDatabaseRequest_descriptor, @@ -273,7 +386,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Database", }); internal_static_google_spanner_admin_database_v1_GetDatabaseDdlRequest_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_google_spanner_admin_database_v1_GetDatabaseDdlRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_GetDatabaseDdlRequest_descriptor, @@ -281,13 +394,59 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Database", }); internal_static_google_spanner_admin_database_v1_GetDatabaseDdlResponse_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_google_spanner_admin_database_v1_GetDatabaseDdlResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_database_v1_GetDatabaseDdlResponse_descriptor, new java.lang.String[] { "Statements", }); + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_ListDatabaseOperationsResponse_descriptor, + new java.lang.String[] { + "Operations", "NextPageToken", + }); + internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_RestoreDatabaseRequest_descriptor, + new java.lang.String[] { + "Parent", "DatabaseId", "Backup", "Source", + }); + internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_RestoreDatabaseMetadata_descriptor, + new java.lang.String[] { + "Name", + "SourceType", + "BackupInfo", + "Progress", + "CancelTime", + "OptimizeDatabaseOperationName", + "SourceInfo", + }); + internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_database_v1_OptimizeRestoredDatabaseMetadata_descriptor, + new java.lang.String[] { + "Name", "Progress", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -310,6 +469,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); + com.google.spanner.admin.database.v1.BackupProto.getDescriptor(); + com.google.spanner.admin.database.v1.CommonProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequest.java new file mode 100644 index 0000000000..1ea632c0c7 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequest.java @@ -0,0 +1,1120 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +/** + * + * + *
+ * The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
+ * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.UpdateBackupRequest} + */ +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBackupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateBackupRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.spanner.admin.database.v1.Backup.Builder subBuilder = null; + if (backup_ != null) { + subBuilder = backup_.toBuilder(); + } + backup_ = + input.readMessage( + com.google.spanner.admin.database.v1.Backup.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(backup_); + backup_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.UpdateBackupRequest.class, + com.google.spanner.admin.database.v1.UpdateBackupRequest.Builder.class); + } + + public static final int BACKUP_FIELD_NUMBER = 1; + private com.google.spanner.admin.database.v1.Backup 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`.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return backup_ != null; + } + /** + * + * + *
+   * 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`.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.spanner.admin.database.v1.Backup getBackup() { + return backup_ == null + ? com.google.spanner.admin.database.v1.Backup.getDefaultInstance() + : 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`.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.BackupOrBuilder getBackupOrBuilder() { + return getBackup(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. A mask specifying which fields (e.g. `expire_time`) in the
+   * Backup resource should be updated. This mask is relative to the Backup
+   * resource, not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased accidentally
+   * by clients that do not know about them.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. A mask specifying which fields (e.g. `expire_time`) in the
+   * Backup resource should be updated. This mask is relative to the Backup
+   * resource, not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased accidentally
+   * by clients that do not know about them.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (backup_ != null) { + output.writeMessage(1, getBackup()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (backup_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackup()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.admin.database.v1.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.spanner.admin.database.v1.UpdateBackupRequest other = + (com.google.spanner.admin.database.v1.UpdateBackupRequest) obj; + + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.database.v1.UpdateBackupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
+   * 
+ * + * Protobuf type {@code google.spanner.admin.database.v1.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.UpdateBackupRequest) + com.google.spanner.admin.database.v1.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.database.v1.UpdateBackupRequest.class, + com.google.spanner.admin.database.v1.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.spanner.admin.database.v1.UpdateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (backupBuilder_ == null) { + backup_ = null; + } else { + backup_ = null; + backupBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.database.v1.BackupProto + .internal_static_google_spanner_admin_database_v1_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.spanner.admin.database.v1.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.UpdateBackupRequest build() { + com.google.spanner.admin.database.v1.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.UpdateBackupRequest buildPartial() { + com.google.spanner.admin.database.v1.UpdateBackupRequest result = + new com.google.spanner.admin.database.v1.UpdateBackupRequest(this); + if (backupBuilder_ == null) { + result.backup_ = backup_; + } else { + result.backup_ = backupBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.database.v1.UpdateBackupRequest) { + return mergeFrom((com.google.spanner.admin.database.v1.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.database.v1.UpdateBackupRequest other) { + if (other == com.google.spanner.admin.database.v1.UpdateBackupRequest.getDefaultInstance()) + return this; + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.spanner.admin.database.v1.UpdateBackupRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.spanner.admin.database.v1.UpdateBackupRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.spanner.admin.database.v1.Backup backup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder> + backupBuilder_; + /** + * + * + *
+     * 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return backupBuilder_ != null || backup_ != null; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.spanner.admin.database.v1.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null + ? com.google.spanner.admin.database.v1.Backup.getDefaultInstance() + : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.spanner.admin.database.v1.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + onChanged(); + } else { + backupBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.spanner.admin.database.v1.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + onChanged(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.spanner.admin.database.v1.Backup value) { + if (backupBuilder_ == null) { + if (backup_ != null) { + backup_ = + com.google.spanner.admin.database.v1.Backup.newBuilder(backup_) + .mergeFrom(value) + .buildPartial(); + } else { + backup_ = value; + } + onChanged(); + } else { + backupBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + if (backupBuilder_ == null) { + backup_ = null; + onChanged(); + } else { + backup_ = null; + backupBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.Backup.Builder getBackupBuilder() { + + onChanged(); + return getBackupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.spanner.admin.database.v1.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null + ? com.google.spanner.admin.database.v1.Backup.getDefaultInstance() + : 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`.
+     * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder> + getBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.database.v1.Backup, + com.google.spanner.admin.database.v1.Backup.Builder, + com.google.spanner.admin.database.v1.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.UpdateBackupRequest) + private static final com.google.spanner.admin.database.v1.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.UpdateBackupRequest(); + } + + public static com.google.spanner.admin.database.v1.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateBackupRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.database.v1.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequestOrBuilder.java new file mode 100644 index 0000000000..2fd0d8ae9b --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/admin/database/v1/backup.proto + +package com.google.spanner.admin.database.v1; + +public interface UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.database.v1.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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`.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + /** + * + * + *
+   * 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`.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.spanner.admin.database.v1.Backup getBackup(); + /** + * + * + *
+   * 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`.
+   * 
+ * + * + * .google.spanner.admin.database.v1.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.spanner.admin.database.v1.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto new file mode 100644 index 0000000000..d9b6fd74cd --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto @@ -0,0 +1,363 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/database/v1/common.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "google.golang.org/genproto/googleapis/spanner/admin/database/v1;database"; +option java_multiple_files = true; +option java_outer_classname = "BackupProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; + +// A backup of a Cloud Spanner database. +message Backup { + option (google.api.resource) = { + type: "spanner.googleapis.com/Backup" + pattern: "projects/{project}/instances/{instance}/backups/{backup}" + }; + + // Indicates the current state of the backup. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The pending backup is still being created. Operations on the + // backup may fail with `FAILED_PRECONDITION` in this state. + CREATING = 1; + + // The backup is complete and ready for use. + READY = 2; + } + + // Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. + // Name of the database from which this backup was + // created. This needs to be in the same instance as the backup. + // Values are of the form + // `projects//instances//databases/`. + string database = 2; + + // Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] + // operation. The expiration time of the backup, with microseconds + // granularity that must be at least 6 hours and at most 366 days + // from the time the CreateBackup request is processed. 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. + google.protobuf.Timestamp expire_time = 3; + + // Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. + // Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation. + // + // A globally unique identifier for the backup which cannot be + // changed. Values are of the form + // `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` + // The final segment of the name must be between 2 and 60 characters + // in length. + // + // The backup is stored in the location(s) specified in the instance + // configuration of the instance containing the backup, identified + // by the prefix of the backup name of the form + // `projects//instances/`. + string name = 1; + + // Output only. The backup will contain an externally consistent + // copy of the database at the timestamp specified by + // `create_time`. `create_time` is approximately the time the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Size of the backup in bytes. + int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the backup. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The names of the restored databases that reference the backup. + // The database names are of + // the form `projects//instances//databases/`. + // Referencing databases may exist in different instances. The existence of + // any referencing database prevents the backup from being deleted. When a + // restored database from the backup enters the `READY` state, the reference + // to the backup is removed. + repeated string referencing_databases = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. +message CreateBackupRequest { + // 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//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // Required. The id of the backup to be created. The `backup_id` appended to + // `parent` forms the full backup name of the form + // `projects//instances//backups/`. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The backup to create. + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the operation returned by +// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]. +message CreateBackupMetadata { + // The name of the backup being created. + string name = 1; + + // The name of the database the backup is created from. + string database = 2; + + // The progress of the + // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. + OperationProgress progress = 3; + + // The time at which cancellation of this operation was received. + // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] + // starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not guaranteed. + // Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + google.protobuf.Timestamp cancel_time = 4; +} + +// The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]. +message UpdateBackupRequest { + // 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`. + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup]. +message GetBackupRequest { + // Required. Name of the backup. + // Values are of the form + // `projects//instances//backups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Backup" + } + ]; +} + +// The request for [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup]. +message DeleteBackupRequest { + // Required. Name of the backup to delete. + // Values are of the form + // `projects//instances//backups/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Backup" + } + ]; +} + +// The request for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. +message ListBackupsRequest { + // Required. The instance to list backups from. Values are of the + // form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned backups. + // + // A filter expression consists of a field name, a comparison operator, and a + // value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering: + // + // * `name` + // * `database` + // * `state` + // * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `size_bytes` + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic, but + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `name:Howl` - The backup's name contains the string "howl". + // * `database:prod` + // - The database's name contains the string "prod". + // * `state:CREATING` - The backup is pending creation. + // * `state:READY` - The backup is fully created and ready for use. + // * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + // - The backup name contains the string "howl" and `create_time` + // of the backup is before 2018-03-28T14:50:00Z. + // * `expire_time < \"2018-03-28T14:50:00Z\"` + // - The backup `expire_time` is before 2018-03-28T14:50:00Z. + // * `size_bytes > 10000000000` - The backup's size is greater than 10GB + string filter = 2; + + // Number of backups to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a + // previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same + // `filter`. + string page_token = 4; +} + +// The response for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]. +message ListBackupsResponse { + // The list of matching backups. Backups returned are ordered by `create_time` + // in descending order, starting from the most recent `create_time`. + repeated Backup backups = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more + // of the matching backups. + string next_page_token = 2; +} + +// The request for +// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. +message ListBackupOperationsRequest { + // Required. The instance of the backup operations. Values are of + // the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned backup operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the [operation][google.longrunning.Operation] + // are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is + // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + // * `metadata.` - any field in metadata.value. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic, but + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `metadata.database:prod` - The database the backup was taken from has + // a name containing the string "prod". + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`
+ // `(metadata.name:howl) AND`
+ // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
+ // `(error:*)` - Returns operations where: + // * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + // * The backup name contains the string "howl". + // * The operation started before 2018-03-28T14:50:00Z. + // * The operation resulted in an error. + string filter = 2; + + // Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] + // from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the + // same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]. +message ListBackupOperationsResponse { + // The list of matching backup [long-running + // operations][google.longrunning.Operation]. Each operation's name will be + // prefixed by the backup's name and the operation's + // [metadata][google.longrunning.Operation.metadata] will be of type + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are + // pending or have completed/failed/canceled within the last 7 days. + // Operations returned are ordered by + // `operation.metadata.value.progress.start_time` in descending order starting + // from the most recently started operation. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; +} + +// Information about a backup. +message BackupInfo { + // Name of the backup. + string backup = 1; + + // The backup contains an externally consistent copy of `source_database` at + // the timestamp specified by `create_time`. + google.protobuf.Timestamp create_time = 2; + + // Name of the database the backup was created from. + string source_database = 3; +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/common.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/common.proto new file mode 100644 index 0000000000..4914cb8ac7 --- /dev/null +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/common.proto @@ -0,0 +1,43 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.admin.database.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; +option go_package = "google.golang.org/genproto/googleapis/spanner/admin/database/v1;database"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.spanner.admin.database.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1"; + +// Encapsulates progress related information for a Cloud Spanner long +// running operation. +message OperationProgress { + // Percent completion of the operation. + // Values are between 0 and 100 inclusive. + int32 progress_percent = 1; + + // Time the request was received. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation failed or was completed + // successfully. + google.protobuf.Timestamp end_time = 3; +} diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto index 5ee127d1ef..d48adc8aba 100644 --- a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto +++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto @@ -25,6 +25,8 @@ import "google/iam/v1/policy.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; +import "google/spanner/admin/database/v1/backup.proto"; +import "google/spanner/admin/database/v1/common.proto"; option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1"; option go_package = "google.golang.org/genproto/googleapis/spanner/admin/database/v1;database"; @@ -41,7 +43,8 @@ option (google.api.resource_definition) = { // // The Cloud Spanner Database Admin API can be used to create, drop, and // list databases. It also enables updating the schema of pre-existing -// databases. +// databases. It can be also used to create, delete and list backups for a +// database and to restore from an existing backup. service DatabaseAdmin { option (google.api.default_host) = "spanner.googleapis.com"; option (google.api.oauth_scopes) = @@ -104,6 +107,8 @@ service DatabaseAdmin { } // Drops (aka deletes) a Cloud Spanner database. + // Completed backups for the database will be retained according to their + // `expire_time`. rpc DropDatabase(DropDatabaseRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{database=projects/*/instances/*/databases/*}" @@ -121,11 +126,13 @@ service DatabaseAdmin { option (google.api.method_signature) = "database"; } - // Sets the access control policy on a database resource. + // Sets the access control policy on a database or backup resource. // Replaces any existing policy. // // Authorization requires `spanner.databases.setIamPolicy` // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + // For backups, authorization requires `spanner.backups.setIamPolicy` + // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy" @@ -138,12 +145,14 @@ service DatabaseAdmin { option (google.api.method_signature) = "resource,policy"; } - // Gets the access control policy for a database resource. - // Returns an empty policy if a database exists but does - // not have a policy set. + // 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][google.iam.v1.GetIamPolicyRequest.resource]. + // For backups, authorization requires `spanner.backups.getIamPolicy` + // permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy" @@ -156,12 +165,16 @@ service DatabaseAdmin { option (google.api.method_signature) = "resource"; } - // Returns permissions that the caller has on the specified database resource. + // 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. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions" @@ -173,6 +186,139 @@ service DatabaseAdmin { }; option (google.api.method_signature) = "resource,permissions"; } + + // Starts creating a new Cloud Spanner Backup. + // The returned backup [long-running operation][google.longrunning.Operation] + // will have a name of the format + // `projects//instances//backups//operations/` + // and can be used to track creation of the backup. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The + // [response][google.longrunning.Operation.response] field type is + // [Backup][google.spanner.admin.database.v1.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. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.spanner.admin.database.v1.CreateBackupMetadata" + }; + } + + // Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/instances/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/instances/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + } + + // Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. + rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/instances/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists completed and pending backups. + // Backups returned are ordered by `create_time` in descending order, + // starting from the most recent `create_time`. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // 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][google.longrunning.Operation] has a name of the format + // `projects//instances//databases//operations/`, + // and can be used to track the progress of the operation, and to cancel it. + // The [metadata][google.longrunning.Operation.metadata] field type is + // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] type + // is [Database][google.spanner.admin.database.v1.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. + rpc RestoreDatabase(RestoreDatabaseRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/instances/*}/databases:restore" + body: "*" + }; + option (google.api.method_signature) = "parent,database_id,backup"; + option (google.longrunning.operation_info) = { + response_type: "google.spanner.admin.database.v1.Database" + metadata_type: "google.spanner.admin.database.v1.RestoreDatabaseMetadata" + }; + } + + // Lists database [longrunning-operations][google.longrunning.Operation]. + // A database operation has a name of the form + // `projects//instances//databases//operations/`. + // The long-running operation + // [metadata][google.longrunning.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. + rpc ListDatabaseOperations(ListDatabaseOperationsRequest) returns (ListDatabaseOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/databaseOperations" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists the backup [long-running operations][google.longrunning.Operation] in + // the given instance. A backup operation has a name of the form + // `projects//instances//backups//operations/`. + // The long-running operation + // [metadata][google.longrunning.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. + rpc ListBackupOperations(ListBackupOperationsRequest) returns (ListBackupOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/instances/*}/backupOperations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Information about the database restore. +message RestoreInfo { + // The type of the restore source. + RestoreSourceType source_type = 1; + + // Information about the source used to restore the database. + oneof source_info { + // Information about the backup used to restore the database. The backup + // may no longer exist. + BackupInfo backup_info = 2; + } } // A Cloud Spanner database. @@ -193,6 +339,16 @@ message Database { // The database is fully created and ready for use. READY = 2; + + // The database is fully created and ready for use, but is still + // being optimized for performance and cannot handle full load. + // + // In this state, the database still references the backup + // it was restore from, preventing the backup + // from being deleted. When optimizations are complete, the full performance + // of the database will be restored, and the database will transition to + // `READY` state. + READY_OPTIMIZING = 3; } // Required. The name of the database. Values are of the form @@ -200,10 +356,17 @@ message Database { // where `` is as specified in the `CREATE DATABASE` // statement. This name can be passed to other API methods to // identify the database. - string name = 1; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Output only. The current database state. - State state = 2; + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If exists, the time at which the database creation started. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Applicable only for restored databases. Contains information + // about the restore source. + RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } // The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. @@ -256,11 +419,11 @@ message CreateDatabaseRequest { // database ID must be enclosed in backticks (`` ` ``). string create_statement = 2 [(google.api.field_behavior) = REQUIRED]; - // An optional list of DDL statements to run inside the newly created + // Optional. A list of DDL statements to run inside the newly created // database. Statements can create tables, indexes, etc. These // statements execute atomically with the creation of the database: // if there is an error in any statement, the database is not created. - repeated string extra_statements = 3; + repeated string extra_statements = 3 [(google.api.field_behavior) = OPTIONAL]; } // Metadata type for the operation returned by @@ -380,3 +543,184 @@ message GetDatabaseDdlResponse { // specified in the request. repeated string statements = 1; } + +// The request for +// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. +message ListDatabaseOperationsRequest { + // Required. The instance of the database operations. + // Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // An expression that filters the list of returned operations. + // + // A filter expression consists of a field name, a + // comparison operator, and a value for filtering. + // The value must be a string, a number, or a boolean. The comparison operator + // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + // Colon `:` is the contains operator. Filter rules are not case sensitive. + // + // The following fields in the [Operation][google.longrunning.Operation] + // are eligible for filtering: + // + // * `name` - The name of the long-running operation + // * `done` - False if the operation is in progress, else true. + // * `metadata.@type` - the type of metadata. For example, the type string + // for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is + // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + // * `metadata.` - any field in metadata.value. + // * `error` - Error associated with the long-running operation. + // * `response.@type` - the type of response. + // * `response.` - any field in response.value. + // + // You can combine multiple expressions by enclosing each expression in + // parentheses. By default, expressions are combined with AND logic. However, + // you can specify AND, OR, and NOT logic explicitly. + // + // Here are a few examples: + // + // * `done:true` - The operation is complete. + // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND`
+ // `(metadata.source_type:BACKUP) AND`
+ // `(metadata.backup_info.backup:backup_howl) AND`
+ // `(metadata.name:restored_howl) AND`
+ // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
+ // `(error:*)` - Return operations where: + // * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + // * The database is restored from a backup. + // * The backup name contains "backup_howl". + // * The restored database's name contains "restored_howl". + // * The operation started before 2018-03-28T14:50:00Z. + // * The operation resulted in an error. + string filter = 2; + + // Number of operations to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 3; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] + // from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the + // same `parent` and with the same `filter`. + string page_token = 4; +} + +// The response for +// [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]. +message ListDatabaseOperationsResponse { + // The list of matching database [long-running + // operations][google.longrunning.Operation]. Each operation's name will be + // prefixed by the database's name. The operation's + // [metadata][google.longrunning.Operation.metadata] field type + // `metadata.type_url` describes the type of the metadata. + repeated google.longrunning.Operation operations = 1; + + // `next_page_token` can be sent in a subsequent + // [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations] + // call to fetch more of the matching metadata. + string next_page_token = 2; +} + +// The request for +// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. +message RestoreDatabaseRequest { + // 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//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "spanner.googleapis.com/Instance" + } + ]; + + // 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//instances//databases/`. + string database_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source from which to restore. + oneof source { + // Name of the backup from which to restore. Values are of the form + // `projects//instances//backups/`. + string backup = 3 [(google.api.resource_reference) = { + type: "spanner.googleapis.com/Backup" + }]; + } +} + +// Metadata type for the long-running operation returned by +// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]. +message RestoreDatabaseMetadata { + // Name of the database being created and restored to. + string name = 1; + + // The type of the restore source. + RestoreSourceType source_type = 2; + + // Information about the source used to restore the database, as specified by + // `source` in [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest]. + oneof source_info { + // Information about the backup used to restore the database. + BackupInfo backup_info = 3; + } + + // The progress of the + // [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase] + // operation. + OperationProgress progress = 4; + + // The time at which cancellation of this operation was received. + // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] + // starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not guaranteed. + // Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. + google.protobuf.Timestamp cancel_time = 5; + + // If exists, the name of the long-running operation that will be used to + // track the post-restore optimization process to optimize the performance of + // the restored database, and remove the dependency on the restore source. + // The name is of the form + // `projects//instances//databases//operations/` + // where the is the name of database being created and restored to. + // The metadata type of the long-running operation is + // [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be + // automatically created by the system after the RestoreDatabase long-running + // operation completes successfully. This operation will not be created if the + // restore was not successful. + string optimize_database_operation_name = 6; +} + +// Metadata type for the long-running operation used to track the progress +// of optimizations performed on a newly restored database. This long-running +// operation is automatically created by the system after the successful +// completion of a database restore, and cannot be cancelled. +message OptimizeRestoredDatabaseMetadata { + // Name of the restored database being optimized. + string name = 1; + + // The progress of the post-restore optimizations. + OperationProgress progress = 2; +} + +// Indicates the type of the restore source. +enum RestoreSourceType { + // No restore associated. + TYPE_UNSPECIFIED = 0; + + // A backup was used as the source of the restore. + BACKUP = 1; +} diff --git a/synth.metadata b/synth.metadata index d3e4a8f255..a17baec2d0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,20 +1,20 @@ { - "updateTime": "2020-02-27T10:01:20.622243Z", + "updateTime": "2020-03-12T09:07:02.436365Z", "sources": [ { "generator": { "name": "artman", - "version": "0.46.0", - "dockerImage": "googleapis/artman@sha256:6248a21fba8f0d618c3b032669cec2618e684b66922bb70391fe08c41b05f6ee" + "version": "1.1.0", + "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dfe1cf7be44dee31d78f78e485d8c95430981d6e", - "internalRef": "297497710", - "log": "dfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n" + "sha": "34a5450c591b6be3d6566f25ac31caa5211b2f3f", + "internalRef": "300474272", + "log": "34a5450c591b6be3d6566f25ac31caa5211b2f3f\nIncreases the default timeout from 20s to 30s for MetricService\n\nPiperOrigin-RevId: 300474272\n\n5d8bffe87cd01ba390c32f1714230e5a95d5991d\nfeat: use the latest gapic-generator in WORKSPACE for bazel build.\n\nPiperOrigin-RevId: 300461878\n\nd631c651e3bcfac5d371e8560c27648f7b3e2364\nUpdated the GAPIC configs to include parameters for Backups APIs.\n\nPiperOrigin-RevId: 300443402\n\n678afc7055c1adea9b7b54519f3bdb228013f918\nAdding Game Servers v1beta API.\n\nPiperOrigin-RevId: 300433218\n\n80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\nf0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\n" } }, {