route_matrix_element.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/fallback_info.proto";
  17. import "google/maps/routes/v1/route.proto";
  18. import "google/protobuf/duration.proto";
  19. import "google/rpc/status.proto";
  20. option cc_enable_arenas = true;
  21. option csharp_namespace = "Google.Maps.Routes.V1";
  22. option go_package = "google.golang.org/genproto/googleapis/maps/routes/v1;routes";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "ComputeRouteMatrixElementProto";
  25. option java_package = "com.google.maps.routes.v1";
  26. option objc_class_prefix = "GMRS";
  27. option php_namespace = "Google\\Maps\\Routes\\V1";
  28. // Encapsulates route information computed for an origin/destination pair in the
  29. // ComputeRouteMatrix API. This proto can be streamed to the client.
  30. message RouteMatrixElement {
  31. // Zero-based index of the origin in the request.
  32. int32 origin_index = 1;
  33. // Zero-based index of the destination in the request.
  34. int32 destination_index = 2;
  35. // Error status code for this element.
  36. google.rpc.Status status = 3;
  37. // Indicates whether the route was found or not. Independent of status.
  38. RouteMatrixElementCondition condition = 9;
  39. // The travel distance of the route, in meters.
  40. int32 distance_meters = 4;
  41. // The length of time needed to navigate the route. If you set the
  42. // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
  43. // `static_duration`. If you set the `routing_preference` to either
  44. // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
  45. // taking traffic conditions into account.
  46. google.protobuf.Duration duration = 5;
  47. // The duration of traveling through the route without taking traffic
  48. // conditions into consideration.
  49. google.protobuf.Duration static_duration = 6;
  50. // Additional information about the route. For example: restriction
  51. // information and toll information
  52. RouteTravelAdvisory travel_advisory = 7;
  53. // In some cases when the server is not able to compute the route with the
  54. // given preferences for this particular origin/destination pair, it may
  55. // fall back to using a different mode of computation. When fallback mode is
  56. // used, this field contains detailed information about the fallback response.
  57. // Otherwise this field is unset.
  58. FallbackInfo fallback_info = 8;
  59. }
  60. // The condition of the route being returned.
  61. enum RouteMatrixElementCondition {
  62. // Only used when the `status` of the element is not OK.
  63. ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0;
  64. // A route was found, and the corresponding information was filled out for the
  65. // element.
  66. ROUTE_EXISTS = 1;
  67. // No route could be found. Fields containing route information, such as
  68. // `distance_meters` or `duration`, will not be filled out in the element.
  69. ROUTE_NOT_FOUND = 2;
  70. }