From 99b489f1170ceb45d3ce6cb8d56c8c7aa671ad03 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:01:51 -0500 Subject: [PATCH] feat: [routing] add API for shorter distance reference routes (#5842) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add API for shorter distance reference routes PiperOrigin-RevId: 700387857 Source-Link: https://github.com/googleapis/googleapis/commit/4deb95d3bd31ed01524753dbdb94c2c52ce42103 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a38a16c43c68681bbf5c0de7914b72790a4b6b2b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiYTM4YTE2YzQzYzY4NjgxYmJmNWMwZGU3OTE0YjcyNzkwYTRiNmIyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- packages/google-maps-routing/README.md | 4 +-- .../maps/routing/v2/fallback_info.proto | 1 - .../maps/routing/v2/geocoding_results.proto | 1 - .../maps/routing/v2/localized_time.proto | 1 - .../google/maps/routing/v2/location.proto | 1 - .../google/maps/routing/v2/maneuver.proto | 1 - .../routing/v2/navigation_instruction.proto | 1 - .../google/maps/routing/v2/polyline.proto | 1 - .../protos/google/maps/routing/v2/route.proto | 29 ++++++++++--------- .../google/maps/routing/v2/route_label.proto | 4 ++- .../maps/routing/v2/route_modifiers.proto | 1 - .../maps/routing/v2/route_travel_mode.proto | 1 - .../maps/routing/v2/routes_service.proto | 25 +++++++++++++--- .../maps/routing/v2/routing_preference.proto | 1 - .../routing/v2/speed_reading_interval.proto | 1 - .../google/maps/routing/v2/toll_passes.proto | 1 - .../maps/routing/v2/traffic_model.proto | 1 - .../google/maps/routing/v2/transit.proto | 1 - .../maps/routing/v2/transit_preferences.proto | 1 - .../protos/google/maps/routing/v2/units.proto | 1 - .../routing/v2/vehicle_emission_type.proto | 1 - .../google/maps/routing/v2/waypoint.proto | 1 - .../google-maps-routing/protos/protos.d.ts | 6 ++-- packages/google-maps-routing/protos/protos.js | 14 +++++++++ .../google-maps-routing/protos/protos.json | 13 ++++++--- .../generated/v2/routes.compute_routes.js | 5 +++- ...ippet_metadata_google.maps.routing.v2.json | 2 +- .../src/v2/routes_client.ts | 5 +++- 28 files changed, 78 insertions(+), 47 deletions(-) diff --git a/packages/google-maps-routing/README.md b/packages/google-maps-routing/README.md index 14907fe6573..9d0126cf649 100644 --- a/packages/google-maps-routing/README.md +++ b/packages/google-maps-routing/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Google Maps Routing API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the +1. [Set up authentication][auth] so you can access the API from your local workstation. ### Installing the client library @@ -233,4 +233,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=routes.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto index 8ab23ae61fc..b97f8ed46b1 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto index f2ea9b3bf41..e5d0e733949 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto @@ -18,7 +18,6 @@ package google.maps.routing.v2; import "google/rpc/status.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto index a5a2e292f1c..9a233e4c110 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto @@ -18,7 +18,6 @@ package google.maps.routing.v2; import "google/type/localized_text.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto index 00ea07a953e..f4b61f293b1 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto @@ -19,7 +19,6 @@ package google.maps.routing.v2; import "google/protobuf/wrappers.proto"; import "google/type/latlng.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto index 246757496da..b7b5c616d92 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto index 1952c9b4e19..581b5156564 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto @@ -18,7 +18,6 @@ package google.maps.routing.v2; import "google/maps/routing/v2/maneuver.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto index c718ba2fa7a..27d0d29d774 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto @@ -18,7 +18,6 @@ package google.maps.routing.v2; import "google/protobuf/struct.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto index 1d05ad1cb24..8d1b96e1e60 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto @@ -31,7 +31,6 @@ import "google/protobuf/timestamp.proto"; import "google/type/localized_text.proto"; import "google/type/money.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; @@ -49,9 +48,10 @@ message Route { // Travel distance represented in text form. google.type.LocalizedText distance = 1; - // Duration taking traffic conditions into consideration, represented in - // text form. Note: If you did not request traffic information, this value - // will be the same value as `static_duration`. + // Duration, represented in text form and localized to the region of the + // query. Takes traffic conditions into consideration. Note: If you did not + // request traffic information, this value is the same value as + // `static_duration`. google.type.LocalizedText duration = 2; // Duration without taking traffic conditions into consideration, @@ -119,11 +119,13 @@ message Route { // Text representations of properties of the `Route`. RouteLocalizedValues localized_values = 11; - // A web-safe, base64-encoded route token that can be passed to the Navigation - // SDK, that allows the Navigation SDK to reconstruct the route during - // navigation, and, in the event of rerouting, honor the original intention - // when you created the route by calling ComputeRoutes. Customers should treat - // this token as an opaque blob. It is not meant for reading or mutating. + // An opaque token that can be passed to [Navigation + // SDK](https://developers.google.com/maps/documentation/navigation) to + // reconstruct the route during navigation, and, in the event of rerouting, + // honor the original intention when the route was created. Treat this token + // as an opaque blob. Don't compare its value across requests as its value + // may change even if the service returns the exact same route. + // // NOTE: `Route.route_token` is only available for requests that have set // `ComputeRoutesRequest.routing_preference` to `TRAFFIC_AWARE` or // `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests @@ -204,9 +206,10 @@ message RouteLeg { // Travel distance represented in text form. google.type.LocalizedText distance = 1; - // Duration taking traffic conditions into consideration represented in text - // form. Note: If you did not request traffic information, this value will - // be the same value as static_duration. + // Duration, represented in text form and localized to the region of the + // query. Takes traffic conditions into consideration. Note: If you did not + // request traffic information, this value is the same value as + // static_duration. google.type.LocalizedText duration = 2; // Duration without taking traffic conditions into @@ -384,7 +387,7 @@ message RouteLegStepTransitDetails { // The number of stops from the departure to the arrival stop. This count // includes the arrival stop, but excludes the departure stop. For example, if // your route leaves from Stop A, passes through stops B and C, and arrives at - // stop D, stop_count will return 3. + // stop D, stop_count returns 3. int32 stop_count = 6; // The text that appears in schedules and sign boards to identify a transit diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route_label.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route_label.proto index 862cc19e255..2583bc92062 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/route_label.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route_label.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; @@ -44,4 +43,7 @@ enum RouteLabel { // Fuel efficient route. Routes labeled with this value are determined to be // optimized for Eco parameters such as fuel consumption. FUEL_EFFICIENT = 3; + + // Shorter travel distance route. This is an experimental feature. + SHORTER_DISTANCE = 4; } diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto index e4382acf04a..4f55337e59e 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto @@ -19,7 +19,6 @@ package google.maps.routing.v2; import "google/maps/routing/v2/toll_passes.proto"; import "google/maps/routing/v2/vehicle_info.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto index 1e4a9995b28..3ca186864dc 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto index d2a84d30ad4..2cbd7cc1280 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto @@ -35,7 +35,6 @@ import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; import "google/type/localized_text.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; @@ -142,9 +141,24 @@ message ComputeRoutesRequest { // Not used. Requests containing this value fail. REFERENCE_ROUTE_UNSPECIFIED = 0; - // Fuel efficient route. Routes labeled with this value are determined to be - // optimized for parameters such as fuel consumption. + // Fuel efficient route. FUEL_EFFICIENT = 1; + + // Route with shorter travel distance. This is an experimental feature. + // + // For `DRIVE` requests, this feature prioritizes shorter distance over + // driving comfort. For example, it may prefer local roads instead of + // highways, take dirt roads, cut through parking lots, etc. This feature + // does not return any maneuvers that Google Maps knows to be illegal. + // + // For `BICYCLE` and `TWO_WHEELER` requests, this feature returns routes + // similar to those returned when you don't specify + // `requested_reference_routes`. + // + // This feature is not compatible with any other travel modes, via + // intermediate waypoints, or `optimize_waypoint_order`; such requests will + // fail. However, you can use it with any `routing_preference`. + SHORTER_DISTANCE = 2; } // Extra computations to perform while completing the request. @@ -262,7 +276,10 @@ message ComputeRoutesRequest { // request in addition to the default route. A reference route is a route with // a different route calculation objective than the default route. For example // a `FUEL_EFFICIENT` reference route calculation takes into account various - // parameters that would generate an optimal fuel efficient route. + // parameters that would generate an optimal fuel efficient route. When using + // this feature, look for + // [`route_labels`][google.maps.routing.v2.Route.route_labels] on the + // resulting routes. repeated ReferenceRoute requested_reference_routes = 14 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto index 2f296145a4a..1b174f2a80b 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto index 107b78221d3..9ba4a6fdb1f 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto index fea0078bc9f..9d9cd6409ae 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto index 9ad957f77c1..e46d566f0e1 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/transit.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/transit.proto index 69656967509..86726fa5492 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/transit.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/transit.proto @@ -19,7 +19,6 @@ package google.maps.routing.v2; import "google/maps/routing/v2/location.proto"; import "google/type/localized_text.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto index d20d78483cb..bc6cdd4f594 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto index 821dd023b76..0efc0d0ef76 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto index 4b9284f8be0..2c6d04a54b7 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.maps.routing.v2; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto index 30b7580be06..240d096cb2f 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto @@ -18,7 +18,6 @@ package google.maps.routing.v2; import "google/maps/routing/v2/location.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/protos.d.ts b/packages/google-maps-routing/protos/protos.d.ts index a5e45e2d8a0..f8d6125983c 100644 --- a/packages/google-maps-routing/protos/protos.d.ts +++ b/packages/google-maps-routing/protos/protos.d.ts @@ -8576,7 +8576,8 @@ export namespace google { ROUTE_LABEL_UNSPECIFIED = 0, DEFAULT_ROUTE = 1, DEFAULT_ROUTE_ALTERNATE = 2, - FUEL_EFFICIENT = 3 + FUEL_EFFICIENT = 3, + SHORTER_DISTANCE = 4 } /** RouteTravelMode enum. */ @@ -9919,7 +9920,8 @@ export namespace google { /** ReferenceRoute enum. */ enum ReferenceRoute { REFERENCE_ROUTE_UNSPECIFIED = 0, - FUEL_EFFICIENT = 1 + FUEL_EFFICIENT = 1, + SHORTER_DISTANCE = 2 } /** ExtraComputation enum. */ diff --git a/packages/google-maps-routing/protos/protos.js b/packages/google-maps-routing/protos/protos.js index b4de60db3e0..5444bf92913 100644 --- a/packages/google-maps-routing/protos/protos.js +++ b/packages/google-maps-routing/protos/protos.js @@ -18841,6 +18841,7 @@ case 1: case 2: case 3: + case 4: break; } } @@ -18948,6 +18949,10 @@ case 3: message.routeLabels[i] = 3; break; + case "SHORTER_DISTANCE": + case 4: + message.routeLabels[i] = 4; + break; } } if (object.legs) { @@ -23165,6 +23170,7 @@ * @property {number} DEFAULT_ROUTE=1 DEFAULT_ROUTE value * @property {number} DEFAULT_ROUTE_ALTERNATE=2 DEFAULT_ROUTE_ALTERNATE value * @property {number} FUEL_EFFICIENT=3 FUEL_EFFICIENT value + * @property {number} SHORTER_DISTANCE=4 SHORTER_DISTANCE value */ v2.RouteLabel = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -23172,6 +23178,7 @@ values[valuesById[1] = "DEFAULT_ROUTE"] = 1; values[valuesById[2] = "DEFAULT_ROUTE_ALTERNATE"] = 2; values[valuesById[3] = "FUEL_EFFICIENT"] = 3; + values[valuesById[4] = "SHORTER_DISTANCE"] = 4; return values; })(); @@ -27021,6 +27028,7 @@ return "requestedReferenceRoutes: enum value[] expected"; case 0: case 1: + case 2: break; } } @@ -27247,6 +27255,10 @@ case 1: message.requestedReferenceRoutes[i] = 1; break; + case "SHORTER_DISTANCE": + case 2: + message.requestedReferenceRoutes[i] = 2; + break; } } if (object.extraComputations) { @@ -27432,11 +27444,13 @@ * @enum {number} * @property {number} REFERENCE_ROUTE_UNSPECIFIED=0 REFERENCE_ROUTE_UNSPECIFIED value * @property {number} FUEL_EFFICIENT=1 FUEL_EFFICIENT value + * @property {number} SHORTER_DISTANCE=2 SHORTER_DISTANCE value */ ComputeRoutesRequest.ReferenceRoute = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "REFERENCE_ROUTE_UNSPECIFIED"] = 0; values[valuesById[1] = "FUEL_EFFICIENT"] = 1; + values[valuesById[2] = "SHORTER_DISTANCE"] = 2; return values; })(); diff --git a/packages/google-maps-routing/protos/protos.json b/packages/google-maps-routing/protos/protos.json index 09c34948bcf..0151cfa5aa0 100644 --- a/packages/google-maps-routing/protos/protos.json +++ b/packages/google-maps-routing/protos/protos.json @@ -1,4 +1,7 @@ { + "options": { + "syntax": "proto3" + }, "nested": { "google": { "nested": { @@ -1535,7 +1538,6 @@ "nested": { "v2": { "options": { - "cc_enable_arenas": true, "csharp_namespace": "Google.Maps.Routing.V2", "go_package": "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb", "java_multiple_files": true, @@ -1543,7 +1545,8 @@ "java_package": "com.google.maps.routing.v2", "objc_class_prefix": "GMRV2", "php_namespace": "Google\\Maps\\Routing\\V2", - "ruby_package": "Google::Maps::Routing::V2" + "ruby_package": "Google::Maps::Routing::V2", + "cc_enable_arenas": true }, "nested": { "FallbackInfo": { @@ -2089,7 +2092,8 @@ "ROUTE_LABEL_UNSPECIFIED": 0, "DEFAULT_ROUTE": 1, "DEFAULT_ROUTE_ALTERNATE": 2, - "FUEL_EFFICIENT": 3 + "FUEL_EFFICIENT": 3, + "SHORTER_DISTANCE": 4 } }, "RouteTravelMode": { @@ -2607,7 +2611,8 @@ "ReferenceRoute": { "values": { "REFERENCE_ROUTE_UNSPECIFIED": 0, - "FUEL_EFFICIENT": 1 + "FUEL_EFFICIENT": 1, + "SHORTER_DISTANCE": 2 } }, "ExtraComputation": { diff --git a/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js b/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js index 786b20c5c0e..464c8bf314e 100644 --- a/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js +++ b/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js @@ -134,7 +134,10 @@ function main(origin, destination) { * request in addition to the default route. A reference route is a route with * a different route calculation objective than the default route. For example * a `FUEL_EFFICIENT` reference route calculation takes into account various - * parameters that would generate an optimal fuel efficient route. + * parameters that would generate an optimal fuel efficient route. When using + * this feature, look for + * `route_labels` google.maps.routing.v2.Route.route_labels on the + * resulting routes. */ // const requestedReferenceRoutes = [1,2,3,4] /** diff --git a/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json b/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json index 4658c253518..541c4366eb9 100644 --- a/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json +++ b/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 188, + "end": 191, "type": "FULL" } ], diff --git a/packages/google-maps-routing/src/v2/routes_client.ts b/packages/google-maps-routing/src/v2/routes_client.ts index 24abdd457aa..ce759878d17 100644 --- a/packages/google-maps-routing/src/v2/routes_client.ts +++ b/packages/google-maps-routing/src/v2/routes_client.ts @@ -492,7 +492,10 @@ export class RoutesClient { * request in addition to the default route. A reference route is a route with * a different route calculation objective than the default route. For example * a `FUEL_EFFICIENT` reference route calculation takes into account various - * parameters that would generate an optimal fuel efficient route. + * parameters that would generate an optimal fuel efficient route. When using + * this feature, look for + * {@link protos.google.maps.routing.v2.Route.route_labels|`route_labels`} on the + * resulting routes. * @param {number[]} [request.extraComputations] * Optional. A list of extra computations which may be used to complete the * request. Note: These extra computations may return extra fields on the