Struct OuraClient

Source
pub struct OuraClient<'a> { /* private fields */ }
Expand description

The Oura API client.

This client is used to make requests to the Oura API.

Implementations§

Source§

impl<'a> OuraClient<'a>

Source

pub fn new(token: &'a str) -> Self

Creates a new OuraClient from a personal access token.

Source

pub fn build_with_base_url(token: &'a str, base_url: &'a str) -> Self

Creates a new OuraClient from a personal access token and a base URL.

Note: This is only useful for testing against a mock server.

Source

pub fn get_daily_activity(&self, id: &str) -> Result<DailyActivity, Error>

Gets a single DailyActivity item by id.

Source

pub fn list_daily_activity( &self, query: DateQuery<'_>, ) -> Result<ListResponse<DailyActivity>, Error>

Returns a ListResponse of DailyActivity items based on the supplied query.

Source

pub fn get_daily_readiness(&self, id: &str) -> Result<DailyReadiness, Error>

Gets a single DailyReadiness item by id.

Source

pub fn list_daily_readiness( &self, query: DateQuery<'_>, ) -> Result<ListResponse<DailyReadiness>, Error>

Returns a ListResponse of DailyReadiness items based on the supplied query.

Source

pub fn get_daily_sleep(&self, id: &str) -> Result<DailySleep, Error>

Gets a single DailySleep item by id.

Source

pub fn list_daily_sleep( &self, query: DateQuery<'_>, ) -> Result<ListResponse<DailySleep>, Error>

Returns a ListResponse of DailySleep items based on the supplied query.

Source

pub fn get_daily_spo2(&self, id: &str) -> Result<DailySpO2, Error>

Gets a single DailySpO2 item by id.

Source

pub fn list_daily_spo2( &self, query: DateQuery<'_>, ) -> Result<ListResponse<DailySpO2>, Error>

Returns a ListResponse of DailySpO2 items based on the supplied query.

Source

pub fn list_heart_rate( &self, query: DatetimeQuery<'_>, ) -> Result<ListResponse<HeartRate>, Error>

Returns a ListResponse of HeartRate items based on the supplied query.

Source

pub fn get_personal_info(&self) -> Result<PersonalInfo, Error>

Returns a PersonalInfo based on the caller.

Source

pub fn get_rest_mode_period(&self, id: &str) -> Result<RestModePeriod, Error>

Gets a single RestModePeriod item by id.

Source

pub fn list_rest_mode_period( &self, query: DateQuery<'_>, ) -> Result<ListResponse<RestModePeriod>, Error>

Returns a ListResponse of RestModePeriod items based on the supplied query.

Source

pub fn get_ring_configuration( &self, id: &str, ) -> Result<RingConfiguration, Error>

Gets a single RingConfiguration item by id.

Source

pub fn list_ring_configuration( &self, query: DateQuery<'_>, ) -> Result<ListResponse<RingConfiguration>, Error>

Returns a ListResponse of RingConfiguration items based on the supplied query.

Source

pub fn get_session(&self, id: &str) -> Result<Session, Error>

Gets a single Session item by id.

Source

pub fn list_session( &self, query: DateQuery<'_>, ) -> Result<ListResponse<Session>, Error>

Returns a ListResponse of Session items based on the supplied query.

Source

pub fn get_sleep(&self, id: &str) -> Result<Sleep, Error>

Gets a single Sleep item by id.

Source

pub fn list_sleep( &self, query: DateQuery<'_>, ) -> Result<ListResponse<Sleep>, Error>

Returns a ListResponse of Sleep items based on the supplied query.

Source

pub fn get_sleep_time(&self, id: &str) -> Result<SleepTime, Error>

Gets a single SleepTime item by id.

Source

pub fn list_sleep_time( &self, query: DateQuery<'_>, ) -> Result<ListResponse<SleepTime>, Error>

Returns a ListResponse of SleepTime items based on the supplied query.

Source

pub fn get_tag(&self, id: &str) -> Result<Tag, Error>

Gets a single Tag item by id.

Source

pub fn list_tag(&self, query: DateQuery<'_>) -> Result<ListResponse<Tag>, Error>

Returns a ListResponse of Tag items based on the supplied query.

Source

pub fn get_workout(&self, id: &str) -> Result<Workout, Error>

Gets a single Workout item by id.

Source

pub fn list_workout( &self, query: DateQuery<'_>, ) -> Result<ListResponse<Workout>, Error>

Returns a ListResponse of Workout items based on the supplied query.

Source

pub fn get_tag_v2(&self, id: &str) -> Result<TagV2, Error>

Gets a single TagV2 item by id.

Source

pub fn list_tag_v2( &self, query: DateQuery<'_>, ) -> Result<ListResponse<TagV2>, Error>

Returns a ListResponse of TagV2 items based on the supplied query.

Auto Trait Implementations§

§

impl<'a> Freeze for OuraClient<'a>

§

impl<'a> !RefUnwindSafe for OuraClient<'a>

§

impl<'a> Send for OuraClient<'a>

§

impl<'a> Sync for OuraClient<'a>

§

impl<'a> Unpin for OuraClient<'a>

§

impl<'a> !UnwindSafe for OuraClient<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,