#[non_exhaustive]pub struct DocumentInfo {
pub quantity: Option<i32>,
pub promotion_ids: Vec<String>,
pub joined: bool,
pub conversion_value: Option<f32>,
pub document_descriptor: Option<DocumentDescriptor>,
/* private fields */
}recommendation-service or user-event-service only.Expand description
Detailed document information associated with a user event.
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.quantity: Option<i32>Quantity of the Document associated with the user event. Defaults to 1.
For example, this field is 2 if two quantities of the same Document
are involved in a add-to-cart event.
Required for events of the following event types:
add-to-cartpurchase
promotion_ids: Vec<String>The promotion IDs associated with this Document. Currently, this field is restricted to at most one ID.
joined: boolOutput only. Whether the referenced Document can be found in the data store.
conversion_value: Option<f32>Optional. The conversion value associated with this Document. Must be set if UserEvent.event_type is “conversion”.
For example, a value of 1000 signifies that 1000 seconds were spent viewing
a Document for the watch conversion type.
document_descriptor: Option<DocumentDescriptor>A required descriptor of the associated Document.
-
If id is specified, then the default values for
{location},{collection_id},{data_store_id}, and{branch_id}are used when annotating with the stored Document. -
If name is specified, then the provided values (default values allowed) for
{location},{collection_id},{data_store_id}, and{branch_id}are used when annotating with the stored Document.
Implementations§
Source§impl DocumentInfo
impl DocumentInfo
Sourcepub fn set_quantity<T>(self, v: T) -> Self
pub fn set_quantity<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_quantity<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_quantity<T>(self, v: Option<T>) -> Self
Sourcepub fn set_promotion_ids<T, V>(self, v: T) -> Self
pub fn set_promotion_ids<T, V>(self, v: T) -> Self
Sets the value of promotion_ids.
§Example
let x = DocumentInfo::new().set_promotion_ids(["a", "b", "c"]);Sourcepub fn set_joined<T: Into<bool>>(self, v: T) -> Self
pub fn set_joined<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_conversion_value<T>(self, v: T) -> Self
pub fn set_conversion_value<T>(self, v: T) -> Self
Sets the value of conversion_value.
§Example
let x = DocumentInfo::new().set_conversion_value(42.0);Sourcepub fn set_or_clear_conversion_value<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_conversion_value<T>(self, v: Option<T>) -> Self
Sets or clears the value of conversion_value.
§Example
let x = DocumentInfo::new().set_or_clear_conversion_value(Some(42.0));
let x = DocumentInfo::new().set_or_clear_conversion_value(None::<f32>);Sourcepub fn set_document_descriptor<T: Into<Option<DocumentDescriptor>>>(
self,
v: T,
) -> Self
pub fn set_document_descriptor<T: Into<Option<DocumentDescriptor>>>( self, v: T, ) -> Self
Sets the value of document_descriptor.
Note that all the setters affecting document_descriptor are mutually
exclusive.
§Example
use google_cloud_discoveryengine_v1::model::document_info::DocumentDescriptor;
let x = DocumentInfo::new().set_document_descriptor(Some(DocumentDescriptor::Id("example".to_string())));Sourcepub fn id(&self) -> Option<&String>
pub fn id(&self) -> Option<&String>
The value of document_descriptor
if it holds a Id, None if the field is not set or
holds a different branch.
Sourcepub fn set_id<T: Into<String>>(self, v: T) -> Self
pub fn set_id<T: Into<String>>(self, v: T) -> Self
Sets the value of document_descriptor
to hold a Id.
Note that all the setters affecting document_descriptor are
mutually exclusive.
§Example
let x = DocumentInfo::new().set_id("example");
assert!(x.id().is_some());
assert!(x.name().is_none());
assert!(x.uri().is_none());Sourcepub fn name(&self) -> Option<&String>
pub fn name(&self) -> Option<&String>
The value of document_descriptor
if it holds a Name, None if the field is not set or
holds a different branch.
Sourcepub fn set_name<T: Into<String>>(self, v: T) -> Self
pub fn set_name<T: Into<String>>(self, v: T) -> Self
Sets the value of document_descriptor
to hold a Name.
Note that all the setters affecting document_descriptor are
mutually exclusive.
§Example
let x = DocumentInfo::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}"));
assert!(x.name().is_some());
assert!(x.id().is_none());
assert!(x.uri().is_none());Sourcepub fn uri(&self) -> Option<&String>
pub fn uri(&self) -> Option<&String>
The value of document_descriptor
if it holds a Uri, None if the field is not set or
holds a different branch.
Sourcepub fn set_uri<T: Into<String>>(self, v: T) -> Self
pub fn set_uri<T: Into<String>>(self, v: T) -> Self
Sets the value of document_descriptor
to hold a Uri.
Note that all the setters affecting document_descriptor are
mutually exclusive.
§Example
let x = DocumentInfo::new().set_uri("example");
assert!(x.uri().is_some());
assert!(x.id().is_none());
assert!(x.name().is_none());Trait Implementations§
Source§impl Clone for DocumentInfo
impl Clone for DocumentInfo
Source§fn clone(&self) -> DocumentInfo
fn clone(&self) -> DocumentInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DocumentInfo
impl Debug for DocumentInfo
Source§impl Default for DocumentInfo
impl Default for DocumentInfo
Source§fn default() -> DocumentInfo
fn default() -> DocumentInfo
Source§impl Message for DocumentInfo
impl Message for DocumentInfo
Source§impl PartialEq for DocumentInfo
impl PartialEq for DocumentInfo
impl StructuralPartialEq for DocumentInfo
Auto Trait Implementations§
impl Freeze for DocumentInfo
impl RefUnwindSafe for DocumentInfo
impl Send for DocumentInfo
impl Sync for DocumentInfo
impl Unpin for DocumentInfo
impl UnsafeUnpin for DocumentInfo
impl UnwindSafe for DocumentInfo
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