route_service.proto 8.1 KB

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