Skip to main content

PublicModifiedSleepModel

Struct PublicModifiedSleepModel 

Source
pub struct PublicModifiedSleepModel {
Show 32 fields pub app_sleep_phase_5_min: Option<String>, pub average_breath: Option<f64>, pub average_heart_rate: Option<f64>, pub average_hrv: Option<i64>, pub awake_time: Option<i64>, pub bedtime_end: LocalizedDateTime, pub bedtime_start: LocalizedDateTime, pub day: IsoDate, pub deep_sleep_duration: Option<i64>, pub efficiency: Option<i64>, pub heart_rate: Option<PublicSample>, pub hrv: Option<PublicSample>, pub id: X, pub latency: Option<i64>, pub light_sleep_duration: Option<i64>, pub low_battery_alert: bool, pub lowest_heart_rate: Option<i64>, pub movement_30_sec: Option<String>, pub period: i64, pub readiness: Option<PublicReadiness>, pub readiness_score_delta: Option<i64>, pub rem_sleep_duration: Option<i64>, pub restless_periods: Option<i64>, pub ring_id: Option<String>, pub sleep_algorithm_version: Option<PublicSleepAlgorithmVersion>, pub sleep_analysis_reason: Option<PublicSleepAnalysisReason>, pub sleep_phase_30_sec: Option<String>, pub sleep_phase_5_min: Option<String>, pub sleep_score_delta: Option<i64>, pub time_in_bed: i64, pub total_sleep_duration: Option<i64>, pub type_: Option<PublicSleepType>,
}
Expand description

PublicModifiedSleepModel

