@@ -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
214209message 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.
270260message 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 ;
0 commit comments