ImportDocumentsRequest

Struct ImportDocumentsRequest 

Source
#[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 */ }
Available on crate feature document-service only.
Expand description

Request message for Import methods.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§parent: String

Required. 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: ReconciliationMode

The 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: bool

Whether 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:

§id_field: String

The 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:

§force_refresh_content: bool

Optional. 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

Source

pub fn new() -> Self

Source

pub fn set_parent<T: Into<String>>(self, v: T) -> Self

Sets the value of parent.

§Example
let x = ImportDocumentsRequest::new().set_parent("example");
Source

pub fn set_error_config<T>(self, v: T) -> Self

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 */);
Source

pub fn set_or_clear_error_config<T>(self, v: Option<T>) -> Self

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>);
Source

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);
Source

pub fn set_update_mask<T>(self, v: T) -> Self
where T: Into<FieldMask>,

Sets the value of update_mask.

§Example
use wkt::FieldMask;
let x = ImportDocumentsRequest::new().set_update_mask(FieldMask::default()/* use setters */);
Source

pub fn set_or_clear_update_mask<T>(self, v: Option<T>) -> Self
where T: Into<FieldMask>,

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>);
Source

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);
Source

pub fn set_id_field<T: Into<String>>(self, v: T) -> Self

Sets the value of id_field.

§Example
let x = ImportDocumentsRequest::new().set_id_field("example");
Source

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);
Source

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())));
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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());
Source

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.

Source

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

Source§

fn clone(&self) -> ImportDocumentsRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ImportDocumentsRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ImportDocumentsRequest

Source§

fn default() -> ImportDocumentsRequest

Returns the “default value” for a type. Read more
Source§

impl Message for ImportDocumentsRequest

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for ImportDocumentsRequest

Source§

fn eq(&self, other: &ImportDocumentsRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ImportDocumentsRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,