#[non_exhaustive]pub struct Condition {
pub query_terms: Vec<QueryTerm>,
pub active_time_range: Vec<TimeRange>,
pub page_categories: Vec<String>,
/* private fields */
}Expand description
Metadata that is used to define a condition that triggers an action. A valid condition must specify at least one of ‘query_terms’ or ‘products_filter’. If multiple fields are specified, the condition is met if all the fields are satisfied e.g. if a set of query terms and product_filter are set, then only items matching the product_filter for requests with a query matching the query terms wil get boosted.
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.query_terms: Vec<QueryTerm>A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).
active_time_range: Vec<TimeRange>Range of time(s) specifying when Condition is active. Condition true if any time range matches.
page_categories: Vec<String>Used to support browse uses cases. A list (up to 10 entries) of categories or departments. The format should be the same as UserEvent.page_categories;
Implementations§
Source§impl Condition
impl Condition
pub fn new() -> Self
Sourcepub fn set_query_terms<T, V>(self, v: T) -> Self
pub fn set_query_terms<T, V>(self, v: T) -> Self
Sets the value of query_terms.
§Example
use google_cloud_retail_v2::model::condition::QueryTerm;
let x = Condition::new()
.set_query_terms([
QueryTerm::default()/* use setters */,
QueryTerm::default()/* use (different) setters */,
]);Sourcepub fn set_active_time_range<T, V>(self, v: T) -> Self
pub fn set_active_time_range<T, V>(self, v: T) -> Self
Sets the value of active_time_range.
§Example
use google_cloud_retail_v2::model::condition::TimeRange;
let x = Condition::new()
.set_active_time_range([
TimeRange::default()/* use setters */,
TimeRange::default()/* use (different) setters */,
]);Sourcepub fn set_page_categories<T, V>(self, v: T) -> Self
pub fn set_page_categories<T, V>(self, v: T) -> Self
Sets the value of page_categories.
§Example
let x = Condition::new().set_page_categories(["a", "b", "c"]);