|
| 1 | +// Copyright 2021 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.maps.routes.v1; |
| 18 | + |
| 19 | +import "google/api/field_behavior.proto"; |
| 20 | +import "google/maps/routes/v1/compute_routes_request.proto"; |
| 21 | +import "google/maps/routes/v1/polyline.proto"; |
| 22 | +import "google/maps/routes/v1/waypoint.proto"; |
| 23 | +import "google/protobuf/timestamp.proto"; |
| 24 | + |
| 25 | +option cc_enable_arenas = true; |
| 26 | +option csharp_namespace = "Google.Maps.Routes.V1"; |
| 27 | +option go_package = "google.golang.org/genproto/googleapis/maps/routes/v1;routes"; |
| 28 | +option java_multiple_files = true; |
| 29 | +option java_outer_classname = "ComputeCustomRoutesRequestProto"; |
| 30 | +option java_package = "com.google.maps.routes.v1"; |
| 31 | +option objc_class_prefix = "GMRS"; |
| 32 | +option php_namespace = "Google\\Maps\\Routes\\V1"; |
| 33 | + |
| 34 | +// ComputeCustomRoutes request message. |
| 35 | +message ComputeCustomRoutesRequest { |
| 36 | + // Required. Origin waypoint. |
| 37 | + Waypoint origin = 1 [(google.api.field_behavior) = REQUIRED]; |
| 38 | + |
| 39 | + // Required. Destination waypoint. |
| 40 | + Waypoint destination = 2 [(google.api.field_behavior) = REQUIRED]; |
| 41 | + |
| 42 | + // Optional. A set of waypoints along the route (excluding terminal points), for either |
| 43 | + // stopping at or passing by. Up to 25 intermediate waypoints are supported. |
| 44 | + // Intermediates are not supported in ComputeCustomRoutes Alpha. |
| 45 | + repeated Waypoint intermediates = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 46 | + |
| 47 | + // Optional. Specifies the mode of transportation. Only DRIVE is supported in |
| 48 | + // ComputeCustomRoutes Alpha. |
| 49 | + RouteTravelMode travel_mode = 4 [(google.api.field_behavior) = OPTIONAL]; |
| 50 | + |
| 51 | + // Optional. Specifies how to compute the route. The server attempts to use the selected |
| 52 | + // routing preference to compute the route. If the routing preference results |
| 53 | + // in an error or an extra long latency, then an error is returned. In the |
| 54 | + // future, we might implement a fallback mechanism to use a different option |
| 55 | + // when the preferred option does not give a valid result. You can specify |
| 56 | + // this option only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, |
| 57 | + // otherwise the request fails. |
| 58 | + RoutingPreference routing_preference = 5 [(google.api.field_behavior) = OPTIONAL]; |
| 59 | + |
| 60 | + // Optional. Specifies your preference for the quality of the polyline. |
| 61 | + PolylineQuality polyline_quality = 6 [(google.api.field_behavior) = OPTIONAL]; |
| 62 | + |
| 63 | + // Optional. Specifies the preferred encoding for the polyline. |
| 64 | + PolylineEncoding polyline_encoding = 13 [(google.api.field_behavior) = OPTIONAL]; |
| 65 | + |
| 66 | + // Optional. The departure time. If you don't set this value, then this value |
| 67 | + // defaults to the time that you made the request. If you set this value to a |
| 68 | + // time that has already occurred, then the request fails. |
| 69 | + google.protobuf.Timestamp departure_time = 7 [(google.api.field_behavior) = OPTIONAL]; |
| 70 | + |
| 71 | + // Optional. A set of conditions to satisfy that affect the way routes are calculated. |
| 72 | + RouteModifiers route_modifiers = 11 [(google.api.field_behavior) = OPTIONAL]; |
| 73 | + |
| 74 | + // Required. A route objective to optimize for. |
| 75 | + RouteObjective route_objective = 12 [(google.api.field_behavior) = REQUIRED]; |
| 76 | + |
| 77 | + // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more |
| 78 | + // information, see |
| 79 | + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See |
| 80 | + // [Language Support](https://developers.google.com/maps/faq#languagesupport) |
| 81 | + // for the list of supported languages. When you don't provide this value, the |
| 82 | + // display language is inferred from the location of the route request. |
| 83 | + string language_code = 9 [(google.api.field_behavior) = OPTIONAL]; |
| 84 | + |
| 85 | + // Optional. Specifies the units of measure for the display fields. This includes the |
| 86 | + // `instruction` field in `NavigationInstruction`. The units of measure used |
| 87 | + // for the route, leg, step distance, and duration are not affected by this |
| 88 | + // value. If you don't provide this value, then the display units are inferred |
| 89 | + // from the location of the request. |
| 90 | + Units units = 10 [(google.api.field_behavior) = OPTIONAL]; |
| 91 | +} |
| 92 | + |
| 93 | +// Encapsulates an objective to optimize for by ComputeCustomRoutes. |
| 94 | +message RouteObjective { |
| 95 | + // Encapsulates a RateCard route objective. |
| 96 | + message RateCard { |
| 97 | + // Encapsulates the cost used in the rate card. |
| 98 | + message MonetaryCost { |
| 99 | + // Required. The cost value in local currency inferred from the request. |
| 100 | + double value = 1 [(google.api.field_behavior) = REQUIRED]; |
| 101 | + } |
| 102 | + |
| 103 | + // Optional. Cost per minute. |
| 104 | + MonetaryCost cost_per_minute = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 105 | + |
| 106 | + // Optional. Cost per kilometer. |
| 107 | + MonetaryCost cost_per_km = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 108 | + |
| 109 | + // Optional. Whether to include toll cost in the overall cost. |
| 110 | + bool include_tolls = 4 [(google.api.field_behavior) = OPTIONAL]; |
| 111 | + } |
| 112 | + |
| 113 | + // The route objective. |
| 114 | + oneof objective { |
| 115 | + // The RateCard objective. |
| 116 | + RateCard rate_card = 1; |
| 117 | + } |
| 118 | +} |
0 commit comments