#[non_exhaustive]pub struct ImportDocumentsRequest {
pub parent: String,
pub error_config: Option<ImportErrorConfig>,
pub reconciliation_mode: ReconciliationMode,
pub update_mask: Option<FieldMask>,
pub auto_generate_ids: bool,
pub id_field: String,
pub force_refresh_content: bool,
pub source: Option<Source>,
/* private fields */
}document-service only.Expand description
Request message for Import methods.
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 parent branch resource name, such as
projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}.
Requires create/update permission.
error_config: Option<ImportErrorConfig>The desired location of errors incurred during the Import.
reconciliation_mode: ReconciliationModeThe mode of reconciliation between existing documents and the documents to be imported. Defaults to ReconciliationMode.INCREMENTAL.
update_mask: Option<FieldMask>Indicates which fields in the provided imported documents to update. If not set, the default is to update all fields.
auto_generate_ids: boolWhether to automatically generate IDs for the documents if absent.
If set to true,
Document.ids are
automatically generated based on the hash of the payload, where IDs may not
be consistent during multiple imports. In which case
ReconciliationMode.FULL
is highly recommended to avoid duplicate contents. If unset or set to
false, Document.ids have
to be specified using
id_field,
otherwise, documents without IDs fail to be imported.
Supported data sources:
- GcsSource.
GcsSource.data_schema
must be
customorcsv. Otherwise, an INVALID_ARGUMENT error is thrown. - BigQuerySource.
BigQuerySource.data_schema
must be
customorcsv. Otherwise, an INVALID_ARGUMENT error is thrown. - SpannerSource.
- CloudSqlSource.
- FirestoreSource.
- BigtableSource.
id_field: StringThe field indicates the ID field or column to be used as unique IDs of the documents.
For GcsSource it is the key of
the JSON field. For instance, my_id for JSON {"my_id": "some_uuid"}.
For others, it may be the column name of the table where the unique ids are
stored.
The values of the JSON field or the table column are used as the Document.ids. The JSON field or the table column must be of string type, and the values must be set as valid strings conform to RFC-1034 with 1-63 characters. Otherwise, documents without valid IDs fail to be imported.
Only set this field when
auto_generate_ids
is unset or set as false. Otherwise, an INVALID_ARGUMENT error is thrown.
If it is unset, a default value _id is used when importing from the
allowed data sources.
Supported data sources:
- GcsSource.
GcsSource.data_schema
must be
customorcsv. Otherwise, an INVALID_ARGUMENT error is thrown. - BigQuerySource.
BigQuerySource.data_schema
must be
customorcsv. Otherwise, an INVALID_ARGUMENT error is thrown. - SpannerSource.
- CloudSqlSource.
- FirestoreSource.
- BigtableSource.
force_refresh_content: boolOptional. Whether to force refresh the unstructured content of the documents.
If set to true, the content part of the documents will be refreshed
regardless of the update status of the referencing content.
source: Option<Source>Required. The source of the input.
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_error_config<T>(self, v: T) -> Selfwhere
T: Into<ImportErrorConfig>,
pub fn set_error_config<T>(self, v: T) -> Selfwhere
T: Into<ImportErrorConfig>,
Sets the value of error_config.
§Example
use google_cloud_discoveryengine_v1::model::ImportErrorConfig;
let x = ImportDocumentsRequest::new().set_error_config(ImportErrorConfig::default()/* use setters */);Sourcepub fn set_or_clear_error_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImportErrorConfig>,
pub fn set_or_clear_error_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImportErrorConfig>,
Sets or clears the value of error_config.
§Example
use google_cloud_discoveryengine_v1::model::ImportErrorConfig;
let x = ImportDocumentsRequest::new().set_or_clear_error_config(Some(ImportErrorConfig::default()/* use setters */));
let x = ImportDocumentsRequest::new().set_or_clear_error_config(None::<ImportErrorConfig>);Sourcepub fn set_reconciliation_mode<T: Into<ReconciliationMode>>(self, v: T) -> Self
pub fn set_reconciliation_mode<T: Into<ReconciliationMode>>(self, v: T) -> Self
Sets the value of reconciliation_mode.
§Example
use google_cloud_discoveryengine_v1::model::import_documents_request::ReconciliationMode;
let x0 = ImportDocumentsRequest::new().set_reconciliation_mode(ReconciliationMode::Incremental);
let x1 = ImportDocumentsRequest::new().set_reconciliation_mode(ReconciliationMode::Full);Sourcepub fn set_update_mask<T>(self, v: T) -> Self
pub fn set_update_mask<T>(self, v: T) -> Self
Sets the value of update_mask.
§Example
use wkt::FieldMask;
let x = ImportDocumentsRequest::new().set_update_mask(FieldMask::default()/* use setters */);Sourcepub fn set_or_clear_update_mask<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_mask<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_mask.
§Example
use wkt::FieldMask;
let x = ImportDocumentsRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
let x = ImportDocumentsRequest::new().set_or_clear_update_mask(None::<FieldMask>);Sourcepub fn set_auto_generate_ids<T: Into<bool>>(self, v: T) -> Self
pub fn set_auto_generate_ids<T: Into<bool>>(self, v: T) -> Self
Sets the value of auto_generate_ids.
§Example
let x = ImportDocumentsRequest::new().set_auto_generate_ids(true);Sourcepub fn set_id_field<T: Into<String>>(self, v: T) -> Self
pub fn set_id_field<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_force_refresh_content<T: Into<bool>>(self, v: T) -> Self
pub fn set_force_refresh_content<T: Into<bool>>(self, v: T) -> Self
Sets the value of force_refresh_content.
§Example
let x = ImportDocumentsRequest::new().set_force_refresh_content(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_discoveryengine_v1::model::import_documents_request::InlineSource;
let x = ImportDocumentsRequest::new().set_source(Some(
google_cloud_discoveryengine_v1::model::import_documents_request::Source::InlineSource(InlineSource::default().into())));Sourcepub fn inline_source(&self) -> Option<&Box<InlineSource>>
pub fn inline_source(&self) -> Option<&Box<InlineSource>>
The value of source
if it holds a InlineSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_inline_source<T: Into<Box<InlineSource>>>(self, v: T) -> Self
pub fn set_inline_source<T: Into<Box<InlineSource>>>(self, v: T) -> Self
Sets the value of source
to hold a InlineSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::import_documents_request::InlineSource;
let x = ImportDocumentsRequest::new().set_inline_source(InlineSource::default()/* use setters */);
assert!(x.inline_source().is_some());
assert!(x.gcs_source().is_none());
assert!(x.bigquery_source().is_none());
assert!(x.fhir_store_source().is_none());
assert!(x.spanner_source().is_none());
assert!(x.cloud_sql_source().is_none());
assert!(x.firestore_source().is_none());
assert!(x.alloy_db_source().is_none());
assert!(x.bigtable_source().is_none());Sourcepub fn gcs_source(&self) -> Option<&Box<GcsSource>>
pub fn gcs_source(&self) -> Option<&Box<GcsSource>>
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<GcsSource>>>(self, v: T) -> Self
pub fn set_gcs_source<T: Into<Box<GcsSource>>>(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_discoveryengine_v1::model::GcsSource;
let x = ImportDocumentsRequest::new().set_gcs_source(GcsSource::default()/* use setters */);
assert!(x.gcs_source().is_some());
assert!(x.inline_source().is_none());
assert!(x.bigquery_source().is_none());
assert!(x.fhir_store_source().is_none());
assert!(x.spanner_source().is_none());
assert!(x.cloud_sql_source().is_none());
assert!(x.firestore_source().is_none());
assert!(x.alloy_db_source().is_none());
assert!(x.bigtable_source().is_none());Sourcepub fn bigquery_source(&self) -> Option<&Box<BigQuerySource>>
pub fn bigquery_source(&self) -> Option<&Box<BigQuerySource>>
The value of source
if it holds a BigquerySource, None if the field is not set or
holds a different branch.
Sourcepub fn set_bigquery_source<T: Into<Box<BigQuerySource>>>(self, v: T) -> Self
pub fn set_bigquery_source<T: Into<Box<BigQuerySource>>>(self, v: T) -> Self
Sets the value of source
to hold a BigquerySource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::BigQuerySource;
let x = ImportDocumentsRequest::new().set_bigquery_source(BigQuerySource::default()/* use setters */);
assert!(x.bigquery_source().is_some());
assert!(x.inline_source().is_none());
assert!(x.gcs_source().is_none());
assert!(x.fhir_store_source().is_none());
assert!(x.spanner_source().is_none());
assert!(x.cloud_sql_source().is_none());
assert!(x.firestore_source().is_none());
assert!(x.alloy_db_source().is_none());
assert!(x.bigtable_source().is_none());Sourcepub fn fhir_store_source(&self) -> Option<&Box<FhirStoreSource>>
pub fn fhir_store_source(&self) -> Option<&Box<FhirStoreSource>>
The value of source
if it holds a FhirStoreSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_fhir_store_source<T: Into<Box<FhirStoreSource>>>(self, v: T) -> Self
pub fn set_fhir_store_source<T: Into<Box<FhirStoreSource>>>(self, v: T) -> Self
Sets the value of source
to hold a FhirStoreSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::FhirStoreSource;
let x = ImportDocumentsRequest::new().set_fhir_store_source(FhirStoreSource::default()/* use setters */);
assert!(x.fhir_store_source().is_some());
assert!(x.inline_source().is_none());
assert!(x.gcs_source().is_none());
assert!(x.bigquery_source().is_none());
assert!(x.spanner_source().is_none());
assert!(x.cloud_sql_source().is_none());
assert!(x.firestore_source().is_none());
assert!(x.alloy_db_source().is_none());
assert!(x.bigtable_source().is_none());Sourcepub fn spanner_source(&self) -> Option<&Box<SpannerSource>>
pub fn spanner_source(&self) -> Option<&Box<SpannerSource>>
The value of source
if it holds a SpannerSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_spanner_source<T: Into<Box<SpannerSource>>>(self, v: T) -> Self
pub fn set_spanner_source<T: Into<Box<SpannerSource>>>(self, v: T) -> Self
Sets the value of source
to hold a SpannerSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::SpannerSource;
let x = ImportDocumentsRequest::new().set_spanner_source(SpannerSource::default()/* use setters */);
assert!(x.spanner_source().is_some());
assert!(x.inline_source().is_none());
assert!(x.gcs_source().is_none());
assert!(x.bigquery_source().is_none());
assert!(x.fhir_store_source().is_none());
assert!(x.cloud_sql_source().is_none());
assert!(x.firestore_source().is_none());
assert!(x.alloy_db_source().is_none());
assert!(x.bigtable_source().is_none());Sourcepub fn cloud_sql_source(&self) -> Option<&Box<CloudSqlSource>>
pub fn cloud_sql_source(&self) -> Option<&Box<CloudSqlSource>>
The value of source
if it holds a CloudSqlSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_cloud_sql_source<T: Into<Box<CloudSqlSource>>>(self, v: T) -> Self
pub fn set_cloud_sql_source<T: Into<Box<CloudSqlSource>>>(self, v: T) -> Self
Sets the value of source
to hold a CloudSqlSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::CloudSqlSource;
let x = ImportDocumentsRequest::new().set_cloud_sql_source(CloudSqlSource::default()/* use setters */);
assert!(x.cloud_sql_source().is_some());
assert!(x.inline_source().is_none());
assert!(x.gcs_source().is_none());
assert!(x.bigquery_source().is_none());
assert!(x.fhir_store_source().is_none());
assert!(x.spanner_source().is_none());
assert!(x.firestore_source().is_none());
assert!(x.alloy_db_source().is_none());
assert!(x.bigtable_source().is_none());Sourcepub fn firestore_source(&self) -> Option<&Box<FirestoreSource>>
pub fn firestore_source(&self) -> Option<&Box<FirestoreSource>>
The value of source
if it holds a FirestoreSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_firestore_source<T: Into<Box<FirestoreSource>>>(self, v: T) -> Self
pub fn set_firestore_source<T: Into<Box<FirestoreSource>>>(self, v: T) -> Self
Sets the value of source
to hold a FirestoreSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::FirestoreSource;
let x = ImportDocumentsRequest::new().set_firestore_source(FirestoreSource::default()/* use setters */);
assert!(x.firestore_source().is_some());
assert!(x.inline_source().is_none());
assert!(x.gcs_source().is_none());
assert!(x.bigquery_source().is_none());
assert!(x.fhir_store_source().is_none());
assert!(x.spanner_source().is_none());
assert!(x.cloud_sql_source().is_none());
assert!(x.alloy_db_source().is_none());
assert!(x.bigtable_source().is_none());Sourcepub fn alloy_db_source(&self) -> Option<&Box<AlloyDbSource>>
pub fn alloy_db_source(&self) -> Option<&Box<AlloyDbSource>>
The value of source
if it holds a AlloyDbSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_alloy_db_source<T: Into<Box<AlloyDbSource>>>(self, v: T) -> Self
pub fn set_alloy_db_source<T: Into<Box<AlloyDbSource>>>(self, v: T) -> Self
Sets the value of source
to hold a AlloyDbSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::AlloyDbSource;
let x = ImportDocumentsRequest::new().set_alloy_db_source(AlloyDbSource::default()/* use setters */);
assert!(x.alloy_db_source().is_some());
assert!(x.inline_source().is_none());
assert!(x.gcs_source().is_none());
assert!(x.bigquery_source().is_none());
assert!(x.fhir_store_source().is_none());
assert!(x.spanner_source().is_none());
assert!(x.cloud_sql_source().is_none());
assert!(x.firestore_source().is_none());
assert!(x.bigtable_source().is_none());Sourcepub fn bigtable_source(&self) -> Option<&Box<BigtableSource>>
pub fn bigtable_source(&self) -> Option<&Box<BigtableSource>>
The value of source
if it holds a BigtableSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_bigtable_source<T: Into<Box<BigtableSource>>>(self, v: T) -> Self
pub fn set_bigtable_source<T: Into<Box<BigtableSource>>>(self, v: T) -> Self
Sets the value of source
to hold a BigtableSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::BigtableSource;
let x = ImportDocumentsRequest::new().set_bigtable_source(BigtableSource::default()/* use setters */);
assert!(x.bigtable_source().is_some());
assert!(x.inline_source().is_none());
assert!(x.gcs_source().is_none());
assert!(x.bigquery_source().is_none());
assert!(x.fhir_store_source().is_none());
assert!(x.spanner_source().is_none());
assert!(x.cloud_sql_source().is_none());
assert!(x.firestore_source().is_none());
assert!(x.alloy_db_source().is_none());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