#[non_exhaustive]pub struct Condition {
pub query_terms: Vec<QueryTerm>,
pub active_time_range: Vec<TimeRange>,
pub query_regex: String,
/* private fields */
}Available on crate feature
control-service only.Expand description
Defines circumstances to be checked before allowing a behavior
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.query_terms: Vec<QueryTerm>Search only A list of terms to match the query on. Cannot be set when Condition.query_regex is set.
Maximum of 10 query terms.
active_time_range: Vec<TimeRange>Range of time(s) specifying when condition is active.
Maximum of 10 time ranges.
query_regex: StringOptional. Query regex to match the whole search query. Cannot be set when Condition.query_terms is set. Only supported for Basic Site Search promotion serving controls.
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_discoveryengine_v1::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_discoveryengine_v1::model::condition::TimeRange;
let x = Condition::new()
.set_active_time_range([
TimeRange::default()/* use setters */,
TimeRange::default()/* use (different) setters */,
]);Sourcepub fn set_query_regex<T: Into<String>>(self, v: T) -> Self
pub fn set_query_regex<T: Into<String>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Condition
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnwindSafe for Condition
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
Mutably borrows from an owned value. Read more