JSON schema
{
 "title": "PublicModifiedSleepModel",
 "type": "object",
 "required": [
   "bedtime_end",
   "bedtime_start",
   "day",
   "id",
   "low_battery_alert",
   "period",
   "time_in_bed"
 ],
 "properties": {
   "app_sleep_phase_5_min": {
     "title": "App Sleep Phase 5 Min",
     "description": "\n        5-minute sleep phase classification for the period aligned with what is shown in the app\n        where every character corresponds to:\n        '1' = deep sleep,\n        '2' = light sleep,\n        '3' = REM sleep\n        '4' = awake.\n        Example: \"444423323441114\".\n        NOTE: This field will be removed in the future after a transition period.\n        ",
     "type": [
       "string",
       "null"
     ]
   },
   "average_breath": {
     "title": "",
     "description": "Average breathing rate during sleep as breaths/minute.",
     "type": [
       "number",
       "null"
     ]
   },
   "average_heart_rate": {
     "title": "",
     "description": "Average heart rate during sleep as beats/minute. NOTE: this is the average calculated by ecore (based on 30-second samples) which is different from what is shown in the app. The app shows the average of aggregated 5-minute heart rate samples.",
     "type": [
       "number",
       "null"
     ]
   },
   "average_hrv": {
     "title": "",
     "description": "Average heart rate variability during sleep.",
     "type": [
       "integer",
       "null"
     ]
   },
   "awake_time": {
     "title": "",
     "description": "Duration spent awake in seconds.",
     "type": [
       "integer",
       "null"
     ]
   },
   "bedtime_end": {
     "$ref": "#/components/schemas/LocalizedDateTime"
   },
   "bedtime_start": {
     "$ref": "#/components/schemas/LocalizedDateTime"
   },
   "day": {
     "$ref": "#/components/schemas/ISODate"
   },
   "deep_sleep_duration": {
     "title": "",
     "description": "Duration spent in deep sleep in seconds.",
     "type": [
       "integer",
       "null"
     ]
   },
   "efficiency": {
     "title": "",
     "description": "Sleep efficiency rating in range [1, 100].",
     "type": [
       "integer",
       "null"
     ]
   },
   "heart_rate": {
     "title": "",
     "description": "Object containing heart rate samples.",
     "oneOf": [
       {
         "type": "null"
       },
       {
         "allOf": [
           {
             "$ref": "#/components/schemas/PublicSample"
           }
         ]
       }
     ]
   },
   "hrv": {
     "title": "",
     "description": "Object containing heart rate variability samples.",
     "oneOf": [
       {
         "type": "null"
       },
       {
         "allOf": [
           {
             "$ref": "#/components/schemas/PublicSample"
           }
         ]
       }
     ]
   },
   "id": {
     "title": "",
     "description": "Unique identifier of the object.",
     "type": "string",
     "minLength": 1
   },
   "latency": {
     "title": "",
     "description": "Sleep latency in seconds. This is the time it took for the user to fall asleep after going to bed.",
     "type": [
       "integer",
       "null"
     ]
   },
   "light_sleep_duration": {
     "title": "",
     "description": "Duration spent in light sleep in seconds.",
     "type": [
       "integer",
       "null"
     ]
   },
   "low_battery_alert": {
     "title": "",
     "description": "Flag indicating if a low battery alert occurred.",
     "type": "boolean"
   },
   "lowest_heart_rate": {
     "title": "",
     "description": "Lowest heart rate during sleep. NOTE: this is the value calculated by ecore (based on 30-second samples) which is different from what is shown in the app. The app shows the minimum of aggregated 5-minute heart rate samples.",
     "type": [
       "integer",
       "null"
     ]
   },
   "movement_30_sec": {
     "title": "",
     "description": "30-second movement classification for the period where every character corresponds to:\n'1' = no motion,\n'2' = restless,\n'3' = tossing and turning\n'4' = active\nExample: \"1143222134\".",
     "type": [
       "string",
       "null"
     ]
   },
   "period": {
     "title": "",
     "description": "ECore sleep period identifier.",
     "type": "integer"
   },
   "readiness": {
     "title": "",
     "description": "Object containing the readiness details.",
     "oneOf": [
       {
         "type": "null"
       },
       {
         "allOf": [
           {
             "$ref": "#/components/schemas/PublicReadiness"
           }
         ]
       }
     ]
   },
   "readiness_score_delta": {
     "title": "",
     "description": "Effect on readiness score caused by this sleep period.",
     "type": [
       "integer",
       "null"
     ]
   },
   "rem_sleep_duration": {
     "title": "",
     "description": "Duration spent in REM sleep in seconds.",
     "type": [
       "integer",
       "null"
     ]
   },
   "restless_periods": {
     "title": "",
     "description": "Number of restless periods during sleep.",
     "type": [
       "integer",
       "null"
     ]
   },
   "ring_id": {
     "title": "Ring Id",
     "description": "Encrypted identifier of the ring that produced this sleep data. Deprecated, returns null.",
     "type": [
       "string",
       "null"
     ]
   },
   "sleep_algorithm_version": {
     "title": "",
     "description": "Version of the sleep algorithm used to calculate the sleep data.",
     "oneOf": [
       {
         "type": "null"
       },
       {
         "allOf": [
           {
             "$ref": "#/components/schemas/PublicSleepAlgorithmVersion"
           }
         ]
       }
     ]
   },
   "sleep_analysis_reason": {
     "title": "",
     "description": "The reason for the creation or update of the latest version of this sleep.",
     "oneOf": [
       {
         "type": "null"
       },
       {
         "allOf": [
           {
             "$ref": "#/components/schemas/PublicSleepAnalysisReason"
           }
         ]
       }
     ]
   },
   "sleep_phase_30_sec": {
     "title": "",
     "description": "30-second sleep phase classification for the period where every character corresponds to:\n'1' = deep sleep,\n'2' = light sleep,\n'3' = REM sleep\n'4' = awake.\nExample: \"444423323441114\".",
     "type": [
       "string",
       "null"
     ]
   },
   "sleep_phase_5_min": {
     "title": "",
     "description": "5-minute sleep phase classification for the period where every character corresponds to:\n'1' = deep sleep,\n'2' = light sleep,\n'3' = REM sleep\n'4' = awake.\nExample: \"444423323441114\".",
     "type": [
       "string",
       "null"
     ]
   },
   "sleep_score_delta": {
     "title": "",
     "description": "Effect on sleep score caused by this sleep period.",
     "type": [
       "integer",
       "null"
     ]
   },
   "time_in_bed": {
     "title": "",
     "description": "Duration spent in bed in seconds.",
     "type": "integer"
   },
   "total_sleep_duration": {
     "title": "",
     "description": "Total sleep duration in seconds.",
     "type": [
       "integer",
       "null"
     ]
   },
   "type": {
     "title": "",
     "description": "Type of the sleep period.",
     "oneOf": [
       {
         "type": "null"
       },
       {
         "allOf": [
           {
             "$ref": "#/components/schemas/PublicSleepType"
           }
         ]
       }
     ]
   }
 },
 "x-cloud-only": true,
 "x-collection": "publicsleepmodel",
 "x-owner": "sleep-squad"
}

