// @generated by `just gen-rust` (progenitor) from the overlaid + down-converted Oura
// OpenAPI spec. DO NOT hand-edit — regenerate with `just gen-rust`. See issue #6.
#[allow(unused_imports)]
use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt};
#[allow(unused_imports)]
pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
#[doc = r" Types used as operation parameters and responses."]
#[allow(clippy::all)]
pub mod types {
#[doc = r" Error types."]
pub mod error {
#[doc = r" Error from a `TryFrom` or `FromStr` implementation."]
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
#[doc = "`ArrayUnionFloatNoneTypeBits64`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"ArrayNullableFloatBits64\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ArrayUnionFloatNoneTypeBits64(pub ::std::vec::Vec<::std::option::Option<f64>>);
impl ::std::ops::Deref for ArrayUnionFloatNoneTypeBits64 {
type Target = ::std::vec::Vec<::std::option::Option<f64>>;
fn deref(&self) -> &::std::vec::Vec<::std::option::Option<f64>> {
&self.0
}
}
impl ::std::convert::From<ArrayUnionFloatNoneTypeBits64>
for ::std::vec::Vec<::std::option::Option<f64>>
{
fn from(value: ArrayUnionFloatNoneTypeBits64) -> Self {
value.0
}
}
impl ::std::convert::From<::std::vec::Vec<::std::option::Option<f64>>>
for ArrayUnionFloatNoneTypeBits64
{
fn from(value: ::std::vec::Vec<::std::option::Option<f64>>) -> Self {
Self(value)
}
}
#[doc = "`CreateWebhookSubscriptionRequest`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"CreateWebhookSubscriptionRequest\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"callback_url\","]
#[doc = " \"data_type\","]
#[doc = " \"event_type\","]
#[doc = " \"verification_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"callback_url\": {"]
#[doc = " \"title\": \"Callback Url\","]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " \"data_type\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ExtApiV2DataType\""]
#[doc = " },"]
#[doc = " \"event_type\": {"]
#[doc = " \"$ref\": \"#/components/schemas/WebhookOperation\""]
#[doc = " },"]
#[doc = " \"verification_token\": {"]
#[doc = " \"title\": \"Verification Token\","]
#[doc = " \"type\": \"string\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct CreateWebhookSubscriptionRequest {
pub callback_url: ::std::string::String,
pub data_type: ExtApiV2DataType,
pub event_type: WebhookOperation,
pub verification_token: ::std::string::String,
}
#[doc = "`DailyResilienceModel`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"DailyResilienceModel\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"contributors\","]
#[doc = " \"day\","]
#[doc = " \"id\","]
#[doc = " \"level\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"contributors\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ResilienceContributors\""]
#[doc = " },"]
#[doc = " \"day\": {"]
#[doc = " \"title\": \"Day\","]
#[doc = " \"description\": \"Day when the resilience record was recorded.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"format\": \"date\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"Id\","]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " \"level\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LongTermResilienceLevel\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct DailyResilienceModel {
pub contributors: ResilienceContributors,
#[doc = "Day when the resilience record was recorded."]
pub day: ::chrono::naive::NaiveDate,
pub id: ::std::string::String,
pub level: LongTermResilienceLevel,
}
#[doc = "An EnhancedTagModel maps an ASSATag. An ASSATag in ExtAPIV2 is called a EnhancedTag\nAn EnhancedTagModel will be populated by data from an ASSATag\nThe fields in the EnhancedTagModel map to fields in an ASSATag"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"EnhancedTagModel\","]
#[doc = " \"description\": \"An EnhancedTagModel maps an ASSATag. An ASSATag in ExtAPIV2 is called a EnhancedTag\\nAn EnhancedTagModel will be populated by data from an ASSATag\\nThe fields in the EnhancedTagModel map to fields in an ASSATag\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"id\","]
#[doc = " \"start_day\","]
#[doc = " \"start_time\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"comment\": {"]
#[doc = " \"title\": \"Comment\","]
#[doc = " \"description\": \"Additional freeform text on the tag.\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"custom_name\": {"]
#[doc = " \"title\": \"Custom Name\","]
#[doc = " \"description\": \"The name of the tag if the tag_type_code is `custom`.\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"end_day\": {"]
#[doc = " \"title\": \"End Day\","]
#[doc = " \"description\": \"Day of the tag's end for events with duration or `NULL` if there is no duration.\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ],"]
#[doc = " \"format\": \"date\""]
#[doc = " },"]
#[doc = " \"end_time\": {"]
#[doc = " \"description\": \"Timestamp of the tag's end for events with duration or `NULL` if there is no duration.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalDateTime\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"Id\","]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " \"start_day\": {"]
#[doc = " \"title\": \"Start Day\","]
#[doc = " \"description\": \"Day of the tag (if no duration) or the start day of the tag (with duration).\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"format\": \"date\""]
#[doc = " },"]
#[doc = " \"start_time\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalDateTime\""]
#[doc = " },"]
#[doc = " \"tag_type_code\": {"]
#[doc = " \"title\": \"Tag Type Code\","]
#[doc = " \"description\": \"The unique code of the selected tag type, `NULL` for text-only tags, or `custom` for custom tag types.\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct EnhancedTagModel {
#[doc = "Additional freeform text on the tag."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub comment: ::std::option::Option<::std::string::String>,
#[doc = "The name of the tag if the tag_type_code is `custom`."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub custom_name: ::std::option::Option<::std::string::String>,
#[doc = "Day of the tag's end for events with duration or `NULL` if there is no duration."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_day: ::std::option::Option<::chrono::naive::NaiveDate>,
#[doc = "Timestamp of the tag's end for events with duration or `NULL` if there is no duration."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_time: ::std::option::Option<LocalDateTime>,
pub id: ::std::string::String,
#[doc = "Day of the tag (if no duration) or the start day of the tag (with duration)."]
pub start_day: ::chrono::naive::NaiveDate,
pub start_time: LocalDateTime,
#[doc = "The unique code of the selected tag type, `NULL` for text-only tags, or `custom` for custom tag types."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tag_type_code: ::std::option::Option<::std::string::String>,
}
#[doc = "Data types that partners can subscribe to via ExtApiV2 webhooks."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"ExtApiV2DataType\","]
#[doc = " \"description\": \"Data types that partners can subscribe to via ExtApiV2 webhooks.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"tag\","]
#[doc = " \"enhanced_tag\","]
#[doc = " \"workout\","]
#[doc = " \"session\","]
#[doc = " \"sleep\","]
#[doc = " \"daily_sleep\","]
#[doc = " \"daily_readiness\","]
#[doc = " \"daily_activity\","]
#[doc = " \"daily_spo2\","]
#[doc = " \"sleep_time\","]
#[doc = " \"rest_mode_period\","]
#[doc = " \"ring_configuration\","]
#[doc = " \"daily_stress\","]
#[doc = " \"daily_cardiovascular_age\","]
#[doc = " \"daily_resilience\","]
#[doc = " \"vo2_max\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ExtApiV2DataType {
#[serde(rename = "tag")]
Tag,
#[serde(rename = "enhanced_tag")]
EnhancedTag,
#[serde(rename = "workout")]
Workout,
#[serde(rename = "session")]
Session,
#[serde(rename = "sleep")]
Sleep,
#[serde(rename = "daily_sleep")]
DailySleep,
#[serde(rename = "daily_readiness")]
DailyReadiness,
#[serde(rename = "daily_activity")]
DailyActivity,
#[serde(rename = "daily_spo2")]
DailySpo2,
#[serde(rename = "sleep_time")]
SleepTime,
#[serde(rename = "rest_mode_period")]
RestModePeriod,
#[serde(rename = "ring_configuration")]
RingConfiguration,
#[serde(rename = "daily_stress")]
DailyStress,
#[serde(rename = "daily_cardiovascular_age")]
DailyCardiovascularAge,
#[serde(rename = "daily_resilience")]
DailyResilience,
#[serde(rename = "vo2_max")]
Vo2Max,
}
impl ::std::fmt::Display for ExtApiV2DataType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Tag => f.write_str("tag"),
Self::EnhancedTag => f.write_str("enhanced_tag"),
Self::Workout => f.write_str("workout"),
Self::Session => f.write_str("session"),
Self::Sleep => f.write_str("sleep"),
Self::DailySleep => f.write_str("daily_sleep"),
Self::DailyReadiness => f.write_str("daily_readiness"),
Self::DailyActivity => f.write_str("daily_activity"),
Self::DailySpo2 => f.write_str("daily_spo2"),
Self::SleepTime => f.write_str("sleep_time"),
Self::RestModePeriod => f.write_str("rest_mode_period"),
Self::RingConfiguration => f.write_str("ring_configuration"),
Self::DailyStress => f.write_str("daily_stress"),
Self::DailyCardiovascularAge => f.write_str("daily_cardiovascular_age"),
Self::DailyResilience => f.write_str("daily_resilience"),
Self::Vo2Max => f.write_str("vo2_max"),
}
}
}
impl ::std::str::FromStr for ExtApiV2DataType {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"tag" => Ok(Self::Tag),
"enhanced_tag" => Ok(Self::EnhancedTag),
"workout" => Ok(Self::Workout),
"session" => Ok(Self::Session),
"sleep" => Ok(Self::Sleep),
"daily_sleep" => Ok(Self::DailySleep),
"daily_readiness" => Ok(Self::DailyReadiness),
"daily_activity" => Ok(Self::DailyActivity),
"daily_spo2" => Ok(Self::DailySpo2),
"sleep_time" => Ok(Self::SleepTime),
"rest_mode_period" => Ok(Self::RestModePeriod),
"ring_configuration" => Ok(Self::RingConfiguration),
"daily_stress" => Ok(Self::DailyStress),
"daily_cardiovascular_age" => Ok(Self::DailyCardiovascularAge),
"daily_resilience" => Ok(Self::DailyResilience),
"vo2_max" => Ok(Self::Vo2Max),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ExtApiV2DataType {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ExtApiV2DataType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ExtApiV2DataType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "`HttpValidationError`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"HTTPValidationError\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"properties\": {"]
#[doc = " \"detail\": {"]
#[doc = " \"title\": \"Detail\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ValidationError\""]
#[doc = " }"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct HttpValidationError {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub detail: ::std::vec::Vec<ValidationError>,
}
impl ::std::default::Default for HttpValidationError {
fn default() -> Self {
Self {
detail: Default::default(),
}
}
}
#[doc = "`IsoDate`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"type\": \"string\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
#[serde(transparent)]
pub struct IsoDate(pub ::std::string::String);
impl ::std::ops::Deref for IsoDate {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<IsoDate> for ::std::string::String {
fn from(value: IsoDate) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for IsoDate {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::str::FromStr for IsoDate {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::std::fmt::Display for IsoDate {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
#[doc = "`LocalDateTime`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"type\": \"string\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
#[serde(transparent)]
pub struct LocalDateTime(pub ::std::string::String);
impl ::std::ops::Deref for LocalDateTime {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<LocalDateTime> for ::std::string::String {
fn from(value: LocalDateTime) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for LocalDateTime {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::str::FromStr for LocalDateTime {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::std::fmt::Display for LocalDateTime {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
#[doc = "`LocalizedDateTime`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"type\": \"string\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
#[serde(transparent)]
pub struct LocalizedDateTime(pub ::std::string::String);
impl ::std::ops::Deref for LocalizedDateTime {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<LocalizedDateTime> for ::std::string::String {
fn from(value: LocalizedDateTime) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for LocalizedDateTime {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::str::FromStr for LocalizedDateTime {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::std::fmt::Display for LocalizedDateTime {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
#[doc = "`LocationItem`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"anyOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"type\": \"integer\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum LocationItem {
String(::std::string::String),
Integer(i64),
}
impl ::std::fmt::Display for LocationItem {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match self {
Self::String(x) => x.fmt(f),
Self::Integer(x) => x.fmt(f),
}
}
}
impl ::std::convert::From<i64> for LocationItem {
fn from(value: i64) -> Self {
Self::Integer(value)
}
}
#[doc = "Possible long term resilience level values."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"LongTermResilienceLevel\","]
#[doc = " \"description\": \"Possible long term resilience level values.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"limited\","]
#[doc = " \"adequate\","]
#[doc = " \"solid\","]
#[doc = " \"strong\","]
#[doc = " \"exceptional\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum LongTermResilienceLevel {
#[serde(rename = "limited")]
Limited,
#[serde(rename = "adequate")]
Adequate,
#[serde(rename = "solid")]
Solid,
#[serde(rename = "strong")]
Strong,
#[serde(rename = "exceptional")]
Exceptional,
}
impl ::std::fmt::Display for LongTermResilienceLevel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Limited => f.write_str("limited"),
Self::Adequate => f.write_str("adequate"),
Self::Solid => f.write_str("solid"),
Self::Strong => f.write_str("strong"),
Self::Exceptional => f.write_str("exceptional"),
}
}
}
impl ::std::str::FromStr for LongTermResilienceLevel {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"limited" => Ok(Self::Limited),
"adequate" => Ok(Self::Adequate),
"solid" => Ok(Self::Solid),
"strong" => Ok(Self::Strong),
"exceptional" => Ok(Self::Exceptional),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for LongTermResilienceLevel {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LongTermResilienceLevel {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LongTermResilienceLevel {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "`MultiDocumentResponseDailyResilienceModel`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[DailyResilienceModel]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/DailyResilienceModel\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponseDailyResilienceModel {
pub data: ::std::vec::Vec<DailyResilienceModel>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponseEnhancedTagModel`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[EnhancedTagModel]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/EnhancedTagModel\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponseEnhancedTagModel {
pub data: ::std::vec::Vec<EnhancedTagModel>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicDailyActivity`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicDailyActivity]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicDailyActivity\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicDailyActivity {
pub data: ::std::vec::Vec<PublicDailyActivity>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicDailyCardiovascularAge`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicDailyCardiovascularAge]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicDailyCardiovascularAge\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicDailyCardiovascularAge {
pub data: ::std::vec::Vec<PublicDailyCardiovascularAge>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicDailyReadiness`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicDailyReadiness]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicDailyReadiness\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicDailyReadiness {
pub data: ::std::vec::Vec<PublicDailyReadiness>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicDailySleep`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicDailySleep]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicDailySleep\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicDailySleep {
pub data: ::std::vec::Vec<PublicDailySleep>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicDailySpO2`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicDailySpO2]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicDailySpO2\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicDailySpO2 {
pub data: ::std::vec::Vec<PublicDailySpO2>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicDailyStress`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicDailyStress]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicDailyStress\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicDailyStress {
pub data: ::std::vec::Vec<PublicDailyStress>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicModifiedSleepModel`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicModifiedSleepModel]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicModifiedSleepModel\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicModifiedSleepModel {
pub data: ::std::vec::Vec<PublicModifiedSleepModel>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicRestModePeriod`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicRestModePeriod]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicRestModePeriod\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicRestModePeriod {
pub data: ::std::vec::Vec<PublicRestModePeriod>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicRingConfiguration`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicRingConfiguration]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicRingConfiguration\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicRingConfiguration {
pub data: ::std::vec::Vec<PublicRingConfiguration>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicSession`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicSession]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSession\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicSession {
pub data: ::std::vec::Vec<PublicSession>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicSleepTime`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicSleepTime]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSleepTime\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicSleepTime {
pub data: ::std::vec::Vec<PublicSleepTime>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicVo2Max`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicVO2Max]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicVO2Max\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicVo2Max {
pub data: ::std::vec::Vec<PublicVo2Max>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponsePublicWorkout`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[PublicWorkout]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicWorkout\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponsePublicWorkout {
pub data: ::std::vec::Vec<PublicWorkout>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`MultiDocumentResponseTagModel`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"MultiDocumentResponse[TagModel]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\","]
#[doc = " \"next_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/TagModel\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct MultiDocumentResponseTagModel {
pub data: ::std::vec::Vec<TagModel>,
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`PersonalInfoResponse`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PersonalInfoResponse\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"id\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"age\": {"]
#[doc = " \"title\": \"Age\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"biological_sex\": {"]
#[doc = " \"title\": \"Biological Sex\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"email\": {"]
#[doc = " \"title\": \"Email\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"height\": {"]
#[doc = " \"title\": \"Height\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"Id\","]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " \"weight\": {"]
#[doc = " \"title\": \"Weight\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PersonalInfoResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub age: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub biological_sex: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub height: ::std::option::Option<f64>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub weight: ::std::option::Option<f64>,
}
#[doc = "Object defining activity score contributors."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicActivityContributors\","]
#[doc = " \"description\": \"Object defining activity score contributors.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"properties\": {"]
#[doc = " \"meet_daily_targets\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of meeting previous 7-day daily activity targets in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"move_every_hour\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of previous 24-hour inactivity alerts in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"recovery_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of previous 7-day recovery time in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"stay_active\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of previous 24-hour activity in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"training_frequency\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of previous 7-day exercise frequency in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"training_volume\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of previous 7-day exercise volume in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicActivityContributors {
#[doc = "Contribution of meeting previous 7-day daily activity targets in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub meet_daily_targets: ::std::option::Option<i64>,
#[doc = "Contribution of previous 24-hour inactivity alerts in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub move_every_hour: ::std::option::Option<i64>,
#[doc = "Contribution of previous 7-day recovery time in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recovery_time: ::std::option::Option<i64>,
#[doc = "Contribution of previous 24-hour activity in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub stay_active: ::std::option::Option<i64>,
#[doc = "Contribution of previous 7-day exercise frequency in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub training_frequency: ::std::option::Option<i64>,
#[doc = "Contribution of previous 7-day exercise volume in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub training_volume: ::std::option::Option<i64>,
}
impl ::std::default::Default for PublicActivityContributors {
fn default() -> Self {
Self {
meet_daily_targets: Default::default(),
move_every_hour: Default::default(),
recovery_time: Default::default(),
stay_active: Default::default(),
training_frequency: Default::default(),
training_volume: Default::default(),
}
}
}
#[doc = "Object defining a daily activity that is a 24-hour period starting at 4 a.m."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicDailyActivity\","]
#[doc = " \"description\": \"Object defining a daily activity that is a 24-hour period starting at 4 a.m.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"active_calories\","]
#[doc = " \"average_met_minutes\","]
#[doc = " \"contributors\","]
#[doc = " \"day\","]
#[doc = " \"equivalent_walking_distance\","]
#[doc = " \"high_activity_met_minutes\","]
#[doc = " \"high_activity_time\","]
#[doc = " \"id\","]
#[doc = " \"inactivity_alerts\","]
#[doc = " \"low_activity_met_minutes\","]
#[doc = " \"low_activity_time\","]
#[doc = " \"medium_activity_met_minutes\","]
#[doc = " \"medium_activity_time\","]
#[doc = " \"met\","]
#[doc = " \"meters_to_target\","]
#[doc = " \"non_wear_time\","]
#[doc = " \"resting_time\","]
#[doc = " \"sedentary_met_minutes\","]
#[doc = " \"sedentary_time\","]
#[doc = " \"steps\","]
#[doc = " \"target_calories\","]
#[doc = " \"target_meters\","]
#[doc = " \"timestamp\","]
#[doc = " \"total_calories\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"active_calories\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Active calories expended in kilocalories.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"average_met_minutes\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Average MET minutes.\","]
#[doc = " \"type\": \"number\""]
#[doc = " },"]
#[doc = " \"class_5_min\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"5-minute activity classification for the period where every character corresponds to:\\n'0' = non wear\\n'1' = rest\\n'2' = inactive\\n'3' = low activity\\n'4' = medium activity\\n'5' = high activity\\nExample: \\\"001233334555524001\\\".\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"contributors\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicActivityContributors\""]
#[doc = " },"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"equivalent_walking_distance\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Equivalent walking distance of energe expenditure in meters.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"high_activity_met_minutes\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"The total METs of each minute classified as high activity.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"high_activity_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"The total time in seconds of each minute classified as high activity.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"inactivity_alerts\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Number of inactivity alerts received.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"low_activity_met_minutes\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"The total METs of each minute classified as low activity.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"low_activity_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"The total time in seconds of each minute classified as low activity.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"medium_activity_met_minutes\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"The total METs of each minute classified as medium activity.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"medium_activity_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"The total time in seconds of each minute classified as medium activity.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"met\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
#[doc = " },"]
#[doc = " \"meters_to_target\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Meters remaining to target.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"non_wear_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Ring non-wear time in seconds.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"resting_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Resting time in seconds.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"score\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Activity score in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"sedentary_met_minutes\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Sedentary MET minutes.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"sedentary_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Sedentary time in seconds.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"steps\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Total number of steps taken.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"target_calories\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Daily activity target in kilocalories.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"target_meters\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Daily activity target in meters.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " },"]
#[doc = " \"total_calories\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Total calories expended in kilocalories.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicdailyactivity\","]
#[doc = " \"x-owner\": \"movement-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicDailyActivity {
#[doc = "Active calories expended in kilocalories."]
pub active_calories: i64,
#[doc = "Average MET minutes."]
pub average_met_minutes: f64,
#[doc = "5-minute activity classification for the period where every character corresponds to:\n'0' = non wear\n'1' = rest\n'2' = inactive\n'3' = low activity\n'4' = medium activity\n'5' = high activity\nExample: \"001233334555524001\"."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub class_5_min: ::std::option::Option<::std::string::String>,
pub contributors: PublicActivityContributors,
pub day: IsoDate,
#[doc = "Equivalent walking distance of energe expenditure in meters."]
pub equivalent_walking_distance: i64,
#[doc = "The total METs of each minute classified as high activity."]
pub high_activity_met_minutes: i64,
#[doc = "The total time in seconds of each minute classified as high activity."]
pub high_activity_time: i64,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "Number of inactivity alerts received."]
pub inactivity_alerts: i64,
#[doc = "The total METs of each minute classified as low activity."]
pub low_activity_met_minutes: i64,
#[doc = "The total time in seconds of each minute classified as low activity."]
pub low_activity_time: i64,
#[doc = "The total METs of each minute classified as medium activity."]
pub medium_activity_met_minutes: i64,
#[doc = "The total time in seconds of each minute classified as medium activity."]
pub medium_activity_time: i64,
pub met: PublicSample,
#[doc = "Meters remaining to target."]
pub meters_to_target: i64,
#[doc = "Ring non-wear time in seconds."]
pub non_wear_time: i64,
#[doc = "Resting time in seconds."]
pub resting_time: i64,
#[doc = "Activity score in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub score: ::std::option::Option<i64>,
#[doc = "Sedentary MET minutes."]
pub sedentary_met_minutes: i64,
#[doc = "Sedentary time in seconds."]
pub sedentary_time: i64,
#[doc = "Total number of steps taken."]
pub steps: i64,
#[doc = "Daily activity target in kilocalories."]
pub target_calories: i64,
#[doc = "Daily activity target in meters."]
pub target_meters: i64,
pub timestamp: LocalizedDateTime,
#[doc = "Total calories expended in kilocalories."]
pub total_calories: i64,
}
#[doc = "Daily Cardiovascular Age."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicDailyCardiovascularAge\","]
#[doc = " \"description\": \"Daily Cardiovascular Age.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"day\","]
#[doc = " \"id\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"pulse_wave_velocity\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Pulse wave velocity (m/s), derived from vascular age, with possible offset added.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"vascular_age\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Predicted vascular age in range [18, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicdailycardiovascularage\","]
#[doc = " \"x-owner\": \"heart-health-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicDailyCardiovascularAge {
pub day: IsoDate,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "Pulse wave velocity (m/s), derived from vascular age, with possible offset added."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pulse_wave_velocity: ::std::option::Option<f64>,
#[doc = "Predicted vascular age in range [18, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub vascular_age: ::std::option::Option<i64>,
}
#[doc = "Public object defining daily readiness."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicDailyReadiness\","]
#[doc = " \"description\": \"Public object defining daily readiness.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"contributors\","]
#[doc = " \"day\","]
#[doc = " \"id\","]
#[doc = " \"timestamp\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"contributors\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicReadinessContributors\""]
#[doc = " },"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"score\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Daily readiness score.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"temperature_deviation\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Temperature deviation in degrees Celsius.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"temperature_trend_deviation\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Temperature trend deviation in degrees Celsius.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicdailyreadiness\","]
#[doc = " \"x-owner\": \"wellbeing-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicDailyReadiness {
pub contributors: PublicReadinessContributors,
pub day: IsoDate,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "Daily readiness score."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub score: ::std::option::Option<i64>,
#[doc = "Temperature deviation in degrees Celsius."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub temperature_deviation: ::std::option::Option<f64>,
#[doc = "Temperature trend deviation in degrees Celsius."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub temperature_trend_deviation: ::std::option::Option<f64>,
pub timestamp: LocalizedDateTime,
}
#[doc = "Public object defining daily sleep."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicDailySleep\","]
#[doc = " \"description\": \"Public object defining daily sleep.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"contributors\","]
#[doc = " \"day\","]
#[doc = " \"id\","]
#[doc = " \"timestamp\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"contributors\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSleepContributors\""]
#[doc = " },"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"score\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Daily sleep score.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicdailysleep\","]
#[doc = " \"x-owner\": \"sleep-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicDailySleep {
pub contributors: PublicSleepContributors,
pub day: IsoDate,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "Daily sleep score."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub score: ::std::option::Option<i64>,
pub timestamp: LocalizedDateTime,
}
#[doc = "Daily SpO2 (Oxygen saturation)."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicDailySpO2\","]
#[doc = " \"description\": \"Daily SpO2 (Oxygen saturation).\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"day\","]
#[doc = " \"id\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"breathing_disturbance_index\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Breathing Disturbance Index (BDI) calculated using detected SpO2 drops from timeseries. Values should be in range [0, 100]\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"spo2_percentage\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"The daily SpO2 percentage value aggregates. Sourced from SpO2 percentage timeseries values.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSpo2AggregatedValues\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicdailyspo2\","]
#[doc = " \"x-owner\": \"sleep-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicDailySpO2 {
#[doc = "Breathing Disturbance Index (BDI) calculated using detected SpO2 drops from timeseries. Values should be in range [0, 100]"]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub breathing_disturbance_index: ::std::option::Option<i64>,
pub day: IsoDate,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "The daily SpO2 percentage value aggregates. Sourced from SpO2 percentage timeseries values."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub spo2_percentage: ::std::option::Option<PublicSpo2AggregatedValues>,
}
#[doc = "Daily stress."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicDailyStress\","]
#[doc = " \"description\": \"Daily stress.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"day\","]
#[doc = " \"id\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"day_summary\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Stress summary of full day.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicDailyStressSummary\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"recovery_high\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Time spent in a high recovery zone (bottom quartile data) in seconds.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"stress_high\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Time spent in a high stress zone (top quartile of data) in seconds.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicdailystress\","]
#[doc = " \"x-owner\": \"wellbeing-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicDailyStress {
pub day: IsoDate,
#[doc = "Stress summary of full day."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub day_summary: ::std::option::Option<PublicDailyStressSummary>,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "Time spent in a high recovery zone (bottom quartile data) in seconds."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recovery_high: ::std::option::Option<i64>,
#[doc = "Time spent in a high stress zone (top quartile of data) in seconds."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub stress_high: ::std::option::Option<i64>,
}
#[doc = "Possible public daily stress summary types."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicDailyStressSummary\","]
#[doc = " \"description\": \"Possible public daily stress summary types.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"restored\","]
#[doc = " \"normal\","]
#[doc = " \"stressful\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicDailyStressSummary {
#[serde(rename = "restored")]
Restored,
#[serde(rename = "normal")]
Normal,
#[serde(rename = "stressful")]
Stressful,
}
impl ::std::fmt::Display for PublicDailyStressSummary {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Restored => f.write_str("restored"),
Self::Normal => f.write_str("normal"),
Self::Stressful => f.write_str("stressful"),
}
}
}
impl ::std::str::FromStr for PublicDailyStressSummary {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"restored" => Ok(Self::Restored),
"normal" => Ok(Self::Normal),
"stressful" => Ok(Self::Stressful),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicDailyStressSummary {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicDailyStressSummary {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicDailyStressSummary {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Heart rate sample"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicHeartRateRow\","]
#[doc = " \"description\": \"Heart rate sample\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"bpm\","]
#[doc = " \"source\","]
#[doc = " \"timestamp\","]
#[doc = " \"timestamp_unix\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"bpm\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Heart rate as beats per minute.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"source\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicHeartRateSource\""]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/UtcDateTime\""]
#[doc = " },"]
#[doc = " \"timestamp_unix\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Timestamp of the discrete sample as unix time in milliseconds.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicheartrate\","]
#[doc = " \"x-owner\": \"core-sensing-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicHeartRateRow {
#[doc = "Heart rate as beats per minute."]
pub bpm: i64,
pub source: PublicHeartRateSource,
pub timestamp: UtcDateTime,
#[doc = "Timestamp of the discrete sample as unix time in milliseconds."]
pub timestamp_unix: i64,
}
#[doc = "Possible heart rate sources."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicHeartRateSource\","]
#[doc = " \"description\": \"Possible heart rate sources.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"awake\","]
#[doc = " \"workout\","]
#[doc = " \"rest\","]
#[doc = " \"sleep\","]
#[doc = " \"live\","]
#[doc = " \"session\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicHeartRateSource {
#[serde(rename = "awake")]
Awake,
#[serde(rename = "workout")]
Workout,
#[serde(rename = "rest")]
Rest,
#[serde(rename = "sleep")]
Sleep,
#[serde(rename = "live")]
Live,
#[serde(rename = "session")]
Session,
}
impl ::std::fmt::Display for PublicHeartRateSource {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Awake => f.write_str("awake"),
Self::Workout => f.write_str("workout"),
Self::Rest => f.write_str("rest"),
Self::Sleep => f.write_str("sleep"),
Self::Live => f.write_str("live"),
Self::Session => f.write_str("session"),
}
}
}
impl ::std::str::FromStr for PublicHeartRateSource {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"awake" => Ok(Self::Awake),
"workout" => Ok(Self::Workout),
"rest" => Ok(Self::Rest),
"sleep" => Ok(Self::Sleep),
"live" => Ok(Self::Live),
"session" => Ok(Self::Session),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicHeartRateSource {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicHeartRateSource {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicHeartRateSource {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "`PublicModifiedSleepModel`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicModifiedSleepModel\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"bedtime_end\","]
#[doc = " \"bedtime_start\","]
#[doc = " \"day\","]
#[doc = " \"id\","]
#[doc = " \"low_battery_alert\","]
#[doc = " \"period\","]
#[doc = " \"time_in_bed\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"app_sleep_phase_5_min\": {"]
#[doc = " \"title\": \"App Sleep Phase 5 Min\","]
#[doc = " \"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 \","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"average_breath\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Average breathing rate during sleep as breaths/minute.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"average_heart_rate\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"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.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"average_hrv\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Average heart rate variability during sleep.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"awake_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Duration spent awake in seconds.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"bedtime_end\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " },"]
#[doc = " \"bedtime_start\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " },"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"deep_sleep_duration\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Duration spent in deep sleep in seconds.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"efficiency\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Sleep efficiency rating in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"heart_rate\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Object containing heart rate samples.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"hrv\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Object containing heart rate variability samples.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"latency\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Sleep latency in seconds. This is the time it took for the user to fall asleep after going to bed.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"light_sleep_duration\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Duration spent in light sleep in seconds.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"low_battery_alert\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Flag indicating if a low battery alert occurred.\","]
#[doc = " \"type\": \"boolean\""]
#[doc = " },"]
#[doc = " \"lowest_heart_rate\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"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.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"movement_30_sec\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"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\\\".\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"period\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"ECore sleep period identifier.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"readiness\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Object containing the readiness details.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicReadiness\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"readiness_score_delta\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Effect on readiness score caused by this sleep period.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"rem_sleep_duration\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Duration spent in REM sleep in seconds.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"restless_periods\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Number of restless periods during sleep.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"ring_id\": {"]
#[doc = " \"title\": \"Ring Id\","]
#[doc = " \"description\": \"Encrypted identifier of the ring that produced this sleep data. Deprecated, returns null.\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"sleep_algorithm_version\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Version of the sleep algorithm used to calculate the sleep data.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSleepAlgorithmVersion\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"sleep_analysis_reason\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"The reason for the creation or update of the latest version of this sleep.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSleepAnalysisReason\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"sleep_phase_30_sec\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"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\\\".\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"sleep_phase_5_min\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"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\\\".\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"sleep_score_delta\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Effect on sleep score caused by this sleep period.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"time_in_bed\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Duration spent in bed in seconds.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"total_sleep_duration\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Total sleep duration in seconds.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"type\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Type of the sleep period.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSleepType\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicsleepmodel\","]
#[doc = " \"x-owner\": \"sleep-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicModifiedSleepModel {
#[doc = "\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 "]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub app_sleep_phase_5_min: ::std::option::Option<::std::string::String>,
#[doc = "Average breathing rate during sleep as breaths/minute."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub average_breath: ::std::option::Option<f64>,
#[doc = "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."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub average_heart_rate: ::std::option::Option<f64>,
#[doc = "Average heart rate variability during sleep."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub average_hrv: ::std::option::Option<i64>,
#[doc = "Duration spent awake in seconds."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub awake_time: ::std::option::Option<i64>,
pub bedtime_end: LocalizedDateTime,
pub bedtime_start: LocalizedDateTime,
pub day: IsoDate,
#[doc = "Duration spent in deep sleep in seconds."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deep_sleep_duration: ::std::option::Option<i64>,
#[doc = "Sleep efficiency rating in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub efficiency: ::std::option::Option<i64>,
#[doc = "Object containing heart rate samples."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub heart_rate: ::std::option::Option<PublicSample>,
#[doc = "Object containing heart rate variability samples."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hrv: ::std::option::Option<PublicSample>,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "Sleep latency in seconds. This is the time it took for the user to fall asleep after going to bed."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub latency: ::std::option::Option<i64>,
#[doc = "Duration spent in light sleep in seconds."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub light_sleep_duration: ::std::option::Option<i64>,
#[doc = "Flag indicating if a low battery alert occurred."]
pub low_battery_alert: bool,
#[doc = "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."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lowest_heart_rate: ::std::option::Option<i64>,
#[doc = "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\"."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub movement_30_sec: ::std::option::Option<::std::string::String>,
#[doc = "ECore sleep period identifier."]
pub period: i64,
#[doc = "Object containing the readiness details."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub readiness: ::std::option::Option<PublicReadiness>,
#[doc = "Effect on readiness score caused by this sleep period."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub readiness_score_delta: ::std::option::Option<i64>,
#[doc = "Duration spent in REM sleep in seconds."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rem_sleep_duration: ::std::option::Option<i64>,
#[doc = "Number of restless periods during sleep."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub restless_periods: ::std::option::Option<i64>,
#[doc = "Encrypted identifier of the ring that produced this sleep data. Deprecated, returns null."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ring_id: ::std::option::Option<::std::string::String>,
#[doc = "Version of the sleep algorithm used to calculate the sleep data."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sleep_algorithm_version: ::std::option::Option<PublicSleepAlgorithmVersion>,
#[doc = "The reason for the creation or update of the latest version of this sleep."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sleep_analysis_reason: ::std::option::Option<PublicSleepAnalysisReason>,
#[doc = "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\"."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sleep_phase_30_sec: ::std::option::Option<::std::string::String>,
#[doc = "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\"."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sleep_phase_5_min: ::std::option::Option<::std::string::String>,
#[doc = "Effect on sleep score caused by this sleep period."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sleep_score_delta: ::std::option::Option<i64>,
#[doc = "Duration spent in bed in seconds."]
pub time_in_bed: i64,
#[doc = "Total sleep duration in seconds."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub total_sleep_duration: ::std::option::Option<i64>,
#[doc = "Type of the sleep period."]
#[serde(
rename = "type",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub type_: ::std::option::Option<PublicSleepType>,
}
#[doc = "Possible Moment moods."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicMomentMood\","]
#[doc = " \"description\": \"Possible Moment moods.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"bad\","]
#[doc = " \"worse\","]
#[doc = " \"same\","]
#[doc = " \"good\","]
#[doc = " \"great\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicMomentMood {
#[serde(rename = "bad")]
Bad,
#[serde(rename = "worse")]
Worse,
#[serde(rename = "same")]
Same,
#[serde(rename = "good")]
Good,
#[serde(rename = "great")]
Great,
}
impl ::std::fmt::Display for PublicMomentMood {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Bad => f.write_str("bad"),
Self::Worse => f.write_str("worse"),
Self::Same => f.write_str("same"),
Self::Good => f.write_str("good"),
Self::Great => f.write_str("great"),
}
}
}
impl ::std::str::FromStr for PublicMomentMood {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"bad" => Ok(Self::Bad),
"worse" => Ok(Self::Worse),
"same" => Ok(Self::Same),
"good" => Ok(Self::Good),
"great" => Ok(Self::Great),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicMomentMood {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicMomentMood {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicMomentMood {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Possible Moment types."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicMomentType\","]
#[doc = " \"description\": \"Possible Moment types.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"breathing\","]
#[doc = " \"meditation\","]
#[doc = " \"nap\","]
#[doc = " \"relaxation\","]
#[doc = " \"rest\","]
#[doc = " \"body_status\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicMomentType {
#[serde(rename = "breathing")]
Breathing,
#[serde(rename = "meditation")]
Meditation,
#[serde(rename = "nap")]
Nap,
#[serde(rename = "relaxation")]
Relaxation,
#[serde(rename = "rest")]
Rest,
#[serde(rename = "body_status")]
BodyStatus,
}
impl ::std::fmt::Display for PublicMomentType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Breathing => f.write_str("breathing"),
Self::Meditation => f.write_str("meditation"),
Self::Nap => f.write_str("nap"),
Self::Relaxation => f.write_str("relaxation"),
Self::Rest => f.write_str("rest"),
Self::BodyStatus => f.write_str("body_status"),
}
}
}
impl ::std::str::FromStr for PublicMomentType {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"breathing" => Ok(Self::Breathing),
"meditation" => Ok(Self::Meditation),
"nap" => Ok(Self::Nap),
"relaxation" => Ok(Self::Relaxation),
"rest" => Ok(Self::Rest),
"body_status" => Ok(Self::BodyStatus),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicMomentType {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicMomentType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicMomentType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Object defining readiness."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicReadiness\","]
#[doc = " \"description\": \"Object defining readiness.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"contributors\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"contributors\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicReadinessContributors\""]
#[doc = " },"]
#[doc = " \"score\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Readiness score in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"temperature_deviation\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Temperature deviation in degrees Celsius.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"temperature_trend_deviation\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Temperature trend deviation in degrees Celsius.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicReadiness {
pub contributors: PublicReadinessContributors,
#[doc = "Readiness score in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub score: ::std::option::Option<i64>,
#[doc = "Temperature deviation in degrees Celsius."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub temperature_deviation: ::std::option::Option<f64>,
#[doc = "Temperature trend deviation in degrees Celsius."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub temperature_trend_deviation: ::std::option::Option<f64>,
}
#[doc = "Object defining readiness score contributors."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicReadinessContributors\","]
#[doc = " \"description\": \"Object defining readiness score contributors.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"properties\": {"]
#[doc = " \"activity_balance\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of cumulative activity balance in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"body_temperature\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of body temperature in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"hrv_balance\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of heart rate variability balance in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"previous_day_activity\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of previous day's activity in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"previous_night\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of previous night's sleep in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"recovery_index\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of recovery index in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"resting_heart_rate\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of resting heart rate in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"sleep_balance\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of sleep balance in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"sleep_regularity\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of sleep regularity in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicReadinessContributors {
#[doc = "Contribution of cumulative activity balance in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub activity_balance: ::std::option::Option<i64>,
#[doc = "Contribution of body temperature in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub body_temperature: ::std::option::Option<i64>,
#[doc = "Contribution of heart rate variability balance in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hrv_balance: ::std::option::Option<i64>,
#[doc = "Contribution of previous day's activity in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub previous_day_activity: ::std::option::Option<i64>,
#[doc = "Contribution of previous night's sleep in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub previous_night: ::std::option::Option<i64>,
#[doc = "Contribution of recovery index in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recovery_index: ::std::option::Option<i64>,
#[doc = "Contribution of resting heart rate in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resting_heart_rate: ::std::option::Option<i64>,
#[doc = "Contribution of sleep balance in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sleep_balance: ::std::option::Option<i64>,
#[doc = "Contribution of sleep regularity in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sleep_regularity: ::std::option::Option<i64>,
}
impl ::std::default::Default for PublicReadinessContributors {
fn default() -> Self {
Self {
activity_balance: Default::default(),
body_temperature: Default::default(),
hrv_balance: Default::default(),
previous_day_activity: Default::default(),
previous_night: Default::default(),
recovery_index: Default::default(),
resting_heart_rate: Default::default(),
sleep_balance: Default::default(),
sleep_regularity: Default::default(),
}
}
}
#[doc = "Object defining a public Rest Mode episode."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicRestModeEpisode\","]
#[doc = " \"description\": \"Object defining a public Rest Mode episode.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"tags\","]
#[doc = " \"timestamp\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"tags\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Tags selected for the episode.\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"type\": \"string\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicRestModeEpisode {
#[doc = "Tags selected for the episode."]
pub tags: ::std::vec::Vec<::std::string::String>,
pub timestamp: LocalizedDateTime,
}
#[doc = "Rest mode episode information."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicRestModePeriod\","]
#[doc = " \"description\": \"Rest mode episode information.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"episodes\","]
#[doc = " \"id\","]
#[doc = " \"start_day\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"end_day\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"End date of rest mode.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"end_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Timestamp when rest mode ended.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"episodes\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Collection of episodes during rest mode, consisting of tags.\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicRestModeEpisode\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"start_day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"start_time\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Timestamp when rest mode ended.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicrestmodeperiod\","]
#[doc = " \"x-owner\": \"sleep-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicRestModePeriod {
#[doc = "End date of rest mode."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_day: ::std::option::Option<IsoDate>,
#[doc = "Timestamp when rest mode ended."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_time: ::std::option::Option<LocalizedDateTime>,
#[doc = "Collection of episodes during rest mode, consisting of tags."]
pub episodes: ::std::vec::Vec<PublicRestModeEpisode>,
#[doc = "Unique identifier of the object."]
pub id: X,
pub start_day: IsoDate,
#[doc = "Timestamp when rest mode ended."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_time: ::std::option::Option<LocalizedDateTime>,
}
#[doc = "Object defining a ring battery level event."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicRingBatteryLevelRow\","]
#[doc = " \"description\": \"Object defining a ring battery level event.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"level\","]
#[doc = " \"timestamp\","]
#[doc = " \"timestamp_unix\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"charging\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Flag indicating if the ring was charging.\","]
#[doc = " \"type\": ["]
#[doc = " \"boolean\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"in_charger\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Flag indicating if the ring was in charger.\","]
#[doc = " \"type\": ["]
#[doc = " \"boolean\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"level\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Ring battery level percentage. These values are within [0, 100].\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/UtcDateTime\""]
#[doc = " },"]
#[doc = " \"timestamp_unix\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Timestamp of the discrete sample as unix time in milliseconds.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicringbatterylevel\","]
#[doc = " \"x-owner\": \"connectivity-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicRingBatteryLevelRow {
#[doc = "Flag indicating if the ring was charging."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub charging: ::std::option::Option<bool>,
#[doc = "Flag indicating if the ring was in charger."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub in_charger: ::std::option::Option<bool>,
#[doc = "Ring battery level percentage. These values are within [0, 100]."]
pub level: i64,
pub timestamp: UtcDateTime,
#[doc = "Timestamp of the discrete sample as unix time in milliseconds."]
pub timestamp_unix: i64,
}
#[doc = "Possible ring colors."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicRingColor\","]
#[doc = " \"description\": \"Possible ring colors.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"brushed_silver\","]
#[doc = " \"glossy_black\","]
#[doc = " \"glossy_gold\","]
#[doc = " \"glossy_white\","]
#[doc = " \"gucci\","]
#[doc = " \"matt_gold\","]
#[doc = " \"rose\","]
#[doc = " \"silver\","]
#[doc = " \"stealth_black\","]
#[doc = " \"titanium\","]
#[doc = " \"titanium_and_gold\","]
#[doc = " \"cloud\","]
#[doc = " \"petal\","]
#[doc = " \"midnight\","]
#[doc = " \"tide\","]
#[doc = " \"deep_rose\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicRingColor {
#[serde(rename = "brushed_silver")]
BrushedSilver,
#[serde(rename = "glossy_black")]
GlossyBlack,
#[serde(rename = "glossy_gold")]
GlossyGold,
#[serde(rename = "glossy_white")]
GlossyWhite,
#[serde(rename = "gucci")]
Gucci,
#[serde(rename = "matt_gold")]
MattGold,
#[serde(rename = "rose")]
Rose,
#[serde(rename = "silver")]
Silver,
#[serde(rename = "stealth_black")]
StealthBlack,
#[serde(rename = "titanium")]
Titanium,
#[serde(rename = "titanium_and_gold")]
TitaniumAndGold,
#[serde(rename = "cloud")]
Cloud,
#[serde(rename = "petal")]
Petal,
#[serde(rename = "midnight")]
Midnight,
#[serde(rename = "tide")]
Tide,
#[serde(rename = "deep_rose")]
DeepRose,
}
impl ::std::fmt::Display for PublicRingColor {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::BrushedSilver => f.write_str("brushed_silver"),
Self::GlossyBlack => f.write_str("glossy_black"),
Self::GlossyGold => f.write_str("glossy_gold"),
Self::GlossyWhite => f.write_str("glossy_white"),
Self::Gucci => f.write_str("gucci"),
Self::MattGold => f.write_str("matt_gold"),
Self::Rose => f.write_str("rose"),
Self::Silver => f.write_str("silver"),
Self::StealthBlack => f.write_str("stealth_black"),
Self::Titanium => f.write_str("titanium"),
Self::TitaniumAndGold => f.write_str("titanium_and_gold"),
Self::Cloud => f.write_str("cloud"),
Self::Petal => f.write_str("petal"),
Self::Midnight => f.write_str("midnight"),
Self::Tide => f.write_str("tide"),
Self::DeepRose => f.write_str("deep_rose"),
}
}
}
impl ::std::str::FromStr for PublicRingColor {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"brushed_silver" => Ok(Self::BrushedSilver),
"glossy_black" => Ok(Self::GlossyBlack),
"glossy_gold" => Ok(Self::GlossyGold),
"glossy_white" => Ok(Self::GlossyWhite),
"gucci" => Ok(Self::Gucci),
"matt_gold" => Ok(Self::MattGold),
"rose" => Ok(Self::Rose),
"silver" => Ok(Self::Silver),
"stealth_black" => Ok(Self::StealthBlack),
"titanium" => Ok(Self::Titanium),
"titanium_and_gold" => Ok(Self::TitaniumAndGold),
"cloud" => Ok(Self::Cloud),
"petal" => Ok(Self::Petal),
"midnight" => Ok(Self::Midnight),
"tide" => Ok(Self::Tide),
"deep_rose" => Ok(Self::DeepRose),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicRingColor {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicRingColor {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicRingColor {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Ring configuration."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicRingConfiguration\","]
#[doc = " \"description\": \"Ring configuration.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"id\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"color\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Color of the ring.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicRingColor\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"design\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Design of the ring.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicRingDesign\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"firmware_version\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Firmware version of the ring.\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"hardware_type\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Hardware type of the ring.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicRingHardwareType\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"set_up_at\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"UTC timestamp indicating when the ring was set up.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/UtcDateTime\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"size\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"US size of the ring.\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicringconfiguration\","]
#[doc = " \"x-owner\": \"connectivity-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicRingConfiguration {
#[doc = "Color of the ring."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub color: ::std::option::Option<PublicRingColor>,
#[doc = "Design of the ring."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub design: ::std::option::Option<PublicRingDesign>,
#[doc = "Firmware version of the ring."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub firmware_version: ::std::option::Option<::std::string::String>,
#[doc = "Hardware type of the ring."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hardware_type: ::std::option::Option<PublicRingHardwareType>,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "UTC timestamp indicating when the ring was set up."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub set_up_at: ::std::option::Option<UtcDateTime>,
#[doc = "US size of the ring."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub size: ::std::option::Option<i64>,
}
#[doc = "Possible ring designs."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicRingDesign\","]
#[doc = " \"description\": \"Possible ring designs.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"heritage\","]
#[doc = " \"balance\","]
#[doc = " \"balance_diamond\","]
#[doc = " \"horizon\","]
#[doc = " \"ceramic\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicRingDesign {
#[serde(rename = "heritage")]
Heritage,
#[serde(rename = "balance")]
Balance,
#[serde(rename = "balance_diamond")]
BalanceDiamond,
#[serde(rename = "horizon")]
Horizon,
#[serde(rename = "ceramic")]
Ceramic,
}
impl ::std::fmt::Display for PublicRingDesign {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Heritage => f.write_str("heritage"),
Self::Balance => f.write_str("balance"),
Self::BalanceDiamond => f.write_str("balance_diamond"),
Self::Horizon => f.write_str("horizon"),
Self::Ceramic => f.write_str("ceramic"),
}
}
}
impl ::std::str::FromStr for PublicRingDesign {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"heritage" => Ok(Self::Heritage),
"balance" => Ok(Self::Balance),
"balance_diamond" => Ok(Self::BalanceDiamond),
"horizon" => Ok(Self::Horizon),
"ceramic" => Ok(Self::Ceramic),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicRingDesign {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicRingDesign {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicRingDesign {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Possible ring hardware types."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicRingHardwareType\","]
#[doc = " \"description\": \"Possible ring hardware types.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"gen1\","]
#[doc = " \"gen2\","]
#[doc = " \"gen2m\","]
#[doc = " \"gen3\","]
#[doc = " \"gen4\","]
#[doc = " \"or5\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicRingHardwareType {
#[serde(rename = "gen1")]
Gen1,
#[serde(rename = "gen2")]
Gen2,
#[serde(rename = "gen2m")]
Gen2m,
#[serde(rename = "gen3")]
Gen3,
#[serde(rename = "gen4")]
Gen4,
#[serde(rename = "or5")]
Or5,
}
impl ::std::fmt::Display for PublicRingHardwareType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Gen1 => f.write_str("gen1"),
Self::Gen2 => f.write_str("gen2"),
Self::Gen2m => f.write_str("gen2m"),
Self::Gen3 => f.write_str("gen3"),
Self::Gen4 => f.write_str("gen4"),
Self::Or5 => f.write_str("or5"),
}
}
}
impl ::std::str::FromStr for PublicRingHardwareType {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"gen1" => Ok(Self::Gen1),
"gen2" => Ok(Self::Gen2),
"gen2m" => Ok(Self::Gen2m),
"gen3" => Ok(Self::Gen3),
"gen4" => Ok(Self::Gen4),
"or5" => Ok(Self::Or5),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicRingHardwareType {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicRingHardwareType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicRingHardwareType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Object defining a recorded sample."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSample\","]
#[doc = " \"description\": \"Object defining a recorded sample.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"interval\","]
#[doc = " \"items\","]
#[doc = " \"timestamp\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"interval\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Interval in seconds between the sampled items.\","]
#[doc = " \"type\": \"number\""]
#[doc = " },"]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/Array_Union_float__NoneType__Bits64_\""]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicSample {
#[doc = "Interval in seconds between the sampled items."]
pub interval: f64,
pub items: ArrayUnionFloatNoneTypeBits64,
pub timestamp: LocalizedDateTime,
}
#[doc = "Public model defining a recorded Session."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSession\","]
#[doc = " \"description\": \"Public model defining a recorded Session.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"day\","]
#[doc = " \"end_datetime\","]
#[doc = " \"id\","]
#[doc = " \"start_datetime\","]
#[doc = " \"type\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"end_datetime\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " },"]
#[doc = " \"heart_rate\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Recorded heart rate samples during the Moment.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"heart_rate_variability\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Recorded heart rate variability samples during the Moment.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"mood\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"User-selected mood for the Moment.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicMomentMood\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"motion_count\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Recorded motion count samples during the Moment.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"start_datetime\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " },"]
#[doc = " \"type\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicMomentType\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicsession\","]
#[doc = " \"x-owner\": \"wellbeing-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicSession {
pub day: IsoDate,
pub end_datetime: LocalizedDateTime,
#[doc = "Recorded heart rate samples during the Moment."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub heart_rate: ::std::option::Option<PublicSample>,
#[doc = "Recorded heart rate variability samples during the Moment."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub heart_rate_variability: ::std::option::Option<PublicSample>,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "User-selected mood for the Moment."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mood: ::std::option::Option<PublicMomentMood>,
#[doc = "Recorded motion count samples during the Moment."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub motion_count: ::std::option::Option<PublicSample>,
pub start_datetime: LocalizedDateTime,
#[serde(rename = "type")]
pub type_: PublicMomentType,
}
#[doc = "Oura Sleep Staging Algorithms.\nv1 = original aka legacy aka OSSA 1.0,\nv2 = latest sleep algorithm"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSleepAlgorithmVersion\","]
#[doc = " \"description\": \"Oura Sleep Staging Algorithms.\\nv1 = original aka legacy aka OSSA 1.0,\\nv2 = latest sleep algorithm\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"v1\","]
#[doc = " \"v2\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicSleepAlgorithmVersion {
#[serde(rename = "v1")]
V1,
#[serde(rename = "v2")]
V2,
}
impl ::std::fmt::Display for PublicSleepAlgorithmVersion {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::V1 => f.write_str("v1"),
Self::V2 => f.write_str("v2"),
}
}
}
impl ::std::str::FromStr for PublicSleepAlgorithmVersion {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"v1" => Ok(Self::V1),
"v2" => Ok(Self::V2),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicSleepAlgorithmVersion {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepAlgorithmVersion {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicSleepAlgorithmVersion {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Possible sleep analysis reasons."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSleepAnalysisReason\","]
#[doc = " \"description\": \"Possible sleep analysis reasons.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"foreground_sleep_analysis\","]
#[doc = " \"bedtime_edit\","]
#[doc = " \"background_sleep_analysis\","]
#[doc = " \"background_created_foreground_updated\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicSleepAnalysisReason {
#[serde(rename = "foreground_sleep_analysis")]
ForegroundSleepAnalysis,
#[serde(rename = "bedtime_edit")]
BedtimeEdit,
#[serde(rename = "background_sleep_analysis")]
BackgroundSleepAnalysis,
#[serde(rename = "background_created_foreground_updated")]
BackgroundCreatedForegroundUpdated,
}
impl ::std::fmt::Display for PublicSleepAnalysisReason {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ForegroundSleepAnalysis => f.write_str("foreground_sleep_analysis"),
Self::BedtimeEdit => f.write_str("bedtime_edit"),
Self::BackgroundSleepAnalysis => f.write_str("background_sleep_analysis"),
Self::BackgroundCreatedForegroundUpdated => {
f.write_str("background_created_foreground_updated")
}
}
}
}
impl ::std::str::FromStr for PublicSleepAnalysisReason {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"foreground_sleep_analysis" => Ok(Self::ForegroundSleepAnalysis),
"bedtime_edit" => Ok(Self::BedtimeEdit),
"background_sleep_analysis" => Ok(Self::BackgroundSleepAnalysis),
"background_created_foreground_updated" => {
Ok(Self::BackgroundCreatedForegroundUpdated)
}
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicSleepAnalysisReason {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepAnalysisReason {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicSleepAnalysisReason {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Object defining sleep score contributors."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSleepContributors\","]
#[doc = " \"description\": \"Object defining sleep score contributors.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"properties\": {"]
#[doc = " \"deep_sleep\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of deep sleep in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"efficiency\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of sleep efficiency in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"latency\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of sleep latency in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"rem_sleep\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of REM sleep in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"restfulness\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of sleep restfulness in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"timing\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of sleep timing in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"total_sleep\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Contribution of total sleep in range [1, 100].\","]
#[doc = " \"type\": ["]
#[doc = " \"integer\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicSleepContributors {
#[doc = "Contribution of deep sleep in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deep_sleep: ::std::option::Option<i64>,
#[doc = "Contribution of sleep efficiency in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub efficiency: ::std::option::Option<i64>,
#[doc = "Contribution of sleep latency in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub latency: ::std::option::Option<i64>,
#[doc = "Contribution of REM sleep in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rem_sleep: ::std::option::Option<i64>,
#[doc = "Contribution of sleep restfulness in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub restfulness: ::std::option::Option<i64>,
#[doc = "Contribution of sleep timing in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timing: ::std::option::Option<i64>,
#[doc = "Contribution of total sleep in range [1, 100]."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub total_sleep: ::std::option::Option<i64>,
}
impl ::std::default::Default for PublicSleepContributors {
fn default() -> Self {
Self {
deep_sleep: Default::default(),
efficiency: Default::default(),
latency: Default::default(),
rem_sleep: Default::default(),
restfulness: Default::default(),
timing: Default::default(),
total_sleep: Default::default(),
}
}
}
#[doc = "Suggested bedtime for the user."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSleepTime\","]
#[doc = " \"description\": \"Suggested bedtime for the user.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"day\","]
#[doc = " \"id\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"optimal_bedtime\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Optimal bedtime.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSleepTimeWindow\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"recommendation\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Recommended action for bedtime.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSleepTimeRecommendation\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"status\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Sleep time status; used to inform sleep time recommendation.\","]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicSleepTimeStatus\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicsleeptime\","]
#[doc = " \"x-owner\": \"sleep-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicSleepTime {
pub day: IsoDate,
#[doc = "Unique identifier of the object."]
pub id: X,
#[doc = "Optimal bedtime."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub optimal_bedtime: ::std::option::Option<PublicSleepTimeWindow>,
#[doc = "Recommended action for bedtime."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recommendation: ::std::option::Option<PublicSleepTimeRecommendation>,
#[doc = "Sleep time status; used to inform sleep time recommendation."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<PublicSleepTimeStatus>,
}
#[doc = "Possible public SleepTime recommendation."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSleepTimeRecommendation\","]
#[doc = " \"description\": \"Possible public SleepTime recommendation.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"improve_efficiency\","]
#[doc = " \"earlier_bedtime\","]
#[doc = " \"later_bedtime\","]
#[doc = " \"earlier_wake_up_time\","]
#[doc = " \"later_wake_up_time\","]
#[doc = " \"follow_optimal_bedtime\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicSleepTimeRecommendation {
#[serde(rename = "improve_efficiency")]
ImproveEfficiency,
#[serde(rename = "earlier_bedtime")]
EarlierBedtime,
#[serde(rename = "later_bedtime")]
LaterBedtime,
#[serde(rename = "earlier_wake_up_time")]
EarlierWakeUpTime,
#[serde(rename = "later_wake_up_time")]
LaterWakeUpTime,
#[serde(rename = "follow_optimal_bedtime")]
FollowOptimalBedtime,
}
impl ::std::fmt::Display for PublicSleepTimeRecommendation {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::ImproveEfficiency => f.write_str("improve_efficiency"),
Self::EarlierBedtime => f.write_str("earlier_bedtime"),
Self::LaterBedtime => f.write_str("later_bedtime"),
Self::EarlierWakeUpTime => f.write_str("earlier_wake_up_time"),
Self::LaterWakeUpTime => f.write_str("later_wake_up_time"),
Self::FollowOptimalBedtime => f.write_str("follow_optimal_bedtime"),
}
}
}
impl ::std::str::FromStr for PublicSleepTimeRecommendation {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"improve_efficiency" => Ok(Self::ImproveEfficiency),
"earlier_bedtime" => Ok(Self::EarlierBedtime),
"later_bedtime" => Ok(Self::LaterBedtime),
"earlier_wake_up_time" => Ok(Self::EarlierWakeUpTime),
"later_wake_up_time" => Ok(Self::LaterWakeUpTime),
"follow_optimal_bedtime" => Ok(Self::FollowOptimalBedtime),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicSleepTimeRecommendation {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepTimeRecommendation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicSleepTimeRecommendation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Possible public SleepTime status."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSleepTimeStatus\","]
#[doc = " \"description\": \"Possible public SleepTime status.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"not_enough_nights\","]
#[doc = " \"not_enough_recent_nights\","]
#[doc = " \"bad_sleep_quality\","]
#[doc = " \"only_recommended_found\","]
#[doc = " \"optimal_found\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicSleepTimeStatus {
#[serde(rename = "not_enough_nights")]
NotEnoughNights,
#[serde(rename = "not_enough_recent_nights")]
NotEnoughRecentNights,
#[serde(rename = "bad_sleep_quality")]
BadSleepQuality,
#[serde(rename = "only_recommended_found")]
OnlyRecommendedFound,
#[serde(rename = "optimal_found")]
OptimalFound,
}
impl ::std::fmt::Display for PublicSleepTimeStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::NotEnoughNights => f.write_str("not_enough_nights"),
Self::NotEnoughRecentNights => f.write_str("not_enough_recent_nights"),
Self::BadSleepQuality => f.write_str("bad_sleep_quality"),
Self::OnlyRecommendedFound => f.write_str("only_recommended_found"),
Self::OptimalFound => f.write_str("optimal_found"),
}
}
}
impl ::std::str::FromStr for PublicSleepTimeStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"not_enough_nights" => Ok(Self::NotEnoughNights),
"not_enough_recent_nights" => Ok(Self::NotEnoughRecentNights),
"bad_sleep_quality" => Ok(Self::BadSleepQuality),
"only_recommended_found" => Ok(Self::OnlyRecommendedFound),
"optimal_found" => Ok(Self::OptimalFound),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicSleepTimeStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepTimeStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicSleepTimeStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Object defining sleep time window"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSleepTimeWindow\","]
#[doc = " \"description\": \"Object defining sleep time window\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"day_tz\","]
#[doc = " \"end_offset\","]
#[doc = " \"start_offset\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"day_tz\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Timezone offset in second from GMT of the day\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"end_offset\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"End offset from midnight in second\","]
#[doc = " \"type\": \"integer\""]
#[doc = " },"]
#[doc = " \"start_offset\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Start offset from midnight in second\","]
#[doc = " \"type\": \"integer\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicSleepTimeWindow {
#[doc = "Timezone offset in second from GMT of the day"]
pub day_tz: i64,
#[doc = "End offset from midnight in second"]
pub end_offset: i64,
#[doc = "Start offset from midnight in second"]
pub start_offset: i64,
}
#[doc = "Possible sleep period types.\n'deleted' = deleted sleep by user.\n'sleep' = user confirmed sleep / nap, min 15 minutes, max 3 hours, contributes to daily scores\n'late_nap' = user confirmed sleep / nap, min 15 minutes, ended after sleep day change (6 pm), contributes to next days daily scores\n'long_sleep' = sleep that is long enough (>3h) to automatically contribute to daily scores\n'rest' = Falsely detected sleep / nap, rejected in confirm prompt by user"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSleepType\","]
#[doc = " \"description\": \"Possible sleep period types.\\n'deleted' = deleted sleep by user.\\n'sleep' = user confirmed sleep / nap, min 15 minutes, max 3 hours, contributes to daily scores\\n'late_nap' = user confirmed sleep / nap, min 15 minutes, ended after sleep day change (6 pm), contributes to next days daily scores\\n'long_sleep' = sleep that is long enough (>3h) to automatically contribute to daily scores\\n'rest' = Falsely detected sleep / nap, rejected in confirm prompt by user\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"deleted\","]
#[doc = " \"sleep\","]
#[doc = " \"long_sleep\","]
#[doc = " \"late_nap\","]
#[doc = " \"rest\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicSleepType {
#[serde(rename = "deleted")]
Deleted,
#[serde(rename = "sleep")]
Sleep,
#[serde(rename = "long_sleep")]
LongSleep,
#[serde(rename = "late_nap")]
LateNap,
#[serde(rename = "rest")]
Rest,
}
impl ::std::fmt::Display for PublicSleepType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Deleted => f.write_str("deleted"),
Self::Sleep => f.write_str("sleep"),
Self::LongSleep => f.write_str("long_sleep"),
Self::LateNap => f.write_str("late_nap"),
Self::Rest => f.write_str("rest"),
}
}
}
impl ::std::str::FromStr for PublicSleepType {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"deleted" => Ok(Self::Deleted),
"sleep" => Ok(Self::Sleep),
"long_sleep" => Ok(Self::LongSleep),
"late_nap" => Ok(Self::LateNap),
"rest" => Ok(Self::Rest),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicSleepType {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicSleepType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Object defining public spo2 aggregated values."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicSpo2AggregatedValues\","]
#[doc = " \"description\": \"Object defining public spo2 aggregated values.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"average\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"average\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Average of spo2.\","]
#[doc = " \"type\": \"number\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicSpo2AggregatedValues {
#[doc = "Average of spo2."]
pub average: f64,
}
#[doc = "VO2Max estimate."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicVO2Max\","]
#[doc = " \"description\": \"VO2Max estimate.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"day\","]
#[doc = " \"id\","]
#[doc = " \"timestamp\","]
#[doc = " \"vo2_max\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " },"]
#[doc = " \"vo2_max\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"VO2 max value.\","]
#[doc = " \"type\": \"integer\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicvo2max\","]
#[doc = " \"x-owner\": \"movement-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicVo2Max {
pub day: IsoDate,
#[doc = "Unique identifier of the object."]
pub id: X,
pub timestamp: LocalizedDateTime,
#[doc = "VO2 max value."]
pub vo2_max: i64,
}
#[doc = "Public model for Workout."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicWorkout\","]
#[doc = " \"description\": \"Public model for Workout.\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"activity\","]
#[doc = " \"day\","]
#[doc = " \"end_datetime\","]
#[doc = " \"id\","]
#[doc = " \"intensity\","]
#[doc = " \"source\","]
#[doc = " \"start_datetime\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"activity\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Type of the workout activity.\","]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " \"calories\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Energy burned in kilocalories during the workout.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"day\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
#[doc = " },"]
#[doc = " \"distance\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Distance traveled in meters during the workout.\","]
#[doc = " \"type\": ["]
#[doc = " \"number\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"end_datetime\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = " },"]
#[doc = " \"intensity\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicWorkoutIntensity\""]
#[doc = " },"]
#[doc = " \"label\": {"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"User-defined label for the workout.\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"source\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicWorkoutSource\""]
#[doc = " },"]
#[doc = " \"start_datetime\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"x-cloud-only\": true,"]
#[doc = " \"x-collection\": \"publicworkout\","]
#[doc = " \"x-owner\": \"movement-squad\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct PublicWorkout {
#[doc = "Type of the workout activity."]
pub activity: ::std::string::String,
#[doc = "Energy burned in kilocalories during the workout."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub calories: ::std::option::Option<f64>,
pub day: IsoDate,
#[doc = "Distance traveled in meters during the workout."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub distance: ::std::option::Option<f64>,
pub end_datetime: LocalizedDateTime,
#[doc = "Unique identifier of the object."]
pub id: X,
pub intensity: PublicWorkoutIntensity,
#[doc = "User-defined label for the workout."]
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
pub source: PublicWorkoutSource,
pub start_datetime: LocalizedDateTime,
}
#[doc = "Possible workout intensities."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicWorkoutIntensity\","]
#[doc = " \"description\": \"Possible workout intensities.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"easy\","]
#[doc = " \"moderate\","]
#[doc = " \"hard\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicWorkoutIntensity {
#[serde(rename = "easy")]
Easy,
#[serde(rename = "moderate")]
Moderate,
#[serde(rename = "hard")]
Hard,
}
impl ::std::fmt::Display for PublicWorkoutIntensity {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Easy => f.write_str("easy"),
Self::Moderate => f.write_str("moderate"),
Self::Hard => f.write_str("hard"),
}
}
}
impl ::std::str::FromStr for PublicWorkoutIntensity {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"easy" => Ok(Self::Easy),
"moderate" => Ok(Self::Moderate),
"hard" => Ok(Self::Hard),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicWorkoutIntensity {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicWorkoutIntensity {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicWorkoutIntensity {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "Possible workout sources."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"PublicWorkoutSource\","]
#[doc = " \"description\": \"Possible workout sources.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"manual\","]
#[doc = " \"autodetected\","]
#[doc = " \"confirmed\","]
#[doc = " \"workout_heart_rate\","]
#[doc = " \"live_third_party_heart_rate\","]
#[doc = " \"live_oura_heart_rate\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicWorkoutSource {
#[serde(rename = "manual")]
Manual,
#[serde(rename = "autodetected")]
Autodetected,
#[serde(rename = "confirmed")]
Confirmed,
#[serde(rename = "workout_heart_rate")]
WorkoutHeartRate,
#[serde(rename = "live_third_party_heart_rate")]
LiveThirdPartyHeartRate,
#[serde(rename = "live_oura_heart_rate")]
LiveOuraHeartRate,
}
impl ::std::fmt::Display for PublicWorkoutSource {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Manual => f.write_str("manual"),
Self::Autodetected => f.write_str("autodetected"),
Self::Confirmed => f.write_str("confirmed"),
Self::WorkoutHeartRate => f.write_str("workout_heart_rate"),
Self::LiveThirdPartyHeartRate => f.write_str("live_third_party_heart_rate"),
Self::LiveOuraHeartRate => f.write_str("live_oura_heart_rate"),
}
}
}
impl ::std::str::FromStr for PublicWorkoutSource {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"manual" => Ok(Self::Manual),
"autodetected" => Ok(Self::Autodetected),
"confirmed" => Ok(Self::Confirmed),
"workout_heart_rate" => Ok(Self::WorkoutHeartRate),
"live_third_party_heart_rate" => Ok(Self::LiveThirdPartyHeartRate),
"live_oura_heart_rate" => Ok(Self::LiveOuraHeartRate),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicWorkoutSource {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicWorkoutSource {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicWorkoutSource {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "`ResilienceContributors`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"ResilienceContributors\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"daytime_recovery\","]
#[doc = " \"sleep_recovery\","]
#[doc = " \"stress\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"daytime_recovery\": {"]
#[doc = " \"title\": \"Daytime Recovery\","]
#[doc = " \"description\": \"Daytime recovery contributor to the resilience score. Range: [0, 100]\","]
#[doc = " \"type\": \"number\""]
#[doc = " },"]
#[doc = " \"sleep_recovery\": {"]
#[doc = " \"title\": \"Sleep Recovery\","]
#[doc = " \"description\": \"Sleep recovery contributor to the resilience score. Range: [0, 100]\","]
#[doc = " \"type\": \"number\""]
#[doc = " },"]
#[doc = " \"stress\": {"]
#[doc = " \"title\": \"Stress\","]
#[doc = " \"description\": \"Stress contributor to the resilience score. Range: [0, 100]\","]
#[doc = " \"type\": \"number\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct ResilienceContributors {
#[doc = "Daytime recovery contributor to the resilience score. Range: [0, 100]"]
pub daytime_recovery: f64,
#[doc = "Sleep recovery contributor to the resilience score. Range: [0, 100]"]
pub sleep_recovery: f64,
#[doc = "Stress contributor to the resilience score. Range: [0, 100]"]
pub stress: f64,
}
#[doc = "`ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"Response Multiple Heartrate Documents V2 Usercollection Heartrate Get\","]
#[doc = " \"anyOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponse_PublicHeartRateRow_\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponseDict\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet {
#[serde(
flatten,
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subtype_0: ::std::option::Option<TimeSeriesResponsePublicHeartRateRow>,
#[serde(
flatten,
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subtype_1: ::std::option::Option<TimeSeriesResponseDict>,
}
impl ::std::default::Default for ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet {
fn default() -> Self {
Self {
subtype_0: Default::default(),
subtype_1: Default::default(),
}
}
}
#[doc = "`ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"Response Multiple Ring Battery Level Documents V2 Usercollection Ring Battery Level Get\","]
#[doc = " \"anyOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponse_PublicRingBatteryLevelRow_\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponseDict\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet {
#[serde(
flatten,
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subtype_0: ::std::option::Option<TimeSeriesResponsePublicRingBatteryLevelRow>,
#[serde(
flatten,
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subtype_1: ::std::option::Option<TimeSeriesResponseDict>,
}
impl ::std::default::Default
for ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet
{
fn default() -> Self {
Self {
subtype_0: Default::default(),
subtype_1: Default::default(),
}
}
}
#[doc = "`ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"Response Sandbox Multiple Heartrate Documents V2 Sandbox Usercollection Heartrate Get\","]
#[doc = " \"anyOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponse_PublicHeartRateRow_\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponseDict\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet {
#[serde(
flatten,
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subtype_0: ::std::option::Option<TimeSeriesResponsePublicHeartRateRow>,
#[serde(
flatten,
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subtype_1: ::std::option::Option<TimeSeriesResponseDict>,
}
impl ::std::default::Default
for ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet
{
fn default() -> Self {
Self {
subtype_0: Default::default(),
subtype_1: Default::default(),
}
}
}
#[doc = "`ResponseSandboxMultipleRingBatteryLevelDocumentsV2SandboxUsercollectionRingBatteryLevelGet`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"Response Sandbox Multiple Ring Battery Level Documents V2 Sandbox Usercollection Ring Battery Level Get\","]
#[doc = " \"anyOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponse_PublicRingBatteryLevelRow_\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponseDict\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct ResponseSandboxMultipleRingBatteryLevelDocumentsV2SandboxUsercollectionRingBatteryLevelGet
{
#[serde(
flatten,
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subtype_0: ::std::option::Option<TimeSeriesResponsePublicRingBatteryLevelRow>,
#[serde(
flatten,
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub subtype_1: ::std::option::Option<TimeSeriesResponseDict>,
}
impl :: std :: default :: Default for ResponseSandboxMultipleRingBatteryLevelDocumentsV2SandboxUsercollectionRingBatteryLevelGet { fn default () -> Self { Self { subtype_0 : Default :: default () , subtype_1 : Default :: default () , } } }
#[doc = "A TagModel maps to an ASSANote. An ASSANote in ExtAPIV2 is called a Tag\nA TagModel will be populated by data from an ASSANote\nThe fields in the TagModel map to fields in an ASSANote"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"TagModel\","]
#[doc = " \"description\": \"A TagModel maps to an ASSANote. An ASSANote in ExtAPIV2 is called a Tag\\nA TagModel will be populated by data from an ASSANote\\nThe fields in the TagModel map to fields in an ASSANote\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"day\","]
#[doc = " \"id\","]
#[doc = " \"tags\","]
#[doc = " \"text\","]
#[doc = " \"timestamp\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"day\": {"]
#[doc = " \"title\": \"Day\","]
#[doc = " \"description\": \"Day that the note belongs to.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"format\": \"date\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"Id\","]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " \"tags\": {"]
#[doc = " \"title\": \"Tags\","]
#[doc = " \"description\": \"Selected tags for the tag.\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"type\": \"string\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"text\": {"]
#[doc = " \"title\": \"Text\","]
#[doc = " \"description\": \"Textual contents of the note.\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"timestamp\": {"]
#[doc = " \"$ref\": \"#/components/schemas/LocalDateTime\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct TagModel {
#[doc = "Day that the note belongs to."]
pub day: ::chrono::naive::NaiveDate,
pub id: ::std::string::String,
#[doc = "Selected tags for the tag."]
pub tags: ::std::vec::Vec<::std::string::String>,
#[doc = "Textual contents of the note."]
pub text: ::std::option::Option<::std::string::String>,
pub timestamp: LocalDateTime,
}
#[doc = "`TimeSeriesResponseDict`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"TimeSeriesResponseDict\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"type\": \"object\","]
#[doc = " \"additionalProperties\": true"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct TimeSeriesResponseDict {
pub data: ::std::vec::Vec<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`TimeSeriesResponsePublicHeartRateRow`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"TimeSeriesResponse[PublicHeartRateRow]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicHeartRateRow\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct TimeSeriesResponsePublicHeartRateRow {
pub data: ::std::vec::Vec<PublicHeartRateRow>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`TimeSeriesResponsePublicRingBatteryLevelRow`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"TimeSeriesResponse[PublicRingBatteryLevelRow]\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"data\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"data\": {"]
#[doc = " \"title\": \"Data\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"$ref\": \"#/components/schemas/PublicRingBatteryLevelRow\""]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"next_token\": {"]
#[doc = " \"title\": \"Next Token\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct TimeSeriesResponsePublicRingBatteryLevelRow {
pub data: ::std::vec::Vec<PublicRingBatteryLevelRow>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub next_token: ::std::option::Option<::std::string::String>,
}
#[doc = "`UpdateWebhookSubscriptionRequest`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"UpdateWebhookSubscriptionRequest\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"verification_token\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"callback_url\": {"]
#[doc = " \"title\": \"Callback Url\","]
#[doc = " \"type\": ["]
#[doc = " \"string\","]
#[doc = " \"null\""]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"data_type\": {"]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/ExtApiV2DataType\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"event_type\": {"]
#[doc = " \"oneOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"null\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"allOf\": ["]
#[doc = " {"]
#[doc = " \"$ref\": \"#/components/schemas/WebhookOperation\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " ]"]
#[doc = " },"]
#[doc = " \"verification_token\": {"]
#[doc = " \"title\": \"Verification Token\","]
#[doc = " \"type\": \"string\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct UpdateWebhookSubscriptionRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub callback_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub data_type: ::std::option::Option<ExtApiV2DataType>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_type: ::std::option::Option<WebhookOperation>,
pub verification_token: ::std::string::String,
}
#[doc = "`UtcDateTime`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"type\": \"string\""]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
#[serde(transparent)]
pub struct UtcDateTime(pub ::std::string::String);
impl ::std::ops::Deref for UtcDateTime {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<UtcDateTime> for ::std::string::String {
fn from(value: UtcDateTime) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for UtcDateTime {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::str::FromStr for UtcDateTime {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::std::fmt::Display for UtcDateTime {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
#[doc = "`ValidationError`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"ValidationError\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"loc\","]
#[doc = " \"msg\","]
#[doc = " \"type\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"ctx\": {"]
#[doc = " \"title\": \"Context\","]
#[doc = " \"type\": \"object\""]
#[doc = " },"]
#[doc = " \"input\": {"]
#[doc = " \"title\": \"Input\""]
#[doc = " },"]
#[doc = " \"loc\": {"]
#[doc = " \"title\": \"Location\","]
#[doc = " \"type\": \"array\","]
#[doc = " \"items\": {"]
#[doc = " \"anyOf\": ["]
#[doc = " {"]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " {"]
#[doc = " \"type\": \"integer\""]
#[doc = " }"]
#[doc = " ]"]
#[doc = " }"]
#[doc = " },"]
#[doc = " \"msg\": {"]
#[doc = " \"title\": \"Message\","]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " \"type\": {"]
#[doc = " \"title\": \"Error Type\","]
#[doc = " \"type\": \"string\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct ValidationError {
#[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
pub ctx: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub input: ::std::option::Option<::serde_json::Value>,
pub loc: ::std::vec::Vec<LocationItem>,
pub msg: ::std::string::String,
#[serde(rename = "type")]
pub type_: ::std::string::String,
}
#[doc = "`WebhookOperation`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"WebhookOperation\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"enum\": ["]
#[doc = " \"create\","]
#[doc = " \"update\","]
#[doc = " \"delete\""]
#[doc = " ]"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(
:: serde :: Deserialize,
:: serde :: Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum WebhookOperation {
#[serde(rename = "create")]
Create,
#[serde(rename = "update")]
Update,
#[serde(rename = "delete")]
Delete,
}
impl ::std::fmt::Display for WebhookOperation {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Create => f.write_str("create"),
Self::Update => f.write_str("update"),
Self::Delete => f.write_str("delete"),
}
}
}
impl ::std::str::FromStr for WebhookOperation {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"create" => Ok(Self::Create),
"update" => Ok(Self::Update),
"delete" => Ok(Self::Delete),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WebhookOperation {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for WebhookOperation {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for WebhookOperation {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[doc = "`WebhookSubscriptionModel`"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"WebhookSubscriptionModel\","]
#[doc = " \"type\": \"object\","]
#[doc = " \"required\": ["]
#[doc = " \"callback_url\","]
#[doc = " \"data_type\","]
#[doc = " \"event_type\","]
#[doc = " \"expiration_time\","]
#[doc = " \"id\""]
#[doc = " ],"]
#[doc = " \"properties\": {"]
#[doc = " \"callback_url\": {"]
#[doc = " \"title\": \"Callback Url\","]
#[doc = " \"type\": \"string\""]
#[doc = " },"]
#[doc = " \"data_type\": {"]
#[doc = " \"$ref\": \"#/components/schemas/ExtApiV2DataType\""]
#[doc = " },"]
#[doc = " \"event_type\": {"]
#[doc = " \"$ref\": \"#/components/schemas/WebhookOperation\""]
#[doc = " },"]
#[doc = " \"expiration_time\": {"]
#[doc = " \"title\": \"Expiration Time\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"format\": \"date-time\""]
#[doc = " },"]
#[doc = " \"id\": {"]
#[doc = " \"title\": \"Id\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"format\": \"uuid4\""]
#[doc = " }"]
#[doc = " }"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
pub struct WebhookSubscriptionModel {
pub callback_url: ::std::string::String,
pub data_type: ExtApiV2DataType,
pub event_type: WebhookOperation,
pub expiration_time: ::chrono::DateTime<::chrono::offset::Utc>,
pub id: ::std::string::String,
}
#[doc = "Unique identifier of the object."]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
#[doc = r""]
#[doc = r" ```json"]
#[doc = "{"]
#[doc = " \"title\": \"\","]
#[doc = " \"description\": \"Unique identifier of the object.\","]
#[doc = " \"type\": \"string\","]
#[doc = " \"minLength\": 1"]
#[doc = "}"]
#[doc = r" ```"]
#[doc = r" </details>"]
#[derive(:: serde :: Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct X(::std::string::String);
impl ::std::ops::Deref for X {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<X> for ::std::string::String {
fn from(value: X) -> Self {
value.0
}
}
impl ::std::str::FromStr for X {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for X {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for X {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for X {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for X {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
}
#[derive(Clone, Debug)]
#[doc = "Client for Oura API Documentation\n\n# Overview \nThe Oura API allows Oura users and partner applications to improve their user experience with Oura data.\nThis document describes the Oura API Version 2 (V2), which is the only available integration point for Oura data. The previous V1 API has been sunset.\n# Getting Started \n## What is an API?\nAn API (Application Programming Interface) allows different software applications to communicate with each other. The Oura API enables you to access your Oura Ring data programmatically.\n## Quick Start Guide\n1. Register an [API Application](https://cloud.ouraring.com/oauth/applications) and implement OAuth2\n2. **Make Your First API Call**:\n ```\n curl -X GET https://api.ouraring.com/v2/usercollection/personal_info \\\n -H \"Authorization: Bearer YOUR_TOKEN_HERE\" \\\n -H \"User-Agent: YourAppName/1.0\"\n ```\n3. **Explore Data Types**:\n - Browse the available endpoints in this documentation to discover what data you can access\n - Each endpoint includes example requests and responses\n4. **Set Up Webhooks (Strongly Recommended)**:\n - Webhooks are the preferred way to consume Oura data\n - We have not had customers hit rate limits with webhooks properly implemented\n - Make a single request for historical data when a user first connects, then use webhooks for ongoing updates\n - Webhook notifications come approximately 30 seconds after data syncs from the mobile app\n - [Set up webhooks](#tag/Webhook-Subscription-Routes) to receive notifications when data changes\n## Common Questions\n- **Data Delay**: Different data types sync at different times - sleep data requires users to open the Oura app, while daily activity and stress may sync in the background\n# Data Access\nIn order to access data, a registered [API Application](https://cloud.ouraring.com/oauth/applications) is required.\n API Applications are limited to **10** users before requiring approval from Oura. There is no limit once an application is approved.\n Additionally, Oura users **must provide consent** to share each data type an API Application has access to.\nAll data access requests through the Oura API require [Authentication](https://cloud.ouraring.com/docs/authentication).\nAdditionally, we recommend that Oura users keep their mobile app updated to support API access for the latest data types.\n# Authentication\nThe Oura Cloud API supports authentication through the industry-standard OAuth2 protocol. For more information, see our [Authentication instructions](https://cloud.ouraring.com/docs/authentication).\nAccess tokens must be included in the request header as follows:\n```http\nGET /v2/usercollection/personal_info HTTP/1.1\nHost: api.ouraring.com\nAuthorization: Bearer <token>\nUser-Agent: YourAppName/1.0\n```\nPlease note that personal access tokens were deprecated in December 2025 and are no longer available for use.\n# User-Agent Header\nEvery request must include a `User-Agent` header that identifies your application, for example `User-Agent: YourAppName/1.0`. Requests without one may be rejected. Not every HTTP library sends a default value, so set it explicitly rather than relying on the default. Browsers set their own `User-Agent` automatically; every other client (server-side code, scripts, native apps) must set it.\n\n# Oura HTTP Response Codes\n| Response Code | Description |\n| ------------------------------------ | - |\n| 200 OK | Successful Response |\n| 400 Query Parameter Validation Error | The request contains query parameters that are invalid or incorrectly formatted. |\n| 401 Unauthorized | Invalid or expired authentication token. |\n| 403 Forbidden | The requested resource requires additional permissions or the user's Oura subscription has expired. |\n| 429 Too Many Requests | Rate limit exceeded. See response headers for retry guidance. |\n\n## Rate Limits\nThe API enforces rate limits at two layers to ensure fair access across all applications:\n- a per-access-token limit, which throttles single-token floods, and\n- a per-application limit, which caps the aggregate traffic across all of an application's end-user tokens so one fan-out app can't dominate shared capacity.\n\nA request that trips either layer receives a `429 Too Many Requests`. The `X-RateLimit-Tier` response header identifies which layer fired.\n\nIf your application regularly approaches rate limits, [webhooks](#tag/Webhook-Subscription-Routes) are strongly recommended — most applications that implement webhooks correctly do not encounter rate limit issues.\n\n[Contact us](mailto:api-support@ouraring.com) if you expect your usage to require higher limits.\n\n## Rate Limit Response Headers\nWhen a `429 Too Many Requests` response is returned, five headers are included to guide retries. Prefer these over fixed-interval backoff:\n- **`Retry-After`** — integer seconds to wait before retrying. RFC 7231-compliant; safe to feed directly into your client's backoff logic.\n- **`X-RateLimit-Limit`** — the request ceiling for the current window.\n- **`X-RateLimit-Window`** — the rolling window length in seconds that the ceiling applies to.\n- **`X-RateLimit-Reset`** — Unix epoch (seconds) at which the window resets and quota is fully restored.\n- **`X-RateLimit-Tier`** — identifies which limit was exceeded, useful when contacting support.\n\n\nhttps://cloud.ouraring.com/legal/api-agreement\n\nVersion: 2.0"]
pub struct Client {
pub(crate) baseurl: String,
pub(crate) client: reqwest::Client,
}
impl Client {
#[doc = r" Create a new client."]
#[doc = r""]
#[doc = r" `baseurl` is the base URL provided to the internal"]
#[doc = r" `reqwest::Client`, and should include a scheme and hostname,"]
#[doc = r" as well as port and a path stem if applicable."]
pub fn new(baseurl: &str) -> Self {
#[cfg(not(target_arch = "wasm32"))]
let client = {
let dur = ::std::time::Duration::from_secs(15u64);
reqwest::ClientBuilder::new()
.connect_timeout(dur)
.timeout(dur)
};
#[cfg(target_arch = "wasm32")]
let client = reqwest::ClientBuilder::new();
Self::new_with_client(baseurl, client.build().unwrap())
}
#[doc = r" Construct a new client with an existing `reqwest::Client`,"]
#[doc = r" allowing more control over its configuration."]
#[doc = r""]
#[doc = r" `baseurl` is the base URL provided to the internal"]
#[doc = r" `reqwest::Client`, and should include a scheme and hostname,"]
#[doc = r" as well as port and a path stem if applicable."]
pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self {
Self {
baseurl: baseurl.to_string(),
client,
}
}
}
impl ClientInfo<()> for Client {
fn api_version() -> &'static str {
"2.0"
}
fn baseurl(&self) -> &str {
self.baseurl.as_str()
}
fn client(&self) -> &reqwest::Client {
&self.client
}
fn inner(&self) -> &() {
&()
}
}
impl ClientHooks<()> for &Client {}
#[allow(clippy::all)]
impl Client {
#[doc = "Sandbox - Multiple Daily Activity Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_activity`\n\n"]
pub async fn sandbox_multiple_daily_activity_documents_v2_sandbox_usercollection_daily_activity_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailyActivity>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/daily_activity", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_multiple_daily_activity_documents_v2_sandbox_usercollection_daily_activity_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Daily Activity Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_activity/{document_id}`\n\n"]
pub async fn sandbox_single_daily_activity_document_v2_sandbox_usercollection_daily_activity_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailyActivity>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/daily_activity/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_daily_activity_document_v2_sandbox_usercollection_daily_activity_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Daily Cardiovascular Age Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_cardiovascular_age`\n\n"]
pub async fn sandbox_multiple_daily_cardiovascular_age_documents_v2_sandbox_usercollection_daily_cardiovascular_age_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailyCardiovascularAge>,
Error<types::HttpValidationError>,
> {
let url = format!(
"{}/v2/sandbox/usercollection/daily_cardiovascular_age",
self.baseurl,
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_multiple_daily_cardiovascular_age_documents_v2_sandbox_usercollection_daily_cardiovascular_age_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Daily Cardiovascular Age Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_cardiovascular_age/{document_id}`\n\n"]
pub async fn sandbox_single_daily_cardiovascular_age_document_v2_sandbox_usercollection_daily_cardiovascular_age_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailyCardiovascularAge>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/sandbox/usercollection/daily_cardiovascular_age/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_daily_cardiovascular_age_document_v2_sandbox_usercollection_daily_cardiovascular_age_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Daily Readiness Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_readiness`\n\n"]
pub async fn sandbox_multiple_daily_readiness_documents_v2_sandbox_usercollection_daily_readiness_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailyReadiness>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/daily_readiness", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_multiple_daily_readiness_documents_v2_sandbox_usercollection_daily_readiness_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Daily Readiness Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_readiness/{document_id}`\n\n"]
pub async fn sandbox_single_daily_readiness_document_v2_sandbox_usercollection_daily_readiness_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailyReadiness>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/daily_readiness/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_daily_readiness_document_v2_sandbox_usercollection_daily_readiness_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Daily Resilience Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_resilience`\n\n"]
pub async fn sandbox_multiple_daily_resilience_documents_v2_sandbox_usercollection_daily_resilience_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponseDailyResilienceModel>,
Error<types::HttpValidationError>,
> {
let url = format!(
"{}/v2/sandbox/usercollection/daily_resilience",
self.baseurl,
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_multiple_daily_resilience_documents_v2_sandbox_usercollection_daily_resilience_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Daily Resilience Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_resilience/{document_id}`\n\n"]
pub async fn sandbox_single_daily_resilience_document_v2_sandbox_usercollection_daily_resilience_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::DailyResilienceModel>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/daily_resilience/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_daily_resilience_document_v2_sandbox_usercollection_daily_resilience_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Daily Sleep Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_sleep`\n\n"]
pub async fn sandbox_multiple_daily_sleep_documents_v2_sandbox_usercollection_daily_sleep_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailySleep>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/daily_sleep", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_daily_sleep_documents_v2_sandbox_usercollection_daily_sleep_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Daily Sleep Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_sleep/{document_id}`\n\n"]
pub async fn sandbox_single_daily_sleep_document_v2_sandbox_usercollection_daily_sleep_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailySleep>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/daily_sleep/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_daily_sleep_document_v2_sandbox_usercollection_daily_sleep_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Daily Spo2 Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_spo2`\n\n"]
pub async fn sandbox_multiple_daily_spo2_documents_v2_sandbox_usercollection_daily_spo2_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailySpO2>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/daily_spo2", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_daily_spo2_documents_v2_sandbox_usercollection_daily_spo2_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Daily Spo2 Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_spo2/{document_id}`\n\n"]
pub async fn sandbox_single_daily_spo2_document_v2_sandbox_usercollection_daily_spo2_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailySpO2>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/daily_spo2/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_daily_spo2_document_v2_sandbox_usercollection_daily_spo2_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Daily Stress Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_stress`\n\n"]
pub async fn sandbox_multiple_daily_stress_documents_v2_sandbox_usercollection_daily_stress_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailyStress>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/daily_stress", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_daily_stress_documents_v2_sandbox_usercollection_daily_stress_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Daily Stress Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_stress/{document_id}`\n\n"]
pub async fn sandbox_single_daily_stress_document_v2_sandbox_usercollection_daily_stress_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailyStress>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/daily_stress/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_daily_stress_document_v2_sandbox_usercollection_daily_stress_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Enhanced Tag Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/enhanced_tag`\n\n"]
pub async fn sandbox_multiple_enhanced_tag_documents_v2_sandbox_usercollection_enhanced_tag_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponseEnhancedTagModel>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/enhanced_tag", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_enhanced_tag_documents_v2_sandbox_usercollection_enhanced_tag_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Enhanced Tag Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/enhanced_tag/{document_id}`\n\n"]
pub async fn sandbox_single_enhanced_tag_document_v2_sandbox_usercollection_enhanced_tag_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::EnhancedTagModel>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/enhanced_tag/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_enhanced_tag_document_v2_sandbox_usercollection_enhanced_tag_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Heartrate Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/heartrate`\n\n"]
pub async fn sandbox_multiple_heartrate_documents_v2_sandbox_usercollection_heartrate_get<
'a,
>(
&'a self,
end_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
next_token: Option<&'a str>,
start_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
) -> Result<
ResponseValue<
types::ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet,
>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/heartrate", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"end_datetime",
&end_datetime,
))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_datetime",
&start_datetime,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_heartrate_documents_v2_sandbox_usercollection_heartrate_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Rest Mode Period Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/rest_mode_period`\n\n"]
pub async fn sandbox_multiple_rest_mode_period_documents_v2_sandbox_usercollection_rest_mode_period_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicRestModePeriod>,
Error<types::HttpValidationError>,
> {
let url = format!(
"{}/v2/sandbox/usercollection/rest_mode_period",
self.baseurl,
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_multiple_rest_mode_period_documents_v2_sandbox_usercollection_rest_mode_period_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Rest Mode Period Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/rest_mode_period/{document_id}`\n\n"]
pub async fn sandbox_single_rest_mode_period_document_v2_sandbox_usercollection_rest_mode_period_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicRestModePeriod>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/rest_mode_period/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_rest_mode_period_document_v2_sandbox_usercollection_rest_mode_period_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Ring Battery Level Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/ring_battery_level`\n\n"] pub async fn sandbox_multiple_ring_battery_level_documents_v2_sandbox_usercollection_ring_battery_level_get < 'a > (& 'a self , end_datetime : Option < & 'a :: chrono :: DateTime < :: chrono :: offset :: Utc > > , next_token : Option < & 'a str > , start_datetime : Option < & 'a :: chrono :: DateTime < :: chrono :: offset :: Utc > >) -> Result < ResponseValue < types :: ResponseSandboxMultipleRingBatteryLevelDocumentsV2SandboxUsercollectionRingBatteryLevelGet > , Error < types :: HttpValidationError > , >{
let url = format!(
"{}/v2/sandbox/usercollection/ring_battery_level",
self.baseurl,
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"end_datetime",
&end_datetime,
))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_datetime",
&start_datetime,
))
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_multiple_ring_battery_level_documents_v2_sandbox_usercollection_ring_battery_level_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Ring Configuration Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/ring_configuration`\n\n"]
pub async fn sandbox_multiple_ring_configuration_documents_v2_sandbox_usercollection_ring_configuration_get<
'a,
>(
&'a self,
next_token: Option<&'a str>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicRingConfiguration>,
Error<types::HttpValidationError>,
> {
let url = format!(
"{}/v2/sandbox/usercollection/ring_configuration",
self.baseurl,
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_multiple_ring_configuration_documents_v2_sandbox_usercollection_ring_configuration_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Ring Configuration Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/ring_configuration/{document_id}`\n\n"]
pub async fn sandbox_single_ring_configuration_document_v2_sandbox_usercollection_ring_configuration_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicRingConfiguration>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/sandbox/usercollection/ring_configuration/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_ring_configuration_document_v2_sandbox_usercollection_ring_configuration_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Session Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/session`\n\n"]
pub async fn sandbox_multiple_session_documents_v2_sandbox_usercollection_session_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicSession>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/session", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_session_documents_v2_sandbox_usercollection_session_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Session Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/session/{document_id}`\n\n"]
pub async fn sandbox_single_session_document_v2_sandbox_usercollection_session_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicSession>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/session/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_single_session_document_v2_sandbox_usercollection_session_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Sleep Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/sleep`\n\n"]
pub async fn sandbox_multiple_sleep_documents_v2_sandbox_usercollection_sleep_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicModifiedSleepModel>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/sleep", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "sandbox_multiple_sleep_documents_v2_sandbox_usercollection_sleep_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Sleep Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/sleep/{document_id}`\n\n"]
pub async fn sandbox_single_sleep_document_v2_sandbox_usercollection_sleep_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicModifiedSleepModel>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/sandbox/usercollection/sleep/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_single_sleep_document_v2_sandbox_usercollection_sleep_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Sleep Time Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/sleep_time`\n\n"]
pub async fn sandbox_multiple_sleep_time_documents_v2_sandbox_usercollection_sleep_time_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicSleepTime>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/sleep_time", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_sleep_time_documents_v2_sandbox_usercollection_sleep_time_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Sleep Time Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/sleep_time/{document_id}`\n\n"]
pub async fn sandbox_single_sleep_time_document_v2_sandbox_usercollection_sleep_time_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicSleepTime>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/sleep_time/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_sleep_time_document_v2_sandbox_usercollection_sleep_time_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Tag Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/tag`\n\n"]
pub async fn sandbox_multiple_tag_documents_v2_sandbox_usercollection_tag_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponseTagModel>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/tag", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "sandbox_multiple_tag_documents_v2_sandbox_usercollection_tag_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Tag Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/tag/{document_id}`\n\n"]
pub async fn sandbox_single_tag_document_v2_sandbox_usercollection_tag_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::TagModel>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/tag/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_single_tag_document_v2_sandbox_usercollection_tag_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Vo2 Max Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/vO2_max`\n\n"]
pub async fn sandbox_multiple_v_o2_max_documents_v2_sandbox_usercollection_v_o2_max_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicVo2Max>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/vO2_max", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_v_o2_max_documents_v2_sandbox_usercollection_v_o2_max_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Vo2 Max Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/vO2_max/{document_id}`\n\n"]
pub async fn sandbox_single_v_o2_max_document_v2_sandbox_usercollection_v_o2_max_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicVo2Max>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/vO2_max/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "sandbox_single_v_o2_max_document_v2_sandbox_usercollection_v_o2_max_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Multiple Workout Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/workout`\n\n"]
pub async fn sandbox_multiple_workout_documents_v2_sandbox_usercollection_workout_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicWorkout>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/sandbox/usercollection/workout", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_multiple_workout_documents_v2_sandbox_usercollection_workout_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Sandbox - Single Workout Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/workout/{document_id}`\n\n"]
pub async fn sandbox_single_workout_document_v2_sandbox_usercollection_workout_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicWorkout>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/sandbox/usercollection/workout/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"sandbox_single_workout_document_v2_sandbox_usercollection_workout_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Daily Activity Documents\n\nSends a `GET` request to `/v2/usercollection/daily_activity`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_daily_activity_documents_v2_usercollection_daily_activity_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailyActivity>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/daily_activity", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_daily_activity_documents_v2_usercollection_daily_activity_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Daily Activity Document\n\nSends a `GET` request to `/v2/usercollection/daily_activity/{document_id}`\n\n"]
pub async fn single_daily_activity_document_v2_usercollection_daily_activity_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailyActivity>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/daily_activity/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"single_daily_activity_document_v2_usercollection_daily_activity_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Daily Cardiovascular Age Documents\n\nSends a `GET` request to `/v2/usercollection/daily_cardiovascular_age`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_daily_cardiovascular_age_documents_v2_usercollection_daily_cardiovascular_age_get<
'a,
>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailyCardiovascularAge>,
Error<types::HttpValidationError>,
> {
let url = format!(
"{}/v2/usercollection/daily_cardiovascular_age",
self.baseurl,
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "multiple_daily_cardiovascular_age_documents_v2_usercollection_daily_cardiovascular_age_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Daily Cardiovascular Age Document\n\nSends a `GET` request to `/v2/usercollection/daily_cardiovascular_age/{document_id}`\n\n"]
pub async fn single_daily_cardiovascular_age_document_v2_usercollection_daily_cardiovascular_age_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailyCardiovascularAge>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/usercollection/daily_cardiovascular_age/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "single_daily_cardiovascular_age_document_v2_usercollection_daily_cardiovascular_age_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Daily Readiness Documents\n\nSends a `GET` request to `/v2/usercollection/daily_readiness`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_daily_readiness_documents_v2_usercollection_daily_readiness_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailyReadiness>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/daily_readiness", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"multiple_daily_readiness_documents_v2_usercollection_daily_readiness_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Daily Readiness Document\n\nSends a `GET` request to `/v2/usercollection/daily_readiness/{document_id}`\n\n"]
pub async fn single_daily_readiness_document_v2_usercollection_daily_readiness_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailyReadiness>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/daily_readiness/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"single_daily_readiness_document_v2_usercollection_daily_readiness_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Daily Resilience Documents\n\nSends a `GET` request to `/v2/usercollection/daily_resilience`\n\nArguments:\n- `end_date`\n- `fields`: N/A. This route does not support field selection yet, all fields will be returned.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_daily_resilience_documents_v2_usercollection_daily_resilience_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponseDailyResilienceModel>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/daily_resilience", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"multiple_daily_resilience_documents_v2_usercollection_daily_resilience_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Daily Resilience Document\n\nSends a `GET` request to `/v2/usercollection/daily_resilience/{document_id}`\n\n"]
pub async fn single_daily_resilience_document_v2_usercollection_daily_resilience_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::DailyResilienceModel>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/daily_resilience/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "single_daily_resilience_document_v2_usercollection_daily_resilience_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Daily Sleep Documents\n\nSends a `GET` request to `/v2/usercollection/daily_sleep`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_daily_sleep_documents_v2_usercollection_daily_sleep_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailySleep>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/daily_sleep", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_daily_sleep_documents_v2_usercollection_daily_sleep_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Daily Sleep Document\n\nSends a `GET` request to `/v2/usercollection/daily_sleep/{document_id}`\n\n"]
pub async fn single_daily_sleep_document_v2_usercollection_daily_sleep_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailySleep>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/daily_sleep/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"single_daily_sleep_document_v2_usercollection_daily_sleep_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Daily Spo2 Documents\n\nSends a `GET` request to `/v2/usercollection/daily_spo2`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_daily_spo2_documents_v2_usercollection_daily_spo2_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailySpO2>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/daily_spo2", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_daily_spo2_documents_v2_usercollection_daily_spo2_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Daily Spo2 Document\n\nSends a `GET` request to `/v2/usercollection/daily_spo2/{document_id}`\n\n"]
pub async fn single_daily_spo2_document_v2_usercollection_daily_spo2_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailySpO2>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/daily_spo2/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "single_daily_spo2_document_v2_usercollection_daily_spo2_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Daily Stress Documents\n\nSends a `GET` request to `/v2/usercollection/daily_stress`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_daily_stress_documents_v2_usercollection_daily_stress_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicDailyStress>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/daily_stress", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_daily_stress_documents_v2_usercollection_daily_stress_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Daily Stress Document\n\nSends a `GET` request to `/v2/usercollection/daily_stress/{document_id}`\n\n"]
pub async fn single_daily_stress_document_v2_usercollection_daily_stress_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicDailyStress>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/daily_stress/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"single_daily_stress_document_v2_usercollection_daily_stress_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Enhanced Tag Documents\n\nSends a `GET` request to `/v2/usercollection/enhanced_tag`\n\nArguments:\n- `end_date`\n- `fields`: N/A. This route does not support field selection yet, all fields will be returned.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_enhanced_tag_documents_v2_usercollection_enhanced_tag_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponseEnhancedTagModel>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/enhanced_tag", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_enhanced_tag_documents_v2_usercollection_enhanced_tag_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Enhanced Tag Document\n\nSends a `GET` request to `/v2/usercollection/enhanced_tag/{document_id}`\n\n"]
pub async fn single_enhanced_tag_document_v2_usercollection_enhanced_tag_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::EnhancedTagModel>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/enhanced_tag/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"single_enhanced_tag_document_v2_usercollection_enhanced_tag_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Heartrate Documents\n\nSends a `GET` request to `/v2/usercollection/heartrate`\n\nArguments:\n- `end_datetime`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `latest`: If True, returns most recent sample.\n- `next_token`\n- `start_datetime`\n"]
pub async fn multiple_heartrate_documents_v2_usercollection_heartrate_get<'a>(
&'a self,
end_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
fields: Option<&'a str>,
latest: Option<bool>,
next_token: Option<&'a str>,
start_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
) -> Result<
ResponseValue<types::ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/heartrate", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"end_datetime",
&end_datetime,
))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new("latest", &latest))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_datetime",
&start_datetime,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_heartrate_documents_v2_usercollection_heartrate_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Personal Info Document\n\nSends a `GET` request to `/v2/usercollection/personal_info`\n\n"]
pub async fn single_personal_info_document_v2_usercollection_personal_info_get<'a>(
&'a self,
) -> Result<ResponseValue<types::PersonalInfoResponse>, Error<()>> {
let url = format!("{}/v2/usercollection/personal_info", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "single_personal_info_document_v2_usercollection_personal_info_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Rest Mode Period Documents\n\nSends a `GET` request to `/v2/usercollection/rest_mode_period`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_rest_mode_period_documents_v2_usercollection_rest_mode_period_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicRestModePeriod>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/rest_mode_period", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"multiple_rest_mode_period_documents_v2_usercollection_rest_mode_period_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Rest Mode Period Document\n\nSends a `GET` request to `/v2/usercollection/rest_mode_period/{document_id}`\n\n"]
pub async fn single_rest_mode_period_document_v2_usercollection_rest_mode_period_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicRestModePeriod>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/rest_mode_period/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "single_rest_mode_period_document_v2_usercollection_rest_mode_period_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Ring Battery Level Documents\n\nSends a `GET` request to `/v2/usercollection/ring_battery_level`\n\nArguments:\n- `end_datetime`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `latest`: If True, returns most recent sample.\n- `next_token`\n- `start_datetime`\n"]
pub async fn multiple_ring_battery_level_documents_v2_usercollection_ring_battery_level_get<
'a,
>(
&'a self,
end_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
fields: Option<&'a str>,
latest: Option<bool>,
next_token: Option<&'a str>,
start_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
) -> Result<
ResponseValue<
types::ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet,
>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/ring_battery_level", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"end_datetime",
&end_datetime,
))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new("latest", &latest))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_datetime",
&start_datetime,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"multiple_ring_battery_level_documents_v2_usercollection_ring_battery_level_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Ring Configuration Documents\n\nSends a `GET` request to `/v2/usercollection/ring_configuration`\n\nArguments:\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n"]
pub async fn multiple_ring_configuration_documents_v2_usercollection_ring_configuration_get<
'a,
>(
&'a self,
fields: Option<&'a str>,
next_token: Option<&'a str>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicRingConfiguration>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/ring_configuration", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id:
"multiple_ring_configuration_documents_v2_usercollection_ring_configuration_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Ring Configuration Document\n\nSends a `GET` request to `/v2/usercollection/ring_configuration/{document_id}`\n\n"]
pub async fn single_ring_configuration_document_v2_usercollection_ring_configuration_document_id_get<
'a,
>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicRingConfiguration>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/usercollection/ring_configuration/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo { operation_id : "single_ring_configuration_document_v2_usercollection_ring_configuration_document_id_get" , } ;
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Session Documents\n\nSends a `GET` request to `/v2/usercollection/session`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_session_documents_v2_usercollection_session_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicSession>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/session", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_session_documents_v2_usercollection_session_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Session Document\n\nSends a `GET` request to `/v2/usercollection/session/{document_id}`\n\n"]
pub async fn single_session_document_v2_usercollection_session_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicSession>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/session/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "single_session_document_v2_usercollection_session_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Sleep Documents\n\nSends a `GET` request to `/v2/usercollection/sleep`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_sleep_documents_v2_usercollection_sleep_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicModifiedSleepModel>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/sleep", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_sleep_documents_v2_usercollection_sleep_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Sleep Document\n\nSends a `GET` request to `/v2/usercollection/sleep/{document_id}`\n\n"]
pub async fn single_sleep_document_v2_usercollection_sleep_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicModifiedSleepModel>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/usercollection/sleep/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "single_sleep_document_v2_usercollection_sleep_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Sleep Time Documents\n\nSends a `GET` request to `/v2/usercollection/sleep_time`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_sleep_time_documents_v2_usercollection_sleep_time_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicSleepTime>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/sleep_time", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_sleep_time_documents_v2_usercollection_sleep_time_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Sleep Time Document\n\nSends a `GET` request to `/v2/usercollection/sleep_time/{document_id}`\n\n"]
pub async fn single_sleep_time_document_v2_usercollection_sleep_time_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicSleepTime>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/sleep_time/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "single_sleep_time_document_v2_usercollection_sleep_time_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Tag Documents\n\nSends a `GET` request to `/v2/usercollection/tag`\n\nArguments:\n- `end_date`\n- `fields`: N/A. This route does not support field selection yet, all fields will be returned.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_tag_documents_v2_usercollection_tag_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponseTagModel>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/tag", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_tag_documents_v2_usercollection_tag_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Tag Document\n\nSends a `GET` request to `/v2/usercollection/tag/{document_id}`\n\n"]
pub async fn single_tag_document_v2_usercollection_tag_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::TagModel>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/tag/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "single_tag_document_v2_usercollection_tag_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Vo2 Max Documents\n\nSends a `GET` request to `/v2/usercollection/vO2_max`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_v_o2_max_documents_v2_usercollection_v_o2_max_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicVo2Max>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/vO2_max", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_v_o2_max_documents_v2_usercollection_v_o2_max_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Vo2 Max Document\n\nSends a `GET` request to `/v2/usercollection/vO2_max/{document_id}`\n\n"]
pub async fn single_v_o2_max_document_v2_usercollection_v_o2_max_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicVo2Max>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/vO2_max/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "single_v_o2_max_document_v2_usercollection_v_o2_max_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Multiple Workout Documents\n\nSends a `GET` request to `/v2/usercollection/workout`\n\nArguments:\n- `end_date`\n- `fields`: Comma-separated list of fields to include in the response, in addition to the always returned fields. Defaults to all fields if not provided.\n- `next_token`\n- `start_date`\n"]
pub async fn multiple_workout_documents_v2_usercollection_workout_get<'a>(
&'a self,
end_date: Option<&'a ::chrono::naive::NaiveDate>,
fields: Option<&'a str>,
next_token: Option<&'a str>,
start_date: Option<&'a ::chrono::naive::NaiveDate>,
) -> Result<
ResponseValue<types::MultiDocumentResponsePublicWorkout>,
Error<types::HttpValidationError>,
> {
let url = format!("{}/v2/usercollection/workout", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("end_date", &end_date))
.query(&progenitor_client::QueryParam::new("fields", &fields))
.query(&progenitor_client::QueryParam::new(
"next_token",
&next_token,
))
.query(&progenitor_client::QueryParam::new(
"start_date",
&start_date,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "multiple_workout_documents_v2_usercollection_workout_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Single Workout Document\n\nSends a `GET` request to `/v2/usercollection/workout/{document_id}`\n\n"]
pub async fn single_workout_document_v2_usercollection_workout_document_id_get<'a>(
&'a self,
document_id: &'a str,
) -> Result<ResponseValue<types::PublicWorkout>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/usercollection/workout/{}",
self.baseurl,
encode_path(&document_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "single_workout_document_v2_usercollection_workout_document_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "List Webhook Subscriptions\n\nSends a `GET` request to `/v2/webhook/subscription`\n\n"]
pub async fn list_webhook_subscriptions_v2_webhook_subscription_get<'a>(
&'a self,
) -> Result<ResponseValue<::std::vec::Vec<types::WebhookSubscriptionModel>>, Error<()>> {
let url = format!("{}/v2/webhook/subscription", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_webhook_subscriptions_v2_webhook_subscription_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Create Webhook Subscription\n\nSends a `POST` request to `/v2/webhook/subscription`\n\n"]
pub async fn create_webhook_subscription_v2_webhook_subscription_post<'a>(
&'a self,
body: &'a types::CreateWebhookSubscriptionRequest,
) -> Result<ResponseValue<types::WebhookSubscriptionModel>, Error<types::HttpValidationError>>
{
let url = format!("{}/v2/webhook/subscription", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_webhook_subscription_v2_webhook_subscription_post",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Renew Webhook Subscription\n\nSends a `PUT` request to `/v2/webhook/subscription/renew/{id}`\n\n"]
pub async fn renew_webhook_subscription_v2_webhook_subscription_renew_id_put<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::WebhookSubscriptionModel>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/webhook/subscription/renew/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "renew_webhook_subscription_v2_webhook_subscription_renew_id_put",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Get Webhook Subscription\n\nSends a `GET` request to `/v2/webhook/subscription/{id}`\n\n"]
pub async fn get_webhook_subscription_v2_webhook_subscription_id_get<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::WebhookSubscriptionModel>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/webhook/subscription/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_webhook_subscription_v2_webhook_subscription_id_get",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Update Webhook Subscription\n\nSends a `PUT` request to `/v2/webhook/subscription/{id}`\n\n"]
pub async fn update_webhook_subscription_v2_webhook_subscription_id_put<'a>(
&'a self,
id: &'a str,
body: &'a types::UpdateWebhookSubscriptionRequest,
) -> Result<ResponseValue<types::WebhookSubscriptionModel>, Error<types::HttpValidationError>>
{
let url = format!(
"{}/v2/webhook/subscription/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_webhook_subscription_v2_webhook_subscription_id_put",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
#[doc = "Delete Webhook Subscription\n\nSends a `DELETE` request to `/v2/webhook/subscription/{id}`\n\n"]
pub async fn delete_webhook_subscription_v2_webhook_subscription_id_delete<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<types::HttpValidationError>> {
let url = format!(
"{}/v2/webhook/subscription/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_webhook_subscription_v2_webhook_subscription_id_delete",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
#[doc = r" Items consumers will typically use such as the Client."]
pub mod prelude {
#[allow(unused_imports)]
pub use super::Client;
}