Class PlacesClient
Places client wrapper, for convenient use.
Namespace: Google.Maps.Places.V1
Assembly: Google.Maps.Places.V1.dll
Syntax
public abstract class PlacesClient
Remarks
Service definition for the Places API.
Note: every request (except for Autocomplete requests) requires a field mask
set outside of the request proto (all/*
, is not assumed). The field mask
can be set via the HTTP header X-Goog-FieldMask
. See:
https://developers.google.com/maps/documentation/places/web-service/choose-fields
Properties
DefaultEndpoint
The default endpoint for the Places service, which is a host of "places.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
Type | Description |
---|---|
string |
DefaultScopes
The default Places scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> |
Remarks
The default Places scopes are:
GrpcClient
The underlying gRPC Places client
Declaration
public virtual Places.PlacesClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
Places.PlacesClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type | Description |
---|---|
ServiceMetadata |
Methods
AutocompletePlaces(AutocompletePlacesRequest, CallSettings)
Returns predictions for the given input.
Declaration
public virtual AutocompletePlacesResponse AutocompletePlaces(AutocompletePlacesRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AutocompletePlacesRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
AutocompletePlacesResponse | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
AutocompletePlacesRequest request = new AutocompletePlacesRequest
{
Input = "",
LocationBias = new AutocompletePlacesRequest.Types.LocationBias(),
LocationRestriction = new AutocompletePlacesRequest.Types.LocationRestriction(),
IncludedPrimaryTypes = { "", },
IncludedRegionCodes = { "", },
LanguageCode = "",
RegionCode = "",
Origin = new LatLng(),
InputOffset = 0,
IncludeQueryPredictions = false,
SessionToken = "",
};
// Make the request
AutocompletePlacesResponse response = placesClient.AutocompletePlaces(request);
AutocompletePlacesAsync(AutocompletePlacesRequest, CallSettings)
Returns predictions for the given input.
Declaration
public virtual Task<AutocompletePlacesResponse> AutocompletePlacesAsync(AutocompletePlacesRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AutocompletePlacesRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<AutocompletePlacesResponse> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
AutocompletePlacesRequest request = new AutocompletePlacesRequest
{
Input = "",
LocationBias = new AutocompletePlacesRequest.Types.LocationBias(),
LocationRestriction = new AutocompletePlacesRequest.Types.LocationRestriction(),
IncludedPrimaryTypes = { "", },
IncludedRegionCodes = { "", },
LanguageCode = "",
RegionCode = "",
Origin = new LatLng(),
InputOffset = 0,
IncludeQueryPredictions = false,
SessionToken = "",
};
// Make the request
AutocompletePlacesResponse response = await placesClient.AutocompletePlacesAsync(request);
AutocompletePlacesAsync(AutocompletePlacesRequest, CancellationToken)
Returns predictions for the given input.
Declaration
public virtual Task<AutocompletePlacesResponse> AutocompletePlacesAsync(AutocompletePlacesRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AutocompletePlacesRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<AutocompletePlacesResponse> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
AutocompletePlacesRequest request = new AutocompletePlacesRequest
{
Input = "",
LocationBias = new AutocompletePlacesRequest.Types.LocationBias(),
LocationRestriction = new AutocompletePlacesRequest.Types.LocationRestriction(),
IncludedPrimaryTypes = { "", },
IncludedRegionCodes = { "", },
LanguageCode = "",
RegionCode = "",
Origin = new LatLng(),
InputOffset = 0,
IncludeQueryPredictions = false,
SessionToken = "",
};
// Make the request
AutocompletePlacesResponse response = await placesClient.AutocompletePlacesAsync(request);
Create()
Synchronously creates a PlacesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use PlacesClientBuilder.
Declaration
public static PlacesClient Create()
Returns
Type | Description |
---|---|
PlacesClient | The created PlacesClient. |
CreateAsync(CancellationToken)
Asynchronously creates a PlacesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use PlacesClientBuilder.
Declaration
public static Task<PlacesClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
Task<PlacesClient> | The task representing the created PlacesClient. |
GetPhotoMedia(GetPhotoMediaRequest, CallSettings)
Get a photo media with a photo reference string.
Declaration
public virtual PhotoMedia GetPhotoMedia(GetPhotoMediaRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetPhotoMediaRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PhotoMedia | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
GetPhotoMediaRequest request = new GetPhotoMediaRequest
{
PhotoMediaName = PhotoMediaName.FromPlacePhotoReference("[PLACE_ID]", "[PHOTO_REFERENCE]"),
MaxWidthPx = 0,
MaxHeightPx = 0,
SkipHttpRedirect = false,
};
// Make the request
PhotoMedia response = placesClient.GetPhotoMedia(request);
GetPhotoMedia(PhotoMediaName, CallSettings)
Get a photo media with a photo reference string.
Declaration
public virtual PhotoMedia GetPhotoMedia(PhotoMediaName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PhotoMediaName | name | Required. The resource name of a photo media in the format:
The resource name of a photo as returned in a Place object's |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PhotoMedia | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
PhotoMediaName name = PhotoMediaName.FromPlacePhotoReference("[PLACE_ID]", "[PHOTO_REFERENCE]");
// Make the request
PhotoMedia response = placesClient.GetPhotoMedia(name);
GetPhotoMedia(string, CallSettings)
Get a photo media with a photo reference string.
Declaration
public virtual PhotoMedia GetPhotoMedia(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of a photo media in the format:
The resource name of a photo as returned in a Place object's |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
PhotoMedia | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
string name = "places/[PLACE_ID]/photos/[PHOTO_REFERENCE]/media";
// Make the request
PhotoMedia response = placesClient.GetPhotoMedia(name);
GetPhotoMediaAsync(GetPhotoMediaRequest, CallSettings)
Get a photo media with a photo reference string.
Declaration
public virtual Task<PhotoMedia> GetPhotoMediaAsync(GetPhotoMediaRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetPhotoMediaRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<PhotoMedia> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
GetPhotoMediaRequest request = new GetPhotoMediaRequest
{
PhotoMediaName = PhotoMediaName.FromPlacePhotoReference("[PLACE_ID]", "[PHOTO_REFERENCE]"),
MaxWidthPx = 0,
MaxHeightPx = 0,
SkipHttpRedirect = false,
};
// Make the request
PhotoMedia response = await placesClient.GetPhotoMediaAsync(request);
GetPhotoMediaAsync(GetPhotoMediaRequest, CancellationToken)
Get a photo media with a photo reference string.
Declaration
public virtual Task<PhotoMedia> GetPhotoMediaAsync(GetPhotoMediaRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GetPhotoMediaRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<PhotoMedia> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
GetPhotoMediaRequest request = new GetPhotoMediaRequest
{
PhotoMediaName = PhotoMediaName.FromPlacePhotoReference("[PLACE_ID]", "[PHOTO_REFERENCE]"),
MaxWidthPx = 0,
MaxHeightPx = 0,
SkipHttpRedirect = false,
};
// Make the request
PhotoMedia response = await placesClient.GetPhotoMediaAsync(request);
GetPhotoMediaAsync(PhotoMediaName, CallSettings)
Get a photo media with a photo reference string.
Declaration
public virtual Task<PhotoMedia> GetPhotoMediaAsync(PhotoMediaName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PhotoMediaName | name | Required. The resource name of a photo media in the format:
The resource name of a photo as returned in a Place object's |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<PhotoMedia> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
PhotoMediaName name = PhotoMediaName.FromPlacePhotoReference("[PLACE_ID]", "[PHOTO_REFERENCE]");
// Make the request
PhotoMedia response = await placesClient.GetPhotoMediaAsync(name);
GetPhotoMediaAsync(PhotoMediaName, CancellationToken)
Get a photo media with a photo reference string.
Declaration
public virtual Task<PhotoMedia> GetPhotoMediaAsync(PhotoMediaName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
PhotoMediaName | name | Required. The resource name of a photo media in the format:
The resource name of a photo as returned in a Place object's |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<PhotoMedia> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
PhotoMediaName name = PhotoMediaName.FromPlacePhotoReference("[PLACE_ID]", "[PHOTO_REFERENCE]");
// Make the request
PhotoMedia response = await placesClient.GetPhotoMediaAsync(name);
GetPhotoMediaAsync(string, CallSettings)
Get a photo media with a photo reference string.
Declaration
public virtual Task<PhotoMedia> GetPhotoMediaAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of a photo media in the format:
The resource name of a photo as returned in a Place object's |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<PhotoMedia> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
string name = "places/[PLACE_ID]/photos/[PHOTO_REFERENCE]/media";
// Make the request
PhotoMedia response = await placesClient.GetPhotoMediaAsync(name);
GetPhotoMediaAsync(string, CancellationToken)
Get a photo media with a photo reference string.
Declaration
public virtual Task<PhotoMedia> GetPhotoMediaAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of a photo media in the format:
The resource name of a photo as returned in a Place object's |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<PhotoMedia> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
string name = "places/[PLACE_ID]/photos/[PHOTO_REFERENCE]/media";
// Make the request
PhotoMedia response = await placesClient.GetPhotoMediaAsync(name);
GetPlace(GetPlaceRequest, CallSettings)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Place GetPlace(GetPlaceRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetPlaceRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Place | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
GetPlaceRequest request = new GetPlaceRequest
{
PlaceName = PlaceName.FromPlace("[PLACE_ID]"),
LanguageCode = "",
RegionCode = "",
SessionToken = "",
};
// Make the request
Place response = placesClient.GetPlace(request);
GetPlace(PlaceName, CallSettings)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Place GetPlace(PlaceName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PlaceName | name | Required. The resource name of a place, in the |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Place | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
PlaceName name = PlaceName.FromPlace("[PLACE_ID]");
// Make the request
Place response = placesClient.GetPlace(name);
GetPlace(string, CallSettings)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Place GetPlace(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of a place, in the |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Place | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
string name = "places/[PLACE_ID]";
// Make the request
Place response = placesClient.GetPlace(name);
GetPlaceAsync(GetPlaceRequest, CallSettings)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Task<Place> GetPlaceAsync(GetPlaceRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetPlaceRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Place> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
GetPlaceRequest request = new GetPlaceRequest
{
PlaceName = PlaceName.FromPlace("[PLACE_ID]"),
LanguageCode = "",
RegionCode = "",
SessionToken = "",
};
// Make the request
Place response = await placesClient.GetPlaceAsync(request);
GetPlaceAsync(GetPlaceRequest, CancellationToken)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Task<Place> GetPlaceAsync(GetPlaceRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GetPlaceRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Place> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
GetPlaceRequest request = new GetPlaceRequest
{
PlaceName = PlaceName.FromPlace("[PLACE_ID]"),
LanguageCode = "",
RegionCode = "",
SessionToken = "",
};
// Make the request
Place response = await placesClient.GetPlaceAsync(request);
GetPlaceAsync(PlaceName, CallSettings)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Task<Place> GetPlaceAsync(PlaceName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
PlaceName | name | Required. The resource name of a place, in the |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Place> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
PlaceName name = PlaceName.FromPlace("[PLACE_ID]");
// Make the request
Place response = await placesClient.GetPlaceAsync(name);
GetPlaceAsync(PlaceName, CancellationToken)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Task<Place> GetPlaceAsync(PlaceName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
PlaceName | name | Required. The resource name of a place, in the |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Place> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
PlaceName name = PlaceName.FromPlace("[PLACE_ID]");
// Make the request
Place response = await placesClient.GetPlaceAsync(name);
GetPlaceAsync(string, CallSettings)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Task<Place> GetPlaceAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of a place, in the |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Place> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
string name = "places/[PLACE_ID]";
// Make the request
Place response = await placesClient.GetPlaceAsync(name);
GetPlaceAsync(string, CancellationToken)
Get the details of a place based on its resource name, which is a string
in the places/{place_id}
format.
Declaration
public virtual Task<Place> GetPlaceAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of a place, in the |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Place> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
string name = "places/[PLACE_ID]";
// Make the request
Place response = await placesClient.GetPlaceAsync(name);
SearchNearby(SearchNearbyRequest, CallSettings)
Search for places near locations.
Declaration
public virtual SearchNearbyResponse SearchNearby(SearchNearbyRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
SearchNearbyRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
SearchNearbyResponse | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
SearchNearbyRequest request = new SearchNearbyRequest
{
LanguageCode = "",
RegionCode = "",
IncludedTypes = { "", },
ExcludedTypes = { "", },
IncludedPrimaryTypes = { "", },
ExcludedPrimaryTypes = { "", },
MaxResultCount = 0,
LocationRestriction = new SearchNearbyRequest.Types.LocationRestriction(),
RankPreference = SearchNearbyRequest.Types.RankPreference.Unspecified,
RoutingParameters = new RoutingParameters(),
};
// Make the request
SearchNearbyResponse response = placesClient.SearchNearby(request);
SearchNearbyAsync(SearchNearbyRequest, CallSettings)
Search for places near locations.
Declaration
public virtual Task<SearchNearbyResponse> SearchNearbyAsync(SearchNearbyRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
SearchNearbyRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<SearchNearbyResponse> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
SearchNearbyRequest request = new SearchNearbyRequest
{
LanguageCode = "",
RegionCode = "",
IncludedTypes = { "", },
ExcludedTypes = { "", },
IncludedPrimaryTypes = { "", },
ExcludedPrimaryTypes = { "", },
MaxResultCount = 0,
LocationRestriction = new SearchNearbyRequest.Types.LocationRestriction(),
RankPreference = SearchNearbyRequest.Types.RankPreference.Unspecified,
RoutingParameters = new RoutingParameters(),
};
// Make the request
SearchNearbyResponse response = await placesClient.SearchNearbyAsync(request);
SearchNearbyAsync(SearchNearbyRequest, CancellationToken)
Search for places near locations.
Declaration
public virtual Task<SearchNearbyResponse> SearchNearbyAsync(SearchNearbyRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
SearchNearbyRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<SearchNearbyResponse> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
SearchNearbyRequest request = new SearchNearbyRequest
{
LanguageCode = "",
RegionCode = "",
IncludedTypes = { "", },
ExcludedTypes = { "", },
IncludedPrimaryTypes = { "", },
ExcludedPrimaryTypes = { "", },
MaxResultCount = 0,
LocationRestriction = new SearchNearbyRequest.Types.LocationRestriction(),
RankPreference = SearchNearbyRequest.Types.RankPreference.Unspecified,
RoutingParameters = new RoutingParameters(),
};
// Make the request
SearchNearbyResponse response = await placesClient.SearchNearbyAsync(request);
SearchText(SearchTextRequest, CallSettings)
Text query based place search.
Declaration
public virtual SearchTextResponse SearchText(SearchTextRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
SearchTextRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
SearchTextResponse | The RPC response. |
Sample code
// Create client
PlacesClient placesClient = PlacesClient.Create();
// Initialize request argument(s)
SearchTextRequest request = new SearchTextRequest
{
TextQuery = "",
LanguageCode = "",
RegionCode = "",
RankPreference = SearchTextRequest.Types.RankPreference.Unspecified,
IncludedType = "",
OpenNow = false,
MinRating = 0,
MaxResultCount = 0,
PriceLevels =
{
PriceLevel.Unspecified,
},
StrictTypeFiltering = false,
LocationBias = new SearchTextRequest.Types.LocationBias(),
LocationRestriction = new SearchTextRequest.Types.LocationRestriction(),
EvOptions = new SearchTextRequest.Types.EVOptions(),
RoutingParameters = new RoutingParameters(),
SearchAlongRouteParameters = new SearchTextRequest.Types.SearchAlongRouteParameters(),
};
// Make the request
SearchTextResponse response = placesClient.SearchText(request);
SearchTextAsync(SearchTextRequest, CallSettings)
Text query based place search.
Declaration
public virtual Task<SearchTextResponse> SearchTextAsync(SearchTextRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
SearchTextRequest | request | The request object containing all of the parameters for the API call. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<SearchTextResponse> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
SearchTextRequest request = new SearchTextRequest
{
TextQuery = "",
LanguageCode = "",
RegionCode = "",
RankPreference = SearchTextRequest.Types.RankPreference.Unspecified,
IncludedType = "",
OpenNow = false,
MinRating = 0,
MaxResultCount = 0,
PriceLevels =
{
PriceLevel.Unspecified,
},
StrictTypeFiltering = false,
LocationBias = new SearchTextRequest.Types.LocationBias(),
LocationRestriction = new SearchTextRequest.Types.LocationRestriction(),
EvOptions = new SearchTextRequest.Types.EVOptions(),
RoutingParameters = new RoutingParameters(),
SearchAlongRouteParameters = new SearchTextRequest.Types.SearchAlongRouteParameters(),
};
// Make the request
SearchTextResponse response = await placesClient.SearchTextAsync(request);
SearchTextAsync(SearchTextRequest, CancellationToken)
Text query based place search.
Declaration
public virtual Task<SearchTextResponse> SearchTextAsync(SearchTextRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
SearchTextRequest | request | The request object containing all of the parameters for the API call. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<SearchTextResponse> | A Task containing the RPC response. |
Sample code
// Create client
PlacesClient placesClient = await PlacesClient.CreateAsync();
// Initialize request argument(s)
SearchTextRequest request = new SearchTextRequest
{
TextQuery = "",
LanguageCode = "",
RegionCode = "",
RankPreference = SearchTextRequest.Types.RankPreference.Unspecified,
IncludedType = "",
OpenNow = false,
MinRating = 0,
MaxResultCount = 0,
PriceLevels =
{
PriceLevel.Unspecified,
},
StrictTypeFiltering = false,
LocationBias = new SearchTextRequest.Types.LocationBias(),
LocationRestriction = new SearchTextRequest.Types.LocationRestriction(),
EvOptions = new SearchTextRequest.Types.EVOptions(),
RoutingParameters = new RoutingParameters(),
SearchAlongRouteParameters = new SearchTextRequest.Types.SearchAlongRouteParameters(),
};
// Make the request
SearchTextResponse response = await placesClient.SearchTextAsync(request);
ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous shutdown operation. |
Remarks
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.