#[non_exhaustive]pub struct Document {
pub name: String,
pub id: String,
pub schema_id: String,
pub content: Option<Content>,
pub parent_document_id: String,
pub derived_struct_data: Option<Struct>,
pub acl_info: Option<AclInfo>,
pub index_time: Option<Timestamp>,
pub index_status: Option<IndexStatus>,
pub data: Option<Data>,
/* private fields */
}conversational-search-service or document-service or recommendation-service or search-service only.Expand description
Document captures all raw metadata information of items to be recommended or searched.
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.name: StringImmutable. The full resource name of the document.
Format:
projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}.
This field must be a UTF-8 encoded string with a length limit of 1024 characters.
id: StringImmutable. The identifier of the document.
Id should conform to RFC-1034 standard with a length limit of 128 characters.
schema_id: StringThe identifier of the schema located in the same data store.
content: Option<Content>The unstructured data linked to this document. Content can only be set
and must be set if this document is under a CONTENT_REQUIRED data store.
parent_document_id: StringThe identifier of the parent document. Currently supports at most two level document hierarchy.
Id should conform to RFC-1034 standard with a length limit of 63 characters.
derived_struct_data: Option<Struct>Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
acl_info: Option<AclInfo>Access control information for the document.
index_time: Option<Timestamp>Output only. The last time the document was indexed. If this field is set, the document could be returned in search results.
This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed.
index_status: Option<IndexStatus>Output only. The index status of the document.
- If document is indexed successfully, the index_time field is populated.
- Otherwise, if document is not indexed due to errors, the error_samples field is populated.
- Otherwise, if document’s index is in progress, the pending_message field is populated.
data: Option<Data>Data representation. One of
struct_data or
json_data should be
provided otherwise an INVALID_ARGUMENT error is thrown.
Implementations§
Source§impl Document
impl Document
Sourcepub fn set_schema_id<T: Into<String>>(self, v: T) -> Self
pub fn set_schema_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_content<T>(self, v: T) -> Self
pub fn set_content<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_content<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_content<T>(self, v: Option<T>) -> Self
Sourcepub fn set_parent_document_id<T: Into<String>>(self, v: T) -> Self
pub fn set_parent_document_id<T: Into<String>>(self, v: T) -> Self
Sets the value of parent_document_id.
§Example
let x = Document::new().set_parent_document_id("example");Sourcepub fn set_derived_struct_data<T>(self, v: T) -> Self
pub fn set_derived_struct_data<T>(self, v: T) -> Self
Sets the value of derived_struct_data.
§Example
use wkt::Struct;
let x = Document::new().set_derived_struct_data(Struct::default()/* use setters */);Sourcepub fn set_or_clear_derived_struct_data<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_derived_struct_data<T>(self, v: Option<T>) -> Self
Sets or clears the value of derived_struct_data.
§Example
use wkt::Struct;
let x = Document::new().set_or_clear_derived_struct_data(Some(Struct::default()/* use setters */));
let x = Document::new().set_or_clear_derived_struct_data(None::<Struct>);Sourcepub fn set_acl_info<T>(self, v: T) -> Self
pub fn set_acl_info<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_acl_info<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_acl_info<T>(self, v: Option<T>) -> Self
Sourcepub fn set_index_time<T>(self, v: T) -> Self
pub fn set_index_time<T>(self, v: T) -> Self
Sets the value of index_time.
§Example
use wkt::Timestamp;
let x = Document::new().set_index_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_index_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_index_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of index_time.
§Example
use wkt::Timestamp;
let x = Document::new().set_or_clear_index_time(Some(Timestamp::default()/* use setters */));
let x = Document::new().set_or_clear_index_time(None::<Timestamp>);Sourcepub fn set_index_status<T>(self, v: T) -> Selfwhere
T: Into<IndexStatus>,
pub fn set_index_status<T>(self, v: T) -> Selfwhere
T: Into<IndexStatus>,
Sets the value of index_status.
§Example
use google_cloud_discoveryengine_v1::model::document::IndexStatus;
let x = Document::new().set_index_status(IndexStatus::default()/* use setters */);Sourcepub fn set_or_clear_index_status<T>(self, v: Option<T>) -> Selfwhere
T: Into<IndexStatus>,
pub fn set_or_clear_index_status<T>(self, v: Option<T>) -> Selfwhere
T: Into<IndexStatus>,
Sets or clears the value of index_status.
§Example
use google_cloud_discoveryengine_v1::model::document::IndexStatus;
let x = Document::new().set_or_clear_index_status(Some(IndexStatus::default()/* use setters */));
let x = Document::new().set_or_clear_index_status(None::<IndexStatus>);Sourcepub fn struct_data(&self) -> Option<&Box<Struct>>
pub fn struct_data(&self) -> Option<&Box<Struct>>
The value of data
if it holds a StructData, None if the field is not set or
holds a different branch.
Sourcepub fn set_struct_data<T: Into<Box<Struct>>>(self, v: T) -> Self
pub fn set_struct_data<T: Into<Box<Struct>>>(self, v: T) -> Self
Sourcepub fn json_data(&self) -> Option<&String>
pub fn json_data(&self) -> Option<&String>
The value of data
if it holds a JsonData, None if the field is not set or
holds a different branch.
Sourcepub fn set_json_data<T: Into<String>>(self, v: T) -> Self
pub fn set_json_data<T: Into<String>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl !Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request