mod admin;
pub(crate) mod collection;
mod entries;
mod notifications;
mod properties;
mod system;
pub use admin::Admin;
pub use collection::{
Collection, Created, Delete, DeleteFilter, DeleteMany, DeleteReport, HistoryPage, List,
};
pub use entries::Entries;
pub use notifications::Notifications;
pub use properties::PropertiesRequest;
pub use system::Server;
use crate::client::Client;
use crate::error::Result;
use crate::model::ddata::DData;
use crate::model::summary::Summary;
use crate::model::{Activity, DeviceStatus, Food, ProfileStore, Setting, Timestamp, Treatment};
use crate::query::Filter;
impl Client {
#[must_use]
pub fn entries(&self) -> Entries {
Entries::new(self.clone())
}
#[must_use]
pub fn treatments(&self) -> Collection<Treatment> {
Collection::new(self.clone(), Filter::new())
}
#[must_use]
pub fn devicestatus(&self) -> Collection<DeviceStatus> {
Collection::new(self.clone(), Filter::new())
}
#[must_use]
pub fn profiles(&self) -> Collection<ProfileStore> {
Collection::new(self.clone(), Filter::new())
}
#[must_use]
pub fn food(&self) -> Collection<Food> {
Collection::new(self.clone(), Filter::new())
}
#[must_use]
pub fn activity(&self) -> Collection<Activity> {
Collection::new(self.clone(), Filter::new())
}
#[must_use]
pub fn settings(&self) -> Collection<Setting> {
Collection::new(self.clone(), Filter::new())
}
pub fn properties(&self) -> PropertiesRequest {
PropertiesRequest::new(self.clone())
}
pub async fn ddata(&self, at: Option<Timestamp>) -> Result<DData> {
properties::ddata(self, at).await
}
pub async fn summary(&self, hours: u32) -> Result<Summary> {
properties::summary(self, hours).await
}
#[must_use]
pub fn server(&self) -> Server {
Server::new(self.clone())
}
#[must_use]
pub fn notifications(&self) -> Notifications {
Notifications::new(self.clone())
}
#[must_use]
pub fn admin(&self) -> Admin {
Admin::new(self.clone())
}
}