Skip to content

Commit 0ee215a

Browse files
Google APIscopybara-github
authored andcommitted
feat: Update Routes Preferred protos
PiperOrigin-RevId: 400268071
1 parent 928286b commit 0ee215a

7 files changed

Lines changed: 98 additions & 53 deletions

google/maps/routes/v1/compute_custom_routes_request.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ message ComputeCustomRoutesRequest {
4141

4242
// Optional. A set of waypoints along the route (excluding terminal points), for either
4343
// stopping at or passing by. Up to 25 intermediate waypoints are supported.
44-
// Intermediates are not supported in ComputeCustomRoutes Alpha.
4544
repeated Waypoint intermediates = 3 [(google.api.field_behavior) = OPTIONAL];
4645

47-
// Optional. Specifies the mode of transportation. Only DRIVE is supported in
48-
// ComputeCustomRoutes Alpha.
46+
// Optional. Specifies the mode of transportation. Only DRIVE is supported now.
4947
RouteTravelMode travel_mode = 4 [(google.api.field_behavior) = OPTIONAL];
5048

5149
// Optional. Specifies how to compute the route. The server attempts to use the selected

google/maps/routes/v1/compute_custom_routes_response.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ message ComputeCustomRoutesResponse {
3737
// the customer, it will fallback to another routing mode. In this case
3838
// fallback_routing_mode and routing_mode_fallback_reason are used to
3939
// communicate the fallback routing mode used, as well as the reason for
40-
// fallback. Fallback of routing_preference is not supported in
41-
// ComputeCustomRoutes Alpha.
40+
// fallback.
4241
//
4342
// 2. If it cannot compute a 'best' route for the route objective specified by
4443
// the customer, it might fallback to another objective.

google/maps/routes/v1/compute_routes_request.proto

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,51 @@ message ComputeRoutesRequest {
9090
Units units = 11;
9191
}
9292

93+
// Encapsulates a set of optional conditions to satisfy when calculating the
94+
// routes.
95+
message RouteModifiers {
96+
// Specifies whether to avoid toll roads where reasonable. Preference will be
97+
// given to routes not containing toll roads. Applies only to the `DRIVE` and
98+
// `TWO_WHEELER` travel modes.
99+
bool avoid_tolls = 1;
100+
101+
// Specifies whether to avoid highways where reasonable. Preference will be
102+
// given to routes not containing highways. Applies only to the `DRIVE` and
103+
// `TWO_WHEELER` travel modes.
104+
bool avoid_highways = 2;
105+
106+
// Specifies whether to avoid ferries where reasonable. Preference will be
107+
// given to routes not containing travel by ferries.
108+
// Applies only to the `DRIVE` and`TWO_WHEELER` travel modes.
109+
bool avoid_ferries = 3;
110+
111+
// Specifies whether to avoid navigating indoors where reasonable. Preference
112+
// will be given to routes not containing indoor navigation.
113+
// Applies only to the `WALK` travel mode.
114+
bool avoid_indoor = 4;
115+
116+
// Specifies the vehicle information.
117+
VehicleInfo vehicle_info = 5;
118+
119+
// Encapsulates information about toll passes.
120+
// If toll passes are provided, the API tries to return the pass price. If
121+
// toll passes are not provided, the API treats the toll pass as unknown and
122+
// tries to return the cash price.
123+
// Applies only to the DRIVE and TWO_WHEELER travel modes.
124+
repeated TollPass toll_passes = 6;
125+
}
126+
127+
// Encapsulates the vehicle information, such as the license plate last
128+
// character.
129+
message VehicleInfo {
130+
// Specifies the license plate last character. Could be a digit or a letter.
131+
string license_plate_last_character = 1;
132+
133+
// Describes the vehicle's emission type.
134+
// Applies only to the DRIVE travel mode.
135+
VehicleEmissionType emission_type = 2;
136+
}
137+
93138
// A set of values used to specify the mode of travel.
94139
enum RouteTravelMode {
95140
// No travel mode specified. Defaults to `DRIVE`.
@@ -135,49 +180,6 @@ enum RoutingPreference {
135180
TRAFFIC_AWARE_OPTIMAL = 3;
136181
}
137182

138-
// Encapsulates a set of optional conditions to satisfy when calculating the
139-
// routes.
140-
message RouteModifiers {
141-
// Specifies whether to avoid toll roads where reasonable. Preference will be
142-
// given to routes not containing toll roads. Applies only to the `DRIVE` and
143-
// `TWO_WHEELER` travel modes.
144-
bool avoid_tolls = 1;
145-
146-
// Specifies whether to avoid highways where reasonable. Preference will be
147-
// given to routes not containing highways. Applies only to the `DRIVE` and
148-
// `TWO_WHEELER` travel modes.
149-
bool avoid_highways = 2;
150-
151-
// Specifies whether to avoid ferries where reasonable. Preference will be
152-
// given to routes not containing travel by ferries.
153-
// Applies only to the `DRIVE` and`TWO_WHEELER` travel modes.
154-
bool avoid_ferries = 3;
155-
156-
// Specifies whether to avoid navigating indoors where reasonable. Preference
157-
// will be given to routes not containing indoor navigation.
158-
// Applies only to the `WALK` travel mode.
159-
bool avoid_indoor = 4;
160-
161-
// Optional. Specifies the vehicle information.
162-
VehicleInfo vehicle_info = 5;
163-
164-
// Encapsulates information about toll passes.
165-
// TollPass is unset means no available pass.
166-
// Applies only to the DRIVE and TWO_WHEELER travel modes.
167-
repeated TollPass toll_passes = 6;
168-
}
169-
170-
// Encapsulates the vehicle information, such as the license plate last
171-
// character.
172-
message VehicleInfo {
173-
// Specifies the license plate last character. Could be a digit or a letter.
174-
string license_plate_last_character = 1;
175-
176-
// Describes the vehicle's emission type.
177-
// Applies only to the DRIVE travel mode.
178-
VehicleEmissionType emission_type = 2;
179-
}
180-
181183
// A set of values that specify the unit of measure used in the display.
182184
enum Units {
183185
// Units of measure not specified. Defaults to the unit of measure inferred

google/maps/routes/v1/route_service.proto

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,45 @@ service RoutesPreferred {
122122
body: "*"
123123
};
124124
}
125+
126+
// Given a set of terminal and intermediate waypoints, and a route objective,
127+
// computes the best route for the route objective. Also returns fastest route
128+
// and shortest route as reference routes.
129+
//
130+
// **NOTE:** This method requires that you specify a response field mask in
131+
// the input. You can provide the response field mask by using the URL
132+
// parameter `$fields` or `fields`, or by using the HTTP/gRPC header
133+
// `X-Goog-FieldMask` (see the [available URL parameters and
134+
// headers](https://cloud.google.com/apis/docs/system-parameters). The value
135+
// is a comma separated list of field paths. See this detailed documentation
136+
// about [how to construct the field
137+
// paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
138+
//
139+
// For example, in this method:
140+
//
141+
// * Field mask of all available fields (for manual inspection):
142+
// `X-Goog-FieldMask: *`
143+
// * Field mask of route distances, durations, token and toll info:
144+
// `X-Goog-FieldMask:
145+
// routes.route.distanceMeters,routes.route.duration,routes.token,routes.route.travelAdvisory.tollInfo`
146+
//
147+
// Google discourages the use of the wildcard (`*`) response field mask, or
148+
// specifying the field mask at the top level (`routes`), because:
149+
//
150+
// * Selecting only the fields that you need helps our server save computation
151+
// cycles, allowing us to return the result to you with a lower latency.
152+
// * Selecting only the fields that you need in your production job ensures
153+
// stable latency performance. We might add more response fields in the
154+
// future, and those new fields might require extra computation time. If you
155+
// select all fields, or if you select all fields at the top level, then you
156+
// might experience performance degradation because any new field we add will
157+
// be automatically included in the response.
158+
// * Selecting only the fields that you need results in a smaller response
159+
// size, and thus higher network throughput.
160+
rpc ComputeCustomRoutes(ComputeCustomRoutesRequest) returns (ComputeCustomRoutesResponse) {
161+
option (google.api.http) = {
162+
post: "/v1:computeCustomRoutes"
163+
body: "*"
164+
};
165+
}
125166
}

google/maps/routes/v1/routespreferred.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ apis:
99

1010
authentication:
1111
rules:
12-
- selector: google.maps.routes.v1.RoutesPreferred.ComputeRouteMatrix
13-
oauth:
14-
canonical_scopes: |-
15-
https://www.googleapis.com/auth/maps-platform.routespreferred
16-
- selector: google.maps.routes.v1.RoutesPreferred.ComputeRoutes
12+
- selector: 'google.maps.routes.v1.RoutesPreferred.*'
1713
oauth:
1814
canonical_scopes: |-
1915
https://www.googleapis.com/auth/maps-platform.routespreferred

google/maps/routes/v1/toll_passes.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ enum TollPass {
5353
// https://veloe.com.br/site/onde-usar.
5454
BR_VELOE = 11;
5555

56+
// Indonesia.
57+
// E-card provided by multiple banks used to pay for tolls. All e-cards
58+
// via banks are charged the same so only one enum value is needed. E.g.
59+
// Bank Mandiri https://www.bankmandiri.co.id/e-money
60+
// BCA https://www.bca.co.id/flazz
61+
// BNI https://www.bni.co.id/id-id/ebanking/tapcash
62+
ID_E_TOLL = 16;
63+
5664
// Mexico toll pass.
5765
MX_TAG_IAVE = 12;
5866

google/maps/routes/v1/waypoint.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.maps.routes.v1;
1818

19+
import "google/protobuf/duration.proto";
1920
import "google/protobuf/wrappers.proto";
2021
import "google/type/latlng.proto";
2122

0 commit comments

Comments
 (0)