Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::models::devicestatus::DeviceStatusService;
use crate::models::entries::EntriesService;
use crate::models::profile::ProfileService;
use crate::models::properties::PropertiesService;
use crate::models::status::StatusService;
use crate::models::treatments::TreatmentsService;

#[derive(Clone)]
Expand Down Expand Up @@ -74,6 +75,12 @@ impl NightscoutClient {
}
}

pub fn status(&self) -> StatusService {
StatusService {
client: self.clone(),
}
}

pub async fn send_checked(
&self,
request: reqwest::RequestBuilder,
Expand Down
2 changes: 2 additions & 0 deletions src/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub enum Endpoint {
Current,
DeviceStatus,
Profile,
Status,
}

impl Endpoint {
Expand All @@ -22,6 +23,7 @@ impl Endpoint {
Endpoint::Properties => "api/v2/properties",
Endpoint::DeviceStatus => "api/v2/devicestatus.json",
Endpoint::Profile => "api/v2/profile.json",
Endpoint::Status => "api/v2/status.json",
}
}
}
1 change: 1 addition & 0 deletions src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ pub mod devicestatus;
pub mod entries;
pub mod profile;
pub mod properties;
pub mod status;
pub mod treatments;
pub mod trends;
Loading