1// Copyright 2022 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 15syntax = "proto3"; 16 17package google.maps.routes.v1; 18 19import "google/maps/routes/v1/polyline.proto"; 20import "google/maps/routes/v1/toll_passes.proto"; 21import "google/maps/routes/v1/vehicle_emission_type.proto"; 22import "google/maps/routes/v1/waypoint.proto"; 23import "google/protobuf/timestamp.proto"; 24 25option cc_enable_arenas = true; 26option csharp_namespace = "Google.Maps.Routes.V1"; 27option go_package = "cloud.google.com/go/maps/routes/apiv1/routespb;routespb"; 28option java_multiple_files = true; 29option java_outer_classname = "ComputeRoutesRequestProto"; 30option java_package = "com.google.maps.routes.v1"; 31option objc_class_prefix = "GMRS"; 32option php_namespace = "Google\\Maps\\Routes\\V1"; 33 34// ComputeRoutes request message. 35message ComputeRoutesRequest { 36 // Required. Origin waypoint. 37 Waypoint origin = 1; 38 39 // Required. Destination waypoint. 40 Waypoint destination = 2; 41 42 // Optional. A set of waypoints along the route (excluding terminal points), 43 // for either stopping at or passing by. Up to 25 intermediate waypoints are 44 // supported. 45 repeated Waypoint intermediates = 3; 46 47 // Optional. Specifies the mode of transportation. 48 RouteTravelMode travel_mode = 4; 49 50 // Optional. Specifies how to compute the route. The server 51 // attempts to use the selected routing preference to compute the route. If 52 // the routing preference results in an error or an extra long latency, then 53 // an error is returned. In the future, we might implement a fallback 54 // mechanism to use a different option when the preferred option does not give 55 // a valid result. You can specify this option only when the `travel_mode` is 56 // `DRIVE` or `TWO_WHEELER`, otherwise the request fails. 57 RoutingPreference routing_preference = 5; 58 59 // Optional. Specifies your preference for the quality of the polyline. 60 PolylineQuality polyline_quality = 6; 61 62 // Optional. Specifies the preferred encoding for the polyline. 63 PolylineEncoding polyline_encoding = 12; 64 65 // Optional. The departure time. If you don't set this value, then this value 66 // defaults to the time that you made the request. If you set this value to a 67 // time that has already occurred, then the request fails. 68 google.protobuf.Timestamp departure_time = 7; 69 70 // Specifies whether to calculate alternate routes in addition to the route. 71 bool compute_alternative_routes = 8; 72 73 // Optional. A set of conditions to satisfy that affect the way routes are 74 // calculated. 75 RouteModifiers route_modifiers = 9; 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 = 10; 84 85 // Optional. Specifies the units of measure for the display fields. This 86 // includes the `instruction` field in `NavigationInstruction`. The units of 87 // measure used for the route, leg, step distance, and duration are not 88 // affected by this value. If you don't provide this value, then the display 89 // units are inferred from the location of the request. 90 Units units = 11; 91 92 // If optimizeWaypointOrder is set to true, an attempt is made to re-order the 93 // specified intermediate waypoints to minimize the overall cost of the route. 94 // If any of the intermediate waypoints is via waypoint the request fails. Use 95 // ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index to find 96 // the new ordering. If routes.optimized_intermediate_waypoint_index is not 97 // requested in the `X-Goog-FieldMask` header, the request fails. If 98 // optimizeWaypointOrder is set to false, 99 // ComputeRoutesResponse.optimized_intermediate_waypoint_index is empty. 100 bool optimize_waypoint_order = 13; 101} 102 103// Encapsulates a set of optional conditions to satisfy when calculating the 104// routes. 105message RouteModifiers { 106 // Specifies whether to avoid toll roads where reasonable. Preference will be 107 // given to routes not containing toll roads. Applies only to the `DRIVE` and 108 // `TWO_WHEELER` travel modes. 109 bool avoid_tolls = 1; 110 111 // Specifies whether to avoid highways where reasonable. Preference will be 112 // given to routes not containing highways. Applies only to the `DRIVE` and 113 // `TWO_WHEELER` travel modes. 114 bool avoid_highways = 2; 115 116 // Specifies whether to avoid ferries where reasonable. Preference will be 117 // given to routes not containing travel by ferries. 118 // Applies only to the `DRIVE` and`TWO_WHEELER` travel modes. 119 bool avoid_ferries = 3; 120 121 // Specifies whether to avoid navigating indoors where reasonable. Preference 122 // will be given to routes not containing indoor navigation. 123 // Applies only to the `WALK` travel mode. 124 bool avoid_indoor = 4; 125 126 // Specifies the vehicle information. 127 VehicleInfo vehicle_info = 5; 128 129 // Encapsulates information about toll passes. 130 // If toll passes are provided, the API tries to return the pass price. If 131 // toll passes are not provided, the API treats the toll pass as unknown and 132 // tries to return the cash price. 133 // Applies only to the DRIVE and TWO_WHEELER travel modes. 134 repeated TollPass toll_passes = 6; 135} 136 137// Encapsulates the vehicle information, such as the license plate last 138// character. 139message VehicleInfo { 140 // Specifies the license plate last character. Could be a digit or a letter. 141 string license_plate_last_character = 1; 142 143 // Describes the vehicle's emission type. 144 // Applies only to the DRIVE travel mode. 145 VehicleEmissionType emission_type = 2; 146} 147 148// A set of values used to specify the mode of travel. 149enum RouteTravelMode { 150 // No travel mode specified. Defaults to `DRIVE`. 151 TRAVEL_MODE_UNSPECIFIED = 0; 152 153 // Travel by passenger car. 154 DRIVE = 1; 155 156 // Travel by bicycle. 157 BICYCLE = 2; 158 159 // Travel by walking. 160 WALK = 3; 161 162 // Two-wheeled, motorized vehicle. For example, motorcycle. Note that this 163 // differs from the `BICYCLE` travel mode which covers human-powered mode. 164 TWO_WHEELER = 4; 165 166 // Travel by licensed taxi, which may allow the vehicle to travel on 167 // designated taxi lanes in some areas. 168 TAXI = 5; 169} 170 171// A set of values that specify factors to take into consideration when 172// calculating the route. 173enum RoutingPreference { 174 // No routing preference specified. Default to `TRAFFIC_AWARE`. 175 ROUTING_PREFERENCE_UNSPECIFIED = 0; 176 177 // Computes routes without taking traffic conditions into consideration. 178 // Suitable when traffic conditions don't matter. Using this value produces 179 // the lowest latency. 180 TRAFFIC_UNAWARE = 1; 181 182 // Calculates routes taking traffic conditions into consideration. In contrast 183 // to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to significantly 184 // reduce latency. 185 TRAFFIC_AWARE = 2; 186 187 // Calculates the routes taking traffic conditions into consideration, 188 // without applying most performance optimizations. Using this value produces 189 // the highest latency. 190 TRAFFIC_AWARE_OPTIMAL = 3; 191} 192 193// A set of values that specify the unit of measure used in the display. 194enum Units { 195 // Units of measure not specified. Defaults to the unit of measure inferred 196 // from the request. 197 UNITS_UNSPECIFIED = 0; 198 199 // Metric units of measure. 200 METRIC = 1; 201 202 // Imperial (English) units of measure. 203 IMPERIAL = 2; 204} 205