1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733
// This file is @generated by prost-build.
/// Contains [`GeocodedWaypoints`][google.maps.routing.v2.GeocodedWaypoint] for
/// origin, destination and intermediate waypoints. Only populated for address
/// waypoints.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeocodingResults {
/// Origin geocoded waypoint.
#[prost(message, optional, tag = "1")]
pub origin: ::core::option::Option<GeocodedWaypoint>,
/// Destination geocoded waypoint.
#[prost(message, optional, tag = "2")]
pub destination: ::core::option::Option<GeocodedWaypoint>,
/// A list of intermediate geocoded waypoints each containing an index field
/// that corresponds to the zero-based position of the waypoint in the order
/// they were specified in the request.
#[prost(message, repeated, tag = "3")]
pub intermediates: ::prost::alloc::vec::Vec<GeocodedWaypoint>,
}
/// Details about the locations used as waypoints. Only populated for address
/// waypoints. Includes details about the geocoding results for the purposes of
/// determining what the address was geocoded to.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeocodedWaypoint {
/// Indicates the status code resulting from the geocoding operation.
#[prost(message, optional, tag = "1")]
pub geocoder_status: ::core::option::Option<super::super::super::rpc::Status>,
/// The index of the corresponding intermediate waypoint in the request.
/// Only populated if the corresponding waypoint is an intermediate
/// waypoint.
#[prost(int32, optional, tag = "2")]
pub intermediate_waypoint_request_index: ::core::option::Option<i32>,
/// The type(s) of the result, in the form of zero or more type tags.
/// Supported types: [Address types and address component
/// types](<https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types>).
#[prost(string, repeated, tag = "3")]
pub r#type: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Indicates that the geocoder did not return an exact match for the original
/// request, though it was able to match part of the requested address. You may
/// wish to examine the original request for misspellings and/or an incomplete
/// address.
#[prost(bool, tag = "4")]
pub partial_match: bool,
/// The place ID for this result.
#[prost(string, tag = "5")]
pub place_id: ::prost::alloc::string::String,
}
/// A set of values describing the vehicle's emission type.
/// Applies only to the `DRIVE`
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VehicleEmissionType {
/// No emission type specified. Default to `GASOLINE`.
Unspecified = 0,
/// Gasoline/petrol fueled vehicle.
Gasoline = 1,
/// Electricity powered vehicle.
Electric = 2,
/// Hybrid fuel (such as gasoline + electric) vehicle.
Hybrid = 3,
/// Diesel fueled vehicle.
Diesel = 4,
}
impl VehicleEmissionType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
VehicleEmissionType::Unspecified => "VEHICLE_EMISSION_TYPE_UNSPECIFIED",
VehicleEmissionType::Gasoline => "GASOLINE",
VehicleEmissionType::Electric => "ELECTRIC",
VehicleEmissionType::Hybrid => "HYBRID",
VehicleEmissionType::Diesel => "DIESEL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VEHICLE_EMISSION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"GASOLINE" => Some(Self::Gasoline),
"ELECTRIC" => Some(Self::Electric),
"HYBRID" => Some(Self::Hybrid),
"DIESEL" => Some(Self::Diesel),
_ => None,
}
}
}
/// Contains the vehicle information, such as the vehicle emission type.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct VehicleInfo {
/// Describes the vehicle's emission type.
/// Applies only to the `DRIVE`
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[prost(enumeration = "VehicleEmissionType", tag = "2")]
pub emission_type: i32,
}
/// Localized description of time.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocalizedTime {
/// The time specified as a string in a given time zone.
#[prost(message, optional, tag = "1")]
pub time: ::core::option::Option<super::super::super::r#type::LocalizedText>,
/// Contains the time zone. The value is the name of the time zone as defined
/// in the [IANA Time Zone Database](<http://www.iana.org/time-zones>), e.g.
/// "America/New_York".
#[prost(string, tag = "2")]
pub time_zone: ::prost::alloc::string::String,
}
/// Encapsulates a location (a geographic point, and an optional heading).
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Location {
/// The waypoint's geographic coordinates.
#[prost(message, optional, tag = "1")]
pub lat_lng: ::core::option::Option<super::super::super::r#type::LatLng>,
/// The compass heading associated with the direction of the flow of traffic.
/// This value specifies the side of the road for pickup and drop-off. Heading
/// values can be from 0 to 360, where 0 specifies a heading of due North, 90
/// specifies a heading of due East, and so on. You can use this field only for
/// `DRIVE` and `TWO_WHEELER`
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[prost(message, optional, tag = "2")]
pub heading: ::core::option::Option<i32>,
}
/// A set of values that specify the navigation action to take for the current
/// step (for example, turn left, merge, or straight).
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Maneuver {
/// Not used.
Unspecified = 0,
/// Turn slightly to the left.
TurnSlightLeft = 1,
/// Turn sharply to the left.
TurnSharpLeft = 2,
/// Make a left u-turn.
UturnLeft = 3,
/// Turn left.
TurnLeft = 4,
/// Turn slightly to the right.
TurnSlightRight = 5,
/// Turn sharply to the right.
TurnSharpRight = 6,
/// Make a right u-turn.
UturnRight = 7,
/// Turn right.
TurnRight = 8,
/// Go straight.
Straight = 9,
/// Take the left ramp.
RampLeft = 10,
/// Take the right ramp.
RampRight = 11,
/// Merge into traffic.
Merge = 12,
/// Take the left fork.
ForkLeft = 13,
/// Take the right fork.
ForkRight = 14,
/// Take the ferry.
Ferry = 15,
/// Take the train leading onto the ferry.
FerryTrain = 16,
/// Turn left at the roundabout.
RoundaboutLeft = 17,
/// Turn right at the roundabout.
RoundaboutRight = 18,
/// Initial maneuver.
Depart = 19,
/// Used to indicate a street name change.
NameChange = 20,
}
impl Maneuver {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Maneuver::Unspecified => "MANEUVER_UNSPECIFIED",
Maneuver::TurnSlightLeft => "TURN_SLIGHT_LEFT",
Maneuver::TurnSharpLeft => "TURN_SHARP_LEFT",
Maneuver::UturnLeft => "UTURN_LEFT",
Maneuver::TurnLeft => "TURN_LEFT",
Maneuver::TurnSlightRight => "TURN_SLIGHT_RIGHT",
Maneuver::TurnSharpRight => "TURN_SHARP_RIGHT",
Maneuver::UturnRight => "UTURN_RIGHT",
Maneuver::TurnRight => "TURN_RIGHT",
Maneuver::Straight => "STRAIGHT",
Maneuver::RampLeft => "RAMP_LEFT",
Maneuver::RampRight => "RAMP_RIGHT",
Maneuver::Merge => "MERGE",
Maneuver::ForkLeft => "FORK_LEFT",
Maneuver::ForkRight => "FORK_RIGHT",
Maneuver::Ferry => "FERRY",
Maneuver::FerryTrain => "FERRY_TRAIN",
Maneuver::RoundaboutLeft => "ROUNDABOUT_LEFT",
Maneuver::RoundaboutRight => "ROUNDABOUT_RIGHT",
Maneuver::Depart => "DEPART",
Maneuver::NameChange => "NAME_CHANGE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MANEUVER_UNSPECIFIED" => Some(Self::Unspecified),
"TURN_SLIGHT_LEFT" => Some(Self::TurnSlightLeft),
"TURN_SHARP_LEFT" => Some(Self::TurnSharpLeft),
"UTURN_LEFT" => Some(Self::UturnLeft),
"TURN_LEFT" => Some(Self::TurnLeft),
"TURN_SLIGHT_RIGHT" => Some(Self::TurnSlightRight),
"TURN_SHARP_RIGHT" => Some(Self::TurnSharpRight),
"UTURN_RIGHT" => Some(Self::UturnRight),
"TURN_RIGHT" => Some(Self::TurnRight),
"STRAIGHT" => Some(Self::Straight),
"RAMP_LEFT" => Some(Self::RampLeft),
"RAMP_RIGHT" => Some(Self::RampRight),
"MERGE" => Some(Self::Merge),
"FORK_LEFT" => Some(Self::ForkLeft),
"FORK_RIGHT" => Some(Self::ForkRight),
"FERRY" => Some(Self::Ferry),
"FERRY_TRAIN" => Some(Self::FerryTrain),
"ROUNDABOUT_LEFT" => Some(Self::RoundaboutLeft),
"ROUNDABOUT_RIGHT" => Some(Self::RoundaboutRight),
"DEPART" => Some(Self::Depart),
"NAME_CHANGE" => Some(Self::NameChange),
_ => None,
}
}
}
/// Encapsulates navigation instructions for a
/// [`RouteLegStep`][google.maps.routing.v2.RouteLegStep].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NavigationInstruction {
/// Encapsulates the navigation instructions for the current step (for example,
/// turn left, merge, or straight). This field determines which icon to
/// display.
#[prost(enumeration = "Maneuver", tag = "1")]
pub maneuver: i32,
/// Instructions for navigating this step.
#[prost(string, tag = "2")]
pub instructions: ::prost::alloc::string::String,
}
/// Encapsulates an encoded polyline.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Polyline {
/// Encapsulates the type of polyline. Defaults to encoded_polyline.
#[prost(oneof = "polyline::PolylineType", tags = "1, 2")]
pub polyline_type: ::core::option::Option<polyline::PolylineType>,
}
/// Nested message and enum types in `Polyline`.
pub mod polyline {
/// Encapsulates the type of polyline. Defaults to encoded_polyline.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PolylineType {
/// The string encoding of the polyline using the [polyline encoding
/// algorithm](<https://developers.google.com/maps/documentation/utilities/polylinealgorithm>)
#[prost(string, tag = "1")]
EncodedPolyline(::prost::alloc::string::String),
/// Specifies a polyline using the [GeoJSON LineString
/// format](<https://tools.ietf.org/html/rfc7946#section-3.1.4>).
#[prost(message, tag = "2")]
GeoJsonLinestring(::prost_types::Struct),
}
}
/// A set of values that specify the quality of the polyline.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PolylineQuality {
/// No polyline quality preference specified. Defaults to `OVERVIEW`.
Unspecified = 0,
/// Specifies a high-quality polyline - which is composed using more points
/// than `OVERVIEW`, at the cost of increased response size. Use this value
/// when you need more precision.
HighQuality = 1,
/// Specifies an overview polyline - which is composed using a small number of
/// points. Use this value when displaying an overview of the route. Using this
/// option has a lower request latency compared to using the
/// `HIGH_QUALITY` option.
Overview = 2,
}
impl PolylineQuality {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
PolylineQuality::Unspecified => "POLYLINE_QUALITY_UNSPECIFIED",
PolylineQuality::HighQuality => "HIGH_QUALITY",
PolylineQuality::Overview => "OVERVIEW",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"POLYLINE_QUALITY_UNSPECIFIED" => Some(Self::Unspecified),
"HIGH_QUALITY" => Some(Self::HighQuality),
"OVERVIEW" => Some(Self::Overview),
_ => None,
}
}
}
/// Specifies the preferred type of polyline to be returned.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PolylineEncoding {
/// No polyline type preference specified. Defaults to `ENCODED_POLYLINE`.
Unspecified = 0,
/// Specifies a polyline encoded using the [polyline encoding
/// algorithm](/maps/documentation/utilities/polylinealgorithm).
EncodedPolyline = 1,
/// Specifies a polyline using the [GeoJSON LineString
/// format](<https://tools.ietf.org/html/rfc7946#section-3.1.4>)
GeoJsonLinestring = 2,
}
impl PolylineEncoding {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
PolylineEncoding::Unspecified => "POLYLINE_ENCODING_UNSPECIFIED",
PolylineEncoding::EncodedPolyline => "ENCODED_POLYLINE",
PolylineEncoding::GeoJsonLinestring => "GEO_JSON_LINESTRING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"POLYLINE_ENCODING_UNSPECIFIED" => Some(Self::Unspecified),
"ENCODED_POLYLINE" => Some(Self::EncodedPolyline),
"GEO_JSON_LINESTRING" => Some(Self::GeoJsonLinestring),
_ => None,
}
}
}
/// Labels for the [`Route`][google.maps.routing.v2.Route] that are useful to
/// identify specific properties of the route to compare against others.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RouteLabel {
/// Default - not used.
Unspecified = 0,
/// The default "best" route returned for the route computation.
DefaultRoute = 1,
/// An alternative to the default "best" route. Routes like this will be
/// returned when
/// [`compute_alternative_routes`][google.maps.routing.v2.ComputeRoutesRequest.compute_alternative_routes]
/// is specified.
DefaultRouteAlternate = 2,
/// Fuel efficient route. Routes labeled with this value are determined to be
/// optimized for Eco parameters such as fuel consumption.
FuelEfficient = 3,
}
impl RouteLabel {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
RouteLabel::Unspecified => "ROUTE_LABEL_UNSPECIFIED",
RouteLabel::DefaultRoute => "DEFAULT_ROUTE",
RouteLabel::DefaultRouteAlternate => "DEFAULT_ROUTE_ALTERNATE",
RouteLabel::FuelEfficient => "FUEL_EFFICIENT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ROUTE_LABEL_UNSPECIFIED" => Some(Self::Unspecified),
"DEFAULT_ROUTE" => Some(Self::DefaultRoute),
"DEFAULT_ROUTE_ALTERNATE" => Some(Self::DefaultRouteAlternate),
"FUEL_EFFICIENT" => Some(Self::FuelEfficient),
_ => None,
}
}
}
/// A set of values used to specify the mode of travel.
/// NOTE: `WALK`, `BICYCLE`, and `TWO_WHEELER` routes are in beta and might
/// sometimes be missing clear sidewalks, pedestrian paths, or bicycling paths.
/// You must display this warning to the user for all walking, bicycling, and
/// two-wheel routes that you display in your app.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RouteTravelMode {
/// No travel mode specified. Defaults to `DRIVE`.
TravelModeUnspecified = 0,
/// Travel by passenger car.
Drive = 1,
/// Travel by bicycle.
Bicycle = 2,
/// Travel by walking.
Walk = 3,
/// Two-wheeled, motorized vehicle. For example, motorcycle. Note that this
/// differs from the `BICYCLE` travel mode which covers human-powered mode.
TwoWheeler = 4,
/// Travel by public transit routes, where available.
Transit = 7,
}
impl RouteTravelMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
RouteTravelMode::TravelModeUnspecified => "TRAVEL_MODE_UNSPECIFIED",
RouteTravelMode::Drive => "DRIVE",
RouteTravelMode::Bicycle => "BICYCLE",
RouteTravelMode::Walk => "WALK",
RouteTravelMode::TwoWheeler => "TWO_WHEELER",
RouteTravelMode::Transit => "TRANSIT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRAVEL_MODE_UNSPECIFIED" => Some(Self::TravelModeUnspecified),
"DRIVE" => Some(Self::Drive),
"BICYCLE" => Some(Self::Bicycle),
"WALK" => Some(Self::Walk),
"TWO_WHEELER" => Some(Self::TwoWheeler),
"TRANSIT" => Some(Self::Transit),
_ => None,
}
}
}
/// Traffic density indicator on a contiguous segment of a polyline or path.
/// Given a path with points P_0, P_1, ... , P_N (zero-based index), the
/// `SpeedReadingInterval` defines an interval and describes its traffic using
/// the following categories.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SpeedReadingInterval {
/// The starting index of this interval in the polyline.
#[prost(int32, optional, tag = "1")]
pub start_polyline_point_index: ::core::option::Option<i32>,
/// The ending index of this interval in the polyline.
#[prost(int32, optional, tag = "2")]
pub end_polyline_point_index: ::core::option::Option<i32>,
#[prost(oneof = "speed_reading_interval::SpeedType", tags = "3")]
pub speed_type: ::core::option::Option<speed_reading_interval::SpeedType>,
}
/// Nested message and enum types in `SpeedReadingInterval`.
pub mod speed_reading_interval {
/// The classification of polyline speed based on traffic data.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Speed {
/// Default value. This value is unused.
Unspecified = 0,
/// Normal speed, no slowdown is detected.
Normal = 1,
/// Slowdown detected, but no traffic jam formed.
Slow = 2,
/// Traffic jam detected.
TrafficJam = 3,
}
impl Speed {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Speed::Unspecified => "SPEED_UNSPECIFIED",
Speed::Normal => "NORMAL",
Speed::Slow => "SLOW",
Speed::TrafficJam => "TRAFFIC_JAM",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SPEED_UNSPECIFIED" => Some(Self::Unspecified),
"NORMAL" => Some(Self::Normal),
"SLOW" => Some(Self::Slow),
"TRAFFIC_JAM" => Some(Self::TrafficJam),
_ => None,
}
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum SpeedType {
/// Traffic speed in this interval.
#[prost(enumeration = "Speed", tag = "3")]
Speed(i32),
}
}
/// Encapsulates toll information on a [`Route`][google.maps.routing.v2.Route] or
/// on a [`RouteLeg`][google.maps.routing.v2.RouteLeg].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TollInfo {
/// The monetary amount of tolls for the corresponding
/// [`Route`][google.maps.routing.v2.Route] or
/// [`RouteLeg`][google.maps.routing.v2.RouteLeg]. This list contains a money
/// amount for each currency that is expected to be charged by the toll
/// stations. Typically this list will contain only one item for routes with
/// tolls in one currency. For international trips, this list may contain
/// multiple items to reflect tolls in different currencies.
#[prost(message, repeated, tag = "1")]
pub estimated_price: ::prost::alloc::vec::Vec<super::super::super::r#type::Money>,
}
/// A transit agency that operates a transit line.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitAgency {
/// The name of this transit agency.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The transit agency's locale-specific formatted phone number.
#[prost(string, tag = "2")]
pub phone_number: ::prost::alloc::string::String,
/// The transit agency's URI.
#[prost(string, tag = "3")]
pub uri: ::prost::alloc::string::String,
}
/// Contains information about the transit line used in this step.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitLine {
/// The transit agency (or agencies) that operates this transit line.
#[prost(message, repeated, tag = "1")]
pub agencies: ::prost::alloc::vec::Vec<TransitAgency>,
/// The full name of this transit line, For example, "8 Avenue Local".
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// the URI for this transit line as provided by the transit agency.
#[prost(string, tag = "3")]
pub uri: ::prost::alloc::string::String,
/// The color commonly used in signage for this line. Represented in
/// hexadecimal.
#[prost(string, tag = "4")]
pub color: ::prost::alloc::string::String,
/// The URI for the icon associated with this line.
#[prost(string, tag = "5")]
pub icon_uri: ::prost::alloc::string::String,
/// The short name of this transit line. This name will normally be a line
/// number, such as "M7" or "355".
#[prost(string, tag = "6")]
pub name_short: ::prost::alloc::string::String,
/// The color commonly used in text on signage for this line. Represented in
/// hexadecimal.
#[prost(string, tag = "7")]
pub text_color: ::prost::alloc::string::String,
/// The type of vehicle that operates on this transit line.
#[prost(message, optional, tag = "8")]
pub vehicle: ::core::option::Option<TransitVehicle>,
}
/// Information about a transit stop.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitStop {
/// The name of the transit stop.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The location of the stop expressed in latitude/longitude coordinates.
#[prost(message, optional, tag = "2")]
pub location: ::core::option::Option<Location>,
}
/// Information about a vehicle used in transit routes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitVehicle {
/// The name of this vehicle, capitalized.
#[prost(message, optional, tag = "1")]
pub name: ::core::option::Option<super::super::super::r#type::LocalizedText>,
/// The type of vehicle used.
#[prost(enumeration = "transit_vehicle::TransitVehicleType", tag = "2")]
pub r#type: i32,
/// The URI for an icon associated with this vehicle type.
#[prost(string, tag = "3")]
pub icon_uri: ::prost::alloc::string::String,
/// The URI for the icon associated with this vehicle type, based on the local
/// transport signage.
#[prost(string, tag = "4")]
pub local_icon_uri: ::prost::alloc::string::String,
}
/// Nested message and enum types in `TransitVehicle`.
pub mod transit_vehicle {
/// The type of vehicles for transit routes.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TransitVehicleType {
/// Unused.
Unspecified = 0,
/// Bus.
Bus = 1,
/// A vehicle that operates on a cable, usually on the ground. Aerial cable
/// cars may be of the type `GONDOLA_LIFT`.
CableCar = 2,
/// Commuter rail.
CommuterTrain = 3,
/// Ferry.
Ferry = 4,
/// A vehicle that is pulled up a steep incline by a cable. A Funicular
/// typically consists of two cars, with each car acting as a counterweight
/// for the other.
Funicular = 5,
/// An aerial cable car.
GondolaLift = 6,
/// Heavy rail.
HeavyRail = 7,
/// High speed train.
HighSpeedTrain = 8,
/// Intercity bus.
IntercityBus = 9,
/// Long distance train.
LongDistanceTrain = 10,
/// Light rail transit.
MetroRail = 11,
/// Monorail.
Monorail = 12,
/// All other vehicles.
Other = 13,
/// Rail.
Rail = 14,
/// Share taxi is a kind of bus with the ability to drop off and pick up
/// passengers anywhere on its route.
ShareTaxi = 15,
/// Underground light rail.
Subway = 16,
/// Above ground light rail.
Tram = 17,
/// Trolleybus.
Trolleybus = 18,
}
impl TransitVehicleType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TransitVehicleType::Unspecified => "TRANSIT_VEHICLE_TYPE_UNSPECIFIED",
TransitVehicleType::Bus => "BUS",
TransitVehicleType::CableCar => "CABLE_CAR",
TransitVehicleType::CommuterTrain => "COMMUTER_TRAIN",
TransitVehicleType::Ferry => "FERRY",
TransitVehicleType::Funicular => "FUNICULAR",
TransitVehicleType::GondolaLift => "GONDOLA_LIFT",
TransitVehicleType::HeavyRail => "HEAVY_RAIL",
TransitVehicleType::HighSpeedTrain => "HIGH_SPEED_TRAIN",
TransitVehicleType::IntercityBus => "INTERCITY_BUS",
TransitVehicleType::LongDistanceTrain => "LONG_DISTANCE_TRAIN",
TransitVehicleType::MetroRail => "METRO_RAIL",
TransitVehicleType::Monorail => "MONORAIL",
TransitVehicleType::Other => "OTHER",
TransitVehicleType::Rail => "RAIL",
TransitVehicleType::ShareTaxi => "SHARE_TAXI",
TransitVehicleType::Subway => "SUBWAY",
TransitVehicleType::Tram => "TRAM",
TransitVehicleType::Trolleybus => "TROLLEYBUS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSIT_VEHICLE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"BUS" => Some(Self::Bus),
"CABLE_CAR" => Some(Self::CableCar),
"COMMUTER_TRAIN" => Some(Self::CommuterTrain),
"FERRY" => Some(Self::Ferry),
"FUNICULAR" => Some(Self::Funicular),
"GONDOLA_LIFT" => Some(Self::GondolaLift),
"HEAVY_RAIL" => Some(Self::HeavyRail),
"HIGH_SPEED_TRAIN" => Some(Self::HighSpeedTrain),
"INTERCITY_BUS" => Some(Self::IntercityBus),
"LONG_DISTANCE_TRAIN" => Some(Self::LongDistanceTrain),
"METRO_RAIL" => Some(Self::MetroRail),
"MONORAIL" => Some(Self::Monorail),
"OTHER" => Some(Self::Other),
"RAIL" => Some(Self::Rail),
"SHARE_TAXI" => Some(Self::ShareTaxi),
"SUBWAY" => Some(Self::Subway),
"TRAM" => Some(Self::Tram),
"TROLLEYBUS" => Some(Self::Trolleybus),
_ => None,
}
}
}
}
/// Contains a route, which consists of a series of connected road segments
/// that join beginning, ending, and intermediate waypoints.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Route {
/// Labels for the `Route` that are useful to identify specific properties
/// of the route to compare against others.
#[prost(enumeration = "RouteLabel", repeated, tag = "13")]
pub route_labels: ::prost::alloc::vec::Vec<i32>,
/// A collection of legs (path segments between waypoints) that make up the
/// route. Each leg corresponds to the trip between two non-`via`
/// [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with
/// no intermediate waypoints has only one leg. A route that includes one
/// non-`via` intermediate waypoint has two legs. A route that includes one
/// `via` intermediate waypoint has one leg. The order of the legs matches the
/// order of waypoints from `origin` to `intermediates` to `destination`.
#[prost(message, repeated, tag = "1")]
pub legs: ::prost::alloc::vec::Vec<RouteLeg>,
/// The travel distance of the route, in meters.
#[prost(int32, tag = "2")]
pub distance_meters: i32,
/// The length of time needed to navigate the route. If you set the
/// `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
/// `static_duration`. If you set the `routing_preference` to either
/// `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
/// taking traffic conditions into account.
#[prost(message, optional, tag = "3")]
pub duration: ::core::option::Option<::prost_types::Duration>,
/// The duration of travel through the route without taking traffic
/// conditions into consideration.
#[prost(message, optional, tag = "4")]
pub static_duration: ::core::option::Option<::prost_types::Duration>,
/// The overall route polyline. This polyline is the combined polyline of
/// all `legs`.
#[prost(message, optional, tag = "5")]
pub polyline: ::core::option::Option<Polyline>,
/// A description of the route.
#[prost(string, tag = "6")]
pub description: ::prost::alloc::string::String,
/// An array of warnings to show when displaying the route.
#[prost(string, repeated, tag = "7")]
pub warnings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The viewport bounding box of the polyline.
#[prost(message, optional, tag = "8")]
pub viewport: ::core::option::Option<super::super::super::geo::r#type::Viewport>,
/// Additional information about the route.
#[prost(message, optional, tag = "9")]
pub travel_advisory: ::core::option::Option<RouteTravelAdvisory>,
/// If you set
/// [`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order]
/// to true, this field contains the optimized ordering of intermediate
/// waypoints. Otherwise, this field is empty.
/// For example, if you give an input of Origin: LA; Intermediate waypoints:
/// Dallas, Bangor, Phoenix; Destination: New York; and the optimized
/// intermediate waypoint order is Phoenix, Dallas, Bangor, then this field
/// contains the values \[2, 0, 1\]. The index starts with 0 for the first
/// intermediate waypoint provided in the input.
#[prost(int32, repeated, tag = "10")]
pub optimized_intermediate_waypoint_index: ::prost::alloc::vec::Vec<i32>,
/// Text representations of properties of the `Route`.
#[prost(message, optional, tag = "11")]
pub localized_values: ::core::option::Option<route::RouteLocalizedValues>,
/// A web-safe, base64-encoded route token that can be passed to the Navigation
/// SDK, that allows the Navigation SDK to reconstruct the route during
/// navigation, and, in the event of rerouting, honor the original intention
/// when you created the route by calling ComputeRoutes. Customers should treat
/// this token as an opaque blob. It is not meant for reading or mutating.
/// NOTE: `Route.route_token` is only available for requests that have set
/// `ComputeRoutesRequest.routing_preference` to `TRAFFIC_AWARE` or
/// `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests
/// that have Via waypoints.
#[prost(string, tag = "12")]
pub route_token: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Route`.
pub mod route {
/// Text representations of certain properties.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteLocalizedValues {
/// Travel distance represented in text form.
#[prost(message, optional, tag = "1")]
pub distance: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Duration taking traffic conditions into consideration, represented in
/// text form. Note: If you did not request traffic information, this value
/// will be the same value as `static_duration`.
#[prost(message, optional, tag = "2")]
pub duration: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Duration without taking traffic conditions into consideration,
/// represented in text form.
#[prost(message, optional, tag = "3")]
pub static_duration: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Transit fare represented in text form.
#[prost(message, optional, tag = "4")]
pub transit_fare: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
}
}
/// Contains the additional information that the user should be informed
/// about, such as possible traffic zone restrictions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteTravelAdvisory {
/// Contains information about tolls on the route. This field is only populated
/// if tolls are expected on the route. If this field is set, but the
/// `estimatedPrice` subfield is not populated, then the route contains tolls,
/// but the estimated price is unknown. If this field is not set, then there
/// are no tolls expected on the route.
#[prost(message, optional, tag = "2")]
pub toll_info: ::core::option::Option<TollInfo>,
/// Speed reading intervals detailing traffic density. Applicable in case of
/// `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
/// The intervals cover the entire polyline of the route without overlap.
/// The start point of a specified interval is the same as the end point of the
/// preceding interval.
///
/// Example:
///
/// polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
/// speed_reading_intervals: [A,C), [C,D), [D,G).
#[prost(message, repeated, tag = "3")]
pub speed_reading_intervals: ::prost::alloc::vec::Vec<SpeedReadingInterval>,
/// The predicted fuel consumption in microliters.
#[prost(int64, tag = "5")]
pub fuel_consumption_microliters: i64,
/// Returned route may have restrictions that are not suitable for requested
/// travel mode or route modifiers.
#[prost(bool, tag = "6")]
pub route_restrictions_partially_ignored: bool,
/// If present, contains the total fare or ticket costs on this route
/// This property is only returned for `TRANSIT` requests and only
/// for routes where fare information is available for all transit steps.
#[prost(message, optional, tag = "7")]
pub transit_fare: ::core::option::Option<super::super::super::r#type::Money>,
}
/// Contains the additional information that the user should be informed
/// about on a leg step, such as possible traffic zone restrictions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteLegTravelAdvisory {
/// Contains information about tolls on the specific `RouteLeg`.
/// This field is only populated if we expect there are tolls on the
/// `RouteLeg`. If this field is set but the estimated_price subfield is not
/// populated, we expect that road contains tolls but we do not know an
/// estimated price. If this field does not exist, then there is no toll on the
/// `RouteLeg`.
#[prost(message, optional, tag = "1")]
pub toll_info: ::core::option::Option<TollInfo>,
/// Speed reading intervals detailing traffic density. Applicable in case of
/// `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
/// The intervals cover the entire polyline of the `RouteLeg` without overlap.
/// The start point of a specified interval is the same as the end point of the
/// preceding interval.
///
/// Example:
///
/// polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
/// speed_reading_intervals: [A,C), [C,D), [D,G).
#[prost(message, repeated, tag = "2")]
pub speed_reading_intervals: ::prost::alloc::vec::Vec<SpeedReadingInterval>,
}
/// Contains the additional information that the user should be informed
/// about, such as possible traffic zone restrictions on a leg step.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteLegStepTravelAdvisory {
/// NOTE: This field is not currently populated.
#[prost(message, repeated, tag = "1")]
pub speed_reading_intervals: ::prost::alloc::vec::Vec<SpeedReadingInterval>,
}
/// Contains a segment between non-`via` waypoints.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteLeg {
/// The travel distance of the route leg, in meters.
#[prost(int32, tag = "1")]
pub distance_meters: i32,
/// The length of time needed to navigate the leg. If the `route_preference`
/// is set to `TRAFFIC_UNAWARE`, then this value is the same as
/// `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
/// `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
/// conditions into account.
#[prost(message, optional, tag = "2")]
pub duration: ::core::option::Option<::prost_types::Duration>,
/// The duration of travel through the leg, calculated without taking
/// traffic conditions into consideration.
#[prost(message, optional, tag = "3")]
pub static_duration: ::core::option::Option<::prost_types::Duration>,
/// The overall polyline for this leg that includes each `step`'s
/// polyline.
#[prost(message, optional, tag = "4")]
pub polyline: ::core::option::Option<Polyline>,
/// The start location of this leg. This location might be different from the
/// provided `origin`. For example, when the provided `origin` is not near a
/// road, this is a point on the road.
#[prost(message, optional, tag = "5")]
pub start_location: ::core::option::Option<Location>,
/// The end location of this leg. This location might be different from the
/// provided `destination`. For example, when the provided `destination` is not
/// near a road, this is a point on the road.
#[prost(message, optional, tag = "6")]
pub end_location: ::core::option::Option<Location>,
/// An array of steps denoting segments within this leg. Each step represents
/// one navigation instruction.
#[prost(message, repeated, tag = "7")]
pub steps: ::prost::alloc::vec::Vec<RouteLegStep>,
/// Contains the additional information that the user should be informed
/// about, such as possible traffic zone restrictions, on a route leg.
#[prost(message, optional, tag = "8")]
pub travel_advisory: ::core::option::Option<RouteLegTravelAdvisory>,
/// Text representations of properties of the `RouteLeg`.
#[prost(message, optional, tag = "9")]
pub localized_values: ::core::option::Option<route_leg::RouteLegLocalizedValues>,
/// Overview information about the steps in this `RouteLeg`. This field is only
/// populated for TRANSIT routes.
#[prost(message, optional, tag = "10")]
pub steps_overview: ::core::option::Option<route_leg::StepsOverview>,
}
/// Nested message and enum types in `RouteLeg`.
pub mod route_leg {
/// Text representations of certain properties.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteLegLocalizedValues {
/// Travel distance represented in text form.
#[prost(message, optional, tag = "1")]
pub distance: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Duration taking traffic conditions into consideration represented in text
/// form. Note: If you did not request traffic information, this value will
/// be the same value as static_duration.
#[prost(message, optional, tag = "2")]
pub duration: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Duration without taking traffic conditions into
/// consideration, represented in text form.
#[prost(message, optional, tag = "3")]
pub static_duration: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
}
/// Provides overview information about a list of `RouteLegStep`s.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StepsOverview {
/// Summarized information about different multi-modal segments of
/// the `RouteLeg.steps`. This field is not populated if the `RouteLeg` does
/// not contain any multi-modal segments in the steps.
#[prost(message, repeated, tag = "1")]
pub multi_modal_segments: ::prost::alloc::vec::Vec<
steps_overview::MultiModalSegment,
>,
}
/// Nested message and enum types in `StepsOverview`.
pub mod steps_overview {
/// Provides summarized information about different multi-modal segments of
/// the `RouteLeg.steps`. A multi-modal segment is defined as one or more
/// contiguous `RouteLegStep` that have the same `RouteTravelMode`.
/// This field is not populated if the `RouteLeg` does not contain any
/// multi-modal segments in the steps.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiModalSegment {
/// The corresponding `RouteLegStep` index that is the start of a
/// multi-modal segment.
#[prost(int32, optional, tag = "1")]
pub step_start_index: ::core::option::Option<i32>,
/// The corresponding `RouteLegStep` index that is the end of a
/// multi-modal segment.
#[prost(int32, optional, tag = "2")]
pub step_end_index: ::core::option::Option<i32>,
/// NavigationInstruction for the multi-modal segment.
#[prost(message, optional, tag = "3")]
pub navigation_instruction: ::core::option::Option<
super::super::NavigationInstruction,
>,
/// The travel mode of the multi-modal segment.
#[prost(enumeration = "super::super::RouteTravelMode", tag = "4")]
pub travel_mode: i32,
}
}
}
/// Contains a segment of a [`RouteLeg`][google.maps.routing.v2.RouteLeg]. A
/// step corresponds to a single navigation instruction. Route legs are made up
/// of steps.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteLegStep {
/// The travel distance of this step, in meters. In some circumstances, this
/// field might not have a value.
#[prost(int32, tag = "1")]
pub distance_meters: i32,
/// The duration of travel through this step without taking traffic conditions
/// into consideration. In some circumstances, this field might not have a
/// value.
#[prost(message, optional, tag = "2")]
pub static_duration: ::core::option::Option<::prost_types::Duration>,
/// The polyline associated with this step.
#[prost(message, optional, tag = "3")]
pub polyline: ::core::option::Option<Polyline>,
/// The start location of this step.
#[prost(message, optional, tag = "4")]
pub start_location: ::core::option::Option<Location>,
/// The end location of this step.
#[prost(message, optional, tag = "5")]
pub end_location: ::core::option::Option<Location>,
/// Navigation instructions.
#[prost(message, optional, tag = "6")]
pub navigation_instruction: ::core::option::Option<NavigationInstruction>,
/// Contains the additional information that the user should be informed
/// about, such as possible traffic zone restrictions, on a leg step.
#[prost(message, optional, tag = "7")]
pub travel_advisory: ::core::option::Option<RouteLegStepTravelAdvisory>,
/// Text representations of properties of the `RouteLegStep`.
#[prost(message, optional, tag = "8")]
pub localized_values: ::core::option::Option<
route_leg_step::RouteLegStepLocalizedValues,
>,
/// Details pertaining to this step if the travel mode is `TRANSIT`.
#[prost(message, optional, tag = "9")]
pub transit_details: ::core::option::Option<RouteLegStepTransitDetails>,
/// The travel mode used for this step.
#[prost(enumeration = "RouteTravelMode", tag = "10")]
pub travel_mode: i32,
}
/// Nested message and enum types in `RouteLegStep`.
pub mod route_leg_step {
/// Text representations of certain properties.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteLegStepLocalizedValues {
/// Travel distance represented in text form.
#[prost(message, optional, tag = "1")]
pub distance: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Duration without taking traffic conditions into
/// consideration, represented in text form.
#[prost(message, optional, tag = "3")]
pub static_duration: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
}
}
/// Additional information for the `RouteLegStep` related to `TRANSIT` routes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteLegStepTransitDetails {
/// Information about the arrival and departure stops for the step.
#[prost(message, optional, tag = "1")]
pub stop_details: ::core::option::Option<
route_leg_step_transit_details::TransitStopDetails,
>,
/// Text representations of properties of the `RouteLegStepTransitDetails`.
#[prost(message, optional, tag = "2")]
pub localized_values: ::core::option::Option<
route_leg_step_transit_details::TransitDetailsLocalizedValues,
>,
/// Specifies the direction in which to travel on this line as marked on
/// the vehicle or at the departure stop. The direction is often the terminus
/// station.
#[prost(string, tag = "3")]
pub headsign: ::prost::alloc::string::String,
/// Specifies the expected time as a duration between departures from the same
/// stop at this time. For example, with a headway seconds value of 600, you
/// would expect a ten minute wait if you should miss your bus.
#[prost(message, optional, tag = "4")]
pub headway: ::core::option::Option<::prost_types::Duration>,
/// Information about the transit line used in this step.
#[prost(message, optional, tag = "5")]
pub transit_line: ::core::option::Option<TransitLine>,
/// The number of stops from the departure to the arrival stop. This count
/// includes the arrival stop, but excludes the departure stop. For example, if
/// your route leaves from Stop A, passes through stops B and C, and arrives at
/// stop D, stop_count will return 3.
#[prost(int32, tag = "6")]
pub stop_count: i32,
/// The text that appears in schedules and sign boards to identify a transit
/// trip to passengers. The text should uniquely identify a trip within a
/// service day. For example, "538" is the `trip_short_text` of the Amtrak
/// train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA.
#[prost(string, tag = "7")]
pub trip_short_text: ::prost::alloc::string::String,
}
/// Nested message and enum types in `RouteLegStepTransitDetails`.
pub mod route_leg_step_transit_details {
/// Details about the transit stops for the `RouteLegStep`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitStopDetails {
/// Information about the arrival stop for the step.
#[prost(message, optional, tag = "1")]
pub arrival_stop: ::core::option::Option<super::TransitStop>,
/// The estimated time of arrival for the step.
#[prost(message, optional, tag = "2")]
pub arrival_time: ::core::option::Option<::prost_types::Timestamp>,
/// Information about the departure stop for the step.
#[prost(message, optional, tag = "3")]
pub departure_stop: ::core::option::Option<super::TransitStop>,
/// The estimated time of departure for the step.
#[prost(message, optional, tag = "4")]
pub departure_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Localized descriptions of values for `RouteTransitDetails`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitDetailsLocalizedValues {
/// Time in its formatted text representation with a corresponding time zone.
#[prost(message, optional, tag = "1")]
pub arrival_time: ::core::option::Option<super::LocalizedTime>,
/// Time in its formatted text representation with a corresponding time zone.
#[prost(message, optional, tag = "2")]
pub departure_time: ::core::option::Option<super::LocalizedTime>,
}
}
/// Information related to how and why a fallback result was used. If this field
/// is set, then it means the server used a different routing mode from your
/// preferred mode as fallback.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FallbackInfo {
/// Routing mode used for the response. If fallback was triggered, the mode
/// may be different from routing preference set in the original client
/// request.
#[prost(enumeration = "FallbackRoutingMode", tag = "1")]
pub routing_mode: i32,
/// 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.
#[prost(enumeration = "FallbackReason", tag = "2")]
pub reason: i32,
}
/// Reasons for using fallback response.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FallbackReason {
/// No fallback reason specified.
Unspecified = 0,
/// A server error happened while calculating routes with your preferred
/// routing mode, but we were able to return a result calculated by an
/// alternative mode.
ServerError = 1,
/// We were not able to finish the calculation with your preferred routing mode
/// on time, but we were able to return a result calculated by an alternative
/// mode.
LatencyExceeded = 2,
}
impl FallbackReason {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
FallbackReason::Unspecified => "FALLBACK_REASON_UNSPECIFIED",
FallbackReason::ServerError => "SERVER_ERROR",
FallbackReason::LatencyExceeded => "LATENCY_EXCEEDED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FALLBACK_REASON_UNSPECIFIED" => Some(Self::Unspecified),
"SERVER_ERROR" => Some(Self::ServerError),
"LATENCY_EXCEEDED" => Some(Self::LatencyExceeded),
_ => None,
}
}
}
/// Actual routing mode used for returned fallback response.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FallbackRoutingMode {
/// Not used.
Unspecified = 0,
/// Indicates the `TRAFFIC_UNAWARE`
/// [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] was used to
/// compute the response.
FallbackTrafficUnaware = 1,
/// Indicates the `TRAFFIC_AWARE`
/// [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] was used to
/// compute the response.
FallbackTrafficAware = 2,
}
impl FallbackRoutingMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
FallbackRoutingMode::Unspecified => "FALLBACK_ROUTING_MODE_UNSPECIFIED",
FallbackRoutingMode::FallbackTrafficUnaware => "FALLBACK_TRAFFIC_UNAWARE",
FallbackRoutingMode::FallbackTrafficAware => "FALLBACK_TRAFFIC_AWARE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FALLBACK_ROUTING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"FALLBACK_TRAFFIC_UNAWARE" => Some(Self::FallbackTrafficUnaware),
"FALLBACK_TRAFFIC_AWARE" => Some(Self::FallbackTrafficAware),
_ => None,
}
}
}
/// List of toll passes around the world that we support.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TollPass {
/// Not used. If this value is used, then the request fails.
Unspecified = 0,
/// Sydney toll pass. See additional details at
/// <https://www.myetoll.com.au.>
AuEtollTag = 82,
/// Sydney toll pass. See additional details at <https://www.tollpay.com.au.>
AuEwayTag = 83,
/// Australia-wide toll pass.
/// See additional details at <https://www.linkt.com.au/.>
AuLinkt = 2,
/// Argentina toll pass. See additional details at <https://telepase.com.ar>
ArTelepase = 3,
/// Brazil toll pass. See additional details at <https://www.autoexpreso.com>
BrAutoExpreso = 81,
/// Brazil toll pass. See additional details at <https://conectcar.com.>
BrConectcar = 7,
/// Brazil toll pass. See additional details at <https://movemais.com.>
BrMoveMais = 8,
/// Brazil toll pass. See additional details at <https://pasorapido.gob.do/>
BrPassaRapido = 88,
/// Brazil toll pass. See additional details at <https://www.semparar.com.br.>
BrSemParar = 9,
/// Brazil toll pass. See additional details at <https://taggy.com.br.>
BrTaggy = 10,
/// Brazil toll pass. See additional details at
/// <https://veloe.com.br/site/onde-usar.>
BrVeloe = 11,
/// Canada to United States border crossing.
CaUsAkwasasneSeawayCorporateCard = 84,
/// Canada to United States border crossing.
CaUsAkwasasneSeawayTransitCard = 85,
/// Ontario, Canada to Michigan, United States border crossing.
CaUsBlueWaterEdgePass = 18,
/// Ontario, Canada to Michigan, United States border crossing.
CaUsConnexion = 19,
/// Canada to United States border crossing.
CaUsNexusCard = 20,
/// Indonesia.
/// E-card provided by multiple banks used to pay for tolls. All e-cards
/// via banks are charged the same so only one enum value is needed. E.g.
/// - Bank Mandiri <https://www.bankmandiri.co.id/e-money>
/// - BCA <https://www.bca.co.id/flazz>
/// - BNI <https://www.bni.co.id/id-id/ebanking/tapcash>
IdEToll = 16,
/// India.
InFastag = 78,
/// India, HP state plate exemption.
InLocalHpPlateExempt = 79,
/// Japan
/// ETC. Electronic wireless system to collect tolls.
/// <https://www.go-etc.jp/>
JpEtc = 98,
/// Japan
/// ETC2.0. New version of ETC with further discount and bidirectional
/// communication between devices on vehicles and antennas on the road.
/// <https://www.go-etc.jp/etc2/index.html>
JpEtc2 = 99,
/// Mexico toll pass.
/// <https://iave.capufe.gob.mx/#/>
MxIave = 90,
/// Mexico
/// <https://www.pase.com.mx>
MxPase = 91,
/// Mexico
/// <https://operadoravial.com/quick-pass/>
MxQuickpass = 93,
/// <http://appsh.chihuahua.gob.mx/transparencia/?doc=/ingresos/TelepeajeFormato4.pdf>
MxSistemaTelepeajeChihuahua = 89,
/// Mexico
MxTagIave = 12,
/// Mexico toll pass company. One of many operating in Mexico City. See
/// additional details at <https://www.televia.com.mx.>
MxTagTelevia = 13,
/// Mexico toll pass company. One of many operating in Mexico City.
/// <https://www.televia.com.mx>
MxTelevia = 92,
/// Mexico toll pass. See additional details at
/// <https://www.viapass.com.mx/viapass/web_home.aspx.>
MxViapass = 14,
/// AL, USA.
UsAlFreedomPass = 21,
/// AK, USA.
UsAkAntonAndersonTunnelBookOf10Tickets = 22,
/// CA, USA.
UsCaFastrak = 4,
/// Indicates driver has any FasTrak pass in addition to the DMV issued Clean
/// Air Vehicle (CAV) sticker.
/// <https://www.bayareafastrak.org/en/guide/doINeedFlex.shtml>
UsCaFastrakCavSticker = 86,
/// CO, USA.
UsCoExpresstoll = 23,
/// CO, USA.
UsCoGoPass = 24,
/// DE, USA.
UsDeEzpassde = 25,
/// FL, USA.
UsFlBobSikesTollBridgePass = 65,
/// FL, USA.
UsFlDunesCommunityDevelopmentDistrictExpresscard = 66,
/// FL, USA.
UsFlEpass = 67,
/// FL, USA.
UsFlGibaTollPass = 68,
/// FL, USA.
UsFlLeeway = 69,
/// FL, USA.
UsFlSunpass = 70,
/// FL, USA.
UsFlSunpassPro = 71,
/// IL, USA.
UsIlEzpassil = 73,
/// IL, USA.
UsIlIpass = 72,
/// IN, USA.
UsInEzpassin = 26,
/// KS, USA.
UsKsBestpassHorizon = 27,
/// KS, USA.
UsKsKtag = 28,
/// KS, USA.
UsKsNationalpass = 29,
/// KS, USA.
UsKsPrepassElitepass = 30,
/// KY, USA.
UsKyRiverlink = 31,
/// LA, USA.
UsLaGeauxpass = 32,
/// LA, USA.
UsLaTollTag = 33,
/// MA, USA.
UsMaEzpassma = 6,
/// MD, USA.
UsMdEzpassmd = 34,
/// ME, USA.
UsMeEzpassme = 35,
/// MI, USA.
UsMiAmbassadorBridgePremierCommuterCard = 36,
/// MI, USA.
UsMiBcpass = 94,
/// MI, USA.
UsMiGrosseIleTollBridgePassTag = 37,
/// MI, USA.
/// Deprecated as this pass type no longer exists.
UsMiIqProxCard = 38,
/// MI, USA.
UsMiIqTag = 95,
/// MI, USA.
UsMiMackinacBridgeMacPass = 39,
/// MI, USA.
UsMiNexpressToll = 40,
/// MN, USA.
UsMnEzpassmn = 41,
/// NC, USA.
UsNcEzpassnc = 42,
/// NC, USA.
UsNcPeachPass = 87,
/// NC, USA.
UsNcQuickPass = 43,
/// NH, USA.
UsNhEzpassnh = 80,
/// NJ, USA.
UsNjDownbeachExpressPass = 75,
/// NJ, USA.
UsNjEzpassnj = 74,
/// NY, USA.
UsNyExpresspass = 76,
/// NY, USA.
UsNyEzpassny = 77,
/// OH, USA.
UsOhEzpassoh = 44,
/// PA, USA.
UsPaEzpasspa = 45,
/// RI, USA.
UsRiEzpassri = 46,
/// SC, USA.
UsScPalpass = 47,
/// TX, USA.
UsTxAviTag = 97,
/// TX, USA.
UsTxBancpass = 48,
/// TX, USA.
UsTxDelRioPass = 49,
/// TX, USA.
UsTxEfastPass = 50,
/// TX, USA.
UsTxEaglePassExpressCard = 51,
/// TX, USA.
UsTxEptoll = 52,
/// TX, USA.
UsTxEzCross = 53,
/// TX, USA.
UsTxEztag = 54,
/// TX, USA.
UsTxFuegoTag = 96,
/// TX, USA.
UsTxLaredoTradeTag = 55,
/// TX, USA.
UsTxPluspass = 56,
/// TX, USA.
UsTxTolltag = 57,
/// TX, USA.
UsTxTxtag = 58,
/// TX, USA.
UsTxXpressCard = 59,
/// UT, USA.
UsUtAdamsAveParkwayExpresscard = 60,
/// VA, USA.
UsVaEzpassva = 61,
/// WA, USA.
UsWaBreezeby = 17,
/// WA, USA.
UsWaGoodToGo = 1,
/// WV, USA.
UsWvEzpasswv = 62,
/// WV, USA.
UsWvMemorialBridgeTickets = 63,
/// WV, USA
UsWvMovPass = 100,
/// WV, USA.
UsWvNewellTollBridgeTicket = 64,
}
impl TollPass {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TollPass::Unspecified => "TOLL_PASS_UNSPECIFIED",
TollPass::AuEtollTag => "AU_ETOLL_TAG",
TollPass::AuEwayTag => "AU_EWAY_TAG",
TollPass::AuLinkt => "AU_LINKT",
TollPass::ArTelepase => "AR_TELEPASE",
TollPass::BrAutoExpreso => "BR_AUTO_EXPRESO",
TollPass::BrConectcar => "BR_CONECTCAR",
TollPass::BrMoveMais => "BR_MOVE_MAIS",
TollPass::BrPassaRapido => "BR_PASSA_RAPIDO",
TollPass::BrSemParar => "BR_SEM_PARAR",
TollPass::BrTaggy => "BR_TAGGY",
TollPass::BrVeloe => "BR_VELOE",
TollPass::CaUsAkwasasneSeawayCorporateCard => {
"CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD"
}
TollPass::CaUsAkwasasneSeawayTransitCard => {
"CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD"
}
TollPass::CaUsBlueWaterEdgePass => "CA_US_BLUE_WATER_EDGE_PASS",
TollPass::CaUsConnexion => "CA_US_CONNEXION",
TollPass::CaUsNexusCard => "CA_US_NEXUS_CARD",
TollPass::IdEToll => "ID_E_TOLL",
TollPass::InFastag => "IN_FASTAG",
TollPass::InLocalHpPlateExempt => "IN_LOCAL_HP_PLATE_EXEMPT",
TollPass::JpEtc => "JP_ETC",
TollPass::JpEtc2 => "JP_ETC2",
TollPass::MxIave => "MX_IAVE",
TollPass::MxPase => "MX_PASE",
TollPass::MxQuickpass => "MX_QUICKPASS",
TollPass::MxSistemaTelepeajeChihuahua => "MX_SISTEMA_TELEPEAJE_CHIHUAHUA",
TollPass::MxTagIave => "MX_TAG_IAVE",
TollPass::MxTagTelevia => "MX_TAG_TELEVIA",
TollPass::MxTelevia => "MX_TELEVIA",
TollPass::MxViapass => "MX_VIAPASS",
TollPass::UsAlFreedomPass => "US_AL_FREEDOM_PASS",
TollPass::UsAkAntonAndersonTunnelBookOf10Tickets => {
"US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS"
}
TollPass::UsCaFastrak => "US_CA_FASTRAK",
TollPass::UsCaFastrakCavSticker => "US_CA_FASTRAK_CAV_STICKER",
TollPass::UsCoExpresstoll => "US_CO_EXPRESSTOLL",
TollPass::UsCoGoPass => "US_CO_GO_PASS",
TollPass::UsDeEzpassde => "US_DE_EZPASSDE",
TollPass::UsFlBobSikesTollBridgePass => "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS",
TollPass::UsFlDunesCommunityDevelopmentDistrictExpresscard => {
"US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD"
}
TollPass::UsFlEpass => "US_FL_EPASS",
TollPass::UsFlGibaTollPass => "US_FL_GIBA_TOLL_PASS",
TollPass::UsFlLeeway => "US_FL_LEEWAY",
TollPass::UsFlSunpass => "US_FL_SUNPASS",
TollPass::UsFlSunpassPro => "US_FL_SUNPASS_PRO",
TollPass::UsIlEzpassil => "US_IL_EZPASSIL",
TollPass::UsIlIpass => "US_IL_IPASS",
TollPass::UsInEzpassin => "US_IN_EZPASSIN",
TollPass::UsKsBestpassHorizon => "US_KS_BESTPASS_HORIZON",
TollPass::UsKsKtag => "US_KS_KTAG",
TollPass::UsKsNationalpass => "US_KS_NATIONALPASS",
TollPass::UsKsPrepassElitepass => "US_KS_PREPASS_ELITEPASS",
TollPass::UsKyRiverlink => "US_KY_RIVERLINK",
TollPass::UsLaGeauxpass => "US_LA_GEAUXPASS",
TollPass::UsLaTollTag => "US_LA_TOLL_TAG",
TollPass::UsMaEzpassma => "US_MA_EZPASSMA",
TollPass::UsMdEzpassmd => "US_MD_EZPASSMD",
TollPass::UsMeEzpassme => "US_ME_EZPASSME",
TollPass::UsMiAmbassadorBridgePremierCommuterCard => {
"US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD"
}
TollPass::UsMiBcpass => "US_MI_BCPASS",
TollPass::UsMiGrosseIleTollBridgePassTag => {
"US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG"
}
TollPass::UsMiIqProxCard => "US_MI_IQ_PROX_CARD",
TollPass::UsMiIqTag => "US_MI_IQ_TAG",
TollPass::UsMiMackinacBridgeMacPass => "US_MI_MACKINAC_BRIDGE_MAC_PASS",
TollPass::UsMiNexpressToll => "US_MI_NEXPRESS_TOLL",
TollPass::UsMnEzpassmn => "US_MN_EZPASSMN",
TollPass::UsNcEzpassnc => "US_NC_EZPASSNC",
TollPass::UsNcPeachPass => "US_NC_PEACH_PASS",
TollPass::UsNcQuickPass => "US_NC_QUICK_PASS",
TollPass::UsNhEzpassnh => "US_NH_EZPASSNH",
TollPass::UsNjDownbeachExpressPass => "US_NJ_DOWNBEACH_EXPRESS_PASS",
TollPass::UsNjEzpassnj => "US_NJ_EZPASSNJ",
TollPass::UsNyExpresspass => "US_NY_EXPRESSPASS",
TollPass::UsNyEzpassny => "US_NY_EZPASSNY",
TollPass::UsOhEzpassoh => "US_OH_EZPASSOH",
TollPass::UsPaEzpasspa => "US_PA_EZPASSPA",
TollPass::UsRiEzpassri => "US_RI_EZPASSRI",
TollPass::UsScPalpass => "US_SC_PALPASS",
TollPass::UsTxAviTag => "US_TX_AVI_TAG",
TollPass::UsTxBancpass => "US_TX_BANCPASS",
TollPass::UsTxDelRioPass => "US_TX_DEL_RIO_PASS",
TollPass::UsTxEfastPass => "US_TX_EFAST_PASS",
TollPass::UsTxEaglePassExpressCard => "US_TX_EAGLE_PASS_EXPRESS_CARD",
TollPass::UsTxEptoll => "US_TX_EPTOLL",
TollPass::UsTxEzCross => "US_TX_EZ_CROSS",
TollPass::UsTxEztag => "US_TX_EZTAG",
TollPass::UsTxFuegoTag => "US_TX_FUEGO_TAG",
TollPass::UsTxLaredoTradeTag => "US_TX_LAREDO_TRADE_TAG",
TollPass::UsTxPluspass => "US_TX_PLUSPASS",
TollPass::UsTxTolltag => "US_TX_TOLLTAG",
TollPass::UsTxTxtag => "US_TX_TXTAG",
TollPass::UsTxXpressCard => "US_TX_XPRESS_CARD",
TollPass::UsUtAdamsAveParkwayExpresscard => {
"US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD"
}
TollPass::UsVaEzpassva => "US_VA_EZPASSVA",
TollPass::UsWaBreezeby => "US_WA_BREEZEBY",
TollPass::UsWaGoodToGo => "US_WA_GOOD_TO_GO",
TollPass::UsWvEzpasswv => "US_WV_EZPASSWV",
TollPass::UsWvMemorialBridgeTickets => "US_WV_MEMORIAL_BRIDGE_TICKETS",
TollPass::UsWvMovPass => "US_WV_MOV_PASS",
TollPass::UsWvNewellTollBridgeTicket => "US_WV_NEWELL_TOLL_BRIDGE_TICKET",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TOLL_PASS_UNSPECIFIED" => Some(Self::Unspecified),
"AU_ETOLL_TAG" => Some(Self::AuEtollTag),
"AU_EWAY_TAG" => Some(Self::AuEwayTag),
"AU_LINKT" => Some(Self::AuLinkt),
"AR_TELEPASE" => Some(Self::ArTelepase),
"BR_AUTO_EXPRESO" => Some(Self::BrAutoExpreso),
"BR_CONECTCAR" => Some(Self::BrConectcar),
"BR_MOVE_MAIS" => Some(Self::BrMoveMais),
"BR_PASSA_RAPIDO" => Some(Self::BrPassaRapido),
"BR_SEM_PARAR" => Some(Self::BrSemParar),
"BR_TAGGY" => Some(Self::BrTaggy),
"BR_VELOE" => Some(Self::BrVeloe),
"CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD" => {
Some(Self::CaUsAkwasasneSeawayCorporateCard)
}
"CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD" => {
Some(Self::CaUsAkwasasneSeawayTransitCard)
}
"CA_US_BLUE_WATER_EDGE_PASS" => Some(Self::CaUsBlueWaterEdgePass),
"CA_US_CONNEXION" => Some(Self::CaUsConnexion),
"CA_US_NEXUS_CARD" => Some(Self::CaUsNexusCard),
"ID_E_TOLL" => Some(Self::IdEToll),
"IN_FASTAG" => Some(Self::InFastag),
"IN_LOCAL_HP_PLATE_EXEMPT" => Some(Self::InLocalHpPlateExempt),
"JP_ETC" => Some(Self::JpEtc),
"JP_ETC2" => Some(Self::JpEtc2),
"MX_IAVE" => Some(Self::MxIave),
"MX_PASE" => Some(Self::MxPase),
"MX_QUICKPASS" => Some(Self::MxQuickpass),
"MX_SISTEMA_TELEPEAJE_CHIHUAHUA" => Some(Self::MxSistemaTelepeajeChihuahua),
"MX_TAG_IAVE" => Some(Self::MxTagIave),
"MX_TAG_TELEVIA" => Some(Self::MxTagTelevia),
"MX_TELEVIA" => Some(Self::MxTelevia),
"MX_VIAPASS" => Some(Self::MxViapass),
"US_AL_FREEDOM_PASS" => Some(Self::UsAlFreedomPass),
"US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS" => {
Some(Self::UsAkAntonAndersonTunnelBookOf10Tickets)
}
"US_CA_FASTRAK" => Some(Self::UsCaFastrak),
"US_CA_FASTRAK_CAV_STICKER" => Some(Self::UsCaFastrakCavSticker),
"US_CO_EXPRESSTOLL" => Some(Self::UsCoExpresstoll),
"US_CO_GO_PASS" => Some(Self::UsCoGoPass),
"US_DE_EZPASSDE" => Some(Self::UsDeEzpassde),
"US_FL_BOB_SIKES_TOLL_BRIDGE_PASS" => Some(Self::UsFlBobSikesTollBridgePass),
"US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD" => {
Some(Self::UsFlDunesCommunityDevelopmentDistrictExpresscard)
}
"US_FL_EPASS" => Some(Self::UsFlEpass),
"US_FL_GIBA_TOLL_PASS" => Some(Self::UsFlGibaTollPass),
"US_FL_LEEWAY" => Some(Self::UsFlLeeway),
"US_FL_SUNPASS" => Some(Self::UsFlSunpass),
"US_FL_SUNPASS_PRO" => Some(Self::UsFlSunpassPro),
"US_IL_EZPASSIL" => Some(Self::UsIlEzpassil),
"US_IL_IPASS" => Some(Self::UsIlIpass),
"US_IN_EZPASSIN" => Some(Self::UsInEzpassin),
"US_KS_BESTPASS_HORIZON" => Some(Self::UsKsBestpassHorizon),
"US_KS_KTAG" => Some(Self::UsKsKtag),
"US_KS_NATIONALPASS" => Some(Self::UsKsNationalpass),
"US_KS_PREPASS_ELITEPASS" => Some(Self::UsKsPrepassElitepass),
"US_KY_RIVERLINK" => Some(Self::UsKyRiverlink),
"US_LA_GEAUXPASS" => Some(Self::UsLaGeauxpass),
"US_LA_TOLL_TAG" => Some(Self::UsLaTollTag),
"US_MA_EZPASSMA" => Some(Self::UsMaEzpassma),
"US_MD_EZPASSMD" => Some(Self::UsMdEzpassmd),
"US_ME_EZPASSME" => Some(Self::UsMeEzpassme),
"US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD" => {
Some(Self::UsMiAmbassadorBridgePremierCommuterCard)
}
"US_MI_BCPASS" => Some(Self::UsMiBcpass),
"US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG" => {
Some(Self::UsMiGrosseIleTollBridgePassTag)
}
"US_MI_IQ_PROX_CARD" => Some(Self::UsMiIqProxCard),
"US_MI_IQ_TAG" => Some(Self::UsMiIqTag),
"US_MI_MACKINAC_BRIDGE_MAC_PASS" => Some(Self::UsMiMackinacBridgeMacPass),
"US_MI_NEXPRESS_TOLL" => Some(Self::UsMiNexpressToll),
"US_MN_EZPASSMN" => Some(Self::UsMnEzpassmn),
"US_NC_EZPASSNC" => Some(Self::UsNcEzpassnc),
"US_NC_PEACH_PASS" => Some(Self::UsNcPeachPass),
"US_NC_QUICK_PASS" => Some(Self::UsNcQuickPass),
"US_NH_EZPASSNH" => Some(Self::UsNhEzpassnh),
"US_NJ_DOWNBEACH_EXPRESS_PASS" => Some(Self::UsNjDownbeachExpressPass),
"US_NJ_EZPASSNJ" => Some(Self::UsNjEzpassnj),
"US_NY_EXPRESSPASS" => Some(Self::UsNyExpresspass),
"US_NY_EZPASSNY" => Some(Self::UsNyEzpassny),
"US_OH_EZPASSOH" => Some(Self::UsOhEzpassoh),
"US_PA_EZPASSPA" => Some(Self::UsPaEzpasspa),
"US_RI_EZPASSRI" => Some(Self::UsRiEzpassri),
"US_SC_PALPASS" => Some(Self::UsScPalpass),
"US_TX_AVI_TAG" => Some(Self::UsTxAviTag),
"US_TX_BANCPASS" => Some(Self::UsTxBancpass),
"US_TX_DEL_RIO_PASS" => Some(Self::UsTxDelRioPass),
"US_TX_EFAST_PASS" => Some(Self::UsTxEfastPass),
"US_TX_EAGLE_PASS_EXPRESS_CARD" => Some(Self::UsTxEaglePassExpressCard),
"US_TX_EPTOLL" => Some(Self::UsTxEptoll),
"US_TX_EZ_CROSS" => Some(Self::UsTxEzCross),
"US_TX_EZTAG" => Some(Self::UsTxEztag),
"US_TX_FUEGO_TAG" => Some(Self::UsTxFuegoTag),
"US_TX_LAREDO_TRADE_TAG" => Some(Self::UsTxLaredoTradeTag),
"US_TX_PLUSPASS" => Some(Self::UsTxPluspass),
"US_TX_TOLLTAG" => Some(Self::UsTxTolltag),
"US_TX_TXTAG" => Some(Self::UsTxTxtag),
"US_TX_XPRESS_CARD" => Some(Self::UsTxXpressCard),
"US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD" => {
Some(Self::UsUtAdamsAveParkwayExpresscard)
}
"US_VA_EZPASSVA" => Some(Self::UsVaEzpassva),
"US_WA_BREEZEBY" => Some(Self::UsWaBreezeby),
"US_WA_GOOD_TO_GO" => Some(Self::UsWaGoodToGo),
"US_WV_EZPASSWV" => Some(Self::UsWvEzpasswv),
"US_WV_MEMORIAL_BRIDGE_TICKETS" => Some(Self::UsWvMemorialBridgeTickets),
"US_WV_MOV_PASS" => Some(Self::UsWvMovPass),
"US_WV_NEWELL_TOLL_BRIDGE_TICKET" => Some(Self::UsWvNewellTollBridgeTicket),
_ => None,
}
}
}
/// Encapsulates a set of optional conditions to satisfy when calculating the
/// routes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteModifiers {
/// When set to true, avoids toll roads where reasonable, giving preference to
/// routes not containing toll roads. Applies only to the `DRIVE` and
/// `TWO_WHEELER` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[prost(bool, tag = "1")]
pub avoid_tolls: bool,
/// When set to true, avoids highways where reasonable, giving preference to
/// routes not containing highways. Applies only to the `DRIVE` and
/// `TWO_WHEELER` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[prost(bool, tag = "2")]
pub avoid_highways: bool,
/// When set to true, avoids ferries where reasonable, giving preference to
/// routes not containing ferries. Applies only to the `DRIVE` and`TWO_WHEELER`
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[prost(bool, tag = "3")]
pub avoid_ferries: bool,
/// When set to true, avoids navigating indoors where reasonable, giving
/// preference to routes not containing indoor navigation. Applies only to the
/// `WALK` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[prost(bool, tag = "4")]
pub avoid_indoor: bool,
/// Specifies the vehicle information.
#[prost(message, optional, tag = "5")]
pub vehicle_info: ::core::option::Option<VehicleInfo>,
/// Encapsulates information about toll passes.
/// If toll passes are provided, the API tries to return the pass price. If
/// toll passes are not provided, the API treats the toll pass as unknown and
/// tries to return the cash price.
/// Applies only to the `DRIVE` and `TWO_WHEELER`
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[prost(enumeration = "TollPass", repeated, tag = "6")]
pub toll_passes: ::prost::alloc::vec::Vec<i32>,
}
/// A set of values that specify factors to take into consideration when
/// calculating the route.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RoutingPreference {
/// No routing preference specified. Default to `TRAFFIC_UNAWARE`.
Unspecified = 0,
/// Computes routes without taking live traffic conditions into consideration.
/// Suitable when traffic conditions don't matter or are not applicable.
/// Using this value produces the lowest latency.
/// Note: For [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]
/// `DRIVE` and `TWO_WHEELER`, the route and duration chosen are based on road
/// network and average time-independent traffic conditions, not current road
/// conditions. Consequently, routes may include roads that are temporarily
/// closed. Results for a given
/// request may vary over time due to changes in the road network, updated
/// average traffic conditions, and the distributed nature of the service.
/// Results may also vary between nearly-equivalent routes at any time or
/// frequency.
TrafficUnaware = 1,
/// Calculates routes taking live traffic conditions into consideration.
/// In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to
/// significantly reduce latency.
TrafficAware = 2,
/// Calculates the routes taking live traffic conditions into consideration,
/// without applying most performance optimizations. Using this value produces
/// the highest latency.
TrafficAwareOptimal = 3,
}
impl RoutingPreference {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
RoutingPreference::Unspecified => "ROUTING_PREFERENCE_UNSPECIFIED",
RoutingPreference::TrafficUnaware => "TRAFFIC_UNAWARE",
RoutingPreference::TrafficAware => "TRAFFIC_AWARE",
RoutingPreference::TrafficAwareOptimal => "TRAFFIC_AWARE_OPTIMAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ROUTING_PREFERENCE_UNSPECIFIED" => Some(Self::Unspecified),
"TRAFFIC_UNAWARE" => Some(Self::TrafficUnaware),
"TRAFFIC_AWARE" => Some(Self::TrafficAware),
"TRAFFIC_AWARE_OPTIMAL" => Some(Self::TrafficAwareOptimal),
_ => None,
}
}
}
/// Specifies the assumptions to use when calculating time in traffic. This
/// setting affects the value returned in the `duration` field in the
/// response, which contains the predicted time in traffic based on historical
/// averages.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrafficModel {
/// Unused. If specified, will default to `BEST_GUESS`.
Unspecified = 0,
/// Indicates that the returned `duration` should be the best
/// estimate of travel time given what is known about both historical traffic
/// conditions and live traffic. Live traffic becomes more important the closer
/// the `departure_time` is to now.
BestGuess = 1,
/// Indicates that the returned duration should be longer than the
/// actual travel time on most days, though occasional days with particularly
/// bad traffic conditions may exceed this value.
Pessimistic = 2,
/// Indicates that the returned duration should be shorter than the actual
/// travel time on most days, though occasional days with particularly good
/// traffic conditions may be faster than this value.
Optimistic = 3,
}
impl TrafficModel {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TrafficModel::Unspecified => "TRAFFIC_MODEL_UNSPECIFIED",
TrafficModel::BestGuess => "BEST_GUESS",
TrafficModel::Pessimistic => "PESSIMISTIC",
TrafficModel::Optimistic => "OPTIMISTIC",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRAFFIC_MODEL_UNSPECIFIED" => Some(Self::Unspecified),
"BEST_GUESS" => Some(Self::BestGuess),
"PESSIMISTIC" => Some(Self::Pessimistic),
"OPTIMISTIC" => Some(Self::Optimistic),
_ => None,
}
}
}
/// Preferences for `TRANSIT` based routes that influence the route that is
/// returned.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitPreferences {
/// A set of travel modes to use when getting a `TRANSIT` route. Defaults to
/// all supported modes of travel.
#[prost(enumeration = "transit_preferences::TransitTravelMode", repeated, tag = "1")]
pub allowed_travel_modes: ::prost::alloc::vec::Vec<i32>,
/// A routing preference that, when specified, influences the `TRANSIT` route
/// returned.
#[prost(enumeration = "transit_preferences::TransitRoutingPreference", tag = "2")]
pub routing_preference: i32,
}
/// Nested message and enum types in `TransitPreferences`.
pub mod transit_preferences {
/// A set of values used to specify the mode of transit.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TransitTravelMode {
/// No transit travel mode specified.
Unspecified = 0,
/// Travel by bus.
Bus = 1,
/// Travel by subway.
Subway = 2,
/// Travel by train.
Train = 3,
/// Travel by light rail or tram.
LightRail = 4,
/// Travel by rail. This is equivalent to a combination of `SUBWAY`, `TRAIN`,
/// and `LIGHT_RAIL`.
Rail = 5,
}
impl TransitTravelMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TransitTravelMode::Unspecified => "TRANSIT_TRAVEL_MODE_UNSPECIFIED",
TransitTravelMode::Bus => "BUS",
TransitTravelMode::Subway => "SUBWAY",
TransitTravelMode::Train => "TRAIN",
TransitTravelMode::LightRail => "LIGHT_RAIL",
TransitTravelMode::Rail => "RAIL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSIT_TRAVEL_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"BUS" => Some(Self::Bus),
"SUBWAY" => Some(Self::Subway),
"TRAIN" => Some(Self::Train),
"LIGHT_RAIL" => Some(Self::LightRail),
"RAIL" => Some(Self::Rail),
_ => None,
}
}
}
/// Specifies routing preferences for transit routes.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TransitRoutingPreference {
/// No preference specified.
Unspecified = 0,
/// Indicates that the calculated route should prefer limited amounts of
/// walking.
LessWalking = 1,
/// Indicates that the calculated route should prefer a limited number of
/// transfers.
FewerTransfers = 2,
}
impl TransitRoutingPreference {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TransitRoutingPreference::Unspecified => {
"TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED"
}
TransitRoutingPreference::LessWalking => "LESS_WALKING",
TransitRoutingPreference::FewerTransfers => "FEWER_TRANSFERS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED" => Some(Self::Unspecified),
"LESS_WALKING" => Some(Self::LessWalking),
"FEWER_TRANSFERS" => Some(Self::FewerTransfers),
_ => None,
}
}
}
}
/// A set of values that specify the unit of measure used in the display.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Units {
/// Units of measure not specified. Defaults to the unit of measure inferred
/// from the request.
Unspecified = 0,
/// Metric units of measure.
Metric = 1,
/// Imperial (English) units of measure.
Imperial = 2,
}
impl Units {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Units::Unspecified => "UNITS_UNSPECIFIED",
Units::Metric => "METRIC",
Units::Imperial => "IMPERIAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNITS_UNSPECIFIED" => Some(Self::Unspecified),
"METRIC" => Some(Self::Metric),
"IMPERIAL" => Some(Self::Imperial),
_ => None,
}
}
}
/// Encapsulates a waypoint. Waypoints mark both the beginning and end of a
/// route, and include intermediate stops along the route.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Waypoint {
/// Marks this waypoint as a milestone rather a stopping point. For
/// each non-via waypoint in the request, the response appends an entry to the
/// [`legs`][google.maps.routing.v2.Route.legs]
/// array to provide the details for stopovers on that leg of the trip. Set
/// this value to true when you want the route to pass through this waypoint
/// without stopping over. Via waypoints don't cause an entry to be added to
/// the `legs` array, but they do route the journey through the waypoint. You
/// can only set this value on waypoints that are intermediates. The request
/// fails if you set this field on terminal waypoints. If
/// `ComputeRoutesRequest.optimize_waypoint_order` is set to true then this
/// field cannot be set to true; otherwise, the request fails.
#[prost(bool, tag = "3")]
pub via: bool,
/// Indicates that the waypoint is meant for vehicles to stop at, where the
/// intention is to either pickup or drop-off. When you set this value, the
/// calculated route won't include non-`via` waypoints on roads that are
/// unsuitable for pickup and drop-off. This option works only for `DRIVE` and
/// `TWO_WHEELER` travel modes, and when the `location_type` is
/// [`Location`][google.maps.routing.v2.Location].
#[prost(bool, tag = "4")]
pub vehicle_stopover: bool,
/// Indicates that the location of this waypoint is meant to have a preference
/// for the vehicle to stop at a particular side of road. When you set this
/// value, the route will pass through the location so that the vehicle can
/// stop at the side of road that the location is biased towards from the
/// center of the road. This option works only for `DRIVE` and `TWO_WHEELER`
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode].
#[prost(bool, tag = "5")]
pub side_of_road: bool,
/// Different ways to represent a location.
#[prost(oneof = "waypoint::LocationType", tags = "1, 2, 7")]
pub location_type: ::core::option::Option<waypoint::LocationType>,
}
/// Nested message and enum types in `Waypoint`.
pub mod waypoint {
/// Different ways to represent a location.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum LocationType {
/// A point specified using geographic coordinates, including an optional
/// heading.
#[prost(message, tag = "1")]
Location(super::Location),
/// The POI Place ID associated with the waypoint.
#[prost(string, tag = "2")]
PlaceId(::prost::alloc::string::String),
/// Human readable address or a plus code.
/// See <https://plus.codes> for details.
#[prost(string, tag = "7")]
Address(::prost::alloc::string::String),
}
}
/// ComputeRoutes request message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComputeRoutesRequest {
/// Required. Origin waypoint.
#[prost(message, optional, tag = "1")]
pub origin: ::core::option::Option<Waypoint>,
/// Required. Destination waypoint.
#[prost(message, optional, tag = "2")]
pub destination: ::core::option::Option<Waypoint>,
/// Optional. A set of waypoints along the route (excluding terminal points),
/// for either stopping at or passing by. Up to 25 intermediate waypoints are
/// supported.
#[prost(message, repeated, tag = "3")]
pub intermediates: ::prost::alloc::vec::Vec<Waypoint>,
/// Optional. Specifies the mode of transportation.
#[prost(enumeration = "RouteTravelMode", tag = "4")]
pub travel_mode: i32,
/// Optional. Specifies how to compute the route. The server
/// attempts to use the selected routing preference to compute the route. If
/// the routing preference results in an error or an extra long latency, then
/// an error is returned. You can specify this option only when the
/// `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
#[prost(enumeration = "RoutingPreference", tag = "5")]
pub routing_preference: i32,
/// Optional. Specifies your preference for the quality of the polyline.
#[prost(enumeration = "PolylineQuality", tag = "6")]
pub polyline_quality: i32,
/// Optional. Specifies the preferred encoding for the polyline.
#[prost(enumeration = "PolylineEncoding", tag = "12")]
pub polyline_encoding: i32,
/// Optional. The departure time. If you don't set this value, then this value
/// defaults to the time that you made the request.
/// NOTE: You can only specify a `departure_time` in the past when
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to
/// `TRANSIT`. Transit trips are available for up to 7 days in the past or 100
/// days in the future.
#[prost(message, optional, tag = "7")]
pub departure_time: ::core::option::Option<::prost_types::Timestamp>,
/// Optional. The arrival time.
/// NOTE: Can only be set when
/// [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to
/// `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but
/// not both. Transit trips are available for up to 7 days in the past or 100
/// days in the future.
#[prost(message, optional, tag = "19")]
pub arrival_time: ::core::option::Option<::prost_types::Timestamp>,
/// Optional. Specifies whether to calculate alternate routes in addition to
/// the route. No alternative routes are returned for requests that have
/// intermediate waypoints.
#[prost(bool, tag = "8")]
pub compute_alternative_routes: bool,
/// Optional. A set of conditions to satisfy that affect the way routes are
/// calculated.
#[prost(message, optional, tag = "9")]
pub route_modifiers: ::core::option::Option<RouteModifiers>,
/// Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
/// information, see [Unicode Locale
/// Identifier](<http://www.unicode.org/reports/tr35/#Unicode_locale_identifier>).
/// See [Language
/// Support](<https://developers.google.com/maps/faq#languagesupport>)
/// for the list of supported languages. When you don't provide this value, the
/// display language is inferred from the location of the route request.
#[prost(string, tag = "10")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The region code, specified as a ccTLD ("top-level domain")
/// two-character value. For more information see [Country code top-level
/// domains](<https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains>).
#[prost(string, tag = "16")]
pub region_code: ::prost::alloc::string::String,
/// Optional. Specifies the units of measure for the display fields. These
/// fields include the `instruction` field in
/// [`NavigationInstruction`][google.maps.routing.v2.NavigationInstruction].
/// The units of measure used for the route, leg, step distance, and duration
/// are not affected by this value. If you don't provide this value, then the
/// display units are inferred from the location of the first origin.
#[prost(enumeration = "Units", tag = "11")]
pub units: i32,
/// Optional. If set to true, the service attempts to minimize the overall cost
/// of the route by re-ordering the specified intermediate waypoints. The
/// request fails if any of the intermediate waypoints is a `via` waypoint. Use
/// `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to
/// find the new ordering.
/// If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is
/// not requested in the `X-Goog-FieldMask` header, the request fails.
/// If `optimize_waypoint_order` is set to false,
/// `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be
/// empty.
#[prost(bool, tag = "13")]
pub optimize_waypoint_order: bool,
/// Optional. Specifies what reference routes to calculate as part of the
/// request in addition to the default route. A reference route is a route with
/// a different route calculation objective than the default route. For example
/// a `FUEL_EFFICIENT` reference route calculation takes into account various
/// parameters that would generate an optimal fuel efficient route.
#[prost(
enumeration = "compute_routes_request::ReferenceRoute",
repeated,
packed = "false",
tag = "14"
)]
pub requested_reference_routes: ::prost::alloc::vec::Vec<i32>,
/// Optional. A list of extra computations which may be used to complete the
/// request. Note: These extra computations may return extra fields on the
/// response. These extra fields must also be specified in the field mask to be
/// returned in the response.
#[prost(
enumeration = "compute_routes_request::ExtraComputation",
repeated,
packed = "false",
tag = "15"
)]
pub extra_computations: ::prost::alloc::vec::Vec<i32>,
/// Optional. Specifies the assumptions to use when calculating time in
/// traffic. This setting affects the value returned in the duration field in
/// the
/// [`Route`][google.maps.routing.v2.Route] and
/// [`RouteLeg`][google.maps.routing.v2.RouteLeg] which contains the predicted
/// time in traffic based on historical averages.
/// `TrafficModel` is only available for requests that have set
/// [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] to
/// `TRAFFIC_AWARE_OPTIMAL` and
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] to `DRIVE`.
/// Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
/// specified.
#[prost(enumeration = "TrafficModel", tag = "18")]
pub traffic_model: i32,
/// Optional. Specifies preferences that influence the route returned for
/// `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to
/// `TRANSIT`.
#[prost(message, optional, tag = "20")]
pub transit_preferences: ::core::option::Option<TransitPreferences>,
}
/// Nested message and enum types in `ComputeRoutesRequest`.
pub mod compute_routes_request {
/// A supported reference route on the ComputeRoutesRequest.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ReferenceRoute {
/// Not used. Requests containing this value fail.
Unspecified = 0,
/// Fuel efficient route. Routes labeled with this value are determined to be
/// optimized for parameters such as fuel consumption.
FuelEfficient = 1,
}
impl ReferenceRoute {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ReferenceRoute::Unspecified => "REFERENCE_ROUTE_UNSPECIFIED",
ReferenceRoute::FuelEfficient => "FUEL_EFFICIENT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"REFERENCE_ROUTE_UNSPECIFIED" => Some(Self::Unspecified),
"FUEL_EFFICIENT" => Some(Self::FuelEfficient),
_ => None,
}
}
}
/// Extra computations to perform while completing the request.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExtraComputation {
/// Not used. Requests containing this value will fail.
Unspecified = 0,
/// Toll information for the route(s).
Tolls = 1,
/// Estimated fuel consumption for the route(s).
FuelConsumption = 2,
/// Traffic aware polylines for the route(s).
TrafficOnPolyline = 3,
/// [`NavigationInstructions`](google.maps.routing.v2.NavigationInstructions.instructions)
/// presented as a formatted HTML text string. This content
/// is meant to be read as-is. This content is for display only.
/// Do not programmatically parse it.
HtmlFormattedNavigationInstructions = 4,
}
impl ExtraComputation {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ExtraComputation::Unspecified => "EXTRA_COMPUTATION_UNSPECIFIED",
ExtraComputation::Tolls => "TOLLS",
ExtraComputation::FuelConsumption => "FUEL_CONSUMPTION",
ExtraComputation::TrafficOnPolyline => "TRAFFIC_ON_POLYLINE",
ExtraComputation::HtmlFormattedNavigationInstructions => {
"HTML_FORMATTED_NAVIGATION_INSTRUCTIONS"
}
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXTRA_COMPUTATION_UNSPECIFIED" => Some(Self::Unspecified),
"TOLLS" => Some(Self::Tolls),
"FUEL_CONSUMPTION" => Some(Self::FuelConsumption),
"TRAFFIC_ON_POLYLINE" => Some(Self::TrafficOnPolyline),
"HTML_FORMATTED_NAVIGATION_INSTRUCTIONS" => {
Some(Self::HtmlFormattedNavigationInstructions)
}
_ => None,
}
}
}
}
/// ComputeRoutes the response message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComputeRoutesResponse {
/// Contains an array of computed routes (up to three) when you specify
/// `compute_alternatives_routes`, and contains just one route when you don't.
/// When this array contains multiple entries, the first one is the most
/// recommended route. If the array is empty, then it means no route could be
/// found.
#[prost(message, repeated, tag = "1")]
pub routes: ::prost::alloc::vec::Vec<Route>,
/// In some cases when the server is not able to compute the route results with
/// all of the input preferences, it may fallback to using a different way of
/// computation. When fallback mode is used, this field contains detailed info
/// about the fallback response. Otherwise this field is unset.
#[prost(message, optional, tag = "2")]
pub fallback_info: ::core::option::Option<FallbackInfo>,
/// Contains geocoding response info for waypoints specified as addresses.
#[prost(message, optional, tag = "3")]
pub geocoding_results: ::core::option::Option<GeocodingResults>,
}
/// ComputeRouteMatrix request message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComputeRouteMatrixRequest {
/// Required. Array of origins, which determines the rows of the response
/// matrix. Several size restrictions apply to the cardinality of origins and
/// destinations:
///
/// * The sum of the number of origins + the number of destinations specified
/// as either `place_id` or `address` must be no greater than 50.
/// * The product of number of origins × number of destinations must be no
/// greater than 625 in any case.
/// * The product of the number of origins × number of destinations must be no
/// greater than 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
/// * The product of the number of origins × number of destinations must be no
/// greater than 100 if travel_mode is set to `TRANSIT`.
#[prost(message, repeated, tag = "1")]
pub origins: ::prost::alloc::vec::Vec<RouteMatrixOrigin>,
/// Required. Array of destinations, which determines the columns of the
/// response matrix.
#[prost(message, repeated, tag = "2")]
pub destinations: ::prost::alloc::vec::Vec<RouteMatrixDestination>,
/// Optional. Specifies the mode of transportation.
#[prost(enumeration = "RouteTravelMode", tag = "3")]
pub travel_mode: i32,
/// Optional. Specifies how to compute the route. The server attempts to use
/// the selected routing preference to compute the route. If the routing
/// preference results in an error or an extra long latency, an error is
/// returned. You can specify this option only when the `travel_mode` is
/// `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
#[prost(enumeration = "RoutingPreference", tag = "4")]
pub routing_preference: i32,
/// Optional. The departure time. If you don't set this value, then this value
/// defaults to the time that you made the request.
/// NOTE: You can only specify a `departure_time` in the past when
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to
/// `TRANSIT`.
#[prost(message, optional, tag = "5")]
pub departure_time: ::core::option::Option<::prost_types::Timestamp>,
/// Optional. The arrival time.
/// NOTE: Can only be set when
/// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to
/// `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but
/// not both.
#[prost(message, optional, tag = "11")]
pub arrival_time: ::core::option::Option<::prost_types::Timestamp>,
/// Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
/// information, see [Unicode Locale
/// Identifier](<http://www.unicode.org/reports/tr35/#Unicode_locale_identifier>).
/// See [Language
/// Support](<https://developers.google.com/maps/faq#languagesupport>)
/// for the list of supported languages. When you don't provide this value, the
/// display language is inferred from the location of the first origin.
#[prost(string, tag = "6")]
pub language_code: ::prost::alloc::string::String,
/// Optional. The region code, specified as a ccTLD ("top-level domain")
/// two-character value. For more information see [Country code top-level
/// domains](<https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains>).
#[prost(string, tag = "9")]
pub region_code: ::prost::alloc::string::String,
/// Optional. Specifies the units of measure for the display fields.
#[prost(enumeration = "Units", tag = "7")]
pub units: i32,
/// Optional. A list of extra computations which may be used to complete the
/// request. Note: These extra computations may return extra fields on the
/// response. These extra fields must also be specified in the field mask to be
/// returned in the response.
#[prost(
enumeration = "compute_route_matrix_request::ExtraComputation",
repeated,
packed = "false",
tag = "8"
)]
pub extra_computations: ::prost::alloc::vec::Vec<i32>,
/// Optional. Specifies the assumptions to use when calculating time in
/// traffic. This setting affects the value returned in the duration field in
/// the [RouteMatrixElement][google.maps.routing.v2.RouteMatrixElement] which
/// contains the predicted time in traffic based on historical averages.
/// [RoutingPreference][google.maps.routing.v2.RoutingPreference] to
/// `TRAFFIC_AWARE_OPTIMAL` and
/// [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] to `DRIVE`.
/// Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
/// specified.
#[prost(enumeration = "TrafficModel", tag = "10")]
pub traffic_model: i32,
/// Optional. Specifies preferences that influence the route returned for
/// `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
/// [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to
/// `TRANSIT`.
#[prost(message, optional, tag = "12")]
pub transit_preferences: ::core::option::Option<TransitPreferences>,
}
/// Nested message and enum types in `ComputeRouteMatrixRequest`.
pub mod compute_route_matrix_request {
/// Extra computations to perform while completing the request.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExtraComputation {
/// Not used. Requests containing this value will fail.
Unspecified = 0,
/// Toll information for the matrix element(s).
Tolls = 1,
}
impl ExtraComputation {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ExtraComputation::Unspecified => "EXTRA_COMPUTATION_UNSPECIFIED",
ExtraComputation::Tolls => "TOLLS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXTRA_COMPUTATION_UNSPECIFIED" => Some(Self::Unspecified),
"TOLLS" => Some(Self::Tolls),
_ => None,
}
}
}
}
/// A single origin for ComputeRouteMatrixRequest
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteMatrixOrigin {
/// Required. Origin waypoint
#[prost(message, optional, tag = "1")]
pub waypoint: ::core::option::Option<Waypoint>,
/// Optional. Modifiers for every route that takes this as the origin
#[prost(message, optional, tag = "2")]
pub route_modifiers: ::core::option::Option<RouteModifiers>,
}
/// A single destination for ComputeRouteMatrixRequest
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteMatrixDestination {
/// Required. Destination waypoint
#[prost(message, optional, tag = "1")]
pub waypoint: ::core::option::Option<Waypoint>,
}
/// Contains route information computed for an origin/destination pair in the
/// ComputeRouteMatrix API. This proto can be streamed to the client.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteMatrixElement {
/// Zero-based index of the origin in the request.
#[prost(int32, optional, tag = "1")]
pub origin_index: ::core::option::Option<i32>,
/// Zero-based index of the destination in the request.
#[prost(int32, optional, tag = "2")]
pub destination_index: ::core::option::Option<i32>,
/// Error status code for this element.
#[prost(message, optional, tag = "3")]
pub status: ::core::option::Option<super::super::super::rpc::Status>,
/// Indicates whether the route was found or not. Independent of status.
#[prost(enumeration = "RouteMatrixElementCondition", tag = "9")]
pub condition: i32,
/// The travel distance of the route, in meters.
#[prost(int32, tag = "4")]
pub distance_meters: i32,
/// The length of time needed to navigate the route. If you set the
/// [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.routing_preference]
/// to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If
/// you set the `routing_preference` to either `TRAFFIC_AWARE` or
/// `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
/// conditions into account.
#[prost(message, optional, tag = "5")]
pub duration: ::core::option::Option<::prost_types::Duration>,
/// The duration of traveling through the route without taking traffic
/// conditions into consideration.
#[prost(message, optional, tag = "6")]
pub static_duration: ::core::option::Option<::prost_types::Duration>,
/// Additional information about the route. For example: restriction
/// information and toll information
#[prost(message, optional, tag = "7")]
pub travel_advisory: ::core::option::Option<RouteTravelAdvisory>,
/// In some cases when the server is not able to compute the route with the
/// given preferences for this particular origin/destination pair, it may
/// fall back to using a different mode of computation. When fallback mode is
/// used, this field contains detailed information about the fallback response.
/// Otherwise this field is unset.
#[prost(message, optional, tag = "8")]
pub fallback_info: ::core::option::Option<FallbackInfo>,
/// Text representations of properties of the `RouteMatrixElement`.
#[prost(message, optional, tag = "10")]
pub localized_values: ::core::option::Option<route_matrix_element::LocalizedValues>,
}
/// Nested message and enum types in `RouteMatrixElement`.
pub mod route_matrix_element {
/// Text representations of certain properties.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocalizedValues {
/// Travel distance represented in text form.
#[prost(message, optional, tag = "1")]
pub distance: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Duration represented in text form taking traffic conditions into
/// consideration. Note: If traffic information was not requested, this value
/// is the same value as static_duration.
#[prost(message, optional, tag = "2")]
pub duration: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Duration represented in text form without taking traffic conditions into
/// consideration.
#[prost(message, optional, tag = "3")]
pub static_duration: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
/// Transit fare represented in text form.
#[prost(message, optional, tag = "4")]
pub transit_fare: ::core::option::Option<
super::super::super::super::r#type::LocalizedText,
>,
}
}
/// The condition of the route being returned.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RouteMatrixElementCondition {
/// Only used when the `status` of the element is not OK.
Unspecified = 0,
/// A route was found, and the corresponding information was filled out for the
/// element.
RouteExists = 1,
/// No route could be found. Fields containing route information, such as
/// `distance_meters` or `duration`, will not be filled out in the element.
RouteNotFound = 2,
}
impl RouteMatrixElementCondition {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
RouteMatrixElementCondition::Unspecified => {
"ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED"
}
RouteMatrixElementCondition::RouteExists => "ROUTE_EXISTS",
RouteMatrixElementCondition::RouteNotFound => "ROUTE_NOT_FOUND",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED" => Some(Self::Unspecified),
"ROUTE_EXISTS" => Some(Self::RouteExists),
"ROUTE_NOT_FOUND" => Some(Self::RouteNotFound),
_ => None,
}
}
}
/// Generated client implementations.
pub mod routes_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// The Routes API.
#[derive(Debug, Clone)]
pub struct RoutesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> RoutesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> RoutesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
RoutesClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Returns the primary route along with optional alternate routes, given a set
/// of terminal and intermediate waypoints.
///
/// **NOTE:** This method requires that you specify a response field mask in
/// the input. You can provide the response field mask by using URL parameter
/// `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask`
/// (see the [available URL parameters and
/// headers](https://cloud.google.com/apis/docs/system-parameters)). The value
/// is a comma separated list of field paths. See detailed documentation about
/// [how to construct the field
/// paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
///
/// For example, in this method:
///
/// * Field mask of all available fields (for manual inspection):
/// `X-Goog-FieldMask: *`
/// * Field mask of Route-level duration, distance, and polyline (an example
/// production setup):
/// `X-Goog-FieldMask:
/// routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline`
///
/// Google discourage the use of the wildcard (`*`) response field mask, or
/// specifying the field mask at the top level (`routes`), because:
///
/// * Selecting only the fields that you need helps our server save computation
/// cycles, allowing us to return the result to you with a lower latency.
/// * Selecting only the fields that you need
/// in your production job ensures stable latency performance. We might add
/// more response fields in the future, and those new fields might require
/// extra computation time. If you select all fields, or if you select all
/// fields at the top level, then you might experience performance degradation
/// because any new field we add will be automatically included in the
/// response.
/// * Selecting only the fields that you need results in a smaller response
/// size, and thus higher network throughput.
pub async fn compute_routes(
&mut self,
request: impl tonic::IntoRequest<super::ComputeRoutesRequest>,
) -> std::result::Result<
tonic::Response<super::ComputeRoutesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.maps.routing.v2.Routes/ComputeRoutes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.maps.routing.v2.Routes", "ComputeRoutes"),
);
self.inner.unary(req, path, codec).await
}
/// Takes in a list of origins and destinations and returns a stream containing
/// route information for each combination of origin and destination.
///
/// **NOTE:** This method requires that you specify a response field mask in
/// the input. You can provide the response field mask by using the URL
/// parameter `$fields` or `fields`, or by using the HTTP/gRPC header
/// `X-Goog-FieldMask` (see the [available URL parameters and
/// headers](https://cloud.google.com/apis/docs/system-parameters)).
/// The value is a comma separated list of field paths. See this detailed
/// documentation about [how to construct the field
/// paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto).
///
/// For example, in this method:
///
/// * Field mask of all available fields (for manual inspection):
/// `X-Goog-FieldMask: *`
/// * Field mask of route durations, distances, element status, condition, and
/// element indices (an example production setup):
/// `X-Goog-FieldMask:
/// originIndex,destinationIndex,status,condition,distanceMeters,duration`
///
/// It is critical that you include `status` in your field mask as otherwise
/// all messages will appear to be OK. Google discourages the use of the
/// wildcard (`*`) response field mask, because:
///
/// * Selecting only the fields that you need helps our server save computation
/// cycles, allowing us to return the result to you with a lower latency.
/// * Selecting only the fields that you need in your production job ensures
/// stable latency performance. We might add more response fields in the
/// future, and those new fields might require extra computation time. If you
/// select all fields, or if you select all fields at the top level, then you
/// might experience performance degradation because any new field we add will
/// be automatically included in the response.
/// * Selecting only the fields that you need results in a smaller response
/// size, and thus higher network throughput.
pub async fn compute_route_matrix(
&mut self,
request: impl tonic::IntoRequest<super::ComputeRouteMatrixRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::RouteMatrixElement>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.maps.routing.v2.Routes/ComputeRouteMatrix",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.maps.routing.v2.Routes",
"ComputeRouteMatrix",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}