Class AutocompleteRequest
- Namespace
- GoogleMapsApi.Entities.PlacesNew.Request
- Assembly
- GoogleMapsApi.dll
Request for the Places API (New) Autocomplete endpoint
(POST https://places.googleapis.com/v1/places:autocomplete). Modern replacement for the
legacy Place Autocomplete.
public sealed class AutocompleteRequest : MapsBaseRequest
- Inheritance
-
AutocompleteRequest
- Inherited Members
Remarks
Autocomplete does not use a field mask. See https://developers.google.com/maps/documentation/places/web-service/place-autocomplete.
Properties
IncludedPrimaryTypes
Restrict predictions to these primary place types.
public List<string>? IncludedPrimaryTypes { get; set; }
Property Value
IncludedRegionCodes
Restrict predictions to these region codes (CLDR).
public List<string>? IncludedRegionCodes { get; set; }
Property Value
Input
Text typed by the user to predict against. Required.
public string Input { get; set; }
Property Value
LanguageCode
BCP-47 language code for the response (e.g. "en").
public string? LanguageCode { get; set; }
Property Value
LocationBias
Soft region bias for predictions.
public LocationBias? LocationBias { get; set; }
Property Value
LocationRestriction
Hard region restriction for predictions.
public LocationRestriction? LocationRestriction { get; set; }
Property Value
RegionCode
Unicode CLDR region code used for biasing/formatting (e.g. "US").
public string? RegionCode { get; set; }
Property Value
SessionToken
Autocomplete session token grouping requests for billing.
public string? SessionToken { get; set; }
Property Value
Methods
GetRequestBody()
Builds the body to send with this request, or null for endpoints that use GET with
query-string parameters only. Derived requests that target POST-based endpoints (for example,
Address Validation) override this to return a JSON HttpContent; when the engine
sees a non-null body it issues a POST instead of a GET.
protected override HttpContent? GetRequestBody()
Returns
- HttpContent
The HTTP content to send, or
nullfor a GET request.
GetUri()
Builds the absolute request URI, including scheme, base URL, and serialized query-string parameters.
public override Uri GetUri()
Returns
- Uri
The fully composed URI to send to the Google Maps API.