diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh index 3b890a76b..92efcf881 100644 --- a/.github/scripts/update_generation_config.sh +++ b/.github/scripts/update_generation_config.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -ex # This script should be run at the root of the repository. # This script is used to update googleapis_commitish, gapic_generator_version, # and libraries_bom_version in generation configuration at the time of running diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index 5a97a4380..02d55be1f 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -37,7 +37,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - - uses: googleapis/sdk-platform-java/.github/scripts@v2.61.0 + - uses: googleapis/sdk-platform-java/.github/scripts@v2.62.0 if: env.SHOULD_RUN == 'true' with: base_ref: ${{ github.base_ref }} diff --git a/README.md b/README.md index 28c681315..3ca17327b 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ 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.64.0') +implementation platform('com.google.cloud:libraries-bom:26.66.0') implementation 'com.google.cloud:google-cloud-firestore' ``` diff --git a/generation_config.yaml b/generation_config.yaml index 2411188ba..100946d8d 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ -gapic_generator_version: 2.60.2 -googleapis_commitish: fb0d8ac09cd1c2d94e9da572f0ad4692c8781410 -libraries_bom_version: 26.64.0 +gapic_generator_version: 2.62.0 +googleapis_commitish: 3b2a2ae91db23a9c879b2b725d6a5de6bd64a800 +libraries_bom_version: 26.66.0 libraries: - api_shortname: firestore name_pretty: Cloud Firestore 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 b8ba405de..9566e963e 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 @@ -38,6 +38,8 @@ import com.google.firestore.admin.v1.BulkDeleteDocumentsMetadata; import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; +import com.google.firestore.admin.v1.CloneDatabaseMetadata; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CollectionGroupName; import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; @@ -755,6 +757,23 @@ * * * + * + *

CloneDatabase + *

Creates a new database by cloning an existing one. + *