Fields§

§app_sleep_phase_5_min: Option<String>

5-minute sleep phase classification for the period aligned with what is shown in the app where every character corresponds to: ‘1’ = deep sleep, ‘2’ = light sleep, ‘3’ = REM sleep ‘4’ = awake. Example: “444423323441114”. NOTE: This field will be removed in the future after a transition period.

§average_breath: Option<f64>

Average breathing rate during sleep as breaths/minute.

§average_heart_rate: Option<f64>

Average heart rate during sleep as beats/minute. NOTE: this is the average calculated by ecore (based on 30-second samples) which is different from what is shown in the app. The app shows the average of aggregated 5-minute heart rate samples.

§average_hrv: Option<i64>

Average heart rate variability during sleep.

§awake_time: Option<i64>

Duration spent awake in seconds.

§bedtime_end: LocalizedDateTime§bedtime_start: LocalizedDateTime§day: IsoDate§deep_sleep_duration: Option<i64>

Duration spent in deep sleep in seconds.

§efficiency: Option<i64>

Sleep efficiency rating in range [1, 100].

§heart_rate: Option<PublicSample>

Object containing heart rate samples.

§hrv: Option<PublicSample>

Object containing heart rate variability samples.

§id: X

Unique identifier of the object.

§latency: Option<i64>

Sleep latency in seconds. This is the time it took for the user to fall asleep after going to bed.

§light_sleep_duration: Option<i64>

Duration spent in light sleep in seconds.

§low_battery_alert: bool

Flag indicating if a low battery alert occurred.

§lowest_heart_rate: Option<i64>

Lowest heart rate during sleep. NOTE: this is the value calculated by ecore (based on 30-second samples) which is different from what is shown in the app. The app shows the minimum of aggregated 5-minute heart rate samples.

§movement_30_sec: Option<String>

30-second movement classification for the period where every character corresponds to: ‘1’ = no motion, ‘2’ = restless, ‘3’ = tossing and turning ‘4’ = active Example: “1143222134”.

§period: i64

ECore sleep period identifier.

§readiness: Option<PublicReadiness>

Object containing the readiness details.

§readiness_score_delta: Option<i64>

Effect on readiness score caused by this sleep period.

§rem_sleep_duration: Option<i64>

Duration spent in REM sleep in seconds.

§restless_periods: Option<i64>

Number of restless periods during sleep.

§ring_id: Option<String>

Encrypted identifier of the ring that produced this sleep data. Deprecated, returns null.

§sleep_algorithm_version: Option<PublicSleepAlgorithmVersion>

Version of the sleep algorithm used to calculate the sleep data.

§sleep_analysis_reason: Option<PublicSleepAnalysisReason>

The reason for the creation or update of the latest version of this sleep.

§sleep_phase_30_sec: Option<String>

30-second sleep phase classification for the period where every character corresponds to: ‘1’ = deep sleep, ‘2’ = light sleep, ‘3’ = REM sleep ‘4’ = awake. Example: “444423323441114”.

§sleep_phase_5_min: Option<String>

5-minute sleep phase classification for the period where every character corresponds to: ‘1’ = deep sleep, ‘2’ = light sleep, ‘3’ = REM sleep ‘4’ = awake. Example: “444423323441114”.

§sleep_score_delta: Option<i64>

Effect on sleep score caused by this sleep period.

§time_in_bed: i64

Duration spent in bed in seconds.

§total_sleep_duration: Option<i64>

Total sleep duration in seconds.

§type_: Option<PublicSleepType>

Type of the sleep period.

Trait Implementations§

Source§

impl Clone for PublicModifiedSleepModel

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PublicModifiedSleepModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PublicModifiedSleepModel

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PublicModifiedSleepModel

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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