Struct google_api_proto::google::maps::places::v1::AutocompletePlacesRequest
source · pub struct AutocompletePlacesRequest {
pub input: String,
pub location_bias: Option<LocationBias>,
pub location_restriction: Option<LocationRestriction>,
pub included_primary_types: Vec<String>,
pub included_region_codes: Vec<String>,
pub language_code: String,
pub region_code: String,
pub origin: Option<LatLng>,
pub input_offset: i32,
pub include_query_predictions: bool,
pub session_token: String,
}
Expand description
Request proto for AutocompletePlaces.
Fields§
§input: String
Required. The text string on which to search.
location_bias: Option<LocationBias>
Optional. Bias results to a specified location.
At most one of location_bias
or location_restriction
should be set. If
neither are set, the results will be biased by IP address, meaning the IP
address will be mapped to an imprecise location and used as a biasing
signal.
location_restriction: Option<LocationRestriction>
Optional. Restrict results to a specified location.
At most one of location_bias
or location_restriction
should be set. If
neither are set, the results will be biased by IP address, meaning the IP
address will be mapped to an imprecise location and used as a biasing
signal.
included_primary_types: Vec<String>
Optional. Included primary Place type (for example, “restaurant” or
“gas_station”) in Place Types
(https://developers.google.com/maps/documentation/places/web-service/place-types),
or only (regions)
, or only (cities)
. A Place is only returned if its
primary type is included in this list. Up to 5 values can be specified. If
no types are specified, all Place types are returned.
included_region_codes: Vec<String>
Optional. Only include results in the specified regions, specified as up to
15 CLDR two-character region codes. An empty set will not restrict the
results. If both location_restriction
and included_region_codes
are
set, the results will be located in the area of intersection.
language_code: String
Optional. The language in which to return results. Defaults to en-US. The
results may be in mixed languages if the language used in input
is
different from language_code
or if the returned Place does not have a
translation from the local language to language_code
.
region_code: String
Optional. The region code, specified as a CLDR two-character region code.
This affects address formatting, result ranking, and may influence what
results are returned. This does not restrict results to the specified
region. To restrict results to a region, use region_code_restriction
.
origin: Option<LatLng>
Optional. The origin point from which to calculate geodesic distance to the
destination (returned as distance_meters
). If this value is omitted,
geodesic distance will not be returned.
input_offset: i32
Optional. A zero-based Unicode character offset of input
indicating the
cursor position in input
. The cursor position may influence what
predictions are returned.
If empty, defaults to the length of input
.
include_query_predictions: bool
Optional. If true, the response will include both Place and query predictions. Otherwise the response will only return Place predictions.
session_token: String
Optional. A string which identifies an Autocomplete session for billing purposes. Must be a URL and filename safe base64 string with at most 36 ASCII characters in length. Otherwise an INVALID_ARGUMENT error is returned.
The session begins when the user starts typing a query, and concludes when
they select a place and a call to Place Details or Address Validation is
made. Each session can have multiple queries, followed by one Place Details
or Address Validation request. The credentials used for each request within
a session must belong to the same Google Cloud Console project. Once a
session has concluded, the token is no longer valid; your app must generate
a fresh token for each session. If the session_token
parameter is
omitted, or if you reuse a session token, the session is charged as if no
session token was provided (each request is billed separately).
We recommend the following guidelines:
- Use session tokens for all Place Autocomplete calls.
- Generate a fresh token for each session. Using a version 4 UUID is recommended.
- Ensure that the credentials used for all Place Autocomplete, Place Details, and Address Validation requests within a session belong to the same Cloud Console project.
- Be sure to pass a unique session token for each new session. Using the same token for more than one session will result in each request being billed individually.
Trait Implementations§
source§impl Clone for AutocompletePlacesRequest
impl Clone for AutocompletePlacesRequest
source§fn clone(&self) -> AutocompletePlacesRequest
fn clone(&self) -> AutocompletePlacesRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AutocompletePlacesRequest
impl Debug for AutocompletePlacesRequest
source§impl Default for AutocompletePlacesRequest
impl Default for AutocompletePlacesRequest
source§impl Message for AutocompletePlacesRequest
impl Message for AutocompletePlacesRequest
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 AutocompletePlacesRequest
impl PartialEq for AutocompletePlacesRequest
source§fn eq(&self, other: &AutocompletePlacesRequest) -> bool
fn eq(&self, other: &AutocompletePlacesRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for AutocompletePlacesRequest
Auto Trait Implementations§
impl Freeze for AutocompletePlacesRequest
impl RefUnwindSafe for AutocompletePlacesRequest
impl Send for AutocompletePlacesRequest
impl Sync for AutocompletePlacesRequest
impl Unpin for AutocompletePlacesRequest
impl UnwindSafe for AutocompletePlacesRequest
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