Skip to content

Commit 402c5bd

Browse files
Google APIscopybara-github
authored andcommitted
feat: add new toll passes
feat!: add optional tags to proto3 index based fields to enable checking for field presence BREAKING CHANGE: Adds field presence to fields with semantic meanings for their default values. In this case index fields with a value of 0 have specific meaning and their presence should be noted. This may break workflows where client libraries generated from this change handle data from previous client libraries (where presence is not noted). There are no users of the client libraries currently, so while this is a potential breaking change - there is nothing to break. PiperOrigin-RevId: 470006887
1 parent 586b2aa commit 402c5bd

4 files changed

Lines changed: 47 additions & 40 deletions

File tree

google/maps/routing/v2/routes_service.proto

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ service Routes {
122122
// be automatically included in the response.
123123
// * Selecting only the fields that you need results in a smaller response
124124
// size, and thus higher network throughput.
125-
rpc ComputeRouteMatrix(ComputeRouteMatrixRequest)
126-
returns (stream RouteMatrixElement) {
125+
rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) returns (stream RouteMatrixElement) {
127126
option (google.api.http) = {
128127
post: "/distanceMatrix/v2:computeRouteMatrix"
129128
body: "*"
@@ -154,24 +153,20 @@ message ComputeRoutesRequest {
154153
// mechanism to use a different option when the preferred option does not give
155154
// a valid result. You can specify this option only when the `travel_mode` is
156155
// `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
157-
RoutingPreference routing_preference = 5
158-
[(google.api.field_behavior) = OPTIONAL];
156+
RoutingPreference routing_preference = 5 [(google.api.field_behavior) = OPTIONAL];
159157

160158
// Optional. Specifies your preference for the quality of the polyline.
161159
PolylineQuality polyline_quality = 6 [(google.api.field_behavior) = OPTIONAL];
162160

163161
// Optional. Specifies the preferred encoding for the polyline.
164-
PolylineEncoding polyline_encoding = 12
165-
[(google.api.field_behavior) = OPTIONAL];
162+
PolylineEncoding polyline_encoding = 12 [(google.api.field_behavior) = OPTIONAL];
166163

167164
// Optional. The departure time. If you don't set this value, then this value
168165
// defaults to the time that you made the request. If you set this value to a
169166
// time that has already occurred, then the request fails.
170-
google.protobuf.Timestamp departure_time = 7
171-
[(google.api.field_behavior) = OPTIONAL];
167+
google.protobuf.Timestamp departure_time = 7 [(google.api.field_behavior) = OPTIONAL];
172168

173-
// Optional. Specifies whether to calculate alternate routes in addition to
174-
// the route.
169+
// Optional. Specifies whether to calculate alternate routes in addition to the route.
175170
bool compute_alternative_routes = 8 [(google.api.field_behavior) = OPTIONAL];
176171

177172
// Optional. A set of conditions to satisfy that affect the way routes are
@@ -212,8 +207,8 @@ message ComputeRoutesResponse {
212207

213208
// ComputeRouteMatrix request message
214209
message ComputeRouteMatrixRequest {
215-
// Required. Array of origins, which determines the rows of the response
216-
// matrix. Several size restrictions apply to the cardinality of origins and
210+
// Required. Array of origins, which determines the rows of the response matrix.
211+
// Several size restrictions apply to the cardinality of origins and
217212
// destinations:
218213
//
219214
// * The number of elements (origins × destinations) must be no greater than
@@ -222,32 +217,27 @@ message ComputeRouteMatrixRequest {
222217
// 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
223218
// * The number of waypoints (origins + destinations) specified as `place_id`
224219
// must be no greater than 50.
225-
repeated RouteMatrixOrigin origins = 1
226-
[(google.api.field_behavior) = REQUIRED];
220+
repeated RouteMatrixOrigin origins = 1 [(google.api.field_behavior) = REQUIRED];
227221

228-
// Required. Array of destinations, which determines the columns of the
229-
// response matrix.
230-
repeated RouteMatrixDestination destinations = 2
231-
[(google.api.field_behavior) = REQUIRED];
222+
// Required. Array of destinations, which determines the columns of the response matrix.
223+
repeated RouteMatrixDestination destinations = 2 [(google.api.field_behavior) = REQUIRED];
232224

233225
// Optional. Specifies the mode of transportation.
234226
RouteTravelMode travel_mode = 3 [(google.api.field_behavior) = OPTIONAL];
235227

236-
// Optional. Specifies how to compute the route. The server attempts to use
237-
// the selected routing preference to compute the route. If the routing
238-
// preference results in an error or an extra long latency, an error is
239-
// returned. In the future, we might implement a fallback mechanism to use a
240-
// different option when the preferred option does not give a valid result.
241-
// You can specify this option only when the `travel_mode` is `DRIVE` or
242-
// `TWO_WHEELER`, otherwise the request fails.
243-
RoutingPreference routing_preference = 4
244-
[(google.api.field_behavior) = OPTIONAL];
245-
246-
// Optional. The departure time. If you don't set this value, this defaults to
247-
// the time that you made the request. If you set this value to a time that
248-
// has already occurred, the request fails.
249-
google.protobuf.Timestamp departure_time = 5
250-
[(google.api.field_behavior) = OPTIONAL];
228+
// Optional. Specifies how to compute the route. The server attempts to use the selected
229+
// routing preference to compute the route. If the routing preference results
230+
// in an error or an extra long latency, an error is returned. In the future,
231+
// we might implement a fallback mechanism to use a different option when the
232+
// preferred option does not give a valid result. You can specify this option
233+
// only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
234+
// request fails.
235+
RoutingPreference routing_preference = 4 [(google.api.field_behavior) = OPTIONAL];
236+
237+
// Optional. The departure time. If you don't set this value, this defaults to the time
238+
// that you made the request. If you set this value to a time that has already
239+
// occurred, the request fails.
240+
google.protobuf.Timestamp departure_time = 5 [(google.api.field_behavior) = OPTIONAL];
251241
}
252242

253243
// A single origin for ComputeRouteMatrixRequest
@@ -269,10 +259,10 @@ message RouteMatrixDestination {
269259
// ComputeRouteMatrix API. This proto can be streamed to the client.
270260
message RouteMatrixElement {
271261
// Zero-based index of the origin in the request.
272-
int32 origin_index = 1;
262+
optional int32 origin_index = 1;
273263

274264
// Zero-based index of the destination in the request.
275-
int32 destination_index = 2;
265+
optional int32 destination_index = 2;
276266

277267
// Error status code for this element.
278268
google.rpc.Status status = 3;

google/maps/routing/v2/routes_v2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type: google.api.Service
22
config_version: 3
33
name: routes.googleapis.com
4-
title: routes.googleapis.com API
4+
title: Routes API
55

66
apis:
77
- name: google.maps.routing.v2.Routes

google/maps/routing/v2/speed_reading_interval.proto

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ message SpeedReadingInterval {
4747
}
4848

4949
// The starting index of this interval in the polyline.
50-
// In JSON, when the index is 0, the field appears to be unpopulated.
51-
int32 start_polyline_point_index = 1;
50+
optional int32 start_polyline_point_index = 1;
5251

5352
// The ending index of this interval in the polyline.
54-
// In JSON, when the index is 0, the field appears to be unpopulated.
55-
int32 end_polyline_point_index = 2;
53+
optional int32 end_polyline_point_index = 2;
5654

5755
// Traffic speed in this interval.
5856
Speed speed = 3;

google/maps/routing/v2/toll_passes.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,31 @@ enum TollPass {
9696
IN_LOCAL_HP_PLATE_EXEMPT = 79;
9797

9898
// Mexico toll pass.
99+
// https://iave.capufe.gob.mx/#/
100+
MX_IAVE = 90;
101+
102+
// Mexico
103+
// https://www.pase.com.mx
104+
MX_PASE = 91;
105+
106+
// Mexico
107+
// https://operadoravial.com/quick-pass/
108+
MX_QUICKPASS = 93;
109+
110+
// http://appsh.chihuahua.gob.mx/transparencia/?doc=/ingresos/TelepeajeFormato4.pdf
111+
MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89;
112+
113+
// Mexico
99114
MX_TAG_IAVE = 12;
100115

101116
// Mexico toll pass company. One of many operating in Mexico City. See
102117
// additional details at https://www.televia.com.mx.
103118
MX_TAG_TELEVIA = 13;
104119

120+
// Mexico toll pass company. One of many operating in Mexico City.
121+
// https://www.televia.com.mx
122+
MX_TELEVIA = 92;
123+
105124
// Mexico toll pass. See additional details at
106125
// https://www.viapass.com.mx/viapass/web_home.aspx.
107126
MX_VIAPASS = 14;

0 commit comments

Comments
 (0)