Skip to content

Commit

Permalink
docs: refer to request field by correct name: routing_preference
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 466038028
  • Loading branch information
Google APIs authored and Copybara-Service committed Aug 8, 2022
1 parent 9f7c0ff commit a6aca40
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 32 deletions.
7 changes: 4 additions & 3 deletions google/maps/routes/v1/route.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ message Route {
int32 distance_meters = 2;

// The length of time needed to navigate the route. If you set the
// `route_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
// `static_duration`. If you set the `route_preference` to either
// `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
// `static_duration`. If you set the `routing_preference` to either
// `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
// taking traffic conditions into account.
google.protobuf.Duration duration = 3;
Expand Down Expand Up @@ -164,7 +164,8 @@ message RouteLegStepTravelAdvisory {
message TrafficRestriction {
// The restriction based on the vehicle's license plate last character. If
// this field does not exist, then no restriction on route.
LicensePlateLastCharacterRestriction license_plate_last_character_restriction = 1;
LicensePlateLastCharacterRestriction
license_plate_last_character_restriction = 1;
}

// Encapsulates the license plate last character restriction.
Expand Down
4 changes: 2 additions & 2 deletions google/maps/routes/v1/route_matrix_element.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ message RouteMatrixElement {
int32 distance_meters = 4;

// The length of time needed to navigate the route. If you set the
// `route_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
// `static_duration`. If you set the `route_preference` to either
// `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
// `static_duration`. If you set the `routing_preference` to either
// `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
// taking traffic conditions into account.
google.protobuf.Duration duration = 5;
Expand Down
4 changes: 2 additions & 2 deletions google/maps/routing/v2/route.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ message Route {
int32 distance_meters = 2;

// The length of time needed to navigate the route. If you set the
// `route_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
// `static_duration`. If you set the `route_preference` to either
// `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
// `static_duration`. If you set the `routing_preference` to either
// `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
// taking traffic conditions into account.
google.protobuf.Duration duration = 3;
Expand Down
60 changes: 35 additions & 25 deletions google/maps/routing/v2/routes_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ service Routes {
// be automatically included in the response.
// * Selecting only the fields that you need results in a smaller response
// size, and thus higher network throughput.
rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) returns (stream RouteMatrixElement) {
rpc ComputeRouteMatrix(ComputeRouteMatrixRequest)
returns (stream RouteMatrixElement) {
option (google.api.http) = {
post: "/distanceMatrix/v2:computeRouteMatrix"
body: "*"
Expand Down Expand Up @@ -153,20 +154,24 @@ message ComputeRoutesRequest {
// mechanism to use a different option when the preferred option does not give
// a valid result. You can specify this option only when the `travel_mode` is
// `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
RoutingPreference routing_preference = 5 [(google.api.field_behavior) = OPTIONAL];
RoutingPreference routing_preference = 5
[(google.api.field_behavior) = OPTIONAL];

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

// Optional. Specifies the preferred encoding for the polyline.
PolylineEncoding polyline_encoding = 12 [(google.api.field_behavior) = OPTIONAL];
PolylineEncoding polyline_encoding = 12
[(google.api.field_behavior) = OPTIONAL];

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

// Optional. Specifies whether to calculate alternate routes in addition to the route.
// Optional. Specifies whether to calculate alternate routes in addition to
// the route.
bool compute_alternative_routes = 8 [(google.api.field_behavior) = OPTIONAL];

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

// ComputeRouteMatrix request message
message ComputeRouteMatrixRequest {
// Required. Array of origins, which determines the rows of the response matrix.
// Several size restrictions apply to the cardinality of origins and
// Required. Array of origins, which determines the rows of the response
// matrix. Several size restrictions apply to the cardinality of origins and
// destinations:
//
// * The number of elements (origins × destinations) must be no greater than
Expand All @@ -217,27 +222,32 @@ message ComputeRouteMatrixRequest {
// 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
// * The number of waypoints (origins + destinations) specified as `place_id`
// must be no greater than 50.
repeated RouteMatrixOrigin origins = 1 [(google.api.field_behavior) = REQUIRED];
repeated RouteMatrixOrigin origins = 1
[(google.api.field_behavior) = REQUIRED];

// Required. Array of destinations, which determines the columns of the response matrix.
repeated RouteMatrixDestination destinations = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Array of destinations, which determines the columns of the
// response matrix.
repeated RouteMatrixDestination destinations = 2
[(google.api.field_behavior) = REQUIRED];

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

// Optional. Specifies how to compute the route. The server attempts to use the selected
// routing preference to compute the route. If the routing preference results
// in an error or an extra long latency, an error is returned. In the future,
// we might implement a fallback mechanism to use a different option when the
// preferred option does not give a valid result. You can specify this option
// only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
// request fails.
RoutingPreference routing_preference = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. The departure time. If you don't set this value, this defaults to the time
// that you made the request. If you set this value to a time that has already
// occurred, the request fails.
google.protobuf.Timestamp departure_time = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. Specifies how to compute the route. The server attempts to use
// the selected routing preference to compute the route. If the routing
// preference results in an error or an extra long latency, an error is
// returned. In the future, we might implement a fallback mechanism to use a
// different option when the preferred option does not give a valid result.
// You can specify this option only when the `travel_mode` is `DRIVE` or
// `TWO_WHEELER`, otherwise the request fails.
RoutingPreference routing_preference = 4
[(google.api.field_behavior) = OPTIONAL];

// Optional. The departure time. If you don't set this value, this defaults to
// the time that you made the request. If you set this value to a time that
// has already occurred, the request fails.
google.protobuf.Timestamp departure_time = 5
[(google.api.field_behavior) = OPTIONAL];
}

// A single origin for ComputeRouteMatrixRequest
Expand Down Expand Up @@ -274,8 +284,8 @@ message RouteMatrixElement {
int32 distance_meters = 4;

// The length of time needed to navigate the route. If you set the
// `route_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
// `static_duration`. If you set the `route_preference` to either
// `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
// `static_duration`. If you set the `routing_preference` to either
// `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
// taking traffic conditions into account.
google.protobuf.Duration duration = 5;
Expand Down

0 comments on commit a6aca40

Please sign in to comment.