#[non_exhaustive]pub struct ImportDocumentsRequest {
pub parent: String,
pub document_template: Option<ImportDocumentTemplate>,
pub import_gcs_custom_metadata: bool,
pub source: Option<Source>,
/* private fields */
}documents only.Expand description
Request message for Documents.ImportDocuments.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parent: StringRequired. The knowledge base to import documents into.
Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.
document_template: Option<ImportDocumentTemplate>Required. Document template used for importing all the documents.
import_gcs_custom_metadata: boolWhether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.
source: Option<Source>Required. The source to use for importing documents.
If the source captures multiple objects, then multiple documents will be created, one corresponding to each object, and all of these documents will be created using the same document template.
Dialogflow supports up to 350 documents in each request. If you try to import more, Dialogflow will return an error.
Implementations§
Source§impl ImportDocumentsRequest
impl ImportDocumentsRequest
pub fn new() -> Self
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_document_template<T>(self, v: T) -> Selfwhere
T: Into<ImportDocumentTemplate>,
pub fn set_document_template<T>(self, v: T) -> Selfwhere
T: Into<ImportDocumentTemplate>,
Sets the value of document_template.
§Example
use google_cloud_dialogflow_v2::model::ImportDocumentTemplate;
let x = ImportDocumentsRequest::new().set_document_template(ImportDocumentTemplate::default()/* use setters */);Sourcepub fn set_or_clear_document_template<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImportDocumentTemplate>,
pub fn set_or_clear_document_template<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImportDocumentTemplate>,
Sets or clears the value of document_template.
§Example
use google_cloud_dialogflow_v2::model::ImportDocumentTemplate;
let x = ImportDocumentsRequest::new().set_or_clear_document_template(Some(ImportDocumentTemplate::default()/* use setters */));
let x = ImportDocumentsRequest::new().set_or_clear_document_template(None::<ImportDocumentTemplate>);Sourcepub fn set_import_gcs_custom_metadata<T: Into<bool>>(self, v: T) -> Self
pub fn set_import_gcs_custom_metadata<T: Into<bool>>(self, v: T) -> Self
Sets the value of import_gcs_custom_metadata.
§Example
let x = ImportDocumentsRequest::new().set_import_gcs_custom_metadata(true);Sourcepub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
pub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
Sets the value of source.
Note that all the setters affecting source are mutually
exclusive.
§Example
use google_cloud_dialogflow_v2::model::GcsSources;
let x = ImportDocumentsRequest::new().set_source(Some(
google_cloud_dialogflow_v2::model::import_documents_request::Source::GcsSource(GcsSources::default().into())));Sourcepub fn gcs_source(&self) -> Option<&Box<GcsSources>>
pub fn gcs_source(&self) -> Option<&Box<GcsSources>>
The value of source
if it holds a GcsSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_gcs_source<T: Into<Box<GcsSources>>>(self, v: T) -> Self
pub fn set_gcs_source<T: Into<Box<GcsSources>>>(self, v: T) -> Self
Sets the value of source
to hold a GcsSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::GcsSources;
let x = ImportDocumentsRequest::new().set_gcs_source(GcsSources::default()/* use setters */);
assert!(x.gcs_source().is_some());Trait Implementations§
Source§impl Clone for ImportDocumentsRequest
impl Clone for ImportDocumentsRequest
Source§fn clone(&self) -> ImportDocumentsRequest
fn clone(&self) -> ImportDocumentsRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more