pub struct FirestoreAdmin { /* private fields */ }Expand description
Implements a client for the Cloud Firestore API.
§Example
let client = FirestoreAdmin::builder().build().await?;
// use `client` to make requests to the Cloud Firestore API.§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.
§Configuration
To configure FirestoreAdmin use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://firestore.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
FirestoreAdmin holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap FirestoreAdmin in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl FirestoreAdmin
impl FirestoreAdmin
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for FirestoreAdmin.
let client = FirestoreAdmin::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: FirestoreAdmin + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: FirestoreAdmin + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_index(&self) -> CreateIndex
pub fn create_index(&self) -> CreateIndex
Creates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type IndexOperationMetadata.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_indexes(&self) -> ListIndexes
pub fn list_indexes(&self) -> ListIndexes
Lists composite indexes.
Sourcepub fn delete_index(&self) -> DeleteIndex
pub fn delete_index(&self) -> DeleteIndex
Deletes a composite index.
Sourcepub fn update_field(&self) -> UpdateField
pub fn update_field(&self) -> UpdateField
Updates a field configuration. Currently, field updates apply only to
single field index configuration. However, calls to
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 which may be used to track the status of the field update. The metadata for the operation will be the type 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/*.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_fields(&self) -> ListFields
pub fn list_fields(&self) -> ListFields
Lists the field configuration and metadata for this database.
Currently,
FirestoreAdmin.ListFields
only supports listing fields that have been explicitly overridden. To issue
this query, call
FirestoreAdmin.ListFields
with the filter set to indexConfig.usesAncestorConfig:false or
ttlConfig:*.
Sourcepub fn export_documents(&self) -> ExportDocuments
pub fn export_documents(&self) -> 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
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn import_documents(&self) -> ImportDocuments
pub fn import_documents(&self) -> 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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn bulk_delete_documents(&self) -> BulkDeleteDocuments
pub fn bulk_delete_documents(&self) -> 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
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn create_database(&self) -> CreateDatabase
pub fn create_database(&self) -> CreateDatabase
Create a database.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn get_database(&self) -> GetDatabase
pub fn get_database(&self) -> GetDatabase
Gets information about a database.
Sourcepub fn list_databases(&self) -> ListDatabases
pub fn list_databases(&self) -> ListDatabases
List all the databases in the project.
Sourcepub fn update_database(&self) -> UpdateDatabase
pub fn update_database(&self) -> UpdateDatabase
Updates a database.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn delete_database(&self) -> DeleteDatabase
pub fn delete_database(&self) -> DeleteDatabase
Deletes a database.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn create_user_creds(&self) -> CreateUserCreds
pub fn create_user_creds(&self) -> CreateUserCreds
Create a user creds.
Sourcepub fn get_user_creds(&self) -> GetUserCreds
pub fn get_user_creds(&self) -> GetUserCreds
Gets a user creds resource. Note that the returned resource does not contain the secret value itself.
Sourcepub fn list_user_creds(&self) -> ListUserCreds
pub fn list_user_creds(&self) -> ListUserCreds
List all user creds in the database. Note that the returned resource does not contain the secret value itself.
Sourcepub fn enable_user_creds(&self) -> EnableUserCreds
pub fn enable_user_creds(&self) -> EnableUserCreds
Enables a user creds. No-op if the user creds are already enabled.
Sourcepub fn disable_user_creds(&self) -> DisableUserCreds
pub fn disable_user_creds(&self) -> DisableUserCreds
Disables a user creds. No-op if the user creds are already disabled.
Sourcepub fn reset_user_password(&self) -> ResetUserPassword
pub fn reset_user_password(&self) -> ResetUserPassword
Resets the password of a user creds.
Sourcepub fn delete_user_creds(&self) -> DeleteUserCreds
pub fn delete_user_creds(&self) -> DeleteUserCreds
Deletes a user creds.
Sourcepub fn get_backup(&self) -> GetBackup
pub fn get_backup(&self) -> GetBackup
Gets information about a backup.
Sourcepub fn list_backups(&self) -> ListBackups
pub fn list_backups(&self) -> ListBackups
Lists all the backups.
Sourcepub fn delete_backup(&self) -> DeleteBackup
pub fn delete_backup(&self) -> DeleteBackup
Deletes a backup.
Sourcepub fn restore_database(&self) -> RestoreDatabase
pub fn restore_database(&self) -> 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 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 can be used to track the progress of the restore, with the Operation’s metadata field type being the RestoreDatabaseMetadata. The response type is the Database if the restore was successful. The new database is not readable or writeable until the LRO has completed.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn create_backup_schedule(&self) -> CreateBackupSchedule
pub fn create_backup_schedule(&self) -> 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.
Sourcepub fn get_backup_schedule(&self) -> GetBackupSchedule
pub fn get_backup_schedule(&self) -> GetBackupSchedule
Gets information about a backup schedule.
Sourcepub fn list_backup_schedules(&self) -> ListBackupSchedules
pub fn list_backup_schedules(&self) -> ListBackupSchedules
List backup schedules.
Sourcepub fn update_backup_schedule(&self) -> UpdateBackupSchedule
pub fn update_backup_schedule(&self) -> UpdateBackupSchedule
Updates a backup schedule.
Sourcepub fn delete_backup_schedule(&self) -> DeleteBackupSchedule
pub fn delete_backup_schedule(&self) -> DeleteBackupSchedule
Deletes a backup schedule.
Sourcepub fn clone_database(&self) -> CloneDatabase
pub fn clone_database(&self) -> 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 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 can be used to track the progress of the clone, with the Operation’s metadata field type being the CloneDatabaseMetadata. The response type is the Database if the clone was successful. The new database is not readable or writeable until the LRO has completed.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Sourcepub fn delete_operation(&self) -> DeleteOperation
pub fn delete_operation(&self) -> DeleteOperation
Provides the Operations service functionality in this service.
Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for FirestoreAdmin
impl Clone for FirestoreAdmin
Source§fn clone(&self) -> FirestoreAdmin
fn clone(&self) -> FirestoreAdmin
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more