pub struct Documents { /* private fields */ }documents only.Expand description
Implements a client for the Dialogflow API.
§Example
let client = Documents::builder().build().await?;
// use `client` to make requests to the Dialogflow API.§Service Description
Service for managing knowledge Documents.
§Configuration
To configure Documents 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://dialogflow.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
Documents holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap Documents in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl Documents
impl Documents
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for Documents.
let client = Documents::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Documents + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Documents + '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 list_documents(&self) -> ListDocuments
pub fn list_documents(&self) -> ListDocuments
Returns the list of all documents of the knowledge base.
Sourcepub fn get_document(&self) -> GetDocument
pub fn get_document(&self) -> GetDocument
Retrieves the specified document.
Sourcepub fn create_document(&self) -> CreateDocument
pub fn create_document(&self) -> CreateDocument
Creates a new document.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: KnowledgeOperationMetadataresponse: Document
§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
Creates documents by importing data from external sources. Dialogflow supports up to 350 documents in each request. If you try to import more, Dialogflow will return an error.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: KnowledgeOperationMetadataresponse: ImportDocumentsResponse
§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_document(&self) -> DeleteDocument
pub fn delete_document(&self) -> DeleteDocument
Deletes the specified document.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: KnowledgeOperationMetadataresponse: An Empty message
§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 update_document(&self) -> UpdateDocument
pub fn update_document(&self) -> UpdateDocument
Updates the specified document.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: KnowledgeOperationMetadataresponse: Document
§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 reload_document(&self) -> ReloadDocument
pub fn reload_document(&self) -> ReloadDocument
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: KnowledgeOperationMetadataresponse: Document
Note: The projects.agent.knowledgeBases.documents resource is deprecated;
only use projects.knowledgeBases.documents.
§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 export_document(&self) -> ExportDocument
pub fn export_document(&self) -> ExportDocument
Exports a smart messaging candidate document into the specified destination.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: KnowledgeOperationMetadataresponse: Document
§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_locations(&self) -> ListLocations
pub fn list_locations(&self) -> ListLocations
Lists information about the supported locations for this service.
Sourcepub fn get_location(&self) -> GetLocation
pub fn get_location(&self) -> GetLocation
Gets information about a location.
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.