diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java
index 4cd40abd24..6506cf93bc 100644
--- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java
+++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java
@@ -31,12 +31,19 @@
import com.google.cloud.firestore.v1.stub.FirestoreAdminStub;
import com.google.cloud.firestore.v1.stub.FirestoreAdminStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
+import com.google.firestore.admin.v1.Backup;
+import com.google.firestore.admin.v1.BackupName;
+import com.google.firestore.admin.v1.BackupSchedule;
+import com.google.firestore.admin.v1.BackupScheduleName;
import com.google.firestore.admin.v1.CollectionGroupName;
+import com.google.firestore.admin.v1.CreateBackupScheduleRequest;
import com.google.firestore.admin.v1.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
import com.google.firestore.admin.v1.DatabaseName;
+import com.google.firestore.admin.v1.DeleteBackupRequest;
+import com.google.firestore.admin.v1.DeleteBackupScheduleRequest;
import com.google.firestore.admin.v1.DeleteDatabaseMetadata;
import com.google.firestore.admin.v1.DeleteDatabaseRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
@@ -46,6 +53,8 @@
import com.google.firestore.admin.v1.Field;
import com.google.firestore.admin.v1.FieldName;
import com.google.firestore.admin.v1.FieldOperationMetadata;
+import com.google.firestore.admin.v1.GetBackupRequest;
+import com.google.firestore.admin.v1.GetBackupScheduleRequest;
import com.google.firestore.admin.v1.GetDatabaseRequest;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
@@ -54,13 +63,21 @@
import com.google.firestore.admin.v1.Index;
import com.google.firestore.admin.v1.IndexName;
import com.google.firestore.admin.v1.IndexOperationMetadata;
+import com.google.firestore.admin.v1.ListBackupSchedulesRequest;
+import com.google.firestore.admin.v1.ListBackupSchedulesResponse;
+import com.google.firestore.admin.v1.ListBackupsRequest;
+import com.google.firestore.admin.v1.ListBackupsResponse;
import com.google.firestore.admin.v1.ListDatabasesRequest;
import com.google.firestore.admin.v1.ListDatabasesResponse;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
import com.google.firestore.admin.v1.ListIndexesResponse;
+import com.google.firestore.admin.v1.LocationName;
import com.google.firestore.admin.v1.ProjectName;
+import com.google.firestore.admin.v1.RestoreDatabaseMetadata;
+import com.google.firestore.admin.v1.RestoreDatabaseRequest;
+import com.google.firestore.admin.v1.UpdateBackupScheduleRequest;
import com.google.firestore.admin.v1.UpdateDatabaseMetadata;
import com.google.firestore.admin.v1.UpdateDatabaseRequest;
import com.google.firestore.admin.v1.UpdateFieldRequest;
@@ -403,6 +420,174 @@
*
*
*
+ *
+ * GetBackup |
+ * Gets information about a backup. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getBackupCallable()
+ *
+ * |
+ *
+ *
+ * ListBackups |
+ * Lists all the backups. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * DeleteBackup |
+ * Deletes a backup. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * RestoreDatabase |
+ * Creates a new database by restoring from an existing backup.
+ * The new database must be in the same cloud region or multi-region location as the existing backup. This behaves similar to [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing backup.
+ * The [long-running operation][google.longrunning.Operation] can be used to track the progress of the restore, with the Operation's [metadata][google.longrunning.Operation.metadata] field type being the [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. The [response][google.longrunning.Operation.response] type is the [Database][google.firestore.admin.v1.Database] if the restore was successful. The new database is not readable or writeable until the LRO has completed. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * CreateBackupSchedule |
+ * Creates a backup schedule on a database. At most two backup schedules can be configured on a database, one daily backup schedule with retention up to 7 days and one weekly backup schedule with retention up to 14 weeks. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * createBackupSchedule(DatabaseName parent, BackupSchedule backupSchedule)
+ * createBackupSchedule(String parent, BackupSchedule backupSchedule)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * GetBackupSchedule |
+ * Gets information about a backup schedule. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * ListBackupSchedules |
+ * List backup schedules. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * UpdateBackupSchedule |
+ * Updates a backup schedule. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * DeleteBackupSchedule |
+ * Deletes a backup schedule. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
*
*
* See the individual methods for example code.
@@ -2584,6 +2769,1051 @@ public final UnaryCallable deleteDatabaseCalla
return stub.deleteDatabaseCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a backup.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+ * Backup response = firestoreAdminClient.getBackup(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup to fetch.
+ * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Backup getBackup(BackupName name) {
+ GetBackupRequest request =
+ GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getBackup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a backup.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+ * Backup response = firestoreAdminClient.getBackup(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup to fetch.
+ * Format is `projects/{project}/locations/{location}/backups/{backup}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Backup getBackup(String name) {
+ GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build();
+ return getBackup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a backup.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * GetBackupRequest request =
+ * GetBackupRequest.newBuilder()
+ * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+ * .build();
+ * Backup response = firestoreAdminClient.getBackup(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Backup getBackup(GetBackupRequest request) {
+ return getBackupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a backup.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * GetBackupRequest request =
+ * GetBackupRequest.newBuilder()
+ * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+ * .build();
+ * ApiFuture future = firestoreAdminClient.getBackupCallable().futureCall(request);
+ * // Do something.
+ * Backup response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getBackupCallable() {
+ return stub.getBackupCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all the backups.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * ListBackupsResponse response = firestoreAdminClient.listBackups(parent);
+ * }
+ * }
+ *
+ * @param parent Required. The location to list backups from.
+ * Format is `projects/{project}/locations/{location}`. Use `{location} = '-'` to list
+ * backups from all locations for the given project. This allows listing backups from a single
+ * location or from all locations.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupsResponse listBackups(LocationName parent) {
+ ListBackupsRequest request =
+ ListBackupsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listBackups(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all the backups.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * ListBackupsResponse response = firestoreAdminClient.listBackups(parent);
+ * }
+ * }
+ *
+ * @param parent Required. The location to list backups from.
+ * Format is `projects/{project}/locations/{location}`. Use `{location} = '-'` to list
+ * backups from all locations for the given project. This allows listing backups from a single
+ * location or from all locations.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupsResponse listBackups(String parent) {
+ ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build();
+ return listBackups(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all the backups.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * ListBackupsRequest request =
+ * ListBackupsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * ListBackupsResponse response = firestoreAdminClient.listBackups(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupsResponse listBackups(ListBackupsRequest request) {
+ return listBackupsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all the backups.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * ListBackupsRequest request =
+ * ListBackupsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * ApiFuture future =
+ * firestoreAdminClient.listBackupsCallable().futureCall(request);
+ * // Do something.
+ * ListBackupsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable listBackupsCallable() {
+ return stub.listBackupsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a backup.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
+ * firestoreAdminClient.deleteBackup(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup to delete.
+ * format is `projects/{project}/locations/{location}/backups/{backup}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBackup(BackupName name) {
+ DeleteBackupRequest request =
+ DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteBackup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a backup.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
+ * firestoreAdminClient.deleteBackup(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup to delete.
+ * format is `projects/{project}/locations/{location}/backups/{backup}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBackup(String name) {
+ DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build();
+ deleteBackup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a backup.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * DeleteBackupRequest request =
+ * DeleteBackupRequest.newBuilder()
+ * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+ * .build();
+ * firestoreAdminClient.deleteBackup(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBackup(DeleteBackupRequest request) {
+ deleteBackupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a backup.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * DeleteBackupRequest request =
+ * DeleteBackupRequest.newBuilder()
+ * .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+ * .build();
+ * ApiFuture future = firestoreAdminClient.deleteBackupCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable deleteBackupCallable() {
+ return stub.deleteBackupCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new database by restoring from an existing backup.
+ *
+ * The new database must be in the same cloud region or multi-region location as the existing
+ * backup. This behaves similar to
+ * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] except instead of
+ * creating a new empty database, a new database is created with the database type, index
+ * configuration, and documents from an existing backup.
+ *
+ *
The [long-running operation][google.longrunning.Operation] can be used to track the progress
+ * of the restore, with the Operation's [metadata][google.longrunning.Operation.metadata] field
+ * type being the [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
+ * The [response][google.longrunning.Operation.response] type is the
+ * [Database][google.firestore.admin.v1.Database] if the restore was successful. The new database
+ * is not readable or writeable until the LRO has completed.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * RestoreDatabaseRequest request =
+ * RestoreDatabaseRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setDatabaseId("databaseId1688905718")
+ * .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+ * .build();
+ * Database response = firestoreAdminClient.restoreDatabaseAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture restoreDatabaseAsync(
+ RestoreDatabaseRequest request) {
+ return restoreDatabaseOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new database by restoring from an existing backup.
+ *
+ * The new database must be in the same cloud region or multi-region location as the existing
+ * backup. This behaves similar to
+ * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] except instead of
+ * creating a new empty database, a new database is created with the database type, index
+ * configuration, and documents from an existing backup.
+ *
+ *
The [long-running operation][google.longrunning.Operation] can be used to track the progress
+ * of the restore, with the Operation's [metadata][google.longrunning.Operation.metadata] field
+ * type being the [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
+ * The [response][google.longrunning.Operation.response] type is the
+ * [Database][google.firestore.admin.v1.Database] if the restore was successful. The new database
+ * is not readable or writeable until the LRO has completed.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * RestoreDatabaseRequest request =
+ * RestoreDatabaseRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setDatabaseId("databaseId1688905718")
+ * .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+ * .build();
+ * OperationFuture future =
+ * firestoreAdminClient.restoreDatabaseOperationCallable().futureCall(request);
+ * // Do something.
+ * Database response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable
+ restoreDatabaseOperationCallable() {
+ return stub.restoreDatabaseOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new database by restoring from an existing backup.
+ *
+ * The new database must be in the same cloud region or multi-region location as the existing
+ * backup. This behaves similar to
+ * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] except instead of
+ * creating a new empty database, a new database is created with the database type, index
+ * configuration, and documents from an existing backup.
+ *
+ *
The [long-running operation][google.longrunning.Operation] can be used to track the progress
+ * of the restore, with the Operation's [metadata][google.longrunning.Operation.metadata] field
+ * type being the [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
+ * The [response][google.longrunning.Operation.response] type is the
+ * [Database][google.firestore.admin.v1.Database] if the restore was successful. The new database
+ * is not readable or writeable until the LRO has completed.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * RestoreDatabaseRequest request =
+ * RestoreDatabaseRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setDatabaseId("databaseId1688905718")
+ * .setBackup(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
+ * .build();
+ * ApiFuture future =
+ * firestoreAdminClient.restoreDatabaseCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable restoreDatabaseCallable() {
+ return stub.restoreDatabaseCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a backup schedule on a database. At most two backup schedules can be configured on a
+ * database, one daily backup schedule with retention up to 7 days and one weekly backup schedule
+ * with retention up to 14 weeks.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]");
+ * BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+ * BackupSchedule response = firestoreAdminClient.createBackupSchedule(parent, backupSchedule);
+ * }
+ * }
+ *
+ * @param parent Required. The parent database.
+ * Format `projects/{project}/databases/{database}`
+ * @param backupSchedule Required. The backup schedule to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupSchedule createBackupSchedule(
+ DatabaseName parent, BackupSchedule backupSchedule) {
+ CreateBackupScheduleRequest request =
+ CreateBackupScheduleRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setBackupSchedule(backupSchedule)
+ .build();
+ return createBackupSchedule(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a backup schedule on a database. At most two backup schedules can be configured on a
+ * database, one daily backup schedule with retention up to 7 days and one weekly backup schedule
+ * with retention up to 14 weeks.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * String parent = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
+ * BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+ * BackupSchedule response = firestoreAdminClient.createBackupSchedule(parent, backupSchedule);
+ * }
+ * }
+ *
+ * @param parent Required. The parent database.
+ * Format `projects/{project}/databases/{database}`
+ * @param backupSchedule Required. The backup schedule to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupSchedule createBackupSchedule(String parent, BackupSchedule backupSchedule) {
+ CreateBackupScheduleRequest request =
+ CreateBackupScheduleRequest.newBuilder()
+ .setParent(parent)
+ .setBackupSchedule(backupSchedule)
+ .build();
+ return createBackupSchedule(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a backup schedule on a database. At most two backup schedules can be configured on a
+ * database, one daily backup schedule with retention up to 7 days and one weekly backup schedule
+ * with retention up to 14 weeks.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * CreateBackupScheduleRequest request =
+ * CreateBackupScheduleRequest.newBuilder()
+ * .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+ * .setBackupSchedule(BackupSchedule.newBuilder().build())
+ * .build();
+ * BackupSchedule response = firestoreAdminClient.createBackupSchedule(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupSchedule createBackupSchedule(CreateBackupScheduleRequest request) {
+ return createBackupScheduleCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a backup schedule on a database. At most two backup schedules can be configured on a
+ * database, one daily backup schedule with retention up to 7 days and one weekly backup schedule
+ * with retention up to 14 weeks.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * CreateBackupScheduleRequest request =
+ * CreateBackupScheduleRequest.newBuilder()
+ * .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+ * .setBackupSchedule(BackupSchedule.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * firestoreAdminClient.createBackupScheduleCallable().futureCall(request);
+ * // Do something.
+ * BackupSchedule response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ createBackupScheduleCallable() {
+ return stub.createBackupScheduleCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a backup schedule.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * BackupScheduleName name =
+ * BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]");
+ * BackupSchedule response = firestoreAdminClient.getBackupSchedule(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the backup schedule.
+ * Format `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupSchedule getBackupSchedule(BackupScheduleName name) {
+ GetBackupScheduleRequest request =
+ GetBackupScheduleRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getBackupSchedule(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a backup schedule.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * String name =
+ * BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString();
+ * BackupSchedule response = firestoreAdminClient.getBackupSchedule(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the backup schedule.
+ * Format `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupSchedule getBackupSchedule(String name) {
+ GetBackupScheduleRequest request = GetBackupScheduleRequest.newBuilder().setName(name).build();
+ return getBackupSchedule(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a backup schedule.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * GetBackupScheduleRequest request =
+ * GetBackupScheduleRequest.newBuilder()
+ * .setName(
+ * BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
+ * .build();
+ * BackupSchedule response = firestoreAdminClient.getBackupSchedule(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupSchedule getBackupSchedule(GetBackupScheduleRequest request) {
+ return getBackupScheduleCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a backup schedule.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * GetBackupScheduleRequest request =
+ * GetBackupScheduleRequest.newBuilder()
+ * .setName(
+ * BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
+ * .build();
+ * ApiFuture future =
+ * firestoreAdminClient.getBackupScheduleCallable().futureCall(request);
+ * // Do something.
+ * BackupSchedule response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getBackupScheduleCallable() {
+ return stub.getBackupScheduleCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List backup schedules.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]");
+ * ListBackupSchedulesResponse response = firestoreAdminClient.listBackupSchedules(parent);
+ * }
+ * }
+ *
+ * @param parent Required. The parent database.
+ * Format is `projects/{project}/databases/{database}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupSchedulesResponse listBackupSchedules(DatabaseName parent) {
+ ListBackupSchedulesRequest request =
+ ListBackupSchedulesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listBackupSchedules(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List backup schedules.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * String parent = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
+ * ListBackupSchedulesResponse response = firestoreAdminClient.listBackupSchedules(parent);
+ * }
+ * }
+ *
+ * @param parent Required. The parent database.
+ * Format is `projects/{project}/databases/{database}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupSchedulesResponse listBackupSchedules(String parent) {
+ ListBackupSchedulesRequest request =
+ ListBackupSchedulesRequest.newBuilder().setParent(parent).build();
+ return listBackupSchedules(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List backup schedules.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * ListBackupSchedulesRequest request =
+ * ListBackupSchedulesRequest.newBuilder()
+ * .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+ * .build();
+ * ListBackupSchedulesResponse response = firestoreAdminClient.listBackupSchedules(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupSchedulesResponse listBackupSchedules(ListBackupSchedulesRequest request) {
+ return listBackupSchedulesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List backup schedules.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * ListBackupSchedulesRequest request =
+ * ListBackupSchedulesRequest.newBuilder()
+ * .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+ * .build();
+ * ApiFuture future =
+ * firestoreAdminClient.listBackupSchedulesCallable().futureCall(request);
+ * // Do something.
+ * ListBackupSchedulesResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listBackupSchedulesCallable() {
+ return stub.listBackupSchedulesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a backup schedule.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * BackupSchedule backupSchedule = BackupSchedule.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * BackupSchedule response =
+ * firestoreAdminClient.updateBackupSchedule(backupSchedule, updateMask);
+ * }
+ * }
+ *
+ * @param backupSchedule Required. The backup schedule to update.
+ * @param updateMask The list of fields to be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupSchedule updateBackupSchedule(
+ BackupSchedule backupSchedule, FieldMask updateMask) {
+ UpdateBackupScheduleRequest request =
+ UpdateBackupScheduleRequest.newBuilder()
+ .setBackupSchedule(backupSchedule)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateBackupSchedule(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a backup schedule.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * UpdateBackupScheduleRequest request =
+ * UpdateBackupScheduleRequest.newBuilder()
+ * .setBackupSchedule(BackupSchedule.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * BackupSchedule response = firestoreAdminClient.updateBackupSchedule(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupSchedule updateBackupSchedule(UpdateBackupScheduleRequest request) {
+ return updateBackupScheduleCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a backup schedule.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * UpdateBackupScheduleRequest request =
+ * UpdateBackupScheduleRequest.newBuilder()
+ * .setBackupSchedule(BackupSchedule.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * firestoreAdminClient.updateBackupScheduleCallable().futureCall(request);
+ * // Do something.
+ * BackupSchedule response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ updateBackupScheduleCallable() {
+ return stub.updateBackupScheduleCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a backup schedule.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * BackupScheduleName name =
+ * BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]");
+ * firestoreAdminClient.deleteBackupSchedule(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of backup schedule.
+ * Format `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBackupSchedule(BackupScheduleName name) {
+ DeleteBackupScheduleRequest request =
+ DeleteBackupScheduleRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteBackupSchedule(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a backup schedule.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * String name =
+ * BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString();
+ * firestoreAdminClient.deleteBackupSchedule(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of backup schedule.
+ * Format `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBackupSchedule(String name) {
+ DeleteBackupScheduleRequest request =
+ DeleteBackupScheduleRequest.newBuilder().setName(name).build();
+ deleteBackupSchedule(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a backup schedule.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * DeleteBackupScheduleRequest request =
+ * DeleteBackupScheduleRequest.newBuilder()
+ * .setName(
+ * BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
+ * .build();
+ * firestoreAdminClient.deleteBackupSchedule(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBackupSchedule(DeleteBackupScheduleRequest request) {
+ deleteBackupScheduleCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a backup schedule.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * DeleteBackupScheduleRequest request =
+ * DeleteBackupScheduleRequest.newBuilder()
+ * .setName(
+ * BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
+ * .build();
+ * ApiFuture future =
+ * firestoreAdminClient.deleteBackupScheduleCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable deleteBackupScheduleCallable() {
+ return stub.deleteBackupScheduleCallable();
+ }
+
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java
index ee2077bdaf..476ccec67a 100644
--- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java
+++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java
@@ -33,10 +33,15 @@
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.firestore.v1.stub.FirestoreAdminStubSettings;
+import com.google.firestore.admin.v1.Backup;
+import com.google.firestore.admin.v1.BackupSchedule;
+import com.google.firestore.admin.v1.CreateBackupScheduleRequest;
import com.google.firestore.admin.v1.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
+import com.google.firestore.admin.v1.DeleteBackupRequest;
+import com.google.firestore.admin.v1.DeleteBackupScheduleRequest;
import com.google.firestore.admin.v1.DeleteDatabaseMetadata;
import com.google.firestore.admin.v1.DeleteDatabaseRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
@@ -45,6 +50,8 @@
import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
import com.google.firestore.admin.v1.FieldOperationMetadata;
+import com.google.firestore.admin.v1.GetBackupRequest;
+import com.google.firestore.admin.v1.GetBackupScheduleRequest;
import com.google.firestore.admin.v1.GetDatabaseRequest;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
@@ -52,12 +59,19 @@
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
import com.google.firestore.admin.v1.IndexOperationMetadata;
+import com.google.firestore.admin.v1.ListBackupSchedulesRequest;
+import com.google.firestore.admin.v1.ListBackupSchedulesResponse;
+import com.google.firestore.admin.v1.ListBackupsRequest;
+import com.google.firestore.admin.v1.ListBackupsResponse;
import com.google.firestore.admin.v1.ListDatabasesRequest;
import com.google.firestore.admin.v1.ListDatabasesResponse;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
import com.google.firestore.admin.v1.ListIndexesResponse;
+import com.google.firestore.admin.v1.RestoreDatabaseMetadata;
+import com.google.firestore.admin.v1.RestoreDatabaseRequest;
+import com.google.firestore.admin.v1.UpdateBackupScheduleRequest;
import com.google.firestore.admin.v1.UpdateDatabaseMetadata;
import com.google.firestore.admin.v1.UpdateDatabaseRequest;
import com.google.firestore.admin.v1.UpdateFieldRequest;
@@ -222,6 +236,60 @@ public UnaryCallSettings deleteDatabaseSetting
return ((FirestoreAdminStubSettings) getStubSettings()).deleteDatabaseOperationSettings();
}
+ /** Returns the object with the settings used for calls to getBackup. */
+ public UnaryCallSettings getBackupSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).getBackupSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listBackups. */
+ public UnaryCallSettings listBackupsSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).listBackupsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteBackup. */
+ public UnaryCallSettings deleteBackupSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).deleteBackupSettings();
+ }
+
+ /** Returns the object with the settings used for calls to restoreDatabase. */
+ public UnaryCallSettings restoreDatabaseSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).restoreDatabaseSettings();
+ }
+
+ /** Returns the object with the settings used for calls to restoreDatabase. */
+ public OperationCallSettings
+ restoreDatabaseOperationSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).restoreDatabaseOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createBackupSchedule. */
+ public UnaryCallSettings
+ createBackupScheduleSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).createBackupScheduleSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getBackupSchedule. */
+ public UnaryCallSettings getBackupScheduleSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).getBackupScheduleSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listBackupSchedules. */
+ public UnaryCallSettings
+ listBackupSchedulesSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).listBackupSchedulesSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updateBackupSchedule. */
+ public UnaryCallSettings
+ updateBackupScheduleSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).updateBackupScheduleSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteBackupSchedule. */
+ public UnaryCallSettings deleteBackupScheduleSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).deleteBackupScheduleSettings();
+ }
+
public static final FirestoreAdminSettings create(FirestoreAdminStubSettings stub)
throws IOException {
return new FirestoreAdminSettings.Builder(stub.toBuilder()).build();
@@ -451,6 +519,63 @@ public UnaryCallSettings.Builder deleteDatabas
return getStubSettingsBuilder().deleteDatabaseOperationSettings();
}
+ /** Returns the builder for the settings used for calls to getBackup. */
+ public UnaryCallSettings.Builder getBackupSettings() {
+ return getStubSettingsBuilder().getBackupSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listBackups. */
+ public UnaryCallSettings.Builder
+ listBackupsSettings() {
+ return getStubSettingsBuilder().listBackupsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteBackup. */
+ public UnaryCallSettings.Builder deleteBackupSettings() {
+ return getStubSettingsBuilder().deleteBackupSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to restoreDatabase. */
+ public UnaryCallSettings.Builder restoreDatabaseSettings() {
+ return getStubSettingsBuilder().restoreDatabaseSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to restoreDatabase. */
+ public OperationCallSettings.Builder
+ restoreDatabaseOperationSettings() {
+ return getStubSettingsBuilder().restoreDatabaseOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createBackupSchedule. */
+ public UnaryCallSettings.Builder
+ createBackupScheduleSettings() {
+ return getStubSettingsBuilder().createBackupScheduleSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getBackupSchedule. */
+ public UnaryCallSettings.Builder
+ getBackupScheduleSettings() {
+ return getStubSettingsBuilder().getBackupScheduleSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listBackupSchedules. */
+ public UnaryCallSettings.Builder
+ listBackupSchedulesSettings() {
+ return getStubSettingsBuilder().listBackupSchedulesSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updateBackupSchedule. */
+ public UnaryCallSettings.Builder
+ updateBackupScheduleSettings() {
+ return getStubSettingsBuilder().updateBackupScheduleSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteBackupSchedule. */
+ public UnaryCallSettings.Builder
+ deleteBackupScheduleSettings() {
+ return getStubSettingsBuilder().deleteBackupScheduleSettings();
+ }
+
@Override
public FirestoreAdminSettings build() throws IOException {
return new FirestoreAdminSettings(this);
diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json
index aaa8b74b82..727ba40b1c 100644
--- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json
+++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json
@@ -10,12 +10,21 @@
"grpc": {
"libraryClient": "FirestoreAdminClient",
"rpcs": {
+ "CreateBackupSchedule": {
+ "methods": ["createBackupSchedule", "createBackupSchedule", "createBackupSchedule", "createBackupScheduleCallable"]
+ },
"CreateDatabase": {
"methods": ["createDatabaseAsync", "createDatabaseAsync", "createDatabaseAsync", "createDatabaseOperationCallable", "createDatabaseCallable"]
},
"CreateIndex": {
"methods": ["createIndexAsync", "createIndexAsync", "createIndexAsync", "createIndexOperationCallable", "createIndexCallable"]
},
+ "DeleteBackup": {
+ "methods": ["deleteBackup", "deleteBackup", "deleteBackup", "deleteBackupCallable"]
+ },
+ "DeleteBackupSchedule": {
+ "methods": ["deleteBackupSchedule", "deleteBackupSchedule", "deleteBackupSchedule", "deleteBackupScheduleCallable"]
+ },
"DeleteDatabase": {
"methods": ["deleteDatabaseAsync", "deleteDatabaseAsync", "deleteDatabaseAsync", "deleteDatabaseOperationCallable", "deleteDatabaseCallable"]
},
@@ -25,6 +34,12 @@
"ExportDocuments": {
"methods": ["exportDocumentsAsync", "exportDocumentsAsync", "exportDocumentsAsync", "exportDocumentsOperationCallable", "exportDocumentsCallable"]
},
+ "GetBackup": {
+ "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"]
+ },
+ "GetBackupSchedule": {
+ "methods": ["getBackupSchedule", "getBackupSchedule", "getBackupSchedule", "getBackupScheduleCallable"]
+ },
"GetDatabase": {
"methods": ["getDatabase", "getDatabase", "getDatabase", "getDatabaseCallable"]
},
@@ -37,6 +52,12 @@
"ImportDocuments": {
"methods": ["importDocumentsAsync", "importDocumentsAsync", "importDocumentsAsync", "importDocumentsOperationCallable", "importDocumentsCallable"]
},
+ "ListBackupSchedules": {
+ "methods": ["listBackupSchedules", "listBackupSchedules", "listBackupSchedules", "listBackupSchedulesCallable"]
+ },
+ "ListBackups": {
+ "methods": ["listBackups", "listBackups", "listBackups", "listBackupsCallable"]
+ },
"ListDatabases": {
"methods": ["listDatabases", "listDatabases", "listDatabases", "listDatabasesCallable"]
},
@@ -46,6 +67,12 @@
"ListIndexes": {
"methods": ["listIndexes", "listIndexes", "listIndexes", "listIndexesPagedCallable", "listIndexesCallable"]
},
+ "RestoreDatabase": {
+ "methods": ["restoreDatabaseAsync", "restoreDatabaseOperationCallable", "restoreDatabaseCallable"]
+ },
+ "UpdateBackupSchedule": {
+ "methods": ["updateBackupSchedule", "updateBackupSchedule", "updateBackupScheduleCallable"]
+ },
"UpdateDatabase": {
"methods": ["updateDatabaseAsync", "updateDatabaseAsync", "updateDatabaseOperationCallable", "updateDatabaseCallable"]
},
diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java
index fa51f0cb47..26db1092aa 100644
--- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java
+++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java
@@ -22,10 +22,15 @@
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.firestore.admin.v1.Backup;
+import com.google.firestore.admin.v1.BackupSchedule;
+import com.google.firestore.admin.v1.CreateBackupScheduleRequest;
import com.google.firestore.admin.v1.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
+import com.google.firestore.admin.v1.DeleteBackupRequest;
+import com.google.firestore.admin.v1.DeleteBackupScheduleRequest;
import com.google.firestore.admin.v1.DeleteDatabaseMetadata;
import com.google.firestore.admin.v1.DeleteDatabaseRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
@@ -34,6 +39,8 @@
import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
import com.google.firestore.admin.v1.FieldOperationMetadata;
+import com.google.firestore.admin.v1.GetBackupRequest;
+import com.google.firestore.admin.v1.GetBackupScheduleRequest;
import com.google.firestore.admin.v1.GetDatabaseRequest;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
@@ -41,12 +48,19 @@
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
import com.google.firestore.admin.v1.IndexOperationMetadata;
+import com.google.firestore.admin.v1.ListBackupSchedulesRequest;
+import com.google.firestore.admin.v1.ListBackupSchedulesResponse;
+import com.google.firestore.admin.v1.ListBackupsRequest;
+import com.google.firestore.admin.v1.ListBackupsResponse;
import com.google.firestore.admin.v1.ListDatabasesRequest;
import com.google.firestore.admin.v1.ListDatabasesResponse;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
import com.google.firestore.admin.v1.ListIndexesResponse;
+import com.google.firestore.admin.v1.RestoreDatabaseMetadata;
+import com.google.firestore.admin.v1.RestoreDatabaseRequest;
+import com.google.firestore.admin.v1.UpdateBackupScheduleRequest;
import com.google.firestore.admin.v1.UpdateDatabaseMetadata;
import com.google.firestore.admin.v1.UpdateDatabaseRequest;
import com.google.firestore.admin.v1.UpdateFieldRequest;
@@ -171,6 +185,48 @@ public UnaryCallable deleteDatabaseCallable()
throw new UnsupportedOperationException("Not implemented: deleteDatabaseCallable()");
}
+ public UnaryCallable getBackupCallable() {
+ throw new UnsupportedOperationException("Not implemented: getBackupCallable()");
+ }
+
+ public UnaryCallable listBackupsCallable() {
+ throw new UnsupportedOperationException("Not implemented: listBackupsCallable()");
+ }
+
+ public UnaryCallable deleteBackupCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()");
+ }
+
+ public OperationCallable
+ restoreDatabaseOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: restoreDatabaseOperationCallable()");
+ }
+
+ public UnaryCallable restoreDatabaseCallable() {
+ throw new UnsupportedOperationException("Not implemented: restoreDatabaseCallable()");
+ }
+
+ public UnaryCallable createBackupScheduleCallable() {
+ throw new UnsupportedOperationException("Not implemented: createBackupScheduleCallable()");
+ }
+
+ public UnaryCallable getBackupScheduleCallable() {
+ throw new UnsupportedOperationException("Not implemented: getBackupScheduleCallable()");
+ }
+
+ public UnaryCallable
+ listBackupSchedulesCallable() {
+ throw new UnsupportedOperationException("Not implemented: listBackupSchedulesCallable()");
+ }
+
+ public UnaryCallable updateBackupScheduleCallable() {
+ throw new UnsupportedOperationException("Not implemented: updateBackupScheduleCallable()");
+ }
+
+ public UnaryCallable deleteBackupScheduleCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteBackupScheduleCallable()");
+ }
+
@Override
public abstract void close();
}
diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java
index 7c718c896a..fbcf2bc14f 100644
--- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java
+++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java
@@ -52,10 +52,15 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
+import com.google.firestore.admin.v1.Backup;
+import com.google.firestore.admin.v1.BackupSchedule;
+import com.google.firestore.admin.v1.CreateBackupScheduleRequest;
import com.google.firestore.admin.v1.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
+import com.google.firestore.admin.v1.DeleteBackupRequest;
+import com.google.firestore.admin.v1.DeleteBackupScheduleRequest;
import com.google.firestore.admin.v1.DeleteDatabaseMetadata;
import com.google.firestore.admin.v1.DeleteDatabaseRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
@@ -64,6 +69,8 @@
import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
import com.google.firestore.admin.v1.FieldOperationMetadata;
+import com.google.firestore.admin.v1.GetBackupRequest;
+import com.google.firestore.admin.v1.GetBackupScheduleRequest;
import com.google.firestore.admin.v1.GetDatabaseRequest;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
@@ -71,12 +78,19 @@
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
import com.google.firestore.admin.v1.IndexOperationMetadata;
+import com.google.firestore.admin.v1.ListBackupSchedulesRequest;
+import com.google.firestore.admin.v1.ListBackupSchedulesResponse;
+import com.google.firestore.admin.v1.ListBackupsRequest;
+import com.google.firestore.admin.v1.ListBackupsResponse;
import com.google.firestore.admin.v1.ListDatabasesRequest;
import com.google.firestore.admin.v1.ListDatabasesResponse;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
import com.google.firestore.admin.v1.ListIndexesResponse;
+import com.google.firestore.admin.v1.RestoreDatabaseMetadata;
+import com.google.firestore.admin.v1.RestoreDatabaseRequest;
+import com.google.firestore.admin.v1.UpdateBackupScheduleRequest;
import com.google.firestore.admin.v1.UpdateDatabaseMetadata;
import com.google.firestore.admin.v1.UpdateDatabaseRequest;
import com.google.firestore.admin.v1.UpdateFieldRequest;
@@ -165,6 +179,21 @@ public class FirestoreAdminStubSettings extends StubSettings deleteDatabaseSettings;
private final OperationCallSettings
deleteDatabaseOperationSettings;
+ private final UnaryCallSettings getBackupSettings;
+ private final UnaryCallSettings listBackupsSettings;
+ private final UnaryCallSettings deleteBackupSettings;
+ private final UnaryCallSettings restoreDatabaseSettings;
+ private final OperationCallSettings
+ restoreDatabaseOperationSettings;
+ private final UnaryCallSettings
+ createBackupScheduleSettings;
+ private final UnaryCallSettings
+ getBackupScheduleSettings;
+ private final UnaryCallSettings
+ listBackupSchedulesSettings;
+ private final UnaryCallSettings
+ updateBackupScheduleSettings;
+ private final UnaryCallSettings deleteBackupScheduleSettings;
private static final PagedListDescriptor
LIST_INDEXES_PAGE_STR_DESC =
@@ -387,6 +416,60 @@ public UnaryCallSettings deleteDatabaseSetting
return deleteDatabaseOperationSettings;
}
+ /** Returns the object with the settings used for calls to getBackup. */
+ public UnaryCallSettings getBackupSettings() {
+ return getBackupSettings;
+ }
+
+ /** Returns the object with the settings used for calls to listBackups. */
+ public UnaryCallSettings listBackupsSettings() {
+ return listBackupsSettings;
+ }
+
+ /** Returns the object with the settings used for calls to deleteBackup. */
+ public UnaryCallSettings deleteBackupSettings() {
+ return deleteBackupSettings;
+ }
+
+ /** Returns the object with the settings used for calls to restoreDatabase. */
+ public UnaryCallSettings restoreDatabaseSettings() {
+ return restoreDatabaseSettings;
+ }
+
+ /** Returns the object with the settings used for calls to restoreDatabase. */
+ public OperationCallSettings
+ restoreDatabaseOperationSettings() {
+ return restoreDatabaseOperationSettings;
+ }
+
+ /** Returns the object with the settings used for calls to createBackupSchedule. */
+ public UnaryCallSettings
+ createBackupScheduleSettings() {
+ return createBackupScheduleSettings;
+ }
+
+ /** Returns the object with the settings used for calls to getBackupSchedule. */
+ public UnaryCallSettings getBackupScheduleSettings() {
+ return getBackupScheduleSettings;
+ }
+
+ /** Returns the object with the settings used for calls to listBackupSchedules. */
+ public UnaryCallSettings
+ listBackupSchedulesSettings() {
+ return listBackupSchedulesSettings;
+ }
+
+ /** Returns the object with the settings used for calls to updateBackupSchedule. */
+ public UnaryCallSettings
+ updateBackupScheduleSettings() {
+ return updateBackupScheduleSettings;
+ }
+
+ /** Returns the object with the settings used for calls to deleteBackupSchedule. */
+ public UnaryCallSettings deleteBackupScheduleSettings() {
+ return deleteBackupScheduleSettings;
+ }
+
public FirestoreAdminStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
@@ -527,6 +610,16 @@ protected FirestoreAdminStubSettings(Builder settingsBuilder) throws IOException
updateDatabaseOperationSettings = settingsBuilder.updateDatabaseOperationSettings().build();
deleteDatabaseSettings = settingsBuilder.deleteDatabaseSettings().build();
deleteDatabaseOperationSettings = settingsBuilder.deleteDatabaseOperationSettings().build();
+ getBackupSettings = settingsBuilder.getBackupSettings().build();
+ listBackupsSettings = settingsBuilder.listBackupsSettings().build();
+ deleteBackupSettings = settingsBuilder.deleteBackupSettings().build();
+ restoreDatabaseSettings = settingsBuilder.restoreDatabaseSettings().build();
+ restoreDatabaseOperationSettings = settingsBuilder.restoreDatabaseOperationSettings().build();
+ createBackupScheduleSettings = settingsBuilder.createBackupScheduleSettings().build();
+ getBackupScheduleSettings = settingsBuilder.getBackupScheduleSettings().build();
+ listBackupSchedulesSettings = settingsBuilder.listBackupSchedulesSettings().build();
+ updateBackupScheduleSettings = settingsBuilder.updateBackupScheduleSettings().build();
+ deleteBackupScheduleSettings = settingsBuilder.deleteBackupScheduleSettings().build();
}
/** Builder for FirestoreAdminStubSettings. */
@@ -575,6 +668,25 @@ public static class Builder extends StubSettings.Builder
deleteDatabaseOperationSettings;
+ private final UnaryCallSettings.Builder getBackupSettings;
+ private final UnaryCallSettings.Builder
+ listBackupsSettings;
+ private final UnaryCallSettings.Builder deleteBackupSettings;
+ private final UnaryCallSettings.Builder
+ restoreDatabaseSettings;
+ private final OperationCallSettings.Builder<
+ RestoreDatabaseRequest, Database, RestoreDatabaseMetadata>
+ restoreDatabaseOperationSettings;
+ private final UnaryCallSettings.Builder
+ createBackupScheduleSettings;
+ private final UnaryCallSettings.Builder
+ getBackupScheduleSettings;
+ private final UnaryCallSettings.Builder
+ listBackupSchedulesSettings;
+ private final UnaryCallSettings.Builder
+ updateBackupScheduleSettings;
+ private final UnaryCallSettings.Builder
+ deleteBackupScheduleSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
@@ -651,6 +763,16 @@ protected Builder(ClientContext clientContext) {
updateDatabaseOperationSettings = OperationCallSettings.newBuilder();
deleteDatabaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteDatabaseOperationSettings = OperationCallSettings.newBuilder();
+ getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ listBackupsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ restoreDatabaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ restoreDatabaseOperationSettings = OperationCallSettings.newBuilder();
+ createBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ getBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ listBackupSchedulesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ updateBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ deleteBackupScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
@@ -667,7 +789,16 @@ protected Builder(ClientContext clientContext) {
getDatabaseSettings,
listDatabasesSettings,
updateDatabaseSettings,
- deleteDatabaseSettings);
+ deleteDatabaseSettings,
+ getBackupSettings,
+ listBackupsSettings,
+ deleteBackupSettings,
+ restoreDatabaseSettings,
+ createBackupScheduleSettings,
+ getBackupScheduleSettings,
+ listBackupSchedulesSettings,
+ updateBackupScheduleSettings,
+ deleteBackupScheduleSettings);
initDefaults(this);
}
@@ -695,6 +826,16 @@ protected Builder(FirestoreAdminStubSettings settings) {
updateDatabaseOperationSettings = settings.updateDatabaseOperationSettings.toBuilder();
deleteDatabaseSettings = settings.deleteDatabaseSettings.toBuilder();
deleteDatabaseOperationSettings = settings.deleteDatabaseOperationSettings.toBuilder();
+ getBackupSettings = settings.getBackupSettings.toBuilder();
+ listBackupsSettings = settings.listBackupsSettings.toBuilder();
+ deleteBackupSettings = settings.deleteBackupSettings.toBuilder();
+ restoreDatabaseSettings = settings.restoreDatabaseSettings.toBuilder();
+ restoreDatabaseOperationSettings = settings.restoreDatabaseOperationSettings.toBuilder();
+ createBackupScheduleSettings = settings.createBackupScheduleSettings.toBuilder();
+ getBackupScheduleSettings = settings.getBackupScheduleSettings.toBuilder();
+ listBackupSchedulesSettings = settings.listBackupSchedulesSettings.toBuilder();
+ updateBackupScheduleSettings = settings.updateBackupScheduleSettings.toBuilder();
+ deleteBackupScheduleSettings = settings.deleteBackupScheduleSettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
@@ -711,7 +852,16 @@ protected Builder(FirestoreAdminStubSettings settings) {
getDatabaseSettings,
listDatabasesSettings,
updateDatabaseSettings,
- deleteDatabaseSettings);
+ deleteDatabaseSettings,
+ getBackupSettings,
+ listBackupsSettings,
+ deleteBackupSettings,
+ restoreDatabaseSettings,
+ createBackupScheduleSettings,
+ getBackupScheduleSettings,
+ listBackupSchedulesSettings,
+ updateBackupScheduleSettings,
+ deleteBackupScheduleSettings);
}
private static Builder createDefault() {
@@ -809,6 +959,51 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+ builder
+ .getBackupSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .listBackupsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .deleteBackupSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .restoreDatabaseSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .createBackupScheduleSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .getBackupScheduleSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .listBackupSchedulesSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .updateBackupScheduleSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .deleteBackupScheduleSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
builder
.createIndexOperationSettings()
.setInitialCallSettings(
@@ -975,6 +1170,30 @@ private static Builder initDefaults(Builder builder) {
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
+ builder
+ .restoreDatabaseOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(Database.class))
+ .setMetadataTransformer(
+ ProtoOperationTransformers.MetadataTransformer.create(RestoreDatabaseMetadata.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(5000L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(45000L))
+ .setInitialRpcTimeout(Duration.ZERO)
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.ZERO)
+ .setTotalTimeout(Duration.ofMillis(300000L))
+ .build()));
+
return builder;
}
@@ -1110,6 +1329,63 @@ public UnaryCallSettings.Builder deleteDatabas
return deleteDatabaseOperationSettings;
}
+ /** Returns the builder for the settings used for calls to getBackup. */
+ public UnaryCallSettings.Builder getBackupSettings() {
+ return getBackupSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to listBackups. */
+ public UnaryCallSettings.Builder
+ listBackupsSettings() {
+ return listBackupsSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to deleteBackup. */
+ public UnaryCallSettings.Builder deleteBackupSettings() {
+ return deleteBackupSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to restoreDatabase. */
+ public UnaryCallSettings.Builder restoreDatabaseSettings() {
+ return restoreDatabaseSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to restoreDatabase. */
+ public OperationCallSettings.Builder
+ restoreDatabaseOperationSettings() {
+ return restoreDatabaseOperationSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to createBackupSchedule. */
+ public UnaryCallSettings.Builder
+ createBackupScheduleSettings() {
+ return createBackupScheduleSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to getBackupSchedule. */
+ public UnaryCallSettings.Builder
+ getBackupScheduleSettings() {
+ return getBackupScheduleSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to listBackupSchedules. */
+ public UnaryCallSettings.Builder
+ listBackupSchedulesSettings() {
+ return listBackupSchedulesSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to updateBackupSchedule. */
+ public UnaryCallSettings.Builder
+ updateBackupScheduleSettings() {
+ return updateBackupScheduleSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to deleteBackupSchedule. */
+ public UnaryCallSettings.Builder
+ deleteBackupScheduleSettings() {
+ return deleteBackupScheduleSettings;
+ }
+
/** Returns the endpoint set by the user or the the service's default endpoint. */
@Override
public String getEndpoint() {
diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java
index cf37b45713..d0a883dc14 100644
--- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java
+++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java
@@ -27,10 +27,15 @@
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.firestore.admin.v1.Backup;
+import com.google.firestore.admin.v1.BackupSchedule;
+import com.google.firestore.admin.v1.CreateBackupScheduleRequest;
import com.google.firestore.admin.v1.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
+import com.google.firestore.admin.v1.DeleteBackupRequest;
+import com.google.firestore.admin.v1.DeleteBackupScheduleRequest;
import com.google.firestore.admin.v1.DeleteDatabaseMetadata;
import com.google.firestore.admin.v1.DeleteDatabaseRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
@@ -39,6 +44,8 @@
import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
import com.google.firestore.admin.v1.FieldOperationMetadata;
+import com.google.firestore.admin.v1.GetBackupRequest;
+import com.google.firestore.admin.v1.GetBackupScheduleRequest;
import com.google.firestore.admin.v1.GetDatabaseRequest;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
@@ -46,12 +53,19 @@
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
import com.google.firestore.admin.v1.IndexOperationMetadata;
+import com.google.firestore.admin.v1.ListBackupSchedulesRequest;
+import com.google.firestore.admin.v1.ListBackupSchedulesResponse;
+import com.google.firestore.admin.v1.ListBackupsRequest;
+import com.google.firestore.admin.v1.ListBackupsResponse;
import com.google.firestore.admin.v1.ListDatabasesRequest;
import com.google.firestore.admin.v1.ListDatabasesResponse;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
import com.google.firestore.admin.v1.ListIndexesResponse;
+import com.google.firestore.admin.v1.RestoreDatabaseMetadata;
+import com.google.firestore.admin.v1.RestoreDatabaseRequest;
+import com.google.firestore.admin.v1.UpdateBackupScheduleRequest;
import com.google.firestore.admin.v1.UpdateDatabaseMetadata;
import com.google.firestore.admin.v1.UpdateDatabaseRequest;
import com.google.firestore.admin.v1.UpdateFieldRequest;
@@ -200,6 +214,93 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub {
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
+ private static final MethodDescriptor getBackupMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackup")
+ .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ listBackupsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListBackups")
+ .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor deleteBackupMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackup")
+ .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ restoreDatabaseMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/RestoreDatabase")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(RestoreDatabaseRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ createBackupScheduleMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/CreateBackupSchedule")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(CreateBackupScheduleRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ getBackupScheduleMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackupSchedule")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(GetBackupScheduleRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ listBackupSchedulesMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListBackupSchedules")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ListBackupSchedulesRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListBackupSchedulesResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ updateBackupScheduleMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/UpdateBackupSchedule")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(UpdateBackupScheduleRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(BackupSchedule.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ deleteBackupScheduleMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(DeleteBackupScheduleRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .build();
+
private final UnaryCallable createIndexCallable;
private final OperationCallable
createIndexOperationCallable;
@@ -232,6 +333,20 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub {
private final UnaryCallable deleteDatabaseCallable;
private final OperationCallable
deleteDatabaseOperationCallable;
+ private final UnaryCallable getBackupCallable;
+ private final UnaryCallable listBackupsCallable;
+ private final UnaryCallable deleteBackupCallable;
+ private final UnaryCallable restoreDatabaseCallable;
+ private final OperationCallable
+ restoreDatabaseOperationCallable;
+ private final UnaryCallable
+ createBackupScheduleCallable;
+ private final UnaryCallable getBackupScheduleCallable;
+ private final UnaryCallable
+ listBackupSchedulesCallable;
+ private final UnaryCallable
+ updateBackupScheduleCallable;
+ private final UnaryCallable deleteBackupScheduleCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
@@ -417,6 +532,101 @@ protected GrpcFirestoreAdminStub(
return builder.build();
})
.build();
+ GrpcCallSettings getBackupTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getBackupMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings listBackupsTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listBackupsMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings deleteBackupTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deleteBackupMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings restoreDatabaseTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(restoreDatabaseMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings
+ createBackupScheduleTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(createBackupScheduleMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings getBackupScheduleTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getBackupScheduleMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings
+ listBackupSchedulesTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listBackupSchedulesMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings
+ updateBackupScheduleTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(updateBackupScheduleMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add(
+ "backup_schedule.name",
+ String.valueOf(request.getBackupSchedule().getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings deleteBackupScheduleTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deleteBackupScheduleMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
this.createIndexCallable =
callableFactory.createUnaryCallable(
@@ -508,6 +718,49 @@ protected GrpcFirestoreAdminStub(
settings.deleteDatabaseOperationSettings(),
clientContext,
operationsStub);
+ this.getBackupCallable =
+ callableFactory.createUnaryCallable(
+ getBackupTransportSettings, settings.getBackupSettings(), clientContext);
+ this.listBackupsCallable =
+ callableFactory.createUnaryCallable(
+ listBackupsTransportSettings, settings.listBackupsSettings(), clientContext);
+ this.deleteBackupCallable =
+ callableFactory.createUnaryCallable(
+ deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext);
+ this.restoreDatabaseCallable =
+ callableFactory.createUnaryCallable(
+ restoreDatabaseTransportSettings, settings.restoreDatabaseSettings(), clientContext);
+ this.restoreDatabaseOperationCallable =
+ callableFactory.createOperationCallable(
+ restoreDatabaseTransportSettings,
+ settings.restoreDatabaseOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.createBackupScheduleCallable =
+ callableFactory.createUnaryCallable(
+ createBackupScheduleTransportSettings,
+ settings.createBackupScheduleSettings(),
+ clientContext);
+ this.getBackupScheduleCallable =
+ callableFactory.createUnaryCallable(
+ getBackupScheduleTransportSettings,
+ settings.getBackupScheduleSettings(),
+ clientContext);
+ this.listBackupSchedulesCallable =
+ callableFactory.createUnaryCallable(
+ listBackupSchedulesTransportSettings,
+ settings.listBackupSchedulesSettings(),
+ clientContext);
+ this.updateBackupScheduleCallable =
+ callableFactory.createUnaryCallable(
+ updateBackupScheduleTransportSettings,
+ settings.updateBackupScheduleSettings(),
+ clientContext);
+ this.deleteBackupScheduleCallable =
+ callableFactory.createUnaryCallable(
+ deleteBackupScheduleTransportSettings,
+ settings.deleteBackupScheduleSettings(),
+ clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
@@ -639,6 +892,58 @@ public UnaryCallable deleteDatabaseCallable()
return deleteDatabaseOperationCallable;
}
+ @Override
+ public UnaryCallable getBackupCallable() {
+ return getBackupCallable;
+ }
+
+ @Override
+ public UnaryCallable listBackupsCallable() {
+ return listBackupsCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteBackupCallable() {
+ return deleteBackupCallable;
+ }
+
+ @Override
+ public UnaryCallable restoreDatabaseCallable() {
+ return restoreDatabaseCallable;
+ }
+
+ @Override
+ public OperationCallable
+ restoreDatabaseOperationCallable() {
+ return restoreDatabaseOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable createBackupScheduleCallable() {
+ return createBackupScheduleCallable;
+ }
+
+ @Override
+ public UnaryCallable getBackupScheduleCallable() {
+ return getBackupScheduleCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listBackupSchedulesCallable() {
+ return listBackupSchedulesCallable;
+ }
+
+ @Override
+ public UnaryCallable updateBackupScheduleCallable() {
+ return updateBackupScheduleCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteBackupScheduleCallable() {
+ return deleteBackupScheduleCallable;
+ }
+
@Override
public final void close() {
try {
diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java
index c84683e42a..e81b9b65d9 100644
--- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java
+++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java
@@ -36,10 +36,15 @@
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.common.collect.ImmutableMap;
+import com.google.firestore.admin.v1.Backup;
+import com.google.firestore.admin.v1.BackupSchedule;
+import com.google.firestore.admin.v1.CreateBackupScheduleRequest;
import com.google.firestore.admin.v1.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
+import com.google.firestore.admin.v1.DeleteBackupRequest;
+import com.google.firestore.admin.v1.DeleteBackupScheduleRequest;
import com.google.firestore.admin.v1.DeleteDatabaseMetadata;
import com.google.firestore.admin.v1.DeleteDatabaseRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
@@ -48,6 +53,8 @@
import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
import com.google.firestore.admin.v1.FieldOperationMetadata;
+import com.google.firestore.admin.v1.GetBackupRequest;
+import com.google.firestore.admin.v1.GetBackupScheduleRequest;
import com.google.firestore.admin.v1.GetDatabaseRequest;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
@@ -55,12 +62,19 @@
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
import com.google.firestore.admin.v1.IndexOperationMetadata;
+import com.google.firestore.admin.v1.ListBackupSchedulesRequest;
+import com.google.firestore.admin.v1.ListBackupSchedulesResponse;
+import com.google.firestore.admin.v1.ListBackupsRequest;
+import com.google.firestore.admin.v1.ListBackupsResponse;
import com.google.firestore.admin.v1.ListDatabasesRequest;
import com.google.firestore.admin.v1.ListDatabasesResponse;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
import com.google.firestore.admin.v1.ListIndexesResponse;
+import com.google.firestore.admin.v1.RestoreDatabaseMetadata;
+import com.google.firestore.admin.v1.RestoreDatabaseRequest;
+import com.google.firestore.admin.v1.UpdateBackupScheduleRequest;
import com.google.firestore.admin.v1.UpdateDatabaseMetadata;
import com.google.firestore.admin.v1.UpdateDatabaseRequest;
import com.google.firestore.admin.v1.UpdateFieldRequest;
@@ -86,17 +100,18 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub {
private static final TypeRegistry typeRegistry =
TypeRegistry.newBuilder()
.add(ExportDocumentsResponse.getDescriptor())
- .add(UpdateDatabaseMetadata.getDescriptor())
.add(Field.getDescriptor())
- .add(Empty.getDescriptor())
+ .add(RestoreDatabaseMetadata.getDescriptor())
.add(ImportDocumentsMetadata.getDescriptor())
.add(Database.getDescriptor())
+ .add(FieldOperationMetadata.getDescriptor())
+ .add(DeleteDatabaseMetadata.getDescriptor())
+ .add(UpdateDatabaseMetadata.getDescriptor())
+ .add(Empty.getDescriptor())
.add(Index.getDescriptor())
.add(CreateDatabaseMetadata.getDescriptor())
- .add(FieldOperationMetadata.getDescriptor())
.add(ExportDocumentsMetadata.getDescriptor())
.add(IndexOperationMetadata.getDescriptor())
- .add(DeleteDatabaseMetadata.getDescriptor())
.build();
private static final ApiMethodDescriptor
@@ -623,6 +638,327 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub {
HttpJsonOperationSnapshot.create(response))
.build();
+ private static final ApiMethodDescriptor getBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackup")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backups/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Backup.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listBackupsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListBackups")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/backups",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListBackupsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteBackupMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackup")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/backups/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ restoreDatabaseMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/RestoreDatabase")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*}/databases:restore",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (RestoreDatabaseRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ createBackupScheduleMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/CreateBackupSchedule")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/databases/*}/backupSchedules",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("backupSchedule", request.getBackupSchedule(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(BackupSchedule.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getBackupScheduleMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetBackupSchedule")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/databases/*/backupSchedules/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(BackupSchedule.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listBackupSchedulesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListBackupSchedules")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/databases/*}/backupSchedules",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListBackupSchedulesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateBackupScheduleMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/UpdateBackupSchedule")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{backupSchedule.name=projects/*/databases/*/backupSchedules/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields,
+ "backupSchedule.name",
+ request.getBackupSchedule().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("backupSchedule", request.getBackupSchedule(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(BackupSchedule.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteBackupScheduleMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/databases/*/backupSchedules/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
private final UnaryCallable createIndexCallable;
private final OperationCallable
createIndexOperationCallable;
@@ -655,6 +991,20 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub {
private final UnaryCallable deleteDatabaseCallable;
private final OperationCallable
deleteDatabaseOperationCallable;
+ private final UnaryCallable getBackupCallable;
+ private final UnaryCallable listBackupsCallable;
+ private final UnaryCallable deleteBackupCallable;
+ private final UnaryCallable restoreDatabaseCallable;
+ private final OperationCallable
+ restoreDatabaseOperationCallable;
+ private final UnaryCallable
+ createBackupScheduleCallable;
+ private final UnaryCallable getBackupScheduleCallable;
+ private final UnaryCallable
+ listBackupSchedulesCallable;
+ private final UnaryCallable
+ updateBackupScheduleCallable;
+ private final UnaryCallable deleteBackupScheduleCallable;
private final BackgroundResource backgroundResources;
private final HttpJsonOperationsStub httpJsonOperationsStub;
@@ -881,6 +1231,112 @@ protected HttpJsonFirestoreAdminStub(
return builder.build();
})
.build();
+ HttpJsonCallSettings getBackupTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getBackupMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings listBackupsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listBackupsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings deleteBackupTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteBackupMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings restoreDatabaseTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(restoreDatabaseMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings
+ createBackupScheduleTransportSettings =
+ HttpJsonCallSettings.