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