Class AutocompletePlacesRequest
Request proto for AutocompletePlaces.
Implements
Namespace: Google.Maps.Places.V1
Assembly: Google.Maps.Places.V1.dll
Syntax
public sealed class AutocompletePlacesRequest : IMessage<AutocompletePlacesRequest>, IEquatable<AutocompletePlacesRequest>, IDeepCloneable<AutocompletePlacesRequest>, IBufferMessage, IMessage
Constructors
AutocompletePlacesRequest()
Declaration
public AutocompletePlacesRequest()
AutocompletePlacesRequest(AutocompletePlacesRequest)
Declaration
public AutocompletePlacesRequest(AutocompletePlacesRequest other)
Parameters
Type | Name | Description |
---|---|---|
AutocompletePlacesRequest | other |
Properties
IncludeQueryPredictions
Optional. If true, the response will include both Place and query predictions. Otherwise the response will only return Place predictions.
Declaration
public bool IncludeQueryPredictions { get; set; }
Property Value
Type | Description |
---|---|
bool |
IncludedPrimaryTypes
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.
Declaration
public RepeatedField<string> IncludedPrimaryTypes { get; }
Property Value
Type | Description |
---|---|
RepeatedField<string> |
IncludedRegionCodes
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.
Declaration
public RepeatedField<string> IncludedRegionCodes { get; }
Property Value
Type | Description |
---|---|
RepeatedField<string> |
Input
Required. The text string on which to search.
Declaration
public string Input { get; set; }
Property Value
Type | Description |
---|---|
string |
InputOffset
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
.
Declaration
public int InputOffset { get; set; }
Property Value
Type | Description |
---|---|
int |
LanguageCode
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
.
Declaration
public string LanguageCode { get; set; }
Property Value
Type | Description |
---|---|
string |
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.
Declaration
public AutocompletePlacesRequest.Types.LocationBias LocationBias { get; set; }
Property Value
Type | Description |
---|---|
AutocompletePlacesRequest.Types.LocationBias |
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.
Declaration
public AutocompletePlacesRequest.Types.LocationRestriction LocationRestriction { get; set; }
Property Value
Type | Description |
---|---|
AutocompletePlacesRequest.Types.LocationRestriction |
Origin
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.
Declaration
public LatLng Origin { get; set; }
Property Value
Type | Description |
---|---|
LatLng |
RegionCode
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
.
Declaration
public string RegionCode { get; set; }
Property Value
Type | Description |
---|---|
string |
SessionToken
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.
Declaration
public string SessionToken { get; set; }
Property Value
Type | Description |
---|---|
string |