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