Struct google_api_proto::google::cloud::retail::v2alpha::CompleteQueryRequest
source · pub struct CompleteQueryRequest {
pub catalog: String,
pub query: String,
pub visitor_id: String,
pub language_codes: Vec<String>,
pub device_type: String,
pub dataset: String,
pub max_suggestions: i32,
pub enable_attribute_suggestions: bool,
pub entity: String,
}
Expand description
Autocomplete parameters.
Fields§
§catalog: String
Required. Catalog for which the completion is performed.
Full resource name of catalog, such as
projects/*/locations/global/catalogs/default_catalog
.
query: String
Required. The query used to generate suggestions.
The maximum number of allowed characters is 255.
visitor_id: String
Required field. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.
The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
language_codes: Vec<String>
Note that this field applies for user-data
dataset only. For requests
with cloud-retail
dataset, setting this field has no effect.
The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as “en-US” or “sr-Latn”. For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.
device_type: String
The device type context for completion suggestions. We recommend that you leave this field empty.
It can apply different suggestions on different device types, e.g.
DESKTOP
, MOBILE
. If it is empty, the suggestions are across all device
types.
Supported formats:
-
UNKNOWN_DEVICE_TYPE
-
DESKTOP
-
MOBILE
-
A customized string starts with
OTHER_
, e.g.OTHER_IPHONE
.
dataset: String
Determines which dataset to use for fetching completion. “user-data” will use the imported dataset through [CompletionService.ImportCompletionData][google.cloud.retail.v2alpha.CompletionService.ImportCompletionData]. “cloud-retail” will use the dataset generated by cloud retail based on user events. If leave empty, it will use the “user-data”.
Current supported values:
-
user-data
-
cloud-retail: This option requires enabling auto-learning function first. See guidelines.
max_suggestions: i32
Completion max suggestions. If left unset or set to 0, then will fallback to the configured value [CompletionConfig.max_suggestions][google.cloud.retail.v2alpha.CompletionConfig.max_suggestions].
The maximum allowed max suggestions is 20. If it is set higher, it will be capped by 20.
enable_attribute_suggestions: bool
If true, attribute suggestions are enabled and provided in response.
This field is only available for “cloud-retail” dataset.
entity: String
The entity for customers who run multiple entities, domains, sites, or
regions, for example, Google US
, Google Ads
, Waymo
,
google.com
, youtube.com
, etc.
If this is set, it must be an exact match with
[UserEvent.entity][google.cloud.retail.v2alpha.UserEvent.entity] to get
per-entity autocomplete results.
Trait Implementations§
source§impl Clone for CompleteQueryRequest
impl Clone for CompleteQueryRequest
source§fn clone(&self) -> CompleteQueryRequest
fn clone(&self) -> CompleteQueryRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CompleteQueryRequest
impl Debug for CompleteQueryRequest
source§impl Default for CompleteQueryRequest
impl Default for CompleteQueryRequest
source§impl Message for CompleteQueryRequest
impl Message for CompleteQueryRequest
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 CompleteQueryRequest
impl PartialEq for CompleteQueryRequest
source§fn eq(&self, other: &CompleteQueryRequest) -> bool
fn eq(&self, other: &CompleteQueryRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CompleteQueryRequest
Auto Trait Implementations§
impl Freeze for CompleteQueryRequest
impl RefUnwindSafe for CompleteQueryRequest
impl Send for CompleteQueryRequest
impl Sync for CompleteQueryRequest
impl Unpin for CompleteQueryRequest
impl UnwindSafe for CompleteQueryRequest
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