xref: /aosp_15_r20/external/googleapis/google/maps/routes/v1/route_service.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/annotations.proto";
20import "google/api/client.proto";
21import "google/maps/routes/v1/compute_custom_routes_request.proto";
22import "google/maps/routes/v1/compute_custom_routes_response.proto";
23import "google/maps/routes/v1/compute_route_matrix_request.proto";
24import "google/maps/routes/v1/compute_routes_request.proto";
25import "google/maps/routes/v1/compute_routes_response.proto";
26import "google/maps/routes/v1/route_matrix_element.proto";
27
28option cc_enable_arenas = true;
29option csharp_namespace = "Google.Maps.Routes.V1";
30option go_package = "cloud.google.com/go/maps/routes/apiv1/routespb;routespb";
31option java_multiple_files = true;
32option java_outer_classname = "RoutesServiceProto";
33option java_package = "com.google.maps.routes.v1";
34option objc_class_prefix = "GMRS";
35option php_namespace = "Google\\Maps\\Routes\\V1";
36
37// The Routes Preferred API.
38service RoutesPreferred {
39  option (google.api.default_host) = "routespreferred.googleapis.com";
40  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/maps-platform.routespreferred";
41
42  // Returns the primary route along with optional alternate routes, given a set
43  // of terminal and intermediate waypoints.
44  //
45  // **NOTE:** This method requires that you specify a response field mask in
46  // the input. You can provide the response field mask by using URL parameter
47  // `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask`
48  // (see the [available URL parameters and
49  // headers](https://cloud.google.com/apis/docs/system-parameters). The value
50  // is a comma separated list of field paths. See detailed documentation about
51  // [how to construct the field
52  // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
53  //
54  // For example, in this method:
55  //
56  // * Field mask of all available fields (for manual inspection):
57  //   `X-Goog-FieldMask: *`
58  // * Field mask of Route-level duration, distance, and polyline (an example
59  // production setup):
60  //   `X-Goog-FieldMask:
61  //   routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline`
62  //
63  // Google discourage the use of the wildcard (`*`) response field mask, or
64  // specifying the field mask at the top level (`routes`), because:
65  //
66  // * Selecting only the fields that you need helps our server save computation
67  // cycles, allowing us to return the result to you with a lower latency.
68  // * Selecting only the fields that you need
69  // in your production job ensures stable latency performance. We might add
70  // more response fields in the future, and those new fields might require
71  // extra computation time. If you select all fields, or if you select all
72  // fields at the top level, then you might experience performance degradation
73  // because any new field we add will be automatically included in the
74  // response.
75  // * Selecting only the fields that you need results in a smaller response
76  // size, and thus higher network throughput.
77  rpc ComputeRoutes(ComputeRoutesRequest) returns (ComputeRoutesResponse) {
78    option (google.api.http) = {
79      post: "/v1:computeRoutes"
80      body: "*"
81    };
82  }
83
84  // Takes in a list of origins and destinations and returns a stream containing
85  // route information for each combination of origin and destination.
86  //
87  // **NOTE:** This method requires that you specify a response field mask in
88  // the input. You can provide the response field mask by using the URL
89  // parameter `$fields` or `fields`, or by using the HTTP/gRPC header
90  // `X-Goog-FieldMask` (see the [available URL parameters and
91  // headers](https://cloud.google.com/apis/docs/system-parameters). The value
92  // is a comma separated list of field paths. See this detailed documentation
93  // about [how to construct the field
94  // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
95  //
96  // For example, in this method:
97  //
98  // * Field mask of all available fields (for manual inspection):
99  //   `X-Goog-FieldMask: *`
100  // * Field mask of route durations, distances, element status, condition, and
101  //   element indices (an example production setup):
102  //   `X-Goog-FieldMask:
103  //   originIndex,destinationIndex,status,condition,distanceMeters,duration`
104  //
105  // It is critical that you include `status` in your field mask as otherwise
106  // all messages will appear to be OK. Google discourages the use of the
107  // wildcard (`*`) response field mask, because:
108  //
109  // * Selecting only the fields that you need helps our server save computation
110  // cycles, allowing us to return the result to you with a lower latency.
111  // * Selecting only the fields that you need in your production job ensures
112  // stable latency performance. We might add more response fields in the
113  // future, and those new fields might require extra computation time. If you
114  // select all fields, or if you select all fields at the top level, then you
115  // might experience performance degradation because any new field we add will
116  // be automatically included in the response.
117  // * Selecting only the fields that you need results in a smaller response
118  // size, and thus higher network throughput.
119  rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) returns (stream RouteMatrixElement) {
120    option (google.api.http) = {
121      post: "/v1:computeRouteMatrix"
122      body: "*"
123    };
124  }
125
126  // Given a set of terminal and intermediate waypoints, and a route objective,
127  // computes the best route for the route objective. Also returns fastest route
128  // and shortest route as reference routes.
129  //
130  // **NOTE:** This method requires that you specify a response field mask in
131  // the input. You can provide the response field mask by using the URL
132  // parameter `$fields` or `fields`, or by using the HTTP/gRPC header
133  // `X-Goog-FieldMask` (see the [available URL parameters and
134  // headers](https://cloud.google.com/apis/docs/system-parameters). The value
135  // is a comma separated list of field paths. See this detailed documentation
136  // about [how to construct the field
137  // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
138  //
139  // For example, in this method:
140  //
141  // * Field mask of all available fields (for manual inspection):
142  //   `X-Goog-FieldMask: *`
143  // * Field mask of route distances, durations, token and toll info:
144  //   `X-Goog-FieldMask:
145  //   routes.route.distanceMeters,routes.route.duration,routes.token,routes.route.travelAdvisory.tollInfo`
146  //
147  // Google discourages the use of the wildcard (`*`) response field mask, or
148  // specifying the field mask at the top level (`routes`), because:
149  //
150  // * Selecting only the fields that you need helps our server save computation
151  // cycles, allowing us to return the result to you with a lower latency.
152  // * Selecting only the fields that you need in your production job ensures
153  // stable latency performance. We might add more response fields in the
154  // future, and those new fields might require extra computation time. If you
155  // select all fields, or if you select all fields at the top level, then you
156  // might experience performance degradation because any new field we add will
157  // be automatically included in the response.
158  // * Selecting only the fields that you need results in a smaller response
159  // size, and thus higher network throughput.
160  rpc ComputeCustomRoutes(ComputeCustomRoutesRequest) returns (ComputeCustomRoutesResponse) {
161    option (google.api.http) = {
162      post: "/v1:computeCustomRoutes"
163      body: "*"
164    };
165  }
166}
167