diff --git a/CHANGELOG.md b/CHANGELOG.md index 63031bdecf..7a7e309075 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [3.19.0](https://github.com/googleapis/java-firestore/compare/v3.18.0...v3.19.0) (2024-03-15) + + +### Features + +* A new message `Backup` is added ([#1611](https://github.com/googleapis/java-firestore/issues/1611)) ([434a55b](https://github.com/googleapis/java-firestore/commit/434a55b478fc617c2ec892a30d3eb1ce027ac54f)) +* Add ExplainMetrics field to RunAggregationQueryResponse ([f275b16](https://github.com/googleapis/java-firestore/commit/f275b1603225895e2673131191b4c15927e3bdcd)) +* Add ExplainMetrics field to RunQueryResponse ([f275b16](https://github.com/googleapis/java-firestore/commit/f275b1603225895e2673131191b4c15927e3bdcd)) +* Add ExplainOptions field to RunAggregationQueryRequest ([f275b16](https://github.com/googleapis/java-firestore/commit/f275b1603225895e2673131191b4c15927e3bdcd)) +* Add ExplainOptions field to RunQueryRequest ([f275b16](https://github.com/googleapis/java-firestore/commit/f275b1603225895e2673131191b4c15927e3bdcd)) +* Add new types ExplainOptions, ExplainMetrics, PlanSummary, ExecutionStats ([#1608](https://github.com/googleapis/java-firestore/issues/1608)) ([f275b16](https://github.com/googleapis/java-firestore/commit/f275b1603225895e2673131191b4c15927e3bdcd)) + + +### Bug Fixes + +* Update DocFX profile ([#1603](https://github.com/googleapis/java-firestore/issues/1603)) ([0a2eb16](https://github.com/googleapis/java-firestore/commit/0a2eb1640e1d4fb13d05bc489ace5a773a0b9a78)) + ## [3.18.0](https://github.com/googleapis/java-firestore/compare/v3.17.1...v3.18.0) (2024-03-04) diff --git a/README.md b/README.md index aa2480b9a5..9e21e4f6f8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.33.0 + 26.34.0 pom import @@ -42,7 +42,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-firestore - 3.17.1 + 3.18.0 ``` @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.33.0') +implementation platform('com.google.cloud:libraries-bom:26.34.0') implementation 'com.google.cloud:google-cloud-firestore' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-firestore:3.17.1' +implementation 'com.google.cloud:google-cloud-firestore:3.18.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-firestore" % "3.17.1" +libraryDependencies += "com.google.cloud" % "google-cloud-firestore" % "3.18.0" ``` @@ -222,7 +222,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-firestore/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-firestore.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-firestore/3.17.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-firestore/3.18.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-firestore-admin/pom.xml b/google-cloud-firestore-admin/pom.xml index bec9e9ca9c..8f1478f304 100644 --- a/google-cloud-firestore-admin/pom.xml +++ b/google-cloud-firestore-admin/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 google-cloud-firestore-admin - 3.18.0 + 3.19.0 jar Google Cloud Firestore Admin Client https://github.com/googleapis/java-firestore @@ -14,7 +14,7 @@ com.google.cloud google-cloud-firestore-parent - 3.18.0 + 3.19.0 diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java index 4cd40abd24..6506cf93bc 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java @@ -31,12 +31,19 @@ import com.google.cloud.firestore.v1.stub.FirestoreAdminStub; import com.google.cloud.firestore.v1.stub.FirestoreAdminStubSettings; import com.google.common.util.concurrent.MoreExecutors; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupName; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.BackupScheduleName; import com.google.firestore.admin.v1.CollectionGroupName; +import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; import com.google.firestore.admin.v1.DatabaseName; +import com.google.firestore.admin.v1.DeleteBackupRequest; +import com.google.firestore.admin.v1.DeleteBackupScheduleRequest; import com.google.firestore.admin.v1.DeleteDatabaseMetadata; import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; @@ -46,6 +53,8 @@ import com.google.firestore.admin.v1.Field; import com.google.firestore.admin.v1.FieldName; import com.google.firestore.admin.v1.FieldOperationMetadata; +import com.google.firestore.admin.v1.GetBackupRequest; +import com.google.firestore.admin.v1.GetBackupScheduleRequest; import com.google.firestore.admin.v1.GetDatabaseRequest; import com.google.firestore.admin.v1.GetFieldRequest; import com.google.firestore.admin.v1.GetIndexRequest; @@ -54,13 +63,21 @@ import com.google.firestore.admin.v1.Index; import com.google.firestore.admin.v1.IndexName; import com.google.firestore.admin.v1.IndexOperationMetadata; +import com.google.firestore.admin.v1.ListBackupSchedulesRequest; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsRequest; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesRequest; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsRequest; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesRequest; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.LocationName; import com.google.firestore.admin.v1.ProjectName; +import com.google.firestore.admin.v1.RestoreDatabaseMetadata; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; +import com.google.firestore.admin.v1.UpdateBackupScheduleRequest; import com.google.firestore.admin.v1.UpdateDatabaseMetadata; import com.google.firestore.admin.v1.UpdateDatabaseRequest; import com.google.firestore.admin.v1.UpdateFieldRequest; @@ -403,6 +420,174 @@ * * * + * + *

GetBackup + *

Gets information about a backup. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

ListBackups + *

Lists all the backups. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

DeleteBackup + *

Deletes a backup. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

RestoreDatabase + *

Creates a new database by restoring from an existing backup. + *

The new database must be in the same cloud region or multi-region location as the existing backup. This behaves similar to [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing backup. + *

The [long-running operation][google.longrunning.Operation] can be used to track the progress of the restore, with the Operation's [metadata][google.longrunning.Operation.metadata] field type being the [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. The [response][google.longrunning.Operation.response] type is the [Database][google.firestore.admin.v1.Database] if the restore was successful. The new database is not readable or writeable until the LRO has completed. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

CreateBackupSchedule + *

Creates a backup schedule on a database. At most two backup schedules can be configured on a database, one daily backup schedule with retention up to 7 days and one weekly backup schedule with retention up to 14 weeks. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

GetBackupSchedule + *

Gets information about a backup schedule. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

ListBackupSchedules + *

List backup schedules. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

UpdateBackupSchedule + *

Updates a backup schedule. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * + * + *

DeleteBackupSchedule + *

Deletes a backup schedule. + * + *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ * + *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ * + *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ * + * + * * * *

See the individual methods for example code. @@ -2584,6 +2769,1051 @@ public final UnaryCallable deleteDatabaseCalla return stub.deleteDatabaseCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   Backup response = firestoreAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the backup to fetch. + *

Format is `projects/{project}/locations/{location}/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 information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   Backup response = firestoreAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the backup to fetch. + *

Format is `projects/{project}/locations/{location}/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 information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   Backup response = firestoreAdminClient.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 information about a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future = firestoreAdminClient.getBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListBackupsResponse response = firestoreAdminClient.listBackups(parent);
+   * }
+   * }
+ * + * @param parent Required. The location to list backups from. + *

Format is `projects/{project}/locations/{location}`. Use `{location} = '-'` to list + * backups from all locations for the given project. This allows listing backups from a single + * location or from all locations. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsResponse listBackups(LocationName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   ListBackupsResponse response = firestoreAdminClient.listBackups(parent);
+   * }
+   * }
+ * + * @param parent Required. The location to list backups from. + *

Format is `projects/{project}/locations/{location}`. Use `{location} = '-'` to list + * backups from all locations for the given project. This allows listing backups from a single + * location or from all locations. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ListBackupsResponse response = firestoreAdminClient.listBackups(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 ListBackupsResponse listBackups(ListBackupsRequest request) { + return listBackupsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.listBackupsCallable().futureCall(request);
+   *   // Do something.
+   *   ListBackupsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+   *   firestoreAdminClient.deleteBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the backup to delete. + *

format is `projects/{project}/locations/{location}/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 backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+   *   firestoreAdminClient.deleteBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the backup to delete. + *

format is `projects/{project}/locations/{location}/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 backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   firestoreAdminClient.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 backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future = firestoreAdminClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new database by restoring from an existing backup. + * + *

The new database must be in the same cloud region or multi-region location as the existing + * backup. This behaves similar to + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] except instead of + * creating a new empty database, a new database is created with the database type, index + * configuration, and documents from an existing backup. + * + *

The [long-running operation][google.longrunning.Operation] can be used to track the progress + * of the restore, with the Operation's [metadata][google.longrunning.Operation.metadata] field + * type being the [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] type is the + * [Database][google.firestore.admin.v1.Database] if the restore was successful. The new database + * is not readable or writeable until the LRO has completed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   RestoreDatabaseRequest request =
+   *       RestoreDatabaseRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDatabaseId("databaseId1688905718")
+   *           .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   Database response = firestoreAdminClient.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 + */ + public final OperationFuture restoreDatabaseAsync( + RestoreDatabaseRequest request) { + return restoreDatabaseOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new database by restoring from an existing backup. + * + *

The new database must be in the same cloud region or multi-region location as the existing + * backup. This behaves similar to + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] except instead of + * creating a new empty database, a new database is created with the database type, index + * configuration, and documents from an existing backup. + * + *

The [long-running operation][google.longrunning.Operation] can be used to track the progress + * of the restore, with the Operation's [metadata][google.longrunning.Operation.metadata] field + * type being the [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] type is the + * [Database][google.firestore.admin.v1.Database] if the restore was successful. The new database + * is not readable or writeable until the LRO has completed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   RestoreDatabaseRequest request =
+   *       RestoreDatabaseRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDatabaseId("databaseId1688905718")
+   *           .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       firestoreAdminClient.restoreDatabaseOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Database response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restoreDatabaseOperationCallable() { + return stub.restoreDatabaseOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new database by restoring from an existing backup. + * + *

The new database must be in the same cloud region or multi-region location as the existing + * backup. This behaves similar to + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] except instead of + * creating a new empty database, a new database is created with the database type, index + * configuration, and documents from an existing backup. + * + *

The [long-running operation][google.longrunning.Operation] can be used to track the progress + * of the restore, with the Operation's [metadata][google.longrunning.Operation.metadata] field + * type being the [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] type is the + * [Database][google.firestore.admin.v1.Database] if the restore was successful. The new database + * is not readable or writeable until the LRO has completed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   RestoreDatabaseRequest request =
+   *       RestoreDatabaseRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDatabaseId("databaseId1688905718")
+   *           .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.restoreDatabaseCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreDatabaseCallable() { + return stub.restoreDatabaseCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup schedule on a database. At most two backup schedules can be configured on a + * database, one daily backup schedule with retention up to 7 days and one weekly backup schedule + * with retention up to 14 weeks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]");
+   *   BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+   *   BackupSchedule response = firestoreAdminClient.createBackupSchedule(parent, backupSchedule);
+   * }
+   * }
+ * + * @param parent Required. The parent database. + *

Format `projects/{project}/databases/{database}` + * @param backupSchedule Required. The backup schedule to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule createBackupSchedule( + DatabaseName parent, BackupSchedule backupSchedule) { + CreateBackupScheduleRequest request = + CreateBackupScheduleRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackupSchedule(backupSchedule) + .build(); + return createBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup schedule on a database. At most two backup schedules can be configured on a + * database, one daily backup schedule with retention up to 7 days and one weekly backup schedule + * with retention up to 14 weeks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String parent = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
+   *   BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+   *   BackupSchedule response = firestoreAdminClient.createBackupSchedule(parent, backupSchedule);
+   * }
+   * }
+ * + * @param parent Required. The parent database. + *

Format `projects/{project}/databases/{database}` + * @param backupSchedule Required. The backup schedule to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule createBackupSchedule(String parent, BackupSchedule backupSchedule) { + CreateBackupScheduleRequest request = + CreateBackupScheduleRequest.newBuilder() + .setParent(parent) + .setBackupSchedule(backupSchedule) + .build(); + return createBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup schedule on a database. At most two backup schedules can be configured on a + * database, one daily backup schedule with retention up to 7 days and one weekly backup schedule + * with retention up to 14 weeks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   CreateBackupScheduleRequest request =
+   *       CreateBackupScheduleRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+   *           .setBackupSchedule(BackupSchedule.newBuilder().build())
+   *           .build();
+   *   BackupSchedule response = firestoreAdminClient.createBackupSchedule(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 BackupSchedule createBackupSchedule(CreateBackupScheduleRequest request) { + return createBackupScheduleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a backup schedule on a database. At most two backup schedules can be configured on a + * database, one daily backup schedule with retention up to 7 days and one weekly backup schedule + * with retention up to 14 weeks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   CreateBackupScheduleRequest request =
+   *       CreateBackupScheduleRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+   *           .setBackupSchedule(BackupSchedule.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.createBackupScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   BackupSchedule response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createBackupScheduleCallable() { + return stub.createBackupScheduleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   BackupScheduleName name =
+   *       BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]");
+   *   BackupSchedule response = firestoreAdminClient.getBackupSchedule(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup schedule. + *

Format `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule getBackupSchedule(BackupScheduleName name) { + GetBackupScheduleRequest request = + GetBackupScheduleRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String name =
+   *       BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString();
+   *   BackupSchedule response = firestoreAdminClient.getBackupSchedule(name);
+   * }
+   * }
+ * + * @param name Required. The name of the backup schedule. + *

Format `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule getBackupSchedule(String name) { + GetBackupScheduleRequest request = GetBackupScheduleRequest.newBuilder().setName(name).build(); + return getBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   GetBackupScheduleRequest request =
+   *       GetBackupScheduleRequest.newBuilder()
+   *           .setName(
+   *               BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
+   *           .build();
+   *   BackupSchedule response = firestoreAdminClient.getBackupSchedule(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 BackupSchedule getBackupSchedule(GetBackupScheduleRequest request) { + return getBackupScheduleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   GetBackupScheduleRequest request =
+   *       GetBackupScheduleRequest.newBuilder()
+   *           .setName(
+   *               BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.getBackupScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   BackupSchedule response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupScheduleCallable() { + return stub.getBackupScheduleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List backup schedules. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]");
+   *   ListBackupSchedulesResponse response = firestoreAdminClient.listBackupSchedules(parent);
+   * }
+   * }
+ * + * @param parent Required. The parent database. + *

Format is `projects/{project}/databases/{database}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupSchedulesResponse listBackupSchedules(DatabaseName parent) { + ListBackupSchedulesRequest request = + ListBackupSchedulesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackupSchedules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List backup schedules. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String parent = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
+   *   ListBackupSchedulesResponse response = firestoreAdminClient.listBackupSchedules(parent);
+   * }
+   * }
+ * + * @param parent Required. The parent database. + *

Format is `projects/{project}/databases/{database}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupSchedulesResponse listBackupSchedules(String parent) { + ListBackupSchedulesRequest request = + ListBackupSchedulesRequest.newBuilder().setParent(parent).build(); + return listBackupSchedules(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List backup schedules. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   ListBackupSchedulesRequest request =
+   *       ListBackupSchedulesRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+   *           .build();
+   *   ListBackupSchedulesResponse response = firestoreAdminClient.listBackupSchedules(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 ListBackupSchedulesResponse listBackupSchedules(ListBackupSchedulesRequest request) { + return listBackupSchedulesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List backup schedules. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   ListBackupSchedulesRequest request =
+   *       ListBackupSchedulesRequest.newBuilder()
+   *           .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.listBackupSchedulesCallable().futureCall(request);
+   *   // Do something.
+   *   ListBackupSchedulesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + listBackupSchedulesCallable() { + return stub.listBackupSchedulesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   BackupSchedule response =
+   *       firestoreAdminClient.updateBackupSchedule(backupSchedule, updateMask);
+   * }
+   * }
+ * + * @param backupSchedule Required. The backup schedule to update. + * @param updateMask The list of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupSchedule updateBackupSchedule( + BackupSchedule backupSchedule, FieldMask updateMask) { + UpdateBackupScheduleRequest request = + UpdateBackupScheduleRequest.newBuilder() + .setBackupSchedule(backupSchedule) + .setUpdateMask(updateMask) + .build(); + return updateBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   UpdateBackupScheduleRequest request =
+   *       UpdateBackupScheduleRequest.newBuilder()
+   *           .setBackupSchedule(BackupSchedule.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   BackupSchedule response = firestoreAdminClient.updateBackupSchedule(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 BackupSchedule updateBackupSchedule(UpdateBackupScheduleRequest request) { + return updateBackupScheduleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   UpdateBackupScheduleRequest request =
+   *       UpdateBackupScheduleRequest.newBuilder()
+   *           .setBackupSchedule(BackupSchedule.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.updateBackupScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   BackupSchedule response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateBackupScheduleCallable() { + return stub.updateBackupScheduleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   BackupScheduleName name =
+   *       BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]");
+   *   firestoreAdminClient.deleteBackupSchedule(name);
+   * }
+   * }
+ * + * @param name Required. The name of backup schedule. + *

Format `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackupSchedule(BackupScheduleName name) { + DeleteBackupScheduleRequest request = + DeleteBackupScheduleRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String name =
+   *       BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString();
+   *   firestoreAdminClient.deleteBackupSchedule(name);
+   * }
+   * }
+ * + * @param name Required. The name of backup schedule. + *

Format `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackupSchedule(String name) { + DeleteBackupScheduleRequest request = + DeleteBackupScheduleRequest.newBuilder().setName(name).build(); + deleteBackupSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DeleteBackupScheduleRequest request =
+   *       DeleteBackupScheduleRequest.newBuilder()
+   *           .setName(
+   *               BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
+   *           .build();
+   *   firestoreAdminClient.deleteBackupSchedule(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 deleteBackupSchedule(DeleteBackupScheduleRequest request) { + deleteBackupScheduleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a backup schedule. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DeleteBackupScheduleRequest request =
+   *       DeleteBackupScheduleRequest.newBuilder()
+   *           .setName(
+   *               BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.deleteBackupScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupScheduleCallable() { + return stub.deleteBackupScheduleCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java index ee2077bdaf..476ccec67a 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java @@ -33,10 +33,15 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.firestore.v1.stub.FirestoreAdminStubSettings; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteBackupRequest; +import com.google.firestore.admin.v1.DeleteBackupScheduleRequest; import com.google.firestore.admin.v1.DeleteDatabaseMetadata; import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; @@ -45,6 +50,8 @@ import com.google.firestore.admin.v1.ExportDocumentsResponse; import com.google.firestore.admin.v1.Field; import com.google.firestore.admin.v1.FieldOperationMetadata; +import com.google.firestore.admin.v1.GetBackupRequest; +import com.google.firestore.admin.v1.GetBackupScheduleRequest; import com.google.firestore.admin.v1.GetDatabaseRequest; import com.google.firestore.admin.v1.GetFieldRequest; import com.google.firestore.admin.v1.GetIndexRequest; @@ -52,12 +59,19 @@ import com.google.firestore.admin.v1.ImportDocumentsRequest; import com.google.firestore.admin.v1.Index; import com.google.firestore.admin.v1.IndexOperationMetadata; +import com.google.firestore.admin.v1.ListBackupSchedulesRequest; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsRequest; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesRequest; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsRequest; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesRequest; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.RestoreDatabaseMetadata; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; +import com.google.firestore.admin.v1.UpdateBackupScheduleRequest; import com.google.firestore.admin.v1.UpdateDatabaseMetadata; import com.google.firestore.admin.v1.UpdateDatabaseRequest; import com.google.firestore.admin.v1.UpdateFieldRequest; @@ -222,6 +236,60 @@ public UnaryCallSettings deleteDatabaseSetting return ((FirestoreAdminStubSettings) getStubSettings()).deleteDatabaseOperationSettings(); } + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public UnaryCallSettings listBackupsSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).deleteBackupSettings(); + } + + /** Returns the object with the settings used for calls to restoreDatabase. */ + public UnaryCallSettings restoreDatabaseSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).restoreDatabaseSettings(); + } + + /** Returns the object with the settings used for calls to restoreDatabase. */ + public OperationCallSettings + restoreDatabaseOperationSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).restoreDatabaseOperationSettings(); + } + + /** Returns the object with the settings used for calls to createBackupSchedule. */ + public UnaryCallSettings + createBackupScheduleSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).createBackupScheduleSettings(); + } + + /** Returns the object with the settings used for calls to getBackupSchedule. */ + public UnaryCallSettings getBackupScheduleSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).getBackupScheduleSettings(); + } + + /** Returns the object with the settings used for calls to listBackupSchedules. */ + public UnaryCallSettings + listBackupSchedulesSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).listBackupSchedulesSettings(); + } + + /** Returns the object with the settings used for calls to updateBackupSchedule. */ + public UnaryCallSettings + updateBackupScheduleSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).updateBackupScheduleSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackupSchedule. */ + public UnaryCallSettings deleteBackupScheduleSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).deleteBackupScheduleSettings(); + } + public static final FirestoreAdminSettings create(FirestoreAdminStubSettings stub) throws IOException { return new FirestoreAdminSettings.Builder(stub.toBuilder()).build(); @@ -451,6 +519,63 @@ public UnaryCallSettings.Builder deleteDatabas return getStubSettingsBuilder().deleteDatabaseOperationSettings(); } + /** 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 listBackups. */ + public UnaryCallSettings.Builder + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** 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 restoreDatabase. */ + public UnaryCallSettings.Builder restoreDatabaseSettings() { + return getStubSettingsBuilder().restoreDatabaseSettings(); + } + + /** Returns the builder for the settings used for calls to restoreDatabase. */ + public OperationCallSettings.Builder + restoreDatabaseOperationSettings() { + return getStubSettingsBuilder().restoreDatabaseOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createBackupSchedule. */ + public UnaryCallSettings.Builder + createBackupScheduleSettings() { + return getStubSettingsBuilder().createBackupScheduleSettings(); + } + + /** Returns the builder for the settings used for calls to getBackupSchedule. */ + public UnaryCallSettings.Builder + getBackupScheduleSettings() { + return getStubSettingsBuilder().getBackupScheduleSettings(); + } + + /** Returns the builder for the settings used for calls to listBackupSchedules. */ + public UnaryCallSettings.Builder + listBackupSchedulesSettings() { + return getStubSettingsBuilder().listBackupSchedulesSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackupSchedule. */ + public UnaryCallSettings.Builder + updateBackupScheduleSettings() { + return getStubSettingsBuilder().updateBackupScheduleSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackupSchedule. */ + public UnaryCallSettings.Builder + deleteBackupScheduleSettings() { + return getStubSettingsBuilder().deleteBackupScheduleSettings(); + } + @Override public FirestoreAdminSettings build() throws IOException { return new FirestoreAdminSettings(this); diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json index aaa8b74b82..727ba40b1c 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json @@ -10,12 +10,21 @@ "grpc": { "libraryClient": "FirestoreAdminClient", "rpcs": { + "CreateBackupSchedule": { + "methods": ["createBackupSchedule", "createBackupSchedule", "createBackupSchedule", "createBackupScheduleCallable"] + }, "CreateDatabase": { "methods": ["createDatabaseAsync", "createDatabaseAsync", "createDatabaseAsync", "createDatabaseOperationCallable", "createDatabaseCallable"] }, "CreateIndex": { "methods": ["createIndexAsync", "createIndexAsync", "createIndexAsync", "createIndexOperationCallable", "createIndexCallable"] }, + "DeleteBackup": { + "methods": ["deleteBackup", "deleteBackup", "deleteBackup", "deleteBackupCallable"] + }, + "DeleteBackupSchedule": { + "methods": ["deleteBackupSchedule", "deleteBackupSchedule", "deleteBackupSchedule", "deleteBackupScheduleCallable"] + }, "DeleteDatabase": { "methods": ["deleteDatabaseAsync", "deleteDatabaseAsync", "deleteDatabaseAsync", "deleteDatabaseOperationCallable", "deleteDatabaseCallable"] }, @@ -25,6 +34,12 @@ "ExportDocuments": { "methods": ["exportDocumentsAsync", "exportDocumentsAsync", "exportDocumentsAsync", "exportDocumentsOperationCallable", "exportDocumentsCallable"] }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "GetBackupSchedule": { + "methods": ["getBackupSchedule", "getBackupSchedule", "getBackupSchedule", "getBackupScheduleCallable"] + }, "GetDatabase": { "methods": ["getDatabase", "getDatabase", "getDatabase", "getDatabaseCallable"] }, @@ -37,6 +52,12 @@ "ImportDocuments": { "methods": ["importDocumentsAsync", "importDocumentsAsync", "importDocumentsAsync", "importDocumentsOperationCallable", "importDocumentsCallable"] }, + "ListBackupSchedules": { + "methods": ["listBackupSchedules", "listBackupSchedules", "listBackupSchedules", "listBackupSchedulesCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsCallable"] + }, "ListDatabases": { "methods": ["listDatabases", "listDatabases", "listDatabases", "listDatabasesCallable"] }, @@ -46,6 +67,12 @@ "ListIndexes": { "methods": ["listIndexes", "listIndexes", "listIndexes", "listIndexesPagedCallable", "listIndexesCallable"] }, + "RestoreDatabase": { + "methods": ["restoreDatabaseAsync", "restoreDatabaseOperationCallable", "restoreDatabaseCallable"] + }, + "UpdateBackupSchedule": { + "methods": ["updateBackupSchedule", "updateBackupSchedule", "updateBackupScheduleCallable"] + }, "UpdateDatabase": { "methods": ["updateDatabaseAsync", "updateDatabaseAsync", "updateDatabaseOperationCallable", "updateDatabaseCallable"] }, diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java index fa51f0cb47..26db1092aa 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java @@ -22,10 +22,15 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteBackupRequest; +import com.google.firestore.admin.v1.DeleteBackupScheduleRequest; import com.google.firestore.admin.v1.DeleteDatabaseMetadata; import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; @@ -34,6 +39,8 @@ import com.google.firestore.admin.v1.ExportDocumentsResponse; import com.google.firestore.admin.v1.Field; import com.google.firestore.admin.v1.FieldOperationMetadata; +import com.google.firestore.admin.v1.GetBackupRequest; +import com.google.firestore.admin.v1.GetBackupScheduleRequest; import com.google.firestore.admin.v1.GetDatabaseRequest; import com.google.firestore.admin.v1.GetFieldRequest; import com.google.firestore.admin.v1.GetIndexRequest; @@ -41,12 +48,19 @@ import com.google.firestore.admin.v1.ImportDocumentsRequest; import com.google.firestore.admin.v1.Index; import com.google.firestore.admin.v1.IndexOperationMetadata; +import com.google.firestore.admin.v1.ListBackupSchedulesRequest; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsRequest; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesRequest; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsRequest; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesRequest; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.RestoreDatabaseMetadata; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; +import com.google.firestore.admin.v1.UpdateBackupScheduleRequest; import com.google.firestore.admin.v1.UpdateDatabaseMetadata; import com.google.firestore.admin.v1.UpdateDatabaseRequest; import com.google.firestore.admin.v1.UpdateFieldRequest; @@ -171,6 +185,48 @@ public UnaryCallable deleteDatabaseCallable() throw new UnsupportedOperationException("Not implemented: deleteDatabaseCallable()"); } + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + public OperationCallable + restoreDatabaseOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreDatabaseOperationCallable()"); + } + + public UnaryCallable restoreDatabaseCallable() { + throw new UnsupportedOperationException("Not implemented: restoreDatabaseCallable()"); + } + + public UnaryCallable createBackupScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupScheduleCallable()"); + } + + public UnaryCallable getBackupScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupScheduleCallable()"); + } + + public UnaryCallable + listBackupSchedulesCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupSchedulesCallable()"); + } + + public UnaryCallable updateBackupScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupScheduleCallable()"); + } + + public UnaryCallable deleteBackupScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupScheduleCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java index 7c718c896a..fbcf2bc14f 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java @@ -52,10 +52,15 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteBackupRequest; +import com.google.firestore.admin.v1.DeleteBackupScheduleRequest; import com.google.firestore.admin.v1.DeleteDatabaseMetadata; import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; @@ -64,6 +69,8 @@ import com.google.firestore.admin.v1.ExportDocumentsResponse; import com.google.firestore.admin.v1.Field; import com.google.firestore.admin.v1.FieldOperationMetadata; +import com.google.firestore.admin.v1.GetBackupRequest; +import com.google.firestore.admin.v1.GetBackupScheduleRequest; import com.google.firestore.admin.v1.GetDatabaseRequest; import com.google.firestore.admin.v1.GetFieldRequest; import com.google.firestore.admin.v1.GetIndexRequest; @@ -71,12 +78,19 @@ import com.google.firestore.admin.v1.ImportDocumentsRequest; import com.google.firestore.admin.v1.Index; import com.google.firestore.admin.v1.IndexOperationMetadata; +import com.google.firestore.admin.v1.ListBackupSchedulesRequest; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsRequest; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesRequest; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsRequest; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesRequest; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.RestoreDatabaseMetadata; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; +import com.google.firestore.admin.v1.UpdateBackupScheduleRequest; import com.google.firestore.admin.v1.UpdateDatabaseMetadata; import com.google.firestore.admin.v1.UpdateDatabaseRequest; import com.google.firestore.admin.v1.UpdateFieldRequest; @@ -165,6 +179,21 @@ public class FirestoreAdminStubSettings extends StubSettings deleteDatabaseSettings; private final OperationCallSettings deleteDatabaseOperationSettings; + private final UnaryCallSettings getBackupSettings; + private final UnaryCallSettings listBackupsSettings; + private final UnaryCallSettings deleteBackupSettings; + private final UnaryCallSettings restoreDatabaseSettings; + private final OperationCallSettings + restoreDatabaseOperationSettings; + private final UnaryCallSettings + createBackupScheduleSettings; + private final UnaryCallSettings + getBackupScheduleSettings; + private final UnaryCallSettings + listBackupSchedulesSettings; + private final UnaryCallSettings + updateBackupScheduleSettings; + private final UnaryCallSettings deleteBackupScheduleSettings; private static final PagedListDescriptor LIST_INDEXES_PAGE_STR_DESC = @@ -387,6 +416,60 @@ public UnaryCallSettings deleteDatabaseSetting return deleteDatabaseOperationSettings; } + /** 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 listBackups. */ + public UnaryCallSettings listBackupsSettings() { + return listBackupsSettings; + } + + /** 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 restoreDatabase. */ + public UnaryCallSettings restoreDatabaseSettings() { + return restoreDatabaseSettings; + } + + /** Returns the object with the settings used for calls to restoreDatabase. */ + public OperationCallSettings + restoreDatabaseOperationSettings() { + return restoreDatabaseOperationSettings; + } + + /** Returns the object with the settings used for calls to createBackupSchedule. */ + public UnaryCallSettings + createBackupScheduleSettings() { + return createBackupScheduleSettings; + } + + /** Returns the object with the settings used for calls to getBackupSchedule. */ + public UnaryCallSettings getBackupScheduleSettings() { + return getBackupScheduleSettings; + } + + /** Returns the object with the settings used for calls to listBackupSchedules. */ + public UnaryCallSettings + listBackupSchedulesSettings() { + return listBackupSchedulesSettings; + } + + /** Returns the object with the settings used for calls to updateBackupSchedule. */ + public UnaryCallSettings + updateBackupScheduleSettings() { + return updateBackupScheduleSettings; + } + + /** Returns the object with the settings used for calls to deleteBackupSchedule. */ + public UnaryCallSettings deleteBackupScheduleSettings() { + return deleteBackupScheduleSettings; + } + public FirestoreAdminStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -527,6 +610,16 @@ protected FirestoreAdminStubSettings(Builder settingsBuilder) throws IOException updateDatabaseOperationSettings = settingsBuilder.updateDatabaseOperationSettings().build(); deleteDatabaseSettings = settingsBuilder.deleteDatabaseSettings().build(); deleteDatabaseOperationSettings = settingsBuilder.deleteDatabaseOperationSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + restoreDatabaseSettings = settingsBuilder.restoreDatabaseSettings().build(); + restoreDatabaseOperationSettings = settingsBuilder.restoreDatabaseOperationSettings().build(); + createBackupScheduleSettings = settingsBuilder.createBackupScheduleSettings().build(); + getBackupScheduleSettings = settingsBuilder.getBackupScheduleSettings().build(); + listBackupSchedulesSettings = settingsBuilder.listBackupSchedulesSettings().build(); + updateBackupScheduleSettings = settingsBuilder.updateBackupScheduleSettings().build(); + deleteBackupScheduleSettings = settingsBuilder.deleteBackupScheduleSettings().build(); } /** Builder for FirestoreAdminStubSettings. */ @@ -575,6 +668,25 @@ public static class Builder extends StubSettings.Builder deleteDatabaseOperationSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final UnaryCallSettings.Builder + listBackupsSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private final UnaryCallSettings.Builder + restoreDatabaseSettings; + private final OperationCallSettings.Builder< + RestoreDatabaseRequest, Database, RestoreDatabaseMetadata> + restoreDatabaseOperationSettings; + private final UnaryCallSettings.Builder + createBackupScheduleSettings; + private final UnaryCallSettings.Builder + getBackupScheduleSettings; + private final UnaryCallSettings.Builder + listBackupSchedulesSettings; + private final UnaryCallSettings.Builder + updateBackupScheduleSettings; + private final UnaryCallSettings.Builder + deleteBackupScheduleSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -651,6 +763,16 @@ protected Builder(ClientContext clientContext) { updateDatabaseOperationSettings = OperationCallSettings.newBuilder(); deleteDatabaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteDatabaseOperationSettings = OperationCallSettings.newBuilder(); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBackupsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreDatabaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreDatabaseOperationSettings = OperationCallSettings.newBuilder(); + createBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBackupSchedulesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -667,7 +789,16 @@ protected Builder(ClientContext clientContext) { getDatabaseSettings, listDatabasesSettings, updateDatabaseSettings, - deleteDatabaseSettings); + deleteDatabaseSettings, + getBackupSettings, + listBackupsSettings, + deleteBackupSettings, + restoreDatabaseSettings, + createBackupScheduleSettings, + getBackupScheduleSettings, + listBackupSchedulesSettings, + updateBackupScheduleSettings, + deleteBackupScheduleSettings); initDefaults(this); } @@ -695,6 +826,16 @@ protected Builder(FirestoreAdminStubSettings settings) { updateDatabaseOperationSettings = settings.updateDatabaseOperationSettings.toBuilder(); deleteDatabaseSettings = settings.deleteDatabaseSettings.toBuilder(); deleteDatabaseOperationSettings = settings.deleteDatabaseOperationSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + restoreDatabaseSettings = settings.restoreDatabaseSettings.toBuilder(); + restoreDatabaseOperationSettings = settings.restoreDatabaseOperationSettings.toBuilder(); + createBackupScheduleSettings = settings.createBackupScheduleSettings.toBuilder(); + getBackupScheduleSettings = settings.getBackupScheduleSettings.toBuilder(); + listBackupSchedulesSettings = settings.listBackupSchedulesSettings.toBuilder(); + updateBackupScheduleSettings = settings.updateBackupScheduleSettings.toBuilder(); + deleteBackupScheduleSettings = settings.deleteBackupScheduleSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -711,7 +852,16 @@ protected Builder(FirestoreAdminStubSettings settings) { getDatabaseSettings, listDatabasesSettings, updateDatabaseSettings, - deleteDatabaseSettings); + deleteDatabaseSettings, + getBackupSettings, + listBackupsSettings, + deleteBackupSettings, + restoreDatabaseSettings, + createBackupScheduleSettings, + getBackupScheduleSettings, + listBackupSchedulesSettings, + updateBackupScheduleSettings, + deleteBackupScheduleSettings); } private static Builder createDefault() { @@ -809,6 +959,51 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listBackupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .restoreDatabaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createBackupScheduleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getBackupScheduleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listBackupSchedulesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateBackupScheduleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteBackupScheduleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .createIndexOperationSettings() .setInitialCallSettings( @@ -975,6 +1170,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .restoreDatabaseOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Database.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(RestoreDatabaseMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + return builder; } @@ -1110,6 +1329,63 @@ public UnaryCallSettings.Builder deleteDatabas return deleteDatabaseOperationSettings; } + /** 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 listBackups. */ + public UnaryCallSettings.Builder + listBackupsSettings() { + return listBackupsSettings; + } + + /** 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 restoreDatabase. */ + public UnaryCallSettings.Builder restoreDatabaseSettings() { + return restoreDatabaseSettings; + } + + /** Returns the builder for the settings used for calls to restoreDatabase. */ + public OperationCallSettings.Builder + restoreDatabaseOperationSettings() { + return restoreDatabaseOperationSettings; + } + + /** Returns the builder for the settings used for calls to createBackupSchedule. */ + public UnaryCallSettings.Builder + createBackupScheduleSettings() { + return createBackupScheduleSettings; + } + + /** Returns the builder for the settings used for calls to getBackupSchedule. */ + public UnaryCallSettings.Builder + getBackupScheduleSettings() { + return getBackupScheduleSettings; + } + + /** Returns the builder for the settings used for calls to listBackupSchedules. */ + public UnaryCallSettings.Builder + listBackupSchedulesSettings() { + return listBackupSchedulesSettings; + } + + /** Returns the builder for the settings used for calls to updateBackupSchedule. */ + public UnaryCallSettings.Builder + updateBackupScheduleSettings() { + return updateBackupScheduleSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackupSchedule. */ + public UnaryCallSettings.Builder + deleteBackupScheduleSettings() { + return deleteBackupScheduleSettings; + } + /** Returns the endpoint set by the user or the the service's default endpoint. */ @Override public String getEndpoint() { diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java index cf37b45713..d0a883dc14 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java @@ -27,10 +27,15 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteBackupRequest; +import com.google.firestore.admin.v1.DeleteBackupScheduleRequest; import com.google.firestore.admin.v1.DeleteDatabaseMetadata; import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; @@ -39,6 +44,8 @@ import com.google.firestore.admin.v1.ExportDocumentsResponse; import com.google.firestore.admin.v1.Field; import com.google.firestore.admin.v1.FieldOperationMetadata; +import com.google.firestore.admin.v1.GetBackupRequest; +import com.google.firestore.admin.v1.GetBackupScheduleRequest; import com.google.firestore.admin.v1.GetDatabaseRequest; import com.google.firestore.admin.v1.GetFieldRequest; import com.google.firestore.admin.v1.GetIndexRequest; @@ -46,12 +53,19 @@ import com.google.firestore.admin.v1.ImportDocumentsRequest; import com.google.firestore.admin.v1.Index; import com.google.firestore.admin.v1.IndexOperationMetadata; +import com.google.firestore.admin.v1.ListBackupSchedulesRequest; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsRequest; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesRequest; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsRequest; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesRequest; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.RestoreDatabaseMetadata; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; +import com.google.firestore.admin.v1.UpdateBackupScheduleRequest; import com.google.firestore.admin.v1.UpdateDatabaseMetadata; import com.google.firestore.admin.v1.UpdateDatabaseRequest; import com.google.firestore.admin.v1.UpdateFieldRequest; @@ -200,6 +214,93 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + restoreDatabaseMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/RestoreDatabase") + .setRequestMarshaller( + ProtoUtils.marshaller(RestoreDatabaseRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createBackupScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/CreateBackupSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateBackupScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getBackupScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackupSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(GetBackupScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listBackupSchedulesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListBackupSchedules") + .setRequestMarshaller( + ProtoUtils.marshaller(ListBackupSchedulesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupSchedulesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateBackupScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/UpdateBackupSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateBackupScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteBackupScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteBackupScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private final UnaryCallable createIndexCallable; private final OperationCallable createIndexOperationCallable; @@ -232,6 +333,20 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { private final UnaryCallable deleteDatabaseCallable; private final OperationCallable deleteDatabaseOperationCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable deleteBackupCallable; + private final UnaryCallable restoreDatabaseCallable; + private final OperationCallable + restoreDatabaseOperationCallable; + private final UnaryCallable + createBackupScheduleCallable; + private final UnaryCallable getBackupScheduleCallable; + private final UnaryCallable + listBackupSchedulesCallable; + private final UnaryCallable + updateBackupScheduleCallable; + private final UnaryCallable deleteBackupScheduleCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -417,6 +532,101 @@ protected GrpcFirestoreAdminStub( return builder.build(); }) .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings restoreDatabaseTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreDatabaseMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + createBackupScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getBackupScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listBackupSchedulesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupSchedulesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + updateBackupScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "backup_schedule.name", + String.valueOf(request.getBackupSchedule().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBackupScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); this.createIndexCallable = callableFactory.createUnaryCallable( @@ -508,6 +718,49 @@ protected GrpcFirestoreAdminStub( settings.deleteDatabaseOperationSettings(), clientContext, operationsStub); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.restoreDatabaseCallable = + callableFactory.createUnaryCallable( + restoreDatabaseTransportSettings, settings.restoreDatabaseSettings(), clientContext); + this.restoreDatabaseOperationCallable = + callableFactory.createOperationCallable( + restoreDatabaseTransportSettings, + settings.restoreDatabaseOperationSettings(), + clientContext, + operationsStub); + this.createBackupScheduleCallable = + callableFactory.createUnaryCallable( + createBackupScheduleTransportSettings, + settings.createBackupScheduleSettings(), + clientContext); + this.getBackupScheduleCallable = + callableFactory.createUnaryCallable( + getBackupScheduleTransportSettings, + settings.getBackupScheduleSettings(), + clientContext); + this.listBackupSchedulesCallable = + callableFactory.createUnaryCallable( + listBackupSchedulesTransportSettings, + settings.listBackupSchedulesSettings(), + clientContext); + this.updateBackupScheduleCallable = + callableFactory.createUnaryCallable( + updateBackupScheduleTransportSettings, + settings.updateBackupScheduleSettings(), + clientContext); + this.deleteBackupScheduleCallable = + callableFactory.createUnaryCallable( + deleteBackupScheduleTransportSettings, + settings.deleteBackupScheduleSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -639,6 +892,58 @@ public UnaryCallable deleteDatabaseCallable() return deleteDatabaseOperationCallable; } + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public UnaryCallable restoreDatabaseCallable() { + return restoreDatabaseCallable; + } + + @Override + public OperationCallable + restoreDatabaseOperationCallable() { + return restoreDatabaseOperationCallable; + } + + @Override + public UnaryCallable createBackupScheduleCallable() { + return createBackupScheduleCallable; + } + + @Override + public UnaryCallable getBackupScheduleCallable() { + return getBackupScheduleCallable; + } + + @Override + public UnaryCallable + listBackupSchedulesCallable() { + return listBackupSchedulesCallable; + } + + @Override + public UnaryCallable updateBackupScheduleCallable() { + return updateBackupScheduleCallable; + } + + @Override + public UnaryCallable deleteBackupScheduleCallable() { + return deleteBackupScheduleCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java index c84683e42a..e81b9b65d9 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java @@ -36,10 +36,15 @@ import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; import com.google.common.collect.ImmutableMap; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteBackupRequest; +import com.google.firestore.admin.v1.DeleteBackupScheduleRequest; import com.google.firestore.admin.v1.DeleteDatabaseMetadata; import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; @@ -48,6 +53,8 @@ import com.google.firestore.admin.v1.ExportDocumentsResponse; import com.google.firestore.admin.v1.Field; import com.google.firestore.admin.v1.FieldOperationMetadata; +import com.google.firestore.admin.v1.GetBackupRequest; +import com.google.firestore.admin.v1.GetBackupScheduleRequest; import com.google.firestore.admin.v1.GetDatabaseRequest; import com.google.firestore.admin.v1.GetFieldRequest; import com.google.firestore.admin.v1.GetIndexRequest; @@ -55,12 +62,19 @@ import com.google.firestore.admin.v1.ImportDocumentsRequest; import com.google.firestore.admin.v1.Index; import com.google.firestore.admin.v1.IndexOperationMetadata; +import com.google.firestore.admin.v1.ListBackupSchedulesRequest; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsRequest; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesRequest; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsRequest; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesRequest; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.RestoreDatabaseMetadata; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; +import com.google.firestore.admin.v1.UpdateBackupScheduleRequest; import com.google.firestore.admin.v1.UpdateDatabaseMetadata; import com.google.firestore.admin.v1.UpdateDatabaseRequest; import com.google.firestore.admin.v1.UpdateFieldRequest; @@ -86,17 +100,18 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder() .add(ExportDocumentsResponse.getDescriptor()) - .add(UpdateDatabaseMetadata.getDescriptor()) .add(Field.getDescriptor()) - .add(Empty.getDescriptor()) + .add(RestoreDatabaseMetadata.getDescriptor()) .add(ImportDocumentsMetadata.getDescriptor()) .add(Database.getDescriptor()) + .add(FieldOperationMetadata.getDescriptor()) + .add(DeleteDatabaseMetadata.getDescriptor()) + .add(UpdateDatabaseMetadata.getDescriptor()) + .add(Empty.getDescriptor()) .add(Index.getDescriptor()) .add(CreateDatabaseMetadata.getDescriptor()) - .add(FieldOperationMetadata.getDescriptor()) .add(ExportDocumentsMetadata.getDescriptor()) .add(IndexOperationMetadata.getDescriptor()) - .add(DeleteDatabaseMetadata.getDescriptor()) .build(); private static final ApiMethodDescriptor @@ -623,6 +638,327 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor getBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackup") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Backup.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBackupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListBackups") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/backups", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBackupsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteBackupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackup") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/backups/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + restoreDatabaseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/RestoreDatabase") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*}/databases:restore", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RestoreDatabaseRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createBackupScheduleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/CreateBackupSchedule") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/databases/*}/backupSchedules", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backupSchedule", request.getBackupSchedule(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BackupSchedule.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getBackupScheduleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackupSchedule") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/databases/*/backupSchedules/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BackupSchedule.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBackupSchedulesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListBackupSchedules") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/databases/*}/backupSchedules", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBackupSchedulesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateBackupScheduleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/UpdateBackupSchedule") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{backupSchedule.name=projects/*/databases/*/backupSchedules/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "backupSchedule.name", + request.getBackupSchedule().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("backupSchedule", request.getBackupSchedule(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BackupSchedule.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteBackupScheduleMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/databases/*/backupSchedules/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private final UnaryCallable createIndexCallable; private final OperationCallable createIndexOperationCallable; @@ -655,6 +991,20 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { private final UnaryCallable deleteDatabaseCallable; private final OperationCallable deleteDatabaseOperationCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable deleteBackupCallable; + private final UnaryCallable restoreDatabaseCallable; + private final OperationCallable + restoreDatabaseOperationCallable; + private final UnaryCallable + createBackupScheduleCallable; + private final UnaryCallable getBackupScheduleCallable; + private final UnaryCallable + listBackupSchedulesCallable; + private final UnaryCallable + updateBackupScheduleCallable; + private final UnaryCallable deleteBackupScheduleCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -881,6 +1231,112 @@ protected HttpJsonFirestoreAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings getBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listBackupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBackupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings restoreDatabaseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(restoreDatabaseMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createBackupScheduleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBackupScheduleMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getBackupScheduleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBackupScheduleMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listBackupSchedulesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listBackupSchedulesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateBackupScheduleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBackupScheduleMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "backup_schedule.name", + String.valueOf(request.getBackupSchedule().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBackupScheduleTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupScheduleMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); this.createIndexCallable = callableFactory.createUnaryCallable( @@ -972,6 +1428,49 @@ protected HttpJsonFirestoreAdminStub( settings.deleteDatabaseOperationSettings(), clientContext, httpJsonOperationsStub); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.restoreDatabaseCallable = + callableFactory.createUnaryCallable( + restoreDatabaseTransportSettings, settings.restoreDatabaseSettings(), clientContext); + this.restoreDatabaseOperationCallable = + callableFactory.createOperationCallable( + restoreDatabaseTransportSettings, + settings.restoreDatabaseOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createBackupScheduleCallable = + callableFactory.createUnaryCallable( + createBackupScheduleTransportSettings, + settings.createBackupScheduleSettings(), + clientContext); + this.getBackupScheduleCallable = + callableFactory.createUnaryCallable( + getBackupScheduleTransportSettings, + settings.getBackupScheduleSettings(), + clientContext); + this.listBackupSchedulesCallable = + callableFactory.createUnaryCallable( + listBackupSchedulesTransportSettings, + settings.listBackupSchedulesSettings(), + clientContext); + this.updateBackupScheduleCallable = + callableFactory.createUnaryCallable( + updateBackupScheduleTransportSettings, + settings.updateBackupScheduleSettings(), + clientContext); + this.deleteBackupScheduleCallable = + callableFactory.createUnaryCallable( + deleteBackupScheduleTransportSettings, + settings.deleteBackupScheduleSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -994,6 +1493,15 @@ public static List getMethodDescriptors() { methodDescriptors.add(listDatabasesMethodDescriptor); methodDescriptors.add(updateDatabaseMethodDescriptor); methodDescriptors.add(deleteDatabaseMethodDescriptor); + methodDescriptors.add(getBackupMethodDescriptor); + methodDescriptors.add(listBackupsMethodDescriptor); + methodDescriptors.add(deleteBackupMethodDescriptor); + methodDescriptors.add(restoreDatabaseMethodDescriptor); + methodDescriptors.add(createBackupScheduleMethodDescriptor); + methodDescriptors.add(getBackupScheduleMethodDescriptor); + methodDescriptors.add(listBackupSchedulesMethodDescriptor); + methodDescriptors.add(updateBackupScheduleMethodDescriptor); + methodDescriptors.add(deleteBackupScheduleMethodDescriptor); return methodDescriptors; } @@ -1123,6 +1631,58 @@ public UnaryCallable deleteDatabaseCallable() return deleteDatabaseOperationCallable; } + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public UnaryCallable restoreDatabaseCallable() { + return restoreDatabaseCallable; + } + + @Override + public OperationCallable + restoreDatabaseOperationCallable() { + return restoreDatabaseOperationCallable; + } + + @Override + public UnaryCallable createBackupScheduleCallable() { + return createBackupScheduleCallable; + } + + @Override + public UnaryCallable getBackupScheduleCallable() { + return getBackupScheduleCallable; + } + + @Override + public UnaryCallable + listBackupSchedulesCallable() { + return listBackupSchedulesCallable; + } + + @Override + public UnaryCallable updateBackupScheduleCallable() { + return updateBackupScheduleCallable; + } + + @Override + public UnaryCallable deleteBackupScheduleCallable() { + return deleteBackupScheduleCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json b/google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json index e3b6a2e3cb..8b10cb6c37 100644 --- a/google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json +++ b/google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json @@ -449,6 +449,87 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.Backup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.Backup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.Backup$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.Backup$Stats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.Backup$Stats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.BackupSchedule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.BackupSchedule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.CreateBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.CreateBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.CreateDatabaseMetadata", "queryAllDeclaredConstructors": true, @@ -503,6 +584,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.DailyRecurrence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.DailyRecurrence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.Database", "queryAllDeclaredConstructors": true, @@ -566,6 +665,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.DeleteBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.DeleteBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.DeleteBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.DeleteBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.DeleteDatabaseMetadata", "queryAllDeclaredConstructors": true, @@ -809,6 +944,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.GetBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.GetBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.GetBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.GetBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.GetDatabaseRequest", "queryAllDeclaredConstructors": true, @@ -998,6 +1169,78 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.ListBackupSchedulesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.ListBackupSchedulesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.ListBackupSchedulesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.ListBackupSchedulesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.ListBackupsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.ListBackupsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.ListBackupsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.ListBackupsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.ListDatabasesRequest", "queryAllDeclaredConstructors": true, @@ -1151,6 +1394,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.RestoreDatabaseMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.RestoreDatabaseMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.RestoreDatabaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.RestoreDatabaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.UpdateBackupScheduleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.UpdateBackupScheduleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.UpdateDatabaseMetadata", "queryAllDeclaredConstructors": true, @@ -1205,6 +1502,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.WeeklyRecurrence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.WeeklyRecurrence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.longrunning.CancelOperationRequest", "queryAllDeclaredConstructors": true, @@ -2185,5 +2500,14 @@ "allPublicMethods": true, "allDeclaredClasses": true, "allPublicClasses": true + }, + { + "name": "com.google.type.DayOfWeek", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true } ] \ No newline at end of file diff --git a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java index 0d483b20f0..dee30271d9 100644 --- a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java +++ b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java @@ -30,6 +30,10 @@ import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.cloud.firestore.v1.stub.HttpJsonFirestoreAdminStub; import com.google.common.collect.Lists; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupName; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.BackupScheduleName; import com.google.firestore.admin.v1.CollectionGroupName; import com.google.firestore.admin.v1.Database; import com.google.firestore.admin.v1.DatabaseName; @@ -38,10 +42,14 @@ import com.google.firestore.admin.v1.FieldName; import com.google.firestore.admin.v1.Index; import com.google.firestore.admin.v1.IndexName; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.LocationName; import com.google.firestore.admin.v1.ProjectName; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; import com.google.longrunning.Operation; import com.google.protobuf.Any; import com.google.protobuf.Duration; @@ -1433,4 +1441,773 @@ public void deleteDatabaseExceptionTest2() throws Exception { } catch (ExecutionException e) { } } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDatabase(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setDatabaseUid("databaseUid816481493") + .setSnapshotTime(Timestamp.newBuilder().build()) + .setExpireTime(Timestamp.newBuilder().build()) + .setStats(Backup.Stats.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDatabase(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setDatabaseUid("databaseUid816481493") + .setSnapshotTime(Timestamp.newBuilder().build()) + .setExpireTime(Timestamp.newBuilder().build()) + .setStats(Backup.Stats.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest() throws Exception { + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .addAllBackups(new ArrayList()) + .addAllUnreachable(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsResponse actualResponse = client.listBackups(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .addAllBackups(new ArrayList()) + .addAllUnreachable(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListBackupsResponse actualResponse = client.listBackups(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackup(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + + client.deleteBackup(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1607/locations/location-1607/backups/backup-1607"; + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restoreDatabaseTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) + .setKeyPrefix("keyPrefix-2076395055") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RestoreDatabaseRequest request = + RestoreDatabaseRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDatabaseId("databaseId1688905718") + .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + + Database actualResponse = client.restoreDatabaseAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void restoreDatabaseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RestoreDatabaseRequest request = + RestoreDatabaseRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDatabaseId("databaseId1688905718") + .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + client.restoreDatabaseAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]"); + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + + BackupSchedule actualResponse = client.createBackupSchedule(parent, backupSchedule); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupScheduleExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]"); + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + client.createBackupSchedule(parent, backupSchedule); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupScheduleTest2() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9821/databases/database-9821"; + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + + BackupSchedule actualResponse = client.createBackupSchedule(parent, backupSchedule); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBackupScheduleExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9821/databases/database-9821"; + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + client.createBackupSchedule(parent, backupSchedule); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupScheduleName name = BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]"); + + BackupSchedule actualResponse = client.getBackupSchedule(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupScheduleExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]"); + client.getBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupScheduleTest2() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-3270/databases/database-3270/backupSchedules/backupSchedule-3270"; + + BackupSchedule actualResponse = client.getBackupSchedule(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBackupScheduleExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-3270/databases/database-3270/backupSchedules/backupSchedule-3270"; + client.getBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupSchedulesTest() throws Exception { + ListBackupSchedulesResponse expectedResponse = + ListBackupSchedulesResponse.newBuilder() + .addAllBackupSchedules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]"); + + ListBackupSchedulesResponse actualResponse = client.listBackupSchedules(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupSchedulesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]"); + client.listBackupSchedules(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupSchedulesTest2() throws Exception { + ListBackupSchedulesResponse expectedResponse = + ListBackupSchedulesResponse.newBuilder() + .addAllBackupSchedules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9821/databases/database-9821"; + + ListBackupSchedulesResponse actualResponse = client.listBackupSchedules(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBackupSchedulesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9821/databases/database-9821"; + client.listBackupSchedules(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BackupSchedule backupSchedule = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + BackupSchedule actualResponse = client.updateBackupSchedule(backupSchedule, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBackupScheduleExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupSchedule backupSchedule = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupSchedule(backupSchedule, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupScheduleTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + BackupScheduleName name = BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]"); + + client.deleteBackupSchedule(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBackupScheduleExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]"); + client.deleteBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupScheduleTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-3270/databases/database-3270/backupSchedules/backupSchedule-3270"; + + client.deleteBackupSchedule(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBackupScheduleExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-3270/databases/database-3270/backupSchedules/backupSchedule-3270"; + client.deleteBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java index f478f7d2c0..5aebfcf410 100644 --- a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java +++ b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java @@ -28,30 +28,46 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; import com.google.common.collect.Lists; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupName; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.BackupScheduleName; import com.google.firestore.admin.v1.CollectionGroupName; +import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; import com.google.firestore.admin.v1.DatabaseName; +import com.google.firestore.admin.v1.DeleteBackupRequest; +import com.google.firestore.admin.v1.DeleteBackupScheduleRequest; import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsRequest; import com.google.firestore.admin.v1.ExportDocumentsResponse; import com.google.firestore.admin.v1.Field; import com.google.firestore.admin.v1.FieldName; +import com.google.firestore.admin.v1.GetBackupRequest; +import com.google.firestore.admin.v1.GetBackupScheduleRequest; import com.google.firestore.admin.v1.GetDatabaseRequest; import com.google.firestore.admin.v1.GetFieldRequest; import com.google.firestore.admin.v1.GetIndexRequest; import com.google.firestore.admin.v1.ImportDocumentsRequest; import com.google.firestore.admin.v1.Index; import com.google.firestore.admin.v1.IndexName; +import com.google.firestore.admin.v1.ListBackupSchedulesRequest; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsRequest; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesRequest; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsRequest; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesRequest; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.LocationName; import com.google.firestore.admin.v1.ProjectName; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; +import com.google.firestore.admin.v1.UpdateBackupScheduleRequest; import com.google.firestore.admin.v1.UpdateDatabaseRequest; import com.google.firestore.admin.v1.UpdateFieldRequest; import com.google.longrunning.Operation; @@ -1296,4 +1312,672 @@ public void deleteDatabaseExceptionTest2() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDatabase(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setDatabaseUid("databaseUid816481493") + .setSnapshotTime(Timestamp.newBuilder().build()) + .setExpireTime(Timestamp.newBuilder().build()) + .setStats(Backup.Stats.newBuilder().build()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .setDatabase(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setDatabaseUid("databaseUid816481493") + .setSnapshotTime(Timestamp.newBuilder().build()) + .setExpireTime(Timestamp.newBuilder().build()) + .setStats(Backup.Stats.newBuilder().build()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest() throws Exception { + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .addAllBackups(new ArrayList()) + .addAllUnreachable(new ArrayList()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBackupsResponse actualResponse = client.listBackups(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .addAllBackups(new ArrayList()) + .addAllUnreachable(new ArrayList()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupsResponse actualResponse = client.listBackups(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + + client.deleteBackup(name); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]"); + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteBackup(name); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restoreDatabaseTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) + .setKeyPrefix("keyPrefix-2076395055") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFirestoreAdmin.addResponse(resultOperation); + + RestoreDatabaseRequest request = + RestoreDatabaseRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDatabaseId("databaseId1688905718") + .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + + Database actualResponse = client.restoreDatabaseAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreDatabaseRequest actualRequest = ((RestoreDatabaseRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getDatabaseId(), actualRequest.getDatabaseId()); + Assert.assertEquals(request.getBackup(), actualRequest.getBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreDatabaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + RestoreDatabaseRequest request = + RestoreDatabaseRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDatabaseId("databaseId1688905718") + .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString()) + .build(); + client.restoreDatabaseAsync(request).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 + public void createBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]"); + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + + BackupSchedule actualResponse = client.createBackupSchedule(parent, backupSchedule); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupScheduleRequest actualRequest = + ((CreateBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backupSchedule, actualRequest.getBackupSchedule()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]"); + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + client.createBackupSchedule(parent, backupSchedule); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupScheduleTest2() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + + BackupSchedule actualResponse = client.createBackupSchedule(parent, backupSchedule); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupScheduleRequest actualRequest = + ((CreateBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backupSchedule, actualRequest.getBackupSchedule()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupScheduleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + client.createBackupSchedule(parent, backupSchedule); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + BackupScheduleName name = BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]"); + + BackupSchedule actualResponse = client.getBackupSchedule(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupScheduleRequest actualRequest = ((GetBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]"); + client.getBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupScheduleTest2() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + BackupSchedule actualResponse = client.getBackupSchedule(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupScheduleRequest actualRequest = ((GetBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupScheduleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupSchedulesTest() throws Exception { + ListBackupSchedulesResponse expectedResponse = + ListBackupSchedulesResponse.newBuilder() + .addAllBackupSchedules(new ArrayList()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]"); + + ListBackupSchedulesResponse actualResponse = client.listBackupSchedules(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupSchedulesRequest actualRequest = ((ListBackupSchedulesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupSchedulesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]"); + client.listBackupSchedules(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupSchedulesTest2() throws Exception { + ListBackupSchedulesResponse expectedResponse = + ListBackupSchedulesResponse.newBuilder() + .addAllBackupSchedules(new ArrayList()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupSchedulesResponse actualResponse = client.listBackupSchedules(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupSchedulesRequest actualRequest = ((ListBackupSchedulesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupSchedulesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackupSchedules(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupScheduleTest() throws Exception { + BackupSchedule expectedResponse = + BackupSchedule.newBuilder() + .setName( + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetention(Duration.newBuilder().build()) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + BackupSchedule actualResponse = client.updateBackupSchedule(backupSchedule, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupScheduleRequest actualRequest = + ((UpdateBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(backupSchedule, actualRequest.getBackupSchedule()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + BackupSchedule backupSchedule = BackupSchedule.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackupSchedule(backupSchedule, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupScheduleTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + BackupScheduleName name = BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]"); + + client.deleteBackupSchedule(name); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupScheduleRequest actualRequest = + ((DeleteBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + BackupScheduleName name = + BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]"); + client.deleteBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupScheduleTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteBackupSchedule(name); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupScheduleRequest actualRequest = + ((DeleteBackupScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupScheduleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackupSchedule(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java index 84dc66848b..02c02f8af4 100644 --- a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java +++ b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java @@ -17,25 +17,38 @@ package com.google.cloud.firestore.v1; import com.google.api.core.BetaApi; +import com.google.firestore.admin.v1.Backup; +import com.google.firestore.admin.v1.BackupSchedule; +import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteBackupRequest; +import com.google.firestore.admin.v1.DeleteBackupScheduleRequest; import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsRequest; import com.google.firestore.admin.v1.Field; import com.google.firestore.admin.v1.FirestoreAdminGrpc.FirestoreAdminImplBase; +import com.google.firestore.admin.v1.GetBackupRequest; +import com.google.firestore.admin.v1.GetBackupScheduleRequest; import com.google.firestore.admin.v1.GetDatabaseRequest; import com.google.firestore.admin.v1.GetFieldRequest; import com.google.firestore.admin.v1.GetIndexRequest; import com.google.firestore.admin.v1.ImportDocumentsRequest; import com.google.firestore.admin.v1.Index; +import com.google.firestore.admin.v1.ListBackupSchedulesRequest; +import com.google.firestore.admin.v1.ListBackupSchedulesResponse; +import com.google.firestore.admin.v1.ListBackupsRequest; +import com.google.firestore.admin.v1.ListBackupsResponse; import com.google.firestore.admin.v1.ListDatabasesRequest; import com.google.firestore.admin.v1.ListDatabasesResponse; import com.google.firestore.admin.v1.ListFieldsRequest; import com.google.firestore.admin.v1.ListFieldsResponse; import com.google.firestore.admin.v1.ListIndexesRequest; import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.RestoreDatabaseRequest; +import com.google.firestore.admin.v1.UpdateBackupScheduleRequest; import com.google.firestore.admin.v1.UpdateDatabaseRequest; import com.google.firestore.admin.v1.UpdateFieldRequest; import com.google.longrunning.Operation; @@ -367,4 +380,192 @@ public void deleteDatabase( Exception.class.getName()))); } } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup(DeleteBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreDatabase( + RestoreDatabaseRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method RestoreDatabase, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBackupSchedule( + CreateBackupScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupSchedule) { + requests.add(request); + responseObserver.onNext(((BackupSchedule) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBackupSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupSchedule.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackupSchedule( + GetBackupScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupSchedule) { + requests.add(request); + responseObserver.onNext(((BackupSchedule) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetBackupSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupSchedule.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackupSchedules( + ListBackupSchedulesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupSchedulesResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupSchedulesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListBackupSchedules, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupSchedulesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackupSchedule( + UpdateBackupScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BackupSchedule) { + requests.add(request); + responseObserver.onNext(((BackupSchedule) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBackupSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BackupSchedule.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackupSchedule( + DeleteBackupScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method DeleteBackupSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/google-cloud-firestore-bom/pom.xml b/google-cloud-firestore-bom/pom.xml index 54236bfd61..a1f0d0fffc 100644 --- a/google-cloud-firestore-bom/pom.xml +++ b/google-cloud-firestore-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-firestore-bom - 3.18.0 + 3.19.0 pom com.google.cloud @@ -52,37 +52,37 @@ com.google.cloud google-cloud-firestore - 3.18.0 + 3.19.0 com.google.cloud google-cloud-firestore-admin - 3.18.0 + 3.19.0 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.18.0 + 3.19.0 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.18.0 + 3.19.0 com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.18.0 + 3.19.0 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.18.0 + 3.19.0 com.google.cloud proto-google-cloud-firestore-bundle-v1 - 3.18.0 + 3.19.0
diff --git a/google-cloud-firestore/pom.xml b/google-cloud-firestore/pom.xml index be6ce32249..1aa46fd7b0 100644 --- a/google-cloud-firestore/pom.xml +++ b/google-cloud-firestore/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-firestore - 3.18.0 + 3.19.0 jar Google Cloud Firestore https://github.com/googleapis/java-firestore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-firestore-parent - 3.18.0 + 3.19.0 google-cloud-firestore diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java index ddc68f89d4..95130776ca 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java @@ -1107,7 +1107,11 @@ public final UnaryCallable rollbackCallable() { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (FirestoreClient firestoreClient = FirestoreClient.create()) { - * RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + * RunQueryRequest request = + * RunQueryRequest.newBuilder() + * .setParent("parent-995424086") + * .setExplainOptions(ExplainOptions.newBuilder().build()) + * .build(); * ServerStream stream = firestoreClient.runQueryCallable().call(request); * for (RunQueryResponse response : stream) { * // Do something when a response is received. @@ -1143,7 +1147,10 @@ public final ServerStreamingCallable runQuery * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (FirestoreClient firestoreClient = FirestoreClient.create()) { * RunAggregationQueryRequest request = - * RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + * RunAggregationQueryRequest.newBuilder() + * .setParent("parent-995424086") + * .setExplainOptions(ExplainOptions.newBuilder().build()) + * .build(); * ServerStream stream = * firestoreClient.runAggregationQueryCallable().call(request); * for (RunAggregationQueryResponse response : stream) { diff --git a/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json b/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json index 3ac840905f..0fa7fcc550 100644 --- a/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json +++ b/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json @@ -854,6 +854,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.v1.ExecutionStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ExecutionStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.v1.ExistenceFilter", "queryAllDeclaredConstructors": true, @@ -872,6 +890,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.v1.ExplainMetrics", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ExplainMetrics$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ExplainOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ExplainOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.v1.GetDocumentRequest", "queryAllDeclaredConstructors": true, @@ -1052,6 +1106,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.v1.PlanSummary", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.PlanSummary$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.v1.Precondition", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java index d898445020..885ebc7b98 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java @@ -47,6 +47,8 @@ import com.google.firestore.v1.DeleteDocumentRequest; import com.google.firestore.v1.Document; import com.google.firestore.v1.DocumentMask; +import com.google.firestore.v1.ExplainMetrics; +import com.google.firestore.v1.ExplainOptions; import com.google.firestore.v1.GetDocumentRequest; import com.google.firestore.v1.ListCollectionIdsRequest; import com.google.firestore.v1.ListCollectionIdsResponse; @@ -505,9 +507,14 @@ public void runQueryTest() throws Exception { .setDocument(Document.newBuilder().build()) .setReadTime(Timestamp.newBuilder().build()) .setSkippedResults(880286183) + .setExplainMetrics(ExplainMetrics.newBuilder().build()) .build(); mockFirestore.addResponse(expectedResponse); - RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunQueryRequest request = + RunQueryRequest.newBuilder() + .setParent("parent-995424086") + .setExplainOptions(ExplainOptions.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -523,7 +530,11 @@ public void runQueryTest() throws Exception { public void runQueryExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFirestore.addException(exception); - RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunQueryRequest request = + RunQueryRequest.newBuilder() + .setParent("parent-995424086") + .setExplainOptions(ExplainOptions.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -547,10 +558,14 @@ public void runAggregationQueryTest() throws Exception { .setResult(AggregationResult.newBuilder().build()) .setTransaction(ByteString.EMPTY) .setReadTime(Timestamp.newBuilder().build()) + .setExplainMetrics(ExplainMetrics.newBuilder().build()) .build(); mockFirestore.addResponse(expectedResponse); RunAggregationQueryRequest request = - RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunAggregationQueryRequest.newBuilder() + .setParent("parent-995424086") + .setExplainOptions(ExplainOptions.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -568,7 +583,10 @@ public void runAggregationQueryExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFirestore.addException(exception); RunAggregationQueryRequest request = - RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunAggregationQueryRequest.newBuilder() + .setParent("parent-995424086") + .setExplainOptions(ExplainOptions.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); diff --git a/grpc-google-cloud-firestore-admin-v1/clirr-ignored-differences.xml b/grpc-google-cloud-firestore-admin-v1/clirr-ignored-differences.xml index f5e990727d..9a609086fc 100644 --- a/grpc-google-cloud-firestore-admin-v1/clirr-ignored-differences.xml +++ b/grpc-google-cloud-firestore-admin-v1/clirr-ignored-differences.xml @@ -4,6 +4,46 @@ 7012 com/google/firestore/admin/v1/FirestoreAdminGrpc* - *deleteDatabase(com.google.firestore.admin.v1.DeleteDatabaseRequest, io.grpc.stub.StreamObserver) + void createBackupSchedule(com.google.firestore.admin.v1.CreateBackupScheduleRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/firestore/admin/v1/FirestoreAdminGrpc* + void deleteBackup(com.google.firestore.admin.v1.DeleteBackupRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/firestore/admin/v1/FirestoreAdminGrpc* + void deleteBackupSchedule(com.google.firestore.admin.v1.DeleteBackupScheduleRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/firestore/admin/v1/FirestoreAdminGrpc* + void getBackup(com.google.firestore.admin.v1.GetBackupRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/firestore/admin/v1/FirestoreAdminGrpc* + void getBackupSchedule(com.google.firestore.admin.v1.GetBackupScheduleRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/firestore/admin/v1/FirestoreAdminGrpc* + void listBackupSchedules(com.google.firestore.admin.v1.ListBackupSchedulesRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/firestore/admin/v1/FirestoreAdminGrpc* + void listBackups(com.google.firestore.admin.v1.ListBackupsRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/firestore/admin/v1/FirestoreAdminGrpc* + void restoreDatabase(com.google.firestore.admin.v1.RestoreDatabaseRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/firestore/admin/v1/FirestoreAdminGrpc* + void updateBackupSchedule(com.google.firestore.admin.v1.UpdateBackupScheduleRequest, io.grpc.stub.StreamObserver) diff --git a/grpc-google-cloud-firestore-admin-v1/pom.xml b/grpc-google-cloud-firestore-admin-v1/pom.xml index ad2565785c..3605e868da 100644 --- a/grpc-google-cloud-firestore-admin-v1/pom.xml +++ b/grpc-google-cloud-firestore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.18.0 + 3.19.0 grpc-google-cloud-firestore-admin-v1 GRPC library for grpc-google-cloud-firestore-admin-v1 com.google.cloud google-cloud-firestore-parent - 3.18.0 + 3.19.0 diff --git a/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java b/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java index 97073f14bc..f63bfc4705 100644 --- a/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java +++ b/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java @@ -662,6 +662,419 @@ private FirestoreAdminGrpc() {} return getDeleteDatabaseMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetBackupRequest, com.google.firestore.admin.v1.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.firestore.admin.v1.GetBackupRequest.class, + responseType = com.google.firestore.admin.v1.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetBackupRequest, com.google.firestore.admin.v1.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetBackupRequest, com.google.firestore.admin.v1.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = FirestoreAdminGrpc.getGetBackupMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getGetBackupMethod = FirestoreAdminGrpc.getGetBackupMethod) == null) { + FirestoreAdminGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.Backup.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreAdminMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListBackupsRequest, + com.google.firestore.admin.v1.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.firestore.admin.v1.ListBackupsRequest.class, + responseType = com.google.firestore.admin.v1.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListBackupsRequest, + com.google.firestore.admin.v1.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListBackupsRequest, + com.google.firestore.admin.v1.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = FirestoreAdminGrpc.getListBackupsMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getListBackupsMethod = FirestoreAdminGrpc.getListBackupsMethod) == null) { + FirestoreAdminGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ListBackupsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ListBackupsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.firestore.admin.v1.DeleteBackupRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = FirestoreAdminGrpc.getDeleteBackupMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getDeleteBackupMethod = FirestoreAdminGrpc.getDeleteBackupMethod) == null) { + FirestoreAdminGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.DeleteBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.RestoreDatabaseRequest, com.google.longrunning.Operation> + getRestoreDatabaseMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreDatabase", + requestType = com.google.firestore.admin.v1.RestoreDatabaseRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.RestoreDatabaseRequest, com.google.longrunning.Operation> + getRestoreDatabaseMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.RestoreDatabaseRequest, com.google.longrunning.Operation> + getRestoreDatabaseMethod; + if ((getRestoreDatabaseMethod = FirestoreAdminGrpc.getRestoreDatabaseMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getRestoreDatabaseMethod = FirestoreAdminGrpc.getRestoreDatabaseMethod) == null) { + FirestoreAdminGrpc.getRestoreDatabaseMethod = + getRestoreDatabaseMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreDatabase")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.RestoreDatabaseRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("RestoreDatabase")) + .build(); + } + } + } + return getRestoreDatabaseMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CreateBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getCreateBackupScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackupSchedule", + requestType = com.google.firestore.admin.v1.CreateBackupScheduleRequest.class, + responseType = com.google.firestore.admin.v1.BackupSchedule.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CreateBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getCreateBackupScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CreateBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getCreateBackupScheduleMethod; + if ((getCreateBackupScheduleMethod = FirestoreAdminGrpc.getCreateBackupScheduleMethod) + == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getCreateBackupScheduleMethod = FirestoreAdminGrpc.getCreateBackupScheduleMethod) + == null) { + FirestoreAdminGrpc.getCreateBackupScheduleMethod = + getCreateBackupScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateBackupSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.CreateBackupScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("CreateBackupSchedule")) + .build(); + } + } + } + return getCreateBackupScheduleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getGetBackupScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackupSchedule", + requestType = com.google.firestore.admin.v1.GetBackupScheduleRequest.class, + responseType = com.google.firestore.admin.v1.BackupSchedule.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getGetBackupScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getGetBackupScheduleMethod; + if ((getGetBackupScheduleMethod = FirestoreAdminGrpc.getGetBackupScheduleMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getGetBackupScheduleMethod = FirestoreAdminGrpc.getGetBackupScheduleMethod) == null) { + FirestoreAdminGrpc.getGetBackupScheduleMethod = + getGetBackupScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackupSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.GetBackupScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("GetBackupSchedule")) + .build(); + } + } + } + return getGetBackupScheduleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListBackupSchedulesRequest, + com.google.firestore.admin.v1.ListBackupSchedulesResponse> + getListBackupSchedulesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackupSchedules", + requestType = com.google.firestore.admin.v1.ListBackupSchedulesRequest.class, + responseType = com.google.firestore.admin.v1.ListBackupSchedulesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListBackupSchedulesRequest, + com.google.firestore.admin.v1.ListBackupSchedulesResponse> + getListBackupSchedulesMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListBackupSchedulesRequest, + com.google.firestore.admin.v1.ListBackupSchedulesResponse> + getListBackupSchedulesMethod; + if ((getListBackupSchedulesMethod = FirestoreAdminGrpc.getListBackupSchedulesMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getListBackupSchedulesMethod = FirestoreAdminGrpc.getListBackupSchedulesMethod) + == null) { + FirestoreAdminGrpc.getListBackupSchedulesMethod = + getListBackupSchedulesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListBackupSchedules")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ListBackupSchedulesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ListBackupSchedulesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("ListBackupSchedules")) + .build(); + } + } + } + return getListBackupSchedulesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.UpdateBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getUpdateBackupScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackupSchedule", + requestType = com.google.firestore.admin.v1.UpdateBackupScheduleRequest.class, + responseType = com.google.firestore.admin.v1.BackupSchedule.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.UpdateBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getUpdateBackupScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.UpdateBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule> + getUpdateBackupScheduleMethod; + if ((getUpdateBackupScheduleMethod = FirestoreAdminGrpc.getUpdateBackupScheduleMethod) + == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getUpdateBackupScheduleMethod = FirestoreAdminGrpc.getUpdateBackupScheduleMethod) + == null) { + FirestoreAdminGrpc.getUpdateBackupScheduleMethod = + getUpdateBackupScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateBackupSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.UpdateBackupScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("UpdateBackupSchedule")) + .build(); + } + } + } + return getUpdateBackupScheduleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteBackupScheduleRequest, com.google.protobuf.Empty> + getDeleteBackupScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackupSchedule", + requestType = com.google.firestore.admin.v1.DeleteBackupScheduleRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteBackupScheduleRequest, com.google.protobuf.Empty> + getDeleteBackupScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteBackupScheduleRequest, com.google.protobuf.Empty> + getDeleteBackupScheduleMethod; + if ((getDeleteBackupScheduleMethod = FirestoreAdminGrpc.getDeleteBackupScheduleMethod) + == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getDeleteBackupScheduleMethod = FirestoreAdminGrpc.getDeleteBackupScheduleMethod) + == null) { + FirestoreAdminGrpc.getDeleteBackupScheduleMethod = + getDeleteBackupScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteBackupSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.DeleteBackupScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("DeleteBackupSchedule")) + .build(); + } + } + } + return getDeleteBackupScheduleMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static FirestoreAdminStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -963,6 +1376,153 @@ default void deleteDatabase( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getDeleteDatabaseMethod(), responseObserver); } + + /** + * + * + *
+     * Gets information about a backup.
+     * 
+ */ + default void getBackup( + com.google.firestore.admin.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all the backups.
+     * 
+ */ + default void listBackups( + com.google.firestore.admin.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + default void deleteBackup( + com.google.firestore.admin.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new database by restoring from an existing backup.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing backup. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase]
+     * except instead of creating a new empty database, a new database is created
+     * with the database type, index configuration, and documents from an existing
+     * backup.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the restore, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the restore was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
+     * 
+ */ + default void restoreDatabase( + com.google.firestore.admin.v1.RestoreDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreDatabaseMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a backup schedule on a database.
+     * At most two backup schedules can be configured on a database, one daily
+     * backup schedule with retention up to 7 days and one weekly backup schedule
+     * with retention up to 14 weeks.
+     * 
+ */ + default void createBackupSchedule( + com.google.firestore.admin.v1.CreateBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupScheduleMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information about a backup schedule.
+     * 
+ */ + default void getBackupSchedule( + com.google.firestore.admin.v1.GetBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetBackupScheduleMethod(), responseObserver); + } + + /** + * + * + *
+     * List backup schedules.
+     * 
+ */ + default void listBackupSchedules( + com.google.firestore.admin.v1.ListBackupSchedulesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupSchedulesMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a backup schedule.
+     * 
+ */ + default void updateBackupSchedule( + com.google.firestore.admin.v1.UpdateBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupScheduleMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a backup schedule.
+     * 
+ */ + default void deleteBackupSchedule( + com.google.firestore.admin.v1.DeleteBackupScheduleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupScheduleMethod(), responseObserver); + } } /** @@ -1185,11 +1745,159 @@ public void listFields( * https://cloud.google.com/firestore/docs/manage-data/export-import * */ - public void exportDocuments( - com.google.firestore.admin.v1.ExportDocumentsRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void exportDocuments( + com.google.firestore.admin.v1.ExportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExportDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Imports documents into Google Cloud Firestore. Existing documents with the
+     * same name are overwritten. The import occurs in the background and its
+     * progress can be monitored and managed via the Operation resource that is
+     * created. If an ImportDocuments operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Firestore.
+     * 
+ */ + public void importDocuments( + com.google.firestore.admin.v1.ImportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Create a database.
+     * 
+ */ + public void createDatabase( + com.google.firestore.admin.v1.CreateDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDatabaseMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about a database.
+     * 
+ */ + public void getDatabase( + com.google.firestore.admin.v1.GetDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDatabaseMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List all the databases in the project.
+     * 
+ */ + public void listDatabases( + com.google.firestore.admin.v1.ListDatabasesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDatabasesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a database.
+     * 
+ */ + public void updateDatabase( + com.google.firestore.admin.v1.UpdateDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDatabaseMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a database.
+     * 
+ */ + public void deleteDatabase( + com.google.firestore.admin.v1.DeleteDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDatabaseMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about a backup.
+     * 
+ */ + public void getBackup( + com.google.firestore.admin.v1.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all the backups.
+     * 
+ */ + public void listBackups( + com.google.firestore.admin.v1.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public void deleteBackup( + com.google.firestore.admin.v1.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getExportDocumentsMethod(), getCallOptions()), + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request, responseObserver); } @@ -1198,18 +1906,28 @@ public void exportDocuments( * * *
-     * Imports documents into Google Cloud Firestore. Existing documents with the
-     * same name are overwritten. The import occurs in the background and its
-     * progress can be monitored and managed via the Operation resource that is
-     * created. If an ImportDocuments operation is cancelled, it is possible
-     * that a subset of the data has already been imported to Cloud Firestore.
+     * Creates a new database by restoring from an existing backup.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing backup. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase]
+     * except instead of creating a new empty database, a new database is created
+     * with the database type, index configuration, and documents from an existing
+     * backup.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the restore, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the restore was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
      * 
*/ - public void importDocuments( - com.google.firestore.admin.v1.ImportDocumentsRequest request, + public void restoreDatabase( + com.google.firestore.admin.v1.RestoreDatabaseRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getImportDocumentsMethod(), getCallOptions()), + getChannel().newCall(getRestoreDatabaseMethod(), getCallOptions()), request, responseObserver); } @@ -1218,14 +1936,18 @@ public void importDocuments( * * *
-     * Create a database.
+     * Creates a backup schedule on a database.
+     * At most two backup schedules can be configured on a database, one daily
+     * backup schedule with retention up to 7 days and one weekly backup schedule
+     * with retention up to 14 weeks.
      * 
*/ - public void createDatabase( - com.google.firestore.admin.v1.CreateDatabaseRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void createBackupSchedule( + com.google.firestore.admin.v1.CreateBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateDatabaseMethod(), getCallOptions()), + getChannel().newCall(getCreateBackupScheduleMethod(), getCallOptions()), request, responseObserver); } @@ -1234,14 +1956,15 @@ public void createDatabase( * * *
-     * Gets information about a database.
+     * Gets information about a backup schedule.
      * 
*/ - public void getDatabase( - com.google.firestore.admin.v1.GetDatabaseRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void getBackupSchedule( + com.google.firestore.admin.v1.GetBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetDatabaseMethod(), getCallOptions()), + getChannel().newCall(getGetBackupScheduleMethod(), getCallOptions()), request, responseObserver); } @@ -1250,15 +1973,15 @@ public void getDatabase( * * *
-     * List all the databases in the project.
+     * List backup schedules.
      * 
*/ - public void listDatabases( - com.google.firestore.admin.v1.ListDatabasesRequest request, - io.grpc.stub.StreamObserver + public void listBackupSchedules( + com.google.firestore.admin.v1.ListBackupSchedulesRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListDatabasesMethod(), getCallOptions()), + getChannel().newCall(getListBackupSchedulesMethod(), getCallOptions()), request, responseObserver); } @@ -1267,14 +1990,15 @@ public void listDatabases( * * *
-     * Updates a database.
+     * Updates a backup schedule.
      * 
*/ - public void updateDatabase( - com.google.firestore.admin.v1.UpdateDatabaseRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void updateBackupSchedule( + com.google.firestore.admin.v1.UpdateBackupScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateDatabaseMethod(), getCallOptions()), + getChannel().newCall(getUpdateBackupScheduleMethod(), getCallOptions()), request, responseObserver); } @@ -1283,14 +2007,14 @@ public void updateDatabase( * * *
-     * Deletes a database.
+     * Deletes a backup schedule.
      * 
*/ - public void deleteDatabase( - com.google.firestore.admin.v1.DeleteDatabaseRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void deleteBackupSchedule( + com.google.firestore.admin.v1.DeleteBackupScheduleRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteDatabaseMethod(), getCallOptions()), + getChannel().newCall(getDeleteBackupScheduleMethod(), getCallOptions()), request, responseObserver); } @@ -1552,6 +2276,140 @@ public com.google.longrunning.Operation deleteDatabase( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteDatabaseMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Gets information about a backup.
+     * 
+ */ + public com.google.firestore.admin.v1.Backup getBackup( + com.google.firestore.admin.v1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all the backups.
+     * 
+ */ + public com.google.firestore.admin.v1.ListBackupsResponse listBackups( + com.google.firestore.admin.v1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public com.google.protobuf.Empty deleteBackup( + com.google.firestore.admin.v1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new database by restoring from an existing backup.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing backup. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase]
+     * except instead of creating a new empty database, a new database is created
+     * with the database type, index configuration, and documents from an existing
+     * backup.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the restore, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the restore was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
+     * 
+ */ + public com.google.longrunning.Operation restoreDatabase( + com.google.firestore.admin.v1.RestoreDatabaseRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreDatabaseMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a backup schedule on a database.
+     * At most two backup schedules can be configured on a database, one daily
+     * backup schedule with retention up to 7 days and one weekly backup schedule
+     * with retention up to 14 weeks.
+     * 
+ */ + public com.google.firestore.admin.v1.BackupSchedule createBackupSchedule( + com.google.firestore.admin.v1.CreateBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupScheduleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a backup schedule.
+     * 
+ */ + public com.google.firestore.admin.v1.BackupSchedule getBackupSchedule( + com.google.firestore.admin.v1.GetBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupScheduleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List backup schedules.
+     * 
+ */ + public com.google.firestore.admin.v1.ListBackupSchedulesResponse listBackupSchedules( + com.google.firestore.admin.v1.ListBackupSchedulesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupSchedulesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a backup schedule.
+     * 
+ */ + public com.google.firestore.admin.v1.BackupSchedule updateBackupSchedule( + com.google.firestore.admin.v1.UpdateBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupScheduleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a backup schedule.
+     * 
+ */ + public com.google.protobuf.Empty deleteBackupSchedule( + com.google.firestore.admin.v1.DeleteBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupScheduleMethod(), getCallOptions(), request); + } } /** @@ -1814,6 +2672,145 @@ protected FirestoreAdminFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteDatabaseMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Gets information about a backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getBackup(com.google.firestore.admin.v1.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all the backups.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.admin.v1.ListBackupsResponse> + listBackups(com.google.firestore.admin.v1.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.firestore.admin.v1.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new database by restoring from an existing backup.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing backup. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase]
+     * except instead of creating a new empty database, a new database is created
+     * with the database type, index configuration, and documents from an existing
+     * backup.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the restore, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the restore was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restoreDatabase(com.google.firestore.admin.v1.RestoreDatabaseRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreDatabaseMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a backup schedule on a database.
+     * At most two backup schedules can be configured on a database, one daily
+     * backup schedule with retention up to 7 days and one weekly backup schedule
+     * with retention up to 14 weeks.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.admin.v1.BackupSchedule> + createBackupSchedule(com.google.firestore.admin.v1.CreateBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupScheduleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information about a backup schedule.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.admin.v1.BackupSchedule> + getBackupSchedule(com.google.firestore.admin.v1.GetBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupScheduleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List backup schedules.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.admin.v1.ListBackupSchedulesResponse> + listBackupSchedules(com.google.firestore.admin.v1.ListBackupSchedulesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupSchedulesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a backup schedule.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.admin.v1.BackupSchedule> + updateBackupSchedule(com.google.firestore.admin.v1.UpdateBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupScheduleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a backup schedule.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackupSchedule(com.google.firestore.admin.v1.DeleteBackupScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupScheduleMethod(), getCallOptions()), request); + } } private static final int METHODID_CREATE_INDEX = 0; @@ -1830,6 +2827,15 @@ protected FirestoreAdminFutureStub build( private static final int METHODID_LIST_DATABASES = 11; private static final int METHODID_UPDATE_DATABASE = 12; private static final int METHODID_DELETE_DATABASE = 13; + private static final int METHODID_GET_BACKUP = 14; + private static final int METHODID_LIST_BACKUPS = 15; + private static final int METHODID_DELETE_BACKUP = 16; + private static final int METHODID_RESTORE_DATABASE = 17; + private static final int METHODID_CREATE_BACKUP_SCHEDULE = 18; + private static final int METHODID_GET_BACKUP_SCHEDULE = 19; + private static final int METHODID_LIST_BACKUP_SCHEDULES = 20; + private static final int METHODID_UPDATE_BACKUP_SCHEDULE = 21; + private static final int METHODID_DELETE_BACKUP_SCHEDULE = 22; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1922,6 +2928,57 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.firestore.admin.v1.DeleteDatabaseRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.firestore.admin.v1.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.firestore.admin.v1.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.firestore.admin.v1.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESTORE_DATABASE: + serviceImpl.restoreDatabase( + (com.google.firestore.admin.v1.RestoreDatabaseRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BACKUP_SCHEDULE: + serviceImpl.createBackupSchedule( + (com.google.firestore.admin.v1.CreateBackupScheduleRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BACKUP_SCHEDULE: + serviceImpl.getBackupSchedule( + (com.google.firestore.admin.v1.GetBackupScheduleRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_BACKUP_SCHEDULES: + serviceImpl.listBackupSchedules( + (com.google.firestore.admin.v1.ListBackupSchedulesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.firestore.admin.v1.ListBackupSchedulesResponse>) + responseObserver); + break; + case METHODID_UPDATE_BACKUP_SCHEDULE: + serviceImpl.updateBackupSchedule( + (com.google.firestore.admin.v1.UpdateBackupScheduleRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_BACKUP_SCHEDULE: + serviceImpl.deleteBackupSchedule( + (com.google.firestore.admin.v1.DeleteBackupScheduleRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -2027,6 +3084,65 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.firestore.admin.v1.DeleteDatabaseRequest, com.google.longrunning.Operation>(service, METHODID_DELETE_DATABASE))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.GetBackupRequest, + com.google.firestore.admin.v1.Backup>(service, METHODID_GET_BACKUP))) + .addMethod( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.ListBackupsRequest, + com.google.firestore.admin.v1.ListBackupsResponse>( + service, METHODID_LIST_BACKUPS))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.DeleteBackupRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_BACKUP))) + .addMethod( + getRestoreDatabaseMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.RestoreDatabaseRequest, + com.google.longrunning.Operation>(service, METHODID_RESTORE_DATABASE))) + .addMethod( + getCreateBackupScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.CreateBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule>( + service, METHODID_CREATE_BACKUP_SCHEDULE))) + .addMethod( + getGetBackupScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.GetBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule>( + service, METHODID_GET_BACKUP_SCHEDULE))) + .addMethod( + getListBackupSchedulesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.ListBackupSchedulesRequest, + com.google.firestore.admin.v1.ListBackupSchedulesResponse>( + service, METHODID_LIST_BACKUP_SCHEDULES))) + .addMethod( + getUpdateBackupScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.UpdateBackupScheduleRequest, + com.google.firestore.admin.v1.BackupSchedule>( + service, METHODID_UPDATE_BACKUP_SCHEDULE))) + .addMethod( + getDeleteBackupScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.DeleteBackupScheduleRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_BACKUP_SCHEDULE))) .build(); } @@ -2092,6 +3208,15 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListDatabasesMethod()) .addMethod(getUpdateDatabaseMethod()) .addMethod(getDeleteDatabaseMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getDeleteBackupMethod()) + .addMethod(getRestoreDatabaseMethod()) + .addMethod(getCreateBackupScheduleMethod()) + .addMethod(getGetBackupScheduleMethod()) + .addMethod(getListBackupSchedulesMethod()) + .addMethod(getUpdateBackupScheduleMethod()) + .addMethod(getDeleteBackupScheduleMethod()) .build(); } } diff --git a/grpc-google-cloud-firestore-v1/pom.xml b/grpc-google-cloud-firestore-v1/pom.xml index 6f87981498..00e42df708 100644 --- a/grpc-google-cloud-firestore-v1/pom.xml +++ b/grpc-google-cloud-firestore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.18.0 + 3.19.0 grpc-google-cloud-firestore-v1 GRPC library for grpc-google-cloud-firestore-v1 com.google.cloud google-cloud-firestore-parent - 3.18.0 + 3.19.0 diff --git a/pom.xml b/pom.xml index 3b820ccabb..07983d1170 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-firestore-parent pom - 3.18.0 + 3.19.0 Google Cloud Firestore Parent https://github.com/googleapis/java-firestore @@ -150,32 +150,32 @@ com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.18.0 + 3.19.0 com.google.cloud google-cloud-firestore - 3.18.0 + 3.19.0 com.google.cloud proto-google-cloud-firestore-bundle-v1 - 3.18.0 + 3.19.0 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.18.0 + 3.19.0 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.18.0 + 3.19.0 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.18.0 + 3.19.0 @@ -262,6 +262,27 @@ com/google/cloud/firestore/v1/package-info.java
+ + + + org.apache.maven.plugins + maven-javadoc-plugin + + + ${sourceFileExclude} + + + + + aggregate + + aggregate + + + + + +
diff --git a/proto-google-cloud-firestore-admin-v1/pom.xml b/proto-google-cloud-firestore-admin-v1/pom.xml index 36d2a4e628..e503fded47 100644 --- a/proto-google-cloud-firestore-admin-v1/pom.xml +++ b/proto-google-cloud-firestore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.18.0 + 3.19.0 proto-google-cloud-firestore-admin-v1 PROTO library for proto-google-cloud-firestore-admin-v1 com.google.cloud google-cloud-firestore-parent - 3.18.0 + 3.19.0 diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Backup.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Backup.java new file mode 100644 index 0000000000..25a0b809bd --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Backup.java @@ -0,0 +1,3067 @@ +/* + * Copyright 2024 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/firestore/admin/v1/backup.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * A Backup of a Cloud Firestore Database.
+ *
+ * The backup contains all documents and index configurations for the given
+ * database at a specific point in time.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Backup} + */ +public final class Backup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.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() { + name_ = ""; + database_ = ""; + databaseUid_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Backup(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Backup.class, + com.google.firestore.admin.v1.Backup.Builder.class); + } + + /** + * + * + *
+   * Indicate the current state of the backup.
+   * 
+ * + * Protobuf enum {@code google.firestore.admin.v1.Backup.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state is unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The pending backup is still being created. Operations on the
+     * backup will be rejected in this state.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The backup is complete and ready to use.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * The backup is not available at this moment.
+     * 
+ * + * NOT_AVAILABLE = 3; + */ + NOT_AVAILABLE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state is unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The pending backup is still being created. Operations on the
+     * backup will be rejected in this state.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * The backup is complete and ready to use.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * The backup is not available at this moment.
+     * 
+ * + * NOT_AVAILABLE = 3; + */ + public static final int NOT_AVAILABLE_VALUE = 3; + + 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; + case 3: + return NOT_AVAILABLE; + 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() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.firestore.admin.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.firestore.admin.v1.Backup.State) + } + + public interface StatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.Backup.Stats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Summation of the size of all documents and index entries in
+     * the backup, measured in bytes.
+     * 
+ * + * int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + long getSizeBytes(); + + /** + * + * + *
+     * Output only. The total number of documents contained in the backup.
+     * 
+ * + * int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The documentCount. + */ + long getDocumentCount(); + + /** + * + * + *
+     * Output only. The total number of index entries contained in the backup.
+     * 
+ * + * int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The indexCount. + */ + long getIndexCount(); + } + /** + * + * + *
+   * Backup specific statistics.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Backup.Stats} + */ + public static final class Stats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.Backup.Stats) + StatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Stats.newBuilder() to construct. + private Stats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Stats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Stats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_Stats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_Stats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Backup.Stats.class, + com.google.firestore.admin.v1.Backup.Stats.Builder.class); + } + + public static final int SIZE_BYTES_FIELD_NUMBER = 1; + private long sizeBytes_ = 0L; + /** + * + * + *
+     * Output only. Summation of the size of all documents and index entries in
+     * the backup, measured in bytes.
+     * 
+ * + * int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + + public static final int DOCUMENT_COUNT_FIELD_NUMBER = 2; + private long documentCount_ = 0L; + /** + * + * + *
+     * Output only. The total number of documents contained in the backup.
+     * 
+ * + * int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The documentCount. + */ + @java.lang.Override + public long getDocumentCount() { + return documentCount_; + } + + public static final int INDEX_COUNT_FIELD_NUMBER = 3; + private long indexCount_ = 0L; + /** + * + * + *
+     * Output only. The total number of index entries contained in the backup.
+     * 
+ * + * int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The indexCount. + */ + @java.lang.Override + public long getIndexCount() { + return indexCount_; + } + + 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 (sizeBytes_ != 0L) { + output.writeInt64(1, sizeBytes_); + } + if (documentCount_ != 0L) { + output.writeInt64(2, documentCount_); + } + if (indexCount_ != 0L) { + output.writeInt64(3, indexCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, sizeBytes_); + } + if (documentCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, documentCount_); + } + if (indexCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, indexCount_); + } + size += getUnknownFields().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.firestore.admin.v1.Backup.Stats)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.Backup.Stats other = + (com.google.firestore.admin.v1.Backup.Stats) obj; + + if (getSizeBytes() != other.getSizeBytes()) return false; + if (getDocumentCount() != other.getDocumentCount()) return false; + if (getIndexCount() != other.getIndexCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeBytes()); + hash = (37 * hash) + DOCUMENT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDocumentCount()); + hash = (37 * hash) + INDEX_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIndexCount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.Backup.Stats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Backup.Stats parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Backup.Stats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Backup.Stats 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.firestore.admin.v1.Backup.Stats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Backup.Stats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Backup.Stats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Backup.Stats 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.firestore.admin.v1.Backup.Stats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Backup.Stats 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.firestore.admin.v1.Backup.Stats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Backup.Stats 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.firestore.admin.v1.Backup.Stats 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; + } + /** + * + * + *
+     * Backup specific statistics.
+     * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Backup.Stats} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.Backup.Stats) + com.google.firestore.admin.v1.Backup.StatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_Stats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_Stats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Backup.Stats.class, + com.google.firestore.admin.v1.Backup.Stats.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.Backup.Stats.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sizeBytes_ = 0L; + documentCount_ = 0L; + indexCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_Stats_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Backup.Stats getDefaultInstanceForType() { + return com.google.firestore.admin.v1.Backup.Stats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.Backup.Stats build() { + com.google.firestore.admin.v1.Backup.Stats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Backup.Stats buildPartial() { + com.google.firestore.admin.v1.Backup.Stats result = + new com.google.firestore.admin.v1.Backup.Stats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.Backup.Stats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sizeBytes_ = sizeBytes_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.documentCount_ = documentCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.indexCount_ = indexCount_; + } + } + + @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.firestore.admin.v1.Backup.Stats) { + return mergeFrom((com.google.firestore.admin.v1.Backup.Stats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.Backup.Stats other) { + if (other == com.google.firestore.admin.v1.Backup.Stats.getDefaultInstance()) return this; + if (other.getSizeBytes() != 0L) { + setSizeBytes(other.getSizeBytes()); + } + if (other.getDocumentCount() != 0L) { + setDocumentCount(other.getDocumentCount()); + } + if (other.getIndexCount() != 0L) { + setIndexCount(other.getIndexCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + sizeBytes_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + documentCount_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + indexCount_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long sizeBytes_; + /** + * + * + *
+       * Output only. Summation of the size of all documents and index entries in
+       * the backup, measured in bytes.
+       * 
+ * + * int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + /** + * + * + *
+       * Output only. Summation of the size of all documents and index entries in
+       * the backup, measured in bytes.
+       * 
+ * + * int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeBytes to set. + * @return This builder for chaining. + */ + public Builder setSizeBytes(long value) { + + sizeBytes_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Summation of the size of all documents and index entries in
+       * the backup, measured in bytes.
+       * 
+ * + * int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeBytes() { + bitField0_ = (bitField0_ & ~0x00000001); + sizeBytes_ = 0L; + onChanged(); + return this; + } + + private long documentCount_; + /** + * + * + *
+       * Output only. The total number of documents contained in the backup.
+       * 
+ * + * int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The documentCount. + */ + @java.lang.Override + public long getDocumentCount() { + return documentCount_; + } + /** + * + * + *
+       * Output only. The total number of documents contained in the backup.
+       * 
+ * + * int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The documentCount to set. + * @return This builder for chaining. + */ + public Builder setDocumentCount(long value) { + + documentCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The total number of documents contained in the backup.
+       * 
+ * + * int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDocumentCount() { + bitField0_ = (bitField0_ & ~0x00000002); + documentCount_ = 0L; + onChanged(); + return this; + } + + private long indexCount_; + /** + * + * + *
+       * Output only. The total number of index entries contained in the backup.
+       * 
+ * + * int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The indexCount. + */ + @java.lang.Override + public long getIndexCount() { + return indexCount_; + } + /** + * + * + *
+       * Output only. The total number of index entries contained in the backup.
+       * 
+ * + * int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The indexCount to set. + * @return This builder for chaining. + */ + public Builder setIndexCount(long value) { + + indexCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. The total number of index entries contained in the backup.
+       * 
+ * + * int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIndexCount() { + bitField0_ = (bitField0_ & ~0x00000004); + indexCount_ = 0L; + 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.firestore.admin.v1.Backup.Stats) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Backup.Stats) + private static final com.google.firestore.admin.v1.Backup.Stats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.Backup.Stats(); + } + + public static com.google.firestore.admin.v1.Backup.Stats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Stats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.Backup.Stats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The unique resource name of the Backup.
+   *
+   * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + 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. The unique resource name of the Backup.
+   *
+   * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + /** + * + * + *
+   * Output only. Name of the Firestore database that the backup is from.
+   *
+   * Format is `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The database. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Output only. Name of the Firestore database that the backup is from.
+   *
+   * Format is `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for database. + */ + @java.lang.Override + 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 DATABASE_UID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object databaseUid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UUID4 for the Firestore database that the
+   * backup is from.
+   * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The databaseUid. + */ + @java.lang.Override + public java.lang.String getDatabaseUid() { + java.lang.Object ref = databaseUid_; + 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(); + databaseUid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UUID4 for the Firestore database that the
+   * backup is from.
+   * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for databaseUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseUidBytes() { + java.lang.Object ref = databaseUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SNAPSHOT_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp snapshotTime_; + /** + * + * + *
+   * Output only. The backup contains an externally consistent copy of the
+   * database at this time.
+   * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the snapshotTime field is set. + */ + @java.lang.Override + public boolean hasSnapshotTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The backup contains an externally consistent copy of the
+   * database at this time.
+   * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The snapshotTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSnapshotTime() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + /** + * + * + *
+   * Output only. The backup contains an externally consistent copy of the
+   * database at this time.
+   * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * Output only. The timestamp at which this backup expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The timestamp at which this backup expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * Output only. The timestamp at which this backup expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + public static final int STATS_FIELD_NUMBER = 6; + private com.google.firestore.admin.v1.Backup.Stats stats_; + /** + * + * + *
+   * Output only. Statistics about the backup.
+   *
+   * This data only becomes available after the backup is fully materialized to
+   * secondary storage. This field will be empty till then.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Statistics about the backup.
+   *
+   * This data only becomes available after the backup is fully materialized to
+   * secondary storage. This field will be empty till then.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stats. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Backup.Stats getStats() { + return stats_ == null + ? com.google.firestore.admin.v1.Backup.Stats.getDefaultInstance() + : stats_; + } + /** + * + * + *
+   * Output only. Statistics about the backup.
+   *
+   * This data only becomes available after the backup is fully materialized to
+   * secondary storage. This field will be empty till then.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.firestore.admin.v1.Backup.StatsOrBuilder getStatsOrBuilder() { + return stats_ == null + ? com.google.firestore.admin.v1.Backup.Stats.getDefaultInstance() + : stats_; + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Backup.State getState() { + com.google.firestore.admin.v1.Backup.State result = + com.google.firestore.admin.v1.Backup.State.forNumber(state_); + return result == null ? com.google.firestore.admin.v1.Backup.State.UNRECOGNIZED : result; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, database_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSnapshotTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getExpireTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getStats()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseUid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, databaseUid_); + } + if (state_ != com.google.firestore.admin.v1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, state_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, database_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSnapshotTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getExpireTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStats()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseUid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, databaseUid_); + } + if (state_ != com.google.firestore.admin.v1.Backup.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + size += getUnknownFields().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.firestore.admin.v1.Backup)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.Backup other = (com.google.firestore.admin.v1.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getDatabaseUid().equals(other.getDatabaseUid())) return false; + if (hasSnapshotTime() != other.hasSnapshotTime()) return false; + if (hasSnapshotTime()) { + if (!getSnapshotTime().equals(other.getSnapshotTime())) return false; + } + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } + if (state_ != other.state_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + hash = (37 * hash) + DATABASE_UID_FIELD_NUMBER; + hash = (53 * hash) + getDatabaseUid().hashCode(); + if (hasSnapshotTime()) { + hash = (37 * hash) + SNAPSHOT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotTime().hashCode(); + } + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.Backup parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.Backup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.Backup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.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 Firestore Database.
+   *
+   * The backup contains all documents and index configurations for the given
+   * database at a specific point in time.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.Backup) + com.google.firestore.admin.v1.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Backup.class, + com.google.firestore.admin.v1.Backup.Builder.class); + } + + // Construct using com.google.firestore.admin.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) { + getSnapshotTimeFieldBuilder(); + getExpireTimeFieldBuilder(); + getStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + database_ = ""; + databaseUid_ = ""; + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + state_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.BackupProto + .internal_static_google_firestore_admin_v1_Backup_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Backup getDefaultInstanceForType() { + return com.google.firestore.admin.v1.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.Backup build() { + com.google.firestore.admin.v1.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Backup buildPartial() { + com.google.firestore.admin.v1.Backup result = new com.google.firestore.admin.v1.Backup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.Backup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.databaseUid_ = databaseUid_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.snapshotTime_ = + snapshotTimeBuilder_ == null ? snapshotTime_ : snapshotTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.state_ = state_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.firestore.admin.v1.Backup) { + return mergeFrom((com.google.firestore.admin.v1.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.Backup other) { + if (other == com.google.firestore.admin.v1.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDatabaseUid().isEmpty()) { + databaseUid_ = other.databaseUid_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasSnapshotTime()) { + mergeSnapshotTime(other.getSnapshotTime()); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + if (other.hasStats()) { + mergeStats(other.getStats()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getSnapshotTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 50: + { + input.readMessage(getStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + databaseUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 58 + case 64: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 64 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The unique resource name of the Backup.
+     *
+     * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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. The unique resource name of the Backup.
+     *
+     * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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. The unique resource name of the Backup.
+     *
+     * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique resource name of the Backup.
+     *
+     * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique resource name of the Backup.
+     *
+     * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * Output only. Name of the Firestore database that the backup is from.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Output only. Name of the Firestore database that the backup is from.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Output only. Name of the Firestore database that the backup is from.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the Firestore database that the backup is from.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the Firestore database that the backup is from.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object databaseUid_ = ""; + /** + * + * + *
+     * Output only. The system-generated UUID4 for the Firestore database that the
+     * backup is from.
+     * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The databaseUid. + */ + public java.lang.String getDatabaseUid() { + java.lang.Object ref = databaseUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + databaseUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UUID4 for the Firestore database that the
+     * backup is from.
+     * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for databaseUid. + */ + public com.google.protobuf.ByteString getDatabaseUidBytes() { + java.lang.Object ref = databaseUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + databaseUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UUID4 for the Firestore database that the
+     * backup is from.
+     * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The databaseUid to set. + * @return This builder for chaining. + */ + public Builder setDatabaseUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + databaseUid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UUID4 for the Firestore database that the
+     * backup is from.
+     * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseUid() { + databaseUid_ = getDefaultInstance().getDatabaseUid(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UUID4 for the Firestore database that the
+     * backup is from.
+     * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for databaseUid to set. + * @return This builder for chaining. + */ + public Builder setDatabaseUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + databaseUid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp snapshotTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + snapshotTimeBuilder_; + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the snapshotTime field is set. + */ + public boolean hasSnapshotTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The snapshotTime. + */ + public com.google.protobuf.Timestamp getSnapshotTime() { + if (snapshotTimeBuilder_ == null) { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } else { + return snapshotTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshotTime_ = value; + } else { + snapshotTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (snapshotTimeBuilder_ == null) { + snapshotTime_ = builderForValue.build(); + } else { + snapshotTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && snapshotTime_ != null + && snapshotTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSnapshotTimeBuilder().mergeFrom(value); + } else { + snapshotTime_ = value; + } + } else { + snapshotTimeBuilder_.mergeFrom(value); + } + if (snapshotTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSnapshotTime() { + bitField0_ = (bitField0_ & ~0x00000008); + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getSnapshotTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getSnapshotTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + if (snapshotTimeBuilder_ != null) { + return snapshotTimeBuilder_.getMessageOrBuilder(); + } else { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + } + /** + * + * + *
+     * Output only. The backup contains an externally consistent copy of the
+     * database at this time.
+     * 
+ * + * + * .google.protobuf.Timestamp snapshot_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> + getSnapshotTimeFieldBuilder() { + if (snapshotTimeBuilder_ == null) { + snapshotTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSnapshotTime(), getParentForChildren(), isClean()); + snapshotTime_ = null; + } + return snapshotTimeBuilder_; + } + + 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_; + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + } else { + expireTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); + } else { + expireTime_ = value; + } + } else { + expireTimeBuilder_.mergeFrom(value); + } + if (expireTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExpireTime() { + bitField0_ = (bitField0_ & ~0x00000010); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp at which this backup expires.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_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> + 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 com.google.firestore.admin.v1.Backup.Stats stats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Backup.Stats, + com.google.firestore.admin.v1.Backup.Stats.Builder, + com.google.firestore.admin.v1.Backup.StatsOrBuilder> + statsBuilder_; + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stats. + */ + public com.google.firestore.admin.v1.Backup.Stats getStats() { + if (statsBuilder_ == null) { + return stats_ == null + ? com.google.firestore.admin.v1.Backup.Stats.getDefaultInstance() + : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStats(com.google.firestore.admin.v1.Backup.Stats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStats(com.google.firestore.admin.v1.Backup.Stats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStats(com.google.firestore.admin.v1.Backup.Stats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && stats_ != null + && stats_ != com.google.firestore.admin.v1.Backup.Stats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + if (stats_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000020); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.firestore.admin.v1.Backup.Stats.Builder getStatsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.firestore.admin.v1.Backup.StatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null + ? com.google.firestore.admin.v1.Backup.Stats.getDefaultInstance() + : stats_; + } + } + /** + * + * + *
+     * Output only. Statistics about the backup.
+     *
+     * This data only becomes available after the backup is fully materialized to
+     * secondary storage. This field will be empty till then.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Backup.Stats, + com.google.firestore.admin.v1.Backup.Stats.Builder, + com.google.firestore.admin.v1.Backup.StatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Backup.Stats, + com.google.firestore.admin.v1.Backup.Stats.Builder, + com.google.firestore.admin.v1.Backup.StatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.State state = 8 [(.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; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Backup.State getState() { + com.google.firestore.admin.v1.Backup.State result = + com.google.firestore.admin.v1.Backup.State.forNumber(state_); + return result == null ? com.google.firestore.admin.v1.Backup.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.firestore.admin.v1.Backup.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000040); + state_ = 0; + 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.firestore.admin.v1.Backup) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Backup) + private static final com.google.firestore.admin.v1.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.Backup(); + } + + public static com.google.firestore.admin.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupName.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupName.java new file mode 100644 index 0000000000..76cdb34739 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 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.firestore.admin.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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class BackupName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BACKUP = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + location = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String location, String backup) { + return newBuilder().setProject(project).setLocation(location).setBackup(backup).build(); + } + + public static String format(String project, String location, String backup) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBackup(backup) + .build() + .toString(); + } + + public static BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), 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 PROJECT_LOCATION_BACKUP.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_BACKUP.instantiate( + "project", project, "location", location, "backup", backup); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.backup, that.backup); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(backup); + return h; + } + + /** Builder for projects/{project}/locations/{location}/backups/{backup}. */ + public static class Builder { + private String project; + private String location; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.location = backupName.location; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupOrBuilder.java new file mode 100644 index 0000000000..8da642d413 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupOrBuilder.java @@ -0,0 +1,276 @@ +/* + * Copyright 2024 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/firestore/admin/v1/backup.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The unique resource name of the Backup.
+   *
+   * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The unique resource name of the Backup.
+   *
+   * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Name of the Firestore database that the backup is from.
+   *
+   * Format is `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The database. + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * Output only. Name of the Firestore database that the backup is from.
+   *
+   * Format is `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Output only. The system-generated UUID4 for the Firestore database that the
+   * backup is from.
+   * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The databaseUid. + */ + java.lang.String getDatabaseUid(); + /** + * + * + *
+   * Output only. The system-generated UUID4 for the Firestore database that the
+   * backup is from.
+   * 
+ * + * string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for databaseUid. + */ + com.google.protobuf.ByteString getDatabaseUidBytes(); + + /** + * + * + *
+   * Output only. The backup contains an externally consistent copy of the
+   * database at this time.
+   * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the snapshotTime field is set. + */ + boolean hasSnapshotTime(); + /** + * + * + *
+   * Output only. The backup contains an externally consistent copy of the
+   * database at this time.
+   * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The snapshotTime. + */ + com.google.protobuf.Timestamp getSnapshotTime(); + /** + * + * + *
+   * Output only. The backup contains an externally consistent copy of the
+   * database at this time.
+   * 
+ * + * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp at which this backup expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Output only. The timestamp at which this backup expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Output only. The timestamp at which this backup expires.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Statistics about the backup.
+   *
+   * This data only becomes available after the backup is fully materialized to
+   * secondary storage. This field will be empty till then.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + /** + * + * + *
+   * Output only. Statistics about the backup.
+   *
+   * This data only becomes available after the backup is fully materialized to
+   * secondary storage. This field will be empty till then.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stats. + */ + com.google.firestore.admin.v1.Backup.Stats getStats(); + /** + * + * + *
+   * Output only. Statistics about the backup.
+   *
+   * This data only becomes available after the backup is fully materialized to
+   * secondary storage. This field will be empty till then.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.firestore.admin.v1.Backup.StatsOrBuilder getStatsOrBuilder(); + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.firestore.admin.v1.Backup.State state = 8 [(.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.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.firestore.admin.v1.Backup.State getState(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupProto.java new file mode 100644 index 0000000000..deab8154ca --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupProto.java @@ -0,0 +1,111 @@ +/* + * Copyright 2024 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/firestore/admin/v1/backup.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.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_firestore_admin_v1_Backup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_Backup_Stats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_Backup_Stats_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/firestore/admin/v1/backup.proto" + + "\022\031google.firestore.admin.v1\032\037google/api/" + + "field_behavior.proto\032\031google/api/resourc" + + "e.proto\032\037google/protobuf/timestamp.proto" + + "\"\340\004\n\006Backup\022\021\n\004name\030\001 \001(\tB\003\340A\003\022;\n\010databa" + + "se\030\002 \001(\tB)\340A\003\372A#\n!firestore.googleapis.c" + + "om/Database\022\031\n\014database_uid\030\007 \001(\tB\003\340A\003\0226" + + "\n\rsnapshot_time\030\003 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\0224\n\013expire_time\030\004 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\003\340A\003\022;\n\005stats\030\006 " + + "\001(\0132\'.google.firestore.admin.v1.Backup.S" + + "tatsB\003\340A\003\022;\n\005state\030\010 \001(\0162\'.google.firest" + + "ore.admin.v1.Backup.StateB\003\340A\003\032W\n\005Stats\022" + + "\027\n\nsize_bytes\030\001 \001(\003B\003\340A\003\022\033\n\016document_cou" + + "nt\030\002 \001(\003B\003\340A\003\022\030\n\013index_count\030\003 \001(\003B\003\340A\003\"" + + "J\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREAT" + + "ING\020\001\022\t\n\005READY\020\002\022\021\n\rNOT_AVAILABLE\020\003:^\352A[" + + "\n\037firestore.googleapis.com/Backup\0228proje" + + "cts/{project}/locations/{location}/backu" + + "ps/{backup}B\332\001\n\035com.google.firestore.adm" + + "in.v1B\013BackupProtoP\001Z9cloud.google.com/g" + + "o/firestore/apiv1/admin/adminpb;adminpb\242" + + "\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1" + + "\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#Goo" + + "gle::Cloud::Firestore::Admin::V1b\006proto3" + }; + 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.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_firestore_admin_v1_Backup_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_admin_v1_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_Backup_descriptor, + new java.lang.String[] { + "Name", "Database", "DatabaseUid", "SnapshotTime", "ExpireTime", "Stats", "State", + }); + internal_static_google_firestore_admin_v1_Backup_Stats_descriptor = + internal_static_google_firestore_admin_v1_Backup_descriptor.getNestedTypes().get(0); + internal_static_google_firestore_admin_v1_Backup_Stats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_Backup_Stats_descriptor, + new java.lang.String[] { + "SizeBytes", "DocumentCount", "IndexCount", + }); + 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.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupSchedule.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupSchedule.java new file mode 100644 index 0000000000..2ae1843ae5 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupSchedule.java @@ -0,0 +1,2256 @@ +/* + * Copyright 2024 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/firestore/admin/v1/schedule.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * A backup schedule for a Cloud Firestore Database.
+ *
+ * This resource is owned by the database it is backing up, and is deleted along
+ * with the database. The actual backups are not though.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.BackupSchedule} + */ +public final class BackupSchedule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.BackupSchedule) + BackupScheduleOrBuilder { + private static final long serialVersionUID = 0L; + // Use BackupSchedule.newBuilder() to construct. + private BackupSchedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BackupSchedule() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BackupSchedule(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_BackupSchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_BackupSchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.BackupSchedule.class, + com.google.firestore.admin.v1.BackupSchedule.Builder.class); + } + + private int bitField0_; + private int recurrenceCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object recurrence_; + + public enum RecurrenceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DAILY_RECURRENCE(7), + WEEKLY_RECURRENCE(8), + RECURRENCE_NOT_SET(0); + private final int value; + + private RecurrenceCase(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 RecurrenceCase valueOf(int value) { + return forNumber(value); + } + + public static RecurrenceCase forNumber(int value) { + switch (value) { + case 7: + return DAILY_RECURRENCE; + case 8: + return WEEKLY_RECURRENCE; + case 0: + return RECURRENCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RecurrenceCase getRecurrenceCase() { + return RecurrenceCase.forNumber(recurrenceCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The unique backup schedule identifier across all locations and
+   * databases for the given project.
+   *
+   * This will be auto-assigned.
+   *
+   * Format is
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + 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. The unique backup schedule identifier across all locations and
+   * databases for the given project.
+   *
+   * This will be auto-assigned.
+   *
+   * Format is
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + 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 = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was created and
+   * effective since.
+   *
+   * No backups will be created for this schedule before this time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was created and
+   * effective since.
+   *
+   * No backups will be created for this schedule before this time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was created and
+   * effective since.
+   *
+   * No backups will be created for this schedule before this time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was most recently
+   * updated. When a backup schedule is first created, this is the same as
+   * create_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was most recently
+   * updated. When a backup schedule is first created, this is the same as
+   * create_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was most recently
+   * updated. When a backup schedule is first created, this is the same as
+   * create_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int RETENTION_FIELD_NUMBER = 6; + private com.google.protobuf.Duration retention_; + /** + * + * + *
+   * At what relative time in the future, compared to its creation time,
+   * the backup should be deleted, e.g. keep backups for 7 days.
+   * 
+ * + * .google.protobuf.Duration retention = 6; + * + * @return Whether the retention field is set. + */ + @java.lang.Override + public boolean hasRetention() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * At what relative time in the future, compared to its creation time,
+   * the backup should be deleted, e.g. keep backups for 7 days.
+   * 
+ * + * .google.protobuf.Duration retention = 6; + * + * @return The retention. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetention() { + return retention_ == null ? com.google.protobuf.Duration.getDefaultInstance() : retention_; + } + /** + * + * + *
+   * At what relative time in the future, compared to its creation time,
+   * the backup should be deleted, e.g. keep backups for 7 days.
+   * 
+ * + * .google.protobuf.Duration retention = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionOrBuilder() { + return retention_ == null ? com.google.protobuf.Duration.getDefaultInstance() : retention_; + } + + public static final int DAILY_RECURRENCE_FIELD_NUMBER = 7; + /** + * + * + *
+   * For a schedule that runs daily at a specified time.
+   * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + * + * @return Whether the dailyRecurrence field is set. + */ + @java.lang.Override + public boolean hasDailyRecurrence() { + return recurrenceCase_ == 7; + } + /** + * + * + *
+   * For a schedule that runs daily at a specified time.
+   * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + * + * @return The dailyRecurrence. + */ + @java.lang.Override + public com.google.firestore.admin.v1.DailyRecurrence getDailyRecurrence() { + if (recurrenceCase_ == 7) { + return (com.google.firestore.admin.v1.DailyRecurrence) recurrence_; + } + return com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance(); + } + /** + * + * + *
+   * For a schedule that runs daily at a specified time.
+   * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + @java.lang.Override + public com.google.firestore.admin.v1.DailyRecurrenceOrBuilder getDailyRecurrenceOrBuilder() { + if (recurrenceCase_ == 7) { + return (com.google.firestore.admin.v1.DailyRecurrence) recurrence_; + } + return com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance(); + } + + public static final int WEEKLY_RECURRENCE_FIELD_NUMBER = 8; + /** + * + * + *
+   * For a schedule that runs weekly on a specific day and time.
+   * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + * + * @return Whether the weeklyRecurrence field is set. + */ + @java.lang.Override + public boolean hasWeeklyRecurrence() { + return recurrenceCase_ == 8; + } + /** + * + * + *
+   * For a schedule that runs weekly on a specific day and time.
+   * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + * + * @return The weeklyRecurrence. + */ + @java.lang.Override + public com.google.firestore.admin.v1.WeeklyRecurrence getWeeklyRecurrence() { + if (recurrenceCase_ == 8) { + return (com.google.firestore.admin.v1.WeeklyRecurrence) recurrence_; + } + return com.google.firestore.admin.v1.WeeklyRecurrence.getDefaultInstance(); + } + /** + * + * + *
+   * For a schedule that runs weekly on a specific day and time.
+   * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + @java.lang.Override + public com.google.firestore.admin.v1.WeeklyRecurrenceOrBuilder getWeeklyRecurrenceOrBuilder() { + if (recurrenceCase_ == 8) { + return (com.google.firestore.admin.v1.WeeklyRecurrence) recurrence_; + } + return com.google.firestore.admin.v1.WeeklyRecurrence.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getRetention()); + } + if (recurrenceCase_ == 7) { + output.writeMessage(7, (com.google.firestore.admin.v1.DailyRecurrence) recurrence_); + } + if (recurrenceCase_ == 8) { + output.writeMessage(8, (com.google.firestore.admin.v1.WeeklyRecurrence) recurrence_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getUpdateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getRetention()); + } + if (recurrenceCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.firestore.admin.v1.DailyRecurrence) recurrence_); + } + if (recurrenceCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.firestore.admin.v1.WeeklyRecurrence) recurrence_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getUpdateTime()); + } + size += getUnknownFields().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.firestore.admin.v1.BackupSchedule)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.BackupSchedule other = + (com.google.firestore.admin.v1.BackupSchedule) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasRetention() != other.hasRetention()) return false; + if (hasRetention()) { + if (!getRetention().equals(other.getRetention())) return false; + } + if (!getRecurrenceCase().equals(other.getRecurrenceCase())) return false; + switch (recurrenceCase_) { + case 7: + if (!getDailyRecurrence().equals(other.getDailyRecurrence())) return false; + break; + case 8: + if (!getWeeklyRecurrence().equals(other.getWeeklyRecurrence())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasRetention()) { + hash = (37 * hash) + RETENTION_FIELD_NUMBER; + hash = (53 * hash) + getRetention().hashCode(); + } + switch (recurrenceCase_) { + case 7: + hash = (37 * hash) + DAILY_RECURRENCE_FIELD_NUMBER; + hash = (53 * hash) + getDailyRecurrence().hashCode(); + break; + case 8: + hash = (37 * hash) + WEEKLY_RECURRENCE_FIELD_NUMBER; + hash = (53 * hash) + getWeeklyRecurrence().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.BackupSchedule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.BackupSchedule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.BackupSchedule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.BackupSchedule 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.firestore.admin.v1.BackupSchedule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.BackupSchedule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.BackupSchedule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.BackupSchedule 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.firestore.admin.v1.BackupSchedule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.BackupSchedule 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.firestore.admin.v1.BackupSchedule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.BackupSchedule 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.firestore.admin.v1.BackupSchedule 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 schedule for a Cloud Firestore Database.
+   *
+   * This resource is owned by the database it is backing up, and is deleted along
+   * with the database. The actual backups are not though.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.BackupSchedule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.BackupSchedule) + com.google.firestore.admin.v1.BackupScheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_BackupSchedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_BackupSchedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.BackupSchedule.class, + com.google.firestore.admin.v1.BackupSchedule.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.BackupSchedule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getRetentionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + retention_ = null; + if (retentionBuilder_ != null) { + retentionBuilder_.dispose(); + retentionBuilder_ = null; + } + if (dailyRecurrenceBuilder_ != null) { + dailyRecurrenceBuilder_.clear(); + } + if (weeklyRecurrenceBuilder_ != null) { + weeklyRecurrenceBuilder_.clear(); + } + recurrenceCase_ = 0; + recurrence_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_BackupSchedule_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.BackupSchedule getDefaultInstanceForType() { + return com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.BackupSchedule build() { + com.google.firestore.admin.v1.BackupSchedule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.BackupSchedule buildPartial() { + com.google.firestore.admin.v1.BackupSchedule result = + new com.google.firestore.admin.v1.BackupSchedule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.BackupSchedule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.retention_ = retentionBuilder_ == null ? retention_ : retentionBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.firestore.admin.v1.BackupSchedule result) { + result.recurrenceCase_ = recurrenceCase_; + result.recurrence_ = this.recurrence_; + if (recurrenceCase_ == 7 && dailyRecurrenceBuilder_ != null) { + result.recurrence_ = dailyRecurrenceBuilder_.build(); + } + if (recurrenceCase_ == 8 && weeklyRecurrenceBuilder_ != null) { + result.recurrence_ = weeklyRecurrenceBuilder_.build(); + } + } + + @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.firestore.admin.v1.BackupSchedule) { + return mergeFrom((com.google.firestore.admin.v1.BackupSchedule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.BackupSchedule other) { + if (other == com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasRetention()) { + mergeRetention(other.getRetention()); + } + switch (other.getRecurrenceCase()) { + case DAILY_RECURRENCE: + { + mergeDailyRecurrence(other.getDailyRecurrence()); + break; + } + case WEEKLY_RECURRENCE: + { + mergeWeeklyRecurrence(other.getWeeklyRecurrence()); + break; + } + case RECURRENCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 50: + { + input.readMessage(getRetentionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 50 + case 58: + { + input.readMessage(getDailyRecurrenceFieldBuilder().getBuilder(), extensionRegistry); + recurrenceCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getWeeklyRecurrenceFieldBuilder().getBuilder(), extensionRegistry); + recurrenceCase_ = 8; + break; + } // case 66 + case 82: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int recurrenceCase_ = 0; + private java.lang.Object recurrence_; + + public RecurrenceCase getRecurrenceCase() { + return RecurrenceCase.forNumber(recurrenceCase_); + } + + public Builder clearRecurrence() { + recurrenceCase_ = 0; + recurrence_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The unique backup schedule identifier across all locations and
+     * databases for the given project.
+     *
+     * This will be auto-assigned.
+     *
+     * Format is
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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. The unique backup schedule identifier across all locations and
+     * databases for the given project.
+     *
+     * This will be auto-assigned.
+     *
+     * Format is
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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. The unique backup schedule identifier across all locations and
+     * databases for the given project.
+     *
+     * This will be auto-assigned.
+     *
+     * Format is
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique backup schedule identifier across all locations and
+     * databases for the given project.
+     *
+     * This will be auto-assigned.
+     *
+     * Format is
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique backup schedule identifier across all locations and
+     * databases for the given project.
+     *
+     * This will be auto-assigned.
+     *
+     * Format is
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + 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 timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .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. The timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .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. The timestamp at which this backup schedule was created and
+     * effective since.
+     *
+     * No backups will be created for this schedule before this time.
+     * 
+ * + * + * .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.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp at which this backup schedule was most recently
+     * updated. When a backup schedule is first created, this is the same as
+     * create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Duration retention_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionBuilder_; + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + * + * @return Whether the retention field is set. + */ + public boolean hasRetention() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + * + * @return The retention. + */ + public com.google.protobuf.Duration getRetention() { + if (retentionBuilder_ == null) { + return retention_ == null ? com.google.protobuf.Duration.getDefaultInstance() : retention_; + } else { + return retentionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + */ + public Builder setRetention(com.google.protobuf.Duration value) { + if (retentionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retention_ = value; + } else { + retentionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + */ + public Builder setRetention(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionBuilder_ == null) { + retention_ = builderForValue.build(); + } else { + retentionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + */ + public Builder mergeRetention(com.google.protobuf.Duration value) { + if (retentionBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && retention_ != null + && retention_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionBuilder().mergeFrom(value); + } else { + retention_ = value; + } + } else { + retentionBuilder_.mergeFrom(value); + } + if (retention_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + */ + public Builder clearRetention() { + bitField0_ = (bitField0_ & ~0x00000008); + retention_ = null; + if (retentionBuilder_ != null) { + retentionBuilder_.dispose(); + retentionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + */ + public com.google.protobuf.Duration.Builder getRetentionBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getRetentionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + */ + public com.google.protobuf.DurationOrBuilder getRetentionOrBuilder() { + if (retentionBuilder_ != null) { + return retentionBuilder_.getMessageOrBuilder(); + } else { + return retention_ == null ? com.google.protobuf.Duration.getDefaultInstance() : retention_; + } + } + /** + * + * + *
+     * At what relative time in the future, compared to its creation time,
+     * the backup should be deleted, e.g. keep backups for 7 days.
+     * 
+ * + * .google.protobuf.Duration retention = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRetentionFieldBuilder() { + if (retentionBuilder_ == null) { + retentionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetention(), getParentForChildren(), isClean()); + retention_ = null; + } + return retentionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.DailyRecurrence, + com.google.firestore.admin.v1.DailyRecurrence.Builder, + com.google.firestore.admin.v1.DailyRecurrenceOrBuilder> + dailyRecurrenceBuilder_; + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + * + * @return Whether the dailyRecurrence field is set. + */ + @java.lang.Override + public boolean hasDailyRecurrence() { + return recurrenceCase_ == 7; + } + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + * + * @return The dailyRecurrence. + */ + @java.lang.Override + public com.google.firestore.admin.v1.DailyRecurrence getDailyRecurrence() { + if (dailyRecurrenceBuilder_ == null) { + if (recurrenceCase_ == 7) { + return (com.google.firestore.admin.v1.DailyRecurrence) recurrence_; + } + return com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance(); + } else { + if (recurrenceCase_ == 7) { + return dailyRecurrenceBuilder_.getMessage(); + } + return com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance(); + } + } + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + public Builder setDailyRecurrence(com.google.firestore.admin.v1.DailyRecurrence value) { + if (dailyRecurrenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recurrence_ = value; + onChanged(); + } else { + dailyRecurrenceBuilder_.setMessage(value); + } + recurrenceCase_ = 7; + return this; + } + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + public Builder setDailyRecurrence( + com.google.firestore.admin.v1.DailyRecurrence.Builder builderForValue) { + if (dailyRecurrenceBuilder_ == null) { + recurrence_ = builderForValue.build(); + onChanged(); + } else { + dailyRecurrenceBuilder_.setMessage(builderForValue.build()); + } + recurrenceCase_ = 7; + return this; + } + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + public Builder mergeDailyRecurrence(com.google.firestore.admin.v1.DailyRecurrence value) { + if (dailyRecurrenceBuilder_ == null) { + if (recurrenceCase_ == 7 + && recurrence_ != com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance()) { + recurrence_ = + com.google.firestore.admin.v1.DailyRecurrence.newBuilder( + (com.google.firestore.admin.v1.DailyRecurrence) recurrence_) + .mergeFrom(value) + .buildPartial(); + } else { + recurrence_ = value; + } + onChanged(); + } else { + if (recurrenceCase_ == 7) { + dailyRecurrenceBuilder_.mergeFrom(value); + } else { + dailyRecurrenceBuilder_.setMessage(value); + } + } + recurrenceCase_ = 7; + return this; + } + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + public Builder clearDailyRecurrence() { + if (dailyRecurrenceBuilder_ == null) { + if (recurrenceCase_ == 7) { + recurrenceCase_ = 0; + recurrence_ = null; + onChanged(); + } + } else { + if (recurrenceCase_ == 7) { + recurrenceCase_ = 0; + recurrence_ = null; + } + dailyRecurrenceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + public com.google.firestore.admin.v1.DailyRecurrence.Builder getDailyRecurrenceBuilder() { + return getDailyRecurrenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + @java.lang.Override + public com.google.firestore.admin.v1.DailyRecurrenceOrBuilder getDailyRecurrenceOrBuilder() { + if ((recurrenceCase_ == 7) && (dailyRecurrenceBuilder_ != null)) { + return dailyRecurrenceBuilder_.getMessageOrBuilder(); + } else { + if (recurrenceCase_ == 7) { + return (com.google.firestore.admin.v1.DailyRecurrence) recurrence_; + } + return com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance(); + } + } + /** + * + * + *
+     * For a schedule that runs daily at a specified time.
+     * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.DailyRecurrence, + com.google.firestore.admin.v1.DailyRecurrence.Builder, + com.google.firestore.admin.v1.DailyRecurrenceOrBuilder> + getDailyRecurrenceFieldBuilder() { + if (dailyRecurrenceBuilder_ == null) { + if (!(recurrenceCase_ == 7)) { + recurrence_ = com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance(); + } + dailyRecurrenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.DailyRecurrence, + com.google.firestore.admin.v1.DailyRecurrence.Builder, + com.google.firestore.admin.v1.DailyRecurrenceOrBuilder>( + (com.google.firestore.admin.v1.DailyRecurrence) recurrence_, + getParentForChildren(), + isClean()); + recurrence_ = null; + } + recurrenceCase_ = 7; + onChanged(); + return dailyRecurrenceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.WeeklyRecurrence, + com.google.firestore.admin.v1.WeeklyRecurrence.Builder, + com.google.firestore.admin.v1.WeeklyRecurrenceOrBuilder> + weeklyRecurrenceBuilder_; + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + * + * @return Whether the weeklyRecurrence field is set. + */ + @java.lang.Override + public boolean hasWeeklyRecurrence() { + return recurrenceCase_ == 8; + } + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + * + * @return The weeklyRecurrence. + */ + @java.lang.Override + public com.google.firestore.admin.v1.WeeklyRecurrence getWeeklyRecurrence() { + if (weeklyRecurrenceBuilder_ == null) { + if (recurrenceCase_ == 8) { + return (com.google.firestore.admin.v1.WeeklyRecurrence) recurrence_; + } + return com.google.firestore.admin.v1.WeeklyRecurrence.getDefaultInstance(); + } else { + if (recurrenceCase_ == 8) { + return weeklyRecurrenceBuilder_.getMessage(); + } + return com.google.firestore.admin.v1.WeeklyRecurrence.getDefaultInstance(); + } + } + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + public Builder setWeeklyRecurrence(com.google.firestore.admin.v1.WeeklyRecurrence value) { + if (weeklyRecurrenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recurrence_ = value; + onChanged(); + } else { + weeklyRecurrenceBuilder_.setMessage(value); + } + recurrenceCase_ = 8; + return this; + } + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + public Builder setWeeklyRecurrence( + com.google.firestore.admin.v1.WeeklyRecurrence.Builder builderForValue) { + if (weeklyRecurrenceBuilder_ == null) { + recurrence_ = builderForValue.build(); + onChanged(); + } else { + weeklyRecurrenceBuilder_.setMessage(builderForValue.build()); + } + recurrenceCase_ = 8; + return this; + } + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + public Builder mergeWeeklyRecurrence(com.google.firestore.admin.v1.WeeklyRecurrence value) { + if (weeklyRecurrenceBuilder_ == null) { + if (recurrenceCase_ == 8 + && recurrence_ != com.google.firestore.admin.v1.WeeklyRecurrence.getDefaultInstance()) { + recurrence_ = + com.google.firestore.admin.v1.WeeklyRecurrence.newBuilder( + (com.google.firestore.admin.v1.WeeklyRecurrence) recurrence_) + .mergeFrom(value) + .buildPartial(); + } else { + recurrence_ = value; + } + onChanged(); + } else { + if (recurrenceCase_ == 8) { + weeklyRecurrenceBuilder_.mergeFrom(value); + } else { + weeklyRecurrenceBuilder_.setMessage(value); + } + } + recurrenceCase_ = 8; + return this; + } + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + public Builder clearWeeklyRecurrence() { + if (weeklyRecurrenceBuilder_ == null) { + if (recurrenceCase_ == 8) { + recurrenceCase_ = 0; + recurrence_ = null; + onChanged(); + } + } else { + if (recurrenceCase_ == 8) { + recurrenceCase_ = 0; + recurrence_ = null; + } + weeklyRecurrenceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + public com.google.firestore.admin.v1.WeeklyRecurrence.Builder getWeeklyRecurrenceBuilder() { + return getWeeklyRecurrenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + @java.lang.Override + public com.google.firestore.admin.v1.WeeklyRecurrenceOrBuilder getWeeklyRecurrenceOrBuilder() { + if ((recurrenceCase_ == 8) && (weeklyRecurrenceBuilder_ != null)) { + return weeklyRecurrenceBuilder_.getMessageOrBuilder(); + } else { + if (recurrenceCase_ == 8) { + return (com.google.firestore.admin.v1.WeeklyRecurrence) recurrence_; + } + return com.google.firestore.admin.v1.WeeklyRecurrence.getDefaultInstance(); + } + } + /** + * + * + *
+     * For a schedule that runs weekly on a specific day and time.
+     * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.WeeklyRecurrence, + com.google.firestore.admin.v1.WeeklyRecurrence.Builder, + com.google.firestore.admin.v1.WeeklyRecurrenceOrBuilder> + getWeeklyRecurrenceFieldBuilder() { + if (weeklyRecurrenceBuilder_ == null) { + if (!(recurrenceCase_ == 8)) { + recurrence_ = com.google.firestore.admin.v1.WeeklyRecurrence.getDefaultInstance(); + } + weeklyRecurrenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.WeeklyRecurrence, + com.google.firestore.admin.v1.WeeklyRecurrence.Builder, + com.google.firestore.admin.v1.WeeklyRecurrenceOrBuilder>( + (com.google.firestore.admin.v1.WeeklyRecurrence) recurrence_, + getParentForChildren(), + isClean()); + recurrence_ = null; + } + recurrenceCase_ = 8; + onChanged(); + return weeklyRecurrenceBuilder_; + } + + @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.firestore.admin.v1.BackupSchedule) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.BackupSchedule) + private static final com.google.firestore.admin.v1.BackupSchedule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.BackupSchedule(); + } + + public static com.google.firestore.admin.v1.BackupSchedule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupSchedule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.BackupSchedule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupScheduleName.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupScheduleName.java new file mode 100644 index 0000000000..def9a8fdf0 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupScheduleName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2024 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.firestore.admin.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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class BackupScheduleName implements ResourceName { + private static final PathTemplate PROJECT_DATABASE_BACKUP_SCHEDULE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/backupSchedules/{backup_schedule}"); + private volatile Map fieldValuesMap; + private final String project; + private final String database; + private final String backupSchedule; + + @Deprecated + protected BackupScheduleName() { + project = null; + database = null; + backupSchedule = null; + } + + private BackupScheduleName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + backupSchedule = Preconditions.checkNotNull(builder.getBackupSchedule()); + } + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getBackupSchedule() { + return backupSchedule; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupScheduleName of(String project, String database, String backupSchedule) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setBackupSchedule(backupSchedule) + .build(); + } + + public static String format(String project, String database, String backupSchedule) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setBackupSchedule(backupSchedule) + .build() + .toString(); + } + + public static BackupScheduleName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_DATABASE_BACKUP_SCHEDULE.validatedMatch( + formattedString, "BackupScheduleName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("database"), matchMap.get("backup_schedule")); + } + + 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 (BackupScheduleName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_DATABASE_BACKUP_SCHEDULE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (database != null) { + fieldMapBuilder.put("database", database); + } + if (backupSchedule != null) { + fieldMapBuilder.put("backup_schedule", backupSchedule); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_DATABASE_BACKUP_SCHEDULE.instantiate( + "project", project, "database", database, "backup_schedule", backupSchedule); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BackupScheduleName that = ((BackupScheduleName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.database, that.database) + && Objects.equals(this.backupSchedule, that.backupSchedule); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(database); + h *= 1000003; + h ^= Objects.hashCode(backupSchedule); + return h; + } + + /** Builder for projects/{project}/databases/{database}/backupSchedules/{backup_schedule}. */ + public static class Builder { + private String project; + private String database; + private String backupSchedule; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getBackupSchedule() { + return backupSchedule; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + public Builder setBackupSchedule(String backupSchedule) { + this.backupSchedule = backupSchedule; + return this; + } + + private Builder(BackupScheduleName backupScheduleName) { + this.project = backupScheduleName.project; + this.database = backupScheduleName.database; + this.backupSchedule = backupScheduleName.backupSchedule; + } + + public BackupScheduleName build() { + return new BackupScheduleName(this); + } + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupScheduleOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupScheduleOrBuilder.java new file mode 100644 index 0000000000..63dc9b0ccf --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/BackupScheduleOrBuilder.java @@ -0,0 +1,264 @@ +/* + * Copyright 2024 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/firestore/admin/v1/schedule.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface BackupScheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.BackupSchedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The unique backup schedule identifier across all locations and
+   * databases for the given project.
+   *
+   * This will be auto-assigned.
+   *
+   * Format is
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The unique backup schedule identifier across all locations and
+   * databases for the given project.
+   *
+   * This will be auto-assigned.
+   *
+   * Format is
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was created and
+   * effective since.
+   *
+   * No backups will be created for this schedule before this time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was created and
+   * effective since.
+   *
+   * No backups will be created for this schedule before this time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was created and
+   * effective since.
+   *
+   * No backups will be created for this schedule before this time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was most recently
+   * updated. When a backup schedule is first created, this is the same as
+   * create_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was most recently
+   * updated. When a backup schedule is first created, this is the same as
+   * create_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp at which this backup schedule was most recently
+   * updated. When a backup schedule is first created, this is the same as
+   * create_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * At what relative time in the future, compared to its creation time,
+   * the backup should be deleted, e.g. keep backups for 7 days.
+   * 
+ * + * .google.protobuf.Duration retention = 6; + * + * @return Whether the retention field is set. + */ + boolean hasRetention(); + /** + * + * + *
+   * At what relative time in the future, compared to its creation time,
+   * the backup should be deleted, e.g. keep backups for 7 days.
+   * 
+ * + * .google.protobuf.Duration retention = 6; + * + * @return The retention. + */ + com.google.protobuf.Duration getRetention(); + /** + * + * + *
+   * At what relative time in the future, compared to its creation time,
+   * the backup should be deleted, e.g. keep backups for 7 days.
+   * 
+ * + * .google.protobuf.Duration retention = 6; + */ + com.google.protobuf.DurationOrBuilder getRetentionOrBuilder(); + + /** + * + * + *
+   * For a schedule that runs daily at a specified time.
+   * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + * + * @return Whether the dailyRecurrence field is set. + */ + boolean hasDailyRecurrence(); + /** + * + * + *
+   * For a schedule that runs daily at a specified time.
+   * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + * + * @return The dailyRecurrence. + */ + com.google.firestore.admin.v1.DailyRecurrence getDailyRecurrence(); + /** + * + * + *
+   * For a schedule that runs daily at a specified time.
+   * 
+ * + * .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + */ + com.google.firestore.admin.v1.DailyRecurrenceOrBuilder getDailyRecurrenceOrBuilder(); + + /** + * + * + *
+   * For a schedule that runs weekly on a specific day and time.
+   * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + * + * @return Whether the weeklyRecurrence field is set. + */ + boolean hasWeeklyRecurrence(); + /** + * + * + *
+   * For a schedule that runs weekly on a specific day and time.
+   * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + * + * @return The weeklyRecurrence. + */ + com.google.firestore.admin.v1.WeeklyRecurrence getWeeklyRecurrence(); + /** + * + * + *
+   * For a schedule that runs weekly on a specific day and time.
+   * 
+ * + * .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + */ + com.google.firestore.admin.v1.WeeklyRecurrenceOrBuilder getWeeklyRecurrenceOrBuilder(); + + com.google.firestore.admin.v1.BackupSchedule.RecurrenceCase getRecurrenceCase(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateBackupScheduleRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateBackupScheduleRequest.java new file mode 100644 index 0000000000..63dbeb8305 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateBackupScheduleRequest.java @@ -0,0 +1,962 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.CreateBackupScheduleRequest} + */ +public final class CreateBackupScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.CreateBackupScheduleRequest) + CreateBackupScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBackupScheduleRequest.newBuilder() to construct. + private CreateBackupScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBackupScheduleRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBackupScheduleRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.CreateBackupScheduleRequest.class, + com.google.firestore.admin.v1.CreateBackupScheduleRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent database.
+   *
+   *  Format `projects/{project}/databases/{database}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 parent database.
+   *
+   *  Format `projects/{project}/databases/{database}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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_SCHEDULE_FIELD_NUMBER = 2; + private com.google.firestore.admin.v1.BackupSchedule backupSchedule_; + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + @java.lang.Override + public boolean hasBackupSchedule() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + @java.lang.Override + public com.google.firestore.admin.v1.BackupSchedule getBackupSchedule() { + return backupSchedule_ == null + ? com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder() { + return backupSchedule_ == null + ? com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getBackupSchedule()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackupSchedule()); + } + size += getUnknownFields().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.firestore.admin.v1.CreateBackupScheduleRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.CreateBackupScheduleRequest other = + (com.google.firestore.admin.v1.CreateBackupScheduleRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasBackupSchedule() != other.hasBackupSchedule()) return false; + if (hasBackupSchedule()) { + if (!getBackupSchedule().equals(other.getBackupSchedule())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasBackupSchedule()) { + hash = (37 * hash) + BACKUP_SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSchedule().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest 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.firestore.admin.v1.CreateBackupScheduleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest 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.firestore.admin.v1.CreateBackupScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest 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.firestore.admin.v1.CreateBackupScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest 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.firestore.admin.v1.CreateBackupScheduleRequest 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
+   * [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.CreateBackupScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.CreateBackupScheduleRequest) + com.google.firestore.admin.v1.CreateBackupScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.CreateBackupScheduleRequest.class, + com.google.firestore.admin.v1.CreateBackupScheduleRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.CreateBackupScheduleRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupScheduleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backupSchedule_ = null; + if (backupScheduleBuilder_ != null) { + backupScheduleBuilder_.dispose(); + backupScheduleBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.CreateBackupScheduleRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.CreateBackupScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.CreateBackupScheduleRequest build() { + com.google.firestore.admin.v1.CreateBackupScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.CreateBackupScheduleRequest buildPartial() { + com.google.firestore.admin.v1.CreateBackupScheduleRequest result = + new com.google.firestore.admin.v1.CreateBackupScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.CreateBackupScheduleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupSchedule_ = + backupScheduleBuilder_ == null ? backupSchedule_ : backupScheduleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.firestore.admin.v1.CreateBackupScheduleRequest) { + return mergeFrom((com.google.firestore.admin.v1.CreateBackupScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.CreateBackupScheduleRequest other) { + if (other == com.google.firestore.admin.v1.CreateBackupScheduleRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasBackupSchedule()) { + mergeBackupSchedule(other.getBackupSchedule()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getBackupScheduleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent database.
+     *
+     *  Format `projects/{project}/databases/{database}`
+     * 
+ * + * + * 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 parent database.
+     *
+     *  Format `projects/{project}/databases/{database}`
+     * 
+ * + * + * 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 parent database.
+     *
+     *  Format `projects/{project}/databases/{database}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent database.
+     *
+     *  Format `projects/{project}/databases/{database}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent database.
+     *
+     *  Format `projects/{project}/databases/{database}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.BackupSchedule backupSchedule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder> + backupScheduleBuilder_; + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + public boolean hasBackupSchedule() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + public com.google.firestore.admin.v1.BackupSchedule getBackupSchedule() { + if (backupScheduleBuilder_ == null) { + return backupSchedule_ == null + ? com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } else { + return backupScheduleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackupSchedule(com.google.firestore.admin.v1.BackupSchedule value) { + if (backupScheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupSchedule_ = value; + } else { + backupScheduleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackupSchedule( + com.google.firestore.admin.v1.BackupSchedule.Builder builderForValue) { + if (backupScheduleBuilder_ == null) { + backupSchedule_ = builderForValue.build(); + } else { + backupScheduleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackupSchedule(com.google.firestore.admin.v1.BackupSchedule value) { + if (backupScheduleBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && backupSchedule_ != null + && backupSchedule_ + != com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance()) { + getBackupScheduleBuilder().mergeFrom(value); + } else { + backupSchedule_ = value; + } + } else { + backupScheduleBuilder_.mergeFrom(value); + } + if (backupSchedule_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackupSchedule() { + bitField0_ = (bitField0_ & ~0x00000002); + backupSchedule_ = null; + if (backupScheduleBuilder_ != null) { + backupScheduleBuilder_.dispose(); + backupScheduleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.firestore.admin.v1.BackupSchedule.Builder getBackupScheduleBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBackupScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder() { + if (backupScheduleBuilder_ != null) { + return backupScheduleBuilder_.getMessageOrBuilder(); + } else { + return backupSchedule_ == null + ? com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + } + /** + * + * + *
+     * Required. The backup schedule to create.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder> + getBackupScheduleFieldBuilder() { + if (backupScheduleBuilder_ == null) { + backupScheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder>( + getBackupSchedule(), getParentForChildren(), isClean()); + backupSchedule_ = null; + } + return backupScheduleBuilder_; + } + + @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.firestore.admin.v1.CreateBackupScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.CreateBackupScheduleRequest) + private static final com.google.firestore.admin.v1.CreateBackupScheduleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.CreateBackupScheduleRequest(); + } + + public static com.google.firestore.admin.v1.CreateBackupScheduleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupScheduleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.CreateBackupScheduleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateBackupScheduleRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateBackupScheduleRequestOrBuilder.java new file mode 100644 index 0000000000..d5402d0e4a --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateBackupScheduleRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface CreateBackupScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.CreateBackupScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent database.
+   *
+   *  Format `projects/{project}/databases/{database}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent database.
+   *
+   *  Format `projects/{project}/databases/{database}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + boolean hasBackupSchedule(); + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + com.google.firestore.admin.v1.BackupSchedule getBackupSchedule(); + /** + * + * + *
+   * Required. The backup schedule to create.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DailyRecurrence.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DailyRecurrence.java new file mode 100644 index 0000000000..f5015f95f8 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DailyRecurrence.java @@ -0,0 +1,435 @@ +/* + * Copyright 2024 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/firestore/admin/v1/schedule.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Represent a recurring schedule that runs at a specific time every day.
+ *
+ * The time zone is UTC.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DailyRecurrence} + */ +public final class DailyRecurrence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.DailyRecurrence) + DailyRecurrenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use DailyRecurrence.newBuilder() to construct. + private DailyRecurrence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DailyRecurrence() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DailyRecurrence(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_DailyRecurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_DailyRecurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DailyRecurrence.class, + com.google.firestore.admin.v1.DailyRecurrence.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.firestore.admin.v1.DailyRecurrence)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.DailyRecurrence other = + (com.google.firestore.admin.v1.DailyRecurrence) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.DailyRecurrence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DailyRecurrence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DailyRecurrence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DailyRecurrence 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.firestore.admin.v1.DailyRecurrence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DailyRecurrence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DailyRecurrence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DailyRecurrence 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.firestore.admin.v1.DailyRecurrence parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DailyRecurrence 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.firestore.admin.v1.DailyRecurrence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DailyRecurrence 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.firestore.admin.v1.DailyRecurrence 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; + } + /** + * + * + *
+   * Represent a recurring schedule that runs at a specific time every day.
+   *
+   * The time zone is UTC.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DailyRecurrence} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.DailyRecurrence) + com.google.firestore.admin.v1.DailyRecurrenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_DailyRecurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_DailyRecurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DailyRecurrence.class, + com.google.firestore.admin.v1.DailyRecurrence.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.DailyRecurrence.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_DailyRecurrence_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DailyRecurrence getDefaultInstanceForType() { + return com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.DailyRecurrence build() { + com.google.firestore.admin.v1.DailyRecurrence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DailyRecurrence buildPartial() { + com.google.firestore.admin.v1.DailyRecurrence result = + new com.google.firestore.admin.v1.DailyRecurrence(this); + 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.firestore.admin.v1.DailyRecurrence) { + return mergeFrom((com.google.firestore.admin.v1.DailyRecurrence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.DailyRecurrence other) { + if (other == com.google.firestore.admin.v1.DailyRecurrence.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.firestore.admin.v1.DailyRecurrence) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.DailyRecurrence) + private static final com.google.firestore.admin.v1.DailyRecurrence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.DailyRecurrence(); + } + + public static com.google.firestore.admin.v1.DailyRecurrence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DailyRecurrence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.DailyRecurrence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DailyRecurrenceOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DailyRecurrenceOrBuilder.java new file mode 100644 index 0000000000..750956a9bd --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DailyRecurrenceOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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/firestore/admin/v1/schedule.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface DailyRecurrenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.DailyRecurrence) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupRequest.java new file mode 100644 index 0000000000..e4643bb90b --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteBackupRequest} + */ +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteBackupRequest.class, + com.google.firestore.admin.v1.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the backup to delete.
+   *
+   * format is `projects/{project}/locations/{location}/backups/{backup}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + 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.
+   *
+   * format is `projects/{project}/locations/{location}/backups/{backup}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.firestore.admin.v1.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.DeleteBackupRequest other = + (com.google.firestore.admin.v1.DeleteBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.DeleteBackupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.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
+   * [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.DeleteBackupRequest) + com.google.firestore.admin.v1.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteBackupRequest.class, + com.google.firestore.admin.v1.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.DeleteBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteBackupRequest build() { + com.google.firestore.admin.v1.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteBackupRequest buildPartial() { + com.google.firestore.admin.v1.DeleteBackupRequest result = + new com.google.firestore.admin.v1.DeleteBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.DeleteBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.firestore.admin.v1.DeleteBackupRequest) { + return mergeFrom((com.google.firestore.admin.v1.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.DeleteBackupRequest other) { + if (other == com.google.firestore.admin.v1.DeleteBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the backup to delete.
+     *
+     * format is `projects/{project}/locations/{location}/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.
+     *
+     * format is `projects/{project}/locations/{location}/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.
+     *
+     * format is `projects/{project}/locations/{location}/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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the backup to delete.
+     *
+     * format is `projects/{project}/locations/{location}/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(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the backup to delete.
+     *
+     * format is `projects/{project}/locations/{location}/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; + bitField0_ |= 0x00000001; + 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.firestore.admin.v1.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.DeleteBackupRequest) + private static final com.google.firestore.admin.v1.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.DeleteBackupRequest(); + } + + public static com.google.firestore.admin.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupRequestOrBuilder.java new file mode 100644 index 0000000000..40dcbef622 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the backup to delete.
+   *
+   * format is `projects/{project}/locations/{location}/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.
+   *
+   * format is `projects/{project}/locations/{location}/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-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupScheduleRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupScheduleRequest.java new file mode 100644 index 0000000000..0dece9b1a4 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupScheduleRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.DeleteBackupSchedules][].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteBackupScheduleRequest} + */ +public final class DeleteBackupScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.DeleteBackupScheduleRequest) + DeleteBackupScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBackupScheduleRequest.newBuilder() to construct. + private DeleteBackupScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBackupScheduleRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBackupScheduleRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteBackupScheduleRequest.class, + com.google.firestore.admin.v1.DeleteBackupScheduleRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of backup schedule.
+   *
+   * Format
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + 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. The name of backup schedule.
+   *
+   * Format
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.firestore.admin.v1.DeleteBackupScheduleRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.DeleteBackupScheduleRequest other = + (com.google.firestore.admin.v1.DeleteBackupScheduleRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest 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.firestore.admin.v1.DeleteBackupScheduleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest 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.firestore.admin.v1.DeleteBackupScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest 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.firestore.admin.v1.DeleteBackupScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest 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.firestore.admin.v1.DeleteBackupScheduleRequest 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 [FirestoreAdmin.DeleteBackupSchedules][].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteBackupScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.DeleteBackupScheduleRequest) + com.google.firestore.admin.v1.DeleteBackupScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteBackupScheduleRequest.class, + com.google.firestore.admin.v1.DeleteBackupScheduleRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.DeleteBackupScheduleRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteBackupScheduleRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.DeleteBackupScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteBackupScheduleRequest build() { + com.google.firestore.admin.v1.DeleteBackupScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteBackupScheduleRequest buildPartial() { + com.google.firestore.admin.v1.DeleteBackupScheduleRequest result = + new com.google.firestore.admin.v1.DeleteBackupScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.DeleteBackupScheduleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.firestore.admin.v1.DeleteBackupScheduleRequest) { + return mergeFrom((com.google.firestore.admin.v1.DeleteBackupScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.DeleteBackupScheduleRequest other) { + if (other == com.google.firestore.admin.v1.DeleteBackupScheduleRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * 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. The name of backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * 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. The name of backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.firestore.admin.v1.DeleteBackupScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.DeleteBackupScheduleRequest) + private static final com.google.firestore.admin.v1.DeleteBackupScheduleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.DeleteBackupScheduleRequest(); + } + + public static com.google.firestore.admin.v1.DeleteBackupScheduleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupScheduleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.DeleteBackupScheduleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupScheduleRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupScheduleRequestOrBuilder.java new file mode 100644 index 0000000000..7bfea1bed3 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteBackupScheduleRequestOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface DeleteBackupScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.DeleteBackupScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of backup schedule.
+   *
+   * Format
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of backup schedule.
+   *
+   * Format
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * + * 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-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java index c8a6a54a98..2241445338 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java @@ -64,6 +64,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -108,6 +132,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_firestore_admin_v1_ImportDocumentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -121,149 +165,224 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "min.proto\022\031google.firestore.admin.v1\032\034go" + "ogle/api/annotations.proto\032\027google/api/c" + "lient.proto\032\037google/api/field_behavior.p" - + "roto\032\031google/api/resource.proto\032(google/" + + "roto\032\031google/api/resource.proto\032&google/" + + "firestore/admin/v1/backup.proto\032(google/" + "firestore/admin/v1/database.proto\032%googl" + "e/firestore/admin/v1/field.proto\032%google" + "/firestore/admin/v1/index.proto\032)google/" - + "firestore/admin/v1/operation.proto\032#goog" - + "le/longrunning/operations.proto\032\033google/" - + "protobuf/empty.proto\032 google/protobuf/fi" - + "eld_mask.proto\032\037google/protobuf/timestam" - + "p.proto\"Q\n\024ListDatabasesRequest\0229\n\006paren" - + "t\030\001 \001(\tB)\340A\002\372A#\022!firestore.googleapis.co" - + "m/Database\"\250\001\n\025CreateDatabaseRequest\0229\n\006" - + "parent\030\001 \001(\tB)\340A\002\372A#\022!firestore.googleap" - + "is.com/Database\022:\n\010database\030\002 \001(\0132#.goog" - + "le.firestore.admin.v1.DatabaseB\003\340A\002\022\030\n\013d" - + "atabase_id\030\003 \001(\tB\003\340A\002\"\030\n\026CreateDatabaseM" - + "etadata\"d\n\025ListDatabasesResponse\0226\n\tdata" - + "bases\030\001 \003(\0132#.google.firestore.admin.v1." - + "Database\022\023\n\013unreachable\030\003 \003(\t\"M\n\022GetData" - + "baseRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!fires" - + "tore.googleapis.com/Database\"\204\001\n\025UpdateD" - + "atabaseRequest\022:\n\010database\030\001 \001(\0132#.googl" - + "e.firestore.admin.v1.DatabaseB\003\340A\002\022/\n\013up" - + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" - + "ask\"\030\n\026UpdateDatabaseMetadata\"^\n\025DeleteD" - + "atabaseRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!fi" - + "restore.googleapis.com/Database\022\014\n\004etag\030" - + "\003 \001(\t\"\030\n\026DeleteDatabaseMetadata\"\214\001\n\022Crea" - + "teIndexRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(" - + "firestore.googleapis.com/CollectionGroup" - + "\0224\n\005index\030\002 \001(\0132 .google.firestore.admin" - + ".v1.IndexB\003\340A\002\"\215\001\n\022ListIndexesRequest\022@\n" - + "\006parent\030\001 \001(\tB0\340A\002\372A*\n(firestore.googlea" - + "pis.com/CollectionGroup\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\"a" - + "\n\023ListIndexesResponse\0221\n\007indexes\030\001 \003(\0132 " - + ".google.firestore.admin.v1.Index\022\027\n\017next" - + "_page_token\030\002 \001(\t\"G\n\017GetIndexRequest\0224\n\004" - + "name\030\001 \001(\tB&\340A\002\372A \n\036firestore.googleapis" - + ".com/Index\"J\n\022DeleteIndexRequest\0224\n\004name" - + "\030\001 \001(\tB&\340A\002\372A \n\036firestore.googleapis.com" - + "/Index\"{\n\022UpdateFieldRequest\0224\n\005field\030\001 " - + "\001(\0132 .google.firestore.admin.v1.FieldB\003\340" - + "A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.protobu" - + "f.FieldMask\"G\n\017GetFieldRequest\0224\n\004name\030\001" - + " \001(\tB&\340A\002\372A \n\036firestore.googleapis.com/F" - + "ield\"\214\001\n\021ListFieldsRequest\022@\n\006parent\030\001 \001" - + "(\tB0\340A\002\372A*\n(firestore.googleapis.com/Col" - + "lectionGroup\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_siz" - + "e\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"_\n\022ListField" - + "sResponse\0220\n\006fields\030\001 \003(\0132 .google.fires" - + "tore.admin.v1.Field\022\027\n\017next_page_token\030\002" - + " \001(\t\"\316\001\n\026ExportDocumentsRequest\0227\n\004name\030" - + "\001 \001(\tB)\340A\002\372A#\n!firestore.googleapis.com/" - + "Database\022\026\n\016collection_ids\030\002 \003(\t\022\031\n\021outp" - + "ut_uri_prefix\030\003 \001(\t\022\025\n\rnamespace_ids\030\004 \003" - + "(\t\0221\n\rsnapshot_time\030\005 \001(\0132\032.google.proto" - + "buf.Timestamp\"\232\001\n\026ImportDocumentsRequest" - + "\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!firestore.google" - + "apis.com/Database\022\026\n\016collection_ids\030\002 \003(" - + "\t\022\030\n\020input_uri_prefix\030\003 \001(\t\022\025\n\rnamespace" - + "_ids\030\004 \003(\t2\251\026\n\016FirestoreAdmin\022\333\001\n\013Create" - + "Index\022-.google.firestore.admin.v1.Create" - + "IndexRequest\032\035.google.longrunning.Operat" - + "ion\"~\312A\037\n\005Index\022\026IndexOperationMetadata\332" - + "A\014parent,index\202\323\344\223\002G\">/v1/{parent=projec" - + "ts/*/databases/*/collectionGroups/*}/ind" - + "exes:\005index\022\275\001\n\013ListIndexes\022-.google.fir" - + "estore.admin.v1.ListIndexesRequest\032..goo" - + "gle.firestore.admin.v1.ListIndexesRespon" - + "se\"O\332A\006parent\202\323\344\223\002@\022>/v1/{parent=project" - + "s/*/databases/*/collectionGroups/*}/inde" - + "xes\022\247\001\n\010GetIndex\022*.google.firestore.admi" - + "n.v1.GetIndexRequest\032 .google.firestore." - + "admin.v1.Index\"M\332A\004name\202\323\344\223\002@\022>/v1/{name" - + "=projects/*/databases/*/collectionGroups" - + "/*/indexes/*}\022\243\001\n\013DeleteIndex\022-.google.f" - + "irestore.admin.v1.DeleteIndexRequest\032\026.g" - + "oogle.protobuf.Empty\"M\332A\004name\202\323\344\223\002@*>/v1" - + "/{name=projects/*/databases/*/collection" - + "Groups/*/indexes/*}\022\246\001\n\010GetField\022*.googl" - + "e.firestore.admin.v1.GetFieldRequest\032 .g" - + "oogle.firestore.admin.v1.Field\"L\332A\004name\202" - + "\323\344\223\002?\022=/v1/{name=projects/*/databases/*/" - + "collectionGroups/*/fields/*}\022\331\001\n\013UpdateF" - + "ield\022-.google.firestore.admin.v1.UpdateF" - + "ieldRequest\032\035.google.longrunning.Operati" - + "on\"|\312A\037\n\005Field\022\026FieldOperationMetadata\332A" - + "\005field\202\323\344\223\002L2C/v1/{field.name=projects/*" - + "/databases/*/collectionGroups/*/fields/*" - + "}:\005field\022\271\001\n\nListFields\022,.google.firesto" - + "re.admin.v1.ListFieldsRequest\032-.google.f" - + "irestore.admin.v1.ListFieldsResponse\"N\332A" - + "\006parent\202\323\344\223\002?\022=/v1/{parent=projects/*/da" - + "tabases/*/collectionGroups/*}/fields\022\335\001\n" - + "\017ExportDocuments\0221.google.firestore.admi" - + "n.v1.ExportDocumentsRequest\032\035.google.lon" - + "grunning.Operation\"x\312A2\n\027ExportDocuments" - + "Response\022\027ExportDocumentsMetadata\332A\004name" - + "\202\323\344\223\0026\"1/v1/{name=projects/*/databases/*" - + "}:exportDocuments:\001*\022\333\001\n\017ImportDocuments" - + "\0221.google.firestore.admin.v1.ImportDocum" - + "entsRequest\032\035.google.longrunning.Operati" - + "on\"v\312A0\n\025google.protobuf.Empty\022\027ImportDo" - + "cumentsMetadata\332A\004name\202\323\344\223\0026\"1/v1/{name=" - + "projects/*/databases/*}:importDocuments:" - + "\001*\022\331\001\n\016CreateDatabase\0220.google.firestore" - + ".admin.v1.CreateDatabaseRequest\032\035.google" - + ".longrunning.Operation\"v\312A\"\n\010Database\022\026C" - + "reateDatabaseMetadata\332A\033parent,database," - + "database_id\202\323\344\223\002-\"!/v1/{parent=projects/" - + "*}/databases:\010database\022\223\001\n\013GetDatabase\022-" - + ".google.firestore.admin.v1.GetDatabaseRe" - + "quest\032#.google.firestore.admin.v1.Databa" - + "se\"0\332A\004name\202\323\344\223\002#\022!/v1/{name=projects/*/" - + "databases/*}\022\246\001\n\rListDatabases\022/.google." - + "firestore.admin.v1.ListDatabasesRequest\032" - + "0.google.firestore.admin.v1.ListDatabase" - + "sResponse\"2\332A\006parent\202\323\344\223\002#\022!/v1/{parent=" - + "projects/*}/databases\022\333\001\n\016UpdateDatabase" - + "\0220.google.firestore.admin.v1.UpdateDatab" + + "firestore/admin/v1/operation.proto\032(goog" + + "le/firestore/admin/v1/schedule.proto\032#go" + + "ogle/longrunning/operations.proto\032\033googl" + + "e/protobuf/empty.proto\032 google/protobuf/" + + "field_mask.proto\032\037google/protobuf/timest" + + "amp.proto\"Q\n\024ListDatabasesRequest\0229\n\006par" + + "ent\030\001 \001(\tB)\340A\002\372A#\022!firestore.googleapis." + + "com/Database\"\250\001\n\025CreateDatabaseRequest\0229" + + "\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!firestore.google" + + "apis.com/Database\022:\n\010database\030\002 \001(\0132#.go" + + "ogle.firestore.admin.v1.DatabaseB\003\340A\002\022\030\n" + + "\013database_id\030\003 \001(\tB\003\340A\002\"\030\n\026CreateDatabas" + + "eMetadata\"d\n\025ListDatabasesResponse\0226\n\tda" + + "tabases\030\001 \003(\0132#.google.firestore.admin.v" + + "1.Database\022\023\n\013unreachable\030\003 \003(\t\"M\n\022GetDa" + + "tabaseRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!fir" + + "estore.googleapis.com/Database\"\204\001\n\025Updat" + + "eDatabaseRequest\022:\n\010database\030\001 \001(\0132#.goo" + + "gle.firestore.admin.v1.DatabaseB\003\340A\002\022/\n\013" + + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" + + "dMask\"\030\n\026UpdateDatabaseMetadata\"^\n\025Delet" + + "eDatabaseRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!" + + "firestore.googleapis.com/Database\022\014\n\004eta" + + "g\030\003 \001(\t\"\030\n\026DeleteDatabaseMetadata\"\241\001\n\033Cr" + + "eateBackupScheduleRequest\0229\n\006parent\030\001 \001(" + + "\tB)\340A\002\372A#\n!firestore.googleapis.com/Data" + + "base\022G\n\017backup_schedule\030\002 \001(\0132).google.f" + + "irestore.admin.v1.BackupScheduleB\003\340A\002\"Y\n" + + "\030GetBackupScheduleRequest\022=\n\004name\030\001 \001(\tB" + + "/\340A\002\372A)\n\'firestore.googleapis.com/Backup" + + "Schedule\"\227\001\n\033UpdateBackupScheduleRequest" + + "\022G\n\017backup_schedule\030\001 \001(\0132).google.fires" + + "tore.admin.v1.BackupScheduleB\003\340A\002\022/\n\013upd" + + "ate_mask\030\002 \001(\0132\032.google.protobuf.FieldMa" + + "sk\"W\n\032ListBackupSchedulesRequest\0229\n\006pare" + + "nt\030\001 \001(\tB)\340A\002\372A#\n!firestore.googleapis.c" + + "om/Database\"b\n\033ListBackupSchedulesRespon" + + "se\022C\n\020backup_schedules\030\001 \003(\0132).google.fi" + + "restore.admin.v1.BackupSchedule\"\\\n\033Delet" + + "eBackupScheduleRequest\022=\n\004name\030\001 \001(\tB/\340A" + + "\002\372A)\n\'firestore.googleapis.com/BackupSch" + + "edule\"\214\001\n\022CreateIndexRequest\022@\n\006parent\030\001" + + " \001(\tB0\340A\002\372A*\n(firestore.googleapis.com/C" + + "ollectionGroup\0224\n\005index\030\002 \001(\0132 .google.f" + + "irestore.admin.v1.IndexB\003\340A\002\"\215\001\n\022ListInd" + + "exesRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(fir" + + "estore.googleapis.com/CollectionGroup\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\"a\n\023ListIndexesResponse\0221\n\007i" + + "ndexes\030\001 \003(\0132 .google.firestore.admin.v1" + + ".Index\022\027\n\017next_page_token\030\002 \001(\t\"G\n\017GetIn" + + "dexRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036firest" + + "ore.googleapis.com/Index\"J\n\022DeleteIndexR" + + "equest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036firestore." + + "googleapis.com/Index\"{\n\022UpdateFieldReque" + + "st\0224\n\005field\030\001 \001(\0132 .google.firestore.adm" + + "in.v1.FieldB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032." + + "google.protobuf.FieldMask\"G\n\017GetFieldReq" + + "uest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036firestore.go" + + "ogleapis.com/Field\"\214\001\n\021ListFieldsRequest" + + "\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(firestore.goog" + + "leapis.com/CollectionGroup\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\"_\n\022ListFieldsResponse\0220\n\006fields\030\001 \003(\0132" + + " .google.firestore.admin.v1.Field\022\027\n\017nex" + + "t_page_token\030\002 \001(\t\"\316\001\n\026ExportDocumentsRe" + + "quest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!firestore.g" + + "oogleapis.com/Database\022\026\n\016collection_ids" + + "\030\002 \003(\t\022\031\n\021output_uri_prefix\030\003 \001(\t\022\025\n\rnam" + + "espace_ids\030\004 \003(\t\0221\n\rsnapshot_time\030\005 \001(\0132" + + "\032.google.protobuf.Timestamp\"\232\001\n\026ImportDo" + + "cumentsRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!fi" + + "restore.googleapis.com/Database\022\026\n\016colle" + + "ction_ids\030\002 \003(\t\022\030\n\020input_uri_prefix\030\003 \001(" + + "\t\022\025\n\rnamespace_ids\030\004 \003(\t\"I\n\020GetBackupReq" + + "uest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037firestore.go" + + "ogleapis.com/Backup\"O\n\022ListBackupsReques" + + "t\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!firestore.goo" + + "gleapis.com/Location\"^\n\023ListBackupsRespo" + + "nse\0222\n\007backups\030\001 \003(\0132!.google.firestore." + + "admin.v1.Backup\022\023\n\013unreachable\030\003 \003(\t\"L\n\023" + + "DeleteBackupRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A" + + "!\n\037firestore.googleapis.com/Backup\"\246\001\n\026R" + + "estoreDatabaseRequest\0229\n\006parent\030\001 \001(\tB)\340" + + "A\002\372A#\022!firestore.googleapis.com/Database" + + "\022\030\n\013database_id\030\002 \001(\tB\003\340A\002\0227\n\006backup\030\003 \001" + + "(\tB\'\340A\002\372A!\n\037firestore.googleapis.com/Bac" + + "kup2\326#\n\016FirestoreAdmin\022\333\001\n\013CreateIndex\022-" + + ".google.firestore.admin.v1.CreateIndexRe" + + "quest\032\035.google.longrunning.Operation\"~\312A" + + "\037\n\005Index\022\026IndexOperationMetadata\332A\014paren" + + "t,index\202\323\344\223\002G\">/v1/{parent=projects/*/da" + + "tabases/*/collectionGroups/*}/indexes:\005i" + + "ndex\022\275\001\n\013ListIndexes\022-.google.firestore." + + "admin.v1.ListIndexesRequest\032..google.fir" + + "estore.admin.v1.ListIndexesResponse\"O\332A\006" + + "parent\202\323\344\223\002@\022>/v1/{parent=projects/*/dat" + + "abases/*/collectionGroups/*}/indexes\022\247\001\n" + + "\010GetIndex\022*.google.firestore.admin.v1.Ge" + + "tIndexRequest\032 .google.firestore.admin.v" + + "1.Index\"M\332A\004name\202\323\344\223\002@\022>/v1/{name=projec" + + "ts/*/databases/*/collectionGroups/*/inde" + + "xes/*}\022\243\001\n\013DeleteIndex\022-.google.firestor" + + "e.admin.v1.DeleteIndexRequest\032\026.google.p" + + "rotobuf.Empty\"M\332A\004name\202\323\344\223\002@*>/v1/{name=" + + "projects/*/databases/*/collectionGroups/" + + "*/indexes/*}\022\246\001\n\010GetField\022*.google.fires" + + "tore.admin.v1.GetFieldRequest\032 .google.f" + + "irestore.admin.v1.Field\"L\332A\004name\202\323\344\223\002?\022=" + + "/v1/{name=projects/*/databases/*/collect" + + "ionGroups/*/fields/*}\022\331\001\n\013UpdateField\022-." + + "google.firestore.admin.v1.UpdateFieldReq" + + "uest\032\035.google.longrunning.Operation\"|\312A\037" + + "\n\005Field\022\026FieldOperationMetadata\332A\005field\202" + + "\323\344\223\002L2C/v1/{field.name=projects/*/databa" + + "ses/*/collectionGroups/*/fields/*}:\005fiel" + + "d\022\271\001\n\nListFields\022,.google.firestore.admi" + + "n.v1.ListFieldsRequest\032-.google.firestor" + + "e.admin.v1.ListFieldsResponse\"N\332A\006parent" + + "\202\323\344\223\002?\022=/v1/{parent=projects/*/databases" + + "/*/collectionGroups/*}/fields\022\335\001\n\017Export" + + "Documents\0221.google.firestore.admin.v1.Ex" + + "portDocumentsRequest\032\035.google.longrunnin" + + "g.Operation\"x\312A2\n\027ExportDocumentsRespons" + + "e\022\027ExportDocumentsMetadata\332A\004name\202\323\344\223\0026\"" + + "1/v1/{name=projects/*/databases/*}:expor" + + "tDocuments:\001*\022\333\001\n\017ImportDocuments\0221.goog" + + "le.firestore.admin.v1.ImportDocumentsReq" + + "uest\032\035.google.longrunning.Operation\"v\312A0" + + "\n\025google.protobuf.Empty\022\027ImportDocuments" + + "Metadata\332A\004name\202\323\344\223\0026\"1/v1/{name=project" + + "s/*/databases/*}:importDocuments:\001*\022\331\001\n\016" + + "CreateDatabase\0220.google.firestore.admin." + + "v1.CreateDatabaseRequest\032\035.google.longru" + + "nning.Operation\"v\312A\"\n\010Database\022\026CreateDa" + + "tabaseMetadata\332A\033parent,database,databas" + + "e_id\202\323\344\223\002-\"!/v1/{parent=projects/*}/data" + + "bases:\010database\022\223\001\n\013GetDatabase\022-.google" + + ".firestore.admin.v1.GetDatabaseRequest\032#" + + ".google.firestore.admin.v1.Database\"0\332A\004" + + "name\202\323\344\223\002#\022!/v1/{name=projects/*/databas" + + "es/*}\022\246\001\n\rListDatabases\022/.google.firesto" + + "re.admin.v1.ListDatabasesRequest\0320.googl" + + "e.firestore.admin.v1.ListDatabasesRespon" + + "se\"2\332A\006parent\202\323\344\223\002#\022!/v1/{parent=project" + + "s/*}/databases\022\333\001\n\016UpdateDatabase\0220.goog" + + "le.firestore.admin.v1.UpdateDatabaseRequ" + + "est\032\035.google.longrunning.Operation\"x\312A\"\n" + + "\010Database\022\026UpdateDatabaseMetadata\332A\024data" + + "base,update_mask\202\323\344\223\00262*/v1/{database.na" + + "me=projects/*/databases/*}:\010database\022\270\001\n" + + "\016DeleteDatabase\0220.google.firestore.admin" + + ".v1.DeleteDatabaseRequest\032\035.google.longr" + + "unning.Operation\"U\312A\"\n\010Database\022\026DeleteD" + + "atabaseMetadata\332A\004name\202\323\344\223\002#*!/v1/{name=" + + "projects/*/databases/*}\022\227\001\n\tGetBackup\022+." + + "google.firestore.admin.v1.GetBackupReque" + + "st\032!.google.firestore.admin.v1.Backup\":\332" + + "A\004name\202\323\344\223\002-\022+/v1/{name=projects/*/locat" + + "ions/*/backups/*}\022\252\001\n\013ListBackups\022-.goog" + + "le.firestore.admin.v1.ListBackupsRequest" + + "\032..google.firestore.admin.v1.ListBackups" + + "Response\"<\332A\006parent\202\323\344\223\002-\022+/v1/{parent=p" + + "rojects/*/locations/*}/backups\022\222\001\n\014Delet" + + "eBackup\022..google.firestore.admin.v1.Dele" + + "teBackupRequest\032\026.google.protobuf.Empty\"" + + ":\332A\004name\202\323\344\223\002-*+/v1/{name=projects/*/loc" + + "ations/*/backups/*}\022\277\001\n\017RestoreDatabase\022" + + "1.google.firestore.admin.v1.RestoreDatab" + "aseRequest\032\035.google.longrunning.Operatio" - + "n\"x\312A\"\n\010Database\022\026UpdateDatabaseMetadata" - + "\332A\024database,update_mask\202\323\344\223\00262*/v1/{data" - + "base.name=projects/*/databases/*}:\010datab" - + "ase\022\270\001\n\016DeleteDatabase\0220.google.firestor" - + "e.admin.v1.DeleteDatabaseRequest\032\035.googl" - + "e.longrunning.Operation\"U\312A\"\n\010Database\022\026" - + "DeleteDatabaseMetadata\332A\004name\202\323\344\223\002#*!/v1" - + "/{name=projects/*/databases/*}\032v\312A\030fires" - + "tore.googleapis.com\322AXhttps://www.google" - + "apis.com/auth/cloud-platform,https://www" - + ".googleapis.com/auth/datastoreB\245\003\n\035com.g" - + "oogle.firestore.admin.v1B\023FirestoreAdmin" - + "ProtoP\001Z9cloud.google.com/go/firestore/a" - + "piv1/admin/adminpb;adminpb\242\002\004GCFS\252\002\037Goog" - + "le.Cloud.Firestore.Admin.V1\312\002\037Google\\Clo" - + "ud\\Firestore\\Admin\\V1\352\002#Google::Cloud::F" - + "irestore::Admin::V1\352AL\n!firestore.google" - + "apis.com/Location\022\'projects/{project}/lo" - + "cations/{location}\352Aq\n(firestore.googlea" - + "pis.com/CollectionGroup\022Eprojects/{proje" - + "ct}/databases/{database}/collectionGroup" - + "s/{collection}b\006proto3" + + "n\"Z\312A#\n\010Database\022\027RestoreDatabaseMetadat" + + "a\202\323\344\223\002.\")/v1/{parent=projects/*}/databas" + + "es:restore:\001*\022\340\001\n\024CreateBackupSchedule\0226" + + ".google.firestore.admin.v1.CreateBackupS" + + "cheduleRequest\032).google.firestore.admin." + + "v1.BackupSchedule\"e\332A\026parent,backup_sche" + + "dule\202\323\344\223\002F\"3/v1/{parent=projects/*/datab" + + "ases/*}/backupSchedules:\017backup_schedule" + + "\022\267\001\n\021GetBackupSchedule\0223.google.firestor" + + "e.admin.v1.GetBackupScheduleRequest\032).go" + + "ogle.firestore.admin.v1.BackupSchedule\"B" + + "\332A\004name\202\323\344\223\0025\0223/v1/{name=projects/*/data" + + "bases/*/backupSchedules/*}\022\312\001\n\023ListBacku" + + "pSchedules\0225.google.firestore.admin.v1.L" + + "istBackupSchedulesRequest\0326.google.fires" + + "tore.admin.v1.ListBackupSchedulesRespons" + + "e\"D\332A\006parent\202\323\344\223\0025\0223/v1/{parent=projects" + + "/*/databases/*}/backupSchedules\022\365\001\n\024Upda" + + "teBackupSchedule\0226.google.firestore.admi" + + "n.v1.UpdateBackupScheduleRequest\032).googl" + + "e.firestore.admin.v1.BackupSchedule\"z\332A\033" + + "backup_schedule,update_mask\202\323\344\223\002V2C/v1/{" + + "backup_schedule.name=projects/*/database" + + "s/*/backupSchedules/*}:\017backup_schedule\022" + + "\252\001\n\024DeleteBackupSchedule\0226.google.firest" + + "ore.admin.v1.DeleteBackupScheduleRequest" + + "\032\026.google.protobuf.Empty\"B\332A\004name\202\323\344\223\0025*" + + "3/v1/{name=projects/*/databases/*/backup" + + "Schedules/*}\032v\312A\030firestore.googleapis.co" + + "m\322AXhttps://www.googleapis.com/auth/clou" + + "d-platform,https://www.googleapis.com/au" + + "th/datastoreB\245\003\n\035com.google.firestore.ad" + + "min.v1B\023FirestoreAdminProtoP\001Z9cloud.goo" + + "gle.com/go/firestore/apiv1/admin/adminpb" + + ";adminpb\242\002\004GCFS\252\002\037Google.Cloud.Firestore" + + ".Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin" + + "\\V1\352\002#Google::Cloud::Firestore::Admin::V" + + "1\352AL\n!firestore.googleapis.com/Location\022" + + "\'projects/{project}/locations/{location}" + + "\352Aq\n(firestore.googleapis.com/Collection" + + "Group\022Eprojects/{project}/databases/{dat" + + "abase}/collectionGroups/{collection}b\006pr" + + "oto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -273,10 +392,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.firestore.admin.v1.BackupProto.getDescriptor(), com.google.firestore.admin.v1.DatabaseProto.getDescriptor(), com.google.firestore.admin.v1.FieldProto.getDescriptor(), com.google.firestore.admin.v1.IndexProto.getDescriptor(), com.google.firestore.admin.v1.OperationProto.getDescriptor(), + com.google.firestore.admin.v1.ScheduleProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), @@ -348,8 +469,56 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_descriptor, new java.lang.String[] {}); - internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor = + internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_descriptor = getDescriptor().getMessageTypes().get(9); + internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_CreateBackupScheduleRequest_descriptor, + new java.lang.String[] { + "Parent", "BackupSchedule", + }); + internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_descriptor, + new java.lang.String[] { + "BackupSchedule", "UpdateMask", + }); + internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_descriptor, + new java.lang.String[] { + "BackupSchedules", + }); + internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_DeleteBackupScheduleRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(15); internal_static_google_firestore_admin_v1_CreateIndexRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor, @@ -357,7 +526,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Index", }); internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(16); internal_static_google_firestore_admin_v1_ListIndexesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor, @@ -365,7 +534,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Filter", "PageSize", "PageToken", }); internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(17); internal_static_google_firestore_admin_v1_ListIndexesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor, @@ -373,7 +542,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Indexes", "NextPageToken", }); internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(18); internal_static_google_firestore_admin_v1_GetIndexRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor, @@ -381,7 +550,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(19); internal_static_google_firestore_admin_v1_DeleteIndexRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor, @@ -389,7 +558,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(20); internal_static_google_firestore_admin_v1_UpdateFieldRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor, @@ -397,7 +566,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Field", "UpdateMask", }); internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(21); internal_static_google_firestore_admin_v1_GetFieldRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor, @@ -405,7 +574,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(22); internal_static_google_firestore_admin_v1_ListFieldsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor, @@ -413,7 +582,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Filter", "PageSize", "PageToken", }); internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(23); internal_static_google_firestore_admin_v1_ListFieldsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor, @@ -421,7 +590,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Fields", "NextPageToken", }); internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(24); internal_static_google_firestore_admin_v1_ExportDocumentsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor, @@ -429,13 +598,53 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "CollectionIds", "OutputUriPrefix", "NamespaceIds", "SnapshotTime", }); internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(25); internal_static_google_firestore_admin_v1_ImportDocumentsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor, new java.lang.String[] { "Name", "CollectionIds", "InputUriPrefix", "NamespaceIds", }); + internal_static_google_firestore_admin_v1_GetBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_firestore_admin_v1_GetBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_GetBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_firestore_admin_v1_ListBackupsRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_firestore_admin_v1_ListBackupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ListBackupsRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_firestore_admin_v1_ListBackupsResponse_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_firestore_admin_v1_ListBackupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ListBackupsResponse_descriptor, + new java.lang.String[] { + "Backups", "Unreachable", + }); + internal_static_google_firestore_admin_v1_DeleteBackupRequest_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_firestore_admin_v1_DeleteBackupRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_DeleteBackupRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor, + new java.lang.String[] { + "Parent", "DatabaseId", "Backup", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -452,10 +661,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.firestore.admin.v1.BackupProto.getDescriptor(); com.google.firestore.admin.v1.DatabaseProto.getDescriptor(); com.google.firestore.admin.v1.FieldProto.getDescriptor(); com.google.firestore.admin.v1.IndexProto.getDescriptor(); com.google.firestore.admin.v1.OperationProto.getDescriptor(); + com.google.firestore.admin.v1.ScheduleProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupRequest.java new file mode 100644 index 0000000000..bc3a044313 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupRequest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.GetBackupRequest} + */ +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.GetBackupRequest.class, + com.google.firestore.admin.v1.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the backup to fetch.
+   *
+   * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + 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 fetch.
+   *
+   * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.firestore.admin.v1.GetBackupRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.GetBackupRequest other = + (com.google.firestore.admin.v1.GetBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.GetBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.GetBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.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
+   * [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.GetBackupRequest) + com.google.firestore.admin.v1.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.GetBackupRequest.class, + com.google.firestore.admin.v1.GetBackupRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.GetBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetBackupRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetBackupRequest build() { + com.google.firestore.admin.v1.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetBackupRequest buildPartial() { + com.google.firestore.admin.v1.GetBackupRequest result = + new com.google.firestore.admin.v1.GetBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.GetBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.firestore.admin.v1.GetBackupRequest) { + return mergeFrom((com.google.firestore.admin.v1.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.GetBackupRequest other) { + if (other == com.google.firestore.admin.v1.GetBackupRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the backup to fetch.
+     *
+     * Format is `projects/{project}/locations/{location}/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 fetch.
+     *
+     * Format is `projects/{project}/locations/{location}/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 fetch.
+     *
+     * Format is `projects/{project}/locations/{location}/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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the backup to fetch.
+     *
+     * Format is `projects/{project}/locations/{location}/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(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the backup to fetch.
+     *
+     * Format is `projects/{project}/locations/{location}/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; + bitField0_ |= 0x00000001; + 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.firestore.admin.v1.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.GetBackupRequest) + private static final com.google.firestore.admin.v1.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.GetBackupRequest(); + } + + public static com.google.firestore.admin.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupRequestOrBuilder.java new file mode 100644 index 0000000000..541b353aa9 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the backup to fetch.
+   *
+   * Format is `projects/{project}/locations/{location}/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 fetch.
+   *
+   * Format is `projects/{project}/locations/{location}/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-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupScheduleRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupScheduleRequest.java new file mode 100644 index 0000000000..466569f114 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupScheduleRequest.java @@ -0,0 +1,663 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.GetBackupScheduleRequest} + */ +public final class GetBackupScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.GetBackupScheduleRequest) + GetBackupScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBackupScheduleRequest.newBuilder() to construct. + private GetBackupScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBackupScheduleRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBackupScheduleRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.GetBackupScheduleRequest.class, + com.google.firestore.admin.v1.GetBackupScheduleRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the backup schedule.
+   *
+   * Format
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + 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. The name of the backup schedule.
+   *
+   * Format
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.firestore.admin.v1.GetBackupScheduleRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.GetBackupScheduleRequest other = + (com.google.firestore.admin.v1.GetBackupScheduleRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest 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.firestore.admin.v1.GetBackupScheduleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest 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.firestore.admin.v1.GetBackupScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest 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.firestore.admin.v1.GetBackupScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest 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.firestore.admin.v1.GetBackupScheduleRequest 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
+   * [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.GetBackupScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.GetBackupScheduleRequest) + com.google.firestore.admin.v1.GetBackupScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.GetBackupScheduleRequest.class, + com.google.firestore.admin.v1.GetBackupScheduleRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.GetBackupScheduleRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetBackupScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetBackupScheduleRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.GetBackupScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetBackupScheduleRequest build() { + com.google.firestore.admin.v1.GetBackupScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetBackupScheduleRequest buildPartial() { + com.google.firestore.admin.v1.GetBackupScheduleRequest result = + new com.google.firestore.admin.v1.GetBackupScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.GetBackupScheduleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.firestore.admin.v1.GetBackupScheduleRequest) { + return mergeFrom((com.google.firestore.admin.v1.GetBackupScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.GetBackupScheduleRequest other) { + if (other == com.google.firestore.admin.v1.GetBackupScheduleRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * 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. The name of the backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * 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. The name of the backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the backup schedule.
+     *
+     * Format
+     * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.firestore.admin.v1.GetBackupScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.GetBackupScheduleRequest) + private static final com.google.firestore.admin.v1.GetBackupScheduleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.GetBackupScheduleRequest(); + } + + public static com.google.firestore.admin.v1.GetBackupScheduleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupScheduleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.GetBackupScheduleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupScheduleRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupScheduleRequestOrBuilder.java new file mode 100644 index 0000000000..d75c69e10f --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetBackupScheduleRequestOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface GetBackupScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.GetBackupScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the backup schedule.
+   *
+   * Format
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the backup schedule.
+   *
+   * Format
+   * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+   * 
+ * + * + * 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-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesRequest.java new file mode 100644 index 0000000000..c8f38c04c4 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesRequest.java @@ -0,0 +1,656 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListBackupSchedulesRequest} + */ +public final class ListBackupSchedulesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ListBackupSchedulesRequest) + ListBackupSchedulesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupSchedulesRequest.newBuilder() to construct. + private ListBackupSchedulesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupSchedulesRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupSchedulesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListBackupSchedulesRequest.class, + com.google.firestore.admin.v1.ListBackupSchedulesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent database.
+   *
+   * Format is `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 parent database.
+   *
+   * Format is `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += getUnknownFields().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.firestore.admin.v1.ListBackupSchedulesRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ListBackupSchedulesRequest other = + (com.google.firestore.admin.v1.ListBackupSchedulesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest 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.firestore.admin.v1.ListBackupSchedulesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest 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.firestore.admin.v1.ListBackupSchedulesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest 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.firestore.admin.v1.ListBackupSchedulesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest 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.firestore.admin.v1.ListBackupSchedulesRequest 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
+   * [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListBackupSchedulesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ListBackupSchedulesRequest) + com.google.firestore.admin.v1.ListBackupSchedulesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListBackupSchedulesRequest.class, + com.google.firestore.admin.v1.ListBackupSchedulesRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ListBackupSchedulesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupSchedulesRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ListBackupSchedulesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupSchedulesRequest build() { + com.google.firestore.admin.v1.ListBackupSchedulesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupSchedulesRequest buildPartial() { + com.google.firestore.admin.v1.ListBackupSchedulesRequest result = + new com.google.firestore.admin.v1.ListBackupSchedulesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.ListBackupSchedulesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + } + + @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.firestore.admin.v1.ListBackupSchedulesRequest) { + return mergeFrom((com.google.firestore.admin.v1.ListBackupSchedulesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ListBackupSchedulesRequest other) { + if (other == com.google.firestore.admin.v1.ListBackupSchedulesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent database.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * 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 parent database.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * 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 parent database.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent database.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent database.
+     *
+     * Format is `projects/{project}/databases/{database}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.firestore.admin.v1.ListBackupSchedulesRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListBackupSchedulesRequest) + private static final com.google.firestore.admin.v1.ListBackupSchedulesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ListBackupSchedulesRequest(); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupSchedulesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.ListBackupSchedulesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesRequestOrBuilder.java new file mode 100644 index 0000000000..c2d083160f --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface ListBackupSchedulesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ListBackupSchedulesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent database.
+   *
+   * Format is `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent database.
+   *
+   * Format is `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesResponse.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesResponse.java new file mode 100644 index 0000000000..ea2ac8418a --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesResponse.java @@ -0,0 +1,950 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The response for
+ * [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListBackupSchedulesResponse} + */ +public final class ListBackupSchedulesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ListBackupSchedulesResponse) + ListBackupSchedulesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBackupSchedulesResponse.newBuilder() to construct. + private ListBackupSchedulesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBackupSchedulesResponse() { + backupSchedules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupSchedulesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListBackupSchedulesResponse.class, + com.google.firestore.admin.v1.ListBackupSchedulesResponse.Builder.class); + } + + public static final int BACKUP_SCHEDULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backupSchedules_; + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public java.util.List getBackupSchedulesList() { + return backupSchedules_; + } + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public java.util.List + getBackupSchedulesOrBuilderList() { + return backupSchedules_; + } + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public int getBackupSchedulesCount() { + return backupSchedules_.size(); + } + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public com.google.firestore.admin.v1.BackupSchedule getBackupSchedules(int index) { + return backupSchedules_.get(index); + } + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + @java.lang.Override + public com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupSchedulesOrBuilder( + int index) { + return backupSchedules_.get(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 { + for (int i = 0; i < backupSchedules_.size(); i++) { + output.writeMessage(1, backupSchedules_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < backupSchedules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backupSchedules_.get(i)); + } + size += getUnknownFields().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.firestore.admin.v1.ListBackupSchedulesResponse)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ListBackupSchedulesResponse other = + (com.google.firestore.admin.v1.ListBackupSchedulesResponse) obj; + + if (!getBackupSchedulesList().equals(other.getBackupSchedulesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBackupSchedulesCount() > 0) { + hash = (37 * hash) + BACKUP_SCHEDULES_FIELD_NUMBER; + hash = (53 * hash) + getBackupSchedulesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse 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.firestore.admin.v1.ListBackupSchedulesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse 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.firestore.admin.v1.ListBackupSchedulesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse 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.firestore.admin.v1.ListBackupSchedulesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse 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.firestore.admin.v1.ListBackupSchedulesResponse 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
+   * [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListBackupSchedulesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ListBackupSchedulesResponse) + com.google.firestore.admin.v1.ListBackupSchedulesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListBackupSchedulesResponse.class, + com.google.firestore.admin.v1.ListBackupSchedulesResponse.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ListBackupSchedulesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupSchedulesBuilder_ == null) { + backupSchedules_ = java.util.Collections.emptyList(); + } else { + backupSchedules_ = null; + backupSchedulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupSchedulesResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupSchedulesResponse getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ListBackupSchedulesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupSchedulesResponse build() { + com.google.firestore.admin.v1.ListBackupSchedulesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupSchedulesResponse buildPartial() { + com.google.firestore.admin.v1.ListBackupSchedulesResponse result = + new com.google.firestore.admin.v1.ListBackupSchedulesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.firestore.admin.v1.ListBackupSchedulesResponse result) { + if (backupSchedulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backupSchedules_ = java.util.Collections.unmodifiableList(backupSchedules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backupSchedules_ = backupSchedules_; + } else { + result.backupSchedules_ = backupSchedulesBuilder_.build(); + } + } + + private void buildPartial0(com.google.firestore.admin.v1.ListBackupSchedulesResponse result) { + int from_bitField0_ = bitField0_; + } + + @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.firestore.admin.v1.ListBackupSchedulesResponse) { + return mergeFrom((com.google.firestore.admin.v1.ListBackupSchedulesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ListBackupSchedulesResponse other) { + if (other == com.google.firestore.admin.v1.ListBackupSchedulesResponse.getDefaultInstance()) + return this; + if (backupSchedulesBuilder_ == null) { + if (!other.backupSchedules_.isEmpty()) { + if (backupSchedules_.isEmpty()) { + backupSchedules_ = other.backupSchedules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupSchedulesIsMutable(); + backupSchedules_.addAll(other.backupSchedules_); + } + onChanged(); + } + } else { + if (!other.backupSchedules_.isEmpty()) { + if (backupSchedulesBuilder_.isEmpty()) { + backupSchedulesBuilder_.dispose(); + backupSchedulesBuilder_ = null; + backupSchedules_ = other.backupSchedules_; + bitField0_ = (bitField0_ & ~0x00000001); + backupSchedulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBackupSchedulesFieldBuilder() + : null; + } else { + backupSchedulesBuilder_.addAllMessages(other.backupSchedules_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.admin.v1.BackupSchedule m = + input.readMessage( + com.google.firestore.admin.v1.BackupSchedule.parser(), extensionRegistry); + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(m); + } else { + backupSchedulesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List backupSchedules_ = + java.util.Collections.emptyList(); + + private void ensureBackupSchedulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backupSchedules_ = + new java.util.ArrayList(backupSchedules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder> + backupSchedulesBuilder_; + + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public java.util.List getBackupSchedulesList() { + if (backupSchedulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(backupSchedules_); + } else { + return backupSchedulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public int getBackupSchedulesCount() { + if (backupSchedulesBuilder_ == null) { + return backupSchedules_.size(); + } else { + return backupSchedulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.firestore.admin.v1.BackupSchedule getBackupSchedules(int index) { + if (backupSchedulesBuilder_ == null) { + return backupSchedules_.get(index); + } else { + return backupSchedulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder setBackupSchedules( + int index, com.google.firestore.admin.v1.BackupSchedule value) { + if (backupSchedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupSchedulesIsMutable(); + backupSchedules_.set(index, value); + onChanged(); + } else { + backupSchedulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder setBackupSchedules( + int index, com.google.firestore.admin.v1.BackupSchedule.Builder builderForValue) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.set(index, builderForValue.build()); + onChanged(); + } else { + backupSchedulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addBackupSchedules(com.google.firestore.admin.v1.BackupSchedule value) { + if (backupSchedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(value); + onChanged(); + } else { + backupSchedulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addBackupSchedules( + int index, com.google.firestore.admin.v1.BackupSchedule value) { + if (backupSchedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(index, value); + onChanged(); + } else { + backupSchedulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addBackupSchedules( + com.google.firestore.admin.v1.BackupSchedule.Builder builderForValue) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(builderForValue.build()); + onChanged(); + } else { + backupSchedulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addBackupSchedules( + int index, com.google.firestore.admin.v1.BackupSchedule.Builder builderForValue) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.add(index, builderForValue.build()); + onChanged(); + } else { + backupSchedulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder addAllBackupSchedules( + java.lang.Iterable values) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backupSchedules_); + onChanged(); + } else { + backupSchedulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder clearBackupSchedules() { + if (backupSchedulesBuilder_ == null) { + backupSchedules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupSchedulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public Builder removeBackupSchedules(int index) { + if (backupSchedulesBuilder_ == null) { + ensureBackupSchedulesIsMutable(); + backupSchedules_.remove(index); + onChanged(); + } else { + backupSchedulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.firestore.admin.v1.BackupSchedule.Builder getBackupSchedulesBuilder( + int index) { + return getBackupSchedulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupSchedulesOrBuilder( + int index) { + if (backupSchedulesBuilder_ == null) { + return backupSchedules_.get(index); + } else { + return backupSchedulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public java.util.List + getBackupSchedulesOrBuilderList() { + if (backupSchedulesBuilder_ != null) { + return backupSchedulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backupSchedules_); + } + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.firestore.admin.v1.BackupSchedule.Builder addBackupSchedulesBuilder() { + return getBackupSchedulesFieldBuilder() + .addBuilder(com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance()); + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public com.google.firestore.admin.v1.BackupSchedule.Builder addBackupSchedulesBuilder( + int index) { + return getBackupSchedulesFieldBuilder() + .addBuilder(index, com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance()); + } + /** + * + * + *
+     * List of all backup schedules.
+     * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + public java.util.List + getBackupSchedulesBuilderList() { + return getBackupSchedulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder> + getBackupSchedulesFieldBuilder() { + if (backupSchedulesBuilder_ == null) { + backupSchedulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder>( + backupSchedules_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + backupSchedules_ = null; + } + return backupSchedulesBuilder_; + } + + @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.firestore.admin.v1.ListBackupSchedulesResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListBackupSchedulesResponse) + private static final com.google.firestore.admin.v1.ListBackupSchedulesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ListBackupSchedulesResponse(); + } + + public static com.google.firestore.admin.v1.ListBackupSchedulesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupSchedulesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.ListBackupSchedulesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesResponseOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesResponseOrBuilder.java new file mode 100644 index 0000000000..eea1e95de0 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupSchedulesResponseOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface ListBackupSchedulesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ListBackupSchedulesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + java.util.List getBackupSchedulesList(); + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + com.google.firestore.admin.v1.BackupSchedule getBackupSchedules(int index); + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + int getBackupSchedulesCount(); + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + java.util.List + getBackupSchedulesOrBuilderList(); + /** + * + * + *
+   * List of all backup schedules.
+   * 
+ * + * repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupSchedulesOrBuilder(int index); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsRequest.java new file mode 100644 index 0000000000..63727c0910 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsRequest.java @@ -0,0 +1,676 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListBackupsRequest} + */ +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.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_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListBackupsRequest.class, + com.google.firestore.admin.v1.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The location to list backups from.
+   *
+   * Format is `projects/{project}/locations/{location}`.
+   * Use `{location} = '-'` to list backups from all locations for the given
+   * project. This allows listing backups from a single location or from all
+   * locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 location to list backups from.
+   *
+   * Format is `projects/{project}/locations/{location}`.
+   * Use `{location} = '-'` to list backups from all locations for the given
+   * project. This allows listing backups from a single location or from all
+   * locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += getUnknownFields().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.firestore.admin.v1.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ListBackupsRequest other = + (com.google.firestore.admin.v1.ListBackupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ListBackupsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListBackupsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.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
+   * [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ListBackupsRequest) + com.google.firestore.admin.v1.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListBackupsRequest.class, + com.google.firestore.admin.v1.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ListBackupsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupsRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupsRequest build() { + com.google.firestore.admin.v1.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupsRequest buildPartial() { + com.google.firestore.admin.v1.ListBackupsRequest result = + new com.google.firestore.admin.v1.ListBackupsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.ListBackupsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + } + + @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.firestore.admin.v1.ListBackupsRequest) { + return mergeFrom((com.google.firestore.admin.v1.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ListBackupsRequest other) { + if (other == com.google.firestore.admin.v1.ListBackupsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The location to list backups from.
+     *
+     * Format is `projects/{project}/locations/{location}`.
+     * Use `{location} = '-'` to list backups from all locations for the given
+     * project. This allows listing backups from a single location or from all
+     * locations.
+     * 
+ * + * + * 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 location to list backups from.
+     *
+     * Format is `projects/{project}/locations/{location}`.
+     * Use `{location} = '-'` to list backups from all locations for the given
+     * project. This allows listing backups from a single location or from all
+     * locations.
+     * 
+ * + * + * 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 location to list backups from.
+     *
+     * Format is `projects/{project}/locations/{location}`.
+     * Use `{location} = '-'` to list backups from all locations for the given
+     * project. This allows listing backups from a single location or from all
+     * locations.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location to list backups from.
+     *
+     * Format is `projects/{project}/locations/{location}`.
+     * Use `{location} = '-'` to list backups from all locations for the given
+     * project. This allows listing backups from a single location or from all
+     * locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The location to list backups from.
+     *
+     * Format is `projects/{project}/locations/{location}`.
+     * Use `{location} = '-'` to list backups from all locations for the given
+     * project. This allows listing backups from a single location or from all
+     * locations.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.firestore.admin.v1.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListBackupsRequest) + private static final com.google.firestore.admin.v1.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ListBackupsRequest(); + } + + public static com.google.firestore.admin.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsRequestOrBuilder.java new file mode 100644 index 0000000000..2945d5c155 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The location to list backups from.
+   *
+   * Format is `projects/{project}/locations/{location}`.
+   * Use `{location} = '-'` to list backups from all locations for the given
+   * project. This allows listing backups from a single location or from all
+   * locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The location to list backups from.
+   *
+   * Format is `projects/{project}/locations/{location}`.
+   * Use `{location} = '-'` to list backups from all locations for the given
+   * project. This allows listing backups from a single location or from all
+   * locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsResponse.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsResponse.java new file mode 100644 index 0000000000..728d020c93 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsResponse.java @@ -0,0 +1,1279 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The response for
+ * [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListBackupsResponse} + */ +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.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(); + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBackupsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListBackupsResponse.class, + com.google.firestore.admin.v1.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backups_; + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + @java.lang.Override + public com.google.firestore.admin.v1.Backup getBackups(int index) { + return backups_.get(index); + } + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + @java.lang.Override + public com.google.firestore.admin.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.get(index); + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * List of locations that existing backups were not able to be fetched from.
+   *
+   * Instead of failing the entire requests when a single location is
+   * unreachable, this response returns a partial result set and list of
+   * locations unable to be reached here. The request can be retried against a
+   * single location to get a concrete error.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * List of locations that existing backups were not able to be fetched from.
+   *
+   * Instead of failing the entire requests when a single location is
+   * unreachable, this response returns a partial result set and list of
+   * locations unable to be reached here. The request can be retried against a
+   * single location to get a concrete error.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * List of locations that existing backups were not able to be fetched from.
+   *
+   * Instead of failing the entire requests when a single location is
+   * unreachable, this response returns a partial result set and list of
+   * locations unable to be reached here. The request can be retried against a
+   * single location to get a concrete error.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * List of locations that existing backups were not able to be fetched from.
+   *
+   * Instead of failing the entire requests when a single location is
+   * unreachable, this response returns a partial result set and list of
+   * locations unable to be reached here. The request can be retried against a
+   * single location to get a concrete error.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 { + for (int i = 0; i < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().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)); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().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.firestore.admin.v1.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ListBackupsResponse other = + (com.google.firestore.admin.v1.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + } + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ListBackupsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListBackupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.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
+   * [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ListBackupsResponse) + com.google.firestore.admin.v1.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListBackupsResponse.class, + com.google.firestore.admin.v1.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ListBackupsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + } else { + backups_ = null; + backupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupsResponse getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupsResponse build() { + com.google.firestore.admin.v1.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListBackupsResponse buildPartial() { + com.google.firestore.admin.v1.ListBackupsResponse result = + new com.google.firestore.admin.v1.ListBackupsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.firestore.admin.v1.ListBackupsResponse result) { + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.build(); + } + } + + private void buildPartial0(com.google.firestore.admin.v1.ListBackupsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @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.firestore.admin.v1.ListBackupsResponse) { + return mergeFrom((com.google.firestore.admin.v1.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ListBackupsResponse other) { + if (other == com.google.firestore.admin.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.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000002; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.admin.v1.Backup m = + input.readMessage( + com.google.firestore.admin.v1.Backup.parser(), extensionRegistry); + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(m); + } else { + backupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.firestore.admin.v1.Backup, + com.google.firestore.admin.v1.Backup.Builder, + com.google.firestore.admin.v1.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public com.google.firestore.admin.v1.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.firestore.admin.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; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.firestore.admin.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.firestore.admin.v1.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.firestore.admin.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; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public Builder addBackups(com.google.firestore.admin.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.firestore.admin.v1.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.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; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public com.google.firestore.admin.v1.Backup.Builder getBackupsBuilder(int index) { + return getBackupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public com.google.firestore.admin.v1.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public com.google.firestore.admin.v1.Backup.Builder addBackupsBuilder() { + return getBackupsFieldBuilder() + .addBuilder(com.google.firestore.admin.v1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public com.google.firestore.admin.v1.Backup.Builder addBackupsBuilder(int index) { + return getBackupsFieldBuilder() + .addBuilder(index, com.google.firestore.admin.v1.Backup.getDefaultInstance()); + } + /** + * + * + *
+     * List of all backups for the project.
+     * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + public java.util.List getBackupsBuilderList() { + return getBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Backup, + com.google.firestore.admin.v1.Backup.Builder, + com.google.firestore.admin.v1.BackupOrBuilder> + getBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Backup, + com.google.firestore.admin.v1.Backup.Builder, + com.google.firestore.admin.v1.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * List of locations that existing backups were not able to be fetched from.
+     *
+     * Instead of failing the entire requests when a single location is
+     * unreachable, this response returns a partial result set and list of
+     * locations unable to be reached here. The request can be retried against a
+     * single location to get a concrete error.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000002; + 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.firestore.admin.v1.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListBackupsResponse) + private static final com.google.firestore.admin.v1.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ListBackupsResponse(); + } + + public static com.google.firestore.admin.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsResponseOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsResponseOrBuilder.java new file mode 100644 index 0000000000..9cbfc18a4f --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListBackupsResponseOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + java.util.List getBackupsList(); + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + com.google.firestore.admin.v1.Backup getBackups(int index); + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + int getBackupsCount(); + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + java.util.List getBackupsOrBuilderList(); + /** + * + * + *
+   * List of all backups for the project.
+   * 
+ * + * repeated .google.firestore.admin.v1.Backup backups = 1; + */ + com.google.firestore.admin.v1.BackupOrBuilder getBackupsOrBuilder(int index); + + /** + * + * + *
+   * List of locations that existing backups were not able to be fetched from.
+   *
+   * Instead of failing the entire requests when a single location is
+   * unreachable, this response returns a partial result set and list of
+   * locations unable to be reached here. The request can be retried against a
+   * single location to get a concrete error.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * List of locations that existing backups were not able to be fetched from.
+   *
+   * Instead of failing the entire requests when a single location is
+   * unreachable, this response returns a partial result set and list of
+   * locations unable to be reached here. The request can be retried against a
+   * single location to get a concrete error.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * List of locations that existing backups were not able to be fetched from.
+   *
+   * Instead of failing the entire requests when a single location is
+   * unreachable, this response returns a partial result set and list of
+   * locations unable to be reached here. The request can be retried against a
+   * single location to get a concrete error.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * List of locations that existing backups were not able to be fetched from.
+   *
+   * Instead of failing the entire requests when a single location is
+   * unreachable, this response returns a partial result set and list of
+   * locations unable to be reached here. The request can be retried against a
+   * single location to get a concrete error.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationName.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationName.java new file mode 100644 index 0000000000..3e4c274919 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2024 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.firestore.admin.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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java index 28676b40c4..fd5e57b65f 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java @@ -56,6 +56,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_firestore_admin_v1_ExportDocumentsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_firestore_admin_v1_ExportDocumentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_firestore_admin_v1_Progress_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -126,18 +130,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "1.Progress\022\026\n\016collection_ids\030\006 \003(\t\022\030\n\020in" + "put_uri_prefix\030\007 \001(\t\022\025\n\rnamespace_ids\030\010 " + "\003(\t\"4\n\027ExportDocumentsResponse\022\031\n\021output" - + "_uri_prefix\030\001 \001(\t\":\n\010Progress\022\026\n\016estimat" - + "ed_work\030\001 \001(\003\022\026\n\016completed_work\030\002 \001(\003*\236\001" - + "\n\016OperationState\022\037\n\033OPERATION_STATE_UNSP" - + "ECIFIED\020\000\022\020\n\014INITIALIZING\020\001\022\016\n\nPROCESSIN" - + "G\020\002\022\016\n\nCANCELLING\020\003\022\016\n\nFINALIZING\020\004\022\016\n\nS" - + "UCCESSFUL\020\005\022\n\n\006FAILED\020\006\022\r\n\tCANCELLED\020\007B\335" - + "\001\n\035com.google.firestore.admin.v1B\016Operat" - + "ionProtoP\001Z9cloud.google.com/go/firestor" - + "e/apiv1/admin/adminpb;adminpb\242\002\004GCFS\252\002\037G" - + "oogle.Cloud.Firestore.Admin.V1\312\002\037Google\\" - + "Cloud\\Firestore\\Admin\\V1\352\002#Google::Cloud" - + "::Firestore::Admin::V1b\006proto3" + + "_uri_prefix\030\001 \001(\t\"\355\002\n\027RestoreDatabaseMet" + + "adata\022.\n\nstart_time\030\001 \001(\0132\032.google.proto" + + "buf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032.google" + + ".protobuf.Timestamp\022B\n\017operation_state\030\003" + + " \001(\0162).google.firestore.admin.v1.Operati" + + "onState\0228\n\010database\030\004 \001(\tB&\372A#\n!firestor" + + "e.googleapis.com/Database\0224\n\006backup\030\005 \001(" + + "\tB$\372A!\n\037firestore.googleapis.com/Backup\022" + + "@\n\023progress_percentage\030\010 \001(\0132#.google.fi" + + "restore.admin.v1.Progress\":\n\010Progress\022\026\n" + + "\016estimated_work\030\001 \001(\003\022\026\n\016completed_work\030" + + "\002 \001(\003*\236\001\n\016OperationState\022\037\n\033OPERATION_ST" + + "ATE_UNSPECIFIED\020\000\022\020\n\014INITIALIZING\020\001\022\016\n\nP" + + "ROCESSING\020\002\022\016\n\nCANCELLING\020\003\022\016\n\nFINALIZIN" + + "G\020\004\022\016\n\nSUCCESSFUL\020\005\022\n\n\006FAILED\020\006\022\r\n\tCANCE" + + "LLED\020\007B\335\001\n\035com.google.firestore.admin.v1" + + "B\016OperationProtoP\001Z9cloud.google.com/go/" + + "firestore/apiv1/admin/adminpb;adminpb\242\002\004" + + "GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002" + + "\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#Googl" + + "e::Cloud::Firestore::Admin::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -229,14 +242,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "OutputUriPrefix", }); - internal_static_google_firestore_admin_v1_Progress_descriptor = + internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_descriptor = getDescriptor().getMessageTypes().get(5); + internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_descriptor, + new java.lang.String[] { + "StartTime", "EndTime", "OperationState", "Database", "Backup", "ProgressPercentage", + }); + internal_static_google_firestore_admin_v1_Progress_descriptor = + getDescriptor().getMessageTypes().get(6); internal_static_google_firestore_admin_v1_Progress_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_Progress_descriptor, new java.lang.String[] { "EstimatedWork", "CompletedWork", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); com.google.api.ResourceProto.getDescriptor(); com.google.firestore.admin.v1.IndexProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseMetadata.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseMetadata.java new file mode 100644 index 0000000000..00716f9602 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseMetadata.java @@ -0,0 +1,1764 @@ +/* + * Copyright 2024 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/firestore/admin/v1/operation.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Metadata for the [long-running operation][google.longrunning.Operation] from
+ * the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.RestoreDatabaseMetadata} + */ +public final class RestoreDatabaseMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.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() { + operationState_ = 0; + database_ = ""; + backup_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreDatabaseMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.RestoreDatabaseMetadata.class, + com.google.firestore.admin.v1.RestoreDatabaseMetadata.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time the restore was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The time the restore was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time the restore was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The time the restore finished, unset for ongoing restores.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The time the restore finished, unset for ongoing restores.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time the restore finished, unset for ongoing restores.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int OPERATION_STATE_FIELD_NUMBER = 3; + private int operationState_ = 0; + /** + * + * + *
+   * The operation state of the restore.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @return The enum numeric value on the wire for operationState. + */ + @java.lang.Override + public int getOperationStateValue() { + return operationState_; + } + /** + * + * + *
+   * The operation state of the restore.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @return The operationState. + */ + @java.lang.Override + public com.google.firestore.admin.v1.OperationState getOperationState() { + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.forNumber(operationState_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + + public static final int DATABASE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + /** + * + * + *
+   * The name of the database being restored to.
+   * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @return The database. + */ + @java.lang.Override + 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 being restored to.
+   * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for database. + */ + @java.lang.Override + 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 BACKUP_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object backup_ = ""; + /** + * + * + *
+   * The name of the backup restoring from.
+   * 
+ * + * string backup = 5 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * The name of the backup restoring from.
+   * 
+ * + * string backup = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + @java.lang.Override + 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 PROGRESS_PERCENTAGE_FIELD_NUMBER = 8; + private com.google.firestore.admin.v1.Progress progressPercentage_; + /** + * + * + *
+   * How far along the restore is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + * + * @return Whether the progressPercentage field is set. + */ + @java.lang.Override + public boolean hasProgressPercentage() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * How far along the restore is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + * + * @return The progressPercentage. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Progress getProgressPercentage() { + return progressPercentage_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressPercentage_; + } + /** + * + * + *
+   * How far along the restore is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + @java.lang.Override + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressPercentageOrBuilder() { + return progressPercentage_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressPercentage_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (operationState_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, operationState_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(database_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, database_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backup_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, backup_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getProgressPercentage()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (operationState_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, operationState_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(database_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, database_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backup_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, backup_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getProgressPercentage()); + } + size += getUnknownFields().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.firestore.admin.v1.RestoreDatabaseMetadata)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.RestoreDatabaseMetadata other = + (com.google.firestore.admin.v1.RestoreDatabaseMetadata) obj; + + 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 (operationState_ != other.operationState_) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (!getBackup().equals(other.getBackup())) return false; + if (hasProgressPercentage() != other.hasProgressPercentage()) return false; + if (hasProgressPercentage()) { + if (!getProgressPercentage().equals(other.getProgressPercentage())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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 = (37 * hash) + OPERATION_STATE_FIELD_NUMBER; + hash = (53 * hash) + operationState_; + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + if (hasProgressPercentage()) { + hash = (37 * hash) + PROGRESS_PERCENTAGE_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercentage().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.RestoreDatabaseMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.RestoreDatabaseMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.RestoreDatabaseMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.RestoreDatabaseMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.RestoreDatabaseMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.RestoreDatabaseMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.RestoreDatabaseMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.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 for the [long-running operation][google.longrunning.Operation] from
+   * the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.RestoreDatabaseMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.RestoreDatabaseMetadata) + com.google.firestore.admin.v1.RestoreDatabaseMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.RestoreDatabaseMetadata.class, + com.google.firestore.admin.v1.RestoreDatabaseMetadata.Builder.class); + } + + // Construct using com.google.firestore.admin.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) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + getProgressPercentageFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + operationState_ = 0; + database_ = ""; + backup_ = ""; + progressPercentage_ = null; + if (progressPercentageBuilder_ != null) { + progressPercentageBuilder_.dispose(); + progressPercentageBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.RestoreDatabaseMetadata getDefaultInstanceForType() { + return com.google.firestore.admin.v1.RestoreDatabaseMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.RestoreDatabaseMetadata build() { + com.google.firestore.admin.v1.RestoreDatabaseMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.RestoreDatabaseMetadata buildPartial() { + com.google.firestore.admin.v1.RestoreDatabaseMetadata result = + new com.google.firestore.admin.v1.RestoreDatabaseMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.RestoreDatabaseMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.operationState_ = operationState_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.backup_ = backup_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.progressPercentage_ = + progressPercentageBuilder_ == null + ? progressPercentage_ + : progressPercentageBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @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.firestore.admin.v1.RestoreDatabaseMetadata) { + return mergeFrom((com.google.firestore.admin.v1.RestoreDatabaseMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.RestoreDatabaseMetadata other) { + if (other == com.google.firestore.admin.v1.RestoreDatabaseMetadata.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.operationState_ != 0) { + setOperationStateValue(other.getOperationStateValue()); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getBackup().isEmpty()) { + backup_ = other.backup_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasProgressPercentage()) { + mergeProgressPercentage(other.getProgressPercentage()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + operationState_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + backup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 66: + { + input.readMessage( + getProgressPercentageFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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_; + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @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(); + } + } + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The time the restore was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + 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_; + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The time the restore finished, unset for ongoing restores.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + 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_; + } + + private int operationState_ = 0; + /** + * + * + *
+     * The operation state of the restore.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @return The enum numeric value on the wire for operationState. + */ + @java.lang.Override + public int getOperationStateValue() { + return operationState_; + } + /** + * + * + *
+     * The operation state of the restore.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @param value The enum numeric value on the wire for operationState to set. + * @return This builder for chaining. + */ + public Builder setOperationStateValue(int value) { + operationState_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation state of the restore.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @return The operationState. + */ + @java.lang.Override + public com.google.firestore.admin.v1.OperationState getOperationState() { + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.forNumber(operationState_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The operation state of the restore.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @param value The operationState to set. + * @return This builder for chaining. + */ + public Builder setOperationState(com.google.firestore.admin.v1.OperationState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + operationState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The operation state of the restore.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @return This builder for chaining. + */ + public Builder clearOperationState() { + bitField0_ = (bitField0_ & ~0x00000004); + operationState_ = 0; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * The name of the database being restored to.
+     * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @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 being restored to.
+     * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @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 being restored to.
+     * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database being restored to.
+     * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the database being restored to.
+     * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object backup_ = ""; + /** + * + * + *
+     * The name of the backup restoring from.
+     * 
+ * + * string backup = 5 [(.google.api.resource_reference) = { ... } + * + * @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; + } + } + /** + * + * + *
+     * The name of the backup restoring from.
+     * 
+ * + * string backup = 5 [(.google.api.resource_reference) = { ... } + * + * @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; + } + } + /** + * + * + *
+     * The name of the backup restoring from.
+     * 
+ * + * string backup = 5 [(.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(); + } + backup_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the backup restoring from.
+     * 
+ * + * string backup = 5 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBackup() { + backup_ = getDefaultInstance().getBackup(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the backup restoring from.
+     * 
+ * + * string backup = 5 [(.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); + backup_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.Progress progressPercentage_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressPercentageBuilder_; + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + * + * @return Whether the progressPercentage field is set. + */ + public boolean hasProgressPercentage() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + * + * @return The progressPercentage. + */ + public com.google.firestore.admin.v1.Progress getProgressPercentage() { + if (progressPercentageBuilder_ == null) { + return progressPercentage_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressPercentage_; + } else { + return progressPercentageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + public Builder setProgressPercentage(com.google.firestore.admin.v1.Progress value) { + if (progressPercentageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressPercentage_ = value; + } else { + progressPercentageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + public Builder setProgressPercentage( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressPercentageBuilder_ == null) { + progressPercentage_ = builderForValue.build(); + } else { + progressPercentageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + public Builder mergeProgressPercentage(com.google.firestore.admin.v1.Progress value) { + if (progressPercentageBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && progressPercentage_ != null + && progressPercentage_ != com.google.firestore.admin.v1.Progress.getDefaultInstance()) { + getProgressPercentageBuilder().mergeFrom(value); + } else { + progressPercentage_ = value; + } + } else { + progressPercentageBuilder_.mergeFrom(value); + } + if (progressPercentage_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + public Builder clearProgressPercentage() { + bitField0_ = (bitField0_ & ~0x00000020); + progressPercentage_ = null; + if (progressPercentageBuilder_ != null) { + progressPercentageBuilder_.dispose(); + progressPercentageBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressPercentageBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getProgressPercentageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressPercentageOrBuilder() { + if (progressPercentageBuilder_ != null) { + return progressPercentageBuilder_.getMessageOrBuilder(); + } else { + return progressPercentage_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressPercentage_; + } + } + /** + * + * + *
+     * How far along the restore is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressPercentageFieldBuilder() { + if (progressPercentageBuilder_ == null) { + progressPercentageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressPercentage(), getParentForChildren(), isClean()); + progressPercentage_ = null; + } + return progressPercentageBuilder_; + } + + @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.firestore.admin.v1.RestoreDatabaseMetadata) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.RestoreDatabaseMetadata) + private static final com.google.firestore.admin.v1.RestoreDatabaseMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.RestoreDatabaseMetadata(); + } + + public static com.google.firestore.admin.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.RestoreDatabaseMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseMetadataOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseMetadataOrBuilder.java new file mode 100644 index 0000000000..10131af081 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseMetadataOrBuilder.java @@ -0,0 +1,206 @@ +/* + * Copyright 2024 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/firestore/admin/v1/operation.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface RestoreDatabaseMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.RestoreDatabaseMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time the restore was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time the restore was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time the restore was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time the restore finished, unset for ongoing restores.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time the restore finished, unset for ongoing restores.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time the restore finished, unset for ongoing restores.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The operation state of the restore.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @return The enum numeric value on the wire for operationState. + */ + int getOperationStateValue(); + /** + * + * + *
+   * The operation state of the restore.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @return The operationState. + */ + com.google.firestore.admin.v1.OperationState getOperationState(); + + /** + * + * + *
+   * The name of the database being restored to.
+   * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @return The database. + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * The name of the database being restored to.
+   * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * The name of the backup restoring from.
+   * 
+ * + * string backup = 5 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + java.lang.String getBackup(); + /** + * + * + *
+   * The name of the backup restoring from.
+   * 
+ * + * string backup = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + com.google.protobuf.ByteString getBackupBytes(); + + /** + * + * + *
+   * How far along the restore is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + * + * @return Whether the progressPercentage field is set. + */ + boolean hasProgressPercentage(); + /** + * + * + *
+   * How far along the restore is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + * + * @return The progressPercentage. + */ + com.google.firestore.admin.v1.Progress getProgressPercentage(); + /** + * + * + *
+   * How far along the restore is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressPercentageOrBuilder(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseRequest.java new file mode 100644 index 0000000000..1f88b08d70 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseRequest.java @@ -0,0 +1,1103 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request message for
+ * [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.RestoreDatabaseRequest} + */ +public final class RestoreDatabaseRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.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_ = ""; + backup_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestoreDatabaseRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.RestoreDatabaseRequest.class, + com.google.firestore.admin.v1.RestoreDatabaseRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The project to restore the database in. Format is
+   * `projects/{project_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + 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 project to restore the database in. Format is
+   * `projects/{project_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object databaseId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the database, which will become the final
+   * component of the database's resource name. This database id must not be
+   * associated with an existing database.
+   *
+   * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+   * with first character a letter and the last a letter or a number. Must not
+   * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+   *
+   * "(default)" database id is also valid.
+   * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The databaseId. + */ + @java.lang.Override + 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 to use for the database, which will become the final
+   * component of the database's resource name. This database id must not be
+   * associated with an existing database.
+   *
+   * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+   * with first character a letter and the last a letter or a number. Must not
+   * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+   *
+   * "(default)" database id is also valid.
+   * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for databaseId. + */ + @java.lang.Override + 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object backup_ = ""; + /** + * + * + *
+   * Required. Backup to restore from. Must be from the same project as the
+   * parent.
+   *
+   * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+   * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backup. + */ + @java.lang.Override + 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; + } + } + /** + * + * + *
+   * Required. Backup to restore from. Must be from the same project as the
+   * parent.
+   *
+   * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+   * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backup. + */ + @java.lang.Override + 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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, databaseId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backup_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, backup_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, databaseId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backup_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, backup_); + } + size += getUnknownFields().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.firestore.admin.v1.RestoreDatabaseRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.RestoreDatabaseRequest other = + (com.google.firestore.admin.v1.RestoreDatabaseRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getDatabaseId().equals(other.getDatabaseId())) return false; + if (!getBackup().equals(other.getBackup())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.RestoreDatabaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.RestoreDatabaseRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.RestoreDatabaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.v1.RestoreDatabaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.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.firestore.admin.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 message for
+   * [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.RestoreDatabaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.RestoreDatabaseRequest) + com.google.firestore.admin.v1.RestoreDatabaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.RestoreDatabaseRequest.class, + com.google.firestore.admin.v1.RestoreDatabaseRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.RestoreDatabaseRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + databaseId_ = ""; + backup_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.RestoreDatabaseRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.RestoreDatabaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.RestoreDatabaseRequest build() { + com.google.firestore.admin.v1.RestoreDatabaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.RestoreDatabaseRequest buildPartial() { + com.google.firestore.admin.v1.RestoreDatabaseRequest result = + new com.google.firestore.admin.v1.RestoreDatabaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.RestoreDatabaseRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.databaseId_ = databaseId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backup_ = backup_; + } + } + + @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.firestore.admin.v1.RestoreDatabaseRequest) { + return mergeFrom((com.google.firestore.admin.v1.RestoreDatabaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.RestoreDatabaseRequest other) { + if (other == com.google.firestore.admin.v1.RestoreDatabaseRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDatabaseId().isEmpty()) { + databaseId_ = other.databaseId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getBackup().isEmpty()) { + backup_ = other.backup_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + databaseId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + backup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project to restore the database in. Format is
+     * `projects/{project_id}`.
+     * 
+ * + * + * 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 project to restore the database in. Format is
+     * `projects/{project_id}`.
+     * 
+ * + * + * 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 project to restore the database in. Format is
+     * `projects/{project_id}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project to restore the database in. Format is
+     * `projects/{project_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project to restore the database in. Format is
+     * `projects/{project_id}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object databaseId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the database, which will become the final
+     * component of the database's resource name. This database id must not be
+     * associated with an existing database.
+     *
+     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+     * with first character a letter and the last a letter or a number. Must not
+     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+     *
+     * "(default)" database id is also valid.
+     * 
+ * + * 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 to use for the database, which will become the final
+     * component of the database's resource name. This database id must not be
+     * associated with an existing database.
+     *
+     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+     * with first character a letter and the last a letter or a number. Must not
+     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+     *
+     * "(default)" database id is also valid.
+     * 
+ * + * 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 to use for the database, which will become the final
+     * component of the database's resource name. This database id must not be
+     * associated with an existing database.
+     *
+     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+     * with first character a letter and the last a letter or a number. Must not
+     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+     *
+     * "(default)" database id is also valid.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the database, which will become the final
+     * component of the database's resource name. This database id must not be
+     * associated with an existing database.
+     *
+     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+     * with first character a letter and the last a letter or a number. Must not
+     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+     *
+     * "(default)" database id is also valid.
+     * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseId() { + databaseId_ = getDefaultInstance().getDatabaseId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the database, which will become the final
+     * component of the database's resource name. This database id must not be
+     * associated with an existing database.
+     *
+     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+     * with first character a letter and the last a letter or a number. Must not
+     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+     *
+     * "(default)" database id is also valid.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object backup_ = ""; + /** + * + * + *
+     * Required. Backup to restore from. Must be from the same project as the
+     * parent.
+     *
+     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+     * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Required. Backup to restore from. Must be from the same project as the
+     * parent.
+     *
+     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+     * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Required. Backup to restore from. Must be from the same project as the
+     * parent.
+     *
+     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+     * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.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(); + } + backup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Backup to restore from. Must be from the same project as the
+     * parent.
+     *
+     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+     * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBackup() { + backup_ = getDefaultInstance().getBackup(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Backup to restore from. Must be from the same project as the
+     * parent.
+     *
+     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+     * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.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); + backup_ = value; + bitField0_ |= 0x00000004; + 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.firestore.admin.v1.RestoreDatabaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.RestoreDatabaseRequest) + private static final com.google.firestore.admin.v1.RestoreDatabaseRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.RestoreDatabaseRequest(); + } + + public static com.google.firestore.admin.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.RestoreDatabaseRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseRequestOrBuilder.java new file mode 100644 index 0000000000..33d7b01106 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/RestoreDatabaseRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface RestoreDatabaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.RestoreDatabaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project to restore the database in. Format is
+   * `projects/{project_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project to restore the database in. Format is
+   * `projects/{project_id}`.
+   * 
+ * + * + * 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 to use for the database, which will become the final
+   * component of the database's resource name. This database id must not be
+   * associated with an existing database.
+   *
+   * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+   * with first character a letter and the last a letter or a number. Must not
+   * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+   *
+   * "(default)" database id is also valid.
+   * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The databaseId. + */ + java.lang.String getDatabaseId(); + /** + * + * + *
+   * Required. The ID to use for the database, which will become the final
+   * component of the database's resource name. This database id must not be
+   * associated with an existing database.
+   *
+   * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+   * with first character a letter and the last a letter or a number. Must not
+   * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
+   *
+   * "(default)" database id is also valid.
+   * 
+ * + * string database_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for databaseId. + */ + com.google.protobuf.ByteString getDatabaseIdBytes(); + + /** + * + * + *
+   * Required. Backup to restore from. Must be from the same project as the
+   * parent.
+   *
+   * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+   * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The backup. + */ + java.lang.String getBackup(); + /** + * + * + *
+   * Required. Backup to restore from. Must be from the same project as the
+   * parent.
+   *
+   * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
+   * 
+ * + * + * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for backup. + */ + com.google.protobuf.ByteString getBackupBytes(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ScheduleProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ScheduleProto.java new file mode 100644 index 0000000000..ddec765b9d --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ScheduleProto.java @@ -0,0 +1,131 @@ +/* + * Copyright 2024 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/firestore/admin/v1/schedule.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public final class ScheduleProto { + private ScheduleProto() {} + + 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_firestore_admin_v1_BackupSchedule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_BackupSchedule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_DailyRecurrence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_DailyRecurrence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_WeeklyRecurrence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_WeeklyRecurrence_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/firestore/admin/v1/schedule.pro" + + "to\022\031google.firestore.admin.v1\032\037google/ap" + + "i/field_behavior.proto\032\031google/api/resou" + + "rce.proto\032\036google/protobuf/duration.prot" + + "o\032\037google/protobuf/timestamp.proto\032\033goog" + + "le/type/dayofweek.proto\"\326\003\n\016BackupSchedu" + + "le\022\021\n\004name\030\001 \001(\tB\003\340A\003\0224\n\013create_time\030\003 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013u" + + "pdate_time\030\n \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\022,\n\tretention\030\006 \001(\0132\031.google.pr" + + "otobuf.Duration\022F\n\020daily_recurrence\030\007 \001(" + + "\0132*.google.firestore.admin.v1.DailyRecur" + + "renceH\000\022H\n\021weekly_recurrence\030\010 \001(\0132+.goo" + + "gle.firestore.admin.v1.WeeklyRecurrenceH" + + "\000:w\352At\n\'firestore.googleapis.com/BackupS" + + "chedule\022Iprojects/{project}/databases/{d" + + "atabase}/backupSchedules/{backup_schedul" + + "e}B\014\n\nrecurrence\"\021\n\017DailyRecurrence\"7\n\020W" + + "eeklyRecurrence\022#\n\003day\030\002 \001(\0162\026.google.ty" + + "pe.DayOfWeekB\334\001\n\035com.google.firestore.ad" + + "min.v1B\rScheduleProtoP\001Z9cloud.google.co" + + "m/go/firestore/apiv1/admin/adminpb;admin" + + "pb\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin" + + ".V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#" + + "Google::Cloud::Firestore::Admin::V1b\006pro" + + "to3" + }; + 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.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.DayOfWeekProto.getDescriptor(), + }); + internal_static_google_firestore_admin_v1_BackupSchedule_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_admin_v1_BackupSchedule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_BackupSchedule_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "Retention", + "DailyRecurrence", + "WeeklyRecurrence", + "Recurrence", + }); + internal_static_google_firestore_admin_v1_DailyRecurrence_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_firestore_admin_v1_DailyRecurrence_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_DailyRecurrence_descriptor, + new java.lang.String[] {}); + internal_static_google_firestore_admin_v1_WeeklyRecurrence_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_firestore_admin_v1_WeeklyRecurrence_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_WeeklyRecurrence_descriptor, + new java.lang.String[] { + "Day", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.DayOfWeekProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateBackupScheduleRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateBackupScheduleRequest.java new file mode 100644 index 0000000000..e0ef6097aa --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateBackupScheduleRequest.java @@ -0,0 +1,1015 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.UpdateBackupScheduleRequest} + */ +public final class UpdateBackupScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.UpdateBackupScheduleRequest) + UpdateBackupScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBackupScheduleRequest.newBuilder() to construct. + private UpdateBackupScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBackupScheduleRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBackupScheduleRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.UpdateBackupScheduleRequest.class, + com.google.firestore.admin.v1.UpdateBackupScheduleRequest.Builder.class); + } + + private int bitField0_; + public static final int BACKUP_SCHEDULE_FIELD_NUMBER = 1; + private com.google.firestore.admin.v1.BackupSchedule backupSchedule_; + /** + * + * + *
+   * Required. The backup schedule to update.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + @java.lang.Override + public boolean hasBackupSchedule() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The backup schedule to update.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + @java.lang.Override + public com.google.firestore.admin.v1.BackupSchedule getBackupSchedule() { + return backupSchedule_ == null + ? com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + /** + * + * + *
+   * Required. The backup schedule to update.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder() { + return backupSchedule_ == null + ? com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBackupSchedule()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackupSchedule()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.firestore.admin.v1.UpdateBackupScheduleRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.UpdateBackupScheduleRequest other = + (com.google.firestore.admin.v1.UpdateBackupScheduleRequest) obj; + + if (hasBackupSchedule() != other.hasBackupSchedule()) return false; + if (hasBackupSchedule()) { + if (!getBackupSchedule().equals(other.getBackupSchedule())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackupSchedule()) { + hash = (37 * hash) + BACKUP_SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getBackupSchedule().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest 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.firestore.admin.v1.UpdateBackupScheduleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest 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.firestore.admin.v1.UpdateBackupScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest 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.firestore.admin.v1.UpdateBackupScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest 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.firestore.admin.v1.UpdateBackupScheduleRequest 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
+   * [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.UpdateBackupScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.UpdateBackupScheduleRequest) + com.google.firestore.admin.v1.UpdateBackupScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.UpdateBackupScheduleRequest.class, + com.google.firestore.admin.v1.UpdateBackupScheduleRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.UpdateBackupScheduleRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupScheduleFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backupSchedule_ = null; + if (backupScheduleBuilder_ != null) { + backupScheduleBuilder_.dispose(); + backupScheduleBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateBackupScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.UpdateBackupScheduleRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.UpdateBackupScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.UpdateBackupScheduleRequest build() { + com.google.firestore.admin.v1.UpdateBackupScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.UpdateBackupScheduleRequest buildPartial() { + com.google.firestore.admin.v1.UpdateBackupScheduleRequest result = + new com.google.firestore.admin.v1.UpdateBackupScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.UpdateBackupScheduleRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backupSchedule_ = + backupScheduleBuilder_ == null ? backupSchedule_ : backupScheduleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.firestore.admin.v1.UpdateBackupScheduleRequest) { + return mergeFrom((com.google.firestore.admin.v1.UpdateBackupScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.UpdateBackupScheduleRequest other) { + if (other == com.google.firestore.admin.v1.UpdateBackupScheduleRequest.getDefaultInstance()) + return this; + if (other.hasBackupSchedule()) { + mergeBackupSchedule(other.getBackupSchedule()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getBackupScheduleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.firestore.admin.v1.BackupSchedule backupSchedule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder> + backupScheduleBuilder_; + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + public boolean hasBackupSchedule() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + public com.google.firestore.admin.v1.BackupSchedule getBackupSchedule() { + if (backupScheduleBuilder_ == null) { + return backupSchedule_ == null + ? com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } else { + return backupScheduleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackupSchedule(com.google.firestore.admin.v1.BackupSchedule value) { + if (backupScheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backupSchedule_ = value; + } else { + backupScheduleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackupSchedule( + com.google.firestore.admin.v1.BackupSchedule.Builder builderForValue) { + if (backupScheduleBuilder_ == null) { + backupSchedule_ = builderForValue.build(); + } else { + backupScheduleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackupSchedule(com.google.firestore.admin.v1.BackupSchedule value) { + if (backupScheduleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backupSchedule_ != null + && backupSchedule_ + != com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance()) { + getBackupScheduleBuilder().mergeFrom(value); + } else { + backupSchedule_ = value; + } + } else { + backupScheduleBuilder_.mergeFrom(value); + } + if (backupSchedule_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackupSchedule() { + bitField0_ = (bitField0_ & ~0x00000001); + backupSchedule_ = null; + if (backupScheduleBuilder_ != null) { + backupScheduleBuilder_.dispose(); + backupScheduleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.firestore.admin.v1.BackupSchedule.Builder getBackupScheduleBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getBackupScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder() { + if (backupScheduleBuilder_ != null) { + return backupScheduleBuilder_.getMessageOrBuilder(); + } else { + return backupSchedule_ == null + ? com.google.firestore.admin.v1.BackupSchedule.getDefaultInstance() + : backupSchedule_; + } + } + /** + * + * + *
+     * Required. The backup schedule to update.
+     * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder> + getBackupScheduleFieldBuilder() { + if (backupScheduleBuilder_ == null) { + backupScheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.BackupSchedule, + com.google.firestore.admin.v1.BackupSchedule.Builder, + com.google.firestore.admin.v1.BackupScheduleOrBuilder>( + getBackupSchedule(), getParentForChildren(), isClean()); + backupSchedule_ = null; + } + return backupScheduleBuilder_; + } + + 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_; + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.firestore.admin.v1.UpdateBackupScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.UpdateBackupScheduleRequest) + private static final com.google.firestore.admin.v1.UpdateBackupScheduleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.UpdateBackupScheduleRequest(); + } + + public static com.google.firestore.admin.v1.UpdateBackupScheduleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupScheduleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.UpdateBackupScheduleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateBackupScheduleRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateBackupScheduleRequestOrBuilder.java new file mode 100644 index 0000000000..07e4d0cb7c --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateBackupScheduleRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2024 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/firestore/admin/v1/firestore_admin.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface UpdateBackupScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.UpdateBackupScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup schedule to update.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backupSchedule field is set. + */ + boolean hasBackupSchedule(); + /** + * + * + *
+   * Required. The backup schedule to update.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backupSchedule. + */ + com.google.firestore.admin.v1.BackupSchedule getBackupSchedule(); + /** + * + * + *
+   * Required. The backup schedule to update.
+   * 
+ * + * + * .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.firestore.admin.v1.BackupScheduleOrBuilder getBackupScheduleOrBuilder(); + + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/WeeklyRecurrence.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/WeeklyRecurrence.java new file mode 100644 index 0000000000..58dcabbafd --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/WeeklyRecurrence.java @@ -0,0 +1,606 @@ +/* + * Copyright 2024 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/firestore/admin/v1/schedule.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Represents a recurring schedule that runs on a specified day of the week.
+ *
+ * The time zone is UTC.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.WeeklyRecurrence} + */ +public final class WeeklyRecurrence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.WeeklyRecurrence) + WeeklyRecurrenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use WeeklyRecurrence.newBuilder() to construct. + private WeeklyRecurrence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WeeklyRecurrence() { + day_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WeeklyRecurrence(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_WeeklyRecurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_WeeklyRecurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.WeeklyRecurrence.class, + com.google.firestore.admin.v1.WeeklyRecurrence.Builder.class); + } + + public static final int DAY_FIELD_NUMBER = 2; + private int day_ = 0; + /** + * + * + *
+   * The day of week to run.
+   *
+   * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+   * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @return The enum numeric value on the wire for day. + */ + @java.lang.Override + public int getDayValue() { + return day_; + } + /** + * + * + *
+   * The day of week to run.
+   *
+   * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+   * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @return The day. + */ + @java.lang.Override + public com.google.type.DayOfWeek getDay() { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(day_); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + + 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 (day_ != com.google.type.DayOfWeek.DAY_OF_WEEK_UNSPECIFIED.getNumber()) { + output.writeEnum(2, day_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (day_ != com.google.type.DayOfWeek.DAY_OF_WEEK_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, day_); + } + size += getUnknownFields().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.firestore.admin.v1.WeeklyRecurrence)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.WeeklyRecurrence other = + (com.google.firestore.admin.v1.WeeklyRecurrence) obj; + + if (day_ != other.day_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DAY_FIELD_NUMBER; + hash = (53 * hash) + day_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence 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.firestore.admin.v1.WeeklyRecurrence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence 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.firestore.admin.v1.WeeklyRecurrence parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence 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.firestore.admin.v1.WeeklyRecurrence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence 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.firestore.admin.v1.WeeklyRecurrence 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; + } + /** + * + * + *
+   * Represents a recurring schedule that runs on a specified day of the week.
+   *
+   * The time zone is UTC.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.WeeklyRecurrence} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.WeeklyRecurrence) + com.google.firestore.admin.v1.WeeklyRecurrenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_WeeklyRecurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_WeeklyRecurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.WeeklyRecurrence.class, + com.google.firestore.admin.v1.WeeklyRecurrence.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.WeeklyRecurrence.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + day_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.ScheduleProto + .internal_static_google_firestore_admin_v1_WeeklyRecurrence_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.WeeklyRecurrence getDefaultInstanceForType() { + return com.google.firestore.admin.v1.WeeklyRecurrence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.WeeklyRecurrence build() { + com.google.firestore.admin.v1.WeeklyRecurrence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.WeeklyRecurrence buildPartial() { + com.google.firestore.admin.v1.WeeklyRecurrence result = + new com.google.firestore.admin.v1.WeeklyRecurrence(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.WeeklyRecurrence result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.day_ = day_; + } + } + + @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.firestore.admin.v1.WeeklyRecurrence) { + return mergeFrom((com.google.firestore.admin.v1.WeeklyRecurrence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.WeeklyRecurrence other) { + if (other == com.google.firestore.admin.v1.WeeklyRecurrence.getDefaultInstance()) return this; + if (other.day_ != 0) { + setDayValue(other.getDayValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 16: + { + day_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int day_ = 0; + /** + * + * + *
+     * The day of week to run.
+     *
+     * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+     * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @return The enum numeric value on the wire for day. + */ + @java.lang.Override + public int getDayValue() { + return day_; + } + /** + * + * + *
+     * The day of week to run.
+     *
+     * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+     * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @param value The enum numeric value on the wire for day to set. + * @return This builder for chaining. + */ + public Builder setDayValue(int value) { + day_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The day of week to run.
+     *
+     * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+     * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @return The day. + */ + @java.lang.Override + public com.google.type.DayOfWeek getDay() { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(day_); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The day of week to run.
+     *
+     * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+     * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @param value The day to set. + * @return This builder for chaining. + */ + public Builder setDay(com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + day_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The day of week to run.
+     *
+     * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+     * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @return This builder for chaining. + */ + public Builder clearDay() { + bitField0_ = (bitField0_ & ~0x00000001); + day_ = 0; + 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.firestore.admin.v1.WeeklyRecurrence) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.WeeklyRecurrence) + private static final com.google.firestore.admin.v1.WeeklyRecurrence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.WeeklyRecurrence(); + } + + public static com.google.firestore.admin.v1.WeeklyRecurrence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WeeklyRecurrence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.admin.v1.WeeklyRecurrence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/WeeklyRecurrenceOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/WeeklyRecurrenceOrBuilder.java new file mode 100644 index 0000000000..668210ab66 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/WeeklyRecurrenceOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 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/firestore/admin/v1/schedule.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.admin.v1; + +public interface WeeklyRecurrenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.WeeklyRecurrence) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The day of week to run.
+   *
+   * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+   * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @return The enum numeric value on the wire for day. + */ + int getDayValue(); + /** + * + * + *
+   * The day of week to run.
+   *
+   * DAY_OF_WEEK_UNSPECIFIED is not allowed.
+   * 
+ * + * .google.type.DayOfWeek day = 2; + * + * @return The day. + */ + com.google.type.DayOfWeek getDay(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/backup.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/backup.proto new file mode 100644 index 0000000000..e01f81ff89 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/backup.proto @@ -0,0 +1,107 @@ +// Copyright 2023 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.firestore.admin.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; +option ruby_package = "Google::Cloud::Firestore::Admin::V1"; + +// A Backup of a Cloud Firestore Database. +// +// The backup contains all documents and index configurations for the given +// database at a specific point in time. +message Backup { + option (google.api.resource) = { + type: "firestore.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + }; + + // Backup specific statistics. + message Stats { + // Output only. Summation of the size of all documents and index entries in + // the backup, measured in bytes. + int64 size_bytes = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of documents contained in the backup. + int64 document_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of index entries contained in the backup. + int64 index_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Indicate the current state of the backup. + enum State { + // The state is unspecified. + STATE_UNSPECIFIED = 0; + + // The pending backup is still being created. Operations on the + // backup will be rejected in this state. + CREATING = 1; + + // The backup is complete and ready to use. + READY = 2; + + // The backup is not available at this moment. + NOT_AVAILABLE = 3; + } + + // Output only. The unique resource name of the Backup. + // + // Format is `projects/{project}/locations/{location}/backups/{backup}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the Firestore database that the backup is from. + // + // Format is `projects/{project}/databases/{database}`. + string database = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + } + ]; + + // Output only. The system-generated UUID4 for the Firestore database that the + // backup is from. + string database_uid = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The backup contains an externally consistent copy of the + // database at this time. + google.protobuf.Timestamp snapshot_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp at which this backup expires. + google.protobuf.Timestamp expire_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics about the backup. + // + // This data only becomes available after the backup is fully materialized to + // secondary storage. This field will be empty till then. + Stats stats = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the backup. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto index 07cc764b5f..bf6c8c451b 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto @@ -20,10 +20,12 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/firestore/admin/v1/backup.proto"; import "google/firestore/admin/v1/database.proto"; import "google/firestore/admin/v1/field.proto"; import "google/firestore/admin/v1/index.proto"; import "google/firestore/admin/v1/operation.proto"; +import "google/firestore/admin/v1/schedule.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; @@ -271,6 +273,108 @@ service FirestoreAdmin { metadata_type: "DeleteDatabaseMetadata" }; } + + // Gets information about a backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all the backups. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new database by restoring from an existing backup. + // + // The new database must be in the same cloud region or multi-region location + // as the existing backup. This behaves similar to + // [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] + // except instead of creating a new empty database, a new database is created + // with the database type, index configuration, and documents from an existing + // backup. + // + // The [long-running operation][google.longrunning.Operation] can be used to + // track the progress of the restore, with the Operation's + // [metadata][google.longrunning.Operation.metadata] field type being the + // [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] type is the + // [Database][google.firestore.admin.v1.Database] if the restore was + // successful. The new database is not readable or writeable until the LRO has + // completed. + rpc RestoreDatabase(RestoreDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/databases:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Database" + metadata_type: "RestoreDatabaseMetadata" + }; + } + + // Creates a backup schedule on a database. + // At most two backup schedules can be configured on a database, one daily + // backup schedule with retention up to 7 days and one weekly backup schedule + // with retention up to 14 weeks. + rpc CreateBackupSchedule(CreateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/databases/*}/backupSchedules" + body: "backup_schedule" + }; + option (google.api.method_signature) = "parent,backup_schedule"; + } + + // Gets information about a backup schedule. + rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) { + option (google.api.http) = { + get: "/v1/{name=projects/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List backup schedules. + rpc ListBackupSchedules(ListBackupSchedulesRequest) + returns (ListBackupSchedulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/databases/*}/backupSchedules" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a backup schedule. + rpc UpdateBackupSchedule(UpdateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + patch: "/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}" + body: "backup_schedule" + }; + option (google.api.method_signature) = "backup_schedule,update_mask"; + } + + // Deletes a backup schedule. + rpc DeleteBackupSchedule(DeleteBackupScheduleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } } // A request to list the Firestore Databases in all locations for a project. @@ -378,6 +482,83 @@ message DeleteDatabaseRequest { // Metadata related to the delete database operation. message DeleteDatabaseMetadata {} +// The request for +// [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule]. +message CreateBackupScheduleRequest { + // Required. The parent database. + // + // Format `projects/{project}/databases/{database}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + } + ]; + + // Required. The backup schedule to create. + BackupSchedule backup_schedule = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule]. +message GetBackupScheduleRequest { + // Required. The name of the backup schedule. + // + // Format + // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/BackupSchedule" + } + ]; +} + +// The request for +// [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule]. +message UpdateBackupScheduleRequest { + // Required. The backup schedule to update. + BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for +// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]. +message ListBackupSchedulesRequest { + // Required. The parent database. + // + // Format is `projects/{project}/databases/{database}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + } + ]; +} + +// The response for +// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]. +message ListBackupSchedulesResponse { + // List of all backup schedules. + repeated BackupSchedule backup_schedules = 1; +} + +// The request for [FirestoreAdmin.DeleteBackupSchedules][]. +message DeleteBackupScheduleRequest { + // Required. The name of backup schedule. + // + // Format + // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/BackupSchedule" + } + ]; +} + // The request for // [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. message CreateIndexRequest { @@ -587,3 +768,98 @@ message ImportDocumentsRequest { // to include them. Each namespace in this list must be unique. repeated string namespace_ids = 4; } + +// The request for +// [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup]. +message GetBackupRequest { + // Required. Name of the backup to fetch. + // + // Format is `projects/{project}/locations/{location}/backups/{backup}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Backup" + } + ]; +} + +// The request for +// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups]. +message ListBackupsRequest { + // Required. The location to list backups from. + // + // Format is `projects/{project}/locations/{location}`. + // Use `{location} = '-'` to list backups from all locations for the given + // project. This allows listing backups from a single location or from all + // locations. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Location" + } + ]; +} + +// The response for +// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups]. +message ListBackupsResponse { + // List of all backups for the project. + repeated Backup backups = 1; + + // List of locations that existing backups were not able to be fetched from. + // + // Instead of failing the entire requests when a single location is + // unreachable, this response returns a partial result set and list of + // locations unable to be reached here. The request can be retried against a + // single location to get a concrete error. + repeated string unreachable = 3; +} + +// The request for +// [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup]. +message DeleteBackupRequest { + // Required. Name of the backup to delete. + // + // format is `projects/{project}/locations/{location}/backups/{backup}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Backup" + } + ]; +} + +// The request message for +// [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase]. +message RestoreDatabaseRequest { + // Required. The project to restore the database in. Format is + // `projects/{project_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "firestore.googleapis.com/Database" + } + ]; + + // Required. The ID to use for the database, which will become the final + // component of the database's resource name. This database id must not be + // associated with an existing database. + // + // This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + // with first character a letter and the last a letter or a number. Must not + // be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + // + // "(default)" database id is also valid. + string database_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Backup to restore from. Must be from the same project as the + // parent. + // + // Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + string backup = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Backup" + } + ]; +} \ No newline at end of file diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto index 31f63af37b..d3d3e43e46 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto @@ -200,6 +200,43 @@ message ExportDocumentsResponse { string output_uri_prefix = 1; } +// Metadata for the [long-running operation][google.longrunning.Operation] from +// the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request. +message RestoreDatabaseMetadata { + // The time the restore was started. + google.protobuf.Timestamp start_time = 1; + + // The time the restore finished, unset for ongoing restores. + google.protobuf.Timestamp end_time = 2; + + // The operation state of the restore. + OperationState operation_state = 3; + + // The name of the database being restored to. + string database = 4 [(google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + }]; + + // The name of the backup restoring from. + string backup = 5 [(google.api.resource_reference) = { + type: "firestore.googleapis.com/Backup" + }]; + + // How far along the restore is as an estimated percentage of remaining time. + Progress progress_percentage = 8; +} + +// Describes the progress of the operation. +// Unit of work is generic and must be interpreted based on where +// [Progress][google.firestore.admin.v1.Progress] is used. +message Progress { + // The amount of work estimated. + int64 estimated_work = 1; + + // The amount of work completed. + int64 completed_work = 2; +} + // Describes the state of the operation. enum OperationState { // Unspecified. @@ -228,14 +265,3 @@ enum OperationState { // google.longrunning.Operations.CancelOperation. CANCELLED = 7; } - -// Describes the progress of the operation. -// Unit of work is generic and must be interpreted based on where -// [Progress][google.firestore.admin.v1.Progress] is used. -message Progress { - // The amount of work estimated. - int64 estimated_work = 1; - - // The amount of work completed. - int64 completed_work = 2; -} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/schedule.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/schedule.proto new file mode 100644 index 0000000000..b97566e995 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/schedule.proto @@ -0,0 +1,93 @@ +// Copyright 2023 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.firestore.admin.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/dayofweek.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "ScheduleProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; +option ruby_package = "Google::Cloud::Firestore::Admin::V1"; + +// A backup schedule for a Cloud Firestore Database. +// +// This resource is owned by the database it is backing up, and is deleted along +// with the database. The actual backups are not though. +message BackupSchedule { + option (google.api.resource) = { + type: "firestore.googleapis.com/BackupSchedule" + pattern: "projects/{project}/databases/{database}/backupSchedules/{backup_schedule}" + }; + + // Output only. The unique backup schedule identifier across all locations and + // databases for the given project. + // + // This will be auto-assigned. + // + // Format is + // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp at which this backup schedule was created and + // effective since. + // + // No backups will be created for this schedule before this time. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp at which this backup schedule was most recently + // updated. When a backup schedule is first created, this is the same as + // create_time. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // At what relative time in the future, compared to its creation time, + // the backup should be deleted, e.g. keep backups for 7 days. + google.protobuf.Duration retention = 6; + + // A oneof field to represent when backups will be taken. + oneof recurrence { + // For a schedule that runs daily at a specified time. + DailyRecurrence daily_recurrence = 7; + + // For a schedule that runs weekly on a specific day and time. + WeeklyRecurrence weekly_recurrence = 8; + } +} + +// Represent a recurring schedule that runs at a specific time every day. +// +// The time zone is UTC. +message DailyRecurrence {} + +// Represents a recurring schedule that runs on a specified day of the week. +// +// The time zone is UTC. +message WeeklyRecurrence { + // The day of week to run. + // + // DAY_OF_WEEK_UNSPECIFIED is not allowed. + google.type.DayOfWeek day = 2; +} diff --git a/proto-google-cloud-firestore-bundle-v1/pom.xml b/proto-google-cloud-firestore-bundle-v1/pom.xml index a493f54eae..3ecb394243 100644 --- a/proto-google-cloud-firestore-bundle-v1/pom.xml +++ b/proto-google-cloud-firestore-bundle-v1/pom.xml @@ -5,14 +5,14 @@ 4.0.0 proto-google-cloud-firestore-bundle-v1 - 3.18.0 + 3.19.0 proto-google-cloud-firestore-bundle-v1 PROTO library for proto-google-cloud-firestore-bundle-v1 com.google.cloud google-cloud-firestore-parent - 3.18.0 + 3.19.0 diff --git a/proto-google-cloud-firestore-v1/clirr-ignored-differences.xml b/proto-google-cloud-firestore-v1/clirr-ignored-differences.xml index c161a07f07..c060e41ba9 100644 --- a/proto-google-cloud-firestore-v1/clirr-ignored-differences.xml +++ b/proto-google-cloud-firestore-v1/clirr-ignored-differences.xml @@ -91,4 +91,34 @@ com/google/firestore/v1/Run*QueryResponse$Builder * mergeStats(*) + + 7012 + com/google/firestore/v1/Run*QueryRequestOrBuilder + com.google.firestore.v1.ExplainOptions getExplainOptions() + + + 7012 + com/google/firestore/v1/Run*QueryRequestOrBuilder + com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() + + + 7012 + com/google/firestore/v1/Run*QueryRequestOrBuilder + boolean hasExplainOptions() + + + 7012 + com/google/firestore/v1/Run*QueryResponseOrBuilder + com.google.firestore.v1.ExplainMetrics getExplainMetrics() + + + 7012 + com/google/firestore/v1/Run*QueryResponseOrBuilder + com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() + + + 7012 + com/google/firestore/v1/Run*QueryResponseOrBuilder + boolean hasExplainMetrics() + diff --git a/proto-google-cloud-firestore-v1/pom.xml b/proto-google-cloud-firestore-v1/pom.xml index 4ecb163192..ceda1096d2 100644 --- a/proto-google-cloud-firestore-v1/pom.xml +++ b/proto-google-cloud-firestore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.18.0 + 3.19.0 proto-google-cloud-firestore-v1 PROTO library for proto-google-cloud-firestore-v1 com.google.cloud google-cloud-firestore-parent - 3.18.0 + 3.19.0 diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStats.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStats.java new file mode 100644 index 0000000000..3c3fd0a978 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStats.java @@ -0,0 +1,1305 @@ +/* + * Copyright 2024 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/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +/** + * + * + *
+ * Execution statistics for the query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ExecutionStats} + */ +public final class ExecutionStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ExecutionStats) + ExecutionStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExecutionStats.newBuilder() to construct. + private ExecutionStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExecutionStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExecutionStats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExecutionStats.class, + com.google.firestore.v1.ExecutionStats.Builder.class); + } + + private int bitField0_; + public static final int RESULTS_RETURNED_FIELD_NUMBER = 1; + private long resultsReturned_ = 0L; + /** + * + * + *
+   * Total number of results returned, including documents, projections,
+   * aggregation results, keys.
+   * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + @java.lang.Override + public long getResultsReturned() { + return resultsReturned_; + } + + public static final int EXECUTION_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration executionDuration_; + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + @java.lang.Override + public boolean hasExecutionDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getExecutionDuration() { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder() { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + + public static final int READ_OPERATIONS_FIELD_NUMBER = 4; + private long readOperations_ = 0L; + /** + * + * + *
+   * Total billable read operations.
+   * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + @java.lang.Override + public long getReadOperations() { + return readOperations_; + } + + public static final int DEBUG_STATS_FIELD_NUMBER = 5; + private com.google.protobuf.Struct debugStats_; + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + @java.lang.Override + public boolean hasDebugStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + @java.lang.Override + public com.google.protobuf.Struct getDebugStats() { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder() { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + + 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 (resultsReturned_ != 0L) { + output.writeInt64(1, resultsReturned_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getExecutionDuration()); + } + if (readOperations_ != 0L) { + output.writeInt64(4, readOperations_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getDebugStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resultsReturned_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, resultsReturned_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExecutionDuration()); + } + if (readOperations_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, readOperations_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDebugStats()); + } + size += getUnknownFields().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.firestore.v1.ExecutionStats)) { + return super.equals(obj); + } + com.google.firestore.v1.ExecutionStats other = (com.google.firestore.v1.ExecutionStats) obj; + + if (getResultsReturned() != other.getResultsReturned()) return false; + if (hasExecutionDuration() != other.hasExecutionDuration()) return false; + if (hasExecutionDuration()) { + if (!getExecutionDuration().equals(other.getExecutionDuration())) return false; + } + if (getReadOperations() != other.getReadOperations()) return false; + if (hasDebugStats() != other.hasDebugStats()) return false; + if (hasDebugStats()) { + if (!getDebugStats().equals(other.getDebugStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RESULTS_RETURNED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getResultsReturned()); + if (hasExecutionDuration()) { + hash = (37 * hash) + EXECUTION_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getExecutionDuration().hashCode(); + } + hash = (37 * hash) + READ_OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadOperations()); + if (hasDebugStats()) { + hash = (37 * hash) + DEBUG_STATS_FIELD_NUMBER; + hash = (53 * hash) + getDebugStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ExecutionStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExecutionStats parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExecutionStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExecutionStats 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.firestore.v1.ExecutionStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExecutionStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExecutionStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExecutionStats 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.firestore.v1.ExecutionStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExecutionStats 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.firestore.v1.ExecutionStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExecutionStats 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.firestore.v1.ExecutionStats 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; + } + /** + * + * + *
+   * Execution statistics for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ExecutionStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ExecutionStats) + com.google.firestore.v1.ExecutionStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExecutionStats.class, + com.google.firestore.v1.ExecutionStats.Builder.class); + } + + // Construct using com.google.firestore.v1.ExecutionStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExecutionDurationFieldBuilder(); + getDebugStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resultsReturned_ = 0L; + executionDuration_ = null; + if (executionDurationBuilder_ != null) { + executionDurationBuilder_.dispose(); + executionDurationBuilder_ = null; + } + readOperations_ = 0L; + debugStats_ = null; + if (debugStatsBuilder_ != null) { + debugStatsBuilder_.dispose(); + debugStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ExecutionStats getDefaultInstanceForType() { + return com.google.firestore.v1.ExecutionStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ExecutionStats build() { + com.google.firestore.v1.ExecutionStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ExecutionStats buildPartial() { + com.google.firestore.v1.ExecutionStats result = + new com.google.firestore.v1.ExecutionStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.v1.ExecutionStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resultsReturned_ = resultsReturned_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.executionDuration_ = + executionDurationBuilder_ == null + ? executionDuration_ + : executionDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.readOperations_ = readOperations_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.debugStats_ = debugStatsBuilder_ == null ? debugStats_ : debugStatsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.firestore.v1.ExecutionStats) { + return mergeFrom((com.google.firestore.v1.ExecutionStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ExecutionStats other) { + if (other == com.google.firestore.v1.ExecutionStats.getDefaultInstance()) return this; + if (other.getResultsReturned() != 0L) { + setResultsReturned(other.getResultsReturned()); + } + if (other.hasExecutionDuration()) { + mergeExecutionDuration(other.getExecutionDuration()); + } + if (other.getReadOperations() != 0L) { + setReadOperations(other.getReadOperations()); + } + if (other.hasDebugStats()) { + mergeDebugStats(other.getDebugStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + resultsReturned_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 26: + { + input.readMessage( + getExecutionDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: + { + readOperations_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + input.readMessage(getDebugStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long resultsReturned_; + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + @java.lang.Override + public long getResultsReturned() { + return resultsReturned_; + } + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @param value The resultsReturned to set. + * @return This builder for chaining. + */ + public Builder setResultsReturned(long value) { + + resultsReturned_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @return This builder for chaining. + */ + public Builder clearResultsReturned() { + bitField0_ = (bitField0_ & ~0x00000001); + resultsReturned_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Duration executionDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + executionDurationBuilder_; + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + public boolean hasExecutionDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + public com.google.protobuf.Duration getExecutionDuration() { + if (executionDurationBuilder_ == null) { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } else { + return executionDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder setExecutionDuration(com.google.protobuf.Duration value) { + if (executionDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionDuration_ = value; + } else { + executionDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder setExecutionDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (executionDurationBuilder_ == null) { + executionDuration_ = builderForValue.build(); + } else { + executionDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder mergeExecutionDuration(com.google.protobuf.Duration value) { + if (executionDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && executionDuration_ != null + && executionDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getExecutionDurationBuilder().mergeFrom(value); + } else { + executionDuration_ = value; + } + } else { + executionDurationBuilder_.mergeFrom(value); + } + if (executionDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder clearExecutionDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + executionDuration_ = null; + if (executionDurationBuilder_ != null) { + executionDurationBuilder_.dispose(); + executionDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public com.google.protobuf.Duration.Builder getExecutionDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExecutionDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder() { + if (executionDurationBuilder_ != null) { + return executionDurationBuilder_.getMessageOrBuilder(); + } else { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getExecutionDurationFieldBuilder() { + if (executionDurationBuilder_ == null) { + executionDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getExecutionDuration(), getParentForChildren(), isClean()); + executionDuration_ = null; + } + return executionDurationBuilder_; + } + + private long readOperations_; + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + @java.lang.Override + public long getReadOperations() { + return readOperations_; + } + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @param value The readOperations to set. + * @return This builder for chaining. + */ + public Builder setReadOperations(long value) { + + readOperations_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @return This builder for chaining. + */ + public Builder clearReadOperations() { + bitField0_ = (bitField0_ & ~0x00000004); + readOperations_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Struct debugStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + debugStatsBuilder_; + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + public boolean hasDebugStats() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + public com.google.protobuf.Struct getDebugStats() { + if (debugStatsBuilder_ == null) { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } else { + return debugStatsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder setDebugStats(com.google.protobuf.Struct value) { + if (debugStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + debugStats_ = value; + } else { + debugStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder setDebugStats(com.google.protobuf.Struct.Builder builderForValue) { + if (debugStatsBuilder_ == null) { + debugStats_ = builderForValue.build(); + } else { + debugStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder mergeDebugStats(com.google.protobuf.Struct value) { + if (debugStatsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && debugStats_ != null + && debugStats_ != com.google.protobuf.Struct.getDefaultInstance()) { + getDebugStatsBuilder().mergeFrom(value); + } else { + debugStats_ = value; + } + } else { + debugStatsBuilder_.mergeFrom(value); + } + if (debugStats_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder clearDebugStats() { + bitField0_ = (bitField0_ & ~0x00000008); + debugStats_ = null; + if (debugStatsBuilder_ != null) { + debugStatsBuilder_.dispose(); + debugStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public com.google.protobuf.Struct.Builder getDebugStatsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDebugStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder() { + if (debugStatsBuilder_ != null) { + return debugStatsBuilder_.getMessageOrBuilder(); + } else { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getDebugStatsFieldBuilder() { + if (debugStatsBuilder_ == null) { + debugStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getDebugStats(), getParentForChildren(), isClean()); + debugStats_ = null; + } + return debugStatsBuilder_; + } + + @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.firestore.v1.ExecutionStats) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ExecutionStats) + private static final com.google.firestore.v1.ExecutionStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ExecutionStats(); + } + + public static com.google.firestore.v1.ExecutionStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecutionStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.v1.ExecutionStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStatsOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStatsOrBuilder.java new file mode 100644 index 0000000000..1694bea5f5 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStatsOrBuilder.java @@ -0,0 +1,156 @@ +/* + * Copyright 2024 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/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public interface ExecutionStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ExecutionStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Total number of results returned, including documents, projections,
+   * aggregation results, keys.
+   * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + long getResultsReturned(); + + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + boolean hasExecutionDuration(); + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + com.google.protobuf.Duration getExecutionDuration(); + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder(); + + /** + * + * + *
+   * Total billable read operations.
+   * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + long getReadOperations(); + + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + boolean hasDebugStats(); + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + com.google.protobuf.Struct getDebugStats(); + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetrics.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetrics.java new file mode 100644 index 0000000000..9f862e933c --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetrics.java @@ -0,0 +1,1014 @@ +/* + * Copyright 2024 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/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +/** + * + * + *
+ * Explain metrics for the query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ExplainMetrics} + */ +public final class ExplainMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ExplainMetrics) + ExplainMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplainMetrics.newBuilder() to construct. + private ExplainMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplainMetrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplainMetrics(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExplainMetrics.class, + com.google.firestore.v1.ExplainMetrics.Builder.class); + } + + private int bitField0_; + public static final int PLAN_SUMMARY_FIELD_NUMBER = 1; + private com.google.firestore.v1.PlanSummary planSummary_; + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + @java.lang.Override + public boolean hasPlanSummary() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + @java.lang.Override + public com.google.firestore.v1.PlanSummary getPlanSummary() { + return planSummary_ == null + ? com.google.firestore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + @java.lang.Override + public com.google.firestore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder() { + return planSummary_ == null + ? com.google.firestore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + + public static final int EXECUTION_STATS_FIELD_NUMBER = 2; + private com.google.firestore.v1.ExecutionStats executionStats_; + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + @java.lang.Override + public boolean hasExecutionStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + @java.lang.Override + public com.google.firestore.v1.ExecutionStats getExecutionStats() { + return executionStats_ == null + ? com.google.firestore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + @java.lang.Override + public com.google.firestore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder() { + return executionStats_ == null + ? com.google.firestore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPlanSummary()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getExecutionStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPlanSummary()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExecutionStats()); + } + size += getUnknownFields().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.firestore.v1.ExplainMetrics)) { + return super.equals(obj); + } + com.google.firestore.v1.ExplainMetrics other = (com.google.firestore.v1.ExplainMetrics) obj; + + if (hasPlanSummary() != other.hasPlanSummary()) return false; + if (hasPlanSummary()) { + if (!getPlanSummary().equals(other.getPlanSummary())) return false; + } + if (hasExecutionStats() != other.hasExecutionStats()) return false; + if (hasExecutionStats()) { + if (!getExecutionStats().equals(other.getExecutionStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPlanSummary()) { + hash = (37 * hash) + PLAN_SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getPlanSummary().hashCode(); + } + if (hasExecutionStats()) { + hash = (37 * hash) + EXECUTION_STATS_FIELD_NUMBER; + hash = (53 * hash) + getExecutionStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ExplainMetrics parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainMetrics parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExplainMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainMetrics 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.firestore.v1.ExplainMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExplainMetrics parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainMetrics 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.firestore.v1.ExplainMetrics parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainMetrics 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.firestore.v1.ExplainMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainMetrics 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.firestore.v1.ExplainMetrics 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; + } + /** + * + * + *
+   * Explain metrics for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ExplainMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ExplainMetrics) + com.google.firestore.v1.ExplainMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExplainMetrics.class, + com.google.firestore.v1.ExplainMetrics.Builder.class); + } + + // Construct using com.google.firestore.v1.ExplainMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPlanSummaryFieldBuilder(); + getExecutionStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + planSummary_ = null; + if (planSummaryBuilder_ != null) { + planSummaryBuilder_.dispose(); + planSummaryBuilder_ = null; + } + executionStats_ = null; + if (executionStatsBuilder_ != null) { + executionStatsBuilder_.dispose(); + executionStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics getDefaultInstanceForType() { + return com.google.firestore.v1.ExplainMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics build() { + com.google.firestore.v1.ExplainMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics buildPartial() { + com.google.firestore.v1.ExplainMetrics result = + new com.google.firestore.v1.ExplainMetrics(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.v1.ExplainMetrics result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.planSummary_ = + planSummaryBuilder_ == null ? planSummary_ : planSummaryBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.executionStats_ = + executionStatsBuilder_ == null ? executionStats_ : executionStatsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.firestore.v1.ExplainMetrics) { + return mergeFrom((com.google.firestore.v1.ExplainMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ExplainMetrics other) { + if (other == com.google.firestore.v1.ExplainMetrics.getDefaultInstance()) return this; + if (other.hasPlanSummary()) { + mergePlanSummary(other.getPlanSummary()); + } + if (other.hasExecutionStats()) { + mergeExecutionStats(other.getExecutionStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPlanSummaryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExecutionStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.firestore.v1.PlanSummary planSummary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.PlanSummary, + com.google.firestore.v1.PlanSummary.Builder, + com.google.firestore.v1.PlanSummaryOrBuilder> + planSummaryBuilder_; + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + public boolean hasPlanSummary() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + public com.google.firestore.v1.PlanSummary getPlanSummary() { + if (planSummaryBuilder_ == null) { + return planSummary_ == null + ? com.google.firestore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } else { + return planSummaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public Builder setPlanSummary(com.google.firestore.v1.PlanSummary value) { + if (planSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + planSummary_ = value; + } else { + planSummaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public Builder setPlanSummary(com.google.firestore.v1.PlanSummary.Builder builderForValue) { + if (planSummaryBuilder_ == null) { + planSummary_ = builderForValue.build(); + } else { + planSummaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public Builder mergePlanSummary(com.google.firestore.v1.PlanSummary value) { + if (planSummaryBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && planSummary_ != null + && planSummary_ != com.google.firestore.v1.PlanSummary.getDefaultInstance()) { + getPlanSummaryBuilder().mergeFrom(value); + } else { + planSummary_ = value; + } + } else { + planSummaryBuilder_.mergeFrom(value); + } + if (planSummary_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public Builder clearPlanSummary() { + bitField0_ = (bitField0_ & ~0x00000001); + planSummary_ = null; + if (planSummaryBuilder_ != null) { + planSummaryBuilder_.dispose(); + planSummaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public com.google.firestore.v1.PlanSummary.Builder getPlanSummaryBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPlanSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public com.google.firestore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder() { + if (planSummaryBuilder_ != null) { + return planSummaryBuilder_.getMessageOrBuilder(); + } else { + return planSummary_ == null + ? com.google.firestore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.PlanSummary, + com.google.firestore.v1.PlanSummary.Builder, + com.google.firestore.v1.PlanSummaryOrBuilder> + getPlanSummaryFieldBuilder() { + if (planSummaryBuilder_ == null) { + planSummaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.PlanSummary, + com.google.firestore.v1.PlanSummary.Builder, + com.google.firestore.v1.PlanSummaryOrBuilder>( + getPlanSummary(), getParentForChildren(), isClean()); + planSummary_ = null; + } + return planSummaryBuilder_; + } + + private com.google.firestore.v1.ExecutionStats executionStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExecutionStats, + com.google.firestore.v1.ExecutionStats.Builder, + com.google.firestore.v1.ExecutionStatsOrBuilder> + executionStatsBuilder_; + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + public boolean hasExecutionStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + public com.google.firestore.v1.ExecutionStats getExecutionStats() { + if (executionStatsBuilder_ == null) { + return executionStats_ == null + ? com.google.firestore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } else { + return executionStatsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public Builder setExecutionStats(com.google.firestore.v1.ExecutionStats value) { + if (executionStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionStats_ = value; + } else { + executionStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public Builder setExecutionStats( + com.google.firestore.v1.ExecutionStats.Builder builderForValue) { + if (executionStatsBuilder_ == null) { + executionStats_ = builderForValue.build(); + } else { + executionStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public Builder mergeExecutionStats(com.google.firestore.v1.ExecutionStats value) { + if (executionStatsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && executionStats_ != null + && executionStats_ != com.google.firestore.v1.ExecutionStats.getDefaultInstance()) { + getExecutionStatsBuilder().mergeFrom(value); + } else { + executionStats_ = value; + } + } else { + executionStatsBuilder_.mergeFrom(value); + } + if (executionStats_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public Builder clearExecutionStats() { + bitField0_ = (bitField0_ & ~0x00000002); + executionStats_ = null; + if (executionStatsBuilder_ != null) { + executionStatsBuilder_.dispose(); + executionStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public com.google.firestore.v1.ExecutionStats.Builder getExecutionStatsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExecutionStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public com.google.firestore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder() { + if (executionStatsBuilder_ != null) { + return executionStatsBuilder_.getMessageOrBuilder(); + } else { + return executionStats_ == null + ? com.google.firestore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExecutionStats, + com.google.firestore.v1.ExecutionStats.Builder, + com.google.firestore.v1.ExecutionStatsOrBuilder> + getExecutionStatsFieldBuilder() { + if (executionStatsBuilder_ == null) { + executionStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExecutionStats, + com.google.firestore.v1.ExecutionStats.Builder, + com.google.firestore.v1.ExecutionStatsOrBuilder>( + getExecutionStats(), getParentForChildren(), isClean()); + executionStats_ = null; + } + return executionStatsBuilder_; + } + + @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.firestore.v1.ExplainMetrics) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ExplainMetrics) + private static final com.google.firestore.v1.ExplainMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ExplainMetrics(); + } + + public static com.google.firestore.v1.ExplainMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplainMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.v1.ExplainMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetricsOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetricsOrBuilder.java new file mode 100644 index 0000000000..ba5a87f0f1 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetricsOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2024 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/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public interface ExplainMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ExplainMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + boolean hasPlanSummary(); + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + com.google.firestore.v1.PlanSummary getPlanSummary(); + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + com.google.firestore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder(); + + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + boolean hasExecutionStats(); + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + com.google.firestore.v1.ExecutionStats getExecutionStats(); + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + com.google.firestore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptions.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptions.java new file mode 100644 index 0000000000..82c242b890 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptions.java @@ -0,0 +1,557 @@ +/* + * Copyright 2024 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/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +/** + * + * + *
+ * Explain options for the query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ExplainOptions} + */ +public final class ExplainOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ExplainOptions) + ExplainOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplainOptions.newBuilder() to construct. + private ExplainOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplainOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplainOptions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExplainOptions.class, + com.google.firestore.v1.ExplainOptions.Builder.class); + } + + public static final int ANALYZE_FIELD_NUMBER = 1; + private boolean analyze_ = false; + /** + * + * + *
+   * Optional. Whether to execute this query.
+   *
+   * When false (the default), the query will be planned, returning only
+   * metrics from the planning stages.
+   *
+   * When true, the query will be planned and executed, returning the full
+   * query results along with both planning and execution stage metrics.
+   * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + @java.lang.Override + public boolean getAnalyze() { + return analyze_; + } + + 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 (analyze_ != false) { + output.writeBool(1, analyze_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (analyze_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, analyze_); + } + size += getUnknownFields().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.firestore.v1.ExplainOptions)) { + return super.equals(obj); + } + com.google.firestore.v1.ExplainOptions other = (com.google.firestore.v1.ExplainOptions) obj; + + if (getAnalyze() != other.getAnalyze()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ANALYZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAnalyze()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ExplainOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExplainOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainOptions 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.firestore.v1.ExplainOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExplainOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainOptions 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.firestore.v1.ExplainOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainOptions 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.firestore.v1.ExplainOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainOptions 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.firestore.v1.ExplainOptions 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; + } + /** + * + * + *
+   * Explain options for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ExplainOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ExplainOptions) + com.google.firestore.v1.ExplainOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExplainOptions.class, + com.google.firestore.v1.ExplainOptions.Builder.class); + } + + // Construct using com.google.firestore.v1.ExplainOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + analyze_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainOptions getDefaultInstanceForType() { + return com.google.firestore.v1.ExplainOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ExplainOptions build() { + com.google.firestore.v1.ExplainOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainOptions buildPartial() { + com.google.firestore.v1.ExplainOptions result = + new com.google.firestore.v1.ExplainOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.v1.ExplainOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.analyze_ = analyze_; + } + } + + @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.firestore.v1.ExplainOptions) { + return mergeFrom((com.google.firestore.v1.ExplainOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ExplainOptions other) { + if (other == com.google.firestore.v1.ExplainOptions.getDefaultInstance()) return this; + if (other.getAnalyze() != false) { + setAnalyze(other.getAnalyze()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + analyze_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean analyze_; + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + @java.lang.Override + public boolean getAnalyze() { + return analyze_; + } + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The analyze to set. + * @return This builder for chaining. + */ + public Builder setAnalyze(boolean value) { + + analyze_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAnalyze() { + bitField0_ = (bitField0_ & ~0x00000001); + analyze_ = false; + 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.firestore.v1.ExplainOptions) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ExplainOptions) + private static final com.google.firestore.v1.ExplainOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ExplainOptions(); + } + + public static com.google.firestore.v1.ExplainOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplainOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.v1.ExplainOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptionsOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptionsOrBuilder.java new file mode 100644 index 0000000000..2acb95c564 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptionsOrBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 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/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public interface ExplainOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ExplainOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Whether to execute this query.
+   *
+   * When false (the default), the query will be planned, returning only
+   * metrics from the planning stages.
+   *
+   * When true, the query will be planned and executed, returning the full
+   * query results along with both planning and execution stage metrics.
+   * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + boolean getAnalyze(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java index 8c94b976f0..ca42c2a2c0 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java @@ -180,241 +180,248 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "tore/v1/aggregation_result.proto\032 google" + "/firestore/v1/common.proto\032\"google/fires" + "tore/v1/document.proto\032\037google/firestore" - + "/v1/query.proto\032\037google/firestore/v1/wri" - + "te.proto\032\033google/protobuf/empty.proto\032\037g" - + "oogle/protobuf/timestamp.proto\032\036google/p" - + "rotobuf/wrappers.proto\032\027google/rpc/statu" - + "s.proto\"\270\001\n\022GetDocumentRequest\022\021\n\004name\030\001" - + " \001(\tB\003\340A\002\022/\n\004mask\030\002 \001(\0132!.google.firesto" - + "re.v1.DocumentMask\022\025\n\013transaction\030\003 \001(\014H" - + "\000\022/\n\tread_time\030\005 \001(\0132\032.google.protobuf.T" - + "imestampH\000B\026\n\024consistency_selector\"\273\002\n\024L" - + "istDocumentsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002" - + "\022\032\n\rcollection_id\030\002 \001(\tB\003\340A\001\022\026\n\tpage_siz" - + "e\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\022\025\n" - + "\010order_by\030\006 \001(\tB\003\340A\001\0224\n\004mask\030\007 \001(\0132!.goo" - + "gle.firestore.v1.DocumentMaskB\003\340A\001\022\025\n\013tr" - + "ansaction\030\010 \001(\014H\000\022/\n\tread_time\030\n \001(\0132\032.g" - + "oogle.protobuf.TimestampH\000\022\024\n\014show_missi" - + "ng\030\014 \001(\010B\026\n\024consistency_selector\"b\n\025List" - + "DocumentsResponse\0220\n\tdocuments\030\001 \003(\0132\035.g" - + "oogle.firestore.v1.Document\022\027\n\017next_page" - + "_token\030\002 \001(\t\"\304\001\n\025CreateDocumentRequest\022\023" - + "\n\006parent\030\001 \001(\tB\003\340A\002\022\032\n\rcollection_id\030\002 \001" - + "(\tB\003\340A\002\022\023\n\013document_id\030\003 \001(\t\0224\n\010document" - + "\030\004 \001(\0132\035.google.firestore.v1.DocumentB\003\340" - + "A\002\022/\n\004mask\030\005 \001(\0132!.google.firestore.v1.D" - + "ocumentMask\"\363\001\n\025UpdateDocumentRequest\0224\n" - + "\010document\030\001 \001(\0132\035.google.firestore.v1.Do" - + "cumentB\003\340A\002\0226\n\013update_mask\030\002 \001(\0132!.googl" - + "e.firestore.v1.DocumentMask\022/\n\004mask\030\003 \001(" - + "\0132!.google.firestore.v1.DocumentMask\022;\n\020" - + "current_document\030\004 \001(\0132!.google.firestor" - + "e.v1.Precondition\"g\n\025DeleteDocumentReque" - + "st\022\021\n\004name\030\001 \001(\tB\003\340A\002\022;\n\020current_documen" - + "t\030\002 \001(\0132!.google.firestore.v1.Preconditi" - + "on\"\231\002\n\030BatchGetDocumentsRequest\022\025\n\010datab" - + "ase\030\001 \001(\tB\003\340A\002\022\021\n\tdocuments\030\002 \003(\t\022/\n\004mas" - + "k\030\003 \001(\0132!.google.firestore.v1.DocumentMa" - + "sk\022\025\n\013transaction\030\004 \001(\014H\000\022B\n\017new_transac" - + "tion\030\005 \001(\0132\'.google.firestore.v1.Transac" - + "tionOptionsH\000\022/\n\tread_time\030\007 \001(\0132\032.googl" - + "e.protobuf.TimestampH\000B\026\n\024consistency_se" - + "lector\"\254\001\n\031BatchGetDocumentsResponse\022.\n\005" - + "found\030\001 \001(\0132\035.google.firestore.v1.Docume" - + "ntH\000\022\021\n\007missing\030\002 \001(\tH\000\022\023\n\013transaction\030\003" - + " \001(\014\022-\n\tread_time\030\004 \001(\0132\032.google.protobu" - + "f.TimestampB\010\n\006result\"j\n\027BeginTransactio" - + "nRequest\022\025\n\010database\030\001 \001(\tB\003\340A\002\0228\n\007optio" - + "ns\030\002 \001(\0132\'.google.firestore.v1.Transacti" - + "onOptions\"/\n\030BeginTransactionResponse\022\023\n" - + "\013transaction\030\001 \001(\014\"g\n\rCommitRequest\022\025\n\010d" - + "atabase\030\001 \001(\tB\003\340A\002\022*\n\006writes\030\002 \003(\0132\032.goo" - + "gle.firestore.v1.Write\022\023\n\013transaction\030\003 " - + "\001(\014\"z\n\016CommitResponse\0227\n\rwrite_results\030\001" - + " \003(\0132 .google.firestore.v1.WriteResult\022/" - + "\n\013commit_time\030\002 \001(\0132\032.google.protobuf.Ti" - + "mestamp\"B\n\017RollbackRequest\022\025\n\010database\030\001" - + " \001(\tB\003\340A\002\022\030\n\013transaction\030\002 \001(\014B\003\340A\002\"\232\002\n\017" - + "RunQueryRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022@\n\020" - + "structured_query\030\002 \001(\0132$.google.firestor" - + "e.v1.StructuredQueryH\000\022\025\n\013transaction\030\005 " - + "\001(\014H\001\022B\n\017new_transaction\030\006 \001(\0132\'.google." - + "firestore.v1.TransactionOptionsH\001\022/\n\trea" - + "d_time\030\007 \001(\0132\032.google.protobuf.Timestamp" - + "H\001B\014\n\nquery_typeB\026\n\024consistency_selector" - + "\"\311\001\n\020RunQueryResponse\022\023\n\013transaction\030\002 \001" - + "(\014\022/\n\010document\030\001 \001(\0132\035.google.firestore." - + "v1.Document\022-\n\tread_time\030\003 \001(\0132\032.google." - + "protobuf.Timestamp\022\027\n\017skipped_results\030\004 " - + "\001(\005\022\016\n\004done\030\006 \001(\010H\000B\027\n\025continuation_sele" - + "ctor\"\274\002\n\032RunAggregationQueryRequest\022\023\n\006p" - + "arent\030\001 \001(\tB\003\340A\002\022W\n\034structured_aggregati" - + "on_query\030\002 \001(\0132/.google.firestore.v1.Str" - + "ucturedAggregationQueryH\000\022\025\n\013transaction" - + "\030\004 \001(\014H\001\022B\n\017new_transaction\030\005 \001(\0132\'.goog" - + "le.firestore.v1.TransactionOptionsH\001\022/\n\t" - + "read_time\030\006 \001(\0132\032.google.protobuf.Timest" - + "ampH\001B\014\n\nquery_typeB\026\n\024consistency_selec" - + "tor\"\231\001\n\033RunAggregationQueryResponse\0226\n\006r" - + "esult\030\001 \001(\0132&.google.firestore.v1.Aggreg" - + "ationResult\022\023\n\013transaction\030\002 \001(\014\022-\n\tread" - + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"" - + "\205\002\n\025PartitionQueryRequest\022\023\n\006parent\030\001 \001(" - + "\tB\003\340A\002\022@\n\020structured_query\030\002 \001(\0132$.googl" - + "e.firestore.v1.StructuredQueryH\000\022\027\n\017part" - + "ition_count\030\003 \001(\003\022\022\n\npage_token\030\004 \001(\t\022\021\n" - + "\tpage_size\030\005 \001(\005\022/\n\tread_time\030\006 \001(\0132\032.go" - + "ogle.protobuf.TimestampH\001B\014\n\nquery_typeB" - + "\026\n\024consistency_selector\"b\n\026PartitionQuer" - + "yResponse\022/\n\npartitions\030\001 \003(\0132\033.google.f" - + "irestore.v1.Cursor\022\027\n\017next_page_token\030\002 " - + "\001(\t\"\350\001\n\014WriteRequest\022\025\n\010database\030\001 \001(\tB\003" - + "\340A\002\022\021\n\tstream_id\030\002 \001(\t\022*\n\006writes\030\003 \003(\0132\032" - + ".google.firestore.v1.Write\022\024\n\014stream_tok" - + "en\030\004 \001(\014\022=\n\006labels\030\005 \003(\0132-.google.firest" - + "ore.v1.WriteRequest.LabelsEntry\032-\n\013Label" - + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\242" - + "\001\n\rWriteResponse\022\021\n\tstream_id\030\001 \001(\t\022\024\n\014s" - + "tream_token\030\002 \001(\014\0227\n\rwrite_results\030\003 \003(\013" - + "2 .google.firestore.v1.WriteResult\022/\n\013co" - + "mmit_time\030\004 \001(\0132\032.google.protobuf.Timest" - + "amp\"\362\001\n\rListenRequest\022\025\n\010database\030\001 \001(\tB" - + "\003\340A\002\0221\n\nadd_target\030\002 \001(\0132\033.google.firest" - + "ore.v1.TargetH\000\022\027\n\rremove_target\030\003 \001(\005H\000" - + "\022>\n\006labels\030\004 \003(\0132..google.firestore.v1.L" - + "istenRequest.LabelsEntry\032-\n\013LabelsEntry\022" - + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\017\n\rtarge" - + "t_change\"\325\002\n\016ListenResponse\022:\n\rtarget_ch" - + "ange\030\002 \001(\0132!.google.firestore.v1.TargetC" - + "hangeH\000\022>\n\017document_change\030\003 \001(\0132#.googl" - + "e.firestore.v1.DocumentChangeH\000\022>\n\017docum" - + "ent_delete\030\004 \001(\0132#.google.firestore.v1.D" - + "ocumentDeleteH\000\022>\n\017document_remove\030\006 \001(\013" - + "2#.google.firestore.v1.DocumentRemoveH\000\022" - + "6\n\006filter\030\005 \001(\0132$.google.firestore.v1.Ex" - + "istenceFilterH\000B\017\n\rresponse_type\"\326\003\n\006Tar" - + "get\0228\n\005query\030\002 \001(\0132\'.google.firestore.v1" - + ".Target.QueryTargetH\000\022@\n\tdocuments\030\003 \001(\013" - + "2+.google.firestore.v1.Target.DocumentsT" - + "argetH\000\022\026\n\014resume_token\030\004 \001(\014H\001\022/\n\tread_" - + "time\030\013 \001(\0132\032.google.protobuf.TimestampH\001" - + "\022\021\n\ttarget_id\030\005 \001(\005\022\014\n\004once\030\006 \001(\010\0223\n\016exp" - + "ected_count\030\014 \001(\0132\033.google.protobuf.Int3" - + "2Value\032$\n\017DocumentsTarget\022\021\n\tdocuments\030\002" - + " \003(\t\032m\n\013QueryTarget\022\016\n\006parent\030\001 \001(\t\022@\n\020s" - + "tructured_query\030\002 \001(\0132$.google.firestore" - + ".v1.StructuredQueryH\000B\014\n\nquery_typeB\r\n\013t" - + "arget_typeB\r\n\013resume_type\"\252\002\n\014TargetChan" - + "ge\022N\n\022target_change_type\030\001 \001(\01622.google." - + "firestore.v1.TargetChange.TargetChangeTy" - + "pe\022\022\n\ntarget_ids\030\002 \003(\005\022!\n\005cause\030\003 \001(\0132\022." - + "google.rpc.Status\022\024\n\014resume_token\030\004 \001(\014\022" - + "-\n\tread_time\030\006 \001(\0132\032.google.protobuf.Tim" - + "estamp\"N\n\020TargetChangeType\022\r\n\tNO_CHANGE\020" - + "\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002\022\013\n\007CURRENT\020\003\022\t\n\005R" - + "ESET\020\004\"\237\001\n\030ListCollectionIdsRequest\022\023\n\006p" - + "arent\030\001 \001(\tB\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np" - + "age_token\030\003 \001(\t\022/\n\tread_time\030\004 \001(\0132\032.goo" - + "gle.protobuf.TimestampH\000B\026\n\024consistency_" - + "selector\"L\n\031ListCollectionIdsResponse\022\026\n" - + "\016collection_ids\030\001 \003(\t\022\027\n\017next_page_token" - + "\030\002 \001(\t\"\311\001\n\021BatchWriteRequest\022\025\n\010database" - + "\030\001 \001(\tB\003\340A\002\022*\n\006writes\030\002 \003(\0132\032.google.fir" - + "estore.v1.Write\022B\n\006labels\030\003 \003(\01322.google" - + ".firestore.v1.BatchWriteRequest.LabelsEn" + + "/v1/query.proto\032\'google/firestore/v1/que" + + "ry_profile.proto\032\037google/firestore/v1/wr" + + "ite.proto\032\033google/protobuf/empty.proto\032\037" + + "google/protobuf/timestamp.proto\032\036google/" + + "protobuf/wrappers.proto\032\027google/rpc/stat" + + "us.proto\"\270\001\n\022GetDocumentRequest\022\021\n\004name\030" + + "\001 \001(\tB\003\340A\002\022/\n\004mask\030\002 \001(\0132!.google.firest" + + "ore.v1.DocumentMask\022\025\n\013transaction\030\003 \001(\014" + + "H\000\022/\n\tread_time\030\005 \001(\0132\032.google.protobuf." + + "TimestampH\000B\026\n\024consistency_selector\"\273\002\n\024" + + "ListDocumentsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A" + + "\002\022\032\n\rcollection_id\030\002 \001(\tB\003\340A\001\022\026\n\tpage_si" + + "ze\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\022\025" + + "\n\010order_by\030\006 \001(\tB\003\340A\001\0224\n\004mask\030\007 \001(\0132!.go" + + "ogle.firestore.v1.DocumentMaskB\003\340A\001\022\025\n\013t" + + "ransaction\030\010 \001(\014H\000\022/\n\tread_time\030\n \001(\0132\032." + + "google.protobuf.TimestampH\000\022\024\n\014show_miss" + + "ing\030\014 \001(\010B\026\n\024consistency_selector\"b\n\025Lis" + + "tDocumentsResponse\0220\n\tdocuments\030\001 \003(\0132\035." + + "google.firestore.v1.Document\022\027\n\017next_pag" + + "e_token\030\002 \001(\t\"\304\001\n\025CreateDocumentRequest\022" + + "\023\n\006parent\030\001 \001(\tB\003\340A\002\022\032\n\rcollection_id\030\002 " + + "\001(\tB\003\340A\002\022\023\n\013document_id\030\003 \001(\t\0224\n\010documen" + + "t\030\004 \001(\0132\035.google.firestore.v1.DocumentB\003" + + "\340A\002\022/\n\004mask\030\005 \001(\0132!.google.firestore.v1." + + "DocumentMask\"\363\001\n\025UpdateDocumentRequest\0224" + + "\n\010document\030\001 \001(\0132\035.google.firestore.v1.D" + + "ocumentB\003\340A\002\0226\n\013update_mask\030\002 \001(\0132!.goog" + + "le.firestore.v1.DocumentMask\022/\n\004mask\030\003 \001" + + "(\0132!.google.firestore.v1.DocumentMask\022;\n" + + "\020current_document\030\004 \001(\0132!.google.firesto" + + "re.v1.Precondition\"g\n\025DeleteDocumentRequ" + + "est\022\021\n\004name\030\001 \001(\tB\003\340A\002\022;\n\020current_docume" + + "nt\030\002 \001(\0132!.google.firestore.v1.Precondit" + + "ion\"\231\002\n\030BatchGetDocumentsRequest\022\025\n\010data" + + "base\030\001 \001(\tB\003\340A\002\022\021\n\tdocuments\030\002 \003(\t\022/\n\004ma" + + "sk\030\003 \001(\0132!.google.firestore.v1.DocumentM" + + "ask\022\025\n\013transaction\030\004 \001(\014H\000\022B\n\017new_transa" + + "ction\030\005 \001(\0132\'.google.firestore.v1.Transa" + + "ctionOptionsH\000\022/\n\tread_time\030\007 \001(\0132\032.goog" + + "le.protobuf.TimestampH\000B\026\n\024consistency_s" + + "elector\"\254\001\n\031BatchGetDocumentsResponse\022.\n" + + "\005found\030\001 \001(\0132\035.google.firestore.v1.Docum" + + "entH\000\022\021\n\007missing\030\002 \001(\tH\000\022\023\n\013transaction\030" + + "\003 \001(\014\022-\n\tread_time\030\004 \001(\0132\032.google.protob" + + "uf.TimestampB\010\n\006result\"j\n\027BeginTransacti" + + "onRequest\022\025\n\010database\030\001 \001(\tB\003\340A\002\0228\n\007opti" + + "ons\030\002 \001(\0132\'.google.firestore.v1.Transact" + + "ionOptions\"/\n\030BeginTransactionResponse\022\023" + + "\n\013transaction\030\001 \001(\014\"g\n\rCommitRequest\022\025\n\010" + + "database\030\001 \001(\tB\003\340A\002\022*\n\006writes\030\002 \003(\0132\032.go" + + "ogle.firestore.v1.Write\022\023\n\013transaction\030\003" + + " \001(\014\"z\n\016CommitResponse\0227\n\rwrite_results\030" + + "\001 \003(\0132 .google.firestore.v1.WriteResult\022" + + "/\n\013commit_time\030\002 \001(\0132\032.google.protobuf.T" + + "imestamp\"B\n\017RollbackRequest\022\025\n\010database\030" + + "\001 \001(\tB\003\340A\002\022\030\n\013transaction\030\002 \001(\014B\003\340A\002\"\335\002\n" + + "\017RunQueryRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022@\n" + + "\020structured_query\030\002 \001(\0132$.google.firesto" + + "re.v1.StructuredQueryH\000\022\025\n\013transaction\030\005" + + " \001(\014H\001\022B\n\017new_transaction\030\006 \001(\0132\'.google" + + ".firestore.v1.TransactionOptionsH\001\022/\n\tre" + + "ad_time\030\007 \001(\0132\032.google.protobuf.Timestam" + + "pH\001\022A\n\017explain_options\030\n \001(\0132#.google.fi" + + "restore.v1.ExplainOptionsB\003\340A\001B\014\n\nquery_" + + "typeB\026\n\024consistency_selector\"\207\002\n\020RunQuer" + + "yResponse\022\023\n\013transaction\030\002 \001(\014\022/\n\010docume" + + "nt\030\001 \001(\0132\035.google.firestore.v1.Document\022" + + "-\n\tread_time\030\003 \001(\0132\032.google.protobuf.Tim" + + "estamp\022\027\n\017skipped_results\030\004 \001(\005\022\016\n\004done\030" + + "\006 \001(\010H\000\022<\n\017explain_metrics\030\013 \001(\0132#.googl" + + "e.firestore.v1.ExplainMetricsB\027\n\025continu" + + "ation_selector\"\377\002\n\032RunAggregationQueryRe" + + "quest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022W\n\034structured" + + "_aggregation_query\030\002 \001(\0132/.google.firest" + + "ore.v1.StructuredAggregationQueryH\000\022\025\n\013t" + + "ransaction\030\004 \001(\014H\001\022B\n\017new_transaction\030\005 " + + "\001(\0132\'.google.firestore.v1.TransactionOpt" + + "ionsH\001\022/\n\tread_time\030\006 \001(\0132\032.google.proto" + + "buf.TimestampH\001\022A\n\017explain_options\030\010 \001(\013" + + "2#.google.firestore.v1.ExplainOptionsB\003\340" + + "A\001B\014\n\nquery_typeB\026\n\024consistency_selector" + + "\"\327\001\n\033RunAggregationQueryResponse\0226\n\006resu" + + "lt\030\001 \001(\0132&.google.firestore.v1.Aggregati" + + "onResult\022\023\n\013transaction\030\002 \001(\014\022-\n\tread_ti" + + "me\030\003 \001(\0132\032.google.protobuf.Timestamp\022<\n\017" + + "explain_metrics\030\n \001(\0132#.google.firestore" + + ".v1.ExplainMetrics\"\205\002\n\025PartitionQueryReq" + + "uest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022@\n\020structured_" + + "query\030\002 \001(\0132$.google.firestore.v1.Struct" + + "uredQueryH\000\022\027\n\017partition_count\030\003 \001(\003\022\022\n\n" + + "page_token\030\004 \001(\t\022\021\n\tpage_size\030\005 \001(\005\022/\n\tr" + + "ead_time\030\006 \001(\0132\032.google.protobuf.Timesta" + + "mpH\001B\014\n\nquery_typeB\026\n\024consistency_select" + + "or\"b\n\026PartitionQueryResponse\022/\n\npartitio" + + "ns\030\001 \003(\0132\033.google.firestore.v1.Cursor\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\350\001\n\014WriteRequest\022" + + "\025\n\010database\030\001 \001(\tB\003\340A\002\022\021\n\tstream_id\030\002 \001(" + + "\t\022*\n\006writes\030\003 \003(\0132\032.google.firestore.v1." + + "Write\022\024\n\014stream_token\030\004 \001(\014\022=\n\006labels\030\005 " + + "\003(\0132-.google.firestore.v1.WriteRequest.L" + + "abelsEntry\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t:\0028\001\"\242\001\n\rWriteResponse\022\021\n\ts" + + "tream_id\030\001 \001(\t\022\024\n\014stream_token\030\002 \001(\014\0227\n\r" + + "write_results\030\003 \003(\0132 .google.firestore.v" + + "1.WriteResult\022/\n\013commit_time\030\004 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\"\362\001\n\rListenRequest" + + "\022\025\n\010database\030\001 \001(\tB\003\340A\002\0221\n\nadd_target\030\002 " + + "\001(\0132\033.google.firestore.v1.TargetH\000\022\027\n\rre" + + "move_target\030\003 \001(\005H\000\022>\n\006labels\030\004 \003(\0132..go" + + "ogle.firestore.v1.ListenRequest.LabelsEn" + "try\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" - + "\030\002 \001(\t:\0028\001\"q\n\022BatchWriteResponse\0227\n\rwrit" - + "e_results\030\001 \003(\0132 .google.firestore.v1.Wr" - + "iteResult\022\"\n\006status\030\002 \003(\0132\022.google.rpc.S" - + "tatus2\332\031\n\tFirestore\022\217\001\n\013GetDocument\022\'.go" - + "ogle.firestore.v1.GetDocumentRequest\032\035.g" - + "oogle.firestore.v1.Document\"8\202\323\344\223\0022\0220/v1" - + "/{name=projects/*/databases/*/documents/" - + "*/**}\022\365\001\n\rListDocuments\022).google.firesto" - + "re.v1.ListDocumentsRequest\032*.google.fire" - + "store.v1.ListDocumentsResponse\"\214\001\202\323\344\223\002\205\001" - + "\022B/v1/{parent=projects/*/databases/*/doc" - + "uments/*/**}/{collection_id}Z?\022=/v1/{par" - + "ent=projects/*/databases/*/documents}/{c" - + "ollection_id}\022\277\001\n\016UpdateDocument\022*.googl" - + "e.firestore.v1.UpdateDocumentRequest\032\035.g" - + "oogle.firestore.v1.Document\"b\332A\024document" - + ",update_mask\202\323\344\223\002E29/v1/{document.name=p" - + "rojects/*/databases/*/documents/*/**}:\010d" - + "ocument\022\225\001\n\016DeleteDocument\022*.google.fire" - + "store.v1.DeleteDocumentRequest\032\026.google." - + "protobuf.Empty\"?\332A\004name\202\323\344\223\0022*0/v1/{name" - + "=projects/*/databases/*/documents/*/**}\022" - + "\271\001\n\021BatchGetDocuments\022-.google.firestore" - + ".v1.BatchGetDocumentsRequest\032..google.fi" - + "restore.v1.BatchGetDocumentsResponse\"C\202\323" - + "\344\223\002=\"8/v1/{database=projects/*/databases" - + "/*}/documents:batchGet:\001*0\001\022\307\001\n\020BeginTra" - + "nsaction\022,.google.firestore.v1.BeginTran" - + "sactionRequest\032-.google.firestore.v1.Beg" - + "inTransactionResponse\"V\332A\010database\202\323\344\223\002E" - + "\"@/v1/{database=projects/*/databases/*}/" - + "documents:beginTransaction:\001*\022\246\001\n\006Commit" - + "\022\".google.firestore.v1.CommitRequest\032#.g" - + "oogle.firestore.v1.CommitResponse\"S\332A\017da" - + "tabase,writes\202\323\344\223\002;\"6/v1/{database=proje" - + "cts/*/databases/*}/documents:commit:\001*\022\244" - + "\001\n\010Rollback\022$.google.firestore.v1.Rollba" - + "ckRequest\032\026.google.protobuf.Empty\"Z\332A\024da" - + "tabase,transaction\202\323\344\223\002=\"8/v1/{database=" - + "projects/*/databases/*}/documents:rollba" - + "ck:\001*\022\337\001\n\010RunQuery\022$.google.firestore.v1" - + ".RunQueryRequest\032%.google.firestore.v1.R" - + "unQueryResponse\"\203\001\202\323\344\223\002}\"6/v1/{parent=pr" - + "ojects/*/databases/*/documents}:runQuery" - + ":\001*Z@\";/v1/{parent=projects/*/databases/" - + "*/documents/*/**}:runQuery:\001*0\001\022\227\002\n\023RunA" - + "ggregationQuery\022/.google.firestore.v1.Ru" - + "nAggregationQueryRequest\0320.google.firest" - + "ore.v1.RunAggregationQueryResponse\"\232\001\202\323\344" - + "\223\002\223\001\"A/v1/{parent=projects/*/databases/*" - + "/documents}:runAggregationQuery:\001*ZK\"F/v" - + "1/{parent=projects/*/databases/*/documen" - + "ts/*/**}:runAggregationQuery:\001*0\001\022\374\001\n\016Pa" - + "rtitionQuery\022*.google.firestore.v1.Parti" - + "tionQueryRequest\032+.google.firestore.v1.P" - + "artitionQueryResponse\"\220\001\202\323\344\223\002\211\001\"\n\017document_c" + + "hange\030\003 \001(\0132#.google.firestore.v1.Docume" + + "ntChangeH\000\022>\n\017document_delete\030\004 \001(\0132#.go" + + "ogle.firestore.v1.DocumentDeleteH\000\022>\n\017do" + + "cument_remove\030\006 \001(\0132#.google.firestore.v" + + "1.DocumentRemoveH\000\0226\n\006filter\030\005 \001(\0132$.goo" + + "gle.firestore.v1.ExistenceFilterH\000B\017\n\rre" + + "sponse_type\"\326\003\n\006Target\0228\n\005query\030\002 \001(\0132\'." + + "google.firestore.v1.Target.QueryTargetH\000" + + "\022@\n\tdocuments\030\003 \001(\0132+.google.firestore.v" + + "1.Target.DocumentsTargetH\000\022\026\n\014resume_tok" + + "en\030\004 \001(\014H\001\022/\n\tread_time\030\013 \001(\0132\032.google.p" + + "rotobuf.TimestampH\001\022\021\n\ttarget_id\030\005 \001(\005\022\014" + + "\n\004once\030\006 \001(\010\0223\n\016expected_count\030\014 \001(\0132\033.g" + + "oogle.protobuf.Int32Value\032$\n\017DocumentsTa" + + "rget\022\021\n\tdocuments\030\002 \003(\t\032m\n\013QueryTarget\022\016" + + "\n\006parent\030\001 \001(\t\022@\n\020structured_query\030\002 \001(\013" + + "2$.google.firestore.v1.StructuredQueryH\000" + + "B\014\n\nquery_typeB\r\n\013target_typeB\r\n\013resume_" + + "type\"\252\002\n\014TargetChange\022N\n\022target_change_t" + + "ype\030\001 \001(\01622.google.firestore.v1.TargetCh" + + "ange.TargetChangeType\022\022\n\ntarget_ids\030\002 \003(" + + "\005\022!\n\005cause\030\003 \001(\0132\022.google.rpc.Status\022\024\n\014" + + "resume_token\030\004 \001(\014\022-\n\tread_time\030\006 \001(\0132\032." + + "google.protobuf.Timestamp\"N\n\020TargetChang" + + "eType\022\r\n\tNO_CHANGE\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020" + + "\002\022\013\n\007CURRENT\020\003\022\t\n\005RESET\020\004\"\237\001\n\030ListCollec" + + "tionIdsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\021\n\tp" + + "age_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022/\n\tre" + + "ad_time\030\004 \001(\0132\032.google.protobuf.Timestam" + + "pH\000B\026\n\024consistency_selector\"L\n\031ListColle" + + "ctionIdsResponse\022\026\n\016collection_ids\030\001 \003(\t" + + "\022\027\n\017next_page_token\030\002 \001(\t\"\311\001\n\021BatchWrite" + + "Request\022\025\n\010database\030\001 \001(\tB\003\340A\002\022*\n\006writes" + + "\030\002 \003(\0132\032.google.firestore.v1.Write\022B\n\006la" + + "bels\030\003 \003(\01322.google.firestore.v1.BatchWr" + + "iteRequest.LabelsEntry\032-\n\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"q\n\022BatchWr" + + "iteResponse\0227\n\rwrite_results\030\001 \003(\0132 .goo" + + "gle.firestore.v1.WriteResult\022\"\n\006status\030\002" + + " \003(\0132\022.google.rpc.Status2\332\031\n\tFirestore\022\217" + + "\001\n\013GetDocument\022\'.google.firestore.v1.Get" + + "DocumentRequest\032\035.google.firestore.v1.Do" + + "cument\"8\202\323\344\223\0022\0220/v1/{name=projects/*/dat" + + "abases/*/documents/*/**}\022\365\001\n\rListDocumen" + + "ts\022).google.firestore.v1.ListDocumentsRe" + + "quest\032*.google.firestore.v1.ListDocument" + + "sResponse\"\214\001\202\323\344\223\002\205\001\022B/v1/{parent=project" + + "s/*/databases/*/documents/*/**}/{collect" + + "ion_id}Z?\022=/v1/{parent=projects/*/databa" + + "ses/*/documents}/{collection_id}\022\277\001\n\016Upd" + + "ateDocument\022*.google.firestore.v1.Update" + + "DocumentRequest\032\035.google.firestore.v1.Do" + + "cument\"b\332A\024document,update_mask\202\323\344\223\002E29/" + + "v1/{document.name=projects/*/databases/*" + + "/documents/*/**}:\010document\022\225\001\n\016DeleteDoc" + + "ument\022*.google.firestore.v1.DeleteDocume" + + "ntRequest\032\026.google.protobuf.Empty\"?\332A\004na" + + "me\202\323\344\223\0022*0/v1/{name=projects/*/databases" + + "/*/documents/*/**}\022\271\001\n\021BatchGetDocuments" + + "\022-.google.firestore.v1.BatchGetDocuments" + + "Request\032..google.firestore.v1.BatchGetDo" + + "cumentsResponse\"C\202\323\344\223\002=\"8/v1/{database=p" + + "rojects/*/databases/*}/documents:batchGe" + + "t:\001*0\001\022\307\001\n\020BeginTransaction\022,.google.fir" + + "estore.v1.BeginTransactionRequest\032-.goog" + + "le.firestore.v1.BeginTransactionResponse" + + "\"V\332A\010database\202\323\344\223\002E\"@/v1/{database=proje" + + "cts/*/databases/*}/documents:beginTransa" + + "ction:\001*\022\246\001\n\006Commit\022\".google.firestore.v" + + "1.CommitRequest\032#.google.firestore.v1.Co" + + "mmitResponse\"S\332A\017database,writes\202\323\344\223\002;\"6" + + "/v1/{database=projects/*/databases/*}/do" + + "cuments:commit:\001*\022\244\001\n\010Rollback\022$.google." + + "firestore.v1.RollbackRequest\032\026.google.pr" + + "otobuf.Empty\"Z\332A\024database,transaction\202\323\344" + + "\223\002=\"8/v1/{database=projects/*/databases/" + + "*}/documents:rollback:\001*\022\337\001\n\010RunQuery\022$." + + "google.firestore.v1.RunQueryRequest\032%.go" + + "ogle.firestore.v1.RunQueryResponse\"\203\001\202\323\344" + + "\223\002}\"6/v1/{parent=projects/*/databases/*/" + + "documents}:runQuery:\001*Z@\";/v1/{parent=pr" + + "ojects/*/databases/*/documents/*/**}:run" + + "Query:\001*0\001\022\227\002\n\023RunAggregationQuery\022/.goo" + + "gle.firestore.v1.RunAggregationQueryRequ" + + "est\0320.google.firestore.v1.RunAggregation" + + "QueryResponse\"\232\001\202\323\344\223\002\223\001\"A/v1/{parent=pro" + + "jects/*/databases/*/documents}:runAggreg" + + "ationQuery:\001*ZK\"F/v1/{parent=projects/*/" + + "databases/*/documents/*/**}:runAggregati" + + "onQuery:\001*0\001\022\374\001\n\016PartitionQuery\022*.google" + + ".firestore.v1.PartitionQueryRequest\032+.go" + + "ogle.firestore.v1.PartitionQueryResponse" + + "\"\220\001\202\323\344\223\002\211\001\" + * Planning phase information for the query. + * + * + * Protobuf type {@code google.firestore.v1.PlanSummary} + */ +public final class PlanSummary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.PlanSummary) + PlanSummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use PlanSummary.newBuilder() to construct. + private PlanSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PlanSummary() { + indexesUsed_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PlanSummary(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.PlanSummary.class, + com.google.firestore.v1.PlanSummary.Builder.class); + } + + public static final int INDEXES_USED_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List indexesUsed_; + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public java.util.List getIndexesUsedList() { + return indexesUsed_; + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public java.util.List + getIndexesUsedOrBuilderList() { + return indexesUsed_; + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public int getIndexesUsedCount() { + return indexesUsed_.size(); + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public com.google.protobuf.Struct getIndexesUsed(int index) { + return indexesUsed_.get(index); + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index) { + return indexesUsed_.get(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 { + for (int i = 0; i < indexesUsed_.size(); i++) { + output.writeMessage(1, indexesUsed_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < indexesUsed_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, indexesUsed_.get(i)); + } + size += getUnknownFields().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.firestore.v1.PlanSummary)) { + return super.equals(obj); + } + com.google.firestore.v1.PlanSummary other = (com.google.firestore.v1.PlanSummary) obj; + + if (!getIndexesUsedList().equals(other.getIndexesUsedList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getIndexesUsedCount() > 0) { + hash = (37 * hash) + INDEXES_USED_FIELD_NUMBER; + hash = (53 * hash) + getIndexesUsedList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.PlanSummary parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.PlanSummary parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.PlanSummary parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.PlanSummary 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.firestore.v1.PlanSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.PlanSummary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.PlanSummary parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.PlanSummary 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.firestore.v1.PlanSummary parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.PlanSummary 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.firestore.v1.PlanSummary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.PlanSummary 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.firestore.v1.PlanSummary 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; + } + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.PlanSummary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.PlanSummary) + com.google.firestore.v1.PlanSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.PlanSummary.class, + com.google.firestore.v1.PlanSummary.Builder.class); + } + + // Construct using com.google.firestore.v1.PlanSummary.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (indexesUsedBuilder_ == null) { + indexesUsed_ = java.util.Collections.emptyList(); + } else { + indexesUsed_ = null; + indexesUsedBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.PlanSummary getDefaultInstanceForType() { + return com.google.firestore.v1.PlanSummary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.PlanSummary build() { + com.google.firestore.v1.PlanSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.PlanSummary buildPartial() { + com.google.firestore.v1.PlanSummary result = new com.google.firestore.v1.PlanSummary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.firestore.v1.PlanSummary result) { + if (indexesUsedBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + indexesUsed_ = java.util.Collections.unmodifiableList(indexesUsed_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.indexesUsed_ = indexesUsed_; + } else { + result.indexesUsed_ = indexesUsedBuilder_.build(); + } + } + + private void buildPartial0(com.google.firestore.v1.PlanSummary result) { + int from_bitField0_ = bitField0_; + } + + @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.firestore.v1.PlanSummary) { + return mergeFrom((com.google.firestore.v1.PlanSummary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.PlanSummary other) { + if (other == com.google.firestore.v1.PlanSummary.getDefaultInstance()) return this; + if (indexesUsedBuilder_ == null) { + if (!other.indexesUsed_.isEmpty()) { + if (indexesUsed_.isEmpty()) { + indexesUsed_ = other.indexesUsed_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIndexesUsedIsMutable(); + indexesUsed_.addAll(other.indexesUsed_); + } + onChanged(); + } + } else { + if (!other.indexesUsed_.isEmpty()) { + if (indexesUsedBuilder_.isEmpty()) { + indexesUsedBuilder_.dispose(); + indexesUsedBuilder_ = null; + indexesUsed_ = other.indexesUsed_; + bitField0_ = (bitField0_ & ~0x00000001); + indexesUsedBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIndexesUsedFieldBuilder() + : null; + } else { + indexesUsedBuilder_.addAllMessages(other.indexesUsed_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Struct m = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(m); + } else { + indexesUsedBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List indexesUsed_ = + java.util.Collections.emptyList(); + + private void ensureIndexesUsedIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + indexesUsed_ = new java.util.ArrayList(indexesUsed_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + indexesUsedBuilder_; + + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List getIndexesUsedList() { + if (indexesUsedBuilder_ == null) { + return java.util.Collections.unmodifiableList(indexesUsed_); + } else { + return indexesUsedBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public int getIndexesUsedCount() { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.size(); + } else { + return indexesUsedBuilder_.getCount(); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct getIndexesUsed(int index) { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.get(index); + } else { + return indexesUsedBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder setIndexesUsed(int index, com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.set(index, value); + onChanged(); + } else { + indexesUsedBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder setIndexesUsed(int index, com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.set(index, builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.add(value); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(int index, com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.add(index, value); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(int index, com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(index, builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addAllIndexesUsed( + java.lang.Iterable values) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexesUsed_); + onChanged(); + } else { + indexesUsedBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder clearIndexesUsed() { + if (indexesUsedBuilder_ == null) { + indexesUsed_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + indexesUsedBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder removeIndexesUsed(int index) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.remove(index); + onChanged(); + } else { + indexesUsedBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder getIndexesUsedBuilder(int index) { + return getIndexesUsedFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index) { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.get(index); + } else { + return indexesUsedBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List + getIndexesUsedOrBuilderList() { + if (indexesUsedBuilder_ != null) { + return indexesUsedBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(indexesUsed_); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder addIndexesUsedBuilder() { + return getIndexesUsedFieldBuilder() + .addBuilder(com.google.protobuf.Struct.getDefaultInstance()); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder addIndexesUsedBuilder(int index) { + return getIndexesUsedFieldBuilder() + .addBuilder(index, com.google.protobuf.Struct.getDefaultInstance()); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List getIndexesUsedBuilderList() { + return getIndexesUsedFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getIndexesUsedFieldBuilder() { + if (indexesUsedBuilder_ == null) { + indexesUsedBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + indexesUsed_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + indexesUsed_ = null; + } + return indexesUsedBuilder_; + } + + @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.firestore.v1.PlanSummary) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.PlanSummary) + private static final com.google.firestore.v1.PlanSummary DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.PlanSummary(); + } + + public static com.google.firestore.v1.PlanSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PlanSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.firestore.v1.PlanSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PlanSummaryOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PlanSummaryOrBuilder.java new file mode 100644 index 0000000000..4f3c0d8f3d --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PlanSummaryOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2024 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/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public interface PlanSummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.PlanSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + java.util.List getIndexesUsedList(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + com.google.protobuf.Struct getIndexesUsed(int index); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + int getIndexesUsedCount(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + java.util.List getIndexesUsedOrBuilderList(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java new file mode 100644 index 0000000000..e1195e5d79 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java @@ -0,0 +1,128 @@ +/* + * Copyright 2024 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/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public final class QueryProfileProto { + private QueryProfileProto() {} + + 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_firestore_v1_ExplainOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ExplainOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ExplainMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ExplainMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_PlanSummary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_PlanSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ExecutionStats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ExecutionStats_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/firestore/v1/query_profile.prot" + + "o\022\023google.firestore.v1\032\037google/api/field" + + "_behavior.proto\032\036google/protobuf/duratio" + + "n.proto\032\034google/protobuf/struct.proto\"&\n" + + "\016ExplainOptions\022\024\n\007analyze\030\001 \001(\010B\003\340A\001\"\206\001" + + "\n\016ExplainMetrics\0226\n\014plan_summary\030\001 \001(\0132 " + + ".google.firestore.v1.PlanSummary\022<\n\017exec" + + "ution_stats\030\002 \001(\0132#.google.firestore.v1." + + "ExecutionStats\"<\n\013PlanSummary\022-\n\014indexes" + + "_used\030\001 \003(\0132\027.google.protobuf.Struct\"\250\001\n" + + "\016ExecutionStats\022\030\n\020results_returned\030\001 \001(" + + "\003\0225\n\022execution_duration\030\003 \001(\0132\031.google.p" + + "rotobuf.Duration\022\027\n\017read_operations\030\004 \001(" + + "\003\022,\n\013debug_stats\030\005 \001(\0132\027.google.protobuf" + + ".StructB\311\001\n\027com.google.firestore.v1B\021Que" + + "ryProfileProtoP\001Z;cloud.google.com/go/fi" + + "restore/apiv1/firestorepb;firestorepb\242\002\004" + + "GCFS\252\002\031Google.Cloud.Firestore.V1\312\002\031Googl" + + "e\\Cloud\\Firestore\\V1\352\002\034Google::Cloud::Fi" + + "restore::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_firestore_v1_ExplainOptions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_v1_ExplainOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_ExplainOptions_descriptor, + new java.lang.String[] { + "Analyze", + }); + internal_static_google_firestore_v1_ExplainMetrics_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_firestore_v1_ExplainMetrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_ExplainMetrics_descriptor, + new java.lang.String[] { + "PlanSummary", "ExecutionStats", + }); + internal_static_google_firestore_v1_PlanSummary_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_firestore_v1_PlanSummary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_PlanSummary_descriptor, + new java.lang.String[] { + "IndexesUsed", + }); + internal_static_google_firestore_v1_ExecutionStats_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_firestore_v1_ExecutionStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_ExecutionStats_descriptor, + new java.lang.String[] { + "ResultsReturned", "ExecutionDuration", "ReadOperations", "DebugStats", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java index 33f177901c..8e64caeffb 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java @@ -64,6 +64,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.firestore.v1.RunAggregationQueryRequest.Builder.class); } + private int bitField0_; private int queryTypeCase_ = 0; @SuppressWarnings("serial") @@ -437,6 +438,65 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } + public static final int EXPLAIN_OPTIONS_FIELD_NUMBER = 8; + private com.google.firestore.v1.ExplainOptions explainOptions_; + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + @java.lang.Override + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + @java.lang.Override + public com.google.firestore.v1.ExplainOptions getExplainOptions() { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -466,6 +526,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (consistencySelectorCase_ == 6) { output.writeMessage(6, (com.google.protobuf.Timestamp) consistencySelector_); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getExplainOptions()); + } getUnknownFields().writeTo(output); } @@ -498,6 +561,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 6, (com.google.protobuf.Timestamp) consistencySelector_); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getExplainOptions()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -515,6 +581,10 @@ public boolean equals(final java.lang.Object obj) { (com.google.firestore.v1.RunAggregationQueryRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (hasExplainOptions() != other.hasExplainOptions()) return false; + if (hasExplainOptions()) { + if (!getExplainOptions().equals(other.getExplainOptions())) return false; + } if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 2: @@ -551,6 +621,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + if (hasExplainOptions()) { + hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getExplainOptions().hashCode(); + } switch (queryTypeCase_) { case 2: hash = (37 * hash) + STRUCTURED_AGGREGATION_QUERY_FIELD_NUMBER; @@ -705,10 +779,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.firestore.v1.RunAggregationQueryRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExplainOptionsFieldBuilder(); + } } @java.lang.Override @@ -725,6 +808,11 @@ public Builder clear() { if (readTimeBuilder_ != null) { readTimeBuilder_.clear(); } + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } queryTypeCase_ = 0; queryType_ = null; consistencySelectorCase_ = 0; @@ -769,6 +857,13 @@ private void buildPartial0(com.google.firestore.v1.RunAggregationQueryRequest re if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.explainOptions_ = + explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.firestore.v1.RunAggregationQueryRequest result) { @@ -838,6 +933,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunAggregationQueryRequest othe bitField0_ |= 0x00000001; onChanged(); } + if (other.hasExplainOptions()) { + mergeExplainOptions(other.getExplainOptions()); + } switch (other.getQueryTypeCase()) { case STRUCTURED_AGGREGATION_QUERY: { @@ -927,6 +1025,12 @@ public Builder mergeFrom( consistencySelectorCase_ = 6; break; } // case 50 + case 66: + { + input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1889,6 +1993,219 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private com.google.firestore.v1.ExplainOptions explainOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder> + explainOptionsBuilder_; + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + public com.google.firestore.v1.ExplainOptions getExplainOptions() { + if (explainOptionsBuilder_ == null) { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } else { + return explainOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions(com.google.firestore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainOptions_ = value; + } else { + explainOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions( + com.google.firestore.v1.ExplainOptions.Builder builderForValue) { + if (explainOptionsBuilder_ == null) { + explainOptions_ = builderForValue.build(); + } else { + explainOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExplainOptions(com.google.firestore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && explainOptions_ != null + && explainOptions_ != com.google.firestore.v1.ExplainOptions.getDefaultInstance()) { + getExplainOptionsBuilder().mergeFrom(value); + } else { + explainOptions_ = value; + } + } else { + explainOptionsBuilder_.mergeFrom(value); + } + if (explainOptions_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExplainOptions() { + bitField0_ = (bitField0_ & ~0x00000020); + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getExplainOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + if (explainOptionsBuilder_ != null) { + return explainOptionsBuilder_.getMessageOrBuilder(); + } else { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder> + getExplainOptionsFieldBuilder() { + if (explainOptionsBuilder_ == null) { + explainOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder>( + getExplainOptions(), getParentForChildren(), isClean()); + explainOptions_ = null; + } + return explainOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java index a9a00c499a..b8a106b0bd 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java @@ -215,6 +215,50 @@ public interface RunAggregationQueryRequestOrBuilder */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + boolean hasExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + com.google.firestore.v1.ExplainOptions getExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder(); + com.google.firestore.v1.RunAggregationQueryRequest.QueryTypeCase getQueryTypeCase(); com.google.firestore.v1.RunAggregationQueryRequest.ConsistencySelectorCase diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java index 72f44e8898..7c34c1e213 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java @@ -209,6 +209,62 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; } + public static final int EXPLAIN_METRICS_FIELD_NUMBER = 10; + private com.google.firestore.v1.ExplainMetrics explainMetrics_; + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return Whether the explainMetrics field is set. + */ + @java.lang.Override + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return The explainMetrics. + */ + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics getExplainMetrics() { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + @java.lang.Override + public com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -232,6 +288,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getReadTime()); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getExplainMetrics()); + } getUnknownFields().writeTo(output); } @@ -250,6 +309,9 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReadTime()); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getExplainMetrics()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -275,6 +337,10 @@ public boolean equals(final java.lang.Object obj) { if (hasReadTime()) { if (!getReadTime().equals(other.getReadTime())) return false; } + if (hasExplainMetrics() != other.hasExplainMetrics()) return false; + if (hasExplainMetrics()) { + if (!getExplainMetrics().equals(other.getExplainMetrics())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -296,6 +362,10 @@ public int hashCode() { hash = (37 * hash) + READ_TIME_FIELD_NUMBER; hash = (53 * hash) + getReadTime().hashCode(); } + if (hasExplainMetrics()) { + hash = (37 * hash) + EXPLAIN_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getExplainMetrics().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -439,6 +509,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getResultFieldBuilder(); getReadTimeFieldBuilder(); + getExplainMetricsFieldBuilder(); } } @@ -457,6 +528,11 @@ public Builder clear() { readTimeBuilder_.dispose(); readTimeBuilder_ = null; } + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } return this; } @@ -505,6 +581,11 @@ private void buildPartial0(com.google.firestore.v1.RunAggregationQueryResponse r result.readTime_ = readTimeBuilder_ == null ? readTime_ : readTimeBuilder_.build(); to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.explainMetrics_ = + explainMetricsBuilder_ == null ? explainMetrics_ : explainMetricsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -563,6 +644,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunAggregationQueryResponse oth if (other.hasReadTime()) { mergeReadTime(other.getReadTime()); } + if (other.hasExplainMetrics()) { + mergeExplainMetrics(other.getExplainMetrics()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -607,6 +691,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 26 + case 82: + { + input.readMessage(getExplainMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1137,6 +1227,210 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private com.google.firestore.v1.ExplainMetrics explainMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder> + explainMetricsBuilder_; + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return Whether the explainMetrics field is set. + */ + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return The explainMetrics. + */ + public com.google.firestore.v1.ExplainMetrics getExplainMetrics() { + if (explainMetricsBuilder_ == null) { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } else { + return explainMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public Builder setExplainMetrics(com.google.firestore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainMetrics_ = value; + } else { + explainMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public Builder setExplainMetrics( + com.google.firestore.v1.ExplainMetrics.Builder builderForValue) { + if (explainMetricsBuilder_ == null) { + explainMetrics_ = builderForValue.build(); + } else { + explainMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public Builder mergeExplainMetrics(com.google.firestore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && explainMetrics_ != null + && explainMetrics_ != com.google.firestore.v1.ExplainMetrics.getDefaultInstance()) { + getExplainMetricsBuilder().mergeFrom(value); + } else { + explainMetrics_ = value; + } + } else { + explainMetricsBuilder_.mergeFrom(value); + } + if (explainMetrics_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public Builder clearExplainMetrics() { + bitField0_ = (bitField0_ & ~0x00000008); + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public com.google.firestore.v1.ExplainMetrics.Builder getExplainMetricsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getExplainMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + if (explainMetricsBuilder_ != null) { + return explainMetricsBuilder_.getMessageOrBuilder(); + } else { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder> + getExplainMetricsFieldBuilder() { + if (explainMetricsBuilder_ == null) { + explainMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder>( + getExplainMetrics(), getParentForChildren(), isClean()); + explainMetrics_ = null; + } + return explainMetricsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java index b78c4a7f22..11481cb307 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java @@ -136,4 +136,45 @@ public interface RunAggregationQueryResponseOrBuilder * .google.protobuf.Timestamp read_time = 3; */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return Whether the explainMetrics field is set. + */ + boolean hasExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return The explainMetrics. + */ + com.google.firestore.v1.ExplainMetrics getExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder(); } diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java index 1fc41e85b2..563a83190f 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java @@ -63,6 +63,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.firestore.v1.RunQueryRequest.Builder.class); } + private int bitField0_; private int queryTypeCase_ = 0; @SuppressWarnings("serial") @@ -435,6 +436,65 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } + public static final int EXPLAIN_OPTIONS_FIELD_NUMBER = 10; + private com.google.firestore.v1.ExplainOptions explainOptions_; + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + @java.lang.Override + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + @java.lang.Override + public com.google.firestore.v1.ExplainOptions getExplainOptions() { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -464,6 +524,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (consistencySelectorCase_ == 7) { output.writeMessage(7, (com.google.protobuf.Timestamp) consistencySelector_); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(10, getExplainOptions()); + } getUnknownFields().writeTo(output); } @@ -496,6 +559,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 7, (com.google.protobuf.Timestamp) consistencySelector_); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getExplainOptions()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -512,6 +578,10 @@ public boolean equals(final java.lang.Object obj) { com.google.firestore.v1.RunQueryRequest other = (com.google.firestore.v1.RunQueryRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (hasExplainOptions() != other.hasExplainOptions()) return false; + if (hasExplainOptions()) { + if (!getExplainOptions().equals(other.getExplainOptions())) return false; + } if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 2: @@ -547,6 +617,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + if (hasExplainOptions()) { + hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getExplainOptions().hashCode(); + } switch (queryTypeCase_) { case 2: hash = (37 * hash) + STRUCTURED_QUERY_FIELD_NUMBER; @@ -700,10 +774,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.firestore.v1.RunQueryRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExplainOptionsFieldBuilder(); + } } @java.lang.Override @@ -720,6 +803,11 @@ public Builder clear() { if (readTimeBuilder_ != null) { readTimeBuilder_.clear(); } + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } queryTypeCase_ = 0; queryType_ = null; consistencySelectorCase_ = 0; @@ -764,6 +852,13 @@ private void buildPartial0(com.google.firestore.v1.RunQueryRequest result) { if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.explainOptions_ = + explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.firestore.v1.RunQueryRequest result) { @@ -832,6 +927,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunQueryRequest other) { bitField0_ |= 0x00000001; onChanged(); } + if (other.hasExplainOptions()) { + mergeExplainOptions(other.getExplainOptions()); + } switch (other.getQueryTypeCase()) { case STRUCTURED_QUERY: { @@ -920,6 +1018,12 @@ public Builder mergeFrom( consistencySelectorCase_ = 7; break; } // case 58 + case 82: + { + input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1868,6 +1972,219 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private com.google.firestore.v1.ExplainOptions explainOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder> + explainOptionsBuilder_; + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + public com.google.firestore.v1.ExplainOptions getExplainOptions() { + if (explainOptionsBuilder_ == null) { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } else { + return explainOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions(com.google.firestore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainOptions_ = value; + } else { + explainOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions( + com.google.firestore.v1.ExplainOptions.Builder builderForValue) { + if (explainOptionsBuilder_ == null) { + explainOptions_ = builderForValue.build(); + } else { + explainOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExplainOptions(com.google.firestore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && explainOptions_ != null + && explainOptions_ != com.google.firestore.v1.ExplainOptions.getDefaultInstance()) { + getExplainOptionsBuilder().mergeFrom(value); + } else { + explainOptions_ = value; + } + } else { + explainOptionsBuilder_.mergeFrom(value); + } + if (explainOptions_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExplainOptions() { + bitField0_ = (bitField0_ & ~0x00000020); + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getExplainOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + if (explainOptionsBuilder_ != null) { + return explainOptionsBuilder_.getMessageOrBuilder(); + } else { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder> + getExplainOptionsFieldBuilder() { + if (explainOptionsBuilder_ == null) { + explainOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder>( + getExplainOptions(), getParentForChildren(), isClean()); + explainOptions_ = null; + } + return explainOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java index 1402e9c46e..d104c6d188 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java @@ -214,6 +214,50 @@ public interface RunQueryRequestOrBuilder */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + boolean hasExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + com.google.firestore.v1.ExplainOptions getExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder(); + com.google.firestore.v1.RunQueryRequest.QueryTypeCase getQueryTypeCase(); com.google.firestore.v1.RunQueryRequest.ConsistencySelectorCase getConsistencySelectorCase(); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java index 3a4d4d1a52..dc16b5f5ad 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java @@ -299,6 +299,62 @@ public boolean getDone() { return false; } + public static final int EXPLAIN_METRICS_FIELD_NUMBER = 11; + private com.google.firestore.v1.ExplainMetrics explainMetrics_; + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return Whether the explainMetrics field is set. + */ + @java.lang.Override + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return The explainMetrics. + */ + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics getExplainMetrics() { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + @java.lang.Override + public com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -328,6 +384,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (continuationSelectorCase_ == 6) { output.writeBool(6, (boolean) ((java.lang.Boolean) continuationSelector_)); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(11, getExplainMetrics()); + } getUnknownFields().writeTo(output); } @@ -354,6 +413,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 6, (boolean) ((java.lang.Boolean) continuationSelector_)); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExplainMetrics()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -379,6 +441,10 @@ public boolean equals(final java.lang.Object obj) { if (!getReadTime().equals(other.getReadTime())) return false; } if (getSkippedResults() != other.getSkippedResults()) return false; + if (hasExplainMetrics() != other.hasExplainMetrics()) return false; + if (hasExplainMetrics()) { + if (!getExplainMetrics().equals(other.getExplainMetrics())) return false; + } if (!getContinuationSelectorCase().equals(other.getContinuationSelectorCase())) return false; switch (continuationSelectorCase_) { case 6: @@ -410,6 +476,10 @@ public int hashCode() { } hash = (37 * hash) + SKIPPED_RESULTS_FIELD_NUMBER; hash = (53 * hash) + getSkippedResults(); + if (hasExplainMetrics()) { + hash = (37 * hash) + EXPLAIN_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getExplainMetrics().hashCode(); + } switch (continuationSelectorCase_) { case 6: hash = (37 * hash) + DONE_FIELD_NUMBER; @@ -561,6 +631,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getDocumentFieldBuilder(); getReadTimeFieldBuilder(); + getExplainMetricsFieldBuilder(); } } @@ -580,6 +651,11 @@ public Builder clear() { readTimeBuilder_ = null; } skippedResults_ = 0; + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } continuationSelectorCase_ = 0; continuationSelector_ = null; return this; @@ -634,6 +710,11 @@ private void buildPartial0(com.google.firestore.v1.RunQueryResponse result) { if (((from_bitField0_ & 0x00000008) != 0)) { result.skippedResults_ = skippedResults_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.explainMetrics_ = + explainMetricsBuilder_ == null ? explainMetrics_ : explainMetricsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -699,6 +780,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunQueryResponse other) { if (other.getSkippedResults() != 0) { setSkippedResults(other.getSkippedResults()); } + if (other.hasExplainMetrics()) { + mergeExplainMetrics(other.getExplainMetrics()); + } switch (other.getContinuationSelectorCase()) { case DONE: { @@ -766,6 +850,12 @@ public Builder mergeFrom( continuationSelectorCase_ = 6; break; } // case 48 + case 90: + { + input.readMessage(getExplainMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1416,6 +1506,210 @@ public Builder clearDone() { return this; } + private com.google.firestore.v1.ExplainMetrics explainMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder> + explainMetricsBuilder_; + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return Whether the explainMetrics field is set. + */ + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return The explainMetrics. + */ + public com.google.firestore.v1.ExplainMetrics getExplainMetrics() { + if (explainMetricsBuilder_ == null) { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } else { + return explainMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public Builder setExplainMetrics(com.google.firestore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainMetrics_ = value; + } else { + explainMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public Builder setExplainMetrics( + com.google.firestore.v1.ExplainMetrics.Builder builderForValue) { + if (explainMetricsBuilder_ == null) { + explainMetrics_ = builderForValue.build(); + } else { + explainMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public Builder mergeExplainMetrics(com.google.firestore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && explainMetrics_ != null + && explainMetrics_ != com.google.firestore.v1.ExplainMetrics.getDefaultInstance()) { + getExplainMetricsBuilder().mergeFrom(value); + } else { + explainMetrics_ = value; + } + } else { + explainMetricsBuilder_.mergeFrom(value); + } + if (explainMetrics_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public Builder clearExplainMetrics() { + bitField0_ = (bitField0_ & ~0x00000020); + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public com.google.firestore.v1.ExplainMetrics.Builder getExplainMetricsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getExplainMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + if (explainMetricsBuilder_ != null) { + return explainMetricsBuilder_.getMessageOrBuilder(); + } else { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder> + getExplainMetricsFieldBuilder() { + if (explainMetricsBuilder_ == null) { + explainMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder>( + getExplainMetrics(), getParentForChildren(), isClean()); + explainMetrics_ = null; + } + return explainMetricsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java index f5c0f202a1..2c37bf0463 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java @@ -170,5 +170,46 @@ public interface RunQueryResponseOrBuilder */ boolean getDone(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return Whether the explainMetrics field is set. + */ + boolean hasExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return The explainMetrics. + */ + com.google.firestore.v1.ExplainMetrics getExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder(); + com.google.firestore.v1.RunQueryResponse.ContinuationSelectorCase getContinuationSelectorCase(); } diff --git a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto index 3b843eed58..8d78ce4f45 100644 --- a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto +++ b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto @@ -23,6 +23,7 @@ import "google/firestore/v1/aggregation_result.proto"; import "google/firestore/v1/common.proto"; import "google/firestore/v1/document.proto"; import "google/firestore/v1/query.proto"; +import "google/firestore/v1/query_profile.proto"; import "google/firestore/v1/write.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; @@ -576,6 +577,10 @@ message RunQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 7; } + + // Optional. Explain options for the query. If set, additional query + // statistics will be returned. If not, only query results will be returned. + ExplainOptions explain_options = 10 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -612,6 +617,11 @@ message RunQueryResponse { // documents will be returned. bool done = 6; } + + // Query explain metrics. This is only present when the + // [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] + // is provided, and it is sent only once with the last response in the stream. + ExplainMetrics explain_metrics = 11; } // The request for @@ -651,6 +661,10 @@ message RunAggregationQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 6; } + + // Optional. Explain options for the query. If set, additional query + // statistics will be returned. If not, only query results will be returned. + ExplainOptions explain_options = 8 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -676,6 +690,11 @@ message RunAggregationQueryResponse { // `result` will be sent, and this represents the time at which the query // was run. google.protobuf.Timestamp read_time = 3; + + // Query explain metrics. This is only present when the + // [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] + // is provided, and it is sent only once with the last response in the stream. + ExplainMetrics explain_metrics = 10; } // The request for diff --git a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto new file mode 100644 index 0000000000..931e083b02 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto @@ -0,0 +1,92 @@ +// Copyright 2023 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.firestore.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb"; +option java_multiple_files = true; +option java_outer_classname = "QueryProfileProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; +option ruby_package = "Google::Cloud::Firestore::V1"; + +// Specification of the Firestore Query Profile fields. + +// Explain options for the query. +message ExplainOptions { + // Optional. Whether to execute this query. + // + // When false (the default), the query will be planned, returning only + // metrics from the planning stages. + // + // When true, the query will be planned and executed, returning the full + // query results along with both planning and execution stage metrics. + bool analyze = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Explain metrics for the query. +message ExplainMetrics { + // Planning phase information for the query. + PlanSummary plan_summary = 1; + + // Aggregated stats from the execution of the query. Only present when + // [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set + // to true. + ExecutionStats execution_stats = 2; +} + +// Planning phase information for the query. +message PlanSummary { + // The indexes selected for the query. For example: + // [ + // {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + // {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + // ] + repeated google.protobuf.Struct indexes_used = 1; +} + +// Execution statistics for the query. +message ExecutionStats { + // Total number of results returned, including documents, projections, + // aggregation results, keys. + int64 results_returned = 1; + + // Total time to execute the query in the backend. + google.protobuf.Duration execution_duration = 3; + + // Total billable read operations. + int64 read_operations = 4; + + // Debugging statistics from the execution of the query. Note that the + // debugging stats are subject to change as Firestore evolves. It could + // include: + // { + // "indexes_entries_scanned": "1000", + // "documents_scanned": "20", + // "billing_details" : { + // "documents_billable": "20", + // "index_entries_billable": "1000", + // "min_query_cost": "0" + // } + // } + google.protobuf.Struct debug_stats = 5; +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 65aeee0d9d..91602531cd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud google-cloud-firestore - 3.17.1 + 3.18.0 diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 4eca4021ca..964efdfb34 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -32,7 +32,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> com.google.cloud libraries-bom - 26.33.0 + 26.34.0 pom import diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 29dd2d9f0e..be07baf80a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-firestore - 3.17.1 + 3.18.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 658b6a08ac..eeeac489fb 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -34,7 +34,7 @@ com.google.cloud libraries-bom - 26.33.0 + 26.34.0 pom import diff --git a/versions.txt b/versions.txt index 38072e0543..e7b91bd9f9 100644 --- a/versions.txt +++ b/versions.txt @@ -1,11 +1,11 @@ # Format: # module:released-version:current-version -google-cloud-firestore:3.18.0:3.18.0 -google-cloud-firestore-admin:3.18.0:3.18.0 -google-cloud-firestore-bom:3.18.0:3.18.0 -grpc-google-cloud-firestore-admin-v1:3.18.0:3.18.0 -grpc-google-cloud-firestore-v1:3.18.0:3.18.0 -proto-google-cloud-firestore-admin-v1:3.18.0:3.18.0 -proto-google-cloud-firestore-v1:3.18.0:3.18.0 -proto-google-cloud-firestore-bundle-v1:3.18.0:3.18.0 +google-cloud-firestore:3.19.0:3.19.0 +google-cloud-firestore-admin:3.19.0:3.19.0 +google-cloud-firestore-bom:3.19.0:3.19.0 +grpc-google-cloud-firestore-admin-v1:3.19.0:3.19.0 +grpc-google-cloud-firestore-v1:3.19.0:3.19.0 +proto-google-cloud-firestore-admin-v1:3.19.0:3.19.0 +proto-google-cloud-firestore-v1:3.19.0:3.19.0 +proto-google-cloud-firestore-bundle-v1:3.19.0:3.19.0