Class FirestoreAdminClient

java.lang.Object
com.google.cloud.firestore.v1.FirestoreAdminClient
All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class FirestoreAdminClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: The Cloud Firestore Admin API.

This API provides several administrative services for Cloud Firestore.

Project, Database, Namespace, Collection, Collection Group, and Document are used as defined in the Google Cloud Firestore API.

Operation: An Operation represents work being performed in the background.

The index service manages Cloud Firestore indexes.

Index creation is performed asynchronously. An Operation resource is created for each such asynchronous operation. The state of the operation (including any errors encountered) may be queried via the Operation resource.

The Operations collection provides a record of actions performed for the specified Project (including any Operations in progress). Operations are not created directly but through calls on other collections or resources.

An Operation that is done may be deleted so that it is no longer listed as part of the Operation collection. Operations are garbage collected after 30 days. By default, ListOperations will only return in progress and failed operations. To list completed operation, issue a ListOperations request with the filter `done: true`.

Operations are created by service `FirestoreAdmin`, but are accessed via service `google.longrunning.Operations`.

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


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

Note: close() needs to be called on the FirestoreAdminClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

CreateIndex

Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].

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

  • createIndexAsync(CreateIndexRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createIndexAsync(CollectionGroupName parent, Index index)

  • createIndexAsync(String parent, Index index)

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

  • createIndexOperationCallable()

  • createIndexCallable()

ListIndexes

Lists composite indexes.

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

  • listIndexes(ListIndexesRequest request)

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

  • listIndexes(CollectionGroupName parent)

  • listIndexes(String parent)

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

  • listIndexesPagedCallable()

  • listIndexesCallable()

GetIndex

Gets a composite index.

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

  • getIndex(GetIndexRequest request)

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

  • getIndex(IndexName name)

  • getIndex(String name)

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

  • getIndexCallable()

DeleteIndex

Deletes a composite index.

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

  • deleteIndex(DeleteIndexRequest request)

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

  • deleteIndex(IndexName name)

  • deleteIndex(String name)

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

  • deleteIndexCallable()

GetField

Gets the metadata and configuration for a Field.

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

  • getField(GetFieldRequest request)

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

  • getField(FieldName name)

  • getField(String name)

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

  • getFieldCallable()

UpdateField

Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`.

This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the field update. The metadata for the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].

To configure the default field settings for the database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.

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

  • updateFieldAsync(UpdateFieldRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateFieldAsync(Field field)

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

  • updateFieldOperationCallable()

  • updateFieldCallable()

ListFields

Lists the field configuration and metadata for this database.

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields that have been explicitly overridden. To issue this query, call [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to `indexConfig.usesAncestorConfig:false` or `ttlConfig:*`.

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

  • listFields(ListFieldsRequest request)

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

  • listFields(CollectionGroupName parent)

  • listFields(String parent)

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

  • listFieldsPagedCallable()

  • listFieldsCallable()

ExportDocuments

Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

For more details on export behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import

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

  • exportDocumentsAsync(ExportDocumentsRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • exportDocumentsAsync(DatabaseName name)

  • exportDocumentsAsync(String name)

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

  • exportDocumentsOperationCallable()

  • exportDocumentsCallable()

ImportDocuments

Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.

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

  • importDocumentsAsync(ImportDocumentsRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • importDocumentsAsync(DatabaseName name)

  • importDocumentsAsync(String name)

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

  • importDocumentsOperationCallable()

  • importDocumentsCallable()

BulkDeleteDocuments

Bulk deletes a subset of documents from Google Cloud Firestore. Documents created or updated after the underlying system starts to process the request will not be deleted. The bulk delete occurs in the background and its progress can be monitored and managed via the Operation resource that is created.

For more details on bulk delete behavior, refer to: https://cloud.google.com/firestore/docs/manage-data/bulk-delete

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

  • bulkDeleteDocumentsAsync(BulkDeleteDocumentsRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • bulkDeleteDocumentsAsync(DatabaseName name)

  • bulkDeleteDocumentsAsync(String name)

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

  • bulkDeleteDocumentsOperationCallable()

  • bulkDeleteDocumentsCallable()

CreateDatabase

Create a database.

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

  • createDatabaseAsync(CreateDatabaseRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createDatabaseAsync(ProjectName parent, Database database, String databaseId)

  • createDatabaseAsync(String parent, Database database, String databaseId)

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

  • createDatabaseOperationCallable()

  • createDatabaseCallable()

GetDatabase

Gets information about a database.

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

  • getDatabase(GetDatabaseRequest request)

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

  • getDatabase(DatabaseName name)

  • getDatabase(String name)

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

  • getDatabaseCallable()

ListDatabases

List all the databases in the project.

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

  • listDatabases(ListDatabasesRequest request)

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

  • listDatabases(ProjectName parent)

  • listDatabases(String parent)

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

  • listDatabasesCallable()

UpdateDatabase

Updates a database.

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

  • updateDatabaseAsync(UpdateDatabaseRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateDatabaseAsync(Database database, FieldMask updateMask)

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

  • updateDatabaseOperationCallable()

  • updateDatabaseCallable()

DeleteDatabase

Deletes a database.

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

  • deleteDatabaseAsync(DeleteDatabaseRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteDatabaseAsync(DatabaseName name)

  • deleteDatabaseAsync(String name)

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

  • deleteDatabaseOperationCallable()

  • deleteDatabaseCallable()

CreateUserCreds

Create a user creds.

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

  • createUserCreds(CreateUserCredsRequest request)

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

  • createUserCreds(DatabaseName parent, UserCreds userCreds, String userCredsId)

  • createUserCreds(String parent, UserCreds userCreds, String userCredsId)

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

  • createUserCredsCallable()

GetUserCreds

Gets a user creds resource. Note that the returned resource does not contain the secret value itself.

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

  • getUserCreds(GetUserCredsRequest request)

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

  • getUserCreds(UserCredsName name)

  • getUserCreds(String name)

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

  • getUserCredsCallable()

ListUserCreds

List all user creds in the database. Note that the returned resource does not contain the secret value itself.

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

  • listUserCreds(ListUserCredsRequest request)

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

  • listUserCreds(DatabaseName parent)

  • listUserCreds(String parent)

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

  • listUserCredsCallable()

EnableUserCreds

Enables a user creds. No-op if the user creds are already enabled.

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

  • enableUserCreds(EnableUserCredsRequest request)

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

  • enableUserCreds(UserCredsName name)

  • enableUserCreds(String name)

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

  • enableUserCredsCallable()

DisableUserCreds

Disables a user creds. No-op if the user creds are already disabled.

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

  • disableUserCreds(DisableUserCredsRequest request)

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

  • disableUserCreds(UserCredsName name)

  • disableUserCreds(String name)

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

  • disableUserCredsCallable()

ResetUserPassword

Resets the password of a user creds.

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

  • resetUserPassword(ResetUserPasswordRequest request)

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

  • resetUserPassword(UserCredsName name)

  • resetUserPassword(String name)

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

  • resetUserPasswordCallable()

DeleteUserCreds

Deletes a user creds.

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

  • deleteUserCreds(DeleteUserCredsRequest request)

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

  • deleteUserCreds(UserCredsName name)

  • deleteUserCreds(String name)

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

  • deleteUserCredsCallable()

GetBackup

Gets information about a backup.

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

  • getBackup(GetBackupRequest request)

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

  • getBackup(BackupName name)

  • getBackup(String name)

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

  • getBackupCallable()

ListBackups

Lists all the backups.

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

  • listBackups(ListBackupsRequest request)

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

  • listBackups(LocationName parent)

  • listBackups(String parent)

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

  • listBackupsCallable()

DeleteBackup

Deletes a backup.

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

  • deleteBackup(DeleteBackupRequest request)

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

  • deleteBackup(BackupName name)

  • deleteBackup(String name)

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

  • deleteBackupCallable()

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.FirestoreAdmin.CreateDatabase] except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing 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.

  • restoreDatabaseAsync(RestoreDatabaseRequest request)

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

  • restoreDatabaseOperationCallable()

  • restoreDatabaseCallable()

CreateBackupSchedule

Creates a backup schedule on a database. At most two backup schedules can be configured on a database, one daily backup schedule and one weekly backup schedule.

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

  • createBackupSchedule(CreateBackupScheduleRequest request)

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

  • createBackupSchedule(DatabaseName parent, BackupSchedule backupSchedule)

  • 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.

  • createBackupScheduleCallable()

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.

  • getBackupSchedule(GetBackupScheduleRequest request)

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

  • getBackupSchedule(BackupScheduleName name)

  • getBackupSchedule(String name)

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

  • getBackupScheduleCallable()

ListBackupSchedules

List backup schedules.

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

  • listBackupSchedules(ListBackupSchedulesRequest request)

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

  • listBackupSchedules(DatabaseName parent)

  • listBackupSchedules(String parent)

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

  • listBackupSchedulesCallable()

UpdateBackupSchedule

Updates a backup schedule.

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

  • updateBackupSchedule(UpdateBackupScheduleRequest request)

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

  • updateBackupSchedule(BackupSchedule backupSchedule, FieldMask updateMask)

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

  • updateBackupScheduleCallable()

DeleteBackupSchedule

Deletes a backup schedule.

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

  • deleteBackupSchedule(DeleteBackupScheduleRequest request)

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

  • deleteBackupSchedule(BackupScheduleName name)

  • deleteBackupSchedule(String name)

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

  • deleteBackupScheduleCallable()

CloneDatabase

Creates a new database by cloning an existing one.

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

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

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

  • cloneDatabaseAsync(CloneDatabaseRequest request)

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

  • cloneDatabaseOperationCallable()

  • cloneDatabaseCallable()

See the individual methods for example code.

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

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

To customize credentials:


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

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 FirestoreAdminSettings firestoreAdminSettings =
     FirestoreAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
 FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create(firestoreAdminSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 FirestoreAdminSettings firestoreAdminSettings =
     FirestoreAdminSettings.newHttpJsonBuilder().build();
 FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create(firestoreAdminSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

  • Constructor Details

    • FirestoreAdminClient

      protected FirestoreAdminClient(FirestoreAdminSettings settings) throws IOException
      Constructs an instance of FirestoreAdminClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
      Throws:
      IOException
    • FirestoreAdminClient

      protected FirestoreAdminClient(FirestoreAdminStub stub)
  • Method Details

    • create

      public static final FirestoreAdminClient create() throws IOException
      Constructs an instance of FirestoreAdminClient with default settings.
      Throws:
      IOException
    • create

      public static final FirestoreAdminClient create(FirestoreAdminSettings settings) throws IOException
      Constructs an instance of FirestoreAdminClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
      Throws:
      IOException
    • create

      public static final FirestoreAdminClient create(FirestoreAdminStub stub)
      Constructs an instance of FirestoreAdminClient, using the given stub for making calls. This is for advanced usage - prefer using create(FirestoreAdminSettings).
    • getSettings

      public final FirestoreAdminSettings getSettings()
    • getStub

      public FirestoreAdminStub getStub()
    • getOperationsClient

      public final com.google.longrunning.OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • getHttpJsonOperationsClient

      @BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • createIndexAsync

      public final com.google.api.gax.longrunning.OperationFuture<Index,IndexOperationMetadata> createIndexAsync(CollectionGroupName parent, Index index)
      Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CollectionGroupName parent =
             CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
         Index index = Index.newBuilder().build();
         Index response = firestoreAdminClient.createIndexAsync(parent, index).get();
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
      index - Required. The composite index to create.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • createIndexAsync

      public final com.google.api.gax.longrunning.OperationFuture<Index,IndexOperationMetadata> createIndexAsync(String parent, Index index)
      Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString();
         Index index = Index.newBuilder().build();
         Index response = firestoreAdminClient.createIndexAsync(parent, index).get();
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
      index - Required. The composite index to create.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • createIndexAsync

      public final com.google.api.gax.longrunning.OperationFuture<Index,IndexOperationMetadata> createIndexAsync(CreateIndexRequest request)
      Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateIndexRequest request =
             CreateIndexRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setIndex(Index.newBuilder().build())
                 .build();
         Index response = firestoreAdminClient.createIndexAsync(request).get();
       }
       
      Parameters:
      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
    • createIndexOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<CreateIndexRequest,Index,IndexOperationMetadata> createIndexOperationCallable()
      Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateIndexRequest request =
             CreateIndexRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setIndex(Index.newBuilder().build())
                 .build();
         OperationFuture<Index, IndexOperationMetadata> future =
             firestoreAdminClient.createIndexOperationCallable().futureCall(request);
         // Do something.
         Index response = future.get();
       }
       
    • createIndexCallable

      public final com.google.api.gax.rpc.UnaryCallable<CreateIndexRequest,com.google.longrunning.Operation> createIndexCallable()
      Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateIndexRequest request =
             CreateIndexRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setIndex(Index.newBuilder().build())
                 .build();
         ApiFuture<Operation> future = firestoreAdminClient.createIndexCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • listIndexes

      Lists composite indexes.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CollectionGroupName parent =
             CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
         for (Index element : firestoreAdminClient.listIndexes(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listIndexes

      public final FirestoreAdminClient.ListIndexesPagedResponse listIndexes(String parent)
      Lists composite indexes.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString();
         for (Index element : firestoreAdminClient.listIndexes(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listIndexes

      Lists composite indexes.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListIndexesRequest request =
             ListIndexesRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Index element : firestoreAdminClient.listIndexes(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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
    • listIndexesPagedCallable

      public final com.google.api.gax.rpc.UnaryCallable<ListIndexesRequest,FirestoreAdminClient.ListIndexesPagedResponse> listIndexesPagedCallable()
      Lists composite indexes.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListIndexesRequest request =
             ListIndexesRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Index> future = firestoreAdminClient.listIndexesPagedCallable().futureCall(request);
         // Do something.
         for (Index element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listIndexesCallable

      public final com.google.api.gax.rpc.UnaryCallable<ListIndexesRequest,ListIndexesResponse> listIndexesCallable()
      Lists composite indexes.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListIndexesRequest request =
             ListIndexesRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListIndexesResponse response = firestoreAdminClient.listIndexesCallable().call(request);
           for (Index element : response.getIndexesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getIndex

      public final Index getIndex(IndexName name)
      Gets a composite index.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
         Index response = firestoreAdminClient.getIndex(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • getIndex

      public final Index getIndex(String name)
      Gets a composite index.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]").toString();
         Index response = firestoreAdminClient.getIndex(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • getIndex

      public final Index getIndex(GetIndexRequest request)
      Gets a composite index.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         GetIndexRequest request =
             GetIndexRequest.newBuilder()
                 .setName(
                     IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]").toString())
                 .build();
         Index response = firestoreAdminClient.getIndex(request);
       }
       
      Parameters:
      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
    • getIndexCallable

      public final com.google.api.gax.rpc.UnaryCallable<GetIndexRequest,Index> getIndexCallable()
      Gets a composite index.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         GetIndexRequest request =
             GetIndexRequest.newBuilder()
                 .setName(
                     IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]").toString())
                 .build();
         ApiFuture<Index> future = firestoreAdminClient.getIndexCallable().futureCall(request);
         // Do something.
         Index response = future.get();
       }
       
    • deleteIndex

      public final void deleteIndex(IndexName name)
      Deletes a composite index.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
         firestoreAdminClient.deleteIndex(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • deleteIndex

      public final void deleteIndex(String name)
      Deletes a composite index.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]").toString();
         firestoreAdminClient.deleteIndex(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • deleteIndex

      public final void deleteIndex(DeleteIndexRequest request)
      Deletes a composite index.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<DeleteIndexRequest,com.google.protobuf.Empty> deleteIndexCallable()
      Deletes a composite index.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DeleteIndexRequest request =
             DeleteIndexRequest.newBuilder()
                 .setName(
                     IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]").toString())
                 .build();
         ApiFuture<Empty> future = firestoreAdminClient.deleteIndexCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • getField

      public final Field getField(FieldName name)
      Gets the metadata and configuration for a Field.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]");
         Field response = firestoreAdminClient.getField(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • getField

      public final Field getField(String name)
      Gets the metadata and configuration for a Field.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]").toString();
         Field response = firestoreAdminClient.getField(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • getField

      public final Field getField(GetFieldRequest request)
      Gets the metadata and configuration for a Field.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         GetFieldRequest request =
             GetFieldRequest.newBuilder()
                 .setName(
                     FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]").toString())
                 .build();
         Field response = firestoreAdminClient.getField(request);
       }
       
      Parameters:
      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
    • getFieldCallable

      public final com.google.api.gax.rpc.UnaryCallable<GetFieldRequest,Field> getFieldCallable()
      Gets the metadata and configuration for a Field.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         GetFieldRequest request =
             GetFieldRequest.newBuilder()
                 .setName(
                     FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]").toString())
                 .build();
         ApiFuture<Field> future = firestoreAdminClient.getFieldCallable().futureCall(request);
         // Do something.
         Field response = future.get();
       }
       
    • updateFieldAsync

      public final com.google.api.gax.longrunning.OperationFuture<Field,FieldOperationMetadata> updateFieldAsync(Field field)
      Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`.

      This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the field update. The metadata for the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].

      To configure the default field settings for the database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         Field field = Field.newBuilder().build();
         Field response = firestoreAdminClient.updateFieldAsync(field).get();
       }
       
      Parameters:
      field - Required. The field to be updated.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • updateFieldAsync

      public final com.google.api.gax.longrunning.OperationFuture<Field,FieldOperationMetadata> updateFieldAsync(UpdateFieldRequest request)
      Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`.

      This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the field update. The metadata for the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].

      To configure the default field settings for the database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UpdateFieldRequest request =
             UpdateFieldRequest.newBuilder()
                 .setField(Field.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Field response = firestoreAdminClient.updateFieldAsync(request).get();
       }
       
      Parameters:
      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
    • updateFieldOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<UpdateFieldRequest,Field,FieldOperationMetadata> updateFieldOperationCallable()
      Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`.

      This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the field update. The metadata for the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].

      To configure the default field settings for the database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UpdateFieldRequest request =
             UpdateFieldRequest.newBuilder()
                 .setField(Field.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         OperationFuture<Field, FieldOperationMetadata> future =
             firestoreAdminClient.updateFieldOperationCallable().futureCall(request);
         // Do something.
         Field response = future.get();
       }
       
    • updateFieldCallable

      public final com.google.api.gax.rpc.UnaryCallable<UpdateFieldRequest,com.google.longrunning.Operation> updateFieldCallable()
      Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`.

      This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the field update. The metadata for the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].

      To configure the default field settings for the database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UpdateFieldRequest request =
             UpdateFieldRequest.newBuilder()
                 .setField(Field.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Operation> future = firestoreAdminClient.updateFieldCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • listFields

      Lists the field configuration and metadata for this database.

      Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields that have been explicitly overridden. To issue this query, call [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to `indexConfig.usesAncestorConfig:false` or `ttlConfig:*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CollectionGroupName parent =
             CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
         for (Field element : firestoreAdminClient.listFields(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listFields

      public final FirestoreAdminClient.ListFieldsPagedResponse listFields(String parent)
      Lists the field configuration and metadata for this database.

      Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields that have been explicitly overridden. To issue this query, call [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to `indexConfig.usesAncestorConfig:false` or `ttlConfig:*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString();
         for (Field element : firestoreAdminClient.listFields(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listFields

      Lists the field configuration and metadata for this database.

      Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields that have been explicitly overridden. To issue this query, call [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to `indexConfig.usesAncestorConfig:false` or `ttlConfig:*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListFieldsRequest request =
             ListFieldsRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Field element : firestoreAdminClient.listFields(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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
    • listFieldsPagedCallable

      public final com.google.api.gax.rpc.UnaryCallable<ListFieldsRequest,FirestoreAdminClient.ListFieldsPagedResponse> listFieldsPagedCallable()
      Lists the field configuration and metadata for this database.

      Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields that have been explicitly overridden. To issue this query, call [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to `indexConfig.usesAncestorConfig:false` or `ttlConfig:*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListFieldsRequest request =
             ListFieldsRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Field> future = firestoreAdminClient.listFieldsPagedCallable().futureCall(request);
         // Do something.
         for (Field element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listFieldsCallable

      public final com.google.api.gax.rpc.UnaryCallable<ListFieldsRequest,ListFieldsResponse> listFieldsCallable()
      Lists the field configuration and metadata for this database.

      Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields that have been explicitly overridden. To issue this query, call [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to `indexConfig.usesAncestorConfig:false` or `ttlConfig:*`.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListFieldsRequest request =
             ListFieldsRequest.newBuilder()
                 .setParent(
                     CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListFieldsResponse response = firestoreAdminClient.listFieldsCallable().call(request);
           for (Field element : response.getFieldsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • exportDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<ExportDocumentsResponse,ExportDocumentsMetadata> exportDocumentsAsync(DatabaseName name)
      Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

      For more details on export behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
         ExportDocumentsResponse response = firestoreAdminClient.exportDocumentsAsync(name).get();
       }
       
      Parameters:
      name - Required. Database to export. Should be of the form: `projects/{project_id}/databases/{database_id}`.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • exportDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<ExportDocumentsResponse,ExportDocumentsMetadata> exportDocumentsAsync(String name)
      Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

      For more details on export behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
         ExportDocumentsResponse response = firestoreAdminClient.exportDocumentsAsync(name).get();
       }
       
      Parameters:
      name - Required. Database to export. Should be of the form: `projects/{project_id}/databases/{database_id}`.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • exportDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<ExportDocumentsResponse,ExportDocumentsMetadata> exportDocumentsAsync(ExportDocumentsRequest request)
      Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

      For more details on export behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ExportDocumentsRequest request =
             ExportDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .setOutputUriPrefix("outputUriPrefix499858205")
                 .addAllNamespaceIds(new ArrayList<String>())
                 .setSnapshotTime(Timestamp.newBuilder().build())
                 .build();
         ExportDocumentsResponse response = firestoreAdminClient.exportDocumentsAsync(request).get();
       }
       
      Parameters:
      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
    • exportDocumentsOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<ExportDocumentsRequest,ExportDocumentsResponse,ExportDocumentsMetadata> exportDocumentsOperationCallable()
      Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

      For more details on export behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ExportDocumentsRequest request =
             ExportDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .setOutputUriPrefix("outputUriPrefix499858205")
                 .addAllNamespaceIds(new ArrayList<String>())
                 .setSnapshotTime(Timestamp.newBuilder().build())
                 .build();
         OperationFuture<ExportDocumentsResponse, ExportDocumentsMetadata> future =
             firestoreAdminClient.exportDocumentsOperationCallable().futureCall(request);
         // Do something.
         ExportDocumentsResponse response = future.get();
       }
       
    • exportDocumentsCallable

      public final com.google.api.gax.rpc.UnaryCallable<ExportDocumentsRequest,com.google.longrunning.Operation> exportDocumentsCallable()
      Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

      For more details on export behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ExportDocumentsRequest request =
             ExportDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .setOutputUriPrefix("outputUriPrefix499858205")
                 .addAllNamespaceIds(new ArrayList<String>())
                 .setSnapshotTime(Timestamp.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             firestoreAdminClient.exportDocumentsCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • importDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,ImportDocumentsMetadata> importDocumentsAsync(DatabaseName name)
      Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
         firestoreAdminClient.importDocumentsAsync(name).get();
       }
       
      Parameters:
      name - Required. Database to import into. Should be of the form: `projects/{project_id}/databases/{database_id}`.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • importDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,ImportDocumentsMetadata> importDocumentsAsync(String name)
      Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
         firestoreAdminClient.importDocumentsAsync(name).get();
       }
       
      Parameters:
      name - Required. Database to import into. Should be of the form: `projects/{project_id}/databases/{database_id}`.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • importDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,ImportDocumentsMetadata> importDocumentsAsync(ImportDocumentsRequest request)
      Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ImportDocumentsRequest request =
             ImportDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .setInputUriPrefix("inputUriPrefix-97481100")
                 .addAllNamespaceIds(new ArrayList<String>())
                 .build();
         firestoreAdminClient.importDocumentsAsync(request).get();
       }
       
      Parameters:
      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
    • importDocumentsOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<ImportDocumentsRequest,com.google.protobuf.Empty,ImportDocumentsMetadata> importDocumentsOperationCallable()
      Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ImportDocumentsRequest request =
             ImportDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .setInputUriPrefix("inputUriPrefix-97481100")
                 .addAllNamespaceIds(new ArrayList<String>())
                 .build();
         OperationFuture<Empty, ImportDocumentsMetadata> future =
             firestoreAdminClient.importDocumentsOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • importDocumentsCallable

      public final com.google.api.gax.rpc.UnaryCallable<ImportDocumentsRequest,com.google.longrunning.Operation> importDocumentsCallable()
      Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ImportDocumentsRequest request =
             ImportDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .setInputUriPrefix("inputUriPrefix-97481100")
                 .addAllNamespaceIds(new ArrayList<String>())
                 .build();
         ApiFuture<Operation> future =
             firestoreAdminClient.importDocumentsCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • bulkDeleteDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<BulkDeleteDocumentsResponse,BulkDeleteDocumentsMetadata> bulkDeleteDocumentsAsync(DatabaseName name)
      Bulk deletes a subset of documents from Google Cloud Firestore. Documents created or updated after the underlying system starts to process the request will not be deleted. The bulk delete occurs in the background and its progress can be monitored and managed via the Operation resource that is created.

      For more details on bulk delete behavior, refer to: https://cloud.google.com/firestore/docs/manage-data/bulk-delete

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
         BulkDeleteDocumentsResponse response =
             firestoreAdminClient.bulkDeleteDocumentsAsync(name).get();
       }
       
      Parameters:
      name - Required. Database to operate. Should be of the form: `projects/{project_id}/databases/{database_id}`.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • bulkDeleteDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<BulkDeleteDocumentsResponse,BulkDeleteDocumentsMetadata> bulkDeleteDocumentsAsync(String name)
      Bulk deletes a subset of documents from Google Cloud Firestore. Documents created or updated after the underlying system starts to process the request will not be deleted. The bulk delete occurs in the background and its progress can be monitored and managed via the Operation resource that is created.

      For more details on bulk delete behavior, refer to: https://cloud.google.com/firestore/docs/manage-data/bulk-delete

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
         BulkDeleteDocumentsResponse response =
             firestoreAdminClient.bulkDeleteDocumentsAsync(name).get();
       }
       
      Parameters:
      name - Required. Database to operate. Should be of the form: `projects/{project_id}/databases/{database_id}`.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • bulkDeleteDocumentsAsync

      public final com.google.api.gax.longrunning.OperationFuture<BulkDeleteDocumentsResponse,BulkDeleteDocumentsMetadata> bulkDeleteDocumentsAsync(BulkDeleteDocumentsRequest request)
      Bulk deletes a subset of documents from Google Cloud Firestore. Documents created or updated after the underlying system starts to process the request will not be deleted. The bulk delete occurs in the background and its progress can be monitored and managed via the Operation resource that is created.

      For more details on bulk delete behavior, refer to: https://cloud.google.com/firestore/docs/manage-data/bulk-delete

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         BulkDeleteDocumentsRequest request =
             BulkDeleteDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .addAllNamespaceIds(new ArrayList<String>())
                 .build();
         BulkDeleteDocumentsResponse response =
             firestoreAdminClient.bulkDeleteDocumentsAsync(request).get();
       }
       
      Parameters:
      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
    • bulkDeleteDocumentsOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<BulkDeleteDocumentsRequest,BulkDeleteDocumentsResponse,BulkDeleteDocumentsMetadata> bulkDeleteDocumentsOperationCallable()
      Bulk deletes a subset of documents from Google Cloud Firestore. Documents created or updated after the underlying system starts to process the request will not be deleted. The bulk delete occurs in the background and its progress can be monitored and managed via the Operation resource that is created.

      For more details on bulk delete behavior, refer to: https://cloud.google.com/firestore/docs/manage-data/bulk-delete

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         BulkDeleteDocumentsRequest request =
             BulkDeleteDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .addAllNamespaceIds(new ArrayList<String>())
                 .build();
         OperationFuture<BulkDeleteDocumentsResponse, BulkDeleteDocumentsMetadata> future =
             firestoreAdminClient.bulkDeleteDocumentsOperationCallable().futureCall(request);
         // Do something.
         BulkDeleteDocumentsResponse response = future.get();
       }
       
    • bulkDeleteDocumentsCallable

      public final com.google.api.gax.rpc.UnaryCallable<BulkDeleteDocumentsRequest,com.google.longrunning.Operation> bulkDeleteDocumentsCallable()
      Bulk deletes a subset of documents from Google Cloud Firestore. Documents created or updated after the underlying system starts to process the request will not be deleted. The bulk delete occurs in the background and its progress can be monitored and managed via the Operation resource that is created.

      For more details on bulk delete behavior, refer to: https://cloud.google.com/firestore/docs/manage-data/bulk-delete

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         BulkDeleteDocumentsRequest request =
             BulkDeleteDocumentsRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .addAllCollectionIds(new ArrayList<String>())
                 .addAllNamespaceIds(new ArrayList<String>())
                 .build();
         ApiFuture<Operation> future =
             firestoreAdminClient.bulkDeleteDocumentsCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • createDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,CreateDatabaseMetadata> createDatabaseAsync(ProjectName parent, Database database, String databaseId)
      Create a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ProjectName parent = ProjectName.of("[PROJECT]");
         Database database = Database.newBuilder().build();
         String databaseId = "databaseId1688905718";
         Database response =
             firestoreAdminClient.createDatabaseAsync(parent, database, databaseId).get();
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}`
      database - Required. The Database to create.
      databaseId - Required. The ID to use for the database, which will become the final component of the database's resource name.

      This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ with first character a letter and the last a letter or a number. Must not be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.

      "(default)" database ID is also valid.

      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • createDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,CreateDatabaseMetadata> createDatabaseAsync(String parent, Database database, String databaseId)
      Create a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String parent = ProjectName.of("[PROJECT]").toString();
         Database database = Database.newBuilder().build();
         String databaseId = "databaseId1688905718";
         Database response =
             firestoreAdminClient.createDatabaseAsync(parent, database, databaseId).get();
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}`
      database - Required. The Database to create.
      databaseId - Required. The ID to use for the database, which will become the final component of the database's resource name.

      This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ with first character a letter and the last a letter or a number. Must not be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.

      "(default)" database ID is also valid.

      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • createDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,CreateDatabaseMetadata> createDatabaseAsync(CreateDatabaseRequest request)
      Create a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateDatabaseRequest request =
             CreateDatabaseRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setDatabase(Database.newBuilder().build())
                 .setDatabaseId("databaseId1688905718")
                 .build();
         Database response = firestoreAdminClient.createDatabaseAsync(request).get();
       }
       
      Parameters:
      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
    • createDatabaseOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<CreateDatabaseRequest,Database,CreateDatabaseMetadata> createDatabaseOperationCallable()
      Create a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateDatabaseRequest request =
             CreateDatabaseRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setDatabase(Database.newBuilder().build())
                 .setDatabaseId("databaseId1688905718")
                 .build();
         OperationFuture<Database, CreateDatabaseMetadata> future =
             firestoreAdminClient.createDatabaseOperationCallable().futureCall(request);
         // Do something.
         Database response = future.get();
       }
       
    • createDatabaseCallable

      public final com.google.api.gax.rpc.UnaryCallable<CreateDatabaseRequest,com.google.longrunning.Operation> createDatabaseCallable()
      Create a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateDatabaseRequest request =
             CreateDatabaseRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setDatabase(Database.newBuilder().build())
                 .setDatabaseId("databaseId1688905718")
                 .build();
         ApiFuture<Operation> future =
             firestoreAdminClient.createDatabaseCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getDatabase

      public final Database getDatabase(DatabaseName name)
      Gets information about a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
         Database response = firestoreAdminClient.getDatabase(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • getDatabase

      public final Database getDatabase(String name)
      Gets information about a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
         Database response = firestoreAdminClient.getDatabase(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • getDatabase

      public final Database getDatabase(GetDatabaseRequest request)
      Gets information about a database.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<GetDatabaseRequest,Database> getDatabaseCallable()
      Gets information about a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         GetDatabaseRequest request =
             GetDatabaseRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .build();
         ApiFuture<Database> future = firestoreAdminClient.getDatabaseCallable().futureCall(request);
         // Do something.
         Database response = future.get();
       }
       
    • listDatabases

      public final ListDatabasesResponse listDatabases(ProjectName parent)
      List all the databases in the project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ProjectName parent = ProjectName.of("[PROJECT]");
         ListDatabasesResponse response = firestoreAdminClient.listDatabases(parent);
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listDatabases

      public final ListDatabasesResponse listDatabases(String parent)
      List all the databases in the project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String parent = ProjectName.of("[PROJECT]").toString();
         ListDatabasesResponse response = firestoreAdminClient.listDatabases(parent);
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listDatabases

      public final ListDatabasesResponse listDatabases(ListDatabasesRequest request)
      List all the databases in the project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListDatabasesRequest request =
             ListDatabasesRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setShowDeleted(true)
                 .build();
         ListDatabasesResponse response = firestoreAdminClient.listDatabases(request);
       }
       
      Parameters:
      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
    • listDatabasesCallable

      public final com.google.api.gax.rpc.UnaryCallable<ListDatabasesRequest,ListDatabasesResponse> listDatabasesCallable()
      List all the databases in the project.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListDatabasesRequest request =
             ListDatabasesRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setShowDeleted(true)
                 .build();
         ApiFuture<ListDatabasesResponse> future =
             firestoreAdminClient.listDatabasesCallable().futureCall(request);
         // Do something.
         ListDatabasesResponse response = future.get();
       }
       
    • updateDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,UpdateDatabaseMetadata> updateDatabaseAsync(Database database, com.google.protobuf.FieldMask updateMask)
      Updates a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         Database database = Database.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Database response = firestoreAdminClient.updateDatabaseAsync(database, updateMask).get();
       }
       
      Parameters:
      database - Required. The database to update.
      updateMask - The list of fields to be updated.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • updateDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,UpdateDatabaseMetadata> updateDatabaseAsync(UpdateDatabaseRequest request)
      Updates a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UpdateDatabaseRequest request =
             UpdateDatabaseRequest.newBuilder()
                 .setDatabase(Database.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Database response = firestoreAdminClient.updateDatabaseAsync(request).get();
       }
       
      Parameters:
      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
    • updateDatabaseOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<UpdateDatabaseRequest,Database,UpdateDatabaseMetadata> updateDatabaseOperationCallable()
      Updates a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UpdateDatabaseRequest request =
             UpdateDatabaseRequest.newBuilder()
                 .setDatabase(Database.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         OperationFuture<Database, UpdateDatabaseMetadata> future =
             firestoreAdminClient.updateDatabaseOperationCallable().futureCall(request);
         // Do something.
         Database response = future.get();
       }
       
    • updateDatabaseCallable

      public final com.google.api.gax.rpc.UnaryCallable<UpdateDatabaseRequest,com.google.longrunning.Operation> updateDatabaseCallable()
      Updates a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UpdateDatabaseRequest request =
             UpdateDatabaseRequest.newBuilder()
                 .setDatabase(Database.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             firestoreAdminClient.updateDatabaseCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,DeleteDatabaseMetadata> deleteDatabaseAsync(DatabaseName name)
      Deletes a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
         Database response = firestoreAdminClient.deleteDatabaseAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • deleteDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,DeleteDatabaseMetadata> deleteDatabaseAsync(String name)
      Deletes a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
         Database response = firestoreAdminClient.deleteDatabaseAsync(name).get();
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • deleteDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,DeleteDatabaseMetadata> deleteDatabaseAsync(DeleteDatabaseRequest request)
      Deletes a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DeleteDatabaseRequest request =
             DeleteDatabaseRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .setEtag("etag3123477")
                 .build();
         Database response = firestoreAdminClient.deleteDatabaseAsync(request).get();
       }
       
      Parameters:
      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
    • deleteDatabaseOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<DeleteDatabaseRequest,Database,DeleteDatabaseMetadata> deleteDatabaseOperationCallable()
      Deletes a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DeleteDatabaseRequest request =
             DeleteDatabaseRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .setEtag("etag3123477")
                 .build();
         OperationFuture<Database, DeleteDatabaseMetadata> future =
             firestoreAdminClient.deleteDatabaseOperationCallable().futureCall(request);
         // Do something.
         Database response = future.get();
       }
       
    • deleteDatabaseCallable

      public final com.google.api.gax.rpc.UnaryCallable<DeleteDatabaseRequest,com.google.longrunning.Operation> deleteDatabaseCallable()
      Deletes a database.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DeleteDatabaseRequest request =
             DeleteDatabaseRequest.newBuilder()
                 .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .setEtag("etag3123477")
                 .build();
         ApiFuture<Operation> future =
             firestoreAdminClient.deleteDatabaseCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • createUserCreds

      public final UserCreds createUserCreds(DatabaseName parent, UserCreds userCreds, String userCredsId)
      Create a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]");
         UserCreds userCreds = UserCreds.newBuilder().build();
         String userCredsId = "userCredsId726775445";
         UserCreds response = firestoreAdminClient.createUserCreds(parent, userCreds, userCredsId);
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}/databases/{database_id}`
      userCreds - Required. The user creds to create.
      userCredsId - Required. The ID to use for the user creds, which will become the final component of the user creds's resource name.

      This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ with first character a letter and the last a letter or a number. Must not be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.

      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • createUserCreds

      public final UserCreds createUserCreds(String parent, UserCreds userCreds, String userCredsId)
      Create a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String parent = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
         UserCreds userCreds = UserCreds.newBuilder().build();
         String userCredsId = "userCredsId726775445";
         UserCreds response = firestoreAdminClient.createUserCreds(parent, userCreds, userCredsId);
       }
       
      Parameters:
      parent - Required. A parent name of the form `projects/{project_id}/databases/{database_id}`
      userCreds - Required. The user creds to create.
      userCredsId - Required. The ID to use for the user creds, which will become the final component of the user creds's resource name.

      This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ with first character a letter and the last a letter or a number. Must not be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.

      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • createUserCreds

      public final UserCreds createUserCreds(CreateUserCredsRequest request)
      Create a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateUserCredsRequest request =
             CreateUserCredsRequest.newBuilder()
                 .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .setUserCreds(UserCreds.newBuilder().build())
                 .setUserCredsId("userCredsId726775445")
                 .build();
         UserCreds response = firestoreAdminClient.createUserCreds(request);
       }
       
      Parameters:
      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
    • createUserCredsCallable

      public final com.google.api.gax.rpc.UnaryCallable<CreateUserCredsRequest,UserCreds> createUserCredsCallable()
      Create a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateUserCredsRequest request =
             CreateUserCredsRequest.newBuilder()
                 .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .setUserCreds(UserCreds.newBuilder().build())
                 .setUserCredsId("userCredsId726775445")
                 .build();
         ApiFuture<UserCreds> future =
             firestoreAdminClient.createUserCredsCallable().futureCall(request);
         // Do something.
         UserCreds response = future.get();
       }
       
    • getUserCreds

      public final UserCreds getUserCreds(UserCredsName name)
      Gets a user creds resource. Note that the returned resource does not contain the secret value itself.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UserCredsName name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]");
         UserCreds response = firestoreAdminClient.getUserCreds(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • getUserCreds

      public final UserCreds getUserCreds(String name)
      Gets a user creds resource. Note that the returned resource does not contain the secret value itself.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString();
         UserCreds response = firestoreAdminClient.getUserCreds(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • getUserCreds

      public final UserCreds getUserCreds(GetUserCredsRequest request)
      Gets a user creds resource. Note that the returned resource does not contain the secret value itself.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<GetUserCredsRequest,UserCreds> getUserCredsCallable()
      Gets a user creds resource. Note that the returned resource does not contain the secret value itself.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         GetUserCredsRequest request =
             GetUserCredsRequest.newBuilder()
                 .setName(UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString())
                 .build();
         ApiFuture<UserCreds> future = firestoreAdminClient.getUserCredsCallable().futureCall(request);
         // Do something.
         UserCreds response = future.get();
       }
       
    • listUserCreds

      public final ListUserCredsResponse listUserCreds(DatabaseName parent)
      List all user creds in the database. Note that the returned resource does not contain the secret value itself.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DatabaseName parent = DatabaseName.of("[PROJECT]", "[DATABASE]");
         ListUserCredsResponse response = firestoreAdminClient.listUserCreds(parent);
       }
       
      Parameters:
      parent - Required. A parent database name of the form `projects/{project_id}/databases/{database_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listUserCreds

      public final ListUserCredsResponse listUserCreds(String parent)
      List all user creds in the database. Note that the returned resource does not contain the secret value itself.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String parent = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
         ListUserCredsResponse response = firestoreAdminClient.listUserCreds(parent);
       }
       
      Parameters:
      parent - Required. A parent database name of the form `projects/{project_id}/databases/{database_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listUserCreds

      public final ListUserCredsResponse listUserCreds(ListUserCredsRequest request)
      List all user creds in the database. Note that the returned resource does not contain the secret value itself.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListUserCredsRequest request =
             ListUserCredsRequest.newBuilder()
                 .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .build();
         ListUserCredsResponse response = firestoreAdminClient.listUserCreds(request);
       }
       
      Parameters:
      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
    • listUserCredsCallable

      public final com.google.api.gax.rpc.UnaryCallable<ListUserCredsRequest,ListUserCredsResponse> listUserCredsCallable()
      List all user creds in the database. Note that the returned resource does not contain the secret value itself.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListUserCredsRequest request =
             ListUserCredsRequest.newBuilder()
                 .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .build();
         ApiFuture<ListUserCredsResponse> future =
             firestoreAdminClient.listUserCredsCallable().futureCall(request);
         // Do something.
         ListUserCredsResponse response = future.get();
       }
       
    • enableUserCreds

      public final UserCreds enableUserCreds(UserCredsName name)
      Enables a user creds. No-op if the user creds are already enabled.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UserCredsName name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]");
         UserCreds response = firestoreAdminClient.enableUserCreds(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • enableUserCreds

      public final UserCreds enableUserCreds(String name)
      Enables a user creds. No-op if the user creds are already enabled.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString();
         UserCreds response = firestoreAdminClient.enableUserCreds(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • enableUserCreds

      public final UserCreds enableUserCreds(EnableUserCredsRequest request)
      Enables a user creds. No-op if the user creds are already enabled.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<EnableUserCredsRequest,UserCreds> enableUserCredsCallable()
      Enables a user creds. No-op if the user creds are already enabled.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         EnableUserCredsRequest request =
             EnableUserCredsRequest.newBuilder()
                 .setName(UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString())
                 .build();
         ApiFuture<UserCreds> future =
             firestoreAdminClient.enableUserCredsCallable().futureCall(request);
         // Do something.
         UserCreds response = future.get();
       }
       
    • disableUserCreds

      public final UserCreds disableUserCreds(UserCredsName name)
      Disables a user creds. No-op if the user creds are already disabled.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UserCredsName name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]");
         UserCreds response = firestoreAdminClient.disableUserCreds(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • disableUserCreds

      public final UserCreds disableUserCreds(String name)
      Disables a user creds. No-op if the user creds are already disabled.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString();
         UserCreds response = firestoreAdminClient.disableUserCreds(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • disableUserCreds

      public final UserCreds disableUserCreds(DisableUserCredsRequest request)
      Disables a user creds. No-op if the user creds are already disabled.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<DisableUserCredsRequest,UserCreds> disableUserCredsCallable()
      Disables a user creds. No-op if the user creds are already disabled.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DisableUserCredsRequest request =
             DisableUserCredsRequest.newBuilder()
                 .setName(UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString())
                 .build();
         ApiFuture<UserCreds> future =
             firestoreAdminClient.disableUserCredsCallable().futureCall(request);
         // Do something.
         UserCreds response = future.get();
       }
       
    • resetUserPassword

      public final UserCreds resetUserPassword(UserCredsName name)
      Resets the password of a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UserCredsName name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]");
         UserCreds response = firestoreAdminClient.resetUserPassword(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • resetUserPassword

      public final UserCreds resetUserPassword(String name)
      Resets the password of a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString();
         UserCreds response = firestoreAdminClient.resetUserPassword(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • resetUserPassword

      public final UserCreds resetUserPassword(ResetUserPasswordRequest request)
      Resets the password of a user creds.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<ResetUserPasswordRequest,UserCreds> resetUserPasswordCallable()
      Resets the password of a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ResetUserPasswordRequest request =
             ResetUserPasswordRequest.newBuilder()
                 .setName(UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString())
                 .build();
         ApiFuture<UserCreds> future =
             firestoreAdminClient.resetUserPasswordCallable().futureCall(request);
         // Do something.
         UserCreds response = future.get();
       }
       
    • deleteUserCreds

      public final void deleteUserCreds(UserCredsName name)
      Deletes a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UserCredsName name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]");
         firestoreAdminClient.deleteUserCreds(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • deleteUserCreds

      public final void deleteUserCreds(String name)
      Deletes a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String name = UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString();
         firestoreAdminClient.deleteUserCreds(name);
       }
       
      Parameters:
      name - Required. A name of the form `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • deleteUserCreds

      public final void deleteUserCreds(DeleteUserCredsRequest request)
      Deletes a user creds.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<DeleteUserCredsRequest,com.google.protobuf.Empty> deleteUserCredsCallable()
      Deletes a user creds.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DeleteUserCredsRequest request =
             DeleteUserCredsRequest.newBuilder()
                 .setName(UserCredsName.of("[PROJECT]", "[DATABASE]", "[USER_CREDS]").toString())
                 .build();
         ApiFuture<Empty> future = firestoreAdminClient.deleteUserCredsCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • getBackup

      public final Backup getBackup(BackupName name)
      Gets information about a backup.

      Sample code:

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

      public final Backup getBackup(String name)
      Gets information about a backup.

      Sample code:

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

      public final Backup getBackup(GetBackupRequest request)
      Gets information about a backup.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<GetBackupRequest,Backup> getBackupCallable()
      Gets information about a backup.

      Sample code:

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

      public final ListBackupsResponse listBackups(LocationName parent)
      Lists all the backups.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ListBackupsResponse response = firestoreAdminClient.listBackups(parent);
       }
       
      Parameters:
      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
    • listBackups

      public final ListBackupsResponse listBackups(String parent)
      Lists all the backups.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ListBackupsResponse response = firestoreAdminClient.listBackups(parent);
       }
       
      Parameters:
      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
    • listBackups

      public final ListBackupsResponse listBackups(ListBackupsRequest request)
      Lists all the backups.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,ListBackupsResponse> listBackupsCallable()
      Lists all the backups.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         ListBackupsRequest request =
             ListBackupsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .build();
         ApiFuture<ListBackupsResponse> future =
             firestoreAdminClient.listBackupsCallable().futureCall(request);
         // Do something.
         ListBackupsResponse response = future.get();
       }
       
    • deleteBackup

      public final void deleteBackup(BackupName name)
      Deletes a backup.

      Sample code:

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

      public final void deleteBackup(String name)
      Deletes a backup.

      Sample code:

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

      public final void deleteBackup(DeleteBackupRequest request)
      Deletes a backup.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<DeleteBackupRequest,com.google.protobuf.Empty> deleteBackupCallable()
      Deletes a backup.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DeleteBackupRequest request =
             DeleteBackupRequest.newBuilder()
                 .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
                 .build();
         ApiFuture<Empty> future = firestoreAdminClient.deleteBackupCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • restoreDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,RestoreDatabaseMetadata> restoreDatabaseAsync(RestoreDatabaseRequest request)
      Creates a new database by restoring from an existing backup.

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

      
       // 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())
                 .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
                 .putAllTags(new HashMap<String, String>())
                 .build();
         Database response = firestoreAdminClient.restoreDatabaseAsync(request).get();
       }
       
      Parameters:
      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
    • restoreDatabaseOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<RestoreDatabaseRequest,Database,RestoreDatabaseMetadata> restoreDatabaseOperationCallable()
      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.FirestoreAdmin.CreateDatabase] except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing 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:

      
       // 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())
                 .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
                 .putAllTags(new HashMap<String, String>())
                 .build();
         OperationFuture<Database, RestoreDatabaseMetadata> future =
             firestoreAdminClient.restoreDatabaseOperationCallable().futureCall(request);
         // Do something.
         Database response = future.get();
       }
       
    • restoreDatabaseCallable

      public final com.google.api.gax.rpc.UnaryCallable<RestoreDatabaseRequest,com.google.longrunning.Operation> restoreDatabaseCallable()
      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.FirestoreAdmin.CreateDatabase] except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing 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:

      
       // 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())
                 .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
                 .putAllTags(new HashMap<String, String>())
                 .build();
         ApiFuture<Operation> future =
             firestoreAdminClient.restoreDatabaseCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • createBackupSchedule

      public final BackupSchedule createBackupSchedule(DatabaseName parent, BackupSchedule backupSchedule)
      Creates a backup schedule on a database. At most two backup schedules can be configured on a database, one daily backup schedule and one weekly backup schedule.

      Sample code:

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

      Format `projects/{project}/databases/{database}`

      backupSchedule - Required. The backup schedule to create.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • createBackupSchedule

      public final BackupSchedule createBackupSchedule(String parent, BackupSchedule backupSchedule)
      Creates a backup schedule on a database. At most two backup schedules can be configured on a database, one daily backup schedule and one weekly backup schedule.

      Sample code:

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

      Format `projects/{project}/databases/{database}`

      backupSchedule - Required. The backup schedule to create.
      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • createBackupSchedule

      public final BackupSchedule createBackupSchedule(CreateBackupScheduleRequest request)
      Creates a backup schedule on a database. At most two backup schedules can be configured on a database, one daily backup schedule and one weekly backup schedule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateBackupScheduleRequest request =
             CreateBackupScheduleRequest.newBuilder()
                 .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .setBackupSchedule(BackupSchedule.newBuilder().build())
                 .build();
         BackupSchedule response = firestoreAdminClient.createBackupSchedule(request);
       }
       
      Parameters:
      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
    • createBackupScheduleCallable

      public final com.google.api.gax.rpc.UnaryCallable<CreateBackupScheduleRequest,BackupSchedule> createBackupScheduleCallable()
      Creates a backup schedule on a database. At most two backup schedules can be configured on a database, one daily backup schedule and one weekly backup schedule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CreateBackupScheduleRequest request =
             CreateBackupScheduleRequest.newBuilder()
                 .setParent(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
                 .setBackupSchedule(BackupSchedule.newBuilder().build())
                 .build();
         ApiFuture<BackupSchedule> future =
             firestoreAdminClient.createBackupScheduleCallable().futureCall(request);
         // Do something.
         BackupSchedule response = future.get();
       }
       
    • getBackupSchedule

      public final BackupSchedule getBackupSchedule(BackupScheduleName name)
      Gets information about a backup schedule.

      Sample code:

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

      public final BackupSchedule getBackupSchedule(String name)
      Gets information about a backup schedule.

      Sample code:

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

      public final BackupSchedule getBackupSchedule(GetBackupScheduleRequest request)
      Gets information about a backup schedule.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<GetBackupScheduleRequest,BackupSchedule> getBackupScheduleCallable()
      Gets information about a backup schedule.

      Sample code:

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

      public final ListBackupSchedulesResponse listBackupSchedules(DatabaseName parent)
      List backup schedules.

      Sample code:

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

      Format is `projects/{project}/databases/{database}`.

      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listBackupSchedules

      public final ListBackupSchedulesResponse listBackupSchedules(String parent)
      List backup schedules.

      Sample code:

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

      Format is `projects/{project}/databases/{database}`.

      Throws:
      com.google.api.gax.rpc.ApiException - if the remote call fails
    • listBackupSchedules

      public final ListBackupSchedulesResponse listBackupSchedules(ListBackupSchedulesRequest request)
      List backup schedules.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<ListBackupSchedulesRequest,ListBackupSchedulesResponse> listBackupSchedulesCallable()
      List backup schedules.

      Sample code:

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

      public final BackupSchedule updateBackupSchedule(BackupSchedule backupSchedule, com.google.protobuf.FieldMask updateMask)
      Updates a backup schedule.

      Sample code:

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

      public final BackupSchedule updateBackupSchedule(UpdateBackupScheduleRequest request)
      Updates a backup schedule.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<UpdateBackupScheduleRequest,BackupSchedule> updateBackupScheduleCallable()
      Updates a backup schedule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         UpdateBackupScheduleRequest request =
             UpdateBackupScheduleRequest.newBuilder()
                 .setBackupSchedule(BackupSchedule.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<BackupSchedule> future =
             firestoreAdminClient.updateBackupScheduleCallable().futureCall(request);
         // Do something.
         BackupSchedule response = future.get();
       }
       
    • deleteBackupSchedule

      public final void deleteBackupSchedule(BackupScheduleName name)
      Deletes a backup schedule.

      Sample code:

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

      public final void deleteBackupSchedule(String name)
      Deletes a backup schedule.

      Sample code:

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

      public final void deleteBackupSchedule(DeleteBackupScheduleRequest request)
      Deletes a backup schedule.

      Sample code:

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

      public final com.google.api.gax.rpc.UnaryCallable<DeleteBackupScheduleRequest,com.google.protobuf.Empty> deleteBackupScheduleCallable()
      Deletes a backup schedule.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         DeleteBackupScheduleRequest request =
             DeleteBackupScheduleRequest.newBuilder()
                 .setName(
                     BackupScheduleName.of("[PROJECT]", "[DATABASE]", "[BACKUP_SCHEDULE]").toString())
                 .build();
         ApiFuture<Empty> future =
             firestoreAdminClient.deleteBackupScheduleCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • cloneDatabaseAsync

      public final com.google.api.gax.longrunning.OperationFuture<Database,CloneDatabaseMetadata> cloneDatabaseAsync(CloneDatabaseRequest request)
      Creates a new database by cloning an existing one.

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

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CloneDatabaseRequest request =
             CloneDatabaseRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setDatabaseId("databaseId1688905718")
                 .setPitrSnapshot(PitrSnapshot.newBuilder().build())
                 .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
                 .putAllTags(new HashMap<String, String>())
                 .build();
         Database response = firestoreAdminClient.cloneDatabaseAsync(request).get();
       }
       
      Parameters:
      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
    • cloneDatabaseOperationCallable

      public final com.google.api.gax.rpc.OperationCallable<CloneDatabaseRequest,Database,CloneDatabaseMetadata> cloneDatabaseOperationCallable()
      Creates a new database by cloning an existing one.

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

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CloneDatabaseRequest request =
             CloneDatabaseRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setDatabaseId("databaseId1688905718")
                 .setPitrSnapshot(PitrSnapshot.newBuilder().build())
                 .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
                 .putAllTags(new HashMap<String, String>())
                 .build();
         OperationFuture<Database, CloneDatabaseMetadata> future =
             firestoreAdminClient.cloneDatabaseOperationCallable().futureCall(request);
         // Do something.
         Database response = future.get();
       }
       
    • cloneDatabaseCallable

      public final com.google.api.gax.rpc.UnaryCallable<CloneDatabaseRequest,com.google.longrunning.Operation> cloneDatabaseCallable()
      Creates a new database by cloning an existing one.

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

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
         CloneDatabaseRequest request =
             CloneDatabaseRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setDatabaseId("databaseId1688905718")
                 .setPitrSnapshot(PitrSnapshot.newBuilder().build())
                 .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build())
                 .putAllTags(new HashMap<String, String>())
                 .build();
         ApiFuture<Operation> future =
             firestoreAdminClient.cloneDatabaseCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface com.google.api.gax.core.BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface com.google.api.gax.core.BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface com.google.api.gax.core.BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface com.google.api.gax.core.BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface com.google.api.gax.core.BackgroundResource
      Throws:
      InterruptedException