fallback_info.proto 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.routing.v2;
  16. option cc_enable_arenas = true;
  17. option csharp_namespace = "Google.Maps.Routing.V2";
  18. option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "FallbackInfoProto";
  21. option java_package = "com.google.maps.routing.v2";
  22. option objc_class_prefix = "GMRV2";
  23. option php_namespace = "Google\\Maps\\Routing\\V2";
  24. option ruby_package = "Google::Maps::Routing::V2";
  25. // Information related to how and why a fallback result was used. If this field
  26. // is set, then it means the server used a different routing mode from your
  27. // preferred mode as fallback.
  28. message FallbackInfo {
  29. // Routing mode used for the response. If fallback was triggered, the mode
  30. // may be different from routing preference set in the original client
  31. // request.
  32. FallbackRoutingMode routing_mode = 1;
  33. // The reason why fallback response was used instead of the original response.
  34. // This field is only populated when the fallback mode is triggered and the
  35. // fallback response is returned.
  36. FallbackReason reason = 2;
  37. }
  38. // Reasons for using fallback response.
  39. enum FallbackReason {
  40. // No fallback reason specified.
  41. FALLBACK_REASON_UNSPECIFIED = 0;
  42. // A server error happened while calculating routes with your preferred
  43. // routing mode, but we were able to return a result calculated by an
  44. // alternative mode.
  45. SERVER_ERROR = 1;
  46. // We were not able to finish the calculation with your preferred routing mode
  47. // on time, but we were able to return a result calculated by an alternative
  48. // mode.
  49. LATENCY_EXCEEDED = 2;
  50. }
  51. // Actual routing mode used for returned fallback response.
  52. enum FallbackRoutingMode {
  53. // Not used.
  54. FALLBACK_ROUTING_MODE_UNSPECIFIED = 0;
  55. // Indicates the "TRAFFIC_UNAWARE" routing mode was used to compute the
  56. // response.
  57. FALLBACK_TRAFFIC_UNAWARE = 1;
  58. // Indicates the "TRAFFIC_AWARE" routing mode was used to compute the
  59. // response.
  60. FALLBACK_TRAFFIC_AWARE = 2;
  61. }