# ComputeCustomRoutesResponse

- [JSON representation](https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#SCHEMA_REPRESENTATION)
- [CustomRoute](https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute)
  - [JSON representation](https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute.SCHEMA_REPRESENTATION)
- [FallbackInfo](https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#FallbackInfo)
  - [JSON representation](https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#FallbackInfo.SCHEMA_REPRESENTATION)

ComputeCustomRoutes response message.

| JSON representation |
|---|
| ``` { "routes": [ { object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute`) } ], "fastestRoute": { object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute`) }, "shortestRoute": { object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute`) }, "fallbackInfo": { object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#FallbackInfo`) } } ``` |

| Fields ||
|---|---|
| `routes[]` | ``object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute`)`` The 'best' routes for the input route objective. |
| `fastestRoute` | ``object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute`)`` The fastest reference route. |
| `shortestRoute` | ``object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute`)`` The shortest reference route. |
| `fallbackInfo` | ``object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#FallbackInfo`)`` Fallback info for custom routes. |

## CustomRoute

Encapsulates a custom route computed based on the route objective specified by the customer. `CustomRoute` contains a route and a route token, which can be passed to NavSDK to reconstruct the custom route for turn by turn navigation.

| JSON representation |
|---|
| ``` { "route": { object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/Route`) }, "token": string } ``` |

| Fields ||
|---|---|
| `route` | ``object (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/Route`)`` The route considered 'best' for the input route objective. |
| `token` | `string` Web-safe base64 encoded route token that can be passed to NavSDK, which allows NavSDK to reconstruct the route during navigation, and in the event of rerouting honor the original intention when `RoutesPreferred` `ComputeCustomRoutes` is called. Customers should treat this token as an opaque blob. |

## FallbackInfo

Encapsulates fallback info for `ComputeCustomRoutes`. `ComputeCustomRoutes` performs two types of fallbacks:

1. If it cannot compute the route using the `routingPreference` requested by the customer, it will fallback to another routing mode. In this case `fallback_routing_mode` and `routing_mode_fallback_reason` are used to communicate the fallback routing mode used, as well as the reason for fallback.

2. If it cannot compute a 'best' route for the route objective specified by the customer, it might fallback to another objective. `fallback_route_objective` is used to communicate the fallback route objective.

| JSON representation |
|---|
| ``` { "routingMode": enum (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackRoutingMode`), "routingModeReason": enum (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackReason`), "routeObjective": enum (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackRouteObjective`) } ``` |

| Fields ||
|---|---|
| `routingMode` | ``enum (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackRoutingMode`)`` Routing mode used for the response. If fallback was triggered, the mode may be different from routing preference set in the original client request. |
| `routingModeReason` | ``enum (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackReason`)`` The reason why fallback response was used instead of the original response. This field is only populated when the fallback mode is triggered and the fallback response is returned. |
| `routeObjective` | ``enum (`https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackRouteObjective`)`` The route objective used for the response. If fallback was triggered, the objective may be different from the route objective provided in the original client request. |