The new database must be in the same cloud region or multi-region location as the existing database. This behaves similar to [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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 database. + *

The [long-running operation][google.longrunning.Operation] can be used to track the progress of the clone, with the Operation's [metadata][google.longrunning.Operation.metadata] field type being the [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. The [response][google.longrunning.Operation.response] type is the [Database][google.firestore.admin.v1.Database] if the clone 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.

+ * + * + * * * *

See the individual methods for example code. @@ -4990,6 +5009,143 @@ public final UnaryCallable deleteBackupSched return stub.deleteBackupScheduleCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new database by cloning an existing one. + * + *

The new database must be in the same cloud region or multi-region location as the existing + * database. This behaves similar to + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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 database. + * + *

The [long-running operation][google.longrunning.Operation] can be used to track the progress + * of the clone, with the Operation's [metadata][google.longrunning.Operation.metadata] field type + * being the [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. The + * [response][google.longrunning.Operation.response] type is the + * [Database][google.firestore.admin.v1.Database] if the clone 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()) {
+   *   CloneDatabaseRequest request =
+   *       CloneDatabaseRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDatabaseId("databaseId1688905718")
+   *           .setPitrSnapshot(PitrSnapshot.newBuilder().build())
+   *           .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
+   *           .putAllTags(new HashMap())
+   *           .build();
+   *   Database response = firestoreAdminClient.cloneDatabaseAsync(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 cloneDatabaseAsync( + CloneDatabaseRequest request) { + return cloneDatabaseOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new database by cloning an existing one. + * + *

The new database must be in the same cloud region or multi-region location as the existing + * database. This behaves similar to + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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 database. + * + *

The [long-running operation][google.longrunning.Operation] can be used to track the progress + * of the clone, with the Operation's [metadata][google.longrunning.Operation.metadata] field type + * being the [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. The + * [response][google.longrunning.Operation.response] type is the + * [Database][google.firestore.admin.v1.Database] if the clone 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()) {
+   *   CloneDatabaseRequest request =
+   *       CloneDatabaseRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDatabaseId("databaseId1688905718")
+   *           .setPitrSnapshot(PitrSnapshot.newBuilder().build())
+   *           .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
+   *           .putAllTags(new HashMap())
+   *           .build();
+   *   OperationFuture future =
+   *       firestoreAdminClient.cloneDatabaseOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Database response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + cloneDatabaseOperationCallable() { + return stub.cloneDatabaseOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new database by cloning an existing one. + * + *

The new database must be in the same cloud region or multi-region location as the existing + * database. This behaves similar to + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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 database. + * + *

The [long-running operation][google.longrunning.Operation] can be used to track the progress + * of the clone, with the Operation's [metadata][google.longrunning.Operation.metadata] field type + * being the [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. The + * [response][google.longrunning.Operation.response] type is the + * [Database][google.firestore.admin.v1.Database] if the clone 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()) {
+   *   CloneDatabaseRequest request =
+   *       CloneDatabaseRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDatabaseId("databaseId1688905718")
+   *           .setPitrSnapshot(PitrSnapshot.newBuilder().build())
+   *           .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
+   *           .putAllTags(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.cloneDatabaseCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable cloneDatabaseCallable() { + return stub.cloneDatabaseCallable(); + } + @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 b8e9a8d4c..d93c63875 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 @@ -38,6 +38,8 @@ import com.google.firestore.admin.v1.BulkDeleteDocumentsMetadata; import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; +import com.google.firestore.admin.v1.CloneDatabaseMetadata; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; @@ -388,6 +390,17 @@ public UnaryCallSettings deleteBackupSchedul return ((FirestoreAdminStubSettings) getStubSettings()).deleteBackupScheduleSettings(); } + /** Returns the object with the settings used for calls to cloneDatabase. */ + public UnaryCallSettings cloneDatabaseSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).cloneDatabaseSettings(); + } + + /** Returns the object with the settings used for calls to cloneDatabase. */ + public OperationCallSettings + cloneDatabaseOperationSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).cloneDatabaseOperationSettings(); + } + public static final FirestoreAdminSettings create(FirestoreAdminStubSettings stub) throws IOException { return new FirestoreAdminSettings.Builder(stub.toBuilder()).build(); @@ -725,6 +738,17 @@ public UnaryCallSettings.Builder restoreDatab return getStubSettingsBuilder().deleteBackupScheduleSettings(); } + /** Returns the builder for the settings used for calls to cloneDatabase. */ + public UnaryCallSettings.Builder cloneDatabaseSettings() { + return getStubSettingsBuilder().cloneDatabaseSettings(); + } + + /** Returns the builder for the settings used for calls to cloneDatabase. */ + public OperationCallSettings.Builder + cloneDatabaseOperationSettings() { + return getStubSettingsBuilder().cloneDatabaseOperationSettings(); + } + @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 a7fee2258..da56c4232 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 @@ -13,6 +13,9 @@ "BulkDeleteDocuments": { "methods": ["bulkDeleteDocumentsAsync", "bulkDeleteDocumentsAsync", "bulkDeleteDocumentsAsync", "bulkDeleteDocumentsOperationCallable", "bulkDeleteDocumentsCallable"] }, + "CloneDatabase": { + "methods": ["cloneDatabaseAsync", "cloneDatabaseOperationCallable", "cloneDatabaseCallable"] + }, "CreateBackupSchedule": { "methods": ["createBackupSchedule", "createBackupSchedule", "createBackupSchedule", "createBackupScheduleCallable"] }, 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 a9d213d26..6b4d728db 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 @@ -27,6 +27,8 @@ import com.google.firestore.admin.v1.BulkDeleteDocumentsMetadata; import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; +import com.google.firestore.admin.v1.CloneDatabaseMetadata; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; @@ -278,6 +280,15 @@ public UnaryCallable deleteBackupScheduleCal throw new UnsupportedOperationException("Not implemented: deleteBackupScheduleCallable()"); } + public OperationCallable + cloneDatabaseOperationCallable() { + throw new UnsupportedOperationException("Not implemented: cloneDatabaseOperationCallable()"); + } + + public UnaryCallable cloneDatabaseCallable() { + throw new UnsupportedOperationException("Not implemented: cloneDatabaseCallable()"); + } + @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 f827a3451..a8ddabc23 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 @@ -58,6 +58,8 @@ import com.google.firestore.admin.v1.BulkDeleteDocumentsMetadata; import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; +import com.google.firestore.admin.v1.CloneDatabaseMetadata; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; @@ -259,6 +261,9 @@ public class FirestoreAdminStubSettings extends StubSettings updateBackupScheduleSettings; private final UnaryCallSettings deleteBackupScheduleSettings; + private final UnaryCallSettings cloneDatabaseSettings; + private final OperationCallSettings + cloneDatabaseOperationSettings; private static final PagedListDescriptor LIST_INDEXES_PAGE_STR_DESC = @@ -578,6 +583,17 @@ public UnaryCallSettings deleteBackupSchedul return deleteBackupScheduleSettings; } + /** Returns the object with the settings used for calls to cloneDatabase. */ + public UnaryCallSettings cloneDatabaseSettings() { + return cloneDatabaseSettings; + } + + /** Returns the object with the settings used for calls to cloneDatabase. */ + public OperationCallSettings + cloneDatabaseOperationSettings() { + return cloneDatabaseOperationSettings; + } + public FirestoreAdminStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -730,6 +746,8 @@ protected FirestoreAdminStubSettings(Builder settingsBuilder) throws IOException listBackupSchedulesSettings = settingsBuilder.listBackupSchedulesSettings().build(); updateBackupScheduleSettings = settingsBuilder.updateBackupScheduleSettings().build(); deleteBackupScheduleSettings = settingsBuilder.deleteBackupScheduleSettings().build(); + cloneDatabaseSettings = settingsBuilder.cloneDatabaseSettings().build(); + cloneDatabaseOperationSettings = settingsBuilder.cloneDatabaseOperationSettings().build(); } /** Builder for FirestoreAdminStubSettings. */ @@ -814,6 +832,10 @@ public static class Builder extends StubSettings.Builder deleteBackupScheduleSettings; + private final UnaryCallSettings.Builder cloneDatabaseSettings; + private final OperationCallSettings.Builder< + CloneDatabaseRequest, Database, CloneDatabaseMetadata> + cloneDatabaseOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -919,6 +941,8 @@ protected Builder(ClientContext clientContext) { listBackupSchedulesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + cloneDatabaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + cloneDatabaseOperationSettings = OperationCallSettings.newBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -952,7 +976,8 @@ protected Builder(ClientContext clientContext) { getBackupScheduleSettings, listBackupSchedulesSettings, updateBackupScheduleSettings, - deleteBackupScheduleSettings); + deleteBackupScheduleSettings, + cloneDatabaseSettings); initDefaults(this); } @@ -1000,6 +1025,8 @@ protected Builder(FirestoreAdminStubSettings settings) { listBackupSchedulesSettings = settings.listBackupSchedulesSettings.toBuilder(); updateBackupScheduleSettings = settings.updateBackupScheduleSettings.toBuilder(); deleteBackupScheduleSettings = settings.deleteBackupScheduleSettings.toBuilder(); + cloneDatabaseSettings = settings.cloneDatabaseSettings.toBuilder(); + cloneDatabaseOperationSettings = settings.cloneDatabaseOperationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -1033,7 +1060,8 @@ protected Builder(FirestoreAdminStubSettings settings) { getBackupScheduleSettings, listBackupSchedulesSettings, updateBackupScheduleSettings, - deleteBackupScheduleSettings); + deleteBackupScheduleSettings, + cloneDatabaseSettings); } private static Builder createDefault() { @@ -1216,6 +1244,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .cloneDatabaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + builder .createIndexOperationSettings() .setInitialCallSettings( @@ -1432,6 +1465,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeoutDuration(Duration.ofMillis(300000L)) .build())); + builder + .cloneDatabaseOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Database.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CloneDatabaseMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + return builder; } @@ -1675,6 +1732,17 @@ public UnaryCallSettings.Builder restoreDatab return deleteBackupScheduleSettings; } + /** Returns the builder for the settings used for calls to cloneDatabase. */ + public UnaryCallSettings.Builder cloneDatabaseSettings() { + return cloneDatabaseSettings; + } + + /** Returns the builder for the settings used for calls to cloneDatabase. */ + public OperationCallSettings.Builder + cloneDatabaseOperationSettings() { + return cloneDatabaseOperationSettings; + } + @Override public FirestoreAdminStubSettings build() throws IOException { return new FirestoreAdminStubSettings(this); 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 5e5b8ced9..71d6ecb37 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,11 +27,14 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; import com.google.firestore.admin.v1.Backup; import com.google.firestore.admin.v1.BackupSchedule; import com.google.firestore.admin.v1.BulkDeleteDocumentsMetadata; import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; +import com.google.firestore.admin.v1.CloneDatabaseMetadata; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; @@ -104,6 +107,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/CreateIndex") .setRequestMarshaller(ProtoUtils.marshaller(CreateIndexRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -114,6 +118,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller(ProtoUtils.marshaller(ListIndexesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListIndexesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getIndexMethodDescriptor = @@ -122,6 +127,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetIndex") .setRequestMarshaller(ProtoUtils.marshaller(GetIndexRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Index.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteIndexMethodDescriptor = @@ -130,6 +136,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteIndex") .setRequestMarshaller(ProtoUtils.marshaller(DeleteIndexRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getFieldMethodDescriptor = @@ -138,6 +145,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetField") .setRequestMarshaller(ProtoUtils.marshaller(GetFieldRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Field.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateFieldMethodDescriptor = @@ -146,6 +154,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/UpdateField") .setRequestMarshaller(ProtoUtils.marshaller(UpdateFieldRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -155,6 +164,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListFields") .setRequestMarshaller(ProtoUtils.marshaller(ListFieldsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListFieldsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -165,6 +175,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(ExportDocumentsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -175,6 +186,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(ImportDocumentsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -185,6 +197,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(BulkDeleteDocumentsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -195,6 +208,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateDatabaseRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getDatabaseMethodDescriptor = @@ -203,6 +217,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetDatabase") .setRequestMarshaller(ProtoUtils.marshaller(GetDatabaseRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Database.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -214,6 +229,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { ProtoUtils.marshaller(ListDatabasesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListDatabasesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -224,6 +240,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateDatabaseRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -234,6 +251,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteDatabaseRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -244,6 +262,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateUserCredsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(UserCreds.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -253,6 +272,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetUserCreds") .setRequestMarshaller(ProtoUtils.marshaller(GetUserCredsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(UserCreds.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -264,6 +284,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { ProtoUtils.marshaller(ListUserCredsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListUserCredsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -274,6 +295,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(EnableUserCredsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(UserCreds.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -284,6 +306,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(DisableUserCredsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(UserCreds.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -294,6 +317,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(ResetUserPasswordRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(UserCreds.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -304,6 +328,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteUserCredsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getBackupMethodDescriptor = @@ -312,6 +337,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackup") .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -322,6 +348,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteBackupMethodDescriptor = @@ -330,6 +357,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackup") .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -340,6 +368,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(RestoreDatabaseRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -350,6 +379,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateBackupScheduleRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -360,6 +390,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(GetBackupScheduleRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -371,6 +402,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { ProtoUtils.marshaller(ListBackupSchedulesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListBackupSchedulesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -381,6 +413,7 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateBackupScheduleRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -391,6 +424,18 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteBackupScheduleRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + cloneDatabaseMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/CloneDatabase") + .setRequestMarshaller( + ProtoUtils.marshaller(CloneDatabaseRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable createIndexCallable; @@ -450,11 +495,19 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { private final UnaryCallable updateBackupScheduleCallable; private final UnaryCallable deleteBackupScheduleCallable; + private final UnaryCallable cloneDatabaseCallable; + private final OperationCallable + cloneDatabaseOperationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; + private static final PathTemplate CLONE_DATABASE_0_PATH_TEMPLATE = + PathTemplate.create("projects/{project_id=*}/**"); + private static final PathTemplate CLONE_DATABASE_1_PATH_TEMPLATE = + PathTemplate.create("projects/*/databases/{database_id=*}/**"); + public static final GrpcFirestoreAdminStub create(FirestoreAdminStubSettings settings) throws IOException { return new GrpcFirestoreAdminStub(settings, ClientContext.create(settings)); @@ -810,6 +863,27 @@ protected GrpcFirestoreAdminStub( return builder.build(); }) .build(); + GrpcCallSettings cloneDatabaseTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(cloneDatabaseMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + if (request.getPitrSnapshot() != null) { + builder.add( + request.getPitrSnapshot().getDatabase(), + "project_id", + CLONE_DATABASE_0_PATH_TEMPLATE); + } + if (request.getPitrSnapshot() != null) { + builder.add( + request.getPitrSnapshot().getDatabase(), + "database_id", + CLONE_DATABASE_1_PATH_TEMPLATE); + } + return builder.build(); + }) + .build(); this.createIndexCallable = callableFactory.createUnaryCallable( @@ -978,6 +1052,15 @@ protected GrpcFirestoreAdminStub( deleteBackupScheduleTransportSettings, settings.deleteBackupScheduleSettings(), clientContext); + this.cloneDatabaseCallable = + callableFactory.createUnaryCallable( + cloneDatabaseTransportSettings, settings.cloneDatabaseSettings(), clientContext); + this.cloneDatabaseOperationCallable = + callableFactory.createOperationCallable( + cloneDatabaseTransportSettings, + settings.cloneDatabaseOperationSettings(), + clientContext, + operationsStub); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -1208,6 +1291,17 @@ public UnaryCallable deleteBackupScheduleCal return deleteBackupScheduleCallable; } + @Override + public UnaryCallable cloneDatabaseCallable() { + return cloneDatabaseCallable; + } + + @Override + public OperationCallable + cloneDatabaseOperationCallable() { + return cloneDatabaseOperationCallable; + } + @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 b50ad60b2..94cc5d5b6 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 @@ -35,12 +35,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.api.pathtemplate.PathTemplate; 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.BulkDeleteDocumentsMetadata; import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; +import com.google.firestore.admin.v1.CloneDatabaseMetadata; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseMetadata; import com.google.firestore.admin.v1.CreateDatabaseRequest; @@ -125,6 +128,7 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { .add(Index.getDescriptor()) .add(CreateDatabaseMetadata.getDescriptor()) .add(ExportDocumentsMetadata.getDescriptor()) + .add(CloneDatabaseMetadata.getDescriptor()) .add(IndexOperationMetadata.getDescriptor()) .build(); @@ -1268,6 +1272,46 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { .build()) .build(); + private static final ApiMethodDescriptor + cloneDatabaseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/CloneDatabase") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*}/databases:clone", + 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( + (CloneDatabaseRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private final UnaryCallable createIndexCallable; private final OperationCallable createIndexOperationCallable; @@ -1325,11 +1369,19 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { private final UnaryCallable updateBackupScheduleCallable; private final UnaryCallable deleteBackupScheduleCallable; + private final UnaryCallable cloneDatabaseCallable; + private final OperationCallable + cloneDatabaseOperationCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; private final HttpJsonStubCallableFactory callableFactory; + private static final PathTemplate CLONE_DATABASE_0_PATH_TEMPLATE = + PathTemplate.create("projects/{project_id=*}/**"); + private static final PathTemplate CLONE_DATABASE_1_PATH_TEMPLATE = + PathTemplate.create("projects/*/databases/{database_id=*}/**"); + public static final HttpJsonFirestoreAdminStub create(FirestoreAdminStubSettings settings) throws IOException { return new HttpJsonFirestoreAdminStub(settings, ClientContext.create(settings)); @@ -1747,6 +1799,28 @@ protected HttpJsonFirestoreAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings cloneDatabaseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(cloneDatabaseMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + if (request.getPitrSnapshot() != null) { + builder.add( + request.getPitrSnapshot().getDatabase(), + "project_id", + CLONE_DATABASE_0_PATH_TEMPLATE); + } + if (request.getPitrSnapshot() != null) { + builder.add( + request.getPitrSnapshot().getDatabase(), + "database_id", + CLONE_DATABASE_1_PATH_TEMPLATE); + } + return builder.build(); + }) + .build(); this.createIndexCallable = callableFactory.createUnaryCallable( @@ -1915,6 +1989,15 @@ protected HttpJsonFirestoreAdminStub( deleteBackupScheduleTransportSettings, settings.deleteBackupScheduleSettings(), clientContext); + this.cloneDatabaseCallable = + callableFactory.createUnaryCallable( + cloneDatabaseTransportSettings, settings.cloneDatabaseSettings(), clientContext); + this.cloneDatabaseOperationCallable = + callableFactory.createOperationCallable( + cloneDatabaseTransportSettings, + settings.cloneDatabaseOperationSettings(), + clientContext, + httpJsonOperationsStub); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -1954,6 +2037,7 @@ public static List getMethodDescriptors() { methodDescriptors.add(listBackupSchedulesMethodDescriptor); methodDescriptors.add(updateBackupScheduleMethodDescriptor); methodDescriptors.add(deleteBackupScheduleMethodDescriptor); + methodDescriptors.add(cloneDatabaseMethodDescriptor); return methodDescriptors; } @@ -2182,6 +2266,17 @@ public UnaryCallable deleteBackupScheduleCal return deleteBackupScheduleCallable; } + @Override + public UnaryCallable cloneDatabaseCallable() { + return cloneDatabaseCallable; + } + + @Override + public OperationCallable + cloneDatabaseOperationCallable() { + return cloneDatabaseOperationCallable; + } + @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 a7a386dca..bf9e73e32 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 @@ -377,6 +377,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.api.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.api.RubySettings", "queryAllDeclaredConstructors": true, @@ -602,6 +638,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.CloneDatabaseMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.CloneDatabaseMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.CloneDatabaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.CloneDatabaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.CreateBackupScheduleRequest", "queryAllDeclaredConstructors": true, @@ -1772,6 +1844,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.PitrSnapshot", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.PitrSnapshot$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.Progress", "queryAllDeclaredConstructors": true, 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 f19ae2618..3e9277cbe 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 @@ -35,6 +35,7 @@ import com.google.firestore.admin.v1.BackupSchedule; import com.google.firestore.admin.v1.BackupScheduleName; import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CollectionGroupName; import com.google.firestore.admin.v1.Database; import com.google.firestore.admin.v1.DatabaseName; @@ -50,6 +51,7 @@ import com.google.firestore.admin.v1.ListIndexesResponse; import com.google.firestore.admin.v1.ListUserCredsResponse; import com.google.firestore.admin.v1.LocationName; +import com.google.firestore.admin.v1.PitrSnapshot; import com.google.firestore.admin.v1.ProjectName; import com.google.firestore.admin.v1.RestoreDatabaseRequest; import com.google.firestore.admin.v1.UserCreds; @@ -3021,4 +3023,81 @@ public void deleteBackupScheduleExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void cloneDatabaseTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) + .setKeyPrefix("keyPrefix-2076395055") + .setCmekConfig(Database.CmekConfig.newBuilder().build()) + .setPreviousId("previousId-32447886") + .setSourceInfo(Database.SourceInfo.newBuilder().build()) + .putAllTags(new HashMap()) + .setFreeTier(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("cloneDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + CloneDatabaseRequest request = + CloneDatabaseRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDatabaseId("databaseId1688905718") + .setPitrSnapshot(PitrSnapshot.newBuilder().build()) + .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build()) + .putAllTags(new HashMap()) + .build(); + + Database actualResponse = client.cloneDatabaseAsync(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 cloneDatabaseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CloneDatabaseRequest request = + CloneDatabaseRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDatabaseId("databaseId1688905718") + .setPitrSnapshot(PitrSnapshot.newBuilder().build()) + .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build()) + .putAllTags(new HashMap()) + .build(); + client.cloneDatabaseAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } } 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 114e6bc19..b77c01a34 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 @@ -34,6 +34,7 @@ import com.google.firestore.admin.v1.BackupScheduleName; import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CollectionGroupName; import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseRequest; @@ -74,6 +75,7 @@ import com.google.firestore.admin.v1.ListUserCredsRequest; import com.google.firestore.admin.v1.ListUserCredsResponse; import com.google.firestore.admin.v1.LocationName; +import com.google.firestore.admin.v1.PitrSnapshot; import com.google.firestore.admin.v1.ProjectName; import com.google.firestore.admin.v1.ResetUserPasswordRequest; import com.google.firestore.admin.v1.RestoreDatabaseRequest; @@ -2703,4 +2705,82 @@ public void deleteBackupScheduleExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void cloneDatabaseTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) + .setKeyPrefix("keyPrefix-2076395055") + .setCmekConfig(Database.CmekConfig.newBuilder().build()) + .setPreviousId("previousId-32447886") + .setSourceInfo(Database.SourceInfo.newBuilder().build()) + .putAllTags(new HashMap()) + .setFreeTier(true) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("cloneDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFirestoreAdmin.addResponse(resultOperation); + + CloneDatabaseRequest request = + CloneDatabaseRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDatabaseId("databaseId1688905718") + .setPitrSnapshot(PitrSnapshot.newBuilder().build()) + .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build()) + .putAllTags(new HashMap()) + .build(); + + Database actualResponse = client.cloneDatabaseAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CloneDatabaseRequest actualRequest = ((CloneDatabaseRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getDatabaseId(), actualRequest.getDatabaseId()); + Assert.assertEquals(request.getPitrSnapshot(), actualRequest.getPitrSnapshot()); + Assert.assertEquals(request.getEncryptionConfig(), actualRequest.getEncryptionConfig()); + Assert.assertEquals(request.getTagsMap(), actualRequest.getTagsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void cloneDatabaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + CloneDatabaseRequest request = + CloneDatabaseRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDatabaseId("databaseId1688905718") + .setPitrSnapshot(PitrSnapshot.newBuilder().build()) + .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build()) + .putAllTags(new HashMap()) + .build(); + client.cloneDatabaseAsync(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()); + } + } } 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 965014aa8..2ead333ca 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 @@ -20,6 +20,7 @@ import com.google.firestore.admin.v1.Backup; import com.google.firestore.admin.v1.BackupSchedule; import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; +import com.google.firestore.admin.v1.CloneDatabaseRequest; import com.google.firestore.admin.v1.CreateBackupScheduleRequest; import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; @@ -749,4 +750,25 @@ public void deleteBackupSchedule( Exception.class.getName()))); } } + + @Override + public void cloneDatabase( + CloneDatabaseRequest 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 CloneDatabase, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java index c0717e8c1..af599fd61 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java @@ -79,6 +79,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setFullMethodName("google.firestore.v1.Firestore/GetDocument") .setRequestMarshaller(ProtoUtils.marshaller(GetDocumentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -90,6 +91,7 @@ public class GrpcFirestoreStub extends FirestoreStub { ProtoUtils.marshaller(ListDocumentsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListDocumentsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -100,6 +102,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateDocumentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -110,6 +113,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteDocumentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -121,6 +125,7 @@ public class GrpcFirestoreStub extends FirestoreStub { ProtoUtils.marshaller(BatchGetDocumentsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(BatchGetDocumentsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -132,6 +137,7 @@ public class GrpcFirestoreStub extends FirestoreStub { ProtoUtils.marshaller(BeginTransactionRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(BeginTransactionResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor commitMethodDescriptor = @@ -140,6 +146,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setFullMethodName("google.firestore.v1.Firestore/Commit") .setRequestMarshaller(ProtoUtils.marshaller(CommitRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CommitResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor rollbackMethodDescriptor = @@ -148,6 +155,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setFullMethodName("google.firestore.v1.Firestore/Rollback") .setRequestMarshaller(ProtoUtils.marshaller(RollbackRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -157,6 +165,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setFullMethodName("google.firestore.v1.Firestore/RunQuery") .setRequestMarshaller(ProtoUtils.marshaller(RunQueryRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(RunQueryResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -168,6 +177,7 @@ public class GrpcFirestoreStub extends FirestoreStub { ProtoUtils.marshaller(RunAggregationQueryRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(RunAggregationQueryResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -179,6 +189,7 @@ public class GrpcFirestoreStub extends FirestoreStub { ProtoUtils.marshaller(PartitionQueryRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(PartitionQueryResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor writeMethodDescriptor = @@ -187,6 +198,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setFullMethodName("google.firestore.v1.Firestore/Write") .setRequestMarshaller(ProtoUtils.marshaller(WriteRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(WriteResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor listenMethodDescriptor = @@ -195,6 +207,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setFullMethodName("google.firestore.v1.Firestore/Listen") .setRequestMarshaller(ProtoUtils.marshaller(ListenRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListenResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -206,6 +219,7 @@ public class GrpcFirestoreStub extends FirestoreStub { ProtoUtils.marshaller(ListCollectionIdsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListCollectionIdsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -215,6 +229,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setFullMethodName("google.firestore.v1.Firestore/BatchWrite") .setRequestMarshaller(ProtoUtils.marshaller(BatchWriteRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BatchWriteResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -225,6 +240,7 @@ public class GrpcFirestoreStub extends FirestoreStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateDocumentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable getDocumentCallable; 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 a7771461e..a8e23a2c1 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 @@ -1443,6 +1443,49 @@ private FirestoreAdminGrpc() {} return getDeleteBackupScheduleMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CloneDatabaseRequest, com.google.longrunning.Operation> + getCloneDatabaseMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CloneDatabase", + requestType = com.google.firestore.admin.v1.CloneDatabaseRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CloneDatabaseRequest, com.google.longrunning.Operation> + getCloneDatabaseMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CloneDatabaseRequest, com.google.longrunning.Operation> + getCloneDatabaseMethod; + if ((getCloneDatabaseMethod = FirestoreAdminGrpc.getCloneDatabaseMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getCloneDatabaseMethod = FirestoreAdminGrpc.getCloneDatabaseMethod) == null) { + FirestoreAdminGrpc.getCloneDatabaseMethod = + getCloneDatabaseMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CloneDatabase")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.CloneDatabaseRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("CloneDatabase")) + .build(); + } + } + } + return getCloneDatabaseMethod; + } + /** 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 = @@ -2024,6 +2067,34 @@ default void deleteBackupSchedule( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getDeleteBackupScheduleMethod(), responseObserver); } + + /** + * + * + *
+     * Creates a new database by cloning an existing one.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing database. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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
+     * database.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the clone, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the clone was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
+     * 
+ */ + default void cloneDatabase( + com.google.firestore.admin.v1.CloneDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCloneDatabaseMethod(), responseObserver); + } } /** @@ -2655,6 +2726,36 @@ public void deleteBackupSchedule( request, responseObserver); } + + /** + * + * + *
+     * Creates a new database by cloning an existing one.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing database. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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
+     * database.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the clone, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the clone was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
+     * 
+ */ + public void cloneDatabase( + com.google.firestore.admin.v1.CloneDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCloneDatabaseMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -3158,6 +3259,33 @@ public com.google.protobuf.Empty deleteBackupSchedule( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteBackupScheduleMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Creates a new database by cloning an existing one.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing database. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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
+     * database.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the clone, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the clone was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
+     * 
+ */ + public com.google.longrunning.Operation cloneDatabase( + com.google.firestore.admin.v1.CloneDatabaseRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCloneDatabaseMethod(), getCallOptions(), request); + } } /** @@ -3661,6 +3789,33 @@ public com.google.protobuf.Empty deleteBackupSchedule( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteBackupScheduleMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Creates a new database by cloning an existing one.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing database. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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
+     * database.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the clone, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the clone was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
+     * 
+ */ + public com.google.longrunning.Operation cloneDatabase( + com.google.firestore.admin.v1.CloneDatabaseRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCloneDatabaseMethod(), getCallOptions(), request); + } } /** @@ -4179,6 +4334,33 @@ protected FirestoreAdminFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteBackupScheduleMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Creates a new database by cloning an existing one.
+     * The new database must be in the same cloud region or multi-region location
+     * as the existing database. This behaves similar to
+     * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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
+     * database.
+     * The [long-running operation][google.longrunning.Operation] can be used to
+     * track the progress of the clone, with the Operation's
+     * [metadata][google.longrunning.Operation.metadata] field type being the
+     * [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata].
+     * The [response][google.longrunning.Operation.response] type is the
+     * [Database][google.firestore.admin.v1.Database] if the clone was
+     * successful. The new database is not readable or writeable until the LRO has
+     * completed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + cloneDatabase(com.google.firestore.admin.v1.CloneDatabaseRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCloneDatabaseMethod(), getCallOptions()), request); + } } private static final int METHODID_CREATE_INDEX = 0; @@ -4212,6 +4394,7 @@ protected FirestoreAdminFutureStub build( private static final int METHODID_LIST_BACKUP_SCHEDULES = 28; private static final int METHODID_UPDATE_BACKUP_SCHEDULE = 29; private static final int METHODID_DELETE_BACKUP_SCHEDULE = 30; + private static final int METHODID_CLONE_DATABASE = 31; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -4401,6 +4584,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.firestore.admin.v1.DeleteBackupScheduleRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_CLONE_DATABASE: + serviceImpl.cloneDatabase( + (com.google.firestore.admin.v1.CloneDatabaseRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -4615,6 +4803,12 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.firestore.admin.v1.DeleteBackupScheduleRequest, com.google.protobuf.Empty>(service, METHODID_DELETE_BACKUP_SCHEDULE))) + .addMethod( + getCloneDatabaseMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.CloneDatabaseRequest, + com.google.longrunning.Operation>(service, METHODID_CLONE_DATABASE))) .build(); } @@ -4697,6 +4891,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListBackupSchedulesMethod()) .addMethod(getUpdateBackupScheduleMethod()) .addMethod(getDeleteBackupScheduleMethod()) + .addMethod(getCloneDatabaseMethod()) .build(); } } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseMetadata.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseMetadata.java new file mode 100644 index 000000000..ab1c5c99f --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseMetadata.java @@ -0,0 +1,1915 @@ +/* + * Copyright 2025 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.8 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Metadata for the [long-running operation][google.longrunning.Operation] from
+ * the [CloneDatabase][google.firestore.admin.v1.CloneDatabase] request.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.CloneDatabaseMetadata} + */ +public final class CloneDatabaseMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.CloneDatabaseMetadata) + CloneDatabaseMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CloneDatabaseMetadata.newBuilder() to construct. + private CloneDatabaseMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloneDatabaseMetadata() { + operationState_ = 0; + database_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloneDatabaseMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_CloneDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_CloneDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.CloneDatabaseMetadata.class, + com.google.firestore.admin.v1.CloneDatabaseMetadata.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time the clone 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 clone 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 clone 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 clone finished, unset for ongoing clones.
+   * 
+ * + * .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 clone finished, unset for ongoing clones.
+   * 
+ * + * .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 clone finished, unset for ongoing clones.
+   * 
+ * + * .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 clone.
+   * 
+ * + * .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 clone.
+   * 
+ * + * .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 cloned 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 cloned 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 PITR_SNAPSHOT_FIELD_NUMBER = 7; + private com.google.firestore.admin.v1.PitrSnapshot pitrSnapshot_; + + /** + * + * + *
+   * The snapshot from which this database was cloned.
+   * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + * + * @return Whether the pitrSnapshot field is set. + */ + @java.lang.Override + public boolean hasPitrSnapshot() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The snapshot from which this database was cloned.
+   * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + * + * @return The pitrSnapshot. + */ + @java.lang.Override + public com.google.firestore.admin.v1.PitrSnapshot getPitrSnapshot() { + return pitrSnapshot_ == null + ? com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance() + : pitrSnapshot_; + } + + /** + * + * + *
+   * The snapshot from which this database was cloned.
+   * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + @java.lang.Override + public com.google.firestore.admin.v1.PitrSnapshotOrBuilder getPitrSnapshotOrBuilder() { + return pitrSnapshot_ == null + ? com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance() + : pitrSnapshot_; + } + + public static final int PROGRESS_PERCENTAGE_FIELD_NUMBER = 6; + private com.google.firestore.admin.v1.Progress progressPercentage_; + + /** + * + * + *
+   * How far along the clone is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + * + * @return Whether the progressPercentage field is set. + */ + @java.lang.Override + public boolean hasProgressPercentage() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * How far along the clone is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + * + * @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 clone is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + @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 (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getProgressPercentage()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getPitrSnapshot()); + } + 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 (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getProgressPercentage()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getPitrSnapshot()); + } + 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.CloneDatabaseMetadata)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.CloneDatabaseMetadata other = + (com.google.firestore.admin.v1.CloneDatabaseMetadata) 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 (hasPitrSnapshot() != other.hasPitrSnapshot()) return false; + if (hasPitrSnapshot()) { + if (!getPitrSnapshot().equals(other.getPitrSnapshot())) 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(); + if (hasPitrSnapshot()) { + hash = (37 * hash) + PITR_SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getPitrSnapshot().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.CloneDatabaseMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CloneDatabaseMetadata 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.CloneDatabaseMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CloneDatabaseMetadata 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.CloneDatabaseMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CloneDatabaseMetadata 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.CloneDatabaseMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.CloneDatabaseMetadata 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.CloneDatabaseMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.CloneDatabaseMetadata 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.CloneDatabaseMetadata 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.CloneDatabaseMetadata 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.CloneDatabaseMetadata 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 [CloneDatabase][google.firestore.admin.v1.CloneDatabase] request.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.CloneDatabaseMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.CloneDatabaseMetadata) + com.google.firestore.admin.v1.CloneDatabaseMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_CloneDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_CloneDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.CloneDatabaseMetadata.class, + com.google.firestore.admin.v1.CloneDatabaseMetadata.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.CloneDatabaseMetadata.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(); + getPitrSnapshotFieldBuilder(); + 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_ = ""; + pitrSnapshot_ = null; + if (pitrSnapshotBuilder_ != null) { + pitrSnapshotBuilder_.dispose(); + pitrSnapshotBuilder_ = null; + } + 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_CloneDatabaseMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.CloneDatabaseMetadata getDefaultInstanceForType() { + return com.google.firestore.admin.v1.CloneDatabaseMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.CloneDatabaseMetadata build() { + com.google.firestore.admin.v1.CloneDatabaseMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.CloneDatabaseMetadata buildPartial() { + com.google.firestore.admin.v1.CloneDatabaseMetadata result = + new com.google.firestore.admin.v1.CloneDatabaseMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.CloneDatabaseMetadata 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.pitrSnapshot_ = + pitrSnapshotBuilder_ == null ? pitrSnapshot_ : pitrSnapshotBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.progressPercentage_ = + progressPercentageBuilder_ == null + ? progressPercentage_ + : progressPercentageBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + 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.CloneDatabaseMetadata) { + return mergeFrom((com.google.firestore.admin.v1.CloneDatabaseMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.CloneDatabaseMetadata other) { + if (other == com.google.firestore.admin.v1.CloneDatabaseMetadata.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.hasPitrSnapshot()) { + mergePitrSnapshot(other.getPitrSnapshot()); + } + 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 50: + { + input.readMessage( + getProgressPercentageFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getPitrSnapshotFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + 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 clone 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 clone 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 clone 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 clone 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 clone 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 clone 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 clone was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time the clone 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 clone 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 clone finished, unset for ongoing clones.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time the clone finished, unset for ongoing clones.
+     * 
+ * + * .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 clone finished, unset for ongoing clones.
+     * 
+ * + * .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 clone finished, unset for ongoing clones.
+     * 
+ * + * .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 clone finished, unset for ongoing clones.
+     * 
+ * + * .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 clone finished, unset for ongoing clones.
+     * 
+ * + * .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 clone finished, unset for ongoing clones.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time the clone finished, unset for ongoing clones.
+     * 
+ * + * .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 clone finished, unset for ongoing clones.
+     * 
+ * + * .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 clone.
+     * 
+ * + * .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 clone.
+     * 
+ * + * .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 clone.
+     * 
+ * + * .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 clone.
+     * 
+ * + * .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 clone.
+     * 
+ * + * .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 cloned 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 cloned 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 cloned 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 cloned 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 cloned 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 com.google.firestore.admin.v1.PitrSnapshot pitrSnapshot_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.PitrSnapshot, + com.google.firestore.admin.v1.PitrSnapshot.Builder, + com.google.firestore.admin.v1.PitrSnapshotOrBuilder> + pitrSnapshotBuilder_; + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + * + * @return Whether the pitrSnapshot field is set. + */ + public boolean hasPitrSnapshot() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + * + * @return The pitrSnapshot. + */ + public com.google.firestore.admin.v1.PitrSnapshot getPitrSnapshot() { + if (pitrSnapshotBuilder_ == null) { + return pitrSnapshot_ == null + ? com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance() + : pitrSnapshot_; + } else { + return pitrSnapshotBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + public Builder setPitrSnapshot(com.google.firestore.admin.v1.PitrSnapshot value) { + if (pitrSnapshotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pitrSnapshot_ = value; + } else { + pitrSnapshotBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + public Builder setPitrSnapshot( + com.google.firestore.admin.v1.PitrSnapshot.Builder builderForValue) { + if (pitrSnapshotBuilder_ == null) { + pitrSnapshot_ = builderForValue.build(); + } else { + pitrSnapshotBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + public Builder mergePitrSnapshot(com.google.firestore.admin.v1.PitrSnapshot value) { + if (pitrSnapshotBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && pitrSnapshot_ != null + && pitrSnapshot_ != com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance()) { + getPitrSnapshotBuilder().mergeFrom(value); + } else { + pitrSnapshot_ = value; + } + } else { + pitrSnapshotBuilder_.mergeFrom(value); + } + if (pitrSnapshot_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + public Builder clearPitrSnapshot() { + bitField0_ = (bitField0_ & ~0x00000010); + pitrSnapshot_ = null; + if (pitrSnapshotBuilder_ != null) { + pitrSnapshotBuilder_.dispose(); + pitrSnapshotBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + public com.google.firestore.admin.v1.PitrSnapshot.Builder getPitrSnapshotBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getPitrSnapshotFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + public com.google.firestore.admin.v1.PitrSnapshotOrBuilder getPitrSnapshotOrBuilder() { + if (pitrSnapshotBuilder_ != null) { + return pitrSnapshotBuilder_.getMessageOrBuilder(); + } else { + return pitrSnapshot_ == null + ? com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance() + : pitrSnapshot_; + } + } + + /** + * + * + *
+     * The snapshot from which this database was cloned.
+     * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.PitrSnapshot, + com.google.firestore.admin.v1.PitrSnapshot.Builder, + com.google.firestore.admin.v1.PitrSnapshotOrBuilder> + getPitrSnapshotFieldBuilder() { + if (pitrSnapshotBuilder_ == null) { + pitrSnapshotBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.PitrSnapshot, + com.google.firestore.admin.v1.PitrSnapshot.Builder, + com.google.firestore.admin.v1.PitrSnapshotOrBuilder>( + getPitrSnapshot(), getParentForChildren(), isClean()); + pitrSnapshot_ = null; + } + return pitrSnapshotBuilder_; + } + + 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 clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + * + * @return Whether the progressPercentage field is set. + */ + public boolean hasProgressPercentage() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * How far along the clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + * + * @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 clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + 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 clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + 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 clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + 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 clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + public Builder clearProgressPercentage() { + bitField0_ = (bitField0_ & ~0x00000020); + progressPercentage_ = null; + if (progressPercentageBuilder_ != null) { + progressPercentageBuilder_.dispose(); + progressPercentageBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * How far along the clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressPercentageBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getProgressPercentageFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * How far along the clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + 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 clone is as an estimated percentage of remaining time.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + 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.CloneDatabaseMetadata) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.CloneDatabaseMetadata) + private static final com.google.firestore.admin.v1.CloneDatabaseMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.CloneDatabaseMetadata(); + } + + public static com.google.firestore.admin.v1.CloneDatabaseMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloneDatabaseMetadata 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.CloneDatabaseMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseMetadataOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseMetadataOrBuilder.java new file mode 100644 index 000000000..d1215f645 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseMetadataOrBuilder.java @@ -0,0 +1,226 @@ +/* + * Copyright 2025 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.8 +package com.google.firestore.admin.v1; + +public interface CloneDatabaseMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.CloneDatabaseMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time the clone was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time the clone was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time the clone was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time the clone finished, unset for ongoing clones.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The time the clone finished, unset for ongoing clones.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The time the clone finished, unset for ongoing clones.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The operation state of the clone.
+   * 
+ * + * .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 clone.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + * + * @return The operationState. + */ + com.google.firestore.admin.v1.OperationState getOperationState(); + + /** + * + * + *
+   * The name of the database being cloned to.
+   * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * The name of the database being cloned to.
+   * 
+ * + * string database = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * The snapshot from which this database was cloned.
+   * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + * + * @return Whether the pitrSnapshot field is set. + */ + boolean hasPitrSnapshot(); + + /** + * + * + *
+   * The snapshot from which this database was cloned.
+   * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + * + * @return The pitrSnapshot. + */ + com.google.firestore.admin.v1.PitrSnapshot getPitrSnapshot(); + + /** + * + * + *
+   * The snapshot from which this database was cloned.
+   * 
+ * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 7; + */ + com.google.firestore.admin.v1.PitrSnapshotOrBuilder getPitrSnapshotOrBuilder(); + + /** + * + * + *
+   * How far along the clone is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + * + * @return Whether the progressPercentage field is set. + */ + boolean hasProgressPercentage(); + + /** + * + * + *
+   * How far along the clone is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + * + * @return The progressPercentage. + */ + com.google.firestore.admin.v1.Progress getProgressPercentage(); + + /** + * + * + *
+   * How far along the clone is as an estimated percentage of remaining time.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_percentage = 6; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressPercentageOrBuilder(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseRequest.java new file mode 100644 index 000000000..8b5f3fcfa --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseRequest.java @@ -0,0 +1,2029 @@ +/* + * Copyright 2025 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.8 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request message for
+ * [FirestoreAdmin.CloneDatabase][google.firestore.admin.v1.FirestoreAdmin.CloneDatabase].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.CloneDatabaseRequest} + */ +public final class CloneDatabaseRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.CloneDatabaseRequest) + CloneDatabaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CloneDatabaseRequest.newBuilder() to construct. + private CloneDatabaseRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloneDatabaseRequest() { + parent_ = ""; + databaseId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloneDatabaseRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CloneDatabaseRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CloneDatabaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.CloneDatabaseRequest.class, + com.google.firestore.admin.v1.CloneDatabaseRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The project to clone 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 clone 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 PITR_SNAPSHOT_FIELD_NUMBER = 6; + private com.google.firestore.admin.v1.PitrSnapshot pitrSnapshot_; + + /** + * + * + *
+   * Required. Specification of the PITR data to clone from. The source database
+   * must exist.
+   *
+   * The cloned database will be created in the same location as the source
+   * database.
+   * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pitrSnapshot field is set. + */ + @java.lang.Override + public boolean hasPitrSnapshot() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Specification of the PITR data to clone from. The source database
+   * must exist.
+   *
+   * The cloned database will be created in the same location as the source
+   * database.
+   * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pitrSnapshot. + */ + @java.lang.Override + public com.google.firestore.admin.v1.PitrSnapshot getPitrSnapshot() { + return pitrSnapshot_ == null + ? com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance() + : pitrSnapshot_; + } + + /** + * + * + *
+   * Required. Specification of the PITR data to clone from. The source database
+   * must exist.
+   *
+   * The cloned database will be created in the same location as the source
+   * database.
+   * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.firestore.admin.v1.PitrSnapshotOrBuilder getPitrSnapshotOrBuilder() { + return pitrSnapshot_ == null + ? com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance() + : pitrSnapshot_; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 4; + private com.google.firestore.admin.v1.Database.EncryptionConfig encryptionConfig_; + + /** + * + * + *
+   * Optional. Encryption configuration for the cloned database.
+   *
+   * If this field is not specified, the cloned database will use
+   * the same encryption configuration as the source database, namely
+   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+   * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Encryption configuration for the cloned database.
+   *
+   * If this field is not specified, the cloned database will use
+   * the same encryption configuration as the source database, namely
+   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+   * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Database.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + /** + * + * + *
+   * Optional. Encryption configuration for the cloned database.
+   *
+   * If this field is not specified, the cloned database will use
+   * the same encryption configuration as the source database, namely
+   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+   * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + public static final int TAGS_FIELD_NUMBER = 5; + + private static final class TagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CloneDatabaseRequest_TagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getEncryptionConfig()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetTags(), TagsDefaultEntryHolder.defaultEntry, 5); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getPitrSnapshot()); + } + 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 (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEncryptionConfig()); + } + for (java.util.Map.Entry entry : + internalGetTags().getMap().entrySet()) { + com.google.protobuf.MapEntry tags__ = + TagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, tags__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPitrSnapshot()); + } + 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.CloneDatabaseRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.CloneDatabaseRequest other = + (com.google.firestore.admin.v1.CloneDatabaseRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getDatabaseId().equals(other.getDatabaseId())) return false; + if (hasPitrSnapshot() != other.hasPitrSnapshot()) return false; + if (hasPitrSnapshot()) { + if (!getPitrSnapshot().equals(other.getPitrSnapshot())) return false; + } + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (!internalGetTags().equals(other.internalGetTags())) 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(); + if (hasPitrSnapshot()) { + hash = (37 * hash) + PITR_SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getPitrSnapshot().hashCode(); + } + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + if (!internalGetTags().getMap().isEmpty()) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTags().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.CloneDatabaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CloneDatabaseRequest 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.CloneDatabaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CloneDatabaseRequest 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.CloneDatabaseRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.CloneDatabaseRequest 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.CloneDatabaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.CloneDatabaseRequest 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.CloneDatabaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.CloneDatabaseRequest 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.CloneDatabaseRequest 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.CloneDatabaseRequest 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.CloneDatabaseRequest 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.CloneDatabase][google.firestore.admin.v1.FirestoreAdmin.CloneDatabase].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.CloneDatabaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.CloneDatabaseRequest) + com.google.firestore.admin.v1.CloneDatabaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CloneDatabaseRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CloneDatabaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.CloneDatabaseRequest.class, + com.google.firestore.admin.v1.CloneDatabaseRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.CloneDatabaseRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPitrSnapshotFieldBuilder(); + getEncryptionConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + databaseId_ = ""; + pitrSnapshot_ = null; + if (pitrSnapshotBuilder_ != null) { + pitrSnapshotBuilder_.dispose(); + pitrSnapshotBuilder_ = null; + } + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + internalGetMutableTags().clear(); + 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_CloneDatabaseRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.CloneDatabaseRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.CloneDatabaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.CloneDatabaseRequest build() { + com.google.firestore.admin.v1.CloneDatabaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.CloneDatabaseRequest buildPartial() { + com.google.firestore.admin.v1.CloneDatabaseRequest result = + new com.google.firestore.admin.v1.CloneDatabaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.CloneDatabaseRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.databaseId_ = databaseId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pitrSnapshot_ = + pitrSnapshotBuilder_ == null ? pitrSnapshot_ : pitrSnapshotBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.tags_ = internalGetTags(); + result.tags_.makeImmutable(); + } + 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.CloneDatabaseRequest) { + return mergeFrom((com.google.firestore.admin.v1.CloneDatabaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.CloneDatabaseRequest other) { + if (other == com.google.firestore.admin.v1.CloneDatabaseRequest.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.hasPitrSnapshot()) { + mergePitrSnapshot(other.getPitrSnapshot()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + internalGetMutableTags().mergeFrom(other.internalGetTags()); + bitField0_ |= 0x00000010; + 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 34: + { + input.readMessage( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry tags__ = + input.readMessage( + TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTags().getMutableMap().put(tags__.getKey(), tags__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getPitrSnapshotFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 50 + 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 clone 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 clone 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 clone 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 clone 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 clone 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 com.google.firestore.admin.v1.PitrSnapshot pitrSnapshot_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.PitrSnapshot, + com.google.firestore.admin.v1.PitrSnapshot.Builder, + com.google.firestore.admin.v1.PitrSnapshotOrBuilder> + pitrSnapshotBuilder_; + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pitrSnapshot field is set. + */ + public boolean hasPitrSnapshot() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pitrSnapshot. + */ + public com.google.firestore.admin.v1.PitrSnapshot getPitrSnapshot() { + if (pitrSnapshotBuilder_ == null) { + return pitrSnapshot_ == null + ? com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance() + : pitrSnapshot_; + } else { + return pitrSnapshotBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPitrSnapshot(com.google.firestore.admin.v1.PitrSnapshot value) { + if (pitrSnapshotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pitrSnapshot_ = value; + } else { + pitrSnapshotBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPitrSnapshot( + com.google.firestore.admin.v1.PitrSnapshot.Builder builderForValue) { + if (pitrSnapshotBuilder_ == null) { + pitrSnapshot_ = builderForValue.build(); + } else { + pitrSnapshotBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePitrSnapshot(com.google.firestore.admin.v1.PitrSnapshot value) { + if (pitrSnapshotBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && pitrSnapshot_ != null + && pitrSnapshot_ != com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance()) { + getPitrSnapshotBuilder().mergeFrom(value); + } else { + pitrSnapshot_ = value; + } + } else { + pitrSnapshotBuilder_.mergeFrom(value); + } + if (pitrSnapshot_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPitrSnapshot() { + bitField0_ = (bitField0_ & ~0x00000004); + pitrSnapshot_ = null; + if (pitrSnapshotBuilder_ != null) { + pitrSnapshotBuilder_.dispose(); + pitrSnapshotBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.firestore.admin.v1.PitrSnapshot.Builder getPitrSnapshotBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getPitrSnapshotFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.firestore.admin.v1.PitrSnapshotOrBuilder getPitrSnapshotOrBuilder() { + if (pitrSnapshotBuilder_ != null) { + return pitrSnapshotBuilder_.getMessageOrBuilder(); + } else { + return pitrSnapshot_ == null + ? com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance() + : pitrSnapshot_; + } + } + + /** + * + * + *
+     * Required. Specification of the PITR data to clone from. The source database
+     * must exist.
+     *
+     * The cloned database will be created in the same location as the source
+     * database.
+     * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.PitrSnapshot, + com.google.firestore.admin.v1.PitrSnapshot.Builder, + com.google.firestore.admin.v1.PitrSnapshotOrBuilder> + getPitrSnapshotFieldBuilder() { + if (pitrSnapshotBuilder_ == null) { + pitrSnapshotBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.PitrSnapshot, + com.google.firestore.admin.v1.PitrSnapshot.Builder, + com.google.firestore.admin.v1.PitrSnapshotOrBuilder>( + getPitrSnapshot(), getParentForChildren(), isClean()); + pitrSnapshot_ = null; + } + return pitrSnapshotBuilder_; + } + + private com.google.firestore.admin.v1.Database.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Database.EncryptionConfig, + com.google.firestore.admin.v1.Database.EncryptionConfig.Builder, + com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + public com.google.firestore.admin.v1.Database.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.firestore.admin.v1.Database.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEncryptionConfig( + com.google.firestore.admin.v1.Database.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEncryptionConfig( + com.google.firestore.admin.v1.Database.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + if (encryptionConfig_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000008); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.admin.v1.Database.EncryptionConfig.Builder + getEncryptionConfigBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + + /** + * + * + *
+     * Optional. Encryption configuration for the cloned database.
+     *
+     * If this field is not specified, the cloned database will use
+     * the same encryption configuration as the source database, namely
+     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+     * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Database.EncryptionConfig, + com.google.firestore.admin.v1.Database.EncryptionConfig.Builder, + com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Database.EncryptionConfig, + com.google.firestore.admin.v1.Database.EncryptionConfig.Builder, + com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + private com.google.protobuf.MapField + internalGetMutableTags() { + if (tags_ == null) { + tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry); + } + if (!tags_.isMutable()) { + tags_ = tags_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+     * Optional. Immutable. Tags to be bound to the cloned database.
+     *
+     * The tags should be provided in the format of
+     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+     * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+     * Optional. Immutable. Tags to be bound to the cloned database.
+     *
+     * The tags should be provided in the format of
+     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+     * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+     * Optional. Immutable. Tags to be bound to the cloned database.
+     *
+     * The tags should be provided in the format of
+     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+     * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. Immutable. Tags to be bound to the cloned database.
+     *
+     * The tags should be provided in the format of
+     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+     * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTags() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableTags().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. Tags to be bound to the cloned database.
+     *
+     * The tags should be provided in the format of
+     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+     * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTags().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTags() { + bitField0_ |= 0x00000010; + return internalGetMutableTags().getMutableMap(); + } + + /** + * + * + *
+     * Optional. Immutable. Tags to be bound to the cloned database.
+     *
+     * The tags should be provided in the format of
+     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+     * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putTags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableTags().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
+     * Optional. Immutable. Tags to be bound to the cloned database.
+     *
+     * The tags should be provided in the format of
+     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+     * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllTags(java.util.Map values) { + internalGetMutableTags().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + 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.CloneDatabaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.CloneDatabaseRequest) + private static final com.google.firestore.admin.v1.CloneDatabaseRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.CloneDatabaseRequest(); + } + + public static com.google.firestore.admin.v1.CloneDatabaseRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloneDatabaseRequest 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.CloneDatabaseRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseRequestOrBuilder.java new file mode 100644 index 000000000..25920dbe4 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CloneDatabaseRequestOrBuilder.java @@ -0,0 +1,298 @@ +/* + * Copyright 2025 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.8 +package com.google.firestore.admin.v1; + +public interface CloneDatabaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.CloneDatabaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project to clone 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 clone 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. Specification of the PITR data to clone from. The source database
+   * must exist.
+   *
+   * The cloned database will be created in the same location as the source
+   * database.
+   * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the pitrSnapshot field is set. + */ + boolean hasPitrSnapshot(); + + /** + * + * + *
+   * Required. Specification of the PITR data to clone from. The source database
+   * must exist.
+   *
+   * The cloned database will be created in the same location as the source
+   * database.
+   * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The pitrSnapshot. + */ + com.google.firestore.admin.v1.PitrSnapshot getPitrSnapshot(); + + /** + * + * + *
+   * Required. Specification of the PITR data to clone from. The source database
+   * must exist.
+   *
+   * The cloned database will be created in the same location as the source
+   * database.
+   * 
+ * + * + * .google.firestore.admin.v1.PitrSnapshot pitr_snapshot = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.firestore.admin.v1.PitrSnapshotOrBuilder getPitrSnapshotOrBuilder(); + + /** + * + * + *
+   * Optional. Encryption configuration for the cloned database.
+   *
+   * If this field is not specified, the cloned database will use
+   * the same encryption configuration as the source database, namely
+   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+   * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + + /** + * + * + *
+   * Optional. Encryption configuration for the cloned database.
+   *
+   * If this field is not specified, the cloned database will use
+   * the same encryption configuration as the source database, namely
+   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+   * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The encryptionConfig. + */ + com.google.firestore.admin.v1.Database.EncryptionConfig getEncryptionConfig(); + + /** + * + * + *
+   * Optional. Encryption configuration for the cloned database.
+   *
+   * If this field is not specified, the cloned database will use
+   * the same encryption configuration as the source database, namely
+   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
+   * 
+ * + * + * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + int getTagsCount(); + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsTags(java.lang.String key); + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTags(); + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getTagsMap(); + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. Immutable. Tags to be bound to the cloned database.
+   *
+   * The tags should be provided in the format of
+   * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
+   * 
+ * + * + * map<string, string> tags = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getTagsOrThrow(java.lang.String key); +} 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 020aab137..1f0f97495 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 @@ -196,6 +196,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_TagsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_TagsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_TagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_TagsEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -209,292 +217,312 @@ 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/" - + "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/firestore/admin/v1/schedule.proto\032*go" - + "ogle/firestore/admin/v1/user_creds.proto" - + "\032#google/longrunning/operations.proto\032\033g" - + "oogle/protobuf/empty.proto\032 google/proto" - + "buf/field_mask.proto\032\037google/protobuf/ti" - + "mestamp.proto\"g\n\024ListDatabasesRequest\0229\n" - + "\006parent\030\001 \001(\tB)\340A\002\372A#\022!firestore.googlea" - + "pis.com/Database\022\024\n\014show_deleted\030\004 \001(\010\"\250" - + "\001\n\025CreateDatabaseRequest\0229\n\006parent\030\001 \001(\t" - + "B)\340A\002\372A#\022!firestore.googleapis.com/Datab" - + "ase\022:\n\010database\030\002 \001(\0132#.google.firestore" - + ".admin.v1.DatabaseB\003\340A\002\022\030\n\013database_id\030\003" - + " \001(\tB\003\340A\002\"\030\n\026CreateDatabaseMetadata\"d\n\025L" - + "istDatabasesResponse\0226\n\tdatabases\030\001 \003(\0132" - + "#.google.firestore.admin.v1.Database\022\023\n\013" - + "unreachable\030\003 \003(\t\"M\n\022GetDatabaseRequest\022" - + "7\n\004name\030\001 \001(\tB)\340A\002\372A#\n!firestore.googlea" - + "pis.com/Database\"\204\001\n\025UpdateDatabaseReque" - + "st\022:\n\010database\030\001 \001(\0132#.google.firestore." - + "admin.v1.DatabaseB\003\340A\002\022/\n\013update_mask\030\002 " - + "\001(\0132\032.google.protobuf.FieldMask\"\030\n\026Updat" - + "eDatabaseMetadata\"^\n\025DeleteDatabaseReque" - + "st\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!firestore.goog" - + "leapis.com/Database\022\014\n\004etag\030\003 \001(\t\"\030\n\026Del" - + "eteDatabaseMetadata\"\257\001\n\026CreateUserCredsR" - + "equest\022:\n\006parent\030\001 \001(\tB*\340A\002\372A$\022\"firestor" - + "e.googleapis.com/UserCreds\022=\n\nuser_creds" - + "\030\002 \001(\0132$.google.firestore.admin.v1.UserC" - + "redsB\003\340A\002\022\032\n\ruser_creds_id\030\003 \001(\tB\003\340A\002\"O\n" - + "\023GetUserCredsRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372" - + "A$\n\"firestore.googleapis.com/UserCreds\"R" - + "\n\024ListUserCredsRequest\022:\n\006parent\030\001 \001(\tB*" - + "\340A\002\372A$\022\"firestore.googleapis.com/UserCre" - + "ds\"Q\n\025ListUserCredsResponse\0228\n\nuser_cred" - + "s\030\001 \003(\0132$.google.firestore.admin.v1.User" - + "Creds\"R\n\026EnableUserCredsRequest\0228\n\004name\030" - + "\001 \001(\tB*\340A\002\372A$\n\"firestore.googleapis.com/" - + "UserCreds\"S\n\027DisableUserCredsRequest\0228\n\004" - + "name\030\001 \001(\tB*\340A\002\372A$\n\"firestore.googleapis" - + ".com/UserCreds\"T\n\030ResetUserPasswordReque" - + "st\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"firestore.goog" - + "leapis.com/UserCreds\"R\n\026DeleteUserCredsR" - + "equest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"firestore." - + "googleapis.com/UserCreds\"\241\001\n\033CreateBacku" - + "pScheduleRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#" - + "\n!firestore.googleapis.com/Database\022G\n\017b" - + "ackup_schedule\030\002 \001(\0132).google.firestore." - + "admin.v1.BackupScheduleB\003\340A\002\"Y\n\030GetBacku" - + "pScheduleRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'" - + "firestore.googleapis.com/BackupSchedule\"" - + "\227\001\n\033UpdateBackupScheduleRequest\022G\n\017backu" - + "p_schedule\030\001 \001(\0132).google.firestore.admi" - + "n.v1.BackupScheduleB\003\340A\002\022/\n\013update_mask\030" - + "\002 \001(\0132\032.google.protobuf.FieldMask\"W\n\032Lis" - + "tBackupSchedulesRequest\0229\n\006parent\030\001 \001(\tB" - + ")\340A\002\372A#\n!firestore.googleapis.com/Databa" - + "se\"b\n\033ListBackupSchedulesResponse\022C\n\020bac" - + "kup_schedules\030\001 \003(\0132).google.firestore.a" - + "dmin.v1.BackupSchedule\"\\\n\033DeleteBackupSc" - + "heduleRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'fir" - + "estore.googleapis.com/BackupSchedule\"\214\001\n" - + "\022CreateIndexRequest\022@\n\006parent\030\001 \001(\tB0\340A\002" + + "roto\032\031google/api/resource.proto\032\030google/" + + "api/routing.proto\032&google/firestore/admi" + + "n/v1/backup.proto\032(google/firestore/admi" + + "n/v1/database.proto\032%google/firestore/ad" + + "min/v1/field.proto\032%google/firestore/adm" + + "in/v1/index.proto\032)google/firestore/admi" + + "n/v1/operation.proto\032(google/firestore/a" + + "dmin/v1/schedule.proto\032(google/firestore" + + "/admin/v1/snapshot.proto\032*google/firesto" + + "re/admin/v1/user_creds.proto\032#google/lon" + + "grunning/operations.proto\032\033google/protob" + + "uf/empty.proto\032 google/protobuf/field_ma" + + "sk.proto\032\037google/protobuf/timestamp.prot" + + "o\"g\n\024ListDatabasesRequest\0229\n\006parent\030\001 \001(" + + "\tB)\340A\002\372A#\022!firestore.googleapis.com/Data" + + "base\022\024\n\014show_deleted\030\004 \001(\010\"\250\001\n\025CreateDat" + + "abaseRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!fi" + + "restore.googleapis.com/Database\022:\n\010datab" + + "ase\030\002 \001(\0132#.google.firestore.admin.v1.Da" + + "tabaseB\003\340A\002\022\030\n\013database_id\030\003 \001(\tB\003\340A\002\"\030\n" + + "\026CreateDatabaseMetadata\"d\n\025ListDatabases" + + "Response\0226\n\tdatabases\030\001 \003(\0132#.google.fir" + + "estore.admin.v1.Database\022\023\n\013unreachable\030" + + "\003 \003(\t\"M\n\022GetDatabaseRequest\0227\n\004name\030\001 \001(" + + "\tB)\340A\002\372A#\n!firestore.googleapis.com/Data" + + "base\"\204\001\n\025UpdateDatabaseRequest\022:\n\010databa" + + "se\030\001 \001(\0132#.google.firestore.admin.v1.Dat" + + "abaseB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google" + + ".protobuf.FieldMask\"\030\n\026UpdateDatabaseMet" + + "adata\"^\n\025DeleteDatabaseRequest\0227\n\004name\030\001" + + " \001(\tB)\340A\002\372A#\n!firestore.googleapis.com/D" + + "atabase\022\014\n\004etag\030\003 \001(\t\"\030\n\026DeleteDatabaseM" + + "etadata\"\257\001\n\026CreateUserCredsRequest\022:\n\006pa" + + "rent\030\001 \001(\tB*\340A\002\372A$\022\"firestore.googleapis" + + ".com/UserCreds\022=\n\nuser_creds\030\002 \001(\0132$.goo" + + "gle.firestore.admin.v1.UserCredsB\003\340A\002\022\032\n" + + "\ruser_creds_id\030\003 \001(\tB\003\340A\002\"O\n\023GetUserCred" + + "sRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"firestor" + + "e.googleapis.com/UserCreds\"R\n\024ListUserCr" + + "edsRequest\022:\n\006parent\030\001 \001(\tB*\340A\002\372A$\022\"fire" + + "store.googleapis.com/UserCreds\"Q\n\025ListUs" + + "erCredsResponse\0228\n\nuser_creds\030\001 \003(\0132$.go" + + "ogle.firestore.admin.v1.UserCreds\"R\n\026Ena" + + "bleUserCredsRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A" + + "$\n\"firestore.googleapis.com/UserCreds\"S\n" + + "\027DisableUserCredsRequest\0228\n\004name\030\001 \001(\tB*" + + "\340A\002\372A$\n\"firestore.googleapis.com/UserCre" + + "ds\"T\n\030ResetUserPasswordRequest\0228\n\004name\030\001" + + " \001(\tB*\340A\002\372A$\n\"firestore.googleapis.com/U" + + "serCreds\"R\n\026DeleteUserCredsRequest\0228\n\004na" + + "me\030\001 \001(\tB*\340A\002\372A$\n\"firestore.googleapis.c" + + "om/UserCreds\"\241\001\n\033CreateBackupScheduleReq" + + "uest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!firestore." + + "googleapis.com/Database\022G\n\017backup_schedu" + + "le\030\002 \001(\0132).google.firestore.admin.v1.Bac" + + "kupScheduleB\003\340A\002\"Y\n\030GetBackupScheduleReq" + + "uest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'firestore.go" + + "ogleapis.com/BackupSchedule\"\227\001\n\033UpdateBa" + + "ckupScheduleRequest\022G\n\017backup_schedule\030\001" + + " \001(\0132).google.firestore.admin.v1.BackupS" + + "cheduleB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.goog" + + "le.protobuf.FieldMask\"W\n\032ListBackupSched" + + "ulesRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!fir" + + "estore.googleapis.com/Database\"b\n\033ListBa" + + "ckupSchedulesResponse\022C\n\020backup_schedule" + + "s\030\001 \003(\0132).google.firestore.admin.v1.Back" + + "upSchedule\"\\\n\033DeleteBackupScheduleReques" + + "t\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'firestore.googl" + + "eapis.com/BackupSchedule\"\214\001\n\022CreateIndex" + + "Request\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(firesto" + + "re.googleapis.com/CollectionGroup\0224\n\005ind" + + "ex\030\002 \001(\0132 .google.firestore.admin.v1.Ind" + + "exB\003\340A\002\"\215\001\n\022ListIndexesRequest\022@\n\006parent" + + "\030\001 \001(\tB0\340A\002\372A*\n(firestore.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\023ListI" + + "ndexesResponse\0221\n\007indexes\030\001 \003(\0132 .google" + + ".firestore.admin.v1.Index\022\027\n\017next_page_t" + + "oken\030\002 \001(\t\"G\n\017GetIndexRequest\0224\n\004name\030\001 " + + "\001(\tB&\340A\002\372A \n\036firestore.googleapis.com/In" + + "dex\"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 .g" + + "oogle.firestore.admin.v1.FieldB\003\340A\002\022/\n\013u" + + "pdate_mask\030\002 \001(\0132\032.google.protobuf.Field" + + "Mask\"G\n\017GetFieldRequest\0224\n\004name\030\001 \001(\tB&\340" + + "A\002\372A \n\036firestore.googleapis.com/Field\"\214\001" + + "\n\021ListFieldsRequest\022@\n\006parent\030\001 \001(\tB0\340A\002" + "\372A*\n(firestore.googleapis.com/Collection" - + "Group\0224\n\005index\030\002 \001(\0132 .google.firestore." - + "admin.v1.IndexB\003\340A\002\"\215\001\n\022ListIndexesReque" - + "st\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\n(firestore.go" - + "ogleapis.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\017GetIndexReques" - + "t\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036firestore.googl" - + "eapis.com/Index\"J\n\022DeleteIndexRequest\0224\n" - + "\004name\030\001 \001(\tB&\340A\002\372A \n\036firestore.googleapi" - + "s.com/Index\"{\n\022UpdateFieldRequest\0224\n\005fie" - + "ld\030\001 \001(\0132 .google.firestore.admin.v1.Fie" - + "ldB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.pr" - + "otobuf.FieldMask\"G\n\017GetFieldRequest\0224\n\004n" - + "ame\030\001 \001(\tB&\340A\002\372A \n\036firestore.googleapis." - + "com/Field\"\214\001\n\021ListFieldsRequest\022@\n\006paren" - + "t\030\001 \001(\tB0\340A\002\372A*\n(firestore.googleapis.co" - + "m/CollectionGroup\022\016\n\006filter\030\002 \001(\t\022\021\n\tpag" - + "e_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"_\n\022List" - + "FieldsResponse\0220\n\006fields\030\001 \003(\0132 .google." - + "firestore.admin.v1.Field\022\027\n\017next_page_to" - + "ken\030\002 \001(\t\"\316\001\n\026ExportDocumentsRequest\0227\n\004" - + "name\030\001 \001(\tB)\340A\002\372A#\n!firestore.googleapis" - + ".com/Database\022\026\n\016collection_ids\030\002 \003(\t\022\031\n" - + "\021output_uri_prefix\030\003 \001(\t\022\025\n\rnamespace_id" - + "s\030\004 \003(\t\0221\n\rsnapshot_time\030\005 \001(\0132\032.google." - + "protobuf.Timestamp\"\232\001\n\026ImportDocumentsRe" - + "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\030\n\020input_uri_prefix\030\003 \001(\t\022\025\n\rname" - + "space_ids\030\004 \003(\t\"\216\001\n\032BulkDeleteDocumentsR" - + "equest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!firestore." - + "googleapis.com/Database\022\033\n\016collection_id" - + "s\030\002 \003(\tB\003\340A\001\022\032\n\rnamespace_ids\030\003 \003(\tB\003\340A\001" - + "\"\035\n\033BulkDeleteDocumentsResponse\"I\n\020GetBa" - + "ckupRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037fires" - + "tore.googleapis.com/Backup\"_\n\022ListBackup" - + "sRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!firest" - + "ore.googleapis.com/Location\022\016\n\006filter\030\002 " - + "\001(\t\"^\n\023ListBackupsResponse\0222\n\007backups\030\001 " - + "\003(\0132!.google.firestore.admin.v1.Backup\022\023" - + "\n\013unreachable\030\003 \003(\t\"L\n\023DeleteBackupReque" - + "st\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037firestore.goog" - + "leapis.com/Backup\"\374\002\n\026RestoreDatabaseReq" - + "uest\0229\n\006parent\030\001 \001(\tB)\340A\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\037fires" - + "tore.googleapis.com/Backup\022T\n\021encryption" - + "_config\030\t \001(\01324.google.firestore.admin.v" - + "1.Database.EncryptionConfigB\003\340A\001\022Q\n\004tags" - + "\030\n \003(\0132;.google.firestore.admin.v1.Resto" - + "reDatabaseRequest.TagsEntryB\006\340A\005\340A\001\032+\n\tT" - + "agsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" - + "2\301/\n\016FirestoreAdmin\022\333\001\n\013CreateIndex\022-.go" - + "ogle.firestore.admin.v1.CreateIndexReque" - + "st\032\035.google.longrunning.Operation\"~\312A\037\n\005" - + "Index\022\026IndexOperationMetadata\332A\014parent,i" - + "ndex\202\323\344\223\002G\">/v1/{parent=projects/*/datab" - + "ases/*/collectionGroups/*}/indexes:\005inde" - + "x\022\275\001\n\013ListIndexes\022-.google.firestore.adm" - + "in.v1.ListIndexesRequest\032..google.firest" - + "ore.admin.v1.ListIndexesResponse\"O\332A\006par" - + "ent\202\323\344\223\002@\022>/v1/{parent=projects/*/databa" - + "ses/*/collectionGroups/*}/indexes\022\247\001\n\010Ge" - + "tIndex\022*.google.firestore.admin.v1.GetIn" - + "dexRequest\032 .google.firestore.admin.v1.I" - + "ndex\"M\332A\004name\202\323\344\223\002@\022>/v1/{name=projects/" - + "*/databases/*/collectionGroups/*/indexes" - + "/*}\022\243\001\n\013DeleteIndex\022-.google.firestore.a" - + "dmin.v1.DeleteIndexRequest\032\026.google.prot" - + "obuf.Empty\"M\332A\004name\202\323\344\223\002@*>/v1/{name=pro" - + "jects/*/databases/*/collectionGroups/*/i" - + "ndexes/*}\022\246\001\n\010GetField\022*.google.firestor" - + "e.admin.v1.GetFieldRequest\032 .google.fire" - + "store.admin.v1.Field\"L\332A\004name\202\323\344\223\002?\022=/v1" - + "/{name=projects/*/databases/*/collection" - + "Groups/*/fields/*}\022\331\001\n\013UpdateField\022-.goo" - + "gle.firestore.admin.v1.UpdateFieldReques" - + "t\032\035.google.longrunning.Operation\"|\312A\037\n\005F" - + "ield\022\026FieldOperationMetadata\332A\005field\202\323\344\223" - + "\002L2C/v1/{field.name=projects/*/databases" - + "/*/collectionGroups/*/fields/*}:\005field\022\271" - + "\001\n\nListFields\022,.google.firestore.admin.v" - + "1.ListFieldsRequest\032-.google.firestore.a" - + "dmin.v1.ListFieldsResponse\"N\332A\006parent\202\323\344" - + "\223\002?\022=/v1/{parent=projects/*/databases/*/" - + "collectionGroups/*}/fields\022\335\001\n\017ExportDoc" - + "uments\0221.google.firestore.admin.v1.Expor" - + "tDocumentsRequest\032\035.google.longrunning.O" - + "peration\"x\312A2\n\027ExportDocumentsResponse\022\027" - + "ExportDocumentsMetadata\332A\004name\202\323\344\223\0026\"1/v" - + "1/{name=projects/*/databases/*}:exportDo" - + "cuments:\001*\022\333\001\n\017ImportDocuments\0221.google." - + "firestore.admin.v1.ImportDocumentsReques" - + "t\032\035.google.longrunning.Operation\"v\312A0\n\025g" - + "oogle.protobuf.Empty\022\027ImportDocumentsMet" - + "adata\332A\004name\202\323\344\223\0026\"1/v1/{name=projects/*" - + "/databases/*}:importDocuments:\001*\022\362\001\n\023Bul" - + "kDeleteDocuments\0225.google.firestore.admi" - + "n.v1.BulkDeleteDocumentsRequest\032\035.google" - + ".longrunning.Operation\"\204\001\312A:\n\033BulkDelete" - + "DocumentsResponse\022\033BulkDeleteDocumentsMe" - + "tadata\332A\004name\202\323\344\223\002:\"5/v1/{name=projects/" - + "*/databases/*}:bulkDeleteDocuments:\001*\022\331\001" - + "\n\016CreateDatabase\0220.google.firestore.admi" - + "n.v1.CreateDatabaseRequest\032\035.google.long" - + "running.Operation\"v\312A\"\n\010Database\022\026Create" - + "DatabaseMetadata\332A\033parent,database,datab" - + "ase_id\202\323\344\223\002-\"!/v1/{parent=projects/*}/da" - + "tabases:\010database\022\223\001\n\013GetDatabase\022-.goog" - + "le.firestore.admin.v1.GetDatabaseRequest" - + "\032#.google.firestore.admin.v1.Database\"0\332" - + "A\004name\202\323\344\223\002#\022!/v1/{name=projects/*/datab" - + "ases/*}\022\246\001\n\rListDatabases\022/.google.fires" - + "tore.admin.v1.ListDatabasesRequest\0320.goo" - + "gle.firestore.admin.v1.ListDatabasesResp" - + "onse\"2\332A\006parent\202\323\344\223\002#\022!/v1/{parent=proje" - + "cts/*}/databases\022\333\001\n\016UpdateDatabase\0220.go" - + "ogle.firestore.admin.v1.UpdateDatabaseRe" - + "quest\032\035.google.longrunning.Operation\"x\312A" - + "\"\n\010Database\022\026UpdateDatabaseMetadata\332A\024da" - + "tabase,update_mask\202\323\344\223\00262*/v1/{database." - + "name=projects/*/databases/*}:\010database\022\270" - + "\001\n\016DeleteDatabase\0220.google.firestore.adm" - + "in.v1.DeleteDatabaseRequest\032\035.google.lon" - + "grunning.Operation\"U\312A\"\n\010Database\022\026Delet" - + "eDatabaseMetadata\332A\004name\202\323\344\223\002#*!/v1/{nam" - + "e=projects/*/databases/*}\022\317\001\n\017CreateUser" - + "Creds\0221.google.firestore.admin.v1.Create" - + "UserCredsRequest\032$.google.firestore.admi" - + "n.v1.UserCreds\"c\332A\037parent,user_creds,use" - + "r_creds_id\202\323\344\223\002;\"-/v1/{parent=projects/*" - + "/databases/*}/userCreds:\nuser_creds\022\242\001\n\014" - + "GetUserCreds\022..google.firestore.admin.v1" - + ".GetUserCredsRequest\032$.google.firestore." - + "admin.v1.UserCreds\"<\332A\004name\202\323\344\223\002/\022-/v1/{" - + "name=projects/*/databases/*/userCreds/*}" - + "\022\262\001\n\rListUserCreds\022/.google.firestore.ad" - + "min.v1.ListUserCredsRequest\0320.google.fir" - + "estore.admin.v1.ListUserCredsResponse\">\332" - + "A\006parent\202\323\344\223\002/\022-/v1/{parent=projects/*/d" - + "atabases/*}/userCreds\022\262\001\n\017EnableUserCred" - + "s\0221.google.firestore.admin.v1.EnableUser" - + "CredsRequest\032$.google.firestore.admin.v1" - + ".UserCreds\"F\332A\004name\202\323\344\223\0029\"4/v1/{name=pro" - + "jects/*/databases/*/userCreds/*}:enable:" - + "\001*\022\265\001\n\020DisableUserCreds\0222.google.firesto" - + "re.admin.v1.DisableUserCredsRequest\032$.go" - + "ogle.firestore.admin.v1.UserCreds\"G\332A\004na" - + "me\202\323\344\223\002:\"5/v1/{name=projects/*/databases" - + "/*/userCreds/*}:disable:\001*\022\275\001\n\021ResetUser" - + "Password\0223.google.firestore.admin.v1.Res" - + "etUserPasswordRequest\032$.google.firestore" - + ".admin.v1.UserCreds\"M\332A\004name\202\323\344\223\002@\";/v1/" - + "{name=projects/*/databases/*/userCreds/*" - + "}:resetPassword:\001*\022\232\001\n\017DeleteUserCreds\0221" - + ".google.firestore.admin.v1.DeleteUserCre" - + "dsRequest\032\026.google.protobuf.Empty\"<\332A\004na" - + "me\202\323\344\223\002/*-/v1/{name=projects/*/databases" - + "/*/userCreds/*}\022\227\001\n\tGetBackup\022+.google.f" - + "irestore.admin.v1.GetBackupRequest\032!.goo" - + "gle.firestore.admin.v1.Backup\":\332A\004name\202\323" - + "\344\223\002-\022+/v1/{name=projects/*/locations/*/b" - + "ackups/*}\022\252\001\n\013ListBackups\022-.google.fires" - + "tore.admin.v1.ListBackupsRequest\032..googl" - + "e.firestore.admin.v1.ListBackupsResponse" - + "\"<\332A\006parent\202\323\344\223\002-\022+/v1/{parent=projects/" - + "*/locations/*}/backups\022\222\001\n\014DeleteBackup\022" - + "..google.firestore.admin.v1.DeleteBackup" - + "Request\032\026.google.protobuf.Empty\":\332A\004name" - + "\202\323\344\223\002-*+/v1/{name=projects/*/locations/*" - + "/backups/*}\022\277\001\n\017RestoreDatabase\0221.google" - + ".firestore.admin.v1.RestoreDatabaseReque" - + "st\032\035.google.longrunning.Operation\"Z\312A#\n\010" - + "Database\022\027RestoreDatabaseMetadata\202\323\344\223\002.\"" - + ")/v1/{parent=projects/*}/databases:resto" - + "re:\001*\022\340\001\n\024CreateBackupSchedule\0226.google." - + "firestore.admin.v1.CreateBackupScheduleR" + + "Group\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\022ListFieldsRespon" + + "se\0220\n\006fields\030\001 \003(\0132 .google.firestore.ad" + + "min.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/Databas" + + "e\022\026\n\016collection_ids\030\002 \003(\t\022\031\n\021output_uri_" + + "prefix\030\003 \001(\t\022\025\n\rnamespace_ids\030\004 \003(\t\0221\n\rs" + + "napshot_time\030\005 \001(\0132\032.google.protobuf.Tim" + + "estamp\"\232\001\n\026ImportDocumentsRequest\0227\n\004nam" + + "e\030\001 \001(\tB)\340A\002\372A#\n!firestore.googleapis.co" + + "m/Database\022\026\n\016collection_ids\030\002 \003(\t\022\030\n\020in" + + "put_uri_prefix\030\003 \001(\t\022\025\n\rnamespace_ids\030\004 " + + "\003(\t\"\216\001\n\032BulkDeleteDocumentsRequest\0227\n\004na" + + "me\030\001 \001(\tB)\340A\002\372A#\n!firestore.googleapis.c" + + "om/Database\022\033\n\016collection_ids\030\002 \003(\tB\003\340A\001" + + "\022\032\n\rnamespace_ids\030\003 \003(\tB\003\340A\001\"\035\n\033BulkDele" + + "teDocumentsResponse\"I\n\020GetBackupRequest\022" + + "5\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037firestore.googlea" + + "pis.com/Backup\"_\n\022ListBackupsRequest\0229\n\006" + + "parent\030\001 \001(\tB)\340A\002\372A#\n!firestore.googleap" + + "is.com/Location\022\016\n\006filter\030\002 \001(\t\"^\n\023ListB" + + "ackupsResponse\0222\n\007backups\030\001 \003(\0132!.google" + + ".firestore.admin.v1.Backup\022\023\n\013unreachabl" + + "e\030\003 \003(\t\"L\n\023DeleteBackupRequest\0225\n\004name\030\001" + + " \001(\tB\'\340A\002\372A!\n\037firestore.googleapis.com/B" + + "ackup\"\374\002\n\026RestoreDatabaseRequest\0229\n\006pare" + + "nt\030\001 \001(\tB)\340A\002\372A#\022!firestore.googleapis.c" + + "om/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.googlea" + + "pis.com/Backup\022T\n\021encryption_config\030\t \001(" + + "\01324.google.firestore.admin.v1.Database.E" + + "ncryptionConfigB\003\340A\001\022Q\n\004tags\030\n \003(\0132;.goo" + + "gle.firestore.admin.v1.RestoreDatabaseRe" + + "quest.TagsEntryB\006\340A\005\340A\001\032+\n\tTagsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\204\003\n\024CloneDa" + + "tabaseRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!f" + + "irestore.googleapis.com/Database\022\030\n\013data" + + "base_id\030\002 \001(\tB\003\340A\002\022C\n\rpitr_snapshot\030\006 \001(" + + "\0132\'.google.firestore.admin.v1.PitrSnapsh" + + "otB\003\340A\002\022T\n\021encryption_config\030\004 \001(\01324.goo" + + "gle.firestore.admin.v1.Database.Encrypti" + + "onConfigB\003\340A\001\022O\n\004tags\030\005 \003(\01329.google.fir" + + "estore.admin.v1.CloneDatabaseRequest.Tag" + + "sEntryB\006\340A\005\340A\001\032+\n\tTagsEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\t:\0028\0012\3731\n\016FirestoreAdmin\022\333" + + "\001\n\013CreateIndex\022-.google.firestore.admin." + + "v1.CreateIndexRequest\032\035.google.longrunni" + + "ng.Operation\"~\312A\037\n\005Index\022\026IndexOperation" + + "Metadata\332A\014parent,index\202\323\344\223\002G\">/v1/{pare" + + "nt=projects/*/databases/*/collectionGrou" + + "ps/*}/indexes:\005index\022\275\001\n\013ListIndexes\022-.g" + + "oogle.firestore.admin.v1.ListIndexesRequ" + + "est\032..google.firestore.admin.v1.ListInde" + + "xesResponse\"O\332A\006parent\202\323\344\223\002@\022>/v1/{paren" + + "t=projects/*/databases/*/collectionGroup" + + "s/*}/indexes\022\247\001\n\010GetIndex\022*.google.fires" + + "tore.admin.v1.GetIndexRequest\032 .google.f" + + "irestore.admin.v1.Index\"M\332A\004name\202\323\344\223\002@\022>" + + "/v1/{name=projects/*/databases/*/collect" + + "ionGroups/*/indexes/*}\022\243\001\n\013DeleteIndex\022-" + + ".google.firestore.admin.v1.DeleteIndexRe" + + "quest\032\026.google.protobuf.Empty\"M\332A\004name\202\323" + + "\344\223\002@*>/v1/{name=projects/*/databases/*/c" + + "ollectionGroups/*/indexes/*}\022\246\001\n\010GetFiel" + + "d\022*.google.firestore.admin.v1.GetFieldRe" + + "quest\032 .google.firestore.admin.v1.Field\"" + + "L\332A\004name\202\323\344\223\002?\022=/v1/{name=projects/*/dat" + + "abases/*/collectionGroups/*/fields/*}\022\331\001" + + "\n\013UpdateField\022-.google.firestore.admin.v" + + "1.UpdateFieldRequest\032\035.google.longrunnin" + + "g.Operation\"|\312A\037\n\005Field\022\026FieldOperationM" + + "etadata\332A\005field\202\323\344\223\002L2C/v1/{field.name=p" + + "rojects/*/databases/*/collectionGroups/*" + + "/fields/*}:\005field\022\271\001\n\nListFields\022,.googl" + + "e.firestore.admin.v1.ListFieldsRequest\032-" + + ".google.firestore.admin.v1.ListFieldsRes" + + "ponse\"N\332A\006parent\202\323\344\223\002?\022=/v1/{parent=proj" + + "ects/*/databases/*/collectionGroups/*}/f" + + "ields\022\335\001\n\017ExportDocuments\0221.google.fires" + + "tore.admin.v1.ExportDocumentsRequest\032\035.g" + + "oogle.longrunning.Operation\"x\312A2\n\027Export" + + "DocumentsResponse\022\027ExportDocumentsMetada" + + "ta\332A\004name\202\323\344\223\0026\"1/v1/{name=projects/*/da" + + "tabases/*}:exportDocuments:\001*\022\333\001\n\017Import" + + "Documents\0221.google.firestore.admin.v1.Im" + + "portDocumentsRequest\032\035.google.longrunnin" + + "g.Operation\"v\312A0\n\025google.protobuf.Empty\022" + + "\027ImportDocumentsMetadata\332A\004name\202\323\344\223\0026\"1/" + + "v1/{name=projects/*/databases/*}:importD" + + "ocuments:\001*\022\362\001\n\023BulkDeleteDocuments\0225.go" + + "ogle.firestore.admin.v1.BulkDeleteDocume" + + "ntsRequest\032\035.google.longrunning.Operatio" + + "n\"\204\001\312A:\n\033BulkDeleteDocumentsResponse\022\033Bu" + + "lkDeleteDocumentsMetadata\332A\004name\202\323\344\223\002:\"5" + + "/v1/{name=projects/*/databases/*}:bulkDe" + + "leteDocuments:\001*\022\331\001\n\016CreateDatabase\0220.go" + + "ogle.firestore.admin.v1.CreateDatabaseRe" + + "quest\032\035.google.longrunning.Operation\"v\312A" + + "\"\n\010Database\022\026CreateDatabaseMetadata\332A\033pa" + + "rent,database,database_id\202\323\344\223\002-\"!/v1/{pa" + + "rent=projects/*}/databases:\010database\022\223\001\n" + + "\013GetDatabase\022-.google.firestore.admin.v1" + + ".GetDatabaseRequest\032#.google.firestore.a" + + "dmin.v1.Database\"0\332A\004name\202\323\344\223\002#\022!/v1/{na" + + "me=projects/*/databases/*}\022\246\001\n\rListDatab" + + "ases\022/.google.firestore.admin.v1.ListDat" + + "abasesRequest\0320.google.firestore.admin.v" + + "1.ListDatabasesResponse\"2\332A\006parent\202\323\344\223\002#" + + "\022!/v1/{parent=projects/*}/databases\022\333\001\n\016" + + "UpdateDatabase\0220.google.firestore.admin." + + "v1.UpdateDatabaseRequest\032\035.google.longru" + + "nning.Operation\"x\312A\"\n\010Database\022\026UpdateDa" + + "tabaseMetadata\332A\024database,update_mask\202\323\344" + + "\223\00262*/v1/{database.name=projects/*/datab" + + "ases/*}:\010database\022\270\001\n\016DeleteDatabase\0220.g" + + "oogle.firestore.admin.v1.DeleteDatabaseR" + + "equest\032\035.google.longrunning.Operation\"U\312" + + "A\"\n\010Database\022\026DeleteDatabaseMetadata\332A\004n" + + "ame\202\323\344\223\002#*!/v1/{name=projects/*/database" + + "s/*}\022\317\001\n\017CreateUserCreds\0221.google.firest" + + "ore.admin.v1.CreateUserCredsRequest\032$.go" + + "ogle.firestore.admin.v1.UserCreds\"c\332A\037pa" + + "rent,user_creds,user_creds_id\202\323\344\223\002;\"-/v1" + + "/{parent=projects/*/databases/*}/userCre" + + "ds:\nuser_creds\022\242\001\n\014GetUserCreds\022..google" + + ".firestore.admin.v1.GetUserCredsRequest\032" + + "$.google.firestore.admin.v1.UserCreds\"<\332" + + "A\004name\202\323\344\223\002/\022-/v1/{name=projects/*/datab" + + "ases/*/userCreds/*}\022\262\001\n\rListUserCreds\022/." + + "google.firestore.admin.v1.ListUserCredsR" + + "equest\0320.google.firestore.admin.v1.ListU" + + "serCredsResponse\">\332A\006parent\202\323\344\223\002/\022-/v1/{" + + "parent=projects/*/databases/*}/userCreds" + + "\022\262\001\n\017EnableUserCreds\0221.google.firestore." + + "admin.v1.EnableUserCredsRequest\032$.google" + + ".firestore.admin.v1.UserCreds\"F\332A\004name\202\323" + + "\344\223\0029\"4/v1/{name=projects/*/databases/*/u" + + "serCreds/*}:enable:\001*\022\265\001\n\020DisableUserCre" + + "ds\0222.google.firestore.admin.v1.DisableUs" + + "erCredsRequest\032$.google.firestore.admin." + + "v1.UserCreds\"G\332A\004name\202\323\344\223\002:\"5/v1/{name=p" + + "rojects/*/databases/*/userCreds/*}:disab" + + "le:\001*\022\275\001\n\021ResetUserPassword\0223.google.fir" + + "estore.admin.v1.ResetUserPasswordRequest" + + "\032$.google.firestore.admin.v1.UserCreds\"M" + + "\332A\004name\202\323\344\223\002@\";/v1/{name=projects/*/data" + + "bases/*/userCreds/*}:resetPassword:\001*\022\232\001" + + "\n\017DeleteUserCreds\0221.google.firestore.adm" + + "in.v1.DeleteUserCredsRequest\032\026.google.pr" + + "otobuf.Empty\"<\332A\004name\202\323\344\223\002/*-/v1/{name=p" + + "rojects/*/databases/*/userCreds/*}\022\227\001\n\tG" + + "etBackup\022+.google.firestore.admin.v1.Get" + + "BackupRequest\032!.google.firestore.admin.v" + + "1.Backup\":\332A\004name\202\323\344\223\002-\022+/v1/{name=proje" + + "cts/*/locations/*/backups/*}\022\252\001\n\013ListBac" + + "kups\022-.google.firestore.admin.v1.ListBac" + + "kupsRequest\032..google.firestore.admin.v1." + + "ListBackupsResponse\"<\332A\006parent\202\323\344\223\002-\022+/v" + + "1/{parent=projects/*/locations/*}/backup" + + "s\022\222\001\n\014DeleteBackup\022..google.firestore.ad" + + "min.v1.DeleteBackupRequest\032\026.google.prot" + + "obuf.Empty\":\332A\004name\202\323\344\223\002-*+/v1/{name=pro" + + "jects/*/locations/*/backups/*}\022\277\001\n\017Resto" + + "reDatabase\0221.google.firestore.admin.v1.R" + + "estoreDatabaseRequest\032\035.google.longrunni" + + "ng.Operation\"Z\312A#\n\010Database\022\027RestoreData" + + "baseMetadata\202\323\344\223\002.\")/v1/{parent=projects" + + "/*}/databases:restore:\001*\022\340\001\n\024CreateBacku" + + "pSchedule\0226.google.firestore.admin.v1.Cr" + + "eateBackupScheduleRequest\032).google.fires" + + "tore.admin.v1.BackupSchedule\"e\332A\026parent," + + "backup_schedule\202\323\344\223\002F\"3/v1/{parent=proje" + + "cts/*/databases/*}/backupSchedules:\017back" + + "up_schedule\022\267\001\n\021GetBackupSchedule\0223.goog" + + "le.firestore.admin.v1.GetBackupScheduleR" + "equest\032).google.firestore.admin.v1.Backu" - + "pSchedule\"e\332A\026parent,backup_schedule\202\323\344\223" - + "\002F\"3/v1/{parent=projects/*/databases/*}/" - + "backupSchedules:\017backup_schedule\022\267\001\n\021Get" - + "BackupSchedule\0223.google.firestore.admin." - + "v1.GetBackupScheduleRequest\032).google.fir" - + "estore.admin.v1.BackupSchedule\"B\332A\004name\202" - + "\323\344\223\0025\0223/v1/{name=projects/*/databases/*/" - + "backupSchedules/*}\022\312\001\n\023ListBackupSchedul" - + "es\0225.google.firestore.admin.v1.ListBacku" - + "pSchedulesRequest\0326.google.firestore.adm" - + "in.v1.ListBackupSchedulesResponse\"D\332A\006pa" - + "rent\202\323\344\223\0025\0223/v1/{parent=projects/*/datab" - + "ases/*}/backupSchedules\022\365\001\n\024UpdateBackup" - + "Schedule\0226.google.firestore.admin.v1.Upd" - + "ateBackupScheduleRequest\032).google.firest" - + "ore.admin.v1.BackupSchedule\"z\332A\033backup_s" - + "chedule,update_mask\202\323\344\223\002V2C/v1/{backup_s" - + "chedule.name=projects/*/databases/*/back" - + "upSchedules/*}:\017backup_schedule\022\252\001\n\024Dele" - + "teBackupSchedule\0226.google.firestore.admi" - + "n.v1.DeleteBackupScheduleRequest\032\026.googl" - + "e.protobuf.Empty\"B\332A\004name\202\323\344\223\0025*3/v1/{na" - + "me=projects/*/databases/*/backupSchedule" - + "s/*}\032v\312A\030firestore.googleapis.com\322AXhttp" - + "s://www.googleapis.com/auth/cloud-platfo" - + "rm,https://www.googleapis.com/auth/datas" - + "toreB\245\003\n\035com.google.firestore.admin.v1B\023" - + "FirestoreAdminProtoP\001Z9cloud.google.com/" - + "go/firestore/apiv1/admin/adminpb;adminpb" - + "\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V" - + "1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#Go" - + "ogle::Cloud::Firestore::Admin::V1\352AL\n!fi" - + "restore.googleapis.com/Location\022\'project" - + "s/{project}/locations/{location}\352Aq\n(fir" - + "estore.googleapis.com/CollectionGroup\022Ep" - + "rojects/{project}/databases/{database}/c" - + "ollectionGroups/{collection}b\006proto3" + + "pSchedule\"B\332A\004name\202\323\344\223\0025\0223/v1/{name=proj" + + "ects/*/databases/*/backupSchedules/*}\022\312\001" + + "\n\023ListBackupSchedules\0225.google.firestore" + + ".admin.v1.ListBackupSchedulesRequest\0326.g" + + "oogle.firestore.admin.v1.ListBackupSched" + + "ulesResponse\"D\332A\006parent\202\323\344\223\0025\0223/v1/{pare" + + "nt=projects/*/databases/*}/backupSchedul" + + "es\022\365\001\n\024UpdateBackupSchedule\0226.google.fir" + + "estore.admin.v1.UpdateBackupScheduleRequ" + + "est\032).google.firestore.admin.v1.BackupSc" + + "hedule\"z\332A\033backup_schedule,update_mask\202\323" + + "\344\223\002V2C/v1/{backup_schedule.name=projects" + + "/*/databases/*/backupSchedules/*}:\017backu" + + "p_schedule\022\252\001\n\024DeleteBackupSchedule\0226.go" + + "ogle.firestore.admin.v1.DeleteBackupSche" + + "duleRequest\032\026.google.protobuf.Empty\"B\332A\004" + + "name\202\323\344\223\0025*3/v1/{name=projects/*/databas" + + "es/*/backupSchedules/*}\022\267\002\n\rCloneDatabas" + + "e\022/.google.firestore.admin.v1.CloneDatab" + + "aseRequest\032\035.google.longrunning.Operatio" + + "n\"\325\001\312A!\n\010Database\022\025CloneDatabaseMetadata" + + "\202\323\344\223\002,\"\'/v1/{parent=projects/*}/database" + + "s:clone:\001*\212\323\344\223\002y\0224\n\026pitr_snapshot.databa" + + "se\022\032projects/{project_id=*}/**\022A\n\026pitr_s" + + "napshot.database\022\'projects/*/databases/{" + + "database_id=*}/**\032v\312A\030firestore.googleap" + + "is.com\322AXhttps://www.googleapis.com/auth" + + "/cloud-platform,https://www.googleapis.c" + + "om/auth/datastoreB\245\003\n\035com.google.firesto" + + "re.admin.v1B\023FirestoreAdminProtoP\001Z9clou" + + "d.google.com/go/firestore/apiv1/admin/ad" + + "minpb;adminpb\242\002\004GCFS\252\002\037Google.Cloud.Fire" + + "store.Admin.V1\312\002\037Google\\Cloud\\Firestore\\" + + "Admin\\V1\352\002#Google::Cloud::Firestore::Adm" + + "in::V1\352AL\n!firestore.googleapis.com/Loca" + + "tion\022\'projects/{project}/locations/{loca" + + "tion}\352Aq\n(firestore.googleapis.com/Colle" + + "ctionGroup\022Eprojects/{project}/databases" + + "/{database}/collectionGroups/{collection" + + "}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -504,12 +532,14 @@ 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.api.RoutingProto.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.firestore.admin.v1.PitrSnapshotProto.getDescriptor(), com.google.firestore.admin.v1.UserCredsProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.EmptyProto.getDescriptor(), @@ -846,6 +876,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_descriptor, + new java.lang.String[] { + "Parent", "DatabaseId", "PitrSnapshot", "EncryptionConfig", "Tags", + }); + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_TagsEntry_descriptor = + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_TagsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_CloneDatabaseRequest_TagsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -855,6 +903,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ClientProto.oauthScopes); registry.add(com.google.api.ResourceProto.resourceDefinition); registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.api.RoutingProto.routing); registry.add(com.google.longrunning.OperationsProto.operationInfo); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); @@ -862,12 +911,14 @@ 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.api.RoutingProto.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.firestore.admin.v1.PitrSnapshotProto.getDescriptor(); com.google.firestore.admin.v1.UserCredsProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.EmptyProto.getDescriptor(); 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 f61e67c8d..0bf76189a 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 @@ -64,6 +64,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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_CloneDatabaseMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_CloneDatabaseMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_firestore_admin_v1_Progress_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -80,8 +84,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n" + ")google/firestore/admin/v1/operation.pr" + "oto\022\031google.firestore.admin.v1\032\031google/a" - + "pi/resource.proto\032%google/firestore/admi" - + "n/v1/index.proto\032\037google/protobuf/timestamp.proto\"\275\002\n" + + "pi/resource.proto\032%google/firestore/admin/v1/index.proto\032(google/firestore/admin" + + "/v1/snapshot.proto\032\037google/protobuf/timestamp.proto\"\275\002\n" + "\026IndexOperationMetadata\022.\n\n" + "start_time\030\001 \001(\0132\032.google.protobuf.Timestamp\022,\n" + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022\r\n" @@ -93,24 +97,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "start_time\030\001 \001(\0132\032.google.protobuf.Timestamp\022,\n" + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022\r\n" + "\005field\030\003 \001(\t\022_\n" - + "\023index_config_deltas\030\004 \003(\0132B.google.firestore.admin." - + "v1.FieldOperationMetadata.IndexConfigDelta\0228\n" + + "\023index_config_deltas\030\004 \003(\0132B.google.firestore.admi" + + "n.v1.FieldOperationMetadata.IndexConfigDelta\0228\n" + "\005state\030\005 \001(\0162).google.firestore.admin.v1.OperationState\022?\n" + "\022progress_documents\030\006 \001(\0132#.google.firestore.admin.v1.Progress\022;\n" + "\016progress_bytes\030\007 \001(\0132#.google.firestore.admin.v1.Progress\022Z\n" - + "\020ttl_config_delta\030\010 \001(\0132@.google.firestore.admin.v1" - + ".FieldOperationMetadata.TtlConfigDelta\032\347\001\n" + + "\020ttl_config_delta\030\010 \001(\0132@.google.firestore.admin." + + "v1.FieldOperationMetadata.TtlConfigDelta\032\347\001\n" + "\020IndexConfigDelta\022b\n" - + "\013change_type\030\001 \001(\0162M.google.firestore.admin.v1.FieldOperat" - + "ionMetadata.IndexConfigDelta.ChangeType\022/\n" + + "\013change_type\030\001 \001(\0162M.google.firestore.admin.v1.FieldOper" + + "ationMetadata.IndexConfigDelta.ChangeType\022/\n" + "\005index\030\002 \001(\0132 .google.firestore.admin.v1.Index\">\n\n" + "ChangeType\022\033\n" + "\027CHANGE_TYPE_UNSPECIFIED\020\000\022\007\n" + "\003ADD\020\001\022\n\n" + "\006REMOVE\020\002\032\262\001\n" + "\016TtlConfigDelta\022`\n" - + "\013change_type\030\001 \001(\0162K.googl" - + "e.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType\">\n\n" + + "\013change_type\030\001 \001(\0162K.goo" + + "gle.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType\">\n\n" + "ChangeType\022\033\n" + "\027CHANGE_TYPE_UNSPECIFIED\020\000\022\007\n" + "\003ADD\020\001\022\n\n" @@ -118,8 +122,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\027ExportDocumentsMetadata\022.\n\n" + "start_time\030\001 \001(\0132\032.google.protobuf.Timestamp\022,\n" + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022B\n" - + "\017operation_state\030\003 \001(\016" - + "2).google.firestore.admin.v1.OperationState\022?\n" + + "\017operation_state\030\003 \001" + + "(\0162).google.firestore.admin.v1.OperationState\022?\n" + "\022progress_documents\030\004 \001(\0132#.google.firestore.admin.v1.Progress\022;\n" + "\016progress_bytes\030\005 \001(\0132#.google.firestore.admin.v1.Progress\022\026\n" + "\016collection_ids\030\006 \003(\t\022\031\n" @@ -129,18 +133,19 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\027ImportDocumentsMetadata\022.\n\n" + "start_time\030\001 \001(\0132\032.google.protobuf.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.OperationState\022?\n" + + "\017operation_state\030\003 " + + "\001(\0162).google.firestore.admin.v1.OperationState\022?\n" + "\022progress_documents\030\004 \001(\0132#.google.firestore.admin.v1.Progress\022;\n" + "\016progress_bytes\030\005 \001(\0132#.google.firestore.admin.v1.Progress\022\026\n" + "\016collection_ids\030\006 \003(\t\022\030\n" + "\020input_uri_prefix\030\007 \001(\t\022\025\n\r" + "namespace_ids\030\010 \003(\t\"\237\003\n" - + "\033BulkDeleteDocumentsMetadata\022.\n\n" + + "\033BulkDeleteDocumentsMetadata\022.\n" + + "\n" + "start_time\030\001 \001(\0132\032.google.protobuf.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.OperationState\022?\n" + + "\017operation_state\030\003 \001(\0162).g" + + "oogle.firestore.admin.v1.OperationState\022?\n" + "\022progress_documents\030\004 \001(\0132#.google.firestore.admin.v1.Progress\022;\n" + "\016progress_bytes\030\005 \001(\0132#.google.firestore.admin.v1.Progress\022\026\n" + "\016collection_ids\030\006 \003(\t\022\025\n\r" @@ -157,7 +162,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "!firestore.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.firestore.admin.v1.Progress\":\n" + + "\023progress_percentage\030\010" + + " \001(\0132#.google.firestore.admin.v1.Progress\"\365\002\n" + + "\025CloneDatabaseMetadata\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.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.OperationState\0228\n" + + "\010database\030\004 \001(\tB&\372A#\n" + + "!firestore.googleapis.com/Database\022>\n\r" + + "pitr_snapshot\030\007 \001(\0132\'.google.firestore.admin.v1.PitrSnapshot\022@\n" + + "\023progress_percentage\030\006 \001(\0132#.google.firestore.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" @@ -170,11 +185,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "SUCCESSFUL\020\005\022\n\n" + "\006FAILED\020\006\022\r\n" + "\tCANCELLED\020\007B\335\001\n" - + "\035com.google.firestore.admin.v1B\016OperationProtoP\001Z9cl" - + "oud.google.com/go/firestore/apiv1/admin/" - + "adminpb;adminpb\242\002\004GCFS\252\002\037Google.Cloud.Fi" - + "restore.Admin.V1\312\002\037Google\\Cloud\\Firestor" - + "e\\Admin\\V1\352\002#Google::Cloud::Firestore::Admin::V1b\006proto3" + + "\035com.google.firestore.admin.v1B\016OperationProtoP\001Z9cloud.google.com/go/fire" + + "store/apiv1/admin/adminpb;adminpb\242\002\004GCFS" + + "\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Goo" + + "gle\\Cloud\\Firestore\\Admin\\V1\352\002#Google::C" + + "loud::Firestore::Admin::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -182,6 +197,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.ResourceProto.getDescriptor(), com.google.firestore.admin.v1.IndexProto.getDescriptor(), + com.google.firestore.admin.v1.PitrSnapshotProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_firestore_admin_v1_IndexOperationMetadata_descriptor = @@ -289,8 +305,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "StartTime", "EndTime", "OperationState", "Database", "Backup", "ProgressPercentage", }); - internal_static_google_firestore_admin_v1_Progress_descriptor = + internal_static_google_firestore_admin_v1_CloneDatabaseMetadata_descriptor = getDescriptor().getMessageTypes().get(7); + internal_static_google_firestore_admin_v1_CloneDatabaseMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_CloneDatabaseMetadata_descriptor, + new java.lang.String[] { + "StartTime", + "EndTime", + "OperationState", + "Database", + "PitrSnapshot", + "ProgressPercentage", + }); + internal_static_google_firestore_admin_v1_Progress_descriptor = + getDescriptor().getMessageTypes().get(8); internal_static_google_firestore_admin_v1_Progress_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_Progress_descriptor, @@ -304,6 +333,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.ResourceProto.getDescriptor(); com.google.firestore.admin.v1.IndexProto.getDescriptor(); + com.google.firestore.admin.v1.PitrSnapshotProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshot.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshot.java new file mode 100644 index 000000000..d9e1d2e22 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshot.java @@ -0,0 +1,1066 @@ +/* + * Copyright 2025 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/snapshot.proto + +// Protobuf Java Version: 3.25.8 +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * A consistent snapshot of a database at a specific point in time.
+ * A PITR (Point-in-time recovery) snapshot with previous versions of a
+ * database's data is available for every minute up to the associated database's
+ * data retention period. If the PITR feature is enabled, the retention period
+ * is 7 days; otherwise, it is one hour.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.PitrSnapshot} + */ +public final class PitrSnapshot extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.PitrSnapshot) + PitrSnapshotOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PitrSnapshot.newBuilder() to construct. + private PitrSnapshot(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PitrSnapshot() { + database_ = ""; + databaseUid_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PitrSnapshot(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.PitrSnapshotProto + .internal_static_google_firestore_admin_v1_PitrSnapshot_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.PitrSnapshotProto + .internal_static_google_firestore_admin_v1_PitrSnapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.PitrSnapshot.class, + com.google.firestore.admin.v1.PitrSnapshot.Builder.class); + } + + private int bitField0_; + public static final int DATABASE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object database_ = ""; + + /** + * + * + *
+   * Required. The name of the database that this was a snapshot of. Format:
+   * `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + + /** + * + * + *
+   * Required. The name of the database that this was a snapshot of. Format:
+   * `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.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 = 2; + private com.google.protobuf.ByteString databaseUid_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Output only. Public UUID of the database the snapshot was associated with.
+   * 
+ * + * bytes database_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The databaseUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseUid() { + return databaseUid_; + } + + public static final int SNAPSHOT_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp snapshotTime_; + + /** + * + * + *
+   * Required. Snapshot time of the database.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshotTime field is set. + */ + @java.lang.Override + public boolean hasSnapshotTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Snapshot time of the database.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The snapshotTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSnapshotTime() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + + /** + * + * + *
+   * Required. Snapshot time of the database.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + + 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(database_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, database_); + } + if (!databaseUid_.isEmpty()) { + output.writeBytes(2, databaseUid_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSnapshotTime()); + } + 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(database_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, database_); + } + if (!databaseUid_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, databaseUid_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSnapshotTime()); + } + 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.PitrSnapshot)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.PitrSnapshot other = + (com.google.firestore.admin.v1.PitrSnapshot) obj; + + 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 (!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) + 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(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.PitrSnapshot parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.PitrSnapshot 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.PitrSnapshot parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.PitrSnapshot 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.PitrSnapshot parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.PitrSnapshot 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.PitrSnapshot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.PitrSnapshot 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.PitrSnapshot parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.PitrSnapshot 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.PitrSnapshot 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.PitrSnapshot 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.PitrSnapshot 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 consistent snapshot of a database at a specific point in time.
+   * A PITR (Point-in-time recovery) snapshot with previous versions of a
+   * database's data is available for every minute up to the associated database's
+   * data retention period. If the PITR feature is enabled, the retention period
+   * is 7 days; otherwise, it is one hour.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.PitrSnapshot} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.PitrSnapshot) + com.google.firestore.admin.v1.PitrSnapshotOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.PitrSnapshotProto + .internal_static_google_firestore_admin_v1_PitrSnapshot_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.PitrSnapshotProto + .internal_static_google_firestore_admin_v1_PitrSnapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.PitrSnapshot.class, + com.google.firestore.admin.v1.PitrSnapshot.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.PitrSnapshot.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + database_ = ""; + databaseUid_ = com.google.protobuf.ByteString.EMPTY; + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.PitrSnapshotProto + .internal_static_google_firestore_admin_v1_PitrSnapshot_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.PitrSnapshot getDefaultInstanceForType() { + return com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.PitrSnapshot build() { + com.google.firestore.admin.v1.PitrSnapshot result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.PitrSnapshot buildPartial() { + com.google.firestore.admin.v1.PitrSnapshot result = + new com.google.firestore.admin.v1.PitrSnapshot(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.PitrSnapshot result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.database_ = database_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.databaseUid_ = databaseUid_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.snapshotTime_ = + snapshotTimeBuilder_ == null ? snapshotTime_ : snapshotTimeBuilder_.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.PitrSnapshot) { + return mergeFrom((com.google.firestore.admin.v1.PitrSnapshot) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.PitrSnapshot other) { + if (other == com.google.firestore.admin.v1.PitrSnapshot.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getDatabaseUid() != com.google.protobuf.ByteString.EMPTY) { + setDatabaseUid(other.getDatabaseUid()); + } + if (other.hasSnapshotTime()) { + mergeSnapshotTime(other.getSnapshotTime()); + } + 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: + { + database_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + databaseUid_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getSnapshotTimeFieldBuilder().getBuilder(), extensionRegistry); + 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 database_ = ""; + + /** + * + * + *
+     * Required. The name of the database that this was a snapshot of. Format:
+     * `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + + /** + * + * + *
+     * Required. The name of the database that this was a snapshot of. Format:
+     * `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + + /** + * + * + *
+     * Required. The name of the database that this was a snapshot of. Format:
+     * `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the database that this was a snapshot of. Format:
+     * `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + database_ = getDefaultInstance().getDatabase(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the database that this was a snapshot of. Format:
+     * `projects/{project}/databases/{database}`.
+     * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.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_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString databaseUid_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Output only. Public UUID of the database the snapshot was associated with.
+     * 
+ * + * bytes database_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The databaseUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseUid() { + return databaseUid_; + } + + /** + * + * + *
+     * Output only. Public UUID of the database the snapshot was associated with.
+     * 
+ * + * bytes database_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The databaseUid to set. + * @return This builder for chaining. + */ + public Builder setDatabaseUid(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + databaseUid_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Public UUID of the database the snapshot was associated with.
+     * 
+ * + * bytes database_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseUid() { + bitField0_ = (bitField0_ & ~0x00000002); + databaseUid_ = getDefaultInstance().getDatabaseUid(); + 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_; + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshotTime field is set. + */ + public boolean hasSnapshotTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshotTime_ = value; + } else { + snapshotTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (snapshotTimeBuilder_ == null) { + snapshotTime_ = builderForValue.build(); + } else { + snapshotTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && snapshotTime_ != null + && snapshotTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSnapshotTimeBuilder().mergeFrom(value); + } else { + snapshotTime_ = value; + } + } else { + snapshotTimeBuilder_.mergeFrom(value); + } + if (snapshotTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSnapshotTime() { + bitField0_ = (bitField0_ & ~0x00000004); + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getSnapshotTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSnapshotTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + if (snapshotTimeBuilder_ != null) { + return snapshotTimeBuilder_.getMessageOrBuilder(); + } else { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + } + + /** + * + * + *
+     * Required. Snapshot time of the database.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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_; + } + + @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.PitrSnapshot) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.PitrSnapshot) + private static final com.google.firestore.admin.v1.PitrSnapshot DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.PitrSnapshot(); + } + + public static com.google.firestore.admin.v1.PitrSnapshot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PitrSnapshot 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.PitrSnapshot getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshotOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshotOrBuilder.java new file mode 100644 index 000000000..bbb6c7e1a --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshotOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 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/snapshot.proto + +// Protobuf Java Version: 3.25.8 +package com.google.firestore.admin.v1; + +public interface PitrSnapshotOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.PitrSnapshot) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the database that this was a snapshot of. Format:
+   * `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The database. + */ + java.lang.String getDatabase(); + + /** + * + * + *
+   * Required. The name of the database that this was a snapshot of. Format:
+   * `projects/{project}/databases/{database}`.
+   * 
+ * + * + * string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Output only. Public UUID of the database the snapshot was associated with.
+   * 
+ * + * bytes database_uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The databaseUid. + */ + com.google.protobuf.ByteString getDatabaseUid(); + + /** + * + * + *
+   * Required. Snapshot time of the database.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the snapshotTime field is set. + */ + boolean hasSnapshotTime(); + + /** + * + * + *
+   * Required. Snapshot time of the database.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The snapshotTime. + */ + com.google.protobuf.Timestamp getSnapshotTime(); + + /** + * + * + *
+   * Required. Snapshot time of the database.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshotProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshotProto.java new file mode 100644 index 000000000..1646923f2 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/PitrSnapshotProto.java @@ -0,0 +1,87 @@ +/* + * Copyright 2025 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/snapshot.proto + +// Protobuf Java Version: 3.25.8 +package com.google.firestore.admin.v1; + +public final class PitrSnapshotProto { + private PitrSnapshotProto() {} + + 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_PitrSnapshot_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_PitrSnapshot_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/snapshot.pro" + + "to\022\031google.firestore.admin.v1\032\037google/ap" + + "i/field_behavior.proto\032\031google/api/resou" + + "rce.proto\032\037google/protobuf/timestamp.pro" + + "to\"\236\001\n\014PitrSnapshot\022;\n\010database\030\001 \001(\tB)\340" + + "A\002\372A#\n!firestore.googleapis.com/Database" + + "\022\031\n\014database_uid\030\002 \001(\014B\003\340A\003\0226\n\rsnapshot_" + + "time\030\003 \001(\0132\032.google.protobuf.TimestampB\003" + + "\340A\002B\340\001\n\035com.google.firestore.admin.v1B\021P" + + "itrSnapshotProtoP\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( + 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_PitrSnapshot_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_admin_v1_PitrSnapshot_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_PitrSnapshot_descriptor, + new java.lang.String[] { + "Database", "DatabaseUid", "SnapshotTime", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + 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/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 63dfd74e4..1d4efbdde 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,12 +20,14 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/api/routing.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/firestore/admin/v1/snapshot.proto"; import "google/firestore/admin/v1/user_creds.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; @@ -458,6 +460,45 @@ service FirestoreAdmin { }; option (google.api.method_signature) = "name"; } + + // Creates a new database by cloning an existing one. + // + // The new database must be in the same cloud region or multi-region location + // as the existing database. This behaves similar to + // [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.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 + // database. + // + // The [long-running operation][google.longrunning.Operation] can be used to + // track the progress of the clone, with the Operation's + // [metadata][google.longrunning.Operation.metadata] field type being the + // [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] type is the + // [Database][google.firestore.admin.v1.Database] if the clone was + // successful. The new database is not readable or writeable until the LRO has + // completed. + rpc CloneDatabase(CloneDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/databases:clone" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "pitr_snapshot.database" + path_template: "projects/{project_id=*}/**" + } + routing_parameters { + field: "pitr_snapshot.database" + path_template: "projects/*/databases/{database_id=*}/**" + } + }; + option (google.longrunning.operation_info) = { + response_type: "Database" + metadata_type: "CloneDatabaseMetadata" + }; + } } // A request to list the Firestore Databases in all locations for a project. @@ -1137,3 +1178,51 @@ message RestoreDatabaseRequest { (google.api.field_behavior) = OPTIONAL ]; } + +// The request message for +// [FirestoreAdmin.CloneDatabase][google.firestore.admin.v1.FirestoreAdmin.CloneDatabase]. +message CloneDatabaseRequest { + // Required. The project to clone 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. Specification of the PITR data to clone from. The source database + // must exist. + // + // The cloned database will be created in the same location as the source + // database. + PitrSnapshot pitr_snapshot = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Encryption configuration for the cloned database. + // + // If this field is not specified, the cloned database will use + // the same encryption configuration as the source database, namely + // [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]. + Database.EncryptionConfig encryption_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. Tags to be bound to the cloned database. + // + // The tags should be provided in the format of + // `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`. + map tags = 5 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} 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 b92ae2d4d..6fa21489f 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 @@ -18,6 +18,7 @@ package google.firestore.admin.v1; import "google/api/resource.proto"; import "google/firestore/admin/v1/index.proto"; +import "google/firestore/admin/v1/snapshot.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; @@ -259,6 +260,30 @@ message RestoreDatabaseMetadata { Progress progress_percentage = 8; } +// Metadata for the [long-running operation][google.longrunning.Operation] from +// the [CloneDatabase][google.firestore.admin.v1.CloneDatabase] request. +message CloneDatabaseMetadata { + // The time the clone was started. + google.protobuf.Timestamp start_time = 1; + + // The time the clone finished, unset for ongoing clones. + google.protobuf.Timestamp end_time = 2; + + // The operation state of the clone. + OperationState operation_state = 3; + + // The name of the database being cloned to. + string database = 4 [(google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + }]; + + // The snapshot from which this database was cloned. + PitrSnapshot pitr_snapshot = 7; + + // How far along the clone is as an estimated percentage of remaining time. + Progress progress_percentage = 6; +} + // 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. diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/snapshot.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/snapshot.proto new file mode 100644 index 000000000..895bed4da --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/snapshot.proto @@ -0,0 +1,53 @@ +// Copyright 2025 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 = "PitrSnapshotProto"; +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 consistent snapshot of a database at a specific point in time. +// A PITR (Point-in-time recovery) snapshot with previous versions of a +// database's data is available for every minute up to the associated database's +// data retention period. If the PITR feature is enabled, the retention period +// is 7 days; otherwise, it is one hour. +message PitrSnapshot { + // Required. The name of the database that this was a snapshot of. Format: + // `projects/{project}/databases/{database}`. + string database = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + } + ]; + + // Output only. Public UUID of the database the snapshot was associated with. + bytes database_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Snapshot time of the database. + google.protobuf.Timestamp snapshot_time = 3 + [(google.api.field_behavior) = REQUIRED]; +}