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