compute_custom_routes_response.proto 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/maps/routes/v1/custom_route.proto";
  17. import "google/maps/routes/v1/fallback_info.proto";
  18. option cc_enable_arenas = true;
  19. option csharp_namespace = "Google.Maps.Routes.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/maps/routes/v1;routes";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ComputeCustomRoutesResponseProto";
  23. option java_package = "com.google.maps.routes.v1";
  24. option objc_class_prefix = "GMRS";
  25. option php_namespace = "Google\\Maps\\Routes\\V1";
  26. // ComputeCustomRoutes response message.
  27. message ComputeCustomRoutesResponse {
  28. // Encapsulates fallback info for ComputeCustomRoutes. ComputeCustomRoutes
  29. // performs two types of fallbacks:
  30. //
  31. // 1. If it cannot compute the route using the routing_preference requested by
  32. // the customer, it will fallback to another routing mode. In this case
  33. // fallback_routing_mode and routing_mode_fallback_reason are used to
  34. // communicate the fallback routing mode used, as well as the reason for
  35. // fallback.
  36. //
  37. // 2. If it cannot compute a 'best' route for the route objective specified by
  38. // the customer, it might fallback to another objective.
  39. // fallback_route_objective is used to communicate the fallback route
  40. // objective.
  41. message FallbackInfo {
  42. // RouteObjective used for the response.
  43. enum FallbackRouteObjective {
  44. // Fallback route objective unspecified.
  45. FALLBACK_ROUTE_OBJECTIVE_UNSPECIFIED = 0;
  46. // If customer requests RateCard and sets include_tolls to true, and
  47. // Google does not have toll price data for the route, the API falls back
  48. // to RateCard without considering toll price.
  49. FALLBACK_RATECARD_WITHOUT_TOLL_PRICE_DATA = 1;
  50. }
  51. // Routing mode used for the response. If fallback was triggered, the mode
  52. // may be different from routing preference set in the original client
  53. // request.
  54. FallbackRoutingMode routing_mode = 1;
  55. // The reason why fallback response was used instead of the original
  56. // response.
  57. // This field is only populated when the fallback mode is triggered and
  58. // the fallback response is returned.
  59. FallbackReason routing_mode_reason = 2;
  60. // The route objective used for the response. If fallback was triggered, the
  61. // objective may be different from the route objective provided in the
  62. // original client request.
  63. FallbackRouteObjective route_objective = 3;
  64. }
  65. // The ‘best’ routes for the input route objective.
  66. repeated CustomRoute routes = 7;
  67. // The fastest reference route.
  68. CustomRoute fastest_route = 5;
  69. // The shortest reference route.
  70. CustomRoute shortest_route = 6;
  71. // Fallback info for custom routes.
  72. FallbackInfo fallback_info = 8;
  73. }