#[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
pub fn new() -> Self
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("example");
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more