@Generated(value="by gapic-generator-java")
See: Description
| Class | Description |
|---|---|
| RoutesClient |
Service Description: The Routes API.
|
| RoutesSettings |
Settings class to configure an instance of
RoutesClient. |
| RoutesSettings.Builder |
Builder for RoutesSettings.
|
The interfaces provided are listed below, along with usage samples.
======================= RoutesClient =======================
Service Description: The Routes API.
Sample for RoutesClient:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RoutesClient routesClient = RoutesClient.create()) {
ComputeRoutesRequest request =
ComputeRoutesRequest.newBuilder()
.setOrigin(Waypoint.newBuilder().build())
.setDestination(Waypoint.newBuilder().build())
.addAllIntermediates(new ArrayList<Waypoint>())
.setTravelMode(RouteTravelMode.forNumber(0))
.setRoutingPreference(RoutingPreference.forNumber(0))
.setPolylineQuality(PolylineQuality.forNumber(0))
.setPolylineEncoding(PolylineEncoding.forNumber(0))
.setDepartureTime(Timestamp.newBuilder().build())
.setArrivalTime(Timestamp.newBuilder().build())
.setComputeAlternativeRoutes(true)
.setRouteModifiers(RouteModifiers.newBuilder().build())
.setLanguageCode("languageCode-2092349083")
.setRegionCode("regionCode-1991004415")
.setUnits(Units.forNumber(0))
.setOptimizeWaypointOrder(true)
.addAllRequestedReferenceRoutes(new ArrayList<ComputeRoutesRequest.ReferenceRoute>())
.addAllExtraComputations(new ArrayList<ComputeRoutesRequest.ExtraComputation>())
.setTrafficModel(TrafficModel.forNumber(0))
.setTransitPreferences(TransitPreferences.newBuilder().build())
.build();
ComputeRoutesResponse response = routesClient.computeRoutes(request);
}
Copyright © 2025 Google LLC. All rights reserved.