#[non_exhaustive]pub struct Control {
pub name: String,
pub display_name: String,
pub associated_serving_config_ids: Vec<String>,
pub solution_types: Vec<SolutionType>,
pub search_solution_use_case: Vec<SearchSolutionUseCase>,
pub control: Option<Control>,
/* private fields */
}Expand description
Configures dynamic metadata that can be linked to a ServingConfig and affect search or recommendation results at serving time.
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. Fully qualified name
projects/*/locations/global/catalogs/*/controls/*
display_name: StringRequired. The human readable control display name. Used in Retail UI.
This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is thrown.
associated_serving_config_ids: Vec<String>Output only. List of serving config ids that are associated with this control in the same Catalog.
Note the association is managed via the ServingConfig, this is an output only denormalized view.
solution_types: Vec<SolutionType>Required. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time.
Only SOLUTION_TYPE_SEARCH value is supported at the moment.
If no solution type is provided at creation time, will default to
SOLUTION_TYPE_SEARCH.
search_solution_use_case: Vec<SearchSolutionUseCase>Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. Currently only allow one search_solution_use_case per control.
control: Option<Control>The behavior/type of the control
A behavior/type must be specified on creation. Type cannot be changed once specified (e.g. A Rule control will always be a Rule control.). An INVALID_ARGUMENT will be returned if either condition is violated.
Implementations§
Source§impl Control
impl Control
pub fn new() -> Self
Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_associated_serving_config_ids<T, V>(self, v: T) -> Self
pub fn set_associated_serving_config_ids<T, V>(self, v: T) -> Self
Sets the value of associated_serving_config_ids.
§Example
let x = Control::new().set_associated_serving_config_ids(["a", "b", "c"]);Sourcepub fn set_solution_types<T, V>(self, v: T) -> Self
pub fn set_solution_types<T, V>(self, v: T) -> Self
Sets the value of solution_types.
§Example
use google_cloud_retail_v2::model::SolutionType;
let x = Control::new().set_solution_types([
SolutionType::Recommendation,
SolutionType::Search,
]);Sourcepub fn set_search_solution_use_case<T, V>(self, v: T) -> Self
pub fn set_search_solution_use_case<T, V>(self, v: T) -> Self
Sets the value of search_solution_use_case.
§Example
use google_cloud_retail_v2::model::SearchSolutionUseCase;
let x = Control::new().set_search_solution_use_case([
SearchSolutionUseCase::Search,
SearchSolutionUseCase::Browse,
]);Sourcepub fn set_control<T: Into<Option<Control>>>(self, v: T) -> Self
pub fn set_control<T: Into<Option<Control>>>(self, v: T) -> Self
Sourcepub fn rule(&self) -> Option<&Box<Rule>>
pub fn rule(&self) -> Option<&Box<Rule>>
The value of control
if it holds a Rule, None if the field is not set or
holds a different branch.