Class DestinationServiceClient
DestinationService client wrapper, for convenient use.
Namespace: Google.Maps.Geocode.V4
Assembly: Google.Maps.Geocode.V4.dll
Syntax
public abstract class DestinationServiceClient
Remarks
A service for retrieving destinations.
A destination provides hierarchical context about a place, which allows you to, for example, find apartment buildings within a larger apartment complex and vice versa. It also provides navigation points suitable for use cases such as ridesharing or delivery.
Properties
DefaultEndpoint
The default endpoint for the DestinationService service, which is a host of "geocoding-backend.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
| Type | Description |
|---|---|
| string |
DefaultScopes
The default DestinationService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default DestinationService scopes are:
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/maps-platform.destinations
- https://www.googleapis.com/auth/maps-platform.geocode
GrpcClient
The underlying gRPC DestinationService client
Declaration
public virtual DestinationService.DestinationServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| DestinationService.DestinationServiceClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
| Type | Description |
|---|---|
| ServiceMetadata |
Methods
Create()
Synchronously creates a DestinationServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DestinationServiceClientBuilder .
Declaration
public static DestinationServiceClient Create()
Returns
| Type | Description |
|---|---|
| DestinationServiceClient | The created DestinationServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a DestinationServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DestinationServiceClientBuilder .
Declaration
public static Task<DestinationServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<DestinationServiceClient> | The task representing the created DestinationServiceClient. |
SearchDestinations(SearchDestinationsRequest, CallSettings)
This method performs a destination lookup and returns a list of destinations.
Declaration
public virtual SearchDestinationsResponse SearchDestinations(SearchDestinationsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchDestinationsRequest | 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 |
|---|---|
| SearchDestinationsResponse | The RPC response. |
Sample code
// Create client
DestinationServiceClient destinationServiceClient = DestinationServiceClient.Create();
// Initialize request argument(s)
SearchDestinationsRequest request = new SearchDestinationsRequest
{
Place = "",
TravelModes =
{
NavigationPoint.Types.TravelMode.Unspecified,
},
LanguageCode = "",
RegionCode = "",
};
// Make the request
SearchDestinationsResponse response = destinationServiceClient.SearchDestinations(request);
SearchDestinationsAsync(SearchDestinationsRequest, CallSettings)
This method performs a destination lookup and returns a list of destinations.
Declaration
public virtual Task<SearchDestinationsResponse> SearchDestinationsAsync(SearchDestinationsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchDestinationsRequest | 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<SearchDestinationsResponse> | A Task containing the RPC response. |
Sample code
// Create client
DestinationServiceClient destinationServiceClient = await DestinationServiceClient.CreateAsync();
// Initialize request argument(s)
SearchDestinationsRequest request = new SearchDestinationsRequest
{
Place = "",
TravelModes =
{
NavigationPoint.Types.TravelMode.Unspecified,
},
LanguageCode = "",
RegionCode = "",
};
// Make the request
SearchDestinationsResponse response = await destinationServiceClient.SearchDestinationsAsync(request);
SearchDestinationsAsync(SearchDestinationsRequest, CancellationToken)
This method performs a destination lookup and returns a list of destinations.
Declaration
public virtual Task<SearchDestinationsResponse> SearchDestinationsAsync(SearchDestinationsRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchDestinationsRequest | 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<SearchDestinationsResponse> | A Task containing the RPC response. |
Sample code
// Create client
DestinationServiceClient destinationServiceClient = await DestinationServiceClient.CreateAsync();
// Initialize request argument(s)
SearchDestinationsRequest request = new SearchDestinationsRequest
{
Place = "",
TravelModes =
{
NavigationPoint.Types.TravelMode.Unspecified,
},
LanguageCode = "",
RegionCode = "",
};
// Make the request
SearchDestinationsResponse response = await destinationServiceClient.SearchDestinationsAsync(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.