Skip to content

Commit

Permalink
feat: [maps-routing] Add HTML Navigation Instructions feature to Comp…
Browse files Browse the repository at this point in the history
…uteRoutes (#9589)

- [ ] Regenerate this pull request now.

feat: Add Waypoint Optimization feature to ComputeRoutes
feat: Support Transit routes in ComputeRoutes and ComputeRouteMatrix
feat: Add TrafficModel feature in ComputeRoutes and ComputeRouteMatrix
feat: Support returning localized values in ComputeRoutes and ComputeRouteMatrix
feat: Add more navigation instruction maneuvers
feat: Add more toll pass values

PiperOrigin-RevId: 544137630

Source-Link: https://togithub.com/googleapis/googleapis/commit/6e0f749ee337b9aa343d09db8f4e674298ff8e7f

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/cb29cc19eb4fa96ecc75bc49511fe9eba325e297
Copy-Tag: eyJwIjoiamF2YS1tYXBzLXJvdXRpbmcvLk93bEJvdC55YW1sIiwiaCI6ImNiMjljYzE5ZWI0ZmE5NmVjYzc1YmM0OTUxMWZlOWViYTMyNWUyOTcifQ==
  • Loading branch information
gcf-owl-bot[bot] authored Jun 30, 2023
1 parent c35bd0b commit 7be2b86
Show file tree
Hide file tree
Showing 70 changed files with 31,635 additions and 2,469 deletions.
4 changes: 2 additions & 2 deletions java-maps-routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.16.0</version>
<version>26.18.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-routing/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.maps/google-maps-routing.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.maps/google-maps-routing/1.4.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.maps/google-maps-routing/1.5.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@
* .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);
* }
Expand Down Expand Up @@ -231,13 +235,17 @@ public RoutesStub getStub() {
* .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);
* }
Expand Down Expand Up @@ -304,13 +312,17 @@ public final ComputeRoutesResponse computeRoutes(ComputeRoutesRequest request) {
* .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();
* ApiFuture<ComputeRoutesResponse> future =
* routesClient.computeRoutesCallable().futureCall(request);
Expand Down Expand Up @@ -377,9 +389,12 @@ public final UnaryCallable<ComputeRoutesRequest, ComputeRoutesResponse> computeR
* .setTravelMode(RouteTravelMode.forNumber(0))
* .setRoutingPreference(RoutingPreference.forNumber(0))
* .setDepartureTime(Timestamp.newBuilder().build())
* .setArrivalTime(Timestamp.newBuilder().build())
* .setLanguageCode("languageCode-2092349083")
* .setRegionCode("regionCode-1991004415")
* .addAllExtraComputations(new ArrayList<ComputeRouteMatrixRequest.ExtraComputation>())
* .setTrafficModel(TrafficModel.forNumber(0))
* .setTransitPreferences(TransitPreferences.newBuilder().build())
* .build();
* ServerStream<RouteMatrixElement> stream =
* routesClient.computeRouteMatrixCallable().call(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@
* .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);
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@ public void computeRoutesTest() throws Exception {
.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 actualResponse = client.computeRoutes(request);
Expand Down Expand Up @@ -137,13 +141,17 @@ public void computeRoutesExceptionTest() throws Exception {
.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();
client.computeRoutes(request);
Assert.fail("No exception raised");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,17 @@ public void computeRoutesTest() throws Exception {
.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 actualResponse = client.computeRoutes(request);
Expand All @@ -127,16 +131,21 @@ public void computeRoutesTest() throws Exception {
Assert.assertEquals(request.getPolylineQuality(), actualRequest.getPolylineQuality());
Assert.assertEquals(request.getPolylineEncoding(), actualRequest.getPolylineEncoding());
Assert.assertEquals(request.getDepartureTime(), actualRequest.getDepartureTime());
Assert.assertEquals(request.getArrivalTime(), actualRequest.getArrivalTime());
Assert.assertEquals(
request.getComputeAlternativeRoutes(), actualRequest.getComputeAlternativeRoutes());
Assert.assertEquals(request.getRouteModifiers(), actualRequest.getRouteModifiers());
Assert.assertEquals(request.getLanguageCode(), actualRequest.getLanguageCode());
Assert.assertEquals(request.getRegionCode(), actualRequest.getRegionCode());
Assert.assertEquals(request.getUnits(), actualRequest.getUnits());
Assert.assertEquals(
request.getOptimizeWaypointOrder(), actualRequest.getOptimizeWaypointOrder());
Assert.assertEquals(
request.getRequestedReferenceRoutesList(), actualRequest.getRequestedReferenceRoutesList());
Assert.assertEquals(
request.getExtraComputationsList(), actualRequest.getExtraComputationsList());
Assert.assertEquals(request.getTrafficModel(), actualRequest.getTrafficModel());
Assert.assertEquals(request.getTransitPreferences(), actualRequest.getTransitPreferences());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -159,13 +168,17 @@ public void computeRoutesExceptionTest() throws Exception {
.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();
client.computeRoutes(request);
Assert.fail("No exception raised");
Expand All @@ -187,6 +200,7 @@ public void computeRouteMatrixTest() throws Exception {
.setStaticDuration(Duration.newBuilder().build())
.setTravelAdvisory(RouteTravelAdvisory.newBuilder().build())
.setFallbackInfo(FallbackInfo.newBuilder().build())
.setLocalizedValues(RouteMatrixElement.LocalizedValues.newBuilder().build())
.build();
mockRoutes.addResponse(expectedResponse);
ComputeRouteMatrixRequest request =
Expand All @@ -196,9 +210,12 @@ public void computeRouteMatrixTest() throws Exception {
.setTravelMode(RouteTravelMode.forNumber(0))
.setRoutingPreference(RoutingPreference.forNumber(0))
.setDepartureTime(Timestamp.newBuilder().build())
.setArrivalTime(Timestamp.newBuilder().build())
.setLanguageCode("languageCode-2092349083")
.setRegionCode("regionCode-1991004415")
.addAllExtraComputations(new ArrayList<ComputeRouteMatrixRequest.ExtraComputation>())
.setTrafficModel(TrafficModel.forNumber(0))
.setTransitPreferences(TransitPreferences.newBuilder().build())
.build();

MockStreamObserver<RouteMatrixElement> responseObserver = new MockStreamObserver<>();
Expand All @@ -223,9 +240,12 @@ public void computeRouteMatrixExceptionTest() throws Exception {
.setTravelMode(RouteTravelMode.forNumber(0))
.setRoutingPreference(RoutingPreference.forNumber(0))
.setDepartureTime(Timestamp.newBuilder().build())
.setArrivalTime(Timestamp.newBuilder().build())
.setLanguageCode("languageCode-2092349083")
.setRegionCode("regionCode-1991004415")
.addAllExtraComputations(new ArrayList<ComputeRouteMatrixRequest.ExtraComputation>())
.setTrafficModel(TrafficModel.forNumber(0))
.setTransitPreferences(TransitPreferences.newBuilder().build())
.build();

MockStreamObserver<RouteMatrixElement> responseObserver = new MockStreamObserver<>();
Expand Down
Loading

0 comments on commit 7be2b86

Please sign in to comment.