xref: /aosp_15_r20/external/googleapis/google/maps/routes/v1/compute_custom_routes_request.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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/api/field_behavior.proto";
20import "google/maps/routes/v1/compute_routes_request.proto";
21import "google/maps/routes/v1/polyline.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 = "ComputeCustomRoutesRequestProto";
30option java_package = "com.google.maps.routes.v1";
31option objc_class_prefix = "GMRS";
32option php_namespace = "Google\\Maps\\Routes\\V1";
33
34// ComputeCustomRoutes request message.
35message 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  repeated Waypoint intermediates = 3 [(google.api.field_behavior) = OPTIONAL];
45
46  // Optional. Specifies the mode of transportation. Only DRIVE is supported now.
47  RouteTravelMode travel_mode = 4 [(google.api.field_behavior) = OPTIONAL];
48
49  // Optional. Specifies how to compute the route. The server attempts to use the selected
50  // routing preference to compute the route. If the routing preference results
51  // in an error or an extra long latency, then an error is returned. In the
52  // future, we might implement a fallback mechanism to use a different option
53  // when the preferred option does not give a valid result. You can specify
54  // this option only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`,
55  // otherwise the request fails.
56  RoutingPreference routing_preference = 5 [(google.api.field_behavior) = OPTIONAL];
57
58  // Optional. Specifies your preference for the quality of the polyline.
59  PolylineQuality polyline_quality = 6 [(google.api.field_behavior) = OPTIONAL];
60
61  // Optional. Specifies the preferred encoding for the polyline.
62  PolylineEncoding polyline_encoding = 13 [(google.api.field_behavior) = OPTIONAL];
63
64  // Optional. The departure time. If you don't set this value, then this value
65  // defaults to the time that you made the request. If you set this value to a
66  // time that has already occurred, then the request fails.
67  google.protobuf.Timestamp departure_time = 7 [(google.api.field_behavior) = OPTIONAL];
68
69  // Optional. A set of conditions to satisfy that affect the way routes are calculated.
70  RouteModifiers route_modifiers = 11 [(google.api.field_behavior) = OPTIONAL];
71
72  // Required. A route objective to optimize for.
73  RouteObjective route_objective = 12 [(google.api.field_behavior) = REQUIRED];
74
75  // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
76  // information, see
77  // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
78  // [Language Support](https://developers.google.com/maps/faq#languagesupport)
79  // for the list of supported languages. When you don't provide this value, the
80  // display language is inferred from the location of the route request.
81  string language_code = 9 [(google.api.field_behavior) = OPTIONAL];
82
83  // Optional. Specifies the units of measure for the display fields. This includes the
84  // `instruction` field in `NavigationInstruction`. The units of measure used
85  // for the route, leg, step distance, and duration are not affected by this
86  // value. If you don't provide this value, then the display units are inferred
87  // from the location of the request.
88  Units units = 10 [(google.api.field_behavior) = OPTIONAL];
89}
90
91// Encapsulates an objective to optimize for by ComputeCustomRoutes.
92message RouteObjective {
93  // Encapsulates a RateCard route objective.
94  message RateCard {
95    // Encapsulates the cost used in the rate card.
96    message MonetaryCost {
97      // Required. The cost value in local currency inferred from the request.
98      double value = 1 [(google.api.field_behavior) = REQUIRED];
99    }
100
101    // Optional. Cost per minute.
102    MonetaryCost cost_per_minute = 2 [(google.api.field_behavior) = OPTIONAL];
103
104    // Optional. Cost per kilometer.
105    MonetaryCost cost_per_km = 3 [(google.api.field_behavior) = OPTIONAL];
106
107    // Optional. Whether to include toll cost in the overall cost.
108    bool include_tolls = 4 [(google.api.field_behavior) = OPTIONAL];
109  }
110
111  // Customized data layer that customers use to generated route annotations or
112  // influence the generated route.
113  message CustomLayer {
114    // Information about a dataset that customers uploaded in advance. The
115    // dataset information will be used for generating route annotations or to
116    // influence routing.
117    message DatasetInfo {
118      // Required. ID of a customer uploaded dataset for which will be used to annotate or
119      // influence the route. If the dataset does not exist or is not yet ready,
120      // the request will fail.
121      string dataset_id = 1 [(google.api.field_behavior) = REQUIRED];
122    }
123
124    // Required. A dataset that the customer uploaded in advance.
125    DatasetInfo dataset_info = 1 [(google.api.field_behavior) = REQUIRED];
126  }
127
128  // The route objective.
129  oneof objective {
130    // The RateCard objective.
131    RateCard rate_card = 1;
132  }
133
134  // Optional. Specifies the custom data layer being used to affect generated routes.
135  // Customers can turn off the custom layer by not setting this field. Once a
136  // custom layer is being set, the custom layer will be used to generate route
137  // annotations (CustomLayerInfo) in the returned routes, the annotations can
138  // be turned off using `X-Goog-FieldMask` header (see
139  // https://cloud.google.com/apis/docs/system-parameters).
140  CustomLayer custom_layer = 2 [(google.api.field_behavior) = OPTIONAL];
141}
142