google_maps/directions/
mod.rs

1//! The **Directions API** is a service that calculates directions between
2//! locations. You can search for directions for several modes of
3//! transportation, including transit, driving, walking, or cycling.
4//!
5//! # [Get Started](https://developers.google.com/maps/documentation/directions/start)
6//!
7//! * **New Users**: Before you can start using the Google Maps Platform APIs
8//!   and SDKs, you must sign up and create a billing account. To learn more,
9//!   see [Get Started with Google Maps
10//!   Platform](https://developers.google.com/maps/gmp-get-started).
11//!
12//! * This service is also available as part of the client-side [Maps JavaScript
13//!   API](https://developers.google.com/maps/documentation/javascript/directions),
14//!   or for server-side use with the [Java Client, Python Client, Go Client and
15//!   Node.js Client for Google Maps
16//!   Services](https://developers.google.com/maps/documentation/directions/client-library).
17//!
18//! # [Start coding with our client libraries](https://developers.google.com/maps/documentation/directions/start#client-library)
19//!
20//! Client libraries make developing with the Google Maps web service APIs
21//! easier by providing simple, native implementations of common tasks, such as
22//! authentication, request throttling and automatic retry. The Directions API
23//! is available in the [Java Client, Python Client, Go Client and Node.js
24//! Client for Google Maps
25//! Services](https://developers.google.com/maps/documentation/directions/client-library).
26//!
27//! # [Authentication, quotas, pricing, and policies](https://developers.google.com/maps/documentation/directions/start#auth)
28//!
29//! ## [Activate the API and get an API key](https://developers.google.com/maps/documentation/directions/start#get-a-key)
30//!
31//! To use the Directions API, you must first activate the API in the Google
32//! Cloud Platform Console and obtain the proper authentication credentials. You
33//! need to provide an **API key** in each request (or a [client ID if you have
34//! a Premium
35//! Plan](https://developers.google.com/maps/documentation/directions/get-api-key#premium-auth).
36//!
37//! Click the button below to flow through a process where you will:
38//! 1. Create or select a project
39//! 2. Enable the API
40//! 3. Get an API key
41//!
42//! [Get Started](https://cloud.google.com/maps-platform/#get-started)
43//!
44//! [Learn more about authentication
45//! credentials](https://developers.google.com/maps/documentation/directions/get-api-key).
46//!
47//! ## [Quotas and pricing](https://developers.google.com/maps/documentation/directions/start#quotas)
48//!
49//! Review the [usage and
50//! billing](https://developers.google.com/maps/documentation/directions/usage-and-billing)
51//! page for details on the quotas and pricing set for the Directions API.
52//!
53//! ## [Policies](https://developers.google.com/maps/documentation/directions/start#policies)
54//!
55//! Use of the Directions API must be in accordance with the [API
56//! policies](https://developers.google.com/maps/documentation/directions/policies).
57//!
58//! From our Terms of Service: **Innovate, but don't duplicate.** Don't make a
59//! substitute for Google Maps. If your app's primary purpose is navigation, a
60//! business directory, or a general purpose "maps app", it's a substitute for
61//! Google Maps. [Learn
62//! more](https://cloud.google.com/maps-platform/terms/#3-license).
63//!
64//! # [Learn more](https://developers.google.com/maps/documentation/directions/start#learn-more)
65//!
66//! There’s more you can do with the Directions API, like [requesting directions
67//! via different travel
68//! modes](https://developers.google.com/maps/documentation/directions/intro#TravelModes),
69//! [using waypoints to calculate routes through additional
70//! locations](https://developers.google.com/maps/documentation/directions/intro#Waypoints),
71//! and [estimating travel
72//! time](https://developers.google.com/maps/documentation/directions/intro#traffic-model).
73//! See the [Directions API developer
74//! guide](https://developers.google.com/maps/documentation/directions/intro)
75//! for more examples and other details.
76//!
77//! The [Directions API developer
78//! guide](https://developers.google.com/maps/documentation/directions/intro) is
79//! intended for website and mobile developers who want to compute direction
80//! data within maps provided by one of the Google Maps APIs. It provides an
81//! introduction to using the API and reference material on the available
82//! parameters.
83
84pub mod error;
85pub mod request;
86pub mod response;
87pub mod travel_mode;
88pub mod vehicle_type;
89
90// -----------------------------------------------------------------------------
91
92pub use crate::directions::{
93    error::Error,
94    request::{
95        avoid::Avoid,
96        departure_time::DepartureTime,
97        location::Location,
98        Request,
99        traffic_model::TrafficModel,
100        transit_mode::TransitMode,
101        transit_route_preference::TransitRoutePreference,
102        unit_system::UnitSystem,
103        waypoint::Waypoint
104    },
105    response::{
106        directions_distance::DirectionsDistance,
107        directions_duration::DirectionsDuration,
108        driving_maneuver::DrivingManeuver,
109        leg::Leg,
110        overview_polyline::OverviewPolyline,
111        polyline::Polyline, route::Route,
112        Response,
113        status::Status,
114        step::Step,
115        transit_agency::TransitAgency,
116        transit_currency::TransitCurrency,
117        transit_details::TransitDetails,
118        transit_fare::TransitFare,
119        transit_line::TransitLine,
120        transit_stop::TransitStop,
121        transit_time::TransitTime,
122        transit_vehicle::TransitVehicle
123    },
124    travel_mode::TravelMode,
125    vehicle_type::VehicleType
126};
127
128#[deprecated(note = "use `google_maps::directions::Request` instead", since = "3.8.0")]
129pub use crate::directions::request::Request as DirectionsRequest;
130
131#[deprecated(note = "use `google_maps::directions::Response` instead", since = "3.8.0")]
132pub use crate::directions::response::Response as DirectionsResponse;
133
134#[deprecated(note = "use `google_maps::directions::Status` instead", since = "3.8.0")]
135pub use crate::directions::response::status::Status as DirectionsStatus;