pub struct DocumentService { /* private fields */ }document-service only.Expand description
Implements a client for the Discovery Engine API.
§Example
let client = DocumentService::builder().build().await?;
// use `client` to make requests to the Discovery Engine API.§Service Description
Service for ingesting Document information of the customer’s website.
§Configuration
To configure DocumentService 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://discoveryengine.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
DocumentService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap DocumentService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl DocumentService
impl DocumentService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for DocumentService.
let client = DocumentService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: DocumentService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: DocumentService + '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 get_document(&self) -> GetDocument
pub fn get_document(&self) -> GetDocument
Gets a Document.
Sourcepub fn list_documents(&self) -> ListDocuments
pub fn list_documents(&self) -> ListDocuments
Gets a list of Documents.
Sourcepub fn create_document(&self) -> CreateDocument
pub fn create_document(&self) -> CreateDocument
Creates a Document.
Sourcepub fn update_document(&self) -> UpdateDocument
pub fn update_document(&self) -> UpdateDocument
Updates a Document.
Sourcepub fn delete_document(&self) -> DeleteDocument
pub fn delete_document(&self) -> DeleteDocument
Deletes a Document.
Sourcepub fn import_documents(&self) -> ImportDocuments
pub fn import_documents(&self) -> ImportDocuments
Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items are created.
Note: It is possible for a subset of the Documents to be successfully updated.
§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 purge_documents(&self) -> PurgeDocuments
pub fn purge_documents(&self) -> PurgeDocuments
Permanently deletes all selected Documents in a branch.
This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments.
To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.
§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 batch_get_documents_metadata(&self) -> BatchGetDocumentsMetadata
pub fn batch_get_documents_metadata(&self) -> BatchGetDocumentsMetadata
Gets index freshness metadata for Documents. Supported for website search only.
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 cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for DocumentService
impl Clone for DocumentService
Source§fn clone(&self) -> DocumentService
fn clone(&self) -> DocumentService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more