- [Resource: SelectedRoute](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute)
  - [JSON representation](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute.SCHEMA_REPRESENTATION)
- [DynamicRoute](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#DynamicRoute)
  - [JSON representation](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#DynamicRoute.SCHEMA_REPRESENTATION)
- [LatLng](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#LatLng)
  - [JSON representation](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#LatLng.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#State)
- [ValidationError](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#ValidationError)
- [Methods](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#METHODS_SUMMARY)

## Resource: SelectedRoute

A SelectedRoute represents a specific route that a customer wants to periodically retrieve information (e.g. duration) for contracted use cases.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "createTime": string, "state": enum (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#State`), "routeAttributes": { string: string, ... }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "dynamicRoute": { object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#DynamicRoute`) } // End of mutually exclusive fields. "validationError": enum (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#ValidationError`), "dynamicRouting": boolean } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. Resource name of the `SelectedRoute`. Format: projects/{project}/selectedRoutes/{selectedRoute} |
| `displayName` | `string` Optional. Display name of the route. This is an optional field that can be used by the customer. It does not have to be unique. The length is limited to 100 characters (counted in Unicode code points). |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time when the selected route was first created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `state` | ``enum (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#State`)`` Output only. The state of the selected route. |
| `routeAttributes` | `map (key: string, value: string)` Optional. The custom attributes for the selected route. Adding them allows filtering or grouping of the routes when retrieving historical and real-time routes information. Up to 25 attributes are supported per route. Each key and value should be a non-empty string and can have up to 100 characters (counted in Unicode code points). The keys must not start with `goog`. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| Only `DynamicRoute` is supported. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `dynamicRoute` | ``object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#DynamicRoute`)`` The `SelectedRoute` is a dynamic route. |
| End of mutually exclusive fields. ||
| `validationError` | ``enum (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#ValidationError`)`` Output only. The validation error for the selected route when the state is STATE_INVALID. |
| `dynamicRouting` | `boolean` Optional. If set to `true`, the selected route can dynamically reroute based on the live traffic according to the input waypoints. If set to `false`, the selected route will be a fixed route that is agnostic to live traffic and follows the traffic-unaware path computed at creation time. If omitted, the value will be `false` by default indicating it is a fixed route. |

## DynamicRoute

This represents a route with waypoints (origin, destination, and intermediates). The actual route is guaranteed to pass all the waypoints. If `dynamicRouting` is set to `false`, the actual route remains fixed regardless of traffic conditions. Otherwise if `dynamicRouting` is set to `true`, the actual route can change based on the traffic conditions.

| JSON representation |
|---|
| ``` { "origin": { object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#LatLng`) }, "destination": { object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#LatLng`) }, "intermediates": [ { object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#LatLng`) } ] } ``` |

| Fields ||
|---|---|
| `origin` | ``object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#LatLng`)`` Required. Origin location of the route. |
| `destination` | ``object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#LatLng`)`` Required. Ending location of the route. |
| `intermediates[]` | ``object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#LatLng`)`` Optional. A set of intermediate waypoints along the route (excluding terminal points). They are always passing-by points. Up to 25 intermediate waypoints are supported. Adding them properly can reduce the variation of actual route from time to time. |

## LatLng

An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the [WGS84 standard](https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version). Values must be within normalized ranges.

| JSON representation |
|---|
| ``` { "latitude": number, "longitude": number } ``` |

| Fields ||
|---|---|
| `latitude` | `number` The latitude in degrees. It must be in the range \[-90.0, +90.0\]. |
| `longitude` | `number` The longitude in degrees. It must be in the range \[-180.0, +180.0\]. |

## State

The state of the selected route.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The state of this route is not set. |
| `STATE_SCHEDULING` | The route has been created and is being scheduled. |
| `STATE_RUNNING` | The route has been created and has an active schedule. |
| `STATE_DELETING` | The route has been marked for deletion. |
| `STATE_VALIDATING` | The route is in the process of being validated. |
| `STATE_INVALID` | The route is invalid based on one of the validation criteria. |

## ValidationError

The validation error for the selected route.

| Enums ||
|---|---|
| `VALIDATION_ERROR_UNSPECIFIED` | The validation error of this route is not set. |
| `VALIDATION_ERROR_ROUTE_OUTSIDE_JURISDICTION` | The route is outside the jurisdiction of the project. |
| `VALIDATION_ERROR_LOW_ROAD_USAGE` | The route has low road usage (very few people pass through it). |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchCreate` | Creates multiple `SelectedRoute` resources and starts a schedule to periodically retrieve cache information for each of the routes. |
| ### `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchDelete` | Deletes multiple `SelectedRoute` resources for the specified project. |
| ### `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate` | Updates multiple `SelectedRoute` resources as specified by their names. |
| ### `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/create` | Creates a SelectedRoute and starts a schedule to periodically retrieve cache information for the route. |
| ### `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/delete` | Deletes the specified SelectedRoute for the specified project. |
| ### `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/get` | Gets a SelectedRoute as specified by its name. |
| ### `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/list` | Lists all `SelectedRoute` resources for the specified project with pagination. |
| ### `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/patch` | Updates a SelectedRoute as specified by its name. |