pub struct ProjectMethods<'a, C>where
C: 'a,{ /* private fields */ }Expand description
A builder providing access to all methods supported on project resources.
It is not used directly, but through the Firestore hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_firestore1_beta1 as firestore1_beta1;
use firestore1_beta1::{Firestore, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = Firestore::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `databases_documents_batch_get(...)`, `databases_documents_batch_write(...)`, `databases_documents_begin_transaction(...)`, `databases_documents_commit(...)`, `databases_documents_create_document(...)`, `databases_documents_delete(...)`, `databases_documents_get(...)`, `databases_documents_list(...)`, `databases_documents_list_collection_ids(...)`, `databases_documents_list_documents(...)`, `databases_documents_listen(...)`, `databases_documents_partition_query(...)`, `databases_documents_patch(...)`, `databases_documents_rollback(...)`, `databases_documents_run_aggregation_query(...)`, `databases_documents_run_query(...)`, `databases_documents_write(...)`, `databases_export_documents(...)`, `databases_import_documents(...)`, `databases_indexes_create(...)`, `databases_indexes_delete(...)`, `databases_indexes_get(...)` and `databases_indexes_list(...)`
// to build up your call.
let rb = hub.projects();Implementations§
Source§impl<'a, C> ProjectMethods<'a, C>
impl<'a, C> ProjectMethods<'a, C>
Sourcepub fn databases_documents_batch_get(
&self,
request: BatchGetDocumentsRequest,
database: &str,
) -> ProjectDatabaseDocumentBatchGetCall<'a, C>
pub fn databases_documents_batch_get( &self, request: BatchGetDocumentsRequest, database: &str, ) -> ProjectDatabaseDocumentBatchGetCall<'a, C>
Create a builder to help you perform the following task:
Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested.
§Arguments
request- No description provided.database- Required. The database name. In the format:projects/{project_id}/databases/{database_id}.
Sourcepub fn databases_documents_batch_write(
&self,
request: BatchWriteRequest,
database: &str,
) -> ProjectDatabaseDocumentBatchWriteCall<'a, C>
pub fn databases_documents_batch_write( &self, request: BatchWriteRequest, database: &str, ) -> ProjectDatabaseDocumentBatchWriteCall<'a, C>
Create a builder to help you perform the following task:
Applies a batch of write operations. The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the BatchWriteResponse for the success status of each write. If you require an atomically applied set of writes, use Commit instead.
§Arguments
request- No description provided.database- Required. The database name. In the format:projects/{project_id}/databases/{database_id}.
Sourcepub fn databases_documents_begin_transaction(
&self,
request: BeginTransactionRequest,
database: &str,
) -> ProjectDatabaseDocumentBeginTransactionCall<'a, C>
pub fn databases_documents_begin_transaction( &self, request: BeginTransactionRequest, database: &str, ) -> ProjectDatabaseDocumentBeginTransactionCall<'a, C>
Create a builder to help you perform the following task:
Starts a new transaction.
§Arguments
request- No description provided.database- Required. The database name. In the format:projects/{project_id}/databases/{database_id}.
Sourcepub fn databases_documents_commit(
&self,
request: CommitRequest,
database: &str,
) -> ProjectDatabaseDocumentCommitCall<'a, C>
pub fn databases_documents_commit( &self, request: CommitRequest, database: &str, ) -> ProjectDatabaseDocumentCommitCall<'a, C>
Create a builder to help you perform the following task:
Commits a transaction, while optionally updating documents.
§Arguments
request- No description provided.database- Required. The database name. In the format:projects/{project_id}/databases/{database_id}.
Sourcepub fn databases_documents_create_document(
&self,
request: Document,
parent: &str,
collection_id: &str,
) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C>
pub fn databases_documents_create_document( &self, request: Document, parent: &str, collection_id: &str, ) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C>
Create a builder to help you perform the following task:
Creates a new document.
§Arguments
request- No description provided.parent- Required. The parent resource. For example:projects/{project_id}/databases/{database_id}/documentsorprojects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}collectionId- Required. The collection ID, relative toparent, to list. For example:chatrooms.
Sourcepub fn databases_documents_delete(
&self,
name: &str,
) -> ProjectDatabaseDocumentDeleteCall<'a, C>
pub fn databases_documents_delete( &self, name: &str, ) -> ProjectDatabaseDocumentDeleteCall<'a, C>
Create a builder to help you perform the following task:
Deletes a document.
§Arguments
name- Required. The resource name of the Document to delete. In the format:projects/{project_id}/databases/{database_id}/documents/{document_path}.
Sourcepub fn databases_documents_get(
&self,
name: &str,
) -> ProjectDatabaseDocumentGetCall<'a, C>
pub fn databases_documents_get( &self, name: &str, ) -> ProjectDatabaseDocumentGetCall<'a, C>
Create a builder to help you perform the following task:
Gets a single document.
§Arguments
name- Required. The resource name of the Document to get. In the format:projects/{project_id}/databases/{database_id}/documents/{document_path}.
Sourcepub fn databases_documents_list(
&self,
parent: &str,
collection_id: &str,
) -> ProjectDatabaseDocumentListCall<'a, C>
pub fn databases_documents_list( &self, parent: &str, collection_id: &str, ) -> ProjectDatabaseDocumentListCall<'a, C>
Create a builder to help you perform the following task:
Lists documents.
§Arguments
parent- Required. The parent resource name. In the format:projects/{project_id}/databases/{database_id}/documentsorprojects/{project_id}/databases/{database_id}/documents/{document_path}. For example:projects/my-project/databases/my-database/documentsorprojects/my-project/databases/my-database/documents/chatrooms/my-chatroomcollectionId- Optional. The collection ID, relative toparent, to list. For example:chatroomsormessages. This is optional, and when not provided, Firestore will list documents from all collections under the providedparent.
Sourcepub fn databases_documents_list_collection_ids(
&self,
request: ListCollectionIdsRequest,
parent: &str,
) -> ProjectDatabaseDocumentListCollectionIdCall<'a, C>
pub fn databases_documents_list_collection_ids( &self, request: ListCollectionIdsRequest, parent: &str, ) -> ProjectDatabaseDocumentListCollectionIdCall<'a, C>
Create a builder to help you perform the following task:
Lists all the collection IDs underneath a document.
§Arguments
request- No description provided.parent- Required. The parent document. In the format:projects/{project_id}/databases/{database_id}/documents/{document_path}. For example:projects/my-project/databases/my-database/documents/chatrooms/my-chatroom
Sourcepub fn databases_documents_list_documents(
&self,
parent: &str,
collection_id: &str,
) -> ProjectDatabaseDocumentListDocumentCall<'a, C>
pub fn databases_documents_list_documents( &self, parent: &str, collection_id: &str, ) -> ProjectDatabaseDocumentListDocumentCall<'a, C>
Create a builder to help you perform the following task:
Lists documents.
§Arguments
parent- Required. The parent resource name. In the format:projects/{project_id}/databases/{database_id}/documentsorprojects/{project_id}/databases/{database_id}/documents/{document_path}. For example:projects/my-project/databases/my-database/documentsorprojects/my-project/databases/my-database/documents/chatrooms/my-chatroomcollectionId- Optional. The collection ID, relative toparent, to list. For example:chatroomsormessages. This is optional, and when not provided, Firestore will list documents from all collections under the providedparent.
Sourcepub fn databases_documents_listen(
&self,
request: ListenRequest,
database: &str,
) -> ProjectDatabaseDocumentListenCall<'a, C>
pub fn databases_documents_listen( &self, request: ListenRequest, database: &str, ) -> ProjectDatabaseDocumentListenCall<'a, C>
Create a builder to help you perform the following task:
Listens to changes. This method is only available via gRPC or WebChannel (not REST).
§Arguments
request- No description provided.database- Required. The database name. In the format:projects/{project_id}/databases/{database_id}.
Sourcepub fn databases_documents_partition_query(
&self,
request: PartitionQueryRequest,
parent: &str,
) -> ProjectDatabaseDocumentPartitionQueryCall<'a, C>
pub fn databases_documents_partition_query( &self, request: PartitionQueryRequest, parent: &str, ) -> ProjectDatabaseDocumentPartitionQueryCall<'a, C>
Create a builder to help you perform the following task:
Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.
§Arguments
request- No description provided.parent- Required. The parent resource name. In the format:projects/{project_id}/databases/{database_id}/documents. Document resource names are not supported; only database resource names can be specified.
Sourcepub fn databases_documents_patch(
&self,
request: Document,
name: &str,
) -> ProjectDatabaseDocumentPatchCall<'a, C>
pub fn databases_documents_patch( &self, request: Document, name: &str, ) -> ProjectDatabaseDocumentPatchCall<'a, C>
Create a builder to help you perform the following task:
Updates or inserts a document.
§Arguments
request- No description provided.name- The resource name of the document, for exampleprojects/{project_id}/databases/{database_id}/documents/{document_path}.
Sourcepub fn databases_documents_rollback(
&self,
request: RollbackRequest,
database: &str,
) -> ProjectDatabaseDocumentRollbackCall<'a, C>
pub fn databases_documents_rollback( &self, request: RollbackRequest, database: &str, ) -> ProjectDatabaseDocumentRollbackCall<'a, C>
Create a builder to help you perform the following task:
Rolls back a transaction.
§Arguments
request- No description provided.database- Required. The database name. In the format:projects/{project_id}/databases/{database_id}.
Sourcepub fn databases_documents_run_aggregation_query(
&self,
request: RunAggregationQueryRequest,
parent: &str,
) -> ProjectDatabaseDocumentRunAggregationQueryCall<'a, C>
pub fn databases_documents_run_aggregation_query( &self, request: RunAggregationQueryRequest, parent: &str, ) -> ProjectDatabaseDocumentRunAggregationQueryCall<'a, C>
Create a builder to help you perform the following task:
Runs an aggregation query. Rather than producing Document results like Firestore.RunQuery, this API allows running an aggregation to produce a series of AggregationResult server-side. High-Level Example: -- Return the number of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k where a = true );
§Arguments
request- No description provided.parent- Required. The parent resource name. In the format:projects/{project_id}/databases/{database_id}/documentsorprojects/{project_id}/databases/{database_id}/documents/{document_path}. For example:projects/my-project/databases/my-database/documentsorprojects/my-project/databases/my-database/documents/chatrooms/my-chatroom
Sourcepub fn databases_documents_run_query(
&self,
request: RunQueryRequest,
parent: &str,
) -> ProjectDatabaseDocumentRunQueryCall<'a, C>
pub fn databases_documents_run_query( &self, request: RunQueryRequest, parent: &str, ) -> ProjectDatabaseDocumentRunQueryCall<'a, C>
Create a builder to help you perform the following task:
Runs a query.
§Arguments
request- No description provided.parent- Required. The parent resource name. In the format:projects/{project_id}/databases/{database_id}/documentsorprojects/{project_id}/databases/{database_id}/documents/{document_path}. For example:projects/my-project/databases/my-database/documentsorprojects/my-project/databases/my-database/documents/chatrooms/my-chatroom
Sourcepub fn databases_documents_write(
&self,
request: WriteRequest,
database: &str,
) -> ProjectDatabaseDocumentWriteCall<'a, C>
pub fn databases_documents_write( &self, request: WriteRequest, database: &str, ) -> ProjectDatabaseDocumentWriteCall<'a, C>
Create a builder to help you perform the following task:
Streams batches of document updates and deletes, in order. This method is only available via gRPC or WebChannel (not REST).
§Arguments
request- No description provided.database- Required. The database name. In the format:projects/{project_id}/databases/{database_id}. This is only required in the first message.
Sourcepub fn databases_indexes_create(
&self,
request: GoogleFirestoreAdminV1beta1Index,
parent: &str,
) -> ProjectDatabaseIndexCreateCall<'a, C>
pub fn databases_indexes_create( &self, request: GoogleFirestoreAdminV1beta1Index, parent: &str, ) -> ProjectDatabaseIndexCreateCall<'a, C>
Create a builder to help you perform the following task:
Creates the specified index. A newly created index’s initial state is CREATING. On completion of the returned google.longrunning.Operation, the state will be READY. If the index already exists, the call will return an ALREADY_EXISTS status. During creation, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, removing the index with delete, then re-creating the index with create. Indexes with a single field cannot be created.
§Arguments
request- No description provided.parent- The name of the database this index will apply to. For example:projects/{project_id}/databases/{database_id}
Sourcepub fn databases_indexes_delete(
&self,
name: &str,
) -> ProjectDatabaseIndexDeleteCall<'a, C>
pub fn databases_indexes_delete( &self, name: &str, ) -> ProjectDatabaseIndexDeleteCall<'a, C>
Create a builder to help you perform the following task:
Deletes an index.
§Arguments
name- The index name. For example:projects/{project_id}/databases/{database_id}/indexes/{index_id}
Sourcepub fn databases_indexes_get(
&self,
name: &str,
) -> ProjectDatabaseIndexGetCall<'a, C>
pub fn databases_indexes_get( &self, name: &str, ) -> ProjectDatabaseIndexGetCall<'a, C>
Create a builder to help you perform the following task:
Gets an index.
§Arguments
name- The name of the index. For example:projects/{project_id}/databases/{database_id}/indexes/{index_id}
Sourcepub fn databases_indexes_list(
&self,
parent: &str,
) -> ProjectDatabaseIndexListCall<'a, C>
pub fn databases_indexes_list( &self, parent: &str, ) -> ProjectDatabaseIndexListCall<'a, C>
Create a builder to help you perform the following task:
Lists the indexes that match the specified filters.
§Arguments
parent- The database name. For example:projects/{project_id}/databases/{database_id}
Sourcepub fn databases_export_documents(
&self,
request: GoogleFirestoreAdminV1beta1ExportDocumentsRequest,
name: &str,
) -> ProjectDatabaseExportDocumentCall<'a, C>
pub fn databases_export_documents( &self, request: GoogleFirestoreAdminV1beta1ExportDocumentsRequest, name: &str, ) -> ProjectDatabaseExportDocumentCall<'a, C>
Create a builder to help you perform the following task:
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.
§Arguments
request- No description provided.name- Database to export. Should be of the form:projects/{project_id}/databases/{database_id}.
Sourcepub fn databases_import_documents(
&self,
request: GoogleFirestoreAdminV1beta1ImportDocumentsRequest,
name: &str,
) -> ProjectDatabaseImportDocumentCall<'a, C>
pub fn databases_import_documents( &self, request: GoogleFirestoreAdminV1beta1ImportDocumentsRequest, name: &str, ) -> ProjectDatabaseImportDocumentCall<'a, C>
Create a builder to help you perform the following task:
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.
§Arguments
request- No description provided.name- Database to import into. Should be of the form:projects/{project_id}/databases/{database_id}.
Trait Implementations§
impl<'a, C> MethodsBuilder for ProjectMethods<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for ProjectMethods<'a, C>
impl<'a, C> !RefUnwindSafe for ProjectMethods<'a, C>
impl<'a, C> Send for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Sync for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Unpin for ProjectMethods<'a, C>
impl<'a, C> !UnwindSafe for ProjectMethods<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more