#![forbid(unsafe_code)]
mod auth;
mod de;
pub mod endpoints;
mod error;
mod models;
mod params;
mod request;
mod transport;
pub use auth::Auth;
pub use error::{ApiErrorKind, Error, Result};
pub use models::{
ActionDetail, ActionPage, Download, GoalConversion, Outlink, ReferrerAll, ReferrerType, Visit,
VisitorType, VisitsSummary,
};
pub use params::{Date, DateRange, IdSite, Limit, Period, RangeEnd, Segment};
pub use request::Params;
pub use transport::{Client, Endpoint, ParseError, Query, QueryError};
#[cfg(feature = "reqwest")]
pub mod reqwest;
#[cfg(feature = "reqwest")]
pub use reqwest::{Cursor, MatomoClient, MatomoClientError, VisitStream};
#[cfg(feature = "chrono")]
impl From<chrono::NaiveDate> for Date {
fn from(d: chrono::NaiveDate) -> Self {
use chrono::Datelike;
Date::Ymd(d.year() as u16, d.month() as u8, d.day() as u8)
}
}
#[cfg(feature = "time")]
impl From<time::Date> for Date {
fn from(d: time::Date) -> Self {
Date::Ymd(d.year() as u16, u8::from(d.month()), d.day())
}
}