mod client;
mod enums;
mod error;
mod request;
mod types;
pub use client::{Client, ClientBuilder, DEFAULT_TIMEOUT};
pub use enums::{
AlertCause, AlertEffect, AlertSeverityLevel, Direction, LocationType, Mode, PickupDropoffType,
RealtimeMode, TimestampReason, VertexType,
};
pub use error::Error;
pub use jiff::Timestamp;
pub use request::{Geocode, Plan, Request, ReverseGeocode, Stoptimes, Trip};
pub use reqwest::Url;
pub use types::{
Alert, Area, Itinerary, Leg, Match, Place, PlanResponse, StopTime, StoptimesResponse, TimeRange,
};
pub const MOTIS_VERSION: &str = "v2.11.4";
pub const API_VERSION: &str = "v6";
pub const OPENAPI_SPEC: &str = include_str!("../openapi/openapi.yaml");
#[cfg(test)]
mod tests {
use super::{API_VERSION, OPENAPI_SPEC};
#[test]
fn the_api_version_matches_the_vendored_specification() {
let info = OPENAPI_SPEC
.split("\ninfo:\n")
.nth(1)
.expect("the specification has an info section");
let version = info
.lines()
.take_while(|line| line.is_empty() || line.starts_with(' '))
.find_map(|line| line.strip_prefix(" version: "))
.expect("the info section has a version");
assert_eq!(version, API_VERSION);
}
}