pub struct Control {
pub name: String,
pub display_name: String,
pub associated_serving_config_ids: Vec<String>,
pub solution_types: Vec<i32>,
pub search_solution_use_case: Vec<i32>,
pub control: Option<Control>,
}
Expand description
Configures dynamic metadata that can be linked to a [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and affect search or recommendation results at serving time.
Fields§
§name: String
Immutable. Fully qualified name
projects/*/locations/global/catalogs/*/controls/*
display_name: String
Required. 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][google.cloud.retail.v2beta.ServingConfig] ids that are associated with this control in the same [Catalog][google.cloud.retail.v2beta.Catalog].
Note the association is managed via the [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an output only denormalized view.
solution_types: Vec<i32>
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][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
search_solution_use_case: Vec<i32>
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][google.cloud.retail.v2beta.SearchSolutionUseCase.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
sourcepub fn solution_types(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<SolutionType>>
pub fn solution_types( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<SolutionType>>
Returns an iterator which yields the valid enum values contained in solution_types
.
sourcepub fn push_solution_types(&mut self, value: SolutionType)
pub fn push_solution_types(&mut self, value: SolutionType)
Appends the provided enum value to solution_types
.
sourcepub fn search_solution_use_case(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<SearchSolutionUseCase>>
pub fn search_solution_use_case( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<SearchSolutionUseCase>>
Returns an iterator which yields the valid enum values contained in search_solution_use_case
.
sourcepub fn push_search_solution_use_case(&mut self, value: SearchSolutionUseCase)
pub fn push_search_solution_use_case(&mut self, value: SearchSolutionUseCase)
Appends the provided enum value to search_solution_use_case
.
Trait Implementations§
source§impl Message for Control
impl Message for Control
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Control
impl PartialEq for Control
impl StructuralPartialEq for Control
Auto Trait Implementations§
impl Freeze for Control
impl RefUnwindSafe for Control
impl Send for Control
impl Sync for Control
impl Unpin for Control
impl UnwindSafe for Control
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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