1#[allow(unused_imports)]
5use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt};
6#[allow(unused_imports)]
7pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
8#[doc = r" Types used as operation parameters and responses."]
9#[allow(clippy::all)]
10pub mod types {
11 #[doc = r" Error types."]
12 pub mod error {
13 #[doc = r" Error from a `TryFrom` or `FromStr` implementation."]
14 pub struct ConversionError(::std::borrow::Cow<'static, str>);
15 impl ::std::error::Error for ConversionError {}
16 impl ::std::fmt::Display for ConversionError {
17 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
18 ::std::fmt::Display::fmt(&self.0, f)
19 }
20 }
21
22 impl ::std::fmt::Debug for ConversionError {
23 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
24 ::std::fmt::Debug::fmt(&self.0, f)
25 }
26 }
27
28 impl From<&'static str> for ConversionError {
29 fn from(value: &'static str) -> Self {
30 Self(value.into())
31 }
32 }
33
34 impl From<String> for ConversionError {
35 fn from(value: String) -> Self {
36 Self(value.into())
37 }
38 }
39 }
40
41 #[doc = "`ArrayUnionFloatNoneTypeBits64`"]
42 #[doc = r""]
43 #[doc = r" <details><summary>JSON schema</summary>"]
44 #[doc = r""]
45 #[doc = r" ```json"]
46 #[doc = "{"]
47 #[doc = " \"title\": \"ArrayNullableFloatBits64\","]
48 #[doc = " \"type\": \"array\","]
49 #[doc = " \"items\": {"]
50 #[doc = " \"type\": ["]
51 #[doc = " \"number\","]
52 #[doc = " \"null\""]
53 #[doc = " ]"]
54 #[doc = " }"]
55 #[doc = "}"]
56 #[doc = r" ```"]
57 #[doc = r" </details>"]
58 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
59 #[serde(transparent)]
60 pub struct ArrayUnionFloatNoneTypeBits64(pub ::std::vec::Vec<::std::option::Option<f64>>);
61 impl ::std::ops::Deref for ArrayUnionFloatNoneTypeBits64 {
62 type Target = ::std::vec::Vec<::std::option::Option<f64>>;
63 fn deref(&self) -> &::std::vec::Vec<::std::option::Option<f64>> {
64 &self.0
65 }
66 }
67
68 impl ::std::convert::From<ArrayUnionFloatNoneTypeBits64>
69 for ::std::vec::Vec<::std::option::Option<f64>>
70 {
71 fn from(value: ArrayUnionFloatNoneTypeBits64) -> Self {
72 value.0
73 }
74 }
75
76 impl ::std::convert::From<::std::vec::Vec<::std::option::Option<f64>>>
77 for ArrayUnionFloatNoneTypeBits64
78 {
79 fn from(value: ::std::vec::Vec<::std::option::Option<f64>>) -> Self {
80 Self(value)
81 }
82 }
83
84 #[doc = "`CreateWebhookSubscriptionRequest`"]
85 #[doc = r""]
86 #[doc = r" <details><summary>JSON schema</summary>"]
87 #[doc = r""]
88 #[doc = r" ```json"]
89 #[doc = "{"]
90 #[doc = " \"title\": \"CreateWebhookSubscriptionRequest\","]
91 #[doc = " \"type\": \"object\","]
92 #[doc = " \"required\": ["]
93 #[doc = " \"callback_url\","]
94 #[doc = " \"data_type\","]
95 #[doc = " \"event_type\","]
96 #[doc = " \"verification_token\""]
97 #[doc = " ],"]
98 #[doc = " \"properties\": {"]
99 #[doc = " \"callback_url\": {"]
100 #[doc = " \"title\": \"Callback Url\","]
101 #[doc = " \"type\": \"string\""]
102 #[doc = " },"]
103 #[doc = " \"data_type\": {"]
104 #[doc = " \"$ref\": \"#/components/schemas/ExtApiV2DataType\""]
105 #[doc = " },"]
106 #[doc = " \"event_type\": {"]
107 #[doc = " \"$ref\": \"#/components/schemas/WebhookOperation\""]
108 #[doc = " },"]
109 #[doc = " \"verification_token\": {"]
110 #[doc = " \"title\": \"Verification Token\","]
111 #[doc = " \"type\": \"string\""]
112 #[doc = " }"]
113 #[doc = " }"]
114 #[doc = "}"]
115 #[doc = r" ```"]
116 #[doc = r" </details>"]
117 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
118 pub struct CreateWebhookSubscriptionRequest {
119 pub callback_url: ::std::string::String,
120 pub data_type: ExtApiV2DataType,
121 pub event_type: WebhookOperation,
122 pub verification_token: ::std::string::String,
123 }
124
125 #[doc = "`DailyResilienceModel`"]
126 #[doc = r""]
127 #[doc = r" <details><summary>JSON schema</summary>"]
128 #[doc = r""]
129 #[doc = r" ```json"]
130 #[doc = "{"]
131 #[doc = " \"title\": \"DailyResilienceModel\","]
132 #[doc = " \"type\": \"object\","]
133 #[doc = " \"required\": ["]
134 #[doc = " \"contributors\","]
135 #[doc = " \"day\","]
136 #[doc = " \"id\","]
137 #[doc = " \"level\""]
138 #[doc = " ],"]
139 #[doc = " \"properties\": {"]
140 #[doc = " \"contributors\": {"]
141 #[doc = " \"$ref\": \"#/components/schemas/ResilienceContributors\""]
142 #[doc = " },"]
143 #[doc = " \"day\": {"]
144 #[doc = " \"title\": \"Day\","]
145 #[doc = " \"description\": \"Day when the resilience record was recorded.\","]
146 #[doc = " \"type\": \"string\","]
147 #[doc = " \"format\": \"date\""]
148 #[doc = " },"]
149 #[doc = " \"id\": {"]
150 #[doc = " \"title\": \"Id\","]
151 #[doc = " \"type\": \"string\""]
152 #[doc = " },"]
153 #[doc = " \"level\": {"]
154 #[doc = " \"$ref\": \"#/components/schemas/LongTermResilienceLevel\""]
155 #[doc = " }"]
156 #[doc = " }"]
157 #[doc = "}"]
158 #[doc = r" ```"]
159 #[doc = r" </details>"]
160 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
161 pub struct DailyResilienceModel {
162 pub contributors: ResilienceContributors,
163 #[doc = "Day when the resilience record was recorded."]
164 pub day: ::chrono::naive::NaiveDate,
165 pub id: ::std::string::String,
166 pub level: LongTermResilienceLevel,
167 }
168
169 #[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"]
170 #[doc = r""]
171 #[doc = r" <details><summary>JSON schema</summary>"]
172 #[doc = r""]
173 #[doc = r" ```json"]
174 #[doc = "{"]
175 #[doc = " \"title\": \"EnhancedTagModel\","]
176 #[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\","]
177 #[doc = " \"type\": \"object\","]
178 #[doc = " \"required\": ["]
179 #[doc = " \"id\","]
180 #[doc = " \"start_day\","]
181 #[doc = " \"start_time\""]
182 #[doc = " ],"]
183 #[doc = " \"properties\": {"]
184 #[doc = " \"comment\": {"]
185 #[doc = " \"title\": \"Comment\","]
186 #[doc = " \"description\": \"Additional freeform text on the tag.\","]
187 #[doc = " \"type\": ["]
188 #[doc = " \"string\","]
189 #[doc = " \"null\""]
190 #[doc = " ]"]
191 #[doc = " },"]
192 #[doc = " \"custom_name\": {"]
193 #[doc = " \"title\": \"Custom Name\","]
194 #[doc = " \"description\": \"The name of the tag if the tag_type_code is `custom`.\","]
195 #[doc = " \"type\": ["]
196 #[doc = " \"string\","]
197 #[doc = " \"null\""]
198 #[doc = " ]"]
199 #[doc = " },"]
200 #[doc = " \"end_day\": {"]
201 #[doc = " \"title\": \"End Day\","]
202 #[doc = " \"description\": \"Day of the tag's end for events with duration or `NULL` if there is no duration.\","]
203 #[doc = " \"type\": ["]
204 #[doc = " \"string\","]
205 #[doc = " \"null\""]
206 #[doc = " ],"]
207 #[doc = " \"format\": \"date\""]
208 #[doc = " },"]
209 #[doc = " \"end_time\": {"]
210 #[doc = " \"description\": \"Timestamp of the tag's end for events with duration or `NULL` if there is no duration.\","]
211 #[doc = " \"oneOf\": ["]
212 #[doc = " {"]
213 #[doc = " \"type\": \"null\""]
214 #[doc = " },"]
215 #[doc = " {"]
216 #[doc = " \"allOf\": ["]
217 #[doc = " {"]
218 #[doc = " \"$ref\": \"#/components/schemas/LocalDateTime\""]
219 #[doc = " }"]
220 #[doc = " ]"]
221 #[doc = " }"]
222 #[doc = " ]"]
223 #[doc = " },"]
224 #[doc = " \"id\": {"]
225 #[doc = " \"title\": \"Id\","]
226 #[doc = " \"type\": \"string\""]
227 #[doc = " },"]
228 #[doc = " \"start_day\": {"]
229 #[doc = " \"title\": \"Start Day\","]
230 #[doc = " \"description\": \"Day of the tag (if no duration) or the start day of the tag (with duration).\","]
231 #[doc = " \"type\": \"string\","]
232 #[doc = " \"format\": \"date\""]
233 #[doc = " },"]
234 #[doc = " \"start_time\": {"]
235 #[doc = " \"$ref\": \"#/components/schemas/LocalDateTime\""]
236 #[doc = " },"]
237 #[doc = " \"tag_type_code\": {"]
238 #[doc = " \"title\": \"Tag Type Code\","]
239 #[doc = " \"description\": \"The unique code of the selected tag type, `NULL` for text-only tags, or `custom` for custom tag types.\","]
240 #[doc = " \"type\": ["]
241 #[doc = " \"string\","]
242 #[doc = " \"null\""]
243 #[doc = " ]"]
244 #[doc = " }"]
245 #[doc = " }"]
246 #[doc = "}"]
247 #[doc = r" ```"]
248 #[doc = r" </details>"]
249 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
250 pub struct EnhancedTagModel {
251 #[doc = "Additional freeform text on the tag."]
252 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
253 pub comment: ::std::option::Option<::std::string::String>,
254 #[doc = "The name of the tag if the tag_type_code is `custom`."]
255 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
256 pub custom_name: ::std::option::Option<::std::string::String>,
257 #[doc = "Day of the tag's end for events with duration or `NULL` if there is no duration."]
258 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
259 pub end_day: ::std::option::Option<::chrono::naive::NaiveDate>,
260 #[doc = "Timestamp of the tag's end for events with duration or `NULL` if there is no duration."]
261 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
262 pub end_time: ::std::option::Option<LocalDateTime>,
263 pub id: ::std::string::String,
264 #[doc = "Day of the tag (if no duration) or the start day of the tag (with duration)."]
265 pub start_day: ::chrono::naive::NaiveDate,
266 pub start_time: LocalDateTime,
267 #[doc = "The unique code of the selected tag type, `NULL` for text-only tags, or `custom` for custom tag types."]
268 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
269 pub tag_type_code: ::std::option::Option<::std::string::String>,
270 }
271
272 #[doc = "`ExtApiV2DataType`"]
273 #[doc = r""]
274 #[doc = r" <details><summary>JSON schema</summary>"]
275 #[doc = r""]
276 #[doc = r" ```json"]
277 #[doc = "{"]
278 #[doc = " \"title\": \"ExtApiV2DataType\","]
279 #[doc = " \"type\": \"string\","]
280 #[doc = " \"enum\": ["]
281 #[doc = " \"tag\","]
282 #[doc = " \"enhanced_tag\","]
283 #[doc = " \"workout\","]
284 #[doc = " \"session\","]
285 #[doc = " \"sleep\","]
286 #[doc = " \"daily_sleep\","]
287 #[doc = " \"daily_readiness\","]
288 #[doc = " \"daily_activity\","]
289 #[doc = " \"daily_spo2\","]
290 #[doc = " \"sleep_time\","]
291 #[doc = " \"rest_mode_period\","]
292 #[doc = " \"ring_configuration\","]
293 #[doc = " \"daily_stress\","]
294 #[doc = " \"daily_cardiovascular_age\","]
295 #[doc = " \"daily_resilience\","]
296 #[doc = " \"vo2_max\","]
297 #[doc = " \"meal\""]
298 #[doc = " ]"]
299 #[doc = "}"]
300 #[doc = r" ```"]
301 #[doc = r" </details>"]
302 #[derive(
303 :: serde :: Deserialize,
304 :: serde :: Serialize,
305 Clone,
306 Copy,
307 Debug,
308 Eq,
309 Hash,
310 Ord,
311 PartialEq,
312 PartialOrd,
313 )]
314 pub enum ExtApiV2DataType {
315 #[serde(rename = "tag")]
316 Tag,
317 #[serde(rename = "enhanced_tag")]
318 EnhancedTag,
319 #[serde(rename = "workout")]
320 Workout,
321 #[serde(rename = "session")]
322 Session,
323 #[serde(rename = "sleep")]
324 Sleep,
325 #[serde(rename = "daily_sleep")]
326 DailySleep,
327 #[serde(rename = "daily_readiness")]
328 DailyReadiness,
329 #[serde(rename = "daily_activity")]
330 DailyActivity,
331 #[serde(rename = "daily_spo2")]
332 DailySpo2,
333 #[serde(rename = "sleep_time")]
334 SleepTime,
335 #[serde(rename = "rest_mode_period")]
336 RestModePeriod,
337 #[serde(rename = "ring_configuration")]
338 RingConfiguration,
339 #[serde(rename = "daily_stress")]
340 DailyStress,
341 #[serde(rename = "daily_cardiovascular_age")]
342 DailyCardiovascularAge,
343 #[serde(rename = "daily_resilience")]
344 DailyResilience,
345 #[serde(rename = "vo2_max")]
346 Vo2Max,
347 #[serde(rename = "meal")]
348 Meal,
349 }
350
351 impl ::std::fmt::Display for ExtApiV2DataType {
352 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
353 match *self {
354 Self::Tag => f.write_str("tag"),
355 Self::EnhancedTag => f.write_str("enhanced_tag"),
356 Self::Workout => f.write_str("workout"),
357 Self::Session => f.write_str("session"),
358 Self::Sleep => f.write_str("sleep"),
359 Self::DailySleep => f.write_str("daily_sleep"),
360 Self::DailyReadiness => f.write_str("daily_readiness"),
361 Self::DailyActivity => f.write_str("daily_activity"),
362 Self::DailySpo2 => f.write_str("daily_spo2"),
363 Self::SleepTime => f.write_str("sleep_time"),
364 Self::RestModePeriod => f.write_str("rest_mode_period"),
365 Self::RingConfiguration => f.write_str("ring_configuration"),
366 Self::DailyStress => f.write_str("daily_stress"),
367 Self::DailyCardiovascularAge => f.write_str("daily_cardiovascular_age"),
368 Self::DailyResilience => f.write_str("daily_resilience"),
369 Self::Vo2Max => f.write_str("vo2_max"),
370 Self::Meal => f.write_str("meal"),
371 }
372 }
373 }
374
375 impl ::std::str::FromStr for ExtApiV2DataType {
376 type Err = self::error::ConversionError;
377 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
378 match value {
379 "tag" => Ok(Self::Tag),
380 "enhanced_tag" => Ok(Self::EnhancedTag),
381 "workout" => Ok(Self::Workout),
382 "session" => Ok(Self::Session),
383 "sleep" => Ok(Self::Sleep),
384 "daily_sleep" => Ok(Self::DailySleep),
385 "daily_readiness" => Ok(Self::DailyReadiness),
386 "daily_activity" => Ok(Self::DailyActivity),
387 "daily_spo2" => Ok(Self::DailySpo2),
388 "sleep_time" => Ok(Self::SleepTime),
389 "rest_mode_period" => Ok(Self::RestModePeriod),
390 "ring_configuration" => Ok(Self::RingConfiguration),
391 "daily_stress" => Ok(Self::DailyStress),
392 "daily_cardiovascular_age" => Ok(Self::DailyCardiovascularAge),
393 "daily_resilience" => Ok(Self::DailyResilience),
394 "vo2_max" => Ok(Self::Vo2Max),
395 "meal" => Ok(Self::Meal),
396 _ => Err("invalid value".into()),
397 }
398 }
399 }
400
401 impl ::std::convert::TryFrom<&str> for ExtApiV2DataType {
402 type Error = self::error::ConversionError;
403 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
404 value.parse()
405 }
406 }
407
408 impl ::std::convert::TryFrom<&::std::string::String> for ExtApiV2DataType {
409 type Error = self::error::ConversionError;
410 fn try_from(
411 value: &::std::string::String,
412 ) -> ::std::result::Result<Self, self::error::ConversionError> {
413 value.parse()
414 }
415 }
416
417 impl ::std::convert::TryFrom<::std::string::String> for ExtApiV2DataType {
418 type Error = self::error::ConversionError;
419 fn try_from(
420 value: ::std::string::String,
421 ) -> ::std::result::Result<Self, self::error::ConversionError> {
422 value.parse()
423 }
424 }
425
426 #[doc = "`HttpValidationError`"]
427 #[doc = r""]
428 #[doc = r" <details><summary>JSON schema</summary>"]
429 #[doc = r""]
430 #[doc = r" ```json"]
431 #[doc = "{"]
432 #[doc = " \"title\": \"HTTPValidationError\","]
433 #[doc = " \"type\": \"object\","]
434 #[doc = " \"properties\": {"]
435 #[doc = " \"detail\": {"]
436 #[doc = " \"title\": \"Detail\","]
437 #[doc = " \"type\": \"array\","]
438 #[doc = " \"items\": {"]
439 #[doc = " \"$ref\": \"#/components/schemas/ValidationError\""]
440 #[doc = " }"]
441 #[doc = " }"]
442 #[doc = " }"]
443 #[doc = "}"]
444 #[doc = r" ```"]
445 #[doc = r" </details>"]
446 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
447 pub struct HttpValidationError {
448 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
449 pub detail: ::std::vec::Vec<ValidationError>,
450 }
451
452 impl ::std::default::Default for HttpValidationError {
453 fn default() -> Self {
454 Self {
455 detail: Default::default(),
456 }
457 }
458 }
459
460 #[doc = "`IsoDate`"]
461 #[doc = r""]
462 #[doc = r" <details><summary>JSON schema</summary>"]
463 #[doc = r""]
464 #[doc = r" ```json"]
465 #[doc = "{"]
466 #[doc = " \"type\": \"string\""]
467 #[doc = "}"]
468 #[doc = r" ```"]
469 #[doc = r" </details>"]
470 #[derive(
471 :: serde :: Deserialize,
472 :: serde :: Serialize,
473 Clone,
474 Debug,
475 Eq,
476 Hash,
477 Ord,
478 PartialEq,
479 PartialOrd,
480 )]
481 #[serde(transparent)]
482 pub struct IsoDate(pub ::std::string::String);
483 impl ::std::ops::Deref for IsoDate {
484 type Target = ::std::string::String;
485 fn deref(&self) -> &::std::string::String {
486 &self.0
487 }
488 }
489
490 impl ::std::convert::From<IsoDate> for ::std::string::String {
491 fn from(value: IsoDate) -> Self {
492 value.0
493 }
494 }
495
496 impl ::std::convert::From<::std::string::String> for IsoDate {
497 fn from(value: ::std::string::String) -> Self {
498 Self(value)
499 }
500 }
501
502 impl ::std::str::FromStr for IsoDate {
503 type Err = ::std::convert::Infallible;
504 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
505 Ok(Self(value.to_string()))
506 }
507 }
508
509 impl ::std::fmt::Display for IsoDate {
510 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
511 self.0.fmt(f)
512 }
513 }
514
515 #[doc = "`LocalDateTime`"]
516 #[doc = r""]
517 #[doc = r" <details><summary>JSON schema</summary>"]
518 #[doc = r""]
519 #[doc = r" ```json"]
520 #[doc = "{"]
521 #[doc = " \"type\": \"string\""]
522 #[doc = "}"]
523 #[doc = r" ```"]
524 #[doc = r" </details>"]
525 #[derive(
526 :: serde :: Deserialize,
527 :: serde :: Serialize,
528 Clone,
529 Debug,
530 Eq,
531 Hash,
532 Ord,
533 PartialEq,
534 PartialOrd,
535 )]
536 #[serde(transparent)]
537 pub struct LocalDateTime(pub ::std::string::String);
538 impl ::std::ops::Deref for LocalDateTime {
539 type Target = ::std::string::String;
540 fn deref(&self) -> &::std::string::String {
541 &self.0
542 }
543 }
544
545 impl ::std::convert::From<LocalDateTime> for ::std::string::String {
546 fn from(value: LocalDateTime) -> Self {
547 value.0
548 }
549 }
550
551 impl ::std::convert::From<::std::string::String> for LocalDateTime {
552 fn from(value: ::std::string::String) -> Self {
553 Self(value)
554 }
555 }
556
557 impl ::std::str::FromStr for LocalDateTime {
558 type Err = ::std::convert::Infallible;
559 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
560 Ok(Self(value.to_string()))
561 }
562 }
563
564 impl ::std::fmt::Display for LocalDateTime {
565 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
566 self.0.fmt(f)
567 }
568 }
569
570 #[doc = "`LocalizedDateTime`"]
571 #[doc = r""]
572 #[doc = r" <details><summary>JSON schema</summary>"]
573 #[doc = r""]
574 #[doc = r" ```json"]
575 #[doc = "{"]
576 #[doc = " \"type\": \"string\""]
577 #[doc = "}"]
578 #[doc = r" ```"]
579 #[doc = r" </details>"]
580 #[derive(
581 :: serde :: Deserialize,
582 :: serde :: Serialize,
583 Clone,
584 Debug,
585 Eq,
586 Hash,
587 Ord,
588 PartialEq,
589 PartialOrd,
590 )]
591 #[serde(transparent)]
592 pub struct LocalizedDateTime(pub ::std::string::String);
593 impl ::std::ops::Deref for LocalizedDateTime {
594 type Target = ::std::string::String;
595 fn deref(&self) -> &::std::string::String {
596 &self.0
597 }
598 }
599
600 impl ::std::convert::From<LocalizedDateTime> for ::std::string::String {
601 fn from(value: LocalizedDateTime) -> Self {
602 value.0
603 }
604 }
605
606 impl ::std::convert::From<::std::string::String> for LocalizedDateTime {
607 fn from(value: ::std::string::String) -> Self {
608 Self(value)
609 }
610 }
611
612 impl ::std::str::FromStr for LocalizedDateTime {
613 type Err = ::std::convert::Infallible;
614 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
615 Ok(Self(value.to_string()))
616 }
617 }
618
619 impl ::std::fmt::Display for LocalizedDateTime {
620 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
621 self.0.fmt(f)
622 }
623 }
624
625 #[doc = "`LocationItem`"]
626 #[doc = r""]
627 #[doc = r" <details><summary>JSON schema</summary>"]
628 #[doc = r""]
629 #[doc = r" ```json"]
630 #[doc = "{"]
631 #[doc = " \"anyOf\": ["]
632 #[doc = " {"]
633 #[doc = " \"type\": \"string\""]
634 #[doc = " },"]
635 #[doc = " {"]
636 #[doc = " \"type\": \"integer\""]
637 #[doc = " }"]
638 #[doc = " ]"]
639 #[doc = "}"]
640 #[doc = r" ```"]
641 #[doc = r" </details>"]
642 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
643 #[serde(untagged)]
644 pub enum LocationItem {
645 String(::std::string::String),
646 Integer(i64),
647 }
648
649 impl ::std::fmt::Display for LocationItem {
650 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
651 match self {
652 Self::String(x) => x.fmt(f),
653 Self::Integer(x) => x.fmt(f),
654 }
655 }
656 }
657
658 impl ::std::convert::From<i64> for LocationItem {
659 fn from(value: i64) -> Self {
660 Self::Integer(value)
661 }
662 }
663
664 #[doc = "Possible long term resilience level values."]
665 #[doc = r""]
666 #[doc = r" <details><summary>JSON schema</summary>"]
667 #[doc = r""]
668 #[doc = r" ```json"]
669 #[doc = "{"]
670 #[doc = " \"title\": \"LongTermResilienceLevel\","]
671 #[doc = " \"description\": \"Possible long term resilience level values.\","]
672 #[doc = " \"type\": \"string\","]
673 #[doc = " \"enum\": ["]
674 #[doc = " \"limited\","]
675 #[doc = " \"adequate\","]
676 #[doc = " \"solid\","]
677 #[doc = " \"strong\","]
678 #[doc = " \"exceptional\""]
679 #[doc = " ]"]
680 #[doc = "}"]
681 #[doc = r" ```"]
682 #[doc = r" </details>"]
683 #[derive(
684 :: serde :: Deserialize,
685 :: serde :: Serialize,
686 Clone,
687 Copy,
688 Debug,
689 Eq,
690 Hash,
691 Ord,
692 PartialEq,
693 PartialOrd,
694 )]
695 pub enum LongTermResilienceLevel {
696 #[serde(rename = "limited")]
697 Limited,
698 #[serde(rename = "adequate")]
699 Adequate,
700 #[serde(rename = "solid")]
701 Solid,
702 #[serde(rename = "strong")]
703 Strong,
704 #[serde(rename = "exceptional")]
705 Exceptional,
706 }
707
708 impl ::std::fmt::Display for LongTermResilienceLevel {
709 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
710 match *self {
711 Self::Limited => f.write_str("limited"),
712 Self::Adequate => f.write_str("adequate"),
713 Self::Solid => f.write_str("solid"),
714 Self::Strong => f.write_str("strong"),
715 Self::Exceptional => f.write_str("exceptional"),
716 }
717 }
718 }
719
720 impl ::std::str::FromStr for LongTermResilienceLevel {
721 type Err = self::error::ConversionError;
722 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
723 match value {
724 "limited" => Ok(Self::Limited),
725 "adequate" => Ok(Self::Adequate),
726 "solid" => Ok(Self::Solid),
727 "strong" => Ok(Self::Strong),
728 "exceptional" => Ok(Self::Exceptional),
729 _ => Err("invalid value".into()),
730 }
731 }
732 }
733
734 impl ::std::convert::TryFrom<&str> for LongTermResilienceLevel {
735 type Error = self::error::ConversionError;
736 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
737 value.parse()
738 }
739 }
740
741 impl ::std::convert::TryFrom<&::std::string::String> for LongTermResilienceLevel {
742 type Error = self::error::ConversionError;
743 fn try_from(
744 value: &::std::string::String,
745 ) -> ::std::result::Result<Self, self::error::ConversionError> {
746 value.parse()
747 }
748 }
749
750 impl ::std::convert::TryFrom<::std::string::String> for LongTermResilienceLevel {
751 type Error = self::error::ConversionError;
752 fn try_from(
753 value: ::std::string::String,
754 ) -> ::std::result::Result<Self, self::error::ConversionError> {
755 value.parse()
756 }
757 }
758
759 #[doc = "`MultiDocumentResponseDailyResilienceModel`"]
760 #[doc = r""]
761 #[doc = r" <details><summary>JSON schema</summary>"]
762 #[doc = r""]
763 #[doc = r" ```json"]
764 #[doc = "{"]
765 #[doc = " \"title\": \"MultiDocumentResponse[DailyResilienceModel]\","]
766 #[doc = " \"type\": \"object\","]
767 #[doc = " \"required\": ["]
768 #[doc = " \"data\","]
769 #[doc = " \"next_token\""]
770 #[doc = " ],"]
771 #[doc = " \"properties\": {"]
772 #[doc = " \"data\": {"]
773 #[doc = " \"title\": \"Data\","]
774 #[doc = " \"type\": \"array\","]
775 #[doc = " \"items\": {"]
776 #[doc = " \"$ref\": \"#/components/schemas/DailyResilienceModel\""]
777 #[doc = " }"]
778 #[doc = " },"]
779 #[doc = " \"next_token\": {"]
780 #[doc = " \"title\": \"Next Token\","]
781 #[doc = " \"type\": ["]
782 #[doc = " \"string\","]
783 #[doc = " \"null\""]
784 #[doc = " ]"]
785 #[doc = " }"]
786 #[doc = " }"]
787 #[doc = "}"]
788 #[doc = r" ```"]
789 #[doc = r" </details>"]
790 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
791 pub struct MultiDocumentResponseDailyResilienceModel {
792 pub data: ::std::vec::Vec<DailyResilienceModel>,
793 pub next_token: ::std::option::Option<::std::string::String>,
794 }
795
796 #[doc = "`MultiDocumentResponseEnhancedTagModel`"]
797 #[doc = r""]
798 #[doc = r" <details><summary>JSON schema</summary>"]
799 #[doc = r""]
800 #[doc = r" ```json"]
801 #[doc = "{"]
802 #[doc = " \"title\": \"MultiDocumentResponse[EnhancedTagModel]\","]
803 #[doc = " \"type\": \"object\","]
804 #[doc = " \"required\": ["]
805 #[doc = " \"data\","]
806 #[doc = " \"next_token\""]
807 #[doc = " ],"]
808 #[doc = " \"properties\": {"]
809 #[doc = " \"data\": {"]
810 #[doc = " \"title\": \"Data\","]
811 #[doc = " \"type\": \"array\","]
812 #[doc = " \"items\": {"]
813 #[doc = " \"$ref\": \"#/components/schemas/EnhancedTagModel\""]
814 #[doc = " }"]
815 #[doc = " },"]
816 #[doc = " \"next_token\": {"]
817 #[doc = " \"title\": \"Next Token\","]
818 #[doc = " \"type\": ["]
819 #[doc = " \"string\","]
820 #[doc = " \"null\""]
821 #[doc = " ]"]
822 #[doc = " }"]
823 #[doc = " }"]
824 #[doc = "}"]
825 #[doc = r" ```"]
826 #[doc = r" </details>"]
827 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
828 pub struct MultiDocumentResponseEnhancedTagModel {
829 pub data: ::std::vec::Vec<EnhancedTagModel>,
830 pub next_token: ::std::option::Option<::std::string::String>,
831 }
832
833 #[doc = "`MultiDocumentResponsePublicDailyActivity`"]
834 #[doc = r""]
835 #[doc = r" <details><summary>JSON schema</summary>"]
836 #[doc = r""]
837 #[doc = r" ```json"]
838 #[doc = "{"]
839 #[doc = " \"title\": \"MultiDocumentResponse[PublicDailyActivity]\","]
840 #[doc = " \"type\": \"object\","]
841 #[doc = " \"required\": ["]
842 #[doc = " \"data\","]
843 #[doc = " \"next_token\""]
844 #[doc = " ],"]
845 #[doc = " \"properties\": {"]
846 #[doc = " \"data\": {"]
847 #[doc = " \"title\": \"Data\","]
848 #[doc = " \"type\": \"array\","]
849 #[doc = " \"items\": {"]
850 #[doc = " \"$ref\": \"#/components/schemas/PublicDailyActivity\""]
851 #[doc = " }"]
852 #[doc = " },"]
853 #[doc = " \"next_token\": {"]
854 #[doc = " \"title\": \"Next Token\","]
855 #[doc = " \"type\": ["]
856 #[doc = " \"string\","]
857 #[doc = " \"null\""]
858 #[doc = " ]"]
859 #[doc = " }"]
860 #[doc = " }"]
861 #[doc = "}"]
862 #[doc = r" ```"]
863 #[doc = r" </details>"]
864 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
865 pub struct MultiDocumentResponsePublicDailyActivity {
866 pub data: ::std::vec::Vec<PublicDailyActivity>,
867 pub next_token: ::std::option::Option<::std::string::String>,
868 }
869
870 #[doc = "`MultiDocumentResponsePublicDailyCardiovascularAge`"]
871 #[doc = r""]
872 #[doc = r" <details><summary>JSON schema</summary>"]
873 #[doc = r""]
874 #[doc = r" ```json"]
875 #[doc = "{"]
876 #[doc = " \"title\": \"MultiDocumentResponse[PublicDailyCardiovascularAge]\","]
877 #[doc = " \"type\": \"object\","]
878 #[doc = " \"required\": ["]
879 #[doc = " \"data\","]
880 #[doc = " \"next_token\""]
881 #[doc = " ],"]
882 #[doc = " \"properties\": {"]
883 #[doc = " \"data\": {"]
884 #[doc = " \"title\": \"Data\","]
885 #[doc = " \"type\": \"array\","]
886 #[doc = " \"items\": {"]
887 #[doc = " \"$ref\": \"#/components/schemas/PublicDailyCardiovascularAge\""]
888 #[doc = " }"]
889 #[doc = " },"]
890 #[doc = " \"next_token\": {"]
891 #[doc = " \"title\": \"Next Token\","]
892 #[doc = " \"type\": ["]
893 #[doc = " \"string\","]
894 #[doc = " \"null\""]
895 #[doc = " ]"]
896 #[doc = " }"]
897 #[doc = " }"]
898 #[doc = "}"]
899 #[doc = r" ```"]
900 #[doc = r" </details>"]
901 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
902 pub struct MultiDocumentResponsePublicDailyCardiovascularAge {
903 pub data: ::std::vec::Vec<PublicDailyCardiovascularAge>,
904 pub next_token: ::std::option::Option<::std::string::String>,
905 }
906
907 #[doc = "`MultiDocumentResponsePublicDailyReadiness`"]
908 #[doc = r""]
909 #[doc = r" <details><summary>JSON schema</summary>"]
910 #[doc = r""]
911 #[doc = r" ```json"]
912 #[doc = "{"]
913 #[doc = " \"title\": \"MultiDocumentResponse[PublicDailyReadiness]\","]
914 #[doc = " \"type\": \"object\","]
915 #[doc = " \"required\": ["]
916 #[doc = " \"data\","]
917 #[doc = " \"next_token\""]
918 #[doc = " ],"]
919 #[doc = " \"properties\": {"]
920 #[doc = " \"data\": {"]
921 #[doc = " \"title\": \"Data\","]
922 #[doc = " \"type\": \"array\","]
923 #[doc = " \"items\": {"]
924 #[doc = " \"$ref\": \"#/components/schemas/PublicDailyReadiness\""]
925 #[doc = " }"]
926 #[doc = " },"]
927 #[doc = " \"next_token\": {"]
928 #[doc = " \"title\": \"Next Token\","]
929 #[doc = " \"type\": ["]
930 #[doc = " \"string\","]
931 #[doc = " \"null\""]
932 #[doc = " ]"]
933 #[doc = " }"]
934 #[doc = " }"]
935 #[doc = "}"]
936 #[doc = r" ```"]
937 #[doc = r" </details>"]
938 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
939 pub struct MultiDocumentResponsePublicDailyReadiness {
940 pub data: ::std::vec::Vec<PublicDailyReadiness>,
941 pub next_token: ::std::option::Option<::std::string::String>,
942 }
943
944 #[doc = "`MultiDocumentResponsePublicDailySleep`"]
945 #[doc = r""]
946 #[doc = r" <details><summary>JSON schema</summary>"]
947 #[doc = r""]
948 #[doc = r" ```json"]
949 #[doc = "{"]
950 #[doc = " \"title\": \"MultiDocumentResponse[PublicDailySleep]\","]
951 #[doc = " \"type\": \"object\","]
952 #[doc = " \"required\": ["]
953 #[doc = " \"data\","]
954 #[doc = " \"next_token\""]
955 #[doc = " ],"]
956 #[doc = " \"properties\": {"]
957 #[doc = " \"data\": {"]
958 #[doc = " \"title\": \"Data\","]
959 #[doc = " \"type\": \"array\","]
960 #[doc = " \"items\": {"]
961 #[doc = " \"$ref\": \"#/components/schemas/PublicDailySleep\""]
962 #[doc = " }"]
963 #[doc = " },"]
964 #[doc = " \"next_token\": {"]
965 #[doc = " \"title\": \"Next Token\","]
966 #[doc = " \"type\": ["]
967 #[doc = " \"string\","]
968 #[doc = " \"null\""]
969 #[doc = " ]"]
970 #[doc = " }"]
971 #[doc = " }"]
972 #[doc = "}"]
973 #[doc = r" ```"]
974 #[doc = r" </details>"]
975 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
976 pub struct MultiDocumentResponsePublicDailySleep {
977 pub data: ::std::vec::Vec<PublicDailySleep>,
978 pub next_token: ::std::option::Option<::std::string::String>,
979 }
980
981 #[doc = "`MultiDocumentResponsePublicDailySpO2`"]
982 #[doc = r""]
983 #[doc = r" <details><summary>JSON schema</summary>"]
984 #[doc = r""]
985 #[doc = r" ```json"]
986 #[doc = "{"]
987 #[doc = " \"title\": \"MultiDocumentResponse[PublicDailySpO2]\","]
988 #[doc = " \"type\": \"object\","]
989 #[doc = " \"required\": ["]
990 #[doc = " \"data\","]
991 #[doc = " \"next_token\""]
992 #[doc = " ],"]
993 #[doc = " \"properties\": {"]
994 #[doc = " \"data\": {"]
995 #[doc = " \"title\": \"Data\","]
996 #[doc = " \"type\": \"array\","]
997 #[doc = " \"items\": {"]
998 #[doc = " \"$ref\": \"#/components/schemas/PublicDailySpO2\""]
999 #[doc = " }"]
1000 #[doc = " },"]
1001 #[doc = " \"next_token\": {"]
1002 #[doc = " \"title\": \"Next Token\","]
1003 #[doc = " \"type\": ["]
1004 #[doc = " \"string\","]
1005 #[doc = " \"null\""]
1006 #[doc = " ]"]
1007 #[doc = " }"]
1008 #[doc = " }"]
1009 #[doc = "}"]
1010 #[doc = r" ```"]
1011 #[doc = r" </details>"]
1012 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1013 pub struct MultiDocumentResponsePublicDailySpO2 {
1014 pub data: ::std::vec::Vec<PublicDailySpO2>,
1015 pub next_token: ::std::option::Option<::std::string::String>,
1016 }
1017
1018 #[doc = "`MultiDocumentResponsePublicDailyStress`"]
1019 #[doc = r""]
1020 #[doc = r" <details><summary>JSON schema</summary>"]
1021 #[doc = r""]
1022 #[doc = r" ```json"]
1023 #[doc = "{"]
1024 #[doc = " \"title\": \"MultiDocumentResponse[PublicDailyStress]\","]
1025 #[doc = " \"type\": \"object\","]
1026 #[doc = " \"required\": ["]
1027 #[doc = " \"data\","]
1028 #[doc = " \"next_token\""]
1029 #[doc = " ],"]
1030 #[doc = " \"properties\": {"]
1031 #[doc = " \"data\": {"]
1032 #[doc = " \"title\": \"Data\","]
1033 #[doc = " \"type\": \"array\","]
1034 #[doc = " \"items\": {"]
1035 #[doc = " \"$ref\": \"#/components/schemas/PublicDailyStress\""]
1036 #[doc = " }"]
1037 #[doc = " },"]
1038 #[doc = " \"next_token\": {"]
1039 #[doc = " \"title\": \"Next Token\","]
1040 #[doc = " \"type\": ["]
1041 #[doc = " \"string\","]
1042 #[doc = " \"null\""]
1043 #[doc = " ]"]
1044 #[doc = " }"]
1045 #[doc = " }"]
1046 #[doc = "}"]
1047 #[doc = r" ```"]
1048 #[doc = r" </details>"]
1049 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1050 pub struct MultiDocumentResponsePublicDailyStress {
1051 pub data: ::std::vec::Vec<PublicDailyStress>,
1052 pub next_token: ::std::option::Option<::std::string::String>,
1053 }
1054
1055 #[doc = "`MultiDocumentResponsePublicModifiedSleepModel`"]
1056 #[doc = r""]
1057 #[doc = r" <details><summary>JSON schema</summary>"]
1058 #[doc = r""]
1059 #[doc = r" ```json"]
1060 #[doc = "{"]
1061 #[doc = " \"title\": \"MultiDocumentResponse[PublicModifiedSleepModel]\","]
1062 #[doc = " \"type\": \"object\","]
1063 #[doc = " \"required\": ["]
1064 #[doc = " \"data\","]
1065 #[doc = " \"next_token\""]
1066 #[doc = " ],"]
1067 #[doc = " \"properties\": {"]
1068 #[doc = " \"data\": {"]
1069 #[doc = " \"title\": \"Data\","]
1070 #[doc = " \"type\": \"array\","]
1071 #[doc = " \"items\": {"]
1072 #[doc = " \"$ref\": \"#/components/schemas/PublicModifiedSleepModel\""]
1073 #[doc = " }"]
1074 #[doc = " },"]
1075 #[doc = " \"next_token\": {"]
1076 #[doc = " \"title\": \"Next Token\","]
1077 #[doc = " \"type\": ["]
1078 #[doc = " \"string\","]
1079 #[doc = " \"null\""]
1080 #[doc = " ]"]
1081 #[doc = " }"]
1082 #[doc = " }"]
1083 #[doc = "}"]
1084 #[doc = r" ```"]
1085 #[doc = r" </details>"]
1086 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1087 pub struct MultiDocumentResponsePublicModifiedSleepModel {
1088 pub data: ::std::vec::Vec<PublicModifiedSleepModel>,
1089 pub next_token: ::std::option::Option<::std::string::String>,
1090 }
1091
1092 #[doc = "`MultiDocumentResponsePublicRestModePeriod`"]
1093 #[doc = r""]
1094 #[doc = r" <details><summary>JSON schema</summary>"]
1095 #[doc = r""]
1096 #[doc = r" ```json"]
1097 #[doc = "{"]
1098 #[doc = " \"title\": \"MultiDocumentResponse[PublicRestModePeriod]\","]
1099 #[doc = " \"type\": \"object\","]
1100 #[doc = " \"required\": ["]
1101 #[doc = " \"data\","]
1102 #[doc = " \"next_token\""]
1103 #[doc = " ],"]
1104 #[doc = " \"properties\": {"]
1105 #[doc = " \"data\": {"]
1106 #[doc = " \"title\": \"Data\","]
1107 #[doc = " \"type\": \"array\","]
1108 #[doc = " \"items\": {"]
1109 #[doc = " \"$ref\": \"#/components/schemas/PublicRestModePeriod\""]
1110 #[doc = " }"]
1111 #[doc = " },"]
1112 #[doc = " \"next_token\": {"]
1113 #[doc = " \"title\": \"Next Token\","]
1114 #[doc = " \"type\": ["]
1115 #[doc = " \"string\","]
1116 #[doc = " \"null\""]
1117 #[doc = " ]"]
1118 #[doc = " }"]
1119 #[doc = " }"]
1120 #[doc = "}"]
1121 #[doc = r" ```"]
1122 #[doc = r" </details>"]
1123 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1124 pub struct MultiDocumentResponsePublicRestModePeriod {
1125 pub data: ::std::vec::Vec<PublicRestModePeriod>,
1126 pub next_token: ::std::option::Option<::std::string::String>,
1127 }
1128
1129 #[doc = "`MultiDocumentResponsePublicRingConfiguration`"]
1130 #[doc = r""]
1131 #[doc = r" <details><summary>JSON schema</summary>"]
1132 #[doc = r""]
1133 #[doc = r" ```json"]
1134 #[doc = "{"]
1135 #[doc = " \"title\": \"MultiDocumentResponse[PublicRingConfiguration]\","]
1136 #[doc = " \"type\": \"object\","]
1137 #[doc = " \"required\": ["]
1138 #[doc = " \"data\","]
1139 #[doc = " \"next_token\""]
1140 #[doc = " ],"]
1141 #[doc = " \"properties\": {"]
1142 #[doc = " \"data\": {"]
1143 #[doc = " \"title\": \"Data\","]
1144 #[doc = " \"type\": \"array\","]
1145 #[doc = " \"items\": {"]
1146 #[doc = " \"$ref\": \"#/components/schemas/PublicRingConfiguration\""]
1147 #[doc = " }"]
1148 #[doc = " },"]
1149 #[doc = " \"next_token\": {"]
1150 #[doc = " \"title\": \"Next Token\","]
1151 #[doc = " \"type\": ["]
1152 #[doc = " \"string\","]
1153 #[doc = " \"null\""]
1154 #[doc = " ]"]
1155 #[doc = " }"]
1156 #[doc = " }"]
1157 #[doc = "}"]
1158 #[doc = r" ```"]
1159 #[doc = r" </details>"]
1160 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1161 pub struct MultiDocumentResponsePublicRingConfiguration {
1162 pub data: ::std::vec::Vec<PublicRingConfiguration>,
1163 pub next_token: ::std::option::Option<::std::string::String>,
1164 }
1165
1166 #[doc = "`MultiDocumentResponsePublicSession`"]
1167 #[doc = r""]
1168 #[doc = r" <details><summary>JSON schema</summary>"]
1169 #[doc = r""]
1170 #[doc = r" ```json"]
1171 #[doc = "{"]
1172 #[doc = " \"title\": \"MultiDocumentResponse[PublicSession]\","]
1173 #[doc = " \"type\": \"object\","]
1174 #[doc = " \"required\": ["]
1175 #[doc = " \"data\","]
1176 #[doc = " \"next_token\""]
1177 #[doc = " ],"]
1178 #[doc = " \"properties\": {"]
1179 #[doc = " \"data\": {"]
1180 #[doc = " \"title\": \"Data\","]
1181 #[doc = " \"type\": \"array\","]
1182 #[doc = " \"items\": {"]
1183 #[doc = " \"$ref\": \"#/components/schemas/PublicSession\""]
1184 #[doc = " }"]
1185 #[doc = " },"]
1186 #[doc = " \"next_token\": {"]
1187 #[doc = " \"title\": \"Next Token\","]
1188 #[doc = " \"type\": ["]
1189 #[doc = " \"string\","]
1190 #[doc = " \"null\""]
1191 #[doc = " ]"]
1192 #[doc = " }"]
1193 #[doc = " }"]
1194 #[doc = "}"]
1195 #[doc = r" ```"]
1196 #[doc = r" </details>"]
1197 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1198 pub struct MultiDocumentResponsePublicSession {
1199 pub data: ::std::vec::Vec<PublicSession>,
1200 pub next_token: ::std::option::Option<::std::string::String>,
1201 }
1202
1203 #[doc = "`MultiDocumentResponsePublicSleepTime`"]
1204 #[doc = r""]
1205 #[doc = r" <details><summary>JSON schema</summary>"]
1206 #[doc = r""]
1207 #[doc = r" ```json"]
1208 #[doc = "{"]
1209 #[doc = " \"title\": \"MultiDocumentResponse[PublicSleepTime]\","]
1210 #[doc = " \"type\": \"object\","]
1211 #[doc = " \"required\": ["]
1212 #[doc = " \"data\","]
1213 #[doc = " \"next_token\""]
1214 #[doc = " ],"]
1215 #[doc = " \"properties\": {"]
1216 #[doc = " \"data\": {"]
1217 #[doc = " \"title\": \"Data\","]
1218 #[doc = " \"type\": \"array\","]
1219 #[doc = " \"items\": {"]
1220 #[doc = " \"$ref\": \"#/components/schemas/PublicSleepTime\""]
1221 #[doc = " }"]
1222 #[doc = " },"]
1223 #[doc = " \"next_token\": {"]
1224 #[doc = " \"title\": \"Next Token\","]
1225 #[doc = " \"type\": ["]
1226 #[doc = " \"string\","]
1227 #[doc = " \"null\""]
1228 #[doc = " ]"]
1229 #[doc = " }"]
1230 #[doc = " }"]
1231 #[doc = "}"]
1232 #[doc = r" ```"]
1233 #[doc = r" </details>"]
1234 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1235 pub struct MultiDocumentResponsePublicSleepTime {
1236 pub data: ::std::vec::Vec<PublicSleepTime>,
1237 pub next_token: ::std::option::Option<::std::string::String>,
1238 }
1239
1240 #[doc = "`MultiDocumentResponsePublicVo2Max`"]
1241 #[doc = r""]
1242 #[doc = r" <details><summary>JSON schema</summary>"]
1243 #[doc = r""]
1244 #[doc = r" ```json"]
1245 #[doc = "{"]
1246 #[doc = " \"title\": \"MultiDocumentResponse[PublicVO2Max]\","]
1247 #[doc = " \"type\": \"object\","]
1248 #[doc = " \"required\": ["]
1249 #[doc = " \"data\","]
1250 #[doc = " \"next_token\""]
1251 #[doc = " ],"]
1252 #[doc = " \"properties\": {"]
1253 #[doc = " \"data\": {"]
1254 #[doc = " \"title\": \"Data\","]
1255 #[doc = " \"type\": \"array\","]
1256 #[doc = " \"items\": {"]
1257 #[doc = " \"$ref\": \"#/components/schemas/PublicVO2Max\""]
1258 #[doc = " }"]
1259 #[doc = " },"]
1260 #[doc = " \"next_token\": {"]
1261 #[doc = " \"title\": \"Next Token\","]
1262 #[doc = " \"type\": ["]
1263 #[doc = " \"string\","]
1264 #[doc = " \"null\""]
1265 #[doc = " ]"]
1266 #[doc = " }"]
1267 #[doc = " }"]
1268 #[doc = "}"]
1269 #[doc = r" ```"]
1270 #[doc = r" </details>"]
1271 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1272 pub struct MultiDocumentResponsePublicVo2Max {
1273 pub data: ::std::vec::Vec<PublicVo2Max>,
1274 pub next_token: ::std::option::Option<::std::string::String>,
1275 }
1276
1277 #[doc = "`MultiDocumentResponsePublicWorkout`"]
1278 #[doc = r""]
1279 #[doc = r" <details><summary>JSON schema</summary>"]
1280 #[doc = r""]
1281 #[doc = r" ```json"]
1282 #[doc = "{"]
1283 #[doc = " \"title\": \"MultiDocumentResponse[PublicWorkout]\","]
1284 #[doc = " \"type\": \"object\","]
1285 #[doc = " \"required\": ["]
1286 #[doc = " \"data\","]
1287 #[doc = " \"next_token\""]
1288 #[doc = " ],"]
1289 #[doc = " \"properties\": {"]
1290 #[doc = " \"data\": {"]
1291 #[doc = " \"title\": \"Data\","]
1292 #[doc = " \"type\": \"array\","]
1293 #[doc = " \"items\": {"]
1294 #[doc = " \"$ref\": \"#/components/schemas/PublicWorkout\""]
1295 #[doc = " }"]
1296 #[doc = " },"]
1297 #[doc = " \"next_token\": {"]
1298 #[doc = " \"title\": \"Next Token\","]
1299 #[doc = " \"type\": ["]
1300 #[doc = " \"string\","]
1301 #[doc = " \"null\""]
1302 #[doc = " ]"]
1303 #[doc = " }"]
1304 #[doc = " }"]
1305 #[doc = "}"]
1306 #[doc = r" ```"]
1307 #[doc = r" </details>"]
1308 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1309 pub struct MultiDocumentResponsePublicWorkout {
1310 pub data: ::std::vec::Vec<PublicWorkout>,
1311 pub next_token: ::std::option::Option<::std::string::String>,
1312 }
1313
1314 #[doc = "`MultiDocumentResponseTagModel`"]
1315 #[doc = r""]
1316 #[doc = r" <details><summary>JSON schema</summary>"]
1317 #[doc = r""]
1318 #[doc = r" ```json"]
1319 #[doc = "{"]
1320 #[doc = " \"title\": \"MultiDocumentResponse[TagModel]\","]
1321 #[doc = " \"type\": \"object\","]
1322 #[doc = " \"required\": ["]
1323 #[doc = " \"data\","]
1324 #[doc = " \"next_token\""]
1325 #[doc = " ],"]
1326 #[doc = " \"properties\": {"]
1327 #[doc = " \"data\": {"]
1328 #[doc = " \"title\": \"Data\","]
1329 #[doc = " \"type\": \"array\","]
1330 #[doc = " \"items\": {"]
1331 #[doc = " \"$ref\": \"#/components/schemas/TagModel\""]
1332 #[doc = " }"]
1333 #[doc = " },"]
1334 #[doc = " \"next_token\": {"]
1335 #[doc = " \"title\": \"Next Token\","]
1336 #[doc = " \"type\": ["]
1337 #[doc = " \"string\","]
1338 #[doc = " \"null\""]
1339 #[doc = " ]"]
1340 #[doc = " }"]
1341 #[doc = " }"]
1342 #[doc = "}"]
1343 #[doc = r" ```"]
1344 #[doc = r" </details>"]
1345 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1346 pub struct MultiDocumentResponseTagModel {
1347 pub data: ::std::vec::Vec<TagModel>,
1348 pub next_token: ::std::option::Option<::std::string::String>,
1349 }
1350
1351 #[doc = "`PersonalInfoResponse`"]
1352 #[doc = r""]
1353 #[doc = r" <details><summary>JSON schema</summary>"]
1354 #[doc = r""]
1355 #[doc = r" ```json"]
1356 #[doc = "{"]
1357 #[doc = " \"title\": \"PersonalInfoResponse\","]
1358 #[doc = " \"type\": \"object\","]
1359 #[doc = " \"required\": ["]
1360 #[doc = " \"id\""]
1361 #[doc = " ],"]
1362 #[doc = " \"properties\": {"]
1363 #[doc = " \"age\": {"]
1364 #[doc = " \"title\": \"Age\","]
1365 #[doc = " \"type\": ["]
1366 #[doc = " \"integer\","]
1367 #[doc = " \"null\""]
1368 #[doc = " ]"]
1369 #[doc = " },"]
1370 #[doc = " \"biological_sex\": {"]
1371 #[doc = " \"title\": \"Biological Sex\","]
1372 #[doc = " \"type\": ["]
1373 #[doc = " \"string\","]
1374 #[doc = " \"null\""]
1375 #[doc = " ]"]
1376 #[doc = " },"]
1377 #[doc = " \"email\": {"]
1378 #[doc = " \"title\": \"Email\","]
1379 #[doc = " \"type\": ["]
1380 #[doc = " \"string\","]
1381 #[doc = " \"null\""]
1382 #[doc = " ]"]
1383 #[doc = " },"]
1384 #[doc = " \"height\": {"]
1385 #[doc = " \"title\": \"Height\","]
1386 #[doc = " \"type\": ["]
1387 #[doc = " \"number\","]
1388 #[doc = " \"null\""]
1389 #[doc = " ]"]
1390 #[doc = " },"]
1391 #[doc = " \"id\": {"]
1392 #[doc = " \"title\": \"Id\","]
1393 #[doc = " \"type\": \"string\""]
1394 #[doc = " },"]
1395 #[doc = " \"weight\": {"]
1396 #[doc = " \"title\": \"Weight\","]
1397 #[doc = " \"type\": ["]
1398 #[doc = " \"number\","]
1399 #[doc = " \"null\""]
1400 #[doc = " ]"]
1401 #[doc = " }"]
1402 #[doc = " }"]
1403 #[doc = "}"]
1404 #[doc = r" ```"]
1405 #[doc = r" </details>"]
1406 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1407 pub struct PersonalInfoResponse {
1408 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1409 pub age: ::std::option::Option<i64>,
1410 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1411 pub biological_sex: ::std::option::Option<::std::string::String>,
1412 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1413 pub email: ::std::option::Option<::std::string::String>,
1414 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1415 pub height: ::std::option::Option<f64>,
1416 pub id: ::std::string::String,
1417 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1418 pub weight: ::std::option::Option<f64>,
1419 }
1420
1421 #[doc = "Object defining activity score contributors."]
1422 #[doc = r""]
1423 #[doc = r" <details><summary>JSON schema</summary>"]
1424 #[doc = r""]
1425 #[doc = r" ```json"]
1426 #[doc = "{"]
1427 #[doc = " \"title\": \"PublicActivityContributors\","]
1428 #[doc = " \"description\": \"Object defining activity score contributors.\","]
1429 #[doc = " \"type\": \"object\","]
1430 #[doc = " \"properties\": {"]
1431 #[doc = " \"meet_daily_targets\": {"]
1432 #[doc = " \"title\": \"\","]
1433 #[doc = " \"description\": \"Contribution of meeting previous 7-day daily activity targets in range [1, 100].\","]
1434 #[doc = " \"type\": ["]
1435 #[doc = " \"integer\","]
1436 #[doc = " \"null\""]
1437 #[doc = " ]"]
1438 #[doc = " },"]
1439 #[doc = " \"move_every_hour\": {"]
1440 #[doc = " \"title\": \"\","]
1441 #[doc = " \"description\": \"Contribution of previous 24-hour inactivity alerts in range [1, 100].\","]
1442 #[doc = " \"type\": ["]
1443 #[doc = " \"integer\","]
1444 #[doc = " \"null\""]
1445 #[doc = " ]"]
1446 #[doc = " },"]
1447 #[doc = " \"recovery_time\": {"]
1448 #[doc = " \"title\": \"\","]
1449 #[doc = " \"description\": \"Contribution of previous 7-day recovery time in range [1, 100].\","]
1450 #[doc = " \"type\": ["]
1451 #[doc = " \"integer\","]
1452 #[doc = " \"null\""]
1453 #[doc = " ]"]
1454 #[doc = " },"]
1455 #[doc = " \"stay_active\": {"]
1456 #[doc = " \"title\": \"\","]
1457 #[doc = " \"description\": \"Contribution of previous 24-hour activity in range [1, 100].\","]
1458 #[doc = " \"type\": ["]
1459 #[doc = " \"integer\","]
1460 #[doc = " \"null\""]
1461 #[doc = " ]"]
1462 #[doc = " },"]
1463 #[doc = " \"training_frequency\": {"]
1464 #[doc = " \"title\": \"\","]
1465 #[doc = " \"description\": \"Contribution of previous 7-day exercise frequency in range [1, 100].\","]
1466 #[doc = " \"type\": ["]
1467 #[doc = " \"integer\","]
1468 #[doc = " \"null\""]
1469 #[doc = " ]"]
1470 #[doc = " },"]
1471 #[doc = " \"training_volume\": {"]
1472 #[doc = " \"title\": \"\","]
1473 #[doc = " \"description\": \"Contribution of previous 7-day exercise volume in range [1, 100].\","]
1474 #[doc = " \"type\": ["]
1475 #[doc = " \"integer\","]
1476 #[doc = " \"null\""]
1477 #[doc = " ]"]
1478 #[doc = " }"]
1479 #[doc = " }"]
1480 #[doc = "}"]
1481 #[doc = r" ```"]
1482 #[doc = r" </details>"]
1483 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1484 pub struct PublicActivityContributors {
1485 #[doc = "Contribution of meeting previous 7-day daily activity targets in range [1, 100]."]
1486 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1487 pub meet_daily_targets: ::std::option::Option<i64>,
1488 #[doc = "Contribution of previous 24-hour inactivity alerts in range [1, 100]."]
1489 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1490 pub move_every_hour: ::std::option::Option<i64>,
1491 #[doc = "Contribution of previous 7-day recovery time in range [1, 100]."]
1492 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1493 pub recovery_time: ::std::option::Option<i64>,
1494 #[doc = "Contribution of previous 24-hour activity in range [1, 100]."]
1495 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1496 pub stay_active: ::std::option::Option<i64>,
1497 #[doc = "Contribution of previous 7-day exercise frequency in range [1, 100]."]
1498 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1499 pub training_frequency: ::std::option::Option<i64>,
1500 #[doc = "Contribution of previous 7-day exercise volume in range [1, 100]."]
1501 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1502 pub training_volume: ::std::option::Option<i64>,
1503 }
1504
1505 impl ::std::default::Default for PublicActivityContributors {
1506 fn default() -> Self {
1507 Self {
1508 meet_daily_targets: Default::default(),
1509 move_every_hour: Default::default(),
1510 recovery_time: Default::default(),
1511 stay_active: Default::default(),
1512 training_frequency: Default::default(),
1513 training_volume: Default::default(),
1514 }
1515 }
1516 }
1517
1518 #[doc = "Object defining a daily activity that is a 24-hour period starting at 4 a.m."]
1519 #[doc = r""]
1520 #[doc = r" <details><summary>JSON schema</summary>"]
1521 #[doc = r""]
1522 #[doc = r" ```json"]
1523 #[doc = "{"]
1524 #[doc = " \"title\": \"PublicDailyActivity\","]
1525 #[doc = " \"description\": \"Object defining a daily activity that is a 24-hour period starting at 4 a.m.\","]
1526 #[doc = " \"type\": \"object\","]
1527 #[doc = " \"required\": ["]
1528 #[doc = " \"active_calories\","]
1529 #[doc = " \"average_met_minutes\","]
1530 #[doc = " \"contributors\","]
1531 #[doc = " \"day\","]
1532 #[doc = " \"equivalent_walking_distance\","]
1533 #[doc = " \"high_activity_met_minutes\","]
1534 #[doc = " \"high_activity_time\","]
1535 #[doc = " \"id\","]
1536 #[doc = " \"inactivity_alerts\","]
1537 #[doc = " \"low_activity_met_minutes\","]
1538 #[doc = " \"low_activity_time\","]
1539 #[doc = " \"medium_activity_met_minutes\","]
1540 #[doc = " \"medium_activity_time\","]
1541 #[doc = " \"met\","]
1542 #[doc = " \"meters_to_target\","]
1543 #[doc = " \"non_wear_time\","]
1544 #[doc = " \"resting_time\","]
1545 #[doc = " \"sedentary_met_minutes\","]
1546 #[doc = " \"sedentary_time\","]
1547 #[doc = " \"steps\","]
1548 #[doc = " \"target_calories\","]
1549 #[doc = " \"target_meters\","]
1550 #[doc = " \"timestamp\","]
1551 #[doc = " \"total_calories\""]
1552 #[doc = " ],"]
1553 #[doc = " \"properties\": {"]
1554 #[doc = " \"active_calories\": {"]
1555 #[doc = " \"title\": \"\","]
1556 #[doc = " \"description\": \"Active calories expended in kilocalories.\","]
1557 #[doc = " \"type\": \"integer\""]
1558 #[doc = " },"]
1559 #[doc = " \"average_met_minutes\": {"]
1560 #[doc = " \"title\": \"\","]
1561 #[doc = " \"description\": \"Average MET minutes.\","]
1562 #[doc = " \"type\": \"number\""]
1563 #[doc = " },"]
1564 #[doc = " \"class_5_min\": {"]
1565 #[doc = " \"title\": \"\","]
1566 #[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\\\".\","]
1567 #[doc = " \"type\": ["]
1568 #[doc = " \"string\","]
1569 #[doc = " \"null\""]
1570 #[doc = " ]"]
1571 #[doc = " },"]
1572 #[doc = " \"contributors\": {"]
1573 #[doc = " \"$ref\": \"#/components/schemas/PublicActivityContributors\""]
1574 #[doc = " },"]
1575 #[doc = " \"day\": {"]
1576 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
1577 #[doc = " },"]
1578 #[doc = " \"equivalent_walking_distance\": {"]
1579 #[doc = " \"title\": \"\","]
1580 #[doc = " \"description\": \"Equivalent walking distance of energe expenditure in meters.\","]
1581 #[doc = " \"type\": \"integer\""]
1582 #[doc = " },"]
1583 #[doc = " \"high_activity_met_minutes\": {"]
1584 #[doc = " \"title\": \"\","]
1585 #[doc = " \"description\": \"The total METs of each minute classified as high activity.\","]
1586 #[doc = " \"type\": \"integer\""]
1587 #[doc = " },"]
1588 #[doc = " \"high_activity_time\": {"]
1589 #[doc = " \"title\": \"\","]
1590 #[doc = " \"description\": \"The total time in seconds of each minute classified as high activity.\","]
1591 #[doc = " \"type\": \"integer\""]
1592 #[doc = " },"]
1593 #[doc = " \"id\": {"]
1594 #[doc = " \"title\": \"\","]
1595 #[doc = " \"description\": \"Unique identifier of the object.\","]
1596 #[doc = " \"type\": \"string\","]
1597 #[doc = " \"minLength\": 1"]
1598 #[doc = " },"]
1599 #[doc = " \"inactivity_alerts\": {"]
1600 #[doc = " \"title\": \"\","]
1601 #[doc = " \"description\": \"Number of inactivity alerts received.\","]
1602 #[doc = " \"type\": \"integer\""]
1603 #[doc = " },"]
1604 #[doc = " \"low_activity_met_minutes\": {"]
1605 #[doc = " \"title\": \"\","]
1606 #[doc = " \"description\": \"The total METs of each minute classified as low activity.\","]
1607 #[doc = " \"type\": \"integer\""]
1608 #[doc = " },"]
1609 #[doc = " \"low_activity_time\": {"]
1610 #[doc = " \"title\": \"\","]
1611 #[doc = " \"description\": \"The total time in seconds of each minute classified as low activity.\","]
1612 #[doc = " \"type\": \"integer\""]
1613 #[doc = " },"]
1614 #[doc = " \"medium_activity_met_minutes\": {"]
1615 #[doc = " \"title\": \"\","]
1616 #[doc = " \"description\": \"The total METs of each minute classified as medium activity.\","]
1617 #[doc = " \"type\": \"integer\""]
1618 #[doc = " },"]
1619 #[doc = " \"medium_activity_time\": {"]
1620 #[doc = " \"title\": \"\","]
1621 #[doc = " \"description\": \"The total time in seconds of each minute classified as medium activity.\","]
1622 #[doc = " \"type\": \"integer\""]
1623 #[doc = " },"]
1624 #[doc = " \"met\": {"]
1625 #[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
1626 #[doc = " },"]
1627 #[doc = " \"meters_to_target\": {"]
1628 #[doc = " \"title\": \"\","]
1629 #[doc = " \"description\": \"Meters remaining to target.\","]
1630 #[doc = " \"type\": \"integer\""]
1631 #[doc = " },"]
1632 #[doc = " \"non_wear_time\": {"]
1633 #[doc = " \"title\": \"\","]
1634 #[doc = " \"description\": \"Ring non-wear time in seconds.\","]
1635 #[doc = " \"type\": \"integer\""]
1636 #[doc = " },"]
1637 #[doc = " \"resting_time\": {"]
1638 #[doc = " \"title\": \"\","]
1639 #[doc = " \"description\": \"Resting time in seconds.\","]
1640 #[doc = " \"type\": \"integer\""]
1641 #[doc = " },"]
1642 #[doc = " \"score\": {"]
1643 #[doc = " \"title\": \"\","]
1644 #[doc = " \"description\": \"Activity score in range [1, 100].\","]
1645 #[doc = " \"type\": ["]
1646 #[doc = " \"integer\","]
1647 #[doc = " \"null\""]
1648 #[doc = " ]"]
1649 #[doc = " },"]
1650 #[doc = " \"sedentary_met_minutes\": {"]
1651 #[doc = " \"title\": \"\","]
1652 #[doc = " \"description\": \"Sedentary MET minutes.\","]
1653 #[doc = " \"type\": \"integer\""]
1654 #[doc = " },"]
1655 #[doc = " \"sedentary_time\": {"]
1656 #[doc = " \"title\": \"\","]
1657 #[doc = " \"description\": \"Sedentary time in seconds.\","]
1658 #[doc = " \"type\": \"integer\""]
1659 #[doc = " },"]
1660 #[doc = " \"steps\": {"]
1661 #[doc = " \"title\": \"\","]
1662 #[doc = " \"description\": \"Total number of steps taken.\","]
1663 #[doc = " \"type\": \"integer\""]
1664 #[doc = " },"]
1665 #[doc = " \"target_calories\": {"]
1666 #[doc = " \"title\": \"\","]
1667 #[doc = " \"description\": \"Daily activity target in kilocalories.\","]
1668 #[doc = " \"type\": \"integer\""]
1669 #[doc = " },"]
1670 #[doc = " \"target_meters\": {"]
1671 #[doc = " \"title\": \"\","]
1672 #[doc = " \"description\": \"Daily activity target in meters.\","]
1673 #[doc = " \"type\": \"integer\""]
1674 #[doc = " },"]
1675 #[doc = " \"timestamp\": {"]
1676 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
1677 #[doc = " },"]
1678 #[doc = " \"total_calories\": {"]
1679 #[doc = " \"title\": \"\","]
1680 #[doc = " \"description\": \"Total calories expended in kilocalories.\","]
1681 #[doc = " \"type\": \"integer\""]
1682 #[doc = " }"]
1683 #[doc = " },"]
1684 #[doc = " \"x-cloud-only\": true,"]
1685 #[doc = " \"x-collection\": \"publicdailyactivity\","]
1686 #[doc = " \"x-owner\": \"movement-squad\""]
1687 #[doc = "}"]
1688 #[doc = r" ```"]
1689 #[doc = r" </details>"]
1690 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1691 pub struct PublicDailyActivity {
1692 #[doc = "Active calories expended in kilocalories."]
1693 pub active_calories: i64,
1694 #[doc = "Average MET minutes."]
1695 pub average_met_minutes: f64,
1696 #[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\"."]
1697 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1698 pub class_5_min: ::std::option::Option<::std::string::String>,
1699 pub contributors: PublicActivityContributors,
1700 pub day: IsoDate,
1701 #[doc = "Equivalent walking distance of energe expenditure in meters."]
1702 pub equivalent_walking_distance: i64,
1703 #[doc = "The total METs of each minute classified as high activity."]
1704 pub high_activity_met_minutes: i64,
1705 #[doc = "The total time in seconds of each minute classified as high activity."]
1706 pub high_activity_time: i64,
1707 #[doc = "Unique identifier of the object."]
1708 pub id: X,
1709 #[doc = "Number of inactivity alerts received."]
1710 pub inactivity_alerts: i64,
1711 #[doc = "The total METs of each minute classified as low activity."]
1712 pub low_activity_met_minutes: i64,
1713 #[doc = "The total time in seconds of each minute classified as low activity."]
1714 pub low_activity_time: i64,
1715 #[doc = "The total METs of each minute classified as medium activity."]
1716 pub medium_activity_met_minutes: i64,
1717 #[doc = "The total time in seconds of each minute classified as medium activity."]
1718 pub medium_activity_time: i64,
1719 pub met: PublicSample,
1720 #[doc = "Meters remaining to target."]
1721 pub meters_to_target: i64,
1722 #[doc = "Ring non-wear time in seconds."]
1723 pub non_wear_time: i64,
1724 #[doc = "Resting time in seconds."]
1725 pub resting_time: i64,
1726 #[doc = "Activity score in range [1, 100]."]
1727 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1728 pub score: ::std::option::Option<i64>,
1729 #[doc = "Sedentary MET minutes."]
1730 pub sedentary_met_minutes: i64,
1731 #[doc = "Sedentary time in seconds."]
1732 pub sedentary_time: i64,
1733 #[doc = "Total number of steps taken."]
1734 pub steps: i64,
1735 #[doc = "Daily activity target in kilocalories."]
1736 pub target_calories: i64,
1737 #[doc = "Daily activity target in meters."]
1738 pub target_meters: i64,
1739 pub timestamp: LocalizedDateTime,
1740 #[doc = "Total calories expended in kilocalories."]
1741 pub total_calories: i64,
1742 }
1743
1744 #[doc = "Daily Cardiovascular Age."]
1745 #[doc = r""]
1746 #[doc = r" <details><summary>JSON schema</summary>"]
1747 #[doc = r""]
1748 #[doc = r" ```json"]
1749 #[doc = "{"]
1750 #[doc = " \"title\": \"PublicDailyCardiovascularAge\","]
1751 #[doc = " \"description\": \"Daily Cardiovascular Age.\","]
1752 #[doc = " \"type\": \"object\","]
1753 #[doc = " \"required\": ["]
1754 #[doc = " \"day\","]
1755 #[doc = " \"id\""]
1756 #[doc = " ],"]
1757 #[doc = " \"properties\": {"]
1758 #[doc = " \"day\": {"]
1759 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
1760 #[doc = " },"]
1761 #[doc = " \"id\": {"]
1762 #[doc = " \"title\": \"\","]
1763 #[doc = " \"description\": \"Unique identifier of the object.\","]
1764 #[doc = " \"type\": \"string\","]
1765 #[doc = " \"minLength\": 1"]
1766 #[doc = " },"]
1767 #[doc = " \"pulse_wave_velocity\": {"]
1768 #[doc = " \"title\": \"\","]
1769 #[doc = " \"description\": \"Pulse wave velocity (m/s), derived from vascular age, with possible offset added.\","]
1770 #[doc = " \"type\": ["]
1771 #[doc = " \"number\","]
1772 #[doc = " \"null\""]
1773 #[doc = " ]"]
1774 #[doc = " },"]
1775 #[doc = " \"vascular_age\": {"]
1776 #[doc = " \"title\": \"\","]
1777 #[doc = " \"description\": \"Predicted vascular age in range [18, 100].\","]
1778 #[doc = " \"type\": ["]
1779 #[doc = " \"integer\","]
1780 #[doc = " \"null\""]
1781 #[doc = " ]"]
1782 #[doc = " }"]
1783 #[doc = " },"]
1784 #[doc = " \"x-cloud-only\": true,"]
1785 #[doc = " \"x-collection\": \"publicdailycardiovascularage\","]
1786 #[doc = " \"x-owner\": \"heart-health-squad\""]
1787 #[doc = "}"]
1788 #[doc = r" ```"]
1789 #[doc = r" </details>"]
1790 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1791 pub struct PublicDailyCardiovascularAge {
1792 pub day: IsoDate,
1793 #[doc = "Unique identifier of the object."]
1794 pub id: X,
1795 #[doc = "Pulse wave velocity (m/s), derived from vascular age, with possible offset added."]
1796 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1797 pub pulse_wave_velocity: ::std::option::Option<f64>,
1798 #[doc = "Predicted vascular age in range [18, 100]."]
1799 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1800 pub vascular_age: ::std::option::Option<i64>,
1801 }
1802
1803 #[doc = "Public object defining daily readiness."]
1804 #[doc = r""]
1805 #[doc = r" <details><summary>JSON schema</summary>"]
1806 #[doc = r""]
1807 #[doc = r" ```json"]
1808 #[doc = "{"]
1809 #[doc = " \"title\": \"PublicDailyReadiness\","]
1810 #[doc = " \"description\": \"Public object defining daily readiness.\","]
1811 #[doc = " \"type\": \"object\","]
1812 #[doc = " \"required\": ["]
1813 #[doc = " \"contributors\","]
1814 #[doc = " \"day\","]
1815 #[doc = " \"id\","]
1816 #[doc = " \"timestamp\""]
1817 #[doc = " ],"]
1818 #[doc = " \"properties\": {"]
1819 #[doc = " \"contributors\": {"]
1820 #[doc = " \"$ref\": \"#/components/schemas/PublicReadinessContributors\""]
1821 #[doc = " },"]
1822 #[doc = " \"day\": {"]
1823 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
1824 #[doc = " },"]
1825 #[doc = " \"id\": {"]
1826 #[doc = " \"title\": \"\","]
1827 #[doc = " \"description\": \"Unique identifier of the object.\","]
1828 #[doc = " \"type\": \"string\","]
1829 #[doc = " \"minLength\": 1"]
1830 #[doc = " },"]
1831 #[doc = " \"score\": {"]
1832 #[doc = " \"title\": \"\","]
1833 #[doc = " \"description\": \"Daily readiness score.\","]
1834 #[doc = " \"type\": ["]
1835 #[doc = " \"integer\","]
1836 #[doc = " \"null\""]
1837 #[doc = " ]"]
1838 #[doc = " },"]
1839 #[doc = " \"temperature_deviation\": {"]
1840 #[doc = " \"title\": \"\","]
1841 #[doc = " \"description\": \"Temperature deviation in degrees Celsius.\","]
1842 #[doc = " \"type\": ["]
1843 #[doc = " \"number\","]
1844 #[doc = " \"null\""]
1845 #[doc = " ]"]
1846 #[doc = " },"]
1847 #[doc = " \"temperature_trend_deviation\": {"]
1848 #[doc = " \"title\": \"\","]
1849 #[doc = " \"description\": \"Temperature trend deviation in degrees Celsius.\","]
1850 #[doc = " \"type\": ["]
1851 #[doc = " \"number\","]
1852 #[doc = " \"null\""]
1853 #[doc = " ]"]
1854 #[doc = " },"]
1855 #[doc = " \"timestamp\": {"]
1856 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
1857 #[doc = " }"]
1858 #[doc = " },"]
1859 #[doc = " \"x-cloud-only\": true,"]
1860 #[doc = " \"x-collection\": \"publicdailyreadiness\","]
1861 #[doc = " \"x-owner\": \"wellbeing-squad\""]
1862 #[doc = "}"]
1863 #[doc = r" ```"]
1864 #[doc = r" </details>"]
1865 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1866 pub struct PublicDailyReadiness {
1867 pub contributors: PublicReadinessContributors,
1868 pub day: IsoDate,
1869 #[doc = "Unique identifier of the object."]
1870 pub id: X,
1871 #[doc = "Daily readiness score."]
1872 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1873 pub score: ::std::option::Option<i64>,
1874 #[doc = "Temperature deviation in degrees Celsius."]
1875 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1876 pub temperature_deviation: ::std::option::Option<f64>,
1877 #[doc = "Temperature trend deviation in degrees Celsius."]
1878 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1879 pub temperature_trend_deviation: ::std::option::Option<f64>,
1880 pub timestamp: LocalizedDateTime,
1881 }
1882
1883 #[doc = "Public object defining daily sleep."]
1884 #[doc = r""]
1885 #[doc = r" <details><summary>JSON schema</summary>"]
1886 #[doc = r""]
1887 #[doc = r" ```json"]
1888 #[doc = "{"]
1889 #[doc = " \"title\": \"PublicDailySleep\","]
1890 #[doc = " \"description\": \"Public object defining daily sleep.\","]
1891 #[doc = " \"type\": \"object\","]
1892 #[doc = " \"required\": ["]
1893 #[doc = " \"contributors\","]
1894 #[doc = " \"day\","]
1895 #[doc = " \"id\","]
1896 #[doc = " \"timestamp\""]
1897 #[doc = " ],"]
1898 #[doc = " \"properties\": {"]
1899 #[doc = " \"contributors\": {"]
1900 #[doc = " \"$ref\": \"#/components/schemas/PublicSleepContributors\""]
1901 #[doc = " },"]
1902 #[doc = " \"day\": {"]
1903 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
1904 #[doc = " },"]
1905 #[doc = " \"id\": {"]
1906 #[doc = " \"title\": \"\","]
1907 #[doc = " \"description\": \"Unique identifier of the object.\","]
1908 #[doc = " \"type\": \"string\","]
1909 #[doc = " \"minLength\": 1"]
1910 #[doc = " },"]
1911 #[doc = " \"score\": {"]
1912 #[doc = " \"title\": \"\","]
1913 #[doc = " \"description\": \"Daily sleep score.\","]
1914 #[doc = " \"type\": ["]
1915 #[doc = " \"integer\","]
1916 #[doc = " \"null\""]
1917 #[doc = " ]"]
1918 #[doc = " },"]
1919 #[doc = " \"timestamp\": {"]
1920 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
1921 #[doc = " }"]
1922 #[doc = " },"]
1923 #[doc = " \"x-cloud-only\": true,"]
1924 #[doc = " \"x-collection\": \"publicdailysleep\","]
1925 #[doc = " \"x-owner\": \"sleep-squad\""]
1926 #[doc = "}"]
1927 #[doc = r" ```"]
1928 #[doc = r" </details>"]
1929 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1930 pub struct PublicDailySleep {
1931 pub contributors: PublicSleepContributors,
1932 pub day: IsoDate,
1933 #[doc = "Unique identifier of the object."]
1934 pub id: X,
1935 #[doc = "Daily sleep score."]
1936 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1937 pub score: ::std::option::Option<i64>,
1938 pub timestamp: LocalizedDateTime,
1939 }
1940
1941 #[doc = "Daily SpO2 (Oxygen saturation)."]
1942 #[doc = r""]
1943 #[doc = r" <details><summary>JSON schema</summary>"]
1944 #[doc = r""]
1945 #[doc = r" ```json"]
1946 #[doc = "{"]
1947 #[doc = " \"title\": \"PublicDailySpO2\","]
1948 #[doc = " \"description\": \"Daily SpO2 (Oxygen saturation).\","]
1949 #[doc = " \"type\": \"object\","]
1950 #[doc = " \"required\": ["]
1951 #[doc = " \"day\","]
1952 #[doc = " \"id\""]
1953 #[doc = " ],"]
1954 #[doc = " \"properties\": {"]
1955 #[doc = " \"breathing_disturbance_index\": {"]
1956 #[doc = " \"title\": \"\","]
1957 #[doc = " \"description\": \"Breathing Disturbance Index (BDI) calculated using detected SpO2 drops from timeseries. Values should be in range [0, 100]\","]
1958 #[doc = " \"type\": ["]
1959 #[doc = " \"integer\","]
1960 #[doc = " \"null\""]
1961 #[doc = " ]"]
1962 #[doc = " },"]
1963 #[doc = " \"day\": {"]
1964 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
1965 #[doc = " },"]
1966 #[doc = " \"id\": {"]
1967 #[doc = " \"title\": \"\","]
1968 #[doc = " \"description\": \"Unique identifier of the object.\","]
1969 #[doc = " \"type\": \"string\","]
1970 #[doc = " \"minLength\": 1"]
1971 #[doc = " },"]
1972 #[doc = " \"spo2_percentage\": {"]
1973 #[doc = " \"title\": \"\","]
1974 #[doc = " \"description\": \"The daily SpO2 percentage value aggregates. Sourced from SpO2 percentage timeseries values.\","]
1975 #[doc = " \"oneOf\": ["]
1976 #[doc = " {"]
1977 #[doc = " \"type\": \"null\""]
1978 #[doc = " },"]
1979 #[doc = " {"]
1980 #[doc = " \"allOf\": ["]
1981 #[doc = " {"]
1982 #[doc = " \"$ref\": \"#/components/schemas/PublicSpo2AggregatedValues\""]
1983 #[doc = " }"]
1984 #[doc = " ]"]
1985 #[doc = " }"]
1986 #[doc = " ]"]
1987 #[doc = " }"]
1988 #[doc = " },"]
1989 #[doc = " \"x-cloud-only\": true,"]
1990 #[doc = " \"x-collection\": \"publicdailyspo2\","]
1991 #[doc = " \"x-owner\": \"sleep-squad\""]
1992 #[doc = "}"]
1993 #[doc = r" ```"]
1994 #[doc = r" </details>"]
1995 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1996 pub struct PublicDailySpO2 {
1997 #[doc = "Breathing Disturbance Index (BDI) calculated using detected SpO2 drops from timeseries. Values should be in range [0, 100]"]
1998 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1999 pub breathing_disturbance_index: ::std::option::Option<i64>,
2000 pub day: IsoDate,
2001 #[doc = "Unique identifier of the object."]
2002 pub id: X,
2003 #[doc = "The daily SpO2 percentage value aggregates. Sourced from SpO2 percentage timeseries values."]
2004 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2005 pub spo2_percentage: ::std::option::Option<PublicSpo2AggregatedValues>,
2006 }
2007
2008 #[doc = "Daily stress."]
2009 #[doc = r""]
2010 #[doc = r" <details><summary>JSON schema</summary>"]
2011 #[doc = r""]
2012 #[doc = r" ```json"]
2013 #[doc = "{"]
2014 #[doc = " \"title\": \"PublicDailyStress\","]
2015 #[doc = " \"description\": \"Daily stress.\","]
2016 #[doc = " \"type\": \"object\","]
2017 #[doc = " \"required\": ["]
2018 #[doc = " \"day\","]
2019 #[doc = " \"id\""]
2020 #[doc = " ],"]
2021 #[doc = " \"properties\": {"]
2022 #[doc = " \"day\": {"]
2023 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
2024 #[doc = " },"]
2025 #[doc = " \"day_summary\": {"]
2026 #[doc = " \"title\": \"\","]
2027 #[doc = " \"description\": \"Stress summary of full day.\","]
2028 #[doc = " \"oneOf\": ["]
2029 #[doc = " {"]
2030 #[doc = " \"type\": \"null\""]
2031 #[doc = " },"]
2032 #[doc = " {"]
2033 #[doc = " \"allOf\": ["]
2034 #[doc = " {"]
2035 #[doc = " \"$ref\": \"#/components/schemas/PublicDailyStressSummary\""]
2036 #[doc = " }"]
2037 #[doc = " ]"]
2038 #[doc = " }"]
2039 #[doc = " ]"]
2040 #[doc = " },"]
2041 #[doc = " \"id\": {"]
2042 #[doc = " \"title\": \"\","]
2043 #[doc = " \"description\": \"Unique identifier of the object.\","]
2044 #[doc = " \"type\": \"string\","]
2045 #[doc = " \"minLength\": 1"]
2046 #[doc = " },"]
2047 #[doc = " \"recovery_high\": {"]
2048 #[doc = " \"title\": \"\","]
2049 #[doc = " \"description\": \"Time spent in a high recovery zone (bottom quartile data) in seconds.\","]
2050 #[doc = " \"type\": ["]
2051 #[doc = " \"integer\","]
2052 #[doc = " \"null\""]
2053 #[doc = " ]"]
2054 #[doc = " },"]
2055 #[doc = " \"stress_high\": {"]
2056 #[doc = " \"title\": \"\","]
2057 #[doc = " \"description\": \"Time spent in a high stress zone (top quartile of data) in seconds.\","]
2058 #[doc = " \"type\": ["]
2059 #[doc = " \"integer\","]
2060 #[doc = " \"null\""]
2061 #[doc = " ]"]
2062 #[doc = " }"]
2063 #[doc = " },"]
2064 #[doc = " \"x-cloud-only\": true,"]
2065 #[doc = " \"x-collection\": \"publicdailystress\","]
2066 #[doc = " \"x-owner\": \"wellbeing-squad\""]
2067 #[doc = "}"]
2068 #[doc = r" ```"]
2069 #[doc = r" </details>"]
2070 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2071 pub struct PublicDailyStress {
2072 pub day: IsoDate,
2073 #[doc = "Stress summary of full day."]
2074 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2075 pub day_summary: ::std::option::Option<PublicDailyStressSummary>,
2076 #[doc = "Unique identifier of the object."]
2077 pub id: X,
2078 #[doc = "Time spent in a high recovery zone (bottom quartile data) in seconds."]
2079 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2080 pub recovery_high: ::std::option::Option<i64>,
2081 #[doc = "Time spent in a high stress zone (top quartile of data) in seconds."]
2082 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2083 pub stress_high: ::std::option::Option<i64>,
2084 }
2085
2086 #[doc = "Possible public daily stress summary types."]
2087 #[doc = r""]
2088 #[doc = r" <details><summary>JSON schema</summary>"]
2089 #[doc = r""]
2090 #[doc = r" ```json"]
2091 #[doc = "{"]
2092 #[doc = " \"title\": \"PublicDailyStressSummary\","]
2093 #[doc = " \"description\": \"Possible public daily stress summary types.\","]
2094 #[doc = " \"type\": \"string\","]
2095 #[doc = " \"enum\": ["]
2096 #[doc = " \"restored\","]
2097 #[doc = " \"normal\","]
2098 #[doc = " \"stressful\""]
2099 #[doc = " ]"]
2100 #[doc = "}"]
2101 #[doc = r" ```"]
2102 #[doc = r" </details>"]
2103 #[derive(
2104 :: serde :: Deserialize,
2105 :: serde :: Serialize,
2106 Clone,
2107 Copy,
2108 Debug,
2109 Eq,
2110 Hash,
2111 Ord,
2112 PartialEq,
2113 PartialOrd,
2114 )]
2115 pub enum PublicDailyStressSummary {
2116 #[serde(rename = "restored")]
2117 Restored,
2118 #[serde(rename = "normal")]
2119 Normal,
2120 #[serde(rename = "stressful")]
2121 Stressful,
2122 }
2123
2124 impl ::std::fmt::Display for PublicDailyStressSummary {
2125 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2126 match *self {
2127 Self::Restored => f.write_str("restored"),
2128 Self::Normal => f.write_str("normal"),
2129 Self::Stressful => f.write_str("stressful"),
2130 }
2131 }
2132 }
2133
2134 impl ::std::str::FromStr for PublicDailyStressSummary {
2135 type Err = self::error::ConversionError;
2136 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2137 match value {
2138 "restored" => Ok(Self::Restored),
2139 "normal" => Ok(Self::Normal),
2140 "stressful" => Ok(Self::Stressful),
2141 _ => Err("invalid value".into()),
2142 }
2143 }
2144 }
2145
2146 impl ::std::convert::TryFrom<&str> for PublicDailyStressSummary {
2147 type Error = self::error::ConversionError;
2148 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2149 value.parse()
2150 }
2151 }
2152
2153 impl ::std::convert::TryFrom<&::std::string::String> for PublicDailyStressSummary {
2154 type Error = self::error::ConversionError;
2155 fn try_from(
2156 value: &::std::string::String,
2157 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2158 value.parse()
2159 }
2160 }
2161
2162 impl ::std::convert::TryFrom<::std::string::String> for PublicDailyStressSummary {
2163 type Error = self::error::ConversionError;
2164 fn try_from(
2165 value: ::std::string::String,
2166 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2167 value.parse()
2168 }
2169 }
2170
2171 #[doc = "Heart rate sample"]
2172 #[doc = r""]
2173 #[doc = r" <details><summary>JSON schema</summary>"]
2174 #[doc = r""]
2175 #[doc = r" ```json"]
2176 #[doc = "{"]
2177 #[doc = " \"title\": \"PublicHeartRateRow\","]
2178 #[doc = " \"description\": \"Heart rate sample\","]
2179 #[doc = " \"type\": \"object\","]
2180 #[doc = " \"required\": ["]
2181 #[doc = " \"bpm\","]
2182 #[doc = " \"source\","]
2183 #[doc = " \"timestamp\","]
2184 #[doc = " \"timestamp_unix\""]
2185 #[doc = " ],"]
2186 #[doc = " \"properties\": {"]
2187 #[doc = " \"bpm\": {"]
2188 #[doc = " \"title\": \"\","]
2189 #[doc = " \"description\": \"Heart rate as beats per minute.\","]
2190 #[doc = " \"type\": \"integer\""]
2191 #[doc = " },"]
2192 #[doc = " \"source\": {"]
2193 #[doc = " \"$ref\": \"#/components/schemas/PublicHeartRateSource\""]
2194 #[doc = " },"]
2195 #[doc = " \"timestamp\": {"]
2196 #[doc = " \"$ref\": \"#/components/schemas/UtcDateTime\""]
2197 #[doc = " },"]
2198 #[doc = " \"timestamp_unix\": {"]
2199 #[doc = " \"title\": \"\","]
2200 #[doc = " \"description\": \"Timestamp of the discrete sample as unix time in milliseconds.\","]
2201 #[doc = " \"type\": \"integer\""]
2202 #[doc = " }"]
2203 #[doc = " },"]
2204 #[doc = " \"x-cloud-only\": true,"]
2205 #[doc = " \"x-collection\": \"publicheartrate\","]
2206 #[doc = " \"x-owner\": \"core-sensing-squad\""]
2207 #[doc = "}"]
2208 #[doc = r" ```"]
2209 #[doc = r" </details>"]
2210 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2211 pub struct PublicHeartRateRow {
2212 #[doc = "Heart rate as beats per minute."]
2213 pub bpm: i64,
2214 pub source: PublicHeartRateSource,
2215 pub timestamp: UtcDateTime,
2216 #[doc = "Timestamp of the discrete sample as unix time in milliseconds."]
2217 pub timestamp_unix: i64,
2218 }
2219
2220 #[doc = "Possible heart rate sources."]
2221 #[doc = r""]
2222 #[doc = r" <details><summary>JSON schema</summary>"]
2223 #[doc = r""]
2224 #[doc = r" ```json"]
2225 #[doc = "{"]
2226 #[doc = " \"title\": \"PublicHeartRateSource\","]
2227 #[doc = " \"description\": \"Possible heart rate sources.\","]
2228 #[doc = " \"type\": \"string\","]
2229 #[doc = " \"enum\": ["]
2230 #[doc = " \"awake\","]
2231 #[doc = " \"workout\","]
2232 #[doc = " \"rest\","]
2233 #[doc = " \"sleep\","]
2234 #[doc = " \"live\","]
2235 #[doc = " \"session\""]
2236 #[doc = " ]"]
2237 #[doc = "}"]
2238 #[doc = r" ```"]
2239 #[doc = r" </details>"]
2240 #[derive(
2241 :: serde :: Deserialize,
2242 :: serde :: Serialize,
2243 Clone,
2244 Copy,
2245 Debug,
2246 Eq,
2247 Hash,
2248 Ord,
2249 PartialEq,
2250 PartialOrd,
2251 )]
2252 pub enum PublicHeartRateSource {
2253 #[serde(rename = "awake")]
2254 Awake,
2255 #[serde(rename = "workout")]
2256 Workout,
2257 #[serde(rename = "rest")]
2258 Rest,
2259 #[serde(rename = "sleep")]
2260 Sleep,
2261 #[serde(rename = "live")]
2262 Live,
2263 #[serde(rename = "session")]
2264 Session,
2265 }
2266
2267 impl ::std::fmt::Display for PublicHeartRateSource {
2268 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2269 match *self {
2270 Self::Awake => f.write_str("awake"),
2271 Self::Workout => f.write_str("workout"),
2272 Self::Rest => f.write_str("rest"),
2273 Self::Sleep => f.write_str("sleep"),
2274 Self::Live => f.write_str("live"),
2275 Self::Session => f.write_str("session"),
2276 }
2277 }
2278 }
2279
2280 impl ::std::str::FromStr for PublicHeartRateSource {
2281 type Err = self::error::ConversionError;
2282 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2283 match value {
2284 "awake" => Ok(Self::Awake),
2285 "workout" => Ok(Self::Workout),
2286 "rest" => Ok(Self::Rest),
2287 "sleep" => Ok(Self::Sleep),
2288 "live" => Ok(Self::Live),
2289 "session" => Ok(Self::Session),
2290 _ => Err("invalid value".into()),
2291 }
2292 }
2293 }
2294
2295 impl ::std::convert::TryFrom<&str> for PublicHeartRateSource {
2296 type Error = self::error::ConversionError;
2297 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2298 value.parse()
2299 }
2300 }
2301
2302 impl ::std::convert::TryFrom<&::std::string::String> for PublicHeartRateSource {
2303 type Error = self::error::ConversionError;
2304 fn try_from(
2305 value: &::std::string::String,
2306 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2307 value.parse()
2308 }
2309 }
2310
2311 impl ::std::convert::TryFrom<::std::string::String> for PublicHeartRateSource {
2312 type Error = self::error::ConversionError;
2313 fn try_from(
2314 value: ::std::string::String,
2315 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2316 value.parse()
2317 }
2318 }
2319
2320 #[doc = "`PublicModifiedSleepModel`"]
2321 #[doc = r""]
2322 #[doc = r" <details><summary>JSON schema</summary>"]
2323 #[doc = r""]
2324 #[doc = r" ```json"]
2325 #[doc = "{"]
2326 #[doc = " \"title\": \"PublicModifiedSleepModel\","]
2327 #[doc = " \"type\": \"object\","]
2328 #[doc = " \"required\": ["]
2329 #[doc = " \"bedtime_end\","]
2330 #[doc = " \"bedtime_start\","]
2331 #[doc = " \"day\","]
2332 #[doc = " \"id\","]
2333 #[doc = " \"low_battery_alert\","]
2334 #[doc = " \"period\","]
2335 #[doc = " \"time_in_bed\""]
2336 #[doc = " ],"]
2337 #[doc = " \"properties\": {"]
2338 #[doc = " \"app_sleep_phase_5_min\": {"]
2339 #[doc = " \"title\": \"App Sleep Phase 5 Min\","]
2340 #[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 \","]
2341 #[doc = " \"type\": ["]
2342 #[doc = " \"string\","]
2343 #[doc = " \"null\""]
2344 #[doc = " ]"]
2345 #[doc = " },"]
2346 #[doc = " \"average_breath\": {"]
2347 #[doc = " \"title\": \"\","]
2348 #[doc = " \"description\": \"Average breathing rate during sleep as breaths/minute.\","]
2349 #[doc = " \"type\": ["]
2350 #[doc = " \"number\","]
2351 #[doc = " \"null\""]
2352 #[doc = " ]"]
2353 #[doc = " },"]
2354 #[doc = " \"average_heart_rate\": {"]
2355 #[doc = " \"title\": \"\","]
2356 #[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.\","]
2357 #[doc = " \"type\": ["]
2358 #[doc = " \"number\","]
2359 #[doc = " \"null\""]
2360 #[doc = " ]"]
2361 #[doc = " },"]
2362 #[doc = " \"average_hrv\": {"]
2363 #[doc = " \"title\": \"\","]
2364 #[doc = " \"description\": \"Average heart rate variability during sleep.\","]
2365 #[doc = " \"type\": ["]
2366 #[doc = " \"integer\","]
2367 #[doc = " \"null\""]
2368 #[doc = " ]"]
2369 #[doc = " },"]
2370 #[doc = " \"awake_time\": {"]
2371 #[doc = " \"title\": \"\","]
2372 #[doc = " \"description\": \"Duration spent awake in seconds.\","]
2373 #[doc = " \"type\": ["]
2374 #[doc = " \"integer\","]
2375 #[doc = " \"null\""]
2376 #[doc = " ]"]
2377 #[doc = " },"]
2378 #[doc = " \"bedtime_end\": {"]
2379 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
2380 #[doc = " },"]
2381 #[doc = " \"bedtime_start\": {"]
2382 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
2383 #[doc = " },"]
2384 #[doc = " \"day\": {"]
2385 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
2386 #[doc = " },"]
2387 #[doc = " \"deep_sleep_duration\": {"]
2388 #[doc = " \"title\": \"\","]
2389 #[doc = " \"description\": \"Duration spent in deep sleep in seconds.\","]
2390 #[doc = " \"type\": ["]
2391 #[doc = " \"integer\","]
2392 #[doc = " \"null\""]
2393 #[doc = " ]"]
2394 #[doc = " },"]
2395 #[doc = " \"efficiency\": {"]
2396 #[doc = " \"title\": \"\","]
2397 #[doc = " \"description\": \"Sleep efficiency rating in range [1, 100].\","]
2398 #[doc = " \"type\": ["]
2399 #[doc = " \"integer\","]
2400 #[doc = " \"null\""]
2401 #[doc = " ]"]
2402 #[doc = " },"]
2403 #[doc = " \"heart_rate\": {"]
2404 #[doc = " \"title\": \"\","]
2405 #[doc = " \"description\": \"Object containing heart rate samples.\","]
2406 #[doc = " \"oneOf\": ["]
2407 #[doc = " {"]
2408 #[doc = " \"type\": \"null\""]
2409 #[doc = " },"]
2410 #[doc = " {"]
2411 #[doc = " \"allOf\": ["]
2412 #[doc = " {"]
2413 #[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
2414 #[doc = " }"]
2415 #[doc = " ]"]
2416 #[doc = " }"]
2417 #[doc = " ]"]
2418 #[doc = " },"]
2419 #[doc = " \"hrv\": {"]
2420 #[doc = " \"title\": \"\","]
2421 #[doc = " \"description\": \"Object containing heart rate variability samples.\","]
2422 #[doc = " \"oneOf\": ["]
2423 #[doc = " {"]
2424 #[doc = " \"type\": \"null\""]
2425 #[doc = " },"]
2426 #[doc = " {"]
2427 #[doc = " \"allOf\": ["]
2428 #[doc = " {"]
2429 #[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
2430 #[doc = " }"]
2431 #[doc = " ]"]
2432 #[doc = " }"]
2433 #[doc = " ]"]
2434 #[doc = " },"]
2435 #[doc = " \"id\": {"]
2436 #[doc = " \"title\": \"\","]
2437 #[doc = " \"description\": \"Unique identifier of the object.\","]
2438 #[doc = " \"type\": \"string\","]
2439 #[doc = " \"minLength\": 1"]
2440 #[doc = " },"]
2441 #[doc = " \"latency\": {"]
2442 #[doc = " \"title\": \"\","]
2443 #[doc = " \"description\": \"Sleep latency in seconds. This is the time it took for the user to fall asleep after going to bed.\","]
2444 #[doc = " \"type\": ["]
2445 #[doc = " \"integer\","]
2446 #[doc = " \"null\""]
2447 #[doc = " ]"]
2448 #[doc = " },"]
2449 #[doc = " \"light_sleep_duration\": {"]
2450 #[doc = " \"title\": \"\","]
2451 #[doc = " \"description\": \"Duration spent in light sleep in seconds.\","]
2452 #[doc = " \"type\": ["]
2453 #[doc = " \"integer\","]
2454 #[doc = " \"null\""]
2455 #[doc = " ]"]
2456 #[doc = " },"]
2457 #[doc = " \"low_battery_alert\": {"]
2458 #[doc = " \"title\": \"\","]
2459 #[doc = " \"description\": \"Flag indicating if a low battery alert occurred.\","]
2460 #[doc = " \"type\": \"boolean\""]
2461 #[doc = " },"]
2462 #[doc = " \"lowest_heart_rate\": {"]
2463 #[doc = " \"title\": \"\","]
2464 #[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.\","]
2465 #[doc = " \"type\": ["]
2466 #[doc = " \"integer\","]
2467 #[doc = " \"null\""]
2468 #[doc = " ]"]
2469 #[doc = " },"]
2470 #[doc = " \"movement_30_sec\": {"]
2471 #[doc = " \"title\": \"\","]
2472 #[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\\\".\","]
2473 #[doc = " \"type\": ["]
2474 #[doc = " \"string\","]
2475 #[doc = " \"null\""]
2476 #[doc = " ]"]
2477 #[doc = " },"]
2478 #[doc = " \"period\": {"]
2479 #[doc = " \"title\": \"\","]
2480 #[doc = " \"description\": \"ECore sleep period identifier.\","]
2481 #[doc = " \"type\": \"integer\""]
2482 #[doc = " },"]
2483 #[doc = " \"readiness\": {"]
2484 #[doc = " \"title\": \"\","]
2485 #[doc = " \"description\": \"Object containing the readiness details.\","]
2486 #[doc = " \"oneOf\": ["]
2487 #[doc = " {"]
2488 #[doc = " \"type\": \"null\""]
2489 #[doc = " },"]
2490 #[doc = " {"]
2491 #[doc = " \"allOf\": ["]
2492 #[doc = " {"]
2493 #[doc = " \"$ref\": \"#/components/schemas/PublicReadiness\""]
2494 #[doc = " }"]
2495 #[doc = " ]"]
2496 #[doc = " }"]
2497 #[doc = " ]"]
2498 #[doc = " },"]
2499 #[doc = " \"readiness_score_delta\": {"]
2500 #[doc = " \"title\": \"\","]
2501 #[doc = " \"description\": \"Effect on readiness score caused by this sleep period.\","]
2502 #[doc = " \"type\": ["]
2503 #[doc = " \"integer\","]
2504 #[doc = " \"null\""]
2505 #[doc = " ]"]
2506 #[doc = " },"]
2507 #[doc = " \"rem_sleep_duration\": {"]
2508 #[doc = " \"title\": \"\","]
2509 #[doc = " \"description\": \"Duration spent in REM sleep in seconds.\","]
2510 #[doc = " \"type\": ["]
2511 #[doc = " \"integer\","]
2512 #[doc = " \"null\""]
2513 #[doc = " ]"]
2514 #[doc = " },"]
2515 #[doc = " \"restless_periods\": {"]
2516 #[doc = " \"title\": \"\","]
2517 #[doc = " \"description\": \"Number of restless periods during sleep.\","]
2518 #[doc = " \"type\": ["]
2519 #[doc = " \"integer\","]
2520 #[doc = " \"null\""]
2521 #[doc = " ]"]
2522 #[doc = " },"]
2523 #[doc = " \"ring_id\": {"]
2524 #[doc = " \"title\": \"Ring Id\","]
2525 #[doc = " \"description\": \"Encrypted identifier of the ring that produced this sleep data.\","]
2526 #[doc = " \"type\": ["]
2527 #[doc = " \"string\","]
2528 #[doc = " \"null\""]
2529 #[doc = " ]"]
2530 #[doc = " },"]
2531 #[doc = " \"sleep_algorithm_version\": {"]
2532 #[doc = " \"title\": \"\","]
2533 #[doc = " \"description\": \"Version of the sleep algorithm used to calculate the sleep data.\","]
2534 #[doc = " \"oneOf\": ["]
2535 #[doc = " {"]
2536 #[doc = " \"type\": \"null\""]
2537 #[doc = " },"]
2538 #[doc = " {"]
2539 #[doc = " \"allOf\": ["]
2540 #[doc = " {"]
2541 #[doc = " \"$ref\": \"#/components/schemas/PublicSleepAlgorithmVersion\""]
2542 #[doc = " }"]
2543 #[doc = " ]"]
2544 #[doc = " }"]
2545 #[doc = " ]"]
2546 #[doc = " },"]
2547 #[doc = " \"sleep_analysis_reason\": {"]
2548 #[doc = " \"title\": \"\","]
2549 #[doc = " \"description\": \"The reason for the creation or update of the latest version of this sleep.\","]
2550 #[doc = " \"oneOf\": ["]
2551 #[doc = " {"]
2552 #[doc = " \"type\": \"null\""]
2553 #[doc = " },"]
2554 #[doc = " {"]
2555 #[doc = " \"allOf\": ["]
2556 #[doc = " {"]
2557 #[doc = " \"$ref\": \"#/components/schemas/PublicSleepAnalysisReason\""]
2558 #[doc = " }"]
2559 #[doc = " ]"]
2560 #[doc = " }"]
2561 #[doc = " ]"]
2562 #[doc = " },"]
2563 #[doc = " \"sleep_phase_30_sec\": {"]
2564 #[doc = " \"title\": \"\","]
2565 #[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\\\".\","]
2566 #[doc = " \"type\": ["]
2567 #[doc = " \"string\","]
2568 #[doc = " \"null\""]
2569 #[doc = " ]"]
2570 #[doc = " },"]
2571 #[doc = " \"sleep_phase_5_min\": {"]
2572 #[doc = " \"title\": \"\","]
2573 #[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\\\".\","]
2574 #[doc = " \"type\": ["]
2575 #[doc = " \"string\","]
2576 #[doc = " \"null\""]
2577 #[doc = " ]"]
2578 #[doc = " },"]
2579 #[doc = " \"sleep_score_delta\": {"]
2580 #[doc = " \"title\": \"\","]
2581 #[doc = " \"description\": \"Effect on sleep score caused by this sleep period.\","]
2582 #[doc = " \"type\": ["]
2583 #[doc = " \"integer\","]
2584 #[doc = " \"null\""]
2585 #[doc = " ]"]
2586 #[doc = " },"]
2587 #[doc = " \"time_in_bed\": {"]
2588 #[doc = " \"title\": \"\","]
2589 #[doc = " \"description\": \"Duration spent in bed in seconds.\","]
2590 #[doc = " \"type\": \"integer\""]
2591 #[doc = " },"]
2592 #[doc = " \"total_sleep_duration\": {"]
2593 #[doc = " \"title\": \"\","]
2594 #[doc = " \"description\": \"Total sleep duration in seconds.\","]
2595 #[doc = " \"type\": ["]
2596 #[doc = " \"integer\","]
2597 #[doc = " \"null\""]
2598 #[doc = " ]"]
2599 #[doc = " },"]
2600 #[doc = " \"type\": {"]
2601 #[doc = " \"title\": \"\","]
2602 #[doc = " \"description\": \"Type of the sleep period.\","]
2603 #[doc = " \"oneOf\": ["]
2604 #[doc = " {"]
2605 #[doc = " \"type\": \"null\""]
2606 #[doc = " },"]
2607 #[doc = " {"]
2608 #[doc = " \"allOf\": ["]
2609 #[doc = " {"]
2610 #[doc = " \"$ref\": \"#/components/schemas/PublicSleepType\""]
2611 #[doc = " }"]
2612 #[doc = " ]"]
2613 #[doc = " }"]
2614 #[doc = " ]"]
2615 #[doc = " }"]
2616 #[doc = " },"]
2617 #[doc = " \"x-cloud-only\": true,"]
2618 #[doc = " \"x-collection\": \"publicsleepmodel\","]
2619 #[doc = " \"x-owner\": \"sleep-squad\""]
2620 #[doc = "}"]
2621 #[doc = r" ```"]
2622 #[doc = r" </details>"]
2623 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2624 pub struct PublicModifiedSleepModel {
2625 #[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 "]
2626 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2627 pub app_sleep_phase_5_min: ::std::option::Option<::std::string::String>,
2628 #[doc = "Average breathing rate during sleep as breaths/minute."]
2629 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2630 pub average_breath: ::std::option::Option<f64>,
2631 #[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."]
2632 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2633 pub average_heart_rate: ::std::option::Option<f64>,
2634 #[doc = "Average heart rate variability during sleep."]
2635 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2636 pub average_hrv: ::std::option::Option<i64>,
2637 #[doc = "Duration spent awake in seconds."]
2638 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2639 pub awake_time: ::std::option::Option<i64>,
2640 pub bedtime_end: LocalizedDateTime,
2641 pub bedtime_start: LocalizedDateTime,
2642 pub day: IsoDate,
2643 #[doc = "Duration spent in deep sleep in seconds."]
2644 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2645 pub deep_sleep_duration: ::std::option::Option<i64>,
2646 #[doc = "Sleep efficiency rating in range [1, 100]."]
2647 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2648 pub efficiency: ::std::option::Option<i64>,
2649 #[doc = "Object containing heart rate samples."]
2650 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2651 pub heart_rate: ::std::option::Option<PublicSample>,
2652 #[doc = "Object containing heart rate variability samples."]
2653 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2654 pub hrv: ::std::option::Option<PublicSample>,
2655 #[doc = "Unique identifier of the object."]
2656 pub id: X,
2657 #[doc = "Sleep latency in seconds. This is the time it took for the user to fall asleep after going to bed."]
2658 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2659 pub latency: ::std::option::Option<i64>,
2660 #[doc = "Duration spent in light sleep in seconds."]
2661 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2662 pub light_sleep_duration: ::std::option::Option<i64>,
2663 #[doc = "Flag indicating if a low battery alert occurred."]
2664 pub low_battery_alert: bool,
2665 #[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."]
2666 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2667 pub lowest_heart_rate: ::std::option::Option<i64>,
2668 #[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\"."]
2669 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2670 pub movement_30_sec: ::std::option::Option<::std::string::String>,
2671 #[doc = "ECore sleep period identifier."]
2672 pub period: i64,
2673 #[doc = "Object containing the readiness details."]
2674 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2675 pub readiness: ::std::option::Option<PublicReadiness>,
2676 #[doc = "Effect on readiness score caused by this sleep period."]
2677 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2678 pub readiness_score_delta: ::std::option::Option<i64>,
2679 #[doc = "Duration spent in REM sleep in seconds."]
2680 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2681 pub rem_sleep_duration: ::std::option::Option<i64>,
2682 #[doc = "Number of restless periods during sleep."]
2683 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2684 pub restless_periods: ::std::option::Option<i64>,
2685 #[doc = "Encrypted identifier of the ring that produced this sleep data."]
2686 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2687 pub ring_id: ::std::option::Option<::std::string::String>,
2688 #[doc = "Version of the sleep algorithm used to calculate the sleep data."]
2689 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2690 pub sleep_algorithm_version: ::std::option::Option<PublicSleepAlgorithmVersion>,
2691 #[doc = "The reason for the creation or update of the latest version of this sleep."]
2692 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2693 pub sleep_analysis_reason: ::std::option::Option<PublicSleepAnalysisReason>,
2694 #[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\"."]
2695 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2696 pub sleep_phase_30_sec: ::std::option::Option<::std::string::String>,
2697 #[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\"."]
2698 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2699 pub sleep_phase_5_min: ::std::option::Option<::std::string::String>,
2700 #[doc = "Effect on sleep score caused by this sleep period."]
2701 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2702 pub sleep_score_delta: ::std::option::Option<i64>,
2703 #[doc = "Duration spent in bed in seconds."]
2704 pub time_in_bed: i64,
2705 #[doc = "Total sleep duration in seconds."]
2706 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2707 pub total_sleep_duration: ::std::option::Option<i64>,
2708 #[doc = "Type of the sleep period."]
2709 #[serde(
2710 rename = "type",
2711 default,
2712 skip_serializing_if = "::std::option::Option::is_none"
2713 )]
2714 pub type_: ::std::option::Option<PublicSleepType>,
2715 }
2716
2717 #[doc = "Possible Moment moods."]
2718 #[doc = r""]
2719 #[doc = r" <details><summary>JSON schema</summary>"]
2720 #[doc = r""]
2721 #[doc = r" ```json"]
2722 #[doc = "{"]
2723 #[doc = " \"title\": \"PublicMomentMood\","]
2724 #[doc = " \"description\": \"Possible Moment moods.\","]
2725 #[doc = " \"type\": \"string\","]
2726 #[doc = " \"enum\": ["]
2727 #[doc = " \"bad\","]
2728 #[doc = " \"worse\","]
2729 #[doc = " \"same\","]
2730 #[doc = " \"good\","]
2731 #[doc = " \"great\""]
2732 #[doc = " ]"]
2733 #[doc = "}"]
2734 #[doc = r" ```"]
2735 #[doc = r" </details>"]
2736 #[derive(
2737 :: serde :: Deserialize,
2738 :: serde :: Serialize,
2739 Clone,
2740 Copy,
2741 Debug,
2742 Eq,
2743 Hash,
2744 Ord,
2745 PartialEq,
2746 PartialOrd,
2747 )]
2748 pub enum PublicMomentMood {
2749 #[serde(rename = "bad")]
2750 Bad,
2751 #[serde(rename = "worse")]
2752 Worse,
2753 #[serde(rename = "same")]
2754 Same,
2755 #[serde(rename = "good")]
2756 Good,
2757 #[serde(rename = "great")]
2758 Great,
2759 }
2760
2761 impl ::std::fmt::Display for PublicMomentMood {
2762 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2763 match *self {
2764 Self::Bad => f.write_str("bad"),
2765 Self::Worse => f.write_str("worse"),
2766 Self::Same => f.write_str("same"),
2767 Self::Good => f.write_str("good"),
2768 Self::Great => f.write_str("great"),
2769 }
2770 }
2771 }
2772
2773 impl ::std::str::FromStr for PublicMomentMood {
2774 type Err = self::error::ConversionError;
2775 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2776 match value {
2777 "bad" => Ok(Self::Bad),
2778 "worse" => Ok(Self::Worse),
2779 "same" => Ok(Self::Same),
2780 "good" => Ok(Self::Good),
2781 "great" => Ok(Self::Great),
2782 _ => Err("invalid value".into()),
2783 }
2784 }
2785 }
2786
2787 impl ::std::convert::TryFrom<&str> for PublicMomentMood {
2788 type Error = self::error::ConversionError;
2789 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2790 value.parse()
2791 }
2792 }
2793
2794 impl ::std::convert::TryFrom<&::std::string::String> for PublicMomentMood {
2795 type Error = self::error::ConversionError;
2796 fn try_from(
2797 value: &::std::string::String,
2798 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2799 value.parse()
2800 }
2801 }
2802
2803 impl ::std::convert::TryFrom<::std::string::String> for PublicMomentMood {
2804 type Error = self::error::ConversionError;
2805 fn try_from(
2806 value: ::std::string::String,
2807 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2808 value.parse()
2809 }
2810 }
2811
2812 #[doc = "Possible Moment types."]
2813 #[doc = r""]
2814 #[doc = r" <details><summary>JSON schema</summary>"]
2815 #[doc = r""]
2816 #[doc = r" ```json"]
2817 #[doc = "{"]
2818 #[doc = " \"title\": \"PublicMomentType\","]
2819 #[doc = " \"description\": \"Possible Moment types.\","]
2820 #[doc = " \"type\": \"string\","]
2821 #[doc = " \"enum\": ["]
2822 #[doc = " \"breathing\","]
2823 #[doc = " \"meditation\","]
2824 #[doc = " \"nap\","]
2825 #[doc = " \"relaxation\","]
2826 #[doc = " \"rest\","]
2827 #[doc = " \"body_status\""]
2828 #[doc = " ]"]
2829 #[doc = "}"]
2830 #[doc = r" ```"]
2831 #[doc = r" </details>"]
2832 #[derive(
2833 :: serde :: Deserialize,
2834 :: serde :: Serialize,
2835 Clone,
2836 Copy,
2837 Debug,
2838 Eq,
2839 Hash,
2840 Ord,
2841 PartialEq,
2842 PartialOrd,
2843 )]
2844 pub enum PublicMomentType {
2845 #[serde(rename = "breathing")]
2846 Breathing,
2847 #[serde(rename = "meditation")]
2848 Meditation,
2849 #[serde(rename = "nap")]
2850 Nap,
2851 #[serde(rename = "relaxation")]
2852 Relaxation,
2853 #[serde(rename = "rest")]
2854 Rest,
2855 #[serde(rename = "body_status")]
2856 BodyStatus,
2857 }
2858
2859 impl ::std::fmt::Display for PublicMomentType {
2860 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2861 match *self {
2862 Self::Breathing => f.write_str("breathing"),
2863 Self::Meditation => f.write_str("meditation"),
2864 Self::Nap => f.write_str("nap"),
2865 Self::Relaxation => f.write_str("relaxation"),
2866 Self::Rest => f.write_str("rest"),
2867 Self::BodyStatus => f.write_str("body_status"),
2868 }
2869 }
2870 }
2871
2872 impl ::std::str::FromStr for PublicMomentType {
2873 type Err = self::error::ConversionError;
2874 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2875 match value {
2876 "breathing" => Ok(Self::Breathing),
2877 "meditation" => Ok(Self::Meditation),
2878 "nap" => Ok(Self::Nap),
2879 "relaxation" => Ok(Self::Relaxation),
2880 "rest" => Ok(Self::Rest),
2881 "body_status" => Ok(Self::BodyStatus),
2882 _ => Err("invalid value".into()),
2883 }
2884 }
2885 }
2886
2887 impl ::std::convert::TryFrom<&str> for PublicMomentType {
2888 type Error = self::error::ConversionError;
2889 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2890 value.parse()
2891 }
2892 }
2893
2894 impl ::std::convert::TryFrom<&::std::string::String> for PublicMomentType {
2895 type Error = self::error::ConversionError;
2896 fn try_from(
2897 value: &::std::string::String,
2898 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2899 value.parse()
2900 }
2901 }
2902
2903 impl ::std::convert::TryFrom<::std::string::String> for PublicMomentType {
2904 type Error = self::error::ConversionError;
2905 fn try_from(
2906 value: ::std::string::String,
2907 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2908 value.parse()
2909 }
2910 }
2911
2912 #[doc = "Object defining readiness."]
2913 #[doc = r""]
2914 #[doc = r" <details><summary>JSON schema</summary>"]
2915 #[doc = r""]
2916 #[doc = r" ```json"]
2917 #[doc = "{"]
2918 #[doc = " \"title\": \"PublicReadiness\","]
2919 #[doc = " \"description\": \"Object defining readiness.\","]
2920 #[doc = " \"type\": \"object\","]
2921 #[doc = " \"required\": ["]
2922 #[doc = " \"contributors\""]
2923 #[doc = " ],"]
2924 #[doc = " \"properties\": {"]
2925 #[doc = " \"contributors\": {"]
2926 #[doc = " \"$ref\": \"#/components/schemas/PublicReadinessContributors\""]
2927 #[doc = " },"]
2928 #[doc = " \"score\": {"]
2929 #[doc = " \"title\": \"\","]
2930 #[doc = " \"description\": \"Readiness score in range [1, 100].\","]
2931 #[doc = " \"type\": ["]
2932 #[doc = " \"integer\","]
2933 #[doc = " \"null\""]
2934 #[doc = " ]"]
2935 #[doc = " },"]
2936 #[doc = " \"temperature_deviation\": {"]
2937 #[doc = " \"title\": \"\","]
2938 #[doc = " \"description\": \"Temperature deviation in degrees Celsius.\","]
2939 #[doc = " \"type\": ["]
2940 #[doc = " \"number\","]
2941 #[doc = " \"null\""]
2942 #[doc = " ]"]
2943 #[doc = " },"]
2944 #[doc = " \"temperature_trend_deviation\": {"]
2945 #[doc = " \"title\": \"\","]
2946 #[doc = " \"description\": \"Temperature trend deviation in degrees Celsius.\","]
2947 #[doc = " \"type\": ["]
2948 #[doc = " \"number\","]
2949 #[doc = " \"null\""]
2950 #[doc = " ]"]
2951 #[doc = " }"]
2952 #[doc = " }"]
2953 #[doc = "}"]
2954 #[doc = r" ```"]
2955 #[doc = r" </details>"]
2956 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2957 pub struct PublicReadiness {
2958 pub contributors: PublicReadinessContributors,
2959 #[doc = "Readiness score in range [1, 100]."]
2960 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2961 pub score: ::std::option::Option<i64>,
2962 #[doc = "Temperature deviation in degrees Celsius."]
2963 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2964 pub temperature_deviation: ::std::option::Option<f64>,
2965 #[doc = "Temperature trend deviation in degrees Celsius."]
2966 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2967 pub temperature_trend_deviation: ::std::option::Option<f64>,
2968 }
2969
2970 #[doc = "Object defining readiness score contributors."]
2971 #[doc = r""]
2972 #[doc = r" <details><summary>JSON schema</summary>"]
2973 #[doc = r""]
2974 #[doc = r" ```json"]
2975 #[doc = "{"]
2976 #[doc = " \"title\": \"PublicReadinessContributors\","]
2977 #[doc = " \"description\": \"Object defining readiness score contributors.\","]
2978 #[doc = " \"type\": \"object\","]
2979 #[doc = " \"properties\": {"]
2980 #[doc = " \"activity_balance\": {"]
2981 #[doc = " \"title\": \"\","]
2982 #[doc = " \"description\": \"Contribution of cumulative activity balance in range [1, 100].\","]
2983 #[doc = " \"type\": ["]
2984 #[doc = " \"integer\","]
2985 #[doc = " \"null\""]
2986 #[doc = " ]"]
2987 #[doc = " },"]
2988 #[doc = " \"body_temperature\": {"]
2989 #[doc = " \"title\": \"\","]
2990 #[doc = " \"description\": \"Contribution of body temperature in range [1, 100].\","]
2991 #[doc = " \"type\": ["]
2992 #[doc = " \"integer\","]
2993 #[doc = " \"null\""]
2994 #[doc = " ]"]
2995 #[doc = " },"]
2996 #[doc = " \"hrv_balance\": {"]
2997 #[doc = " \"title\": \"\","]
2998 #[doc = " \"description\": \"Contribution of heart rate variability balance in range [1, 100].\","]
2999 #[doc = " \"type\": ["]
3000 #[doc = " \"integer\","]
3001 #[doc = " \"null\""]
3002 #[doc = " ]"]
3003 #[doc = " },"]
3004 #[doc = " \"previous_day_activity\": {"]
3005 #[doc = " \"title\": \"\","]
3006 #[doc = " \"description\": \"Contribution of previous day's activity in range [1, 100].\","]
3007 #[doc = " \"type\": ["]
3008 #[doc = " \"integer\","]
3009 #[doc = " \"null\""]
3010 #[doc = " ]"]
3011 #[doc = " },"]
3012 #[doc = " \"previous_night\": {"]
3013 #[doc = " \"title\": \"\","]
3014 #[doc = " \"description\": \"Contribution of previous night's sleep in range [1, 100].\","]
3015 #[doc = " \"type\": ["]
3016 #[doc = " \"integer\","]
3017 #[doc = " \"null\""]
3018 #[doc = " ]"]
3019 #[doc = " },"]
3020 #[doc = " \"recovery_index\": {"]
3021 #[doc = " \"title\": \"\","]
3022 #[doc = " \"description\": \"Contribution of recovery index in range [1, 100].\","]
3023 #[doc = " \"type\": ["]
3024 #[doc = " \"integer\","]
3025 #[doc = " \"null\""]
3026 #[doc = " ]"]
3027 #[doc = " },"]
3028 #[doc = " \"resting_heart_rate\": {"]
3029 #[doc = " \"title\": \"\","]
3030 #[doc = " \"description\": \"Contribution of resting heart rate in range [1, 100].\","]
3031 #[doc = " \"type\": ["]
3032 #[doc = " \"integer\","]
3033 #[doc = " \"null\""]
3034 #[doc = " ]"]
3035 #[doc = " },"]
3036 #[doc = " \"sleep_balance\": {"]
3037 #[doc = " \"title\": \"\","]
3038 #[doc = " \"description\": \"Contribution of sleep balance in range [1, 100].\","]
3039 #[doc = " \"type\": ["]
3040 #[doc = " \"integer\","]
3041 #[doc = " \"null\""]
3042 #[doc = " ]"]
3043 #[doc = " },"]
3044 #[doc = " \"sleep_regularity\": {"]
3045 #[doc = " \"title\": \"\","]
3046 #[doc = " \"description\": \"Contribution of sleep regularity in range [1, 100].\","]
3047 #[doc = " \"type\": ["]
3048 #[doc = " \"integer\","]
3049 #[doc = " \"null\""]
3050 #[doc = " ]"]
3051 #[doc = " }"]
3052 #[doc = " }"]
3053 #[doc = "}"]
3054 #[doc = r" ```"]
3055 #[doc = r" </details>"]
3056 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3057 pub struct PublicReadinessContributors {
3058 #[doc = "Contribution of cumulative activity balance in range [1, 100]."]
3059 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3060 pub activity_balance: ::std::option::Option<i64>,
3061 #[doc = "Contribution of body temperature in range [1, 100]."]
3062 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3063 pub body_temperature: ::std::option::Option<i64>,
3064 #[doc = "Contribution of heart rate variability balance in range [1, 100]."]
3065 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3066 pub hrv_balance: ::std::option::Option<i64>,
3067 #[doc = "Contribution of previous day's activity in range [1, 100]."]
3068 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3069 pub previous_day_activity: ::std::option::Option<i64>,
3070 #[doc = "Contribution of previous night's sleep in range [1, 100]."]
3071 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3072 pub previous_night: ::std::option::Option<i64>,
3073 #[doc = "Contribution of recovery index in range [1, 100]."]
3074 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3075 pub recovery_index: ::std::option::Option<i64>,
3076 #[doc = "Contribution of resting heart rate in range [1, 100]."]
3077 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3078 pub resting_heart_rate: ::std::option::Option<i64>,
3079 #[doc = "Contribution of sleep balance in range [1, 100]."]
3080 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3081 pub sleep_balance: ::std::option::Option<i64>,
3082 #[doc = "Contribution of sleep regularity in range [1, 100]."]
3083 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3084 pub sleep_regularity: ::std::option::Option<i64>,
3085 }
3086
3087 impl ::std::default::Default for PublicReadinessContributors {
3088 fn default() -> Self {
3089 Self {
3090 activity_balance: Default::default(),
3091 body_temperature: Default::default(),
3092 hrv_balance: Default::default(),
3093 previous_day_activity: Default::default(),
3094 previous_night: Default::default(),
3095 recovery_index: Default::default(),
3096 resting_heart_rate: Default::default(),
3097 sleep_balance: Default::default(),
3098 sleep_regularity: Default::default(),
3099 }
3100 }
3101 }
3102
3103 #[doc = "Object defining a public Rest Mode episode."]
3104 #[doc = r""]
3105 #[doc = r" <details><summary>JSON schema</summary>"]
3106 #[doc = r""]
3107 #[doc = r" ```json"]
3108 #[doc = "{"]
3109 #[doc = " \"title\": \"PublicRestModeEpisode\","]
3110 #[doc = " \"description\": \"Object defining a public Rest Mode episode.\","]
3111 #[doc = " \"type\": \"object\","]
3112 #[doc = " \"required\": ["]
3113 #[doc = " \"tags\","]
3114 #[doc = " \"timestamp\""]
3115 #[doc = " ],"]
3116 #[doc = " \"properties\": {"]
3117 #[doc = " \"tags\": {"]
3118 #[doc = " \"title\": \"\","]
3119 #[doc = " \"description\": \"Tags selected for the episode.\","]
3120 #[doc = " \"type\": \"array\","]
3121 #[doc = " \"items\": {"]
3122 #[doc = " \"type\": \"string\""]
3123 #[doc = " }"]
3124 #[doc = " },"]
3125 #[doc = " \"timestamp\": {"]
3126 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
3127 #[doc = " }"]
3128 #[doc = " }"]
3129 #[doc = "}"]
3130 #[doc = r" ```"]
3131 #[doc = r" </details>"]
3132 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3133 pub struct PublicRestModeEpisode {
3134 #[doc = "Tags selected for the episode."]
3135 pub tags: ::std::vec::Vec<::std::string::String>,
3136 pub timestamp: LocalizedDateTime,
3137 }
3138
3139 #[doc = "Rest mode episode information."]
3140 #[doc = r""]
3141 #[doc = r" <details><summary>JSON schema</summary>"]
3142 #[doc = r""]
3143 #[doc = r" ```json"]
3144 #[doc = "{"]
3145 #[doc = " \"title\": \"PublicRestModePeriod\","]
3146 #[doc = " \"description\": \"Rest mode episode information.\","]
3147 #[doc = " \"type\": \"object\","]
3148 #[doc = " \"required\": ["]
3149 #[doc = " \"episodes\","]
3150 #[doc = " \"id\","]
3151 #[doc = " \"start_day\""]
3152 #[doc = " ],"]
3153 #[doc = " \"properties\": {"]
3154 #[doc = " \"end_day\": {"]
3155 #[doc = " \"title\": \"\","]
3156 #[doc = " \"description\": \"End date of rest mode.\","]
3157 #[doc = " \"oneOf\": ["]
3158 #[doc = " {"]
3159 #[doc = " \"type\": \"null\""]
3160 #[doc = " },"]
3161 #[doc = " {"]
3162 #[doc = " \"allOf\": ["]
3163 #[doc = " {"]
3164 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
3165 #[doc = " }"]
3166 #[doc = " ]"]
3167 #[doc = " }"]
3168 #[doc = " ]"]
3169 #[doc = " },"]
3170 #[doc = " \"end_time\": {"]
3171 #[doc = " \"title\": \"\","]
3172 #[doc = " \"description\": \"Timestamp when rest mode ended.\","]
3173 #[doc = " \"oneOf\": ["]
3174 #[doc = " {"]
3175 #[doc = " \"type\": \"null\""]
3176 #[doc = " },"]
3177 #[doc = " {"]
3178 #[doc = " \"allOf\": ["]
3179 #[doc = " {"]
3180 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
3181 #[doc = " }"]
3182 #[doc = " ]"]
3183 #[doc = " }"]
3184 #[doc = " ]"]
3185 #[doc = " },"]
3186 #[doc = " \"episodes\": {"]
3187 #[doc = " \"title\": \"\","]
3188 #[doc = " \"description\": \"Collection of episodes during rest mode, consisting of tags.\","]
3189 #[doc = " \"type\": \"array\","]
3190 #[doc = " \"items\": {"]
3191 #[doc = " \"$ref\": \"#/components/schemas/PublicRestModeEpisode\""]
3192 #[doc = " }"]
3193 #[doc = " },"]
3194 #[doc = " \"id\": {"]
3195 #[doc = " \"title\": \"\","]
3196 #[doc = " \"description\": \"Unique identifier of the object.\","]
3197 #[doc = " \"type\": \"string\","]
3198 #[doc = " \"minLength\": 1"]
3199 #[doc = " },"]
3200 #[doc = " \"start_day\": {"]
3201 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
3202 #[doc = " },"]
3203 #[doc = " \"start_time\": {"]
3204 #[doc = " \"title\": \"\","]
3205 #[doc = " \"description\": \"Timestamp when rest mode ended.\","]
3206 #[doc = " \"oneOf\": ["]
3207 #[doc = " {"]
3208 #[doc = " \"type\": \"null\""]
3209 #[doc = " },"]
3210 #[doc = " {"]
3211 #[doc = " \"allOf\": ["]
3212 #[doc = " {"]
3213 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
3214 #[doc = " }"]
3215 #[doc = " ]"]
3216 #[doc = " }"]
3217 #[doc = " ]"]
3218 #[doc = " }"]
3219 #[doc = " },"]
3220 #[doc = " \"x-cloud-only\": true,"]
3221 #[doc = " \"x-collection\": \"publicrestmodeperiod\","]
3222 #[doc = " \"x-owner\": \"sleep-squad\""]
3223 #[doc = "}"]
3224 #[doc = r" ```"]
3225 #[doc = r" </details>"]
3226 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3227 pub struct PublicRestModePeriod {
3228 #[doc = "End date of rest mode."]
3229 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3230 pub end_day: ::std::option::Option<IsoDate>,
3231 #[doc = "Timestamp when rest mode ended."]
3232 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3233 pub end_time: ::std::option::Option<LocalizedDateTime>,
3234 #[doc = "Collection of episodes during rest mode, consisting of tags."]
3235 pub episodes: ::std::vec::Vec<PublicRestModeEpisode>,
3236 #[doc = "Unique identifier of the object."]
3237 pub id: X,
3238 pub start_day: IsoDate,
3239 #[doc = "Timestamp when rest mode ended."]
3240 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3241 pub start_time: ::std::option::Option<LocalizedDateTime>,
3242 }
3243
3244 #[doc = "Object defining a ring battery level event."]
3245 #[doc = r""]
3246 #[doc = r" <details><summary>JSON schema</summary>"]
3247 #[doc = r""]
3248 #[doc = r" ```json"]
3249 #[doc = "{"]
3250 #[doc = " \"title\": \"PublicRingBatteryLevelRow\","]
3251 #[doc = " \"description\": \"Object defining a ring battery level event.\","]
3252 #[doc = " \"type\": \"object\","]
3253 #[doc = " \"required\": ["]
3254 #[doc = " \"level\","]
3255 #[doc = " \"timestamp\","]
3256 #[doc = " \"timestamp_unix\""]
3257 #[doc = " ],"]
3258 #[doc = " \"properties\": {"]
3259 #[doc = " \"charging\": {"]
3260 #[doc = " \"title\": \"\","]
3261 #[doc = " \"description\": \"Flag indicating if the ring was charging.\","]
3262 #[doc = " \"type\": ["]
3263 #[doc = " \"boolean\","]
3264 #[doc = " \"null\""]
3265 #[doc = " ]"]
3266 #[doc = " },"]
3267 #[doc = " \"in_charger\": {"]
3268 #[doc = " \"title\": \"\","]
3269 #[doc = " \"description\": \"Flag indicating if the ring was in charger.\","]
3270 #[doc = " \"type\": ["]
3271 #[doc = " \"boolean\","]
3272 #[doc = " \"null\""]
3273 #[doc = " ]"]
3274 #[doc = " },"]
3275 #[doc = " \"level\": {"]
3276 #[doc = " \"title\": \"\","]
3277 #[doc = " \"description\": \"Ring battery level percentage. These values are within [0, 100].\","]
3278 #[doc = " \"type\": \"integer\""]
3279 #[doc = " },"]
3280 #[doc = " \"timestamp\": {"]
3281 #[doc = " \"$ref\": \"#/components/schemas/UtcDateTime\""]
3282 #[doc = " },"]
3283 #[doc = " \"timestamp_unix\": {"]
3284 #[doc = " \"title\": \"\","]
3285 #[doc = " \"description\": \"Timestamp of the discrete sample as unix time in milliseconds.\","]
3286 #[doc = " \"type\": \"integer\""]
3287 #[doc = " }"]
3288 #[doc = " },"]
3289 #[doc = " \"x-cloud-only\": true,"]
3290 #[doc = " \"x-collection\": \"publicringbatterylevel\","]
3291 #[doc = " \"x-owner\": \"connectivity-squad\""]
3292 #[doc = "}"]
3293 #[doc = r" ```"]
3294 #[doc = r" </details>"]
3295 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3296 pub struct PublicRingBatteryLevelRow {
3297 #[doc = "Flag indicating if the ring was charging."]
3298 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3299 pub charging: ::std::option::Option<bool>,
3300 #[doc = "Flag indicating if the ring was in charger."]
3301 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3302 pub in_charger: ::std::option::Option<bool>,
3303 #[doc = "Ring battery level percentage. These values are within [0, 100]."]
3304 pub level: i64,
3305 pub timestamp: UtcDateTime,
3306 #[doc = "Timestamp of the discrete sample as unix time in milliseconds."]
3307 pub timestamp_unix: i64,
3308 }
3309
3310 #[doc = "Possible ring colors."]
3311 #[doc = r""]
3312 #[doc = r" <details><summary>JSON schema</summary>"]
3313 #[doc = r""]
3314 #[doc = r" ```json"]
3315 #[doc = "{"]
3316 #[doc = " \"title\": \"PublicRingColor\","]
3317 #[doc = " \"description\": \"Possible ring colors.\","]
3318 #[doc = " \"type\": \"string\","]
3319 #[doc = " \"enum\": ["]
3320 #[doc = " \"brushed_silver\","]
3321 #[doc = " \"glossy_black\","]
3322 #[doc = " \"glossy_gold\","]
3323 #[doc = " \"glossy_white\","]
3324 #[doc = " \"gucci\","]
3325 #[doc = " \"matt_gold\","]
3326 #[doc = " \"rose\","]
3327 #[doc = " \"silver\","]
3328 #[doc = " \"stealth_black\","]
3329 #[doc = " \"titanium\","]
3330 #[doc = " \"titanium_and_gold\","]
3331 #[doc = " \"cloud\","]
3332 #[doc = " \"petal\","]
3333 #[doc = " \"midnight\","]
3334 #[doc = " \"tide\","]
3335 #[doc = " \"deep_rose\""]
3336 #[doc = " ]"]
3337 #[doc = "}"]
3338 #[doc = r" ```"]
3339 #[doc = r" </details>"]
3340 #[derive(
3341 :: serde :: Deserialize,
3342 :: serde :: Serialize,
3343 Clone,
3344 Copy,
3345 Debug,
3346 Eq,
3347 Hash,
3348 Ord,
3349 PartialEq,
3350 PartialOrd,
3351 )]
3352 pub enum PublicRingColor {
3353 #[serde(rename = "brushed_silver")]
3354 BrushedSilver,
3355 #[serde(rename = "glossy_black")]
3356 GlossyBlack,
3357 #[serde(rename = "glossy_gold")]
3358 GlossyGold,
3359 #[serde(rename = "glossy_white")]
3360 GlossyWhite,
3361 #[serde(rename = "gucci")]
3362 Gucci,
3363 #[serde(rename = "matt_gold")]
3364 MattGold,
3365 #[serde(rename = "rose")]
3366 Rose,
3367 #[serde(rename = "silver")]
3368 Silver,
3369 #[serde(rename = "stealth_black")]
3370 StealthBlack,
3371 #[serde(rename = "titanium")]
3372 Titanium,
3373 #[serde(rename = "titanium_and_gold")]
3374 TitaniumAndGold,
3375 #[serde(rename = "cloud")]
3376 Cloud,
3377 #[serde(rename = "petal")]
3378 Petal,
3379 #[serde(rename = "midnight")]
3380 Midnight,
3381 #[serde(rename = "tide")]
3382 Tide,
3383 #[serde(rename = "deep_rose")]
3384 DeepRose,
3385 }
3386
3387 impl ::std::fmt::Display for PublicRingColor {
3388 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3389 match *self {
3390 Self::BrushedSilver => f.write_str("brushed_silver"),
3391 Self::GlossyBlack => f.write_str("glossy_black"),
3392 Self::GlossyGold => f.write_str("glossy_gold"),
3393 Self::GlossyWhite => f.write_str("glossy_white"),
3394 Self::Gucci => f.write_str("gucci"),
3395 Self::MattGold => f.write_str("matt_gold"),
3396 Self::Rose => f.write_str("rose"),
3397 Self::Silver => f.write_str("silver"),
3398 Self::StealthBlack => f.write_str("stealth_black"),
3399 Self::Titanium => f.write_str("titanium"),
3400 Self::TitaniumAndGold => f.write_str("titanium_and_gold"),
3401 Self::Cloud => f.write_str("cloud"),
3402 Self::Petal => f.write_str("petal"),
3403 Self::Midnight => f.write_str("midnight"),
3404 Self::Tide => f.write_str("tide"),
3405 Self::DeepRose => f.write_str("deep_rose"),
3406 }
3407 }
3408 }
3409
3410 impl ::std::str::FromStr for PublicRingColor {
3411 type Err = self::error::ConversionError;
3412 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3413 match value {
3414 "brushed_silver" => Ok(Self::BrushedSilver),
3415 "glossy_black" => Ok(Self::GlossyBlack),
3416 "glossy_gold" => Ok(Self::GlossyGold),
3417 "glossy_white" => Ok(Self::GlossyWhite),
3418 "gucci" => Ok(Self::Gucci),
3419 "matt_gold" => Ok(Self::MattGold),
3420 "rose" => Ok(Self::Rose),
3421 "silver" => Ok(Self::Silver),
3422 "stealth_black" => Ok(Self::StealthBlack),
3423 "titanium" => Ok(Self::Titanium),
3424 "titanium_and_gold" => Ok(Self::TitaniumAndGold),
3425 "cloud" => Ok(Self::Cloud),
3426 "petal" => Ok(Self::Petal),
3427 "midnight" => Ok(Self::Midnight),
3428 "tide" => Ok(Self::Tide),
3429 "deep_rose" => Ok(Self::DeepRose),
3430 _ => Err("invalid value".into()),
3431 }
3432 }
3433 }
3434
3435 impl ::std::convert::TryFrom<&str> for PublicRingColor {
3436 type Error = self::error::ConversionError;
3437 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3438 value.parse()
3439 }
3440 }
3441
3442 impl ::std::convert::TryFrom<&::std::string::String> for PublicRingColor {
3443 type Error = self::error::ConversionError;
3444 fn try_from(
3445 value: &::std::string::String,
3446 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3447 value.parse()
3448 }
3449 }
3450
3451 impl ::std::convert::TryFrom<::std::string::String> for PublicRingColor {
3452 type Error = self::error::ConversionError;
3453 fn try_from(
3454 value: ::std::string::String,
3455 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3456 value.parse()
3457 }
3458 }
3459
3460 #[doc = "Ring configuration."]
3461 #[doc = r""]
3462 #[doc = r" <details><summary>JSON schema</summary>"]
3463 #[doc = r""]
3464 #[doc = r" ```json"]
3465 #[doc = "{"]
3466 #[doc = " \"title\": \"PublicRingConfiguration\","]
3467 #[doc = " \"description\": \"Ring configuration.\","]
3468 #[doc = " \"type\": \"object\","]
3469 #[doc = " \"required\": ["]
3470 #[doc = " \"id\""]
3471 #[doc = " ],"]
3472 #[doc = " \"properties\": {"]
3473 #[doc = " \"color\": {"]
3474 #[doc = " \"title\": \"\","]
3475 #[doc = " \"description\": \"Color of the ring.\","]
3476 #[doc = " \"oneOf\": ["]
3477 #[doc = " {"]
3478 #[doc = " \"type\": \"null\""]
3479 #[doc = " },"]
3480 #[doc = " {"]
3481 #[doc = " \"allOf\": ["]
3482 #[doc = " {"]
3483 #[doc = " \"$ref\": \"#/components/schemas/PublicRingColor\""]
3484 #[doc = " }"]
3485 #[doc = " ]"]
3486 #[doc = " }"]
3487 #[doc = " ]"]
3488 #[doc = " },"]
3489 #[doc = " \"design\": {"]
3490 #[doc = " \"title\": \"\","]
3491 #[doc = " \"description\": \"Design of the ring.\","]
3492 #[doc = " \"oneOf\": ["]
3493 #[doc = " {"]
3494 #[doc = " \"type\": \"null\""]
3495 #[doc = " },"]
3496 #[doc = " {"]
3497 #[doc = " \"allOf\": ["]
3498 #[doc = " {"]
3499 #[doc = " \"$ref\": \"#/components/schemas/PublicRingDesign\""]
3500 #[doc = " }"]
3501 #[doc = " ]"]
3502 #[doc = " }"]
3503 #[doc = " ]"]
3504 #[doc = " },"]
3505 #[doc = " \"firmware_version\": {"]
3506 #[doc = " \"title\": \"\","]
3507 #[doc = " \"description\": \"Firmware version of the ring.\","]
3508 #[doc = " \"type\": ["]
3509 #[doc = " \"string\","]
3510 #[doc = " \"null\""]
3511 #[doc = " ]"]
3512 #[doc = " },"]
3513 #[doc = " \"hardware_type\": {"]
3514 #[doc = " \"title\": \"\","]
3515 #[doc = " \"description\": \"Hardware type of the ring.\","]
3516 #[doc = " \"oneOf\": ["]
3517 #[doc = " {"]
3518 #[doc = " \"type\": \"null\""]
3519 #[doc = " },"]
3520 #[doc = " {"]
3521 #[doc = " \"allOf\": ["]
3522 #[doc = " {"]
3523 #[doc = " \"$ref\": \"#/components/schemas/PublicRingHardwareType\""]
3524 #[doc = " }"]
3525 #[doc = " ]"]
3526 #[doc = " }"]
3527 #[doc = " ]"]
3528 #[doc = " },"]
3529 #[doc = " \"id\": {"]
3530 #[doc = " \"title\": \"\","]
3531 #[doc = " \"description\": \"Unique identifier of the object.\","]
3532 #[doc = " \"type\": \"string\","]
3533 #[doc = " \"minLength\": 1"]
3534 #[doc = " },"]
3535 #[doc = " \"set_up_at\": {"]
3536 #[doc = " \"title\": \"\","]
3537 #[doc = " \"description\": \"UTC timestamp indicating when the ring was set up.\","]
3538 #[doc = " \"oneOf\": ["]
3539 #[doc = " {"]
3540 #[doc = " \"type\": \"null\""]
3541 #[doc = " },"]
3542 #[doc = " {"]
3543 #[doc = " \"allOf\": ["]
3544 #[doc = " {"]
3545 #[doc = " \"$ref\": \"#/components/schemas/UtcDateTime\""]
3546 #[doc = " }"]
3547 #[doc = " ]"]
3548 #[doc = " }"]
3549 #[doc = " ]"]
3550 #[doc = " },"]
3551 #[doc = " \"size\": {"]
3552 #[doc = " \"title\": \"\","]
3553 #[doc = " \"description\": \"US size of the ring.\","]
3554 #[doc = " \"type\": ["]
3555 #[doc = " \"integer\","]
3556 #[doc = " \"null\""]
3557 #[doc = " ]"]
3558 #[doc = " }"]
3559 #[doc = " },"]
3560 #[doc = " \"x-cloud-only\": true,"]
3561 #[doc = " \"x-collection\": \"publicringconfiguration\","]
3562 #[doc = " \"x-owner\": \"connectivity-squad\""]
3563 #[doc = "}"]
3564 #[doc = r" ```"]
3565 #[doc = r" </details>"]
3566 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3567 pub struct PublicRingConfiguration {
3568 #[doc = "Color of the ring."]
3569 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3570 pub color: ::std::option::Option<PublicRingColor>,
3571 #[doc = "Design of the ring."]
3572 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3573 pub design: ::std::option::Option<PublicRingDesign>,
3574 #[doc = "Firmware version of the ring."]
3575 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3576 pub firmware_version: ::std::option::Option<::std::string::String>,
3577 #[doc = "Hardware type of the ring."]
3578 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3579 pub hardware_type: ::std::option::Option<PublicRingHardwareType>,
3580 #[doc = "Unique identifier of the object."]
3581 pub id: X,
3582 #[doc = "UTC timestamp indicating when the ring was set up."]
3583 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3584 pub set_up_at: ::std::option::Option<UtcDateTime>,
3585 #[doc = "US size of the ring."]
3586 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3587 pub size: ::std::option::Option<i64>,
3588 }
3589
3590 #[doc = "Possible ring designs."]
3591 #[doc = r""]
3592 #[doc = r" <details><summary>JSON schema</summary>"]
3593 #[doc = r""]
3594 #[doc = r" ```json"]
3595 #[doc = "{"]
3596 #[doc = " \"title\": \"PublicRingDesign\","]
3597 #[doc = " \"description\": \"Possible ring designs.\","]
3598 #[doc = " \"type\": \"string\","]
3599 #[doc = " \"enum\": ["]
3600 #[doc = " \"heritage\","]
3601 #[doc = " \"balance\","]
3602 #[doc = " \"balance_diamond\","]
3603 #[doc = " \"horizon\","]
3604 #[doc = " \"ceramic\""]
3605 #[doc = " ]"]
3606 #[doc = "}"]
3607 #[doc = r" ```"]
3608 #[doc = r" </details>"]
3609 #[derive(
3610 :: serde :: Deserialize,
3611 :: serde :: Serialize,
3612 Clone,
3613 Copy,
3614 Debug,
3615 Eq,
3616 Hash,
3617 Ord,
3618 PartialEq,
3619 PartialOrd,
3620 )]
3621 pub enum PublicRingDesign {
3622 #[serde(rename = "heritage")]
3623 Heritage,
3624 #[serde(rename = "balance")]
3625 Balance,
3626 #[serde(rename = "balance_diamond")]
3627 BalanceDiamond,
3628 #[serde(rename = "horizon")]
3629 Horizon,
3630 #[serde(rename = "ceramic")]
3631 Ceramic,
3632 }
3633
3634 impl ::std::fmt::Display for PublicRingDesign {
3635 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3636 match *self {
3637 Self::Heritage => f.write_str("heritage"),
3638 Self::Balance => f.write_str("balance"),
3639 Self::BalanceDiamond => f.write_str("balance_diamond"),
3640 Self::Horizon => f.write_str("horizon"),
3641 Self::Ceramic => f.write_str("ceramic"),
3642 }
3643 }
3644 }
3645
3646 impl ::std::str::FromStr for PublicRingDesign {
3647 type Err = self::error::ConversionError;
3648 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3649 match value {
3650 "heritage" => Ok(Self::Heritage),
3651 "balance" => Ok(Self::Balance),
3652 "balance_diamond" => Ok(Self::BalanceDiamond),
3653 "horizon" => Ok(Self::Horizon),
3654 "ceramic" => Ok(Self::Ceramic),
3655 _ => Err("invalid value".into()),
3656 }
3657 }
3658 }
3659
3660 impl ::std::convert::TryFrom<&str> for PublicRingDesign {
3661 type Error = self::error::ConversionError;
3662 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3663 value.parse()
3664 }
3665 }
3666
3667 impl ::std::convert::TryFrom<&::std::string::String> for PublicRingDesign {
3668 type Error = self::error::ConversionError;
3669 fn try_from(
3670 value: &::std::string::String,
3671 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3672 value.parse()
3673 }
3674 }
3675
3676 impl ::std::convert::TryFrom<::std::string::String> for PublicRingDesign {
3677 type Error = self::error::ConversionError;
3678 fn try_from(
3679 value: ::std::string::String,
3680 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3681 value.parse()
3682 }
3683 }
3684
3685 #[doc = "Possible ring hardware types."]
3686 #[doc = r""]
3687 #[doc = r" <details><summary>JSON schema</summary>"]
3688 #[doc = r""]
3689 #[doc = r" ```json"]
3690 #[doc = "{"]
3691 #[doc = " \"title\": \"PublicRingHardwareType\","]
3692 #[doc = " \"description\": \"Possible ring hardware types.\","]
3693 #[doc = " \"type\": \"string\","]
3694 #[doc = " \"enum\": ["]
3695 #[doc = " \"gen1\","]
3696 #[doc = " \"gen2\","]
3697 #[doc = " \"gen2m\","]
3698 #[doc = " \"gen3\","]
3699 #[doc = " \"gen4\","]
3700 #[doc = " \"or5\""]
3701 #[doc = " ]"]
3702 #[doc = "}"]
3703 #[doc = r" ```"]
3704 #[doc = r" </details>"]
3705 #[derive(
3706 :: serde :: Deserialize,
3707 :: serde :: Serialize,
3708 Clone,
3709 Copy,
3710 Debug,
3711 Eq,
3712 Hash,
3713 Ord,
3714 PartialEq,
3715 PartialOrd,
3716 )]
3717 pub enum PublicRingHardwareType {
3718 #[serde(rename = "gen1")]
3719 Gen1,
3720 #[serde(rename = "gen2")]
3721 Gen2,
3722 #[serde(rename = "gen2m")]
3723 Gen2m,
3724 #[serde(rename = "gen3")]
3725 Gen3,
3726 #[serde(rename = "gen4")]
3727 Gen4,
3728 #[serde(rename = "or5")]
3729 Or5,
3730 }
3731
3732 impl ::std::fmt::Display for PublicRingHardwareType {
3733 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3734 match *self {
3735 Self::Gen1 => f.write_str("gen1"),
3736 Self::Gen2 => f.write_str("gen2"),
3737 Self::Gen2m => f.write_str("gen2m"),
3738 Self::Gen3 => f.write_str("gen3"),
3739 Self::Gen4 => f.write_str("gen4"),
3740 Self::Or5 => f.write_str("or5"),
3741 }
3742 }
3743 }
3744
3745 impl ::std::str::FromStr for PublicRingHardwareType {
3746 type Err = self::error::ConversionError;
3747 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3748 match value {
3749 "gen1" => Ok(Self::Gen1),
3750 "gen2" => Ok(Self::Gen2),
3751 "gen2m" => Ok(Self::Gen2m),
3752 "gen3" => Ok(Self::Gen3),
3753 "gen4" => Ok(Self::Gen4),
3754 "or5" => Ok(Self::Or5),
3755 _ => Err("invalid value".into()),
3756 }
3757 }
3758 }
3759
3760 impl ::std::convert::TryFrom<&str> for PublicRingHardwareType {
3761 type Error = self::error::ConversionError;
3762 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3763 value.parse()
3764 }
3765 }
3766
3767 impl ::std::convert::TryFrom<&::std::string::String> for PublicRingHardwareType {
3768 type Error = self::error::ConversionError;
3769 fn try_from(
3770 value: &::std::string::String,
3771 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3772 value.parse()
3773 }
3774 }
3775
3776 impl ::std::convert::TryFrom<::std::string::String> for PublicRingHardwareType {
3777 type Error = self::error::ConversionError;
3778 fn try_from(
3779 value: ::std::string::String,
3780 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3781 value.parse()
3782 }
3783 }
3784
3785 #[doc = "Object defining a recorded sample."]
3786 #[doc = r""]
3787 #[doc = r" <details><summary>JSON schema</summary>"]
3788 #[doc = r""]
3789 #[doc = r" ```json"]
3790 #[doc = "{"]
3791 #[doc = " \"title\": \"PublicSample\","]
3792 #[doc = " \"description\": \"Object defining a recorded sample.\","]
3793 #[doc = " \"type\": \"object\","]
3794 #[doc = " \"required\": ["]
3795 #[doc = " \"interval\","]
3796 #[doc = " \"items\","]
3797 #[doc = " \"timestamp\""]
3798 #[doc = " ],"]
3799 #[doc = " \"properties\": {"]
3800 #[doc = " \"interval\": {"]
3801 #[doc = " \"title\": \"\","]
3802 #[doc = " \"description\": \"Interval in seconds between the sampled items.\","]
3803 #[doc = " \"type\": \"number\""]
3804 #[doc = " },"]
3805 #[doc = " \"items\": {"]
3806 #[doc = " \"$ref\": \"#/components/schemas/Array_Union_float__NoneType__Bits64_\""]
3807 #[doc = " },"]
3808 #[doc = " \"timestamp\": {"]
3809 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
3810 #[doc = " }"]
3811 #[doc = " }"]
3812 #[doc = "}"]
3813 #[doc = r" ```"]
3814 #[doc = r" </details>"]
3815 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3816 pub struct PublicSample {
3817 #[doc = "Interval in seconds between the sampled items."]
3818 pub interval: f64,
3819 pub items: ArrayUnionFloatNoneTypeBits64,
3820 pub timestamp: LocalizedDateTime,
3821 }
3822
3823 #[doc = "Public model defining a recorded Session."]
3824 #[doc = r""]
3825 #[doc = r" <details><summary>JSON schema</summary>"]
3826 #[doc = r""]
3827 #[doc = r" ```json"]
3828 #[doc = "{"]
3829 #[doc = " \"title\": \"PublicSession\","]
3830 #[doc = " \"description\": \"Public model defining a recorded Session.\","]
3831 #[doc = " \"type\": \"object\","]
3832 #[doc = " \"required\": ["]
3833 #[doc = " \"day\","]
3834 #[doc = " \"end_datetime\","]
3835 #[doc = " \"id\","]
3836 #[doc = " \"start_datetime\","]
3837 #[doc = " \"type\""]
3838 #[doc = " ],"]
3839 #[doc = " \"properties\": {"]
3840 #[doc = " \"day\": {"]
3841 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
3842 #[doc = " },"]
3843 #[doc = " \"end_datetime\": {"]
3844 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
3845 #[doc = " },"]
3846 #[doc = " \"heart_rate\": {"]
3847 #[doc = " \"title\": \"\","]
3848 #[doc = " \"description\": \"Recorded heart rate samples during the Moment.\","]
3849 #[doc = " \"oneOf\": ["]
3850 #[doc = " {"]
3851 #[doc = " \"type\": \"null\""]
3852 #[doc = " },"]
3853 #[doc = " {"]
3854 #[doc = " \"allOf\": ["]
3855 #[doc = " {"]
3856 #[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
3857 #[doc = " }"]
3858 #[doc = " ]"]
3859 #[doc = " }"]
3860 #[doc = " ]"]
3861 #[doc = " },"]
3862 #[doc = " \"heart_rate_variability\": {"]
3863 #[doc = " \"title\": \"\","]
3864 #[doc = " \"description\": \"Recorded heart rate variability samples during the Moment.\","]
3865 #[doc = " \"oneOf\": ["]
3866 #[doc = " {"]
3867 #[doc = " \"type\": \"null\""]
3868 #[doc = " },"]
3869 #[doc = " {"]
3870 #[doc = " \"allOf\": ["]
3871 #[doc = " {"]
3872 #[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
3873 #[doc = " }"]
3874 #[doc = " ]"]
3875 #[doc = " }"]
3876 #[doc = " ]"]
3877 #[doc = " },"]
3878 #[doc = " \"id\": {"]
3879 #[doc = " \"title\": \"\","]
3880 #[doc = " \"description\": \"Unique identifier of the object.\","]
3881 #[doc = " \"type\": \"string\","]
3882 #[doc = " \"minLength\": 1"]
3883 #[doc = " },"]
3884 #[doc = " \"mood\": {"]
3885 #[doc = " \"title\": \"\","]
3886 #[doc = " \"description\": \"User-selected mood for the Moment.\","]
3887 #[doc = " \"oneOf\": ["]
3888 #[doc = " {"]
3889 #[doc = " \"type\": \"null\""]
3890 #[doc = " },"]
3891 #[doc = " {"]
3892 #[doc = " \"allOf\": ["]
3893 #[doc = " {"]
3894 #[doc = " \"$ref\": \"#/components/schemas/PublicMomentMood\""]
3895 #[doc = " }"]
3896 #[doc = " ]"]
3897 #[doc = " }"]
3898 #[doc = " ]"]
3899 #[doc = " },"]
3900 #[doc = " \"motion_count\": {"]
3901 #[doc = " \"title\": \"\","]
3902 #[doc = " \"description\": \"Recorded motion count samples during the Moment.\","]
3903 #[doc = " \"oneOf\": ["]
3904 #[doc = " {"]
3905 #[doc = " \"type\": \"null\""]
3906 #[doc = " },"]
3907 #[doc = " {"]
3908 #[doc = " \"allOf\": ["]
3909 #[doc = " {"]
3910 #[doc = " \"$ref\": \"#/components/schemas/PublicSample\""]
3911 #[doc = " }"]
3912 #[doc = " ]"]
3913 #[doc = " }"]
3914 #[doc = " ]"]
3915 #[doc = " },"]
3916 #[doc = " \"start_datetime\": {"]
3917 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
3918 #[doc = " },"]
3919 #[doc = " \"type\": {"]
3920 #[doc = " \"$ref\": \"#/components/schemas/PublicMomentType\""]
3921 #[doc = " }"]
3922 #[doc = " },"]
3923 #[doc = " \"x-cloud-only\": true,"]
3924 #[doc = " \"x-collection\": \"publicsession\","]
3925 #[doc = " \"x-owner\": \"wellbeing-squad\""]
3926 #[doc = "}"]
3927 #[doc = r" ```"]
3928 #[doc = r" </details>"]
3929 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3930 pub struct PublicSession {
3931 pub day: IsoDate,
3932 pub end_datetime: LocalizedDateTime,
3933 #[doc = "Recorded heart rate samples during the Moment."]
3934 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3935 pub heart_rate: ::std::option::Option<PublicSample>,
3936 #[doc = "Recorded heart rate variability samples during the Moment."]
3937 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3938 pub heart_rate_variability: ::std::option::Option<PublicSample>,
3939 #[doc = "Unique identifier of the object."]
3940 pub id: X,
3941 #[doc = "User-selected mood for the Moment."]
3942 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3943 pub mood: ::std::option::Option<PublicMomentMood>,
3944 #[doc = "Recorded motion count samples during the Moment."]
3945 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3946 pub motion_count: ::std::option::Option<PublicSample>,
3947 pub start_datetime: LocalizedDateTime,
3948 #[serde(rename = "type")]
3949 pub type_: PublicMomentType,
3950 }
3951
3952 #[doc = "Oura Sleep Staging Algorithms.\nv1 = original aka legacy aka OSSA 1.0,\nv2 = latest sleep algorithm"]
3953 #[doc = r""]
3954 #[doc = r" <details><summary>JSON schema</summary>"]
3955 #[doc = r""]
3956 #[doc = r" ```json"]
3957 #[doc = "{"]
3958 #[doc = " \"title\": \"PublicSleepAlgorithmVersion\","]
3959 #[doc = " \"description\": \"Oura Sleep Staging Algorithms.\\nv1 = original aka legacy aka OSSA 1.0,\\nv2 = latest sleep algorithm\","]
3960 #[doc = " \"type\": \"string\","]
3961 #[doc = " \"enum\": ["]
3962 #[doc = " \"v1\","]
3963 #[doc = " \"v2\""]
3964 #[doc = " ]"]
3965 #[doc = "}"]
3966 #[doc = r" ```"]
3967 #[doc = r" </details>"]
3968 #[derive(
3969 :: serde :: Deserialize,
3970 :: serde :: Serialize,
3971 Clone,
3972 Copy,
3973 Debug,
3974 Eq,
3975 Hash,
3976 Ord,
3977 PartialEq,
3978 PartialOrd,
3979 )]
3980 pub enum PublicSleepAlgorithmVersion {
3981 #[serde(rename = "v1")]
3982 V1,
3983 #[serde(rename = "v2")]
3984 V2,
3985 }
3986
3987 impl ::std::fmt::Display for PublicSleepAlgorithmVersion {
3988 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3989 match *self {
3990 Self::V1 => f.write_str("v1"),
3991 Self::V2 => f.write_str("v2"),
3992 }
3993 }
3994 }
3995
3996 impl ::std::str::FromStr for PublicSleepAlgorithmVersion {
3997 type Err = self::error::ConversionError;
3998 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3999 match value {
4000 "v1" => Ok(Self::V1),
4001 "v2" => Ok(Self::V2),
4002 _ => Err("invalid value".into()),
4003 }
4004 }
4005 }
4006
4007 impl ::std::convert::TryFrom<&str> for PublicSleepAlgorithmVersion {
4008 type Error = self::error::ConversionError;
4009 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4010 value.parse()
4011 }
4012 }
4013
4014 impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepAlgorithmVersion {
4015 type Error = self::error::ConversionError;
4016 fn try_from(
4017 value: &::std::string::String,
4018 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4019 value.parse()
4020 }
4021 }
4022
4023 impl ::std::convert::TryFrom<::std::string::String> for PublicSleepAlgorithmVersion {
4024 type Error = self::error::ConversionError;
4025 fn try_from(
4026 value: ::std::string::String,
4027 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4028 value.parse()
4029 }
4030 }
4031
4032 #[doc = "Possible sleep analysis reasons."]
4033 #[doc = r""]
4034 #[doc = r" <details><summary>JSON schema</summary>"]
4035 #[doc = r""]
4036 #[doc = r" ```json"]
4037 #[doc = "{"]
4038 #[doc = " \"title\": \"PublicSleepAnalysisReason\","]
4039 #[doc = " \"description\": \"Possible sleep analysis reasons.\","]
4040 #[doc = " \"type\": \"string\","]
4041 #[doc = " \"enum\": ["]
4042 #[doc = " \"foreground_sleep_analysis\","]
4043 #[doc = " \"bedtime_edit\","]
4044 #[doc = " \"background_sleep_analysis\","]
4045 #[doc = " \"background_created_foreground_updated\""]
4046 #[doc = " ]"]
4047 #[doc = "}"]
4048 #[doc = r" ```"]
4049 #[doc = r" </details>"]
4050 #[derive(
4051 :: serde :: Deserialize,
4052 :: serde :: Serialize,
4053 Clone,
4054 Copy,
4055 Debug,
4056 Eq,
4057 Hash,
4058 Ord,
4059 PartialEq,
4060 PartialOrd,
4061 )]
4062 pub enum PublicSleepAnalysisReason {
4063 #[serde(rename = "foreground_sleep_analysis")]
4064 ForegroundSleepAnalysis,
4065 #[serde(rename = "bedtime_edit")]
4066 BedtimeEdit,
4067 #[serde(rename = "background_sleep_analysis")]
4068 BackgroundSleepAnalysis,
4069 #[serde(rename = "background_created_foreground_updated")]
4070 BackgroundCreatedForegroundUpdated,
4071 }
4072
4073 impl ::std::fmt::Display for PublicSleepAnalysisReason {
4074 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4075 match *self {
4076 Self::ForegroundSleepAnalysis => f.write_str("foreground_sleep_analysis"),
4077 Self::BedtimeEdit => f.write_str("bedtime_edit"),
4078 Self::BackgroundSleepAnalysis => f.write_str("background_sleep_analysis"),
4079 Self::BackgroundCreatedForegroundUpdated => {
4080 f.write_str("background_created_foreground_updated")
4081 }
4082 }
4083 }
4084 }
4085
4086 impl ::std::str::FromStr for PublicSleepAnalysisReason {
4087 type Err = self::error::ConversionError;
4088 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4089 match value {
4090 "foreground_sleep_analysis" => Ok(Self::ForegroundSleepAnalysis),
4091 "bedtime_edit" => Ok(Self::BedtimeEdit),
4092 "background_sleep_analysis" => Ok(Self::BackgroundSleepAnalysis),
4093 "background_created_foreground_updated" => {
4094 Ok(Self::BackgroundCreatedForegroundUpdated)
4095 }
4096 _ => Err("invalid value".into()),
4097 }
4098 }
4099 }
4100
4101 impl ::std::convert::TryFrom<&str> for PublicSleepAnalysisReason {
4102 type Error = self::error::ConversionError;
4103 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4104 value.parse()
4105 }
4106 }
4107
4108 impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepAnalysisReason {
4109 type Error = self::error::ConversionError;
4110 fn try_from(
4111 value: &::std::string::String,
4112 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4113 value.parse()
4114 }
4115 }
4116
4117 impl ::std::convert::TryFrom<::std::string::String> for PublicSleepAnalysisReason {
4118 type Error = self::error::ConversionError;
4119 fn try_from(
4120 value: ::std::string::String,
4121 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4122 value.parse()
4123 }
4124 }
4125
4126 #[doc = "Object defining sleep score contributors."]
4127 #[doc = r""]
4128 #[doc = r" <details><summary>JSON schema</summary>"]
4129 #[doc = r""]
4130 #[doc = r" ```json"]
4131 #[doc = "{"]
4132 #[doc = " \"title\": \"PublicSleepContributors\","]
4133 #[doc = " \"description\": \"Object defining sleep score contributors.\","]
4134 #[doc = " \"type\": \"object\","]
4135 #[doc = " \"properties\": {"]
4136 #[doc = " \"deep_sleep\": {"]
4137 #[doc = " \"title\": \"\","]
4138 #[doc = " \"description\": \"Contribution of deep sleep in range [1, 100].\","]
4139 #[doc = " \"type\": ["]
4140 #[doc = " \"integer\","]
4141 #[doc = " \"null\""]
4142 #[doc = " ]"]
4143 #[doc = " },"]
4144 #[doc = " \"efficiency\": {"]
4145 #[doc = " \"title\": \"\","]
4146 #[doc = " \"description\": \"Contribution of sleep efficiency in range [1, 100].\","]
4147 #[doc = " \"type\": ["]
4148 #[doc = " \"integer\","]
4149 #[doc = " \"null\""]
4150 #[doc = " ]"]
4151 #[doc = " },"]
4152 #[doc = " \"latency\": {"]
4153 #[doc = " \"title\": \"\","]
4154 #[doc = " \"description\": \"Contribution of sleep latency in range [1, 100].\","]
4155 #[doc = " \"type\": ["]
4156 #[doc = " \"integer\","]
4157 #[doc = " \"null\""]
4158 #[doc = " ]"]
4159 #[doc = " },"]
4160 #[doc = " \"rem_sleep\": {"]
4161 #[doc = " \"title\": \"\","]
4162 #[doc = " \"description\": \"Contribution of REM sleep in range [1, 100].\","]
4163 #[doc = " \"type\": ["]
4164 #[doc = " \"integer\","]
4165 #[doc = " \"null\""]
4166 #[doc = " ]"]
4167 #[doc = " },"]
4168 #[doc = " \"restfulness\": {"]
4169 #[doc = " \"title\": \"\","]
4170 #[doc = " \"description\": \"Contribution of sleep restfulness in range [1, 100].\","]
4171 #[doc = " \"type\": ["]
4172 #[doc = " \"integer\","]
4173 #[doc = " \"null\""]
4174 #[doc = " ]"]
4175 #[doc = " },"]
4176 #[doc = " \"timing\": {"]
4177 #[doc = " \"title\": \"\","]
4178 #[doc = " \"description\": \"Contribution of sleep timing in range [1, 100].\","]
4179 #[doc = " \"type\": ["]
4180 #[doc = " \"integer\","]
4181 #[doc = " \"null\""]
4182 #[doc = " ]"]
4183 #[doc = " },"]
4184 #[doc = " \"total_sleep\": {"]
4185 #[doc = " \"title\": \"\","]
4186 #[doc = " \"description\": \"Contribution of total sleep in range [1, 100].\","]
4187 #[doc = " \"type\": ["]
4188 #[doc = " \"integer\","]
4189 #[doc = " \"null\""]
4190 #[doc = " ]"]
4191 #[doc = " }"]
4192 #[doc = " }"]
4193 #[doc = "}"]
4194 #[doc = r" ```"]
4195 #[doc = r" </details>"]
4196 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4197 pub struct PublicSleepContributors {
4198 #[doc = "Contribution of deep sleep in range [1, 100]."]
4199 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4200 pub deep_sleep: ::std::option::Option<i64>,
4201 #[doc = "Contribution of sleep efficiency in range [1, 100]."]
4202 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4203 pub efficiency: ::std::option::Option<i64>,
4204 #[doc = "Contribution of sleep latency in range [1, 100]."]
4205 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4206 pub latency: ::std::option::Option<i64>,
4207 #[doc = "Contribution of REM sleep in range [1, 100]."]
4208 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4209 pub rem_sleep: ::std::option::Option<i64>,
4210 #[doc = "Contribution of sleep restfulness in range [1, 100]."]
4211 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4212 pub restfulness: ::std::option::Option<i64>,
4213 #[doc = "Contribution of sleep timing in range [1, 100]."]
4214 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4215 pub timing: ::std::option::Option<i64>,
4216 #[doc = "Contribution of total sleep in range [1, 100]."]
4217 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4218 pub total_sleep: ::std::option::Option<i64>,
4219 }
4220
4221 impl ::std::default::Default for PublicSleepContributors {
4222 fn default() -> Self {
4223 Self {
4224 deep_sleep: Default::default(),
4225 efficiency: Default::default(),
4226 latency: Default::default(),
4227 rem_sleep: Default::default(),
4228 restfulness: Default::default(),
4229 timing: Default::default(),
4230 total_sleep: Default::default(),
4231 }
4232 }
4233 }
4234
4235 #[doc = "Suggested bedtime for the user."]
4236 #[doc = r""]
4237 #[doc = r" <details><summary>JSON schema</summary>"]
4238 #[doc = r""]
4239 #[doc = r" ```json"]
4240 #[doc = "{"]
4241 #[doc = " \"title\": \"PublicSleepTime\","]
4242 #[doc = " \"description\": \"Suggested bedtime for the user.\","]
4243 #[doc = " \"type\": \"object\","]
4244 #[doc = " \"required\": ["]
4245 #[doc = " \"day\","]
4246 #[doc = " \"id\""]
4247 #[doc = " ],"]
4248 #[doc = " \"properties\": {"]
4249 #[doc = " \"day\": {"]
4250 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
4251 #[doc = " },"]
4252 #[doc = " \"id\": {"]
4253 #[doc = " \"title\": \"\","]
4254 #[doc = " \"description\": \"Unique identifier of the object.\","]
4255 #[doc = " \"type\": \"string\","]
4256 #[doc = " \"minLength\": 1"]
4257 #[doc = " },"]
4258 #[doc = " \"optimal_bedtime\": {"]
4259 #[doc = " \"title\": \"\","]
4260 #[doc = " \"description\": \"Optimal bedtime.\","]
4261 #[doc = " \"oneOf\": ["]
4262 #[doc = " {"]
4263 #[doc = " \"type\": \"null\""]
4264 #[doc = " },"]
4265 #[doc = " {"]
4266 #[doc = " \"allOf\": ["]
4267 #[doc = " {"]
4268 #[doc = " \"$ref\": \"#/components/schemas/PublicSleepTimeWindow\""]
4269 #[doc = " }"]
4270 #[doc = " ]"]
4271 #[doc = " }"]
4272 #[doc = " ]"]
4273 #[doc = " },"]
4274 #[doc = " \"recommendation\": {"]
4275 #[doc = " \"title\": \"\","]
4276 #[doc = " \"description\": \"Recommended action for bedtime.\","]
4277 #[doc = " \"oneOf\": ["]
4278 #[doc = " {"]
4279 #[doc = " \"type\": \"null\""]
4280 #[doc = " },"]
4281 #[doc = " {"]
4282 #[doc = " \"allOf\": ["]
4283 #[doc = " {"]
4284 #[doc = " \"$ref\": \"#/components/schemas/PublicSleepTimeRecommendation\""]
4285 #[doc = " }"]
4286 #[doc = " ]"]
4287 #[doc = " }"]
4288 #[doc = " ]"]
4289 #[doc = " },"]
4290 #[doc = " \"status\": {"]
4291 #[doc = " \"title\": \"\","]
4292 #[doc = " \"description\": \"Sleep time status; used to inform sleep time recommendation.\","]
4293 #[doc = " \"oneOf\": ["]
4294 #[doc = " {"]
4295 #[doc = " \"type\": \"null\""]
4296 #[doc = " },"]
4297 #[doc = " {"]
4298 #[doc = " \"allOf\": ["]
4299 #[doc = " {"]
4300 #[doc = " \"$ref\": \"#/components/schemas/PublicSleepTimeStatus\""]
4301 #[doc = " }"]
4302 #[doc = " ]"]
4303 #[doc = " }"]
4304 #[doc = " ]"]
4305 #[doc = " }"]
4306 #[doc = " },"]
4307 #[doc = " \"x-cloud-only\": true,"]
4308 #[doc = " \"x-collection\": \"publicsleeptime\","]
4309 #[doc = " \"x-owner\": \"sleep-squad\""]
4310 #[doc = "}"]
4311 #[doc = r" ```"]
4312 #[doc = r" </details>"]
4313 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4314 pub struct PublicSleepTime {
4315 pub day: IsoDate,
4316 #[doc = "Unique identifier of the object."]
4317 pub id: X,
4318 #[doc = "Optimal bedtime."]
4319 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4320 pub optimal_bedtime: ::std::option::Option<PublicSleepTimeWindow>,
4321 #[doc = "Recommended action for bedtime."]
4322 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4323 pub recommendation: ::std::option::Option<PublicSleepTimeRecommendation>,
4324 #[doc = "Sleep time status; used to inform sleep time recommendation."]
4325 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4326 pub status: ::std::option::Option<PublicSleepTimeStatus>,
4327 }
4328
4329 #[doc = "Possible public SleepTime recommendation."]
4330 #[doc = r""]
4331 #[doc = r" <details><summary>JSON schema</summary>"]
4332 #[doc = r""]
4333 #[doc = r" ```json"]
4334 #[doc = "{"]
4335 #[doc = " \"title\": \"PublicSleepTimeRecommendation\","]
4336 #[doc = " \"description\": \"Possible public SleepTime recommendation.\","]
4337 #[doc = " \"type\": \"string\","]
4338 #[doc = " \"enum\": ["]
4339 #[doc = " \"improve_efficiency\","]
4340 #[doc = " \"earlier_bedtime\","]
4341 #[doc = " \"later_bedtime\","]
4342 #[doc = " \"earlier_wake_up_time\","]
4343 #[doc = " \"later_wake_up_time\","]
4344 #[doc = " \"follow_optimal_bedtime\""]
4345 #[doc = " ]"]
4346 #[doc = "}"]
4347 #[doc = r" ```"]
4348 #[doc = r" </details>"]
4349 #[derive(
4350 :: serde :: Deserialize,
4351 :: serde :: Serialize,
4352 Clone,
4353 Copy,
4354 Debug,
4355 Eq,
4356 Hash,
4357 Ord,
4358 PartialEq,
4359 PartialOrd,
4360 )]
4361 pub enum PublicSleepTimeRecommendation {
4362 #[serde(rename = "improve_efficiency")]
4363 ImproveEfficiency,
4364 #[serde(rename = "earlier_bedtime")]
4365 EarlierBedtime,
4366 #[serde(rename = "later_bedtime")]
4367 LaterBedtime,
4368 #[serde(rename = "earlier_wake_up_time")]
4369 EarlierWakeUpTime,
4370 #[serde(rename = "later_wake_up_time")]
4371 LaterWakeUpTime,
4372 #[serde(rename = "follow_optimal_bedtime")]
4373 FollowOptimalBedtime,
4374 }
4375
4376 impl ::std::fmt::Display for PublicSleepTimeRecommendation {
4377 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4378 match *self {
4379 Self::ImproveEfficiency => f.write_str("improve_efficiency"),
4380 Self::EarlierBedtime => f.write_str("earlier_bedtime"),
4381 Self::LaterBedtime => f.write_str("later_bedtime"),
4382 Self::EarlierWakeUpTime => f.write_str("earlier_wake_up_time"),
4383 Self::LaterWakeUpTime => f.write_str("later_wake_up_time"),
4384 Self::FollowOptimalBedtime => f.write_str("follow_optimal_bedtime"),
4385 }
4386 }
4387 }
4388
4389 impl ::std::str::FromStr for PublicSleepTimeRecommendation {
4390 type Err = self::error::ConversionError;
4391 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4392 match value {
4393 "improve_efficiency" => Ok(Self::ImproveEfficiency),
4394 "earlier_bedtime" => Ok(Self::EarlierBedtime),
4395 "later_bedtime" => Ok(Self::LaterBedtime),
4396 "earlier_wake_up_time" => Ok(Self::EarlierWakeUpTime),
4397 "later_wake_up_time" => Ok(Self::LaterWakeUpTime),
4398 "follow_optimal_bedtime" => Ok(Self::FollowOptimalBedtime),
4399 _ => Err("invalid value".into()),
4400 }
4401 }
4402 }
4403
4404 impl ::std::convert::TryFrom<&str> for PublicSleepTimeRecommendation {
4405 type Error = self::error::ConversionError;
4406 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4407 value.parse()
4408 }
4409 }
4410
4411 impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepTimeRecommendation {
4412 type Error = self::error::ConversionError;
4413 fn try_from(
4414 value: &::std::string::String,
4415 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4416 value.parse()
4417 }
4418 }
4419
4420 impl ::std::convert::TryFrom<::std::string::String> for PublicSleepTimeRecommendation {
4421 type Error = self::error::ConversionError;
4422 fn try_from(
4423 value: ::std::string::String,
4424 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4425 value.parse()
4426 }
4427 }
4428
4429 #[doc = "Possible public SleepTime status."]
4430 #[doc = r""]
4431 #[doc = r" <details><summary>JSON schema</summary>"]
4432 #[doc = r""]
4433 #[doc = r" ```json"]
4434 #[doc = "{"]
4435 #[doc = " \"title\": \"PublicSleepTimeStatus\","]
4436 #[doc = " \"description\": \"Possible public SleepTime status.\","]
4437 #[doc = " \"type\": \"string\","]
4438 #[doc = " \"enum\": ["]
4439 #[doc = " \"not_enough_nights\","]
4440 #[doc = " \"not_enough_recent_nights\","]
4441 #[doc = " \"bad_sleep_quality\","]
4442 #[doc = " \"only_recommended_found\","]
4443 #[doc = " \"optimal_found\""]
4444 #[doc = " ]"]
4445 #[doc = "}"]
4446 #[doc = r" ```"]
4447 #[doc = r" </details>"]
4448 #[derive(
4449 :: serde :: Deserialize,
4450 :: serde :: Serialize,
4451 Clone,
4452 Copy,
4453 Debug,
4454 Eq,
4455 Hash,
4456 Ord,
4457 PartialEq,
4458 PartialOrd,
4459 )]
4460 pub enum PublicSleepTimeStatus {
4461 #[serde(rename = "not_enough_nights")]
4462 NotEnoughNights,
4463 #[serde(rename = "not_enough_recent_nights")]
4464 NotEnoughRecentNights,
4465 #[serde(rename = "bad_sleep_quality")]
4466 BadSleepQuality,
4467 #[serde(rename = "only_recommended_found")]
4468 OnlyRecommendedFound,
4469 #[serde(rename = "optimal_found")]
4470 OptimalFound,
4471 }
4472
4473 impl ::std::fmt::Display for PublicSleepTimeStatus {
4474 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4475 match *self {
4476 Self::NotEnoughNights => f.write_str("not_enough_nights"),
4477 Self::NotEnoughRecentNights => f.write_str("not_enough_recent_nights"),
4478 Self::BadSleepQuality => f.write_str("bad_sleep_quality"),
4479 Self::OnlyRecommendedFound => f.write_str("only_recommended_found"),
4480 Self::OptimalFound => f.write_str("optimal_found"),
4481 }
4482 }
4483 }
4484
4485 impl ::std::str::FromStr for PublicSleepTimeStatus {
4486 type Err = self::error::ConversionError;
4487 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4488 match value {
4489 "not_enough_nights" => Ok(Self::NotEnoughNights),
4490 "not_enough_recent_nights" => Ok(Self::NotEnoughRecentNights),
4491 "bad_sleep_quality" => Ok(Self::BadSleepQuality),
4492 "only_recommended_found" => Ok(Self::OnlyRecommendedFound),
4493 "optimal_found" => Ok(Self::OptimalFound),
4494 _ => Err("invalid value".into()),
4495 }
4496 }
4497 }
4498
4499 impl ::std::convert::TryFrom<&str> for PublicSleepTimeStatus {
4500 type Error = self::error::ConversionError;
4501 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4502 value.parse()
4503 }
4504 }
4505
4506 impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepTimeStatus {
4507 type Error = self::error::ConversionError;
4508 fn try_from(
4509 value: &::std::string::String,
4510 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4511 value.parse()
4512 }
4513 }
4514
4515 impl ::std::convert::TryFrom<::std::string::String> for PublicSleepTimeStatus {
4516 type Error = self::error::ConversionError;
4517 fn try_from(
4518 value: ::std::string::String,
4519 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4520 value.parse()
4521 }
4522 }
4523
4524 #[doc = "Object defining sleep time window"]
4525 #[doc = r""]
4526 #[doc = r" <details><summary>JSON schema</summary>"]
4527 #[doc = r""]
4528 #[doc = r" ```json"]
4529 #[doc = "{"]
4530 #[doc = " \"title\": \"PublicSleepTimeWindow\","]
4531 #[doc = " \"description\": \"Object defining sleep time window\","]
4532 #[doc = " \"type\": \"object\","]
4533 #[doc = " \"required\": ["]
4534 #[doc = " \"day_tz\","]
4535 #[doc = " \"end_offset\","]
4536 #[doc = " \"start_offset\""]
4537 #[doc = " ],"]
4538 #[doc = " \"properties\": {"]
4539 #[doc = " \"day_tz\": {"]
4540 #[doc = " \"title\": \"\","]
4541 #[doc = " \"description\": \"Timezone offset in second from GMT of the day\","]
4542 #[doc = " \"type\": \"integer\""]
4543 #[doc = " },"]
4544 #[doc = " \"end_offset\": {"]
4545 #[doc = " \"title\": \"\","]
4546 #[doc = " \"description\": \"End offset from midnight in second\","]
4547 #[doc = " \"type\": \"integer\""]
4548 #[doc = " },"]
4549 #[doc = " \"start_offset\": {"]
4550 #[doc = " \"title\": \"\","]
4551 #[doc = " \"description\": \"Start offset from midnight in second\","]
4552 #[doc = " \"type\": \"integer\""]
4553 #[doc = " }"]
4554 #[doc = " }"]
4555 #[doc = "}"]
4556 #[doc = r" ```"]
4557 #[doc = r" </details>"]
4558 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4559 pub struct PublicSleepTimeWindow {
4560 #[doc = "Timezone offset in second from GMT of the day"]
4561 pub day_tz: i64,
4562 #[doc = "End offset from midnight in second"]
4563 pub end_offset: i64,
4564 #[doc = "Start offset from midnight in second"]
4565 pub start_offset: i64,
4566 }
4567
4568 #[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"]
4569 #[doc = r""]
4570 #[doc = r" <details><summary>JSON schema</summary>"]
4571 #[doc = r""]
4572 #[doc = r" ```json"]
4573 #[doc = "{"]
4574 #[doc = " \"title\": \"PublicSleepType\","]
4575 #[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\","]
4576 #[doc = " \"type\": \"string\","]
4577 #[doc = " \"enum\": ["]
4578 #[doc = " \"deleted\","]
4579 #[doc = " \"sleep\","]
4580 #[doc = " \"long_sleep\","]
4581 #[doc = " \"late_nap\","]
4582 #[doc = " \"rest\""]
4583 #[doc = " ]"]
4584 #[doc = "}"]
4585 #[doc = r" ```"]
4586 #[doc = r" </details>"]
4587 #[derive(
4588 :: serde :: Deserialize,
4589 :: serde :: Serialize,
4590 Clone,
4591 Copy,
4592 Debug,
4593 Eq,
4594 Hash,
4595 Ord,
4596 PartialEq,
4597 PartialOrd,
4598 )]
4599 pub enum PublicSleepType {
4600 #[serde(rename = "deleted")]
4601 Deleted,
4602 #[serde(rename = "sleep")]
4603 Sleep,
4604 #[serde(rename = "long_sleep")]
4605 LongSleep,
4606 #[serde(rename = "late_nap")]
4607 LateNap,
4608 #[serde(rename = "rest")]
4609 Rest,
4610 }
4611
4612 impl ::std::fmt::Display for PublicSleepType {
4613 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4614 match *self {
4615 Self::Deleted => f.write_str("deleted"),
4616 Self::Sleep => f.write_str("sleep"),
4617 Self::LongSleep => f.write_str("long_sleep"),
4618 Self::LateNap => f.write_str("late_nap"),
4619 Self::Rest => f.write_str("rest"),
4620 }
4621 }
4622 }
4623
4624 impl ::std::str::FromStr for PublicSleepType {
4625 type Err = self::error::ConversionError;
4626 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4627 match value {
4628 "deleted" => Ok(Self::Deleted),
4629 "sleep" => Ok(Self::Sleep),
4630 "long_sleep" => Ok(Self::LongSleep),
4631 "late_nap" => Ok(Self::LateNap),
4632 "rest" => Ok(Self::Rest),
4633 _ => Err("invalid value".into()),
4634 }
4635 }
4636 }
4637
4638 impl ::std::convert::TryFrom<&str> for PublicSleepType {
4639 type Error = self::error::ConversionError;
4640 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4641 value.parse()
4642 }
4643 }
4644
4645 impl ::std::convert::TryFrom<&::std::string::String> for PublicSleepType {
4646 type Error = self::error::ConversionError;
4647 fn try_from(
4648 value: &::std::string::String,
4649 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4650 value.parse()
4651 }
4652 }
4653
4654 impl ::std::convert::TryFrom<::std::string::String> for PublicSleepType {
4655 type Error = self::error::ConversionError;
4656 fn try_from(
4657 value: ::std::string::String,
4658 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4659 value.parse()
4660 }
4661 }
4662
4663 #[doc = "Object defining public spo2 aggregated values."]
4664 #[doc = r""]
4665 #[doc = r" <details><summary>JSON schema</summary>"]
4666 #[doc = r""]
4667 #[doc = r" ```json"]
4668 #[doc = "{"]
4669 #[doc = " \"title\": \"PublicSpo2AggregatedValues\","]
4670 #[doc = " \"description\": \"Object defining public spo2 aggregated values.\","]
4671 #[doc = " \"type\": \"object\","]
4672 #[doc = " \"required\": ["]
4673 #[doc = " \"average\""]
4674 #[doc = " ],"]
4675 #[doc = " \"properties\": {"]
4676 #[doc = " \"average\": {"]
4677 #[doc = " \"title\": \"\","]
4678 #[doc = " \"description\": \"Average of spo2.\","]
4679 #[doc = " \"type\": \"number\""]
4680 #[doc = " }"]
4681 #[doc = " }"]
4682 #[doc = "}"]
4683 #[doc = r" ```"]
4684 #[doc = r" </details>"]
4685 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4686 pub struct PublicSpo2AggregatedValues {
4687 #[doc = "Average of spo2."]
4688 pub average: f64,
4689 }
4690
4691 #[doc = "VO2Max estimate."]
4692 #[doc = r""]
4693 #[doc = r" <details><summary>JSON schema</summary>"]
4694 #[doc = r""]
4695 #[doc = r" ```json"]
4696 #[doc = "{"]
4697 #[doc = " \"title\": \"PublicVO2Max\","]
4698 #[doc = " \"description\": \"VO2Max estimate.\","]
4699 #[doc = " \"type\": \"object\","]
4700 #[doc = " \"required\": ["]
4701 #[doc = " \"day\","]
4702 #[doc = " \"id\","]
4703 #[doc = " \"timestamp\","]
4704 #[doc = " \"vo2_max\""]
4705 #[doc = " ],"]
4706 #[doc = " \"properties\": {"]
4707 #[doc = " \"day\": {"]
4708 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
4709 #[doc = " },"]
4710 #[doc = " \"id\": {"]
4711 #[doc = " \"title\": \"\","]
4712 #[doc = " \"description\": \"Unique identifier of the object.\","]
4713 #[doc = " \"type\": \"string\","]
4714 #[doc = " \"minLength\": 1"]
4715 #[doc = " },"]
4716 #[doc = " \"timestamp\": {"]
4717 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
4718 #[doc = " },"]
4719 #[doc = " \"vo2_max\": {"]
4720 #[doc = " \"title\": \"\","]
4721 #[doc = " \"description\": \"VO2 max value.\","]
4722 #[doc = " \"type\": \"integer\""]
4723 #[doc = " }"]
4724 #[doc = " },"]
4725 #[doc = " \"x-cloud-only\": true,"]
4726 #[doc = " \"x-collection\": \"publicvo2max\","]
4727 #[doc = " \"x-owner\": \"movement-squad\""]
4728 #[doc = "}"]
4729 #[doc = r" ```"]
4730 #[doc = r" </details>"]
4731 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4732 pub struct PublicVo2Max {
4733 pub day: IsoDate,
4734 #[doc = "Unique identifier of the object."]
4735 pub id: X,
4736 pub timestamp: LocalizedDateTime,
4737 #[doc = "VO2 max value."]
4738 pub vo2_max: i64,
4739 }
4740
4741 #[doc = "Public model for Workout."]
4742 #[doc = r""]
4743 #[doc = r" <details><summary>JSON schema</summary>"]
4744 #[doc = r""]
4745 #[doc = r" ```json"]
4746 #[doc = "{"]
4747 #[doc = " \"title\": \"PublicWorkout\","]
4748 #[doc = " \"description\": \"Public model for Workout.\","]
4749 #[doc = " \"type\": \"object\","]
4750 #[doc = " \"required\": ["]
4751 #[doc = " \"activity\","]
4752 #[doc = " \"day\","]
4753 #[doc = " \"end_datetime\","]
4754 #[doc = " \"id\","]
4755 #[doc = " \"intensity\","]
4756 #[doc = " \"source\","]
4757 #[doc = " \"start_datetime\""]
4758 #[doc = " ],"]
4759 #[doc = " \"properties\": {"]
4760 #[doc = " \"activity\": {"]
4761 #[doc = " \"title\": \"\","]
4762 #[doc = " \"description\": \"Type of the workout activity.\","]
4763 #[doc = " \"type\": \"string\""]
4764 #[doc = " },"]
4765 #[doc = " \"calories\": {"]
4766 #[doc = " \"title\": \"\","]
4767 #[doc = " \"description\": \"Energy burned in kilocalories during the workout.\","]
4768 #[doc = " \"type\": ["]
4769 #[doc = " \"number\","]
4770 #[doc = " \"null\""]
4771 #[doc = " ]"]
4772 #[doc = " },"]
4773 #[doc = " \"day\": {"]
4774 #[doc = " \"$ref\": \"#/components/schemas/ISODate\""]
4775 #[doc = " },"]
4776 #[doc = " \"distance\": {"]
4777 #[doc = " \"title\": \"\","]
4778 #[doc = " \"description\": \"Distance traveled in meters during the workout.\","]
4779 #[doc = " \"type\": ["]
4780 #[doc = " \"number\","]
4781 #[doc = " \"null\""]
4782 #[doc = " ]"]
4783 #[doc = " },"]
4784 #[doc = " \"end_datetime\": {"]
4785 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
4786 #[doc = " },"]
4787 #[doc = " \"id\": {"]
4788 #[doc = " \"title\": \"\","]
4789 #[doc = " \"description\": \"Unique identifier of the object.\","]
4790 #[doc = " \"type\": \"string\","]
4791 #[doc = " \"minLength\": 1"]
4792 #[doc = " },"]
4793 #[doc = " \"intensity\": {"]
4794 #[doc = " \"$ref\": \"#/components/schemas/PublicWorkoutIntensity\""]
4795 #[doc = " },"]
4796 #[doc = " \"label\": {"]
4797 #[doc = " \"title\": \"\","]
4798 #[doc = " \"description\": \"User-defined label for the workout.\","]
4799 #[doc = " \"type\": ["]
4800 #[doc = " \"string\","]
4801 #[doc = " \"null\""]
4802 #[doc = " ]"]
4803 #[doc = " },"]
4804 #[doc = " \"source\": {"]
4805 #[doc = " \"$ref\": \"#/components/schemas/PublicWorkoutSource\""]
4806 #[doc = " },"]
4807 #[doc = " \"start_datetime\": {"]
4808 #[doc = " \"$ref\": \"#/components/schemas/LocalizedDateTime\""]
4809 #[doc = " }"]
4810 #[doc = " },"]
4811 #[doc = " \"x-cloud-only\": true,"]
4812 #[doc = " \"x-collection\": \"publicworkout\","]
4813 #[doc = " \"x-owner\": \"movement-squad\""]
4814 #[doc = "}"]
4815 #[doc = r" ```"]
4816 #[doc = r" </details>"]
4817 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4818 pub struct PublicWorkout {
4819 #[doc = "Type of the workout activity."]
4820 pub activity: ::std::string::String,
4821 #[doc = "Energy burned in kilocalories during the workout."]
4822 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4823 pub calories: ::std::option::Option<f64>,
4824 pub day: IsoDate,
4825 #[doc = "Distance traveled in meters during the workout."]
4826 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4827 pub distance: ::std::option::Option<f64>,
4828 pub end_datetime: LocalizedDateTime,
4829 #[doc = "Unique identifier of the object."]
4830 pub id: X,
4831 pub intensity: PublicWorkoutIntensity,
4832 #[doc = "User-defined label for the workout."]
4833 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4834 pub label: ::std::option::Option<::std::string::String>,
4835 pub source: PublicWorkoutSource,
4836 pub start_datetime: LocalizedDateTime,
4837 }
4838
4839 #[doc = "Possible workout intensities."]
4840 #[doc = r""]
4841 #[doc = r" <details><summary>JSON schema</summary>"]
4842 #[doc = r""]
4843 #[doc = r" ```json"]
4844 #[doc = "{"]
4845 #[doc = " \"title\": \"PublicWorkoutIntensity\","]
4846 #[doc = " \"description\": \"Possible workout intensities.\","]
4847 #[doc = " \"type\": \"string\","]
4848 #[doc = " \"enum\": ["]
4849 #[doc = " \"easy\","]
4850 #[doc = " \"moderate\","]
4851 #[doc = " \"hard\""]
4852 #[doc = " ]"]
4853 #[doc = "}"]
4854 #[doc = r" ```"]
4855 #[doc = r" </details>"]
4856 #[derive(
4857 :: serde :: Deserialize,
4858 :: serde :: Serialize,
4859 Clone,
4860 Copy,
4861 Debug,
4862 Eq,
4863 Hash,
4864 Ord,
4865 PartialEq,
4866 PartialOrd,
4867 )]
4868 pub enum PublicWorkoutIntensity {
4869 #[serde(rename = "easy")]
4870 Easy,
4871 #[serde(rename = "moderate")]
4872 Moderate,
4873 #[serde(rename = "hard")]
4874 Hard,
4875 }
4876
4877 impl ::std::fmt::Display for PublicWorkoutIntensity {
4878 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4879 match *self {
4880 Self::Easy => f.write_str("easy"),
4881 Self::Moderate => f.write_str("moderate"),
4882 Self::Hard => f.write_str("hard"),
4883 }
4884 }
4885 }
4886
4887 impl ::std::str::FromStr for PublicWorkoutIntensity {
4888 type Err = self::error::ConversionError;
4889 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4890 match value {
4891 "easy" => Ok(Self::Easy),
4892 "moderate" => Ok(Self::Moderate),
4893 "hard" => Ok(Self::Hard),
4894 _ => Err("invalid value".into()),
4895 }
4896 }
4897 }
4898
4899 impl ::std::convert::TryFrom<&str> for PublicWorkoutIntensity {
4900 type Error = self::error::ConversionError;
4901 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4902 value.parse()
4903 }
4904 }
4905
4906 impl ::std::convert::TryFrom<&::std::string::String> for PublicWorkoutIntensity {
4907 type Error = self::error::ConversionError;
4908 fn try_from(
4909 value: &::std::string::String,
4910 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4911 value.parse()
4912 }
4913 }
4914
4915 impl ::std::convert::TryFrom<::std::string::String> for PublicWorkoutIntensity {
4916 type Error = self::error::ConversionError;
4917 fn try_from(
4918 value: ::std::string::String,
4919 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4920 value.parse()
4921 }
4922 }
4923
4924 #[doc = "Possible workout sources."]
4925 #[doc = r""]
4926 #[doc = r" <details><summary>JSON schema</summary>"]
4927 #[doc = r""]
4928 #[doc = r" ```json"]
4929 #[doc = "{"]
4930 #[doc = " \"title\": \"PublicWorkoutSource\","]
4931 #[doc = " \"description\": \"Possible workout sources.\","]
4932 #[doc = " \"type\": \"string\","]
4933 #[doc = " \"enum\": ["]
4934 #[doc = " \"manual\","]
4935 #[doc = " \"autodetected\","]
4936 #[doc = " \"confirmed\","]
4937 #[doc = " \"workout_heart_rate\""]
4938 #[doc = " ]"]
4939 #[doc = "}"]
4940 #[doc = r" ```"]
4941 #[doc = r" </details>"]
4942 #[derive(
4943 :: serde :: Deserialize,
4944 :: serde :: Serialize,
4945 Clone,
4946 Copy,
4947 Debug,
4948 Eq,
4949 Hash,
4950 Ord,
4951 PartialEq,
4952 PartialOrd,
4953 )]
4954 pub enum PublicWorkoutSource {
4955 #[serde(rename = "manual")]
4956 Manual,
4957 #[serde(rename = "autodetected")]
4958 Autodetected,
4959 #[serde(rename = "confirmed")]
4960 Confirmed,
4961 #[serde(rename = "workout_heart_rate")]
4962 WorkoutHeartRate,
4963 }
4964
4965 impl ::std::fmt::Display for PublicWorkoutSource {
4966 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4967 match *self {
4968 Self::Manual => f.write_str("manual"),
4969 Self::Autodetected => f.write_str("autodetected"),
4970 Self::Confirmed => f.write_str("confirmed"),
4971 Self::WorkoutHeartRate => f.write_str("workout_heart_rate"),
4972 }
4973 }
4974 }
4975
4976 impl ::std::str::FromStr for PublicWorkoutSource {
4977 type Err = self::error::ConversionError;
4978 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4979 match value {
4980 "manual" => Ok(Self::Manual),
4981 "autodetected" => Ok(Self::Autodetected),
4982 "confirmed" => Ok(Self::Confirmed),
4983 "workout_heart_rate" => Ok(Self::WorkoutHeartRate),
4984 _ => Err("invalid value".into()),
4985 }
4986 }
4987 }
4988
4989 impl ::std::convert::TryFrom<&str> for PublicWorkoutSource {
4990 type Error = self::error::ConversionError;
4991 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4992 value.parse()
4993 }
4994 }
4995
4996 impl ::std::convert::TryFrom<&::std::string::String> for PublicWorkoutSource {
4997 type Error = self::error::ConversionError;
4998 fn try_from(
4999 value: &::std::string::String,
5000 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5001 value.parse()
5002 }
5003 }
5004
5005 impl ::std::convert::TryFrom<::std::string::String> for PublicWorkoutSource {
5006 type Error = self::error::ConversionError;
5007 fn try_from(
5008 value: ::std::string::String,
5009 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5010 value.parse()
5011 }
5012 }
5013
5014 #[doc = "`ResilienceContributors`"]
5015 #[doc = r""]
5016 #[doc = r" <details><summary>JSON schema</summary>"]
5017 #[doc = r""]
5018 #[doc = r" ```json"]
5019 #[doc = "{"]
5020 #[doc = " \"title\": \"ResilienceContributors\","]
5021 #[doc = " \"type\": \"object\","]
5022 #[doc = " \"required\": ["]
5023 #[doc = " \"daytime_recovery\","]
5024 #[doc = " \"sleep_recovery\","]
5025 #[doc = " \"stress\""]
5026 #[doc = " ],"]
5027 #[doc = " \"properties\": {"]
5028 #[doc = " \"daytime_recovery\": {"]
5029 #[doc = " \"title\": \"Daytime Recovery\","]
5030 #[doc = " \"description\": \"Daytime recovery contributor to the resilience score. Range: [0, 100]\","]
5031 #[doc = " \"type\": \"number\""]
5032 #[doc = " },"]
5033 #[doc = " \"sleep_recovery\": {"]
5034 #[doc = " \"title\": \"Sleep Recovery\","]
5035 #[doc = " \"description\": \"Sleep recovery contributor to the resilience score. Range: [0, 100]\","]
5036 #[doc = " \"type\": \"number\""]
5037 #[doc = " },"]
5038 #[doc = " \"stress\": {"]
5039 #[doc = " \"title\": \"Stress\","]
5040 #[doc = " \"description\": \"Stress contributor to the resilience score. Range: [0, 100]\","]
5041 #[doc = " \"type\": \"number\""]
5042 #[doc = " }"]
5043 #[doc = " }"]
5044 #[doc = "}"]
5045 #[doc = r" ```"]
5046 #[doc = r" </details>"]
5047 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5048 pub struct ResilienceContributors {
5049 #[doc = "Daytime recovery contributor to the resilience score. Range: [0, 100]"]
5050 pub daytime_recovery: f64,
5051 #[doc = "Sleep recovery contributor to the resilience score. Range: [0, 100]"]
5052 pub sleep_recovery: f64,
5053 #[doc = "Stress contributor to the resilience score. Range: [0, 100]"]
5054 pub stress: f64,
5055 }
5056
5057 #[doc = "`ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet`"]
5058 #[doc = r""]
5059 #[doc = r" <details><summary>JSON schema</summary>"]
5060 #[doc = r""]
5061 #[doc = r" ```json"]
5062 #[doc = "{"]
5063 #[doc = " \"title\": \"Response Multiple Heartrate Documents V2 Usercollection Heartrate Get\","]
5064 #[doc = " \"anyOf\": ["]
5065 #[doc = " {"]
5066 #[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponse_PublicHeartRateRow_\""]
5067 #[doc = " },"]
5068 #[doc = " {"]
5069 #[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponseDict\""]
5070 #[doc = " }"]
5071 #[doc = " ]"]
5072 #[doc = "}"]
5073 #[doc = r" ```"]
5074 #[doc = r" </details>"]
5075 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5076 pub struct ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet {
5077 #[serde(
5078 flatten,
5079 default,
5080 skip_serializing_if = "::std::option::Option::is_none"
5081 )]
5082 pub subtype_0: ::std::option::Option<TimeSeriesResponsePublicHeartRateRow>,
5083 #[serde(
5084 flatten,
5085 default,
5086 skip_serializing_if = "::std::option::Option::is_none"
5087 )]
5088 pub subtype_1: ::std::option::Option<TimeSeriesResponseDict>,
5089 }
5090
5091 impl ::std::default::Default for ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet {
5092 fn default() -> Self {
5093 Self {
5094 subtype_0: Default::default(),
5095 subtype_1: Default::default(),
5096 }
5097 }
5098 }
5099
5100 #[doc = "`ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet`"]
5101 #[doc = r""]
5102 #[doc = r" <details><summary>JSON schema</summary>"]
5103 #[doc = r""]
5104 #[doc = r" ```json"]
5105 #[doc = "{"]
5106 #[doc = " \"title\": \"Response Multiple Ring Battery Level Documents V2 Usercollection Ring Battery Level Get\","]
5107 #[doc = " \"anyOf\": ["]
5108 #[doc = " {"]
5109 #[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponse_PublicRingBatteryLevelRow_\""]
5110 #[doc = " },"]
5111 #[doc = " {"]
5112 #[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponseDict\""]
5113 #[doc = " }"]
5114 #[doc = " ]"]
5115 #[doc = "}"]
5116 #[doc = r" ```"]
5117 #[doc = r" </details>"]
5118 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5119 pub struct ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet {
5120 #[serde(
5121 flatten,
5122 default,
5123 skip_serializing_if = "::std::option::Option::is_none"
5124 )]
5125 pub subtype_0: ::std::option::Option<TimeSeriesResponsePublicRingBatteryLevelRow>,
5126 #[serde(
5127 flatten,
5128 default,
5129 skip_serializing_if = "::std::option::Option::is_none"
5130 )]
5131 pub subtype_1: ::std::option::Option<TimeSeriesResponseDict>,
5132 }
5133
5134 impl ::std::default::Default
5135 for ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet
5136 {
5137 fn default() -> Self {
5138 Self {
5139 subtype_0: Default::default(),
5140 subtype_1: Default::default(),
5141 }
5142 }
5143 }
5144
5145 #[doc = "`ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet`"]
5146 #[doc = r""]
5147 #[doc = r" <details><summary>JSON schema</summary>"]
5148 #[doc = r""]
5149 #[doc = r" ```json"]
5150 #[doc = "{"]
5151 #[doc = " \"title\": \"Response Sandbox Multiple Heartrate Documents V2 Sandbox Usercollection Heartrate Get\","]
5152 #[doc = " \"anyOf\": ["]
5153 #[doc = " {"]
5154 #[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponse_PublicHeartRateRow_\""]
5155 #[doc = " },"]
5156 #[doc = " {"]
5157 #[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponseDict\""]
5158 #[doc = " }"]
5159 #[doc = " ]"]
5160 #[doc = "}"]
5161 #[doc = r" ```"]
5162 #[doc = r" </details>"]
5163 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5164 pub struct ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet {
5165 #[serde(
5166 flatten,
5167 default,
5168 skip_serializing_if = "::std::option::Option::is_none"
5169 )]
5170 pub subtype_0: ::std::option::Option<TimeSeriesResponsePublicHeartRateRow>,
5171 #[serde(
5172 flatten,
5173 default,
5174 skip_serializing_if = "::std::option::Option::is_none"
5175 )]
5176 pub subtype_1: ::std::option::Option<TimeSeriesResponseDict>,
5177 }
5178
5179 impl ::std::default::Default
5180 for ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet
5181 {
5182 fn default() -> Self {
5183 Self {
5184 subtype_0: Default::default(),
5185 subtype_1: Default::default(),
5186 }
5187 }
5188 }
5189
5190 #[doc = "`ResponseSandboxMultipleRingBatteryLevelDocumentsV2SandboxUsercollectionRingBatteryLevelGet`"]
5191 #[doc = r""]
5192 #[doc = r" <details><summary>JSON schema</summary>"]
5193 #[doc = r""]
5194 #[doc = r" ```json"]
5195 #[doc = "{"]
5196 #[doc = " \"title\": \"Response Sandbox Multiple Ring Battery Level Documents V2 Sandbox Usercollection Ring Battery Level Get\","]
5197 #[doc = " \"anyOf\": ["]
5198 #[doc = " {"]
5199 #[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponse_PublicRingBatteryLevelRow_\""]
5200 #[doc = " },"]
5201 #[doc = " {"]
5202 #[doc = " \"$ref\": \"#/components/schemas/TimeSeriesResponseDict\""]
5203 #[doc = " }"]
5204 #[doc = " ]"]
5205 #[doc = "}"]
5206 #[doc = r" ```"]
5207 #[doc = r" </details>"]
5208 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5209 pub struct ResponseSandboxMultipleRingBatteryLevelDocumentsV2SandboxUsercollectionRingBatteryLevelGet
5210 {
5211 #[serde(
5212 flatten,
5213 default,
5214 skip_serializing_if = "::std::option::Option::is_none"
5215 )]
5216 pub subtype_0: ::std::option::Option<TimeSeriesResponsePublicRingBatteryLevelRow>,
5217 #[serde(
5218 flatten,
5219 default,
5220 skip_serializing_if = "::std::option::Option::is_none"
5221 )]
5222 pub subtype_1: ::std::option::Option<TimeSeriesResponseDict>,
5223 }
5224
5225 impl :: std :: default :: Default for ResponseSandboxMultipleRingBatteryLevelDocumentsV2SandboxUsercollectionRingBatteryLevelGet { fn default () -> Self { Self { subtype_0 : Default :: default () , subtype_1 : Default :: default () , } } }
5226 #[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"]
5227 #[doc = r""]
5228 #[doc = r" <details><summary>JSON schema</summary>"]
5229 #[doc = r""]
5230 #[doc = r" ```json"]
5231 #[doc = "{"]
5232 #[doc = " \"title\": \"TagModel\","]
5233 #[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\","]
5234 #[doc = " \"type\": \"object\","]
5235 #[doc = " \"required\": ["]
5236 #[doc = " \"day\","]
5237 #[doc = " \"id\","]
5238 #[doc = " \"tags\","]
5239 #[doc = " \"text\","]
5240 #[doc = " \"timestamp\""]
5241 #[doc = " ],"]
5242 #[doc = " \"properties\": {"]
5243 #[doc = " \"day\": {"]
5244 #[doc = " \"title\": \"Day\","]
5245 #[doc = " \"description\": \"Day that the note belongs to.\","]
5246 #[doc = " \"type\": \"string\","]
5247 #[doc = " \"format\": \"date\""]
5248 #[doc = " },"]
5249 #[doc = " \"id\": {"]
5250 #[doc = " \"title\": \"Id\","]
5251 #[doc = " \"type\": \"string\""]
5252 #[doc = " },"]
5253 #[doc = " \"tags\": {"]
5254 #[doc = " \"title\": \"Tags\","]
5255 #[doc = " \"description\": \"Selected tags for the tag.\","]
5256 #[doc = " \"type\": \"array\","]
5257 #[doc = " \"items\": {"]
5258 #[doc = " \"type\": \"string\""]
5259 #[doc = " }"]
5260 #[doc = " },"]
5261 #[doc = " \"text\": {"]
5262 #[doc = " \"title\": \"Text\","]
5263 #[doc = " \"description\": \"Textual contents of the note.\","]
5264 #[doc = " \"type\": ["]
5265 #[doc = " \"string\","]
5266 #[doc = " \"null\""]
5267 #[doc = " ]"]
5268 #[doc = " },"]
5269 #[doc = " \"timestamp\": {"]
5270 #[doc = " \"$ref\": \"#/components/schemas/LocalDateTime\""]
5271 #[doc = " }"]
5272 #[doc = " }"]
5273 #[doc = "}"]
5274 #[doc = r" ```"]
5275 #[doc = r" </details>"]
5276 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5277 pub struct TagModel {
5278 #[doc = "Day that the note belongs to."]
5279 pub day: ::chrono::naive::NaiveDate,
5280 pub id: ::std::string::String,
5281 #[doc = "Selected tags for the tag."]
5282 pub tags: ::std::vec::Vec<::std::string::String>,
5283 #[doc = "Textual contents of the note."]
5284 pub text: ::std::option::Option<::std::string::String>,
5285 pub timestamp: LocalDateTime,
5286 }
5287
5288 #[doc = "`TimeSeriesResponseDict`"]
5289 #[doc = r""]
5290 #[doc = r" <details><summary>JSON schema</summary>"]
5291 #[doc = r""]
5292 #[doc = r" ```json"]
5293 #[doc = "{"]
5294 #[doc = " \"title\": \"TimeSeriesResponseDict\","]
5295 #[doc = " \"type\": \"object\","]
5296 #[doc = " \"required\": ["]
5297 #[doc = " \"data\""]
5298 #[doc = " ],"]
5299 #[doc = " \"properties\": {"]
5300 #[doc = " \"data\": {"]
5301 #[doc = " \"title\": \"Data\","]
5302 #[doc = " \"type\": \"array\","]
5303 #[doc = " \"items\": {"]
5304 #[doc = " \"type\": \"object\","]
5305 #[doc = " \"additionalProperties\": true"]
5306 #[doc = " }"]
5307 #[doc = " },"]
5308 #[doc = " \"next_token\": {"]
5309 #[doc = " \"title\": \"Next Token\","]
5310 #[doc = " \"type\": ["]
5311 #[doc = " \"string\","]
5312 #[doc = " \"null\""]
5313 #[doc = " ]"]
5314 #[doc = " }"]
5315 #[doc = " }"]
5316 #[doc = "}"]
5317 #[doc = r" ```"]
5318 #[doc = r" </details>"]
5319 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5320 pub struct TimeSeriesResponseDict {
5321 pub data: ::std::vec::Vec<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
5322 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5323 pub next_token: ::std::option::Option<::std::string::String>,
5324 }
5325
5326 #[doc = "`TimeSeriesResponsePublicHeartRateRow`"]
5327 #[doc = r""]
5328 #[doc = r" <details><summary>JSON schema</summary>"]
5329 #[doc = r""]
5330 #[doc = r" ```json"]
5331 #[doc = "{"]
5332 #[doc = " \"title\": \"TimeSeriesResponse[PublicHeartRateRow]\","]
5333 #[doc = " \"type\": \"object\","]
5334 #[doc = " \"required\": ["]
5335 #[doc = " \"data\""]
5336 #[doc = " ],"]
5337 #[doc = " \"properties\": {"]
5338 #[doc = " \"data\": {"]
5339 #[doc = " \"title\": \"Data\","]
5340 #[doc = " \"type\": \"array\","]
5341 #[doc = " \"items\": {"]
5342 #[doc = " \"$ref\": \"#/components/schemas/PublicHeartRateRow\""]
5343 #[doc = " }"]
5344 #[doc = " },"]
5345 #[doc = " \"next_token\": {"]
5346 #[doc = " \"title\": \"Next Token\","]
5347 #[doc = " \"type\": ["]
5348 #[doc = " \"string\","]
5349 #[doc = " \"null\""]
5350 #[doc = " ]"]
5351 #[doc = " }"]
5352 #[doc = " }"]
5353 #[doc = "}"]
5354 #[doc = r" ```"]
5355 #[doc = r" </details>"]
5356 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5357 pub struct TimeSeriesResponsePublicHeartRateRow {
5358 pub data: ::std::vec::Vec<PublicHeartRateRow>,
5359 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5360 pub next_token: ::std::option::Option<::std::string::String>,
5361 }
5362
5363 #[doc = "`TimeSeriesResponsePublicRingBatteryLevelRow`"]
5364 #[doc = r""]
5365 #[doc = r" <details><summary>JSON schema</summary>"]
5366 #[doc = r""]
5367 #[doc = r" ```json"]
5368 #[doc = "{"]
5369 #[doc = " \"title\": \"TimeSeriesResponse[PublicRingBatteryLevelRow]\","]
5370 #[doc = " \"type\": \"object\","]
5371 #[doc = " \"required\": ["]
5372 #[doc = " \"data\""]
5373 #[doc = " ],"]
5374 #[doc = " \"properties\": {"]
5375 #[doc = " \"data\": {"]
5376 #[doc = " \"title\": \"Data\","]
5377 #[doc = " \"type\": \"array\","]
5378 #[doc = " \"items\": {"]
5379 #[doc = " \"$ref\": \"#/components/schemas/PublicRingBatteryLevelRow\""]
5380 #[doc = " }"]
5381 #[doc = " },"]
5382 #[doc = " \"next_token\": {"]
5383 #[doc = " \"title\": \"Next Token\","]
5384 #[doc = " \"type\": ["]
5385 #[doc = " \"string\","]
5386 #[doc = " \"null\""]
5387 #[doc = " ]"]
5388 #[doc = " }"]
5389 #[doc = " }"]
5390 #[doc = "}"]
5391 #[doc = r" ```"]
5392 #[doc = r" </details>"]
5393 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5394 pub struct TimeSeriesResponsePublicRingBatteryLevelRow {
5395 pub data: ::std::vec::Vec<PublicRingBatteryLevelRow>,
5396 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5397 pub next_token: ::std::option::Option<::std::string::String>,
5398 }
5399
5400 #[doc = "`UpdateWebhookSubscriptionRequest`"]
5401 #[doc = r""]
5402 #[doc = r" <details><summary>JSON schema</summary>"]
5403 #[doc = r""]
5404 #[doc = r" ```json"]
5405 #[doc = "{"]
5406 #[doc = " \"title\": \"UpdateWebhookSubscriptionRequest\","]
5407 #[doc = " \"type\": \"object\","]
5408 #[doc = " \"required\": ["]
5409 #[doc = " \"verification_token\""]
5410 #[doc = " ],"]
5411 #[doc = " \"properties\": {"]
5412 #[doc = " \"callback_url\": {"]
5413 #[doc = " \"title\": \"Callback Url\","]
5414 #[doc = " \"type\": ["]
5415 #[doc = " \"string\","]
5416 #[doc = " \"null\""]
5417 #[doc = " ]"]
5418 #[doc = " },"]
5419 #[doc = " \"data_type\": {"]
5420 #[doc = " \"oneOf\": ["]
5421 #[doc = " {"]
5422 #[doc = " \"type\": \"null\""]
5423 #[doc = " },"]
5424 #[doc = " {"]
5425 #[doc = " \"allOf\": ["]
5426 #[doc = " {"]
5427 #[doc = " \"$ref\": \"#/components/schemas/ExtApiV2DataType\""]
5428 #[doc = " }"]
5429 #[doc = " ]"]
5430 #[doc = " }"]
5431 #[doc = " ]"]
5432 #[doc = " },"]
5433 #[doc = " \"event_type\": {"]
5434 #[doc = " \"oneOf\": ["]
5435 #[doc = " {"]
5436 #[doc = " \"type\": \"null\""]
5437 #[doc = " },"]
5438 #[doc = " {"]
5439 #[doc = " \"allOf\": ["]
5440 #[doc = " {"]
5441 #[doc = " \"$ref\": \"#/components/schemas/WebhookOperation\""]
5442 #[doc = " }"]
5443 #[doc = " ]"]
5444 #[doc = " }"]
5445 #[doc = " ]"]
5446 #[doc = " },"]
5447 #[doc = " \"verification_token\": {"]
5448 #[doc = " \"title\": \"Verification Token\","]
5449 #[doc = " \"type\": \"string\""]
5450 #[doc = " }"]
5451 #[doc = " }"]
5452 #[doc = "}"]
5453 #[doc = r" ```"]
5454 #[doc = r" </details>"]
5455 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5456 pub struct UpdateWebhookSubscriptionRequest {
5457 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5458 pub callback_url: ::std::option::Option<::std::string::String>,
5459 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5460 pub data_type: ::std::option::Option<ExtApiV2DataType>,
5461 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5462 pub event_type: ::std::option::Option<WebhookOperation>,
5463 pub verification_token: ::std::string::String,
5464 }
5465
5466 #[doc = "`UtcDateTime`"]
5467 #[doc = r""]
5468 #[doc = r" <details><summary>JSON schema</summary>"]
5469 #[doc = r""]
5470 #[doc = r" ```json"]
5471 #[doc = "{"]
5472 #[doc = " \"type\": \"string\""]
5473 #[doc = "}"]
5474 #[doc = r" ```"]
5475 #[doc = r" </details>"]
5476 #[derive(
5477 :: serde :: Deserialize,
5478 :: serde :: Serialize,
5479 Clone,
5480 Debug,
5481 Eq,
5482 Hash,
5483 Ord,
5484 PartialEq,
5485 PartialOrd,
5486 )]
5487 #[serde(transparent)]
5488 pub struct UtcDateTime(pub ::std::string::String);
5489 impl ::std::ops::Deref for UtcDateTime {
5490 type Target = ::std::string::String;
5491 fn deref(&self) -> &::std::string::String {
5492 &self.0
5493 }
5494 }
5495
5496 impl ::std::convert::From<UtcDateTime> for ::std::string::String {
5497 fn from(value: UtcDateTime) -> Self {
5498 value.0
5499 }
5500 }
5501
5502 impl ::std::convert::From<::std::string::String> for UtcDateTime {
5503 fn from(value: ::std::string::String) -> Self {
5504 Self(value)
5505 }
5506 }
5507
5508 impl ::std::str::FromStr for UtcDateTime {
5509 type Err = ::std::convert::Infallible;
5510 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
5511 Ok(Self(value.to_string()))
5512 }
5513 }
5514
5515 impl ::std::fmt::Display for UtcDateTime {
5516 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5517 self.0.fmt(f)
5518 }
5519 }
5520
5521 #[doc = "`ValidationError`"]
5522 #[doc = r""]
5523 #[doc = r" <details><summary>JSON schema</summary>"]
5524 #[doc = r""]
5525 #[doc = r" ```json"]
5526 #[doc = "{"]
5527 #[doc = " \"title\": \"ValidationError\","]
5528 #[doc = " \"type\": \"object\","]
5529 #[doc = " \"required\": ["]
5530 #[doc = " \"loc\","]
5531 #[doc = " \"msg\","]
5532 #[doc = " \"type\""]
5533 #[doc = " ],"]
5534 #[doc = " \"properties\": {"]
5535 #[doc = " \"ctx\": {"]
5536 #[doc = " \"title\": \"Context\","]
5537 #[doc = " \"type\": \"object\""]
5538 #[doc = " },"]
5539 #[doc = " \"input\": {"]
5540 #[doc = " \"title\": \"Input\""]
5541 #[doc = " },"]
5542 #[doc = " \"loc\": {"]
5543 #[doc = " \"title\": \"Location\","]
5544 #[doc = " \"type\": \"array\","]
5545 #[doc = " \"items\": {"]
5546 #[doc = " \"anyOf\": ["]
5547 #[doc = " {"]
5548 #[doc = " \"type\": \"string\""]
5549 #[doc = " },"]
5550 #[doc = " {"]
5551 #[doc = " \"type\": \"integer\""]
5552 #[doc = " }"]
5553 #[doc = " ]"]
5554 #[doc = " }"]
5555 #[doc = " },"]
5556 #[doc = " \"msg\": {"]
5557 #[doc = " \"title\": \"Message\","]
5558 #[doc = " \"type\": \"string\""]
5559 #[doc = " },"]
5560 #[doc = " \"type\": {"]
5561 #[doc = " \"title\": \"Error Type\","]
5562 #[doc = " \"type\": \"string\""]
5563 #[doc = " }"]
5564 #[doc = " }"]
5565 #[doc = "}"]
5566 #[doc = r" ```"]
5567 #[doc = r" </details>"]
5568 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5569 pub struct ValidationError {
5570 #[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
5571 pub ctx: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
5572 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5573 pub input: ::std::option::Option<::serde_json::Value>,
5574 pub loc: ::std::vec::Vec<LocationItem>,
5575 pub msg: ::std::string::String,
5576 #[serde(rename = "type")]
5577 pub type_: ::std::string::String,
5578 }
5579
5580 #[doc = "`WebhookOperation`"]
5581 #[doc = r""]
5582 #[doc = r" <details><summary>JSON schema</summary>"]
5583 #[doc = r""]
5584 #[doc = r" ```json"]
5585 #[doc = "{"]
5586 #[doc = " \"title\": \"WebhookOperation\","]
5587 #[doc = " \"type\": \"string\","]
5588 #[doc = " \"enum\": ["]
5589 #[doc = " \"create\","]
5590 #[doc = " \"update\","]
5591 #[doc = " \"delete\""]
5592 #[doc = " ]"]
5593 #[doc = "}"]
5594 #[doc = r" ```"]
5595 #[doc = r" </details>"]
5596 #[derive(
5597 :: serde :: Deserialize,
5598 :: serde :: Serialize,
5599 Clone,
5600 Copy,
5601 Debug,
5602 Eq,
5603 Hash,
5604 Ord,
5605 PartialEq,
5606 PartialOrd,
5607 )]
5608 pub enum WebhookOperation {
5609 #[serde(rename = "create")]
5610 Create,
5611 #[serde(rename = "update")]
5612 Update,
5613 #[serde(rename = "delete")]
5614 Delete,
5615 }
5616
5617 impl ::std::fmt::Display for WebhookOperation {
5618 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5619 match *self {
5620 Self::Create => f.write_str("create"),
5621 Self::Update => f.write_str("update"),
5622 Self::Delete => f.write_str("delete"),
5623 }
5624 }
5625 }
5626
5627 impl ::std::str::FromStr for WebhookOperation {
5628 type Err = self::error::ConversionError;
5629 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5630 match value {
5631 "create" => Ok(Self::Create),
5632 "update" => Ok(Self::Update),
5633 "delete" => Ok(Self::Delete),
5634 _ => Err("invalid value".into()),
5635 }
5636 }
5637 }
5638
5639 impl ::std::convert::TryFrom<&str> for WebhookOperation {
5640 type Error = self::error::ConversionError;
5641 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5642 value.parse()
5643 }
5644 }
5645
5646 impl ::std::convert::TryFrom<&::std::string::String> for WebhookOperation {
5647 type Error = self::error::ConversionError;
5648 fn try_from(
5649 value: &::std::string::String,
5650 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5651 value.parse()
5652 }
5653 }
5654
5655 impl ::std::convert::TryFrom<::std::string::String> for WebhookOperation {
5656 type Error = self::error::ConversionError;
5657 fn try_from(
5658 value: ::std::string::String,
5659 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5660 value.parse()
5661 }
5662 }
5663
5664 #[doc = "`WebhookSubscriptionModel`"]
5665 #[doc = r""]
5666 #[doc = r" <details><summary>JSON schema</summary>"]
5667 #[doc = r""]
5668 #[doc = r" ```json"]
5669 #[doc = "{"]
5670 #[doc = " \"title\": \"WebhookSubscriptionModel\","]
5671 #[doc = " \"type\": \"object\","]
5672 #[doc = " \"required\": ["]
5673 #[doc = " \"callback_url\","]
5674 #[doc = " \"data_type\","]
5675 #[doc = " \"event_type\","]
5676 #[doc = " \"expiration_time\","]
5677 #[doc = " \"id\""]
5678 #[doc = " ],"]
5679 #[doc = " \"properties\": {"]
5680 #[doc = " \"callback_url\": {"]
5681 #[doc = " \"title\": \"Callback Url\","]
5682 #[doc = " \"type\": \"string\""]
5683 #[doc = " },"]
5684 #[doc = " \"data_type\": {"]
5685 #[doc = " \"$ref\": \"#/components/schemas/ExtApiV2DataType\""]
5686 #[doc = " },"]
5687 #[doc = " \"event_type\": {"]
5688 #[doc = " \"$ref\": \"#/components/schemas/WebhookOperation\""]
5689 #[doc = " },"]
5690 #[doc = " \"expiration_time\": {"]
5691 #[doc = " \"title\": \"Expiration Time\","]
5692 #[doc = " \"type\": \"string\","]
5693 #[doc = " \"format\": \"date-time\""]
5694 #[doc = " },"]
5695 #[doc = " \"id\": {"]
5696 #[doc = " \"title\": \"Id\","]
5697 #[doc = " \"type\": \"string\","]
5698 #[doc = " \"format\": \"uuid4\""]
5699 #[doc = " }"]
5700 #[doc = " }"]
5701 #[doc = "}"]
5702 #[doc = r" ```"]
5703 #[doc = r" </details>"]
5704 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
5705 pub struct WebhookSubscriptionModel {
5706 pub callback_url: ::std::string::String,
5707 pub data_type: ExtApiV2DataType,
5708 pub event_type: WebhookOperation,
5709 pub expiration_time: ::chrono::DateTime<::chrono::offset::Utc>,
5710 pub id: ::std::string::String,
5711 }
5712
5713 #[doc = "Unique identifier of the object."]
5714 #[doc = r""]
5715 #[doc = r" <details><summary>JSON schema</summary>"]
5716 #[doc = r""]
5717 #[doc = r" ```json"]
5718 #[doc = "{"]
5719 #[doc = " \"title\": \"\","]
5720 #[doc = " \"description\": \"Unique identifier of the object.\","]
5721 #[doc = " \"type\": \"string\","]
5722 #[doc = " \"minLength\": 1"]
5723 #[doc = "}"]
5724 #[doc = r" ```"]
5725 #[doc = r" </details>"]
5726 #[derive(:: serde :: Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
5727 #[serde(transparent)]
5728 pub struct X(::std::string::String);
5729 impl ::std::ops::Deref for X {
5730 type Target = ::std::string::String;
5731 fn deref(&self) -> &::std::string::String {
5732 &self.0
5733 }
5734 }
5735
5736 impl ::std::convert::From<X> for ::std::string::String {
5737 fn from(value: X) -> Self {
5738 value.0
5739 }
5740 }
5741
5742 impl ::std::str::FromStr for X {
5743 type Err = self::error::ConversionError;
5744 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5745 if value.chars().count() < 1usize {
5746 return Err("shorter than 1 characters".into());
5747 }
5748 Ok(Self(value.to_string()))
5749 }
5750 }
5751
5752 impl ::std::convert::TryFrom<&str> for X {
5753 type Error = self::error::ConversionError;
5754 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5755 value.parse()
5756 }
5757 }
5758
5759 impl ::std::convert::TryFrom<&::std::string::String> for X {
5760 type Error = self::error::ConversionError;
5761 fn try_from(
5762 value: &::std::string::String,
5763 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5764 value.parse()
5765 }
5766 }
5767
5768 impl ::std::convert::TryFrom<::std::string::String> for X {
5769 type Error = self::error::ConversionError;
5770 fn try_from(
5771 value: ::std::string::String,
5772 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5773 value.parse()
5774 }
5775 }
5776
5777 impl<'de> ::serde::Deserialize<'de> for X {
5778 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5779 where
5780 D: ::serde::Deserializer<'de>,
5781 {
5782 ::std::string::String::deserialize(deserializer)?
5783 .parse()
5784 .map_err(|e: self::error::ConversionError| {
5785 <D::Error as ::serde::de::Error>::custom(e.to_string())
5786 })
5787 }
5788 }
5789}
5790
5791#[derive(Clone, Debug)]
5792#[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 ```\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>\n```\nPlease note that personal access tokens were deprecated in December 2025 and are no longer available for use.\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"]
5793pub struct Client {
5794 pub(crate) baseurl: String,
5795 pub(crate) client: reqwest::Client,
5796}
5797
5798impl Client {
5799 #[doc = r" Create a new client."]
5800 #[doc = r""]
5801 #[doc = r" `baseurl` is the base URL provided to the internal"]
5802 #[doc = r" `reqwest::Client`, and should include a scheme and hostname,"]
5803 #[doc = r" as well as port and a path stem if applicable."]
5804 pub fn new(baseurl: &str) -> Self {
5805 #[cfg(not(target_arch = "wasm32"))]
5806 let client = {
5807 let dur = ::std::time::Duration::from_secs(15u64);
5808 reqwest::ClientBuilder::new()
5809 .connect_timeout(dur)
5810 .timeout(dur)
5811 };
5812 #[cfg(target_arch = "wasm32")]
5813 let client = reqwest::ClientBuilder::new();
5814 Self::new_with_client(baseurl, client.build().unwrap())
5815 }
5816
5817 #[doc = r" Construct a new client with an existing `reqwest::Client`,"]
5818 #[doc = r" allowing more control over its configuration."]
5819 #[doc = r""]
5820 #[doc = r" `baseurl` is the base URL provided to the internal"]
5821 #[doc = r" `reqwest::Client`, and should include a scheme and hostname,"]
5822 #[doc = r" as well as port and a path stem if applicable."]
5823 pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self {
5824 Self {
5825 baseurl: baseurl.to_string(),
5826 client,
5827 }
5828 }
5829}
5830
5831impl ClientInfo<()> for Client {
5832 fn api_version() -> &'static str {
5833 "2.0"
5834 }
5835
5836 fn baseurl(&self) -> &str {
5837 self.baseurl.as_str()
5838 }
5839
5840 fn client(&self) -> &reqwest::Client {
5841 &self.client
5842 }
5843
5844 fn inner(&self) -> &() {
5845 &()
5846 }
5847}
5848
5849impl ClientHooks<()> for &Client {}
5850#[allow(clippy::all)]
5851impl Client {
5852 #[doc = "Sandbox - Multiple Daily Activity Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_activity`\n\n"]
5853 pub async fn sandbox_multiple_daily_activity_documents_v2_sandbox_usercollection_daily_activity_get<
5854 'a,
5855 >(
5856 &'a self,
5857 end_date: Option<&'a ::chrono::naive::NaiveDate>,
5858 next_token: Option<&'a str>,
5859 start_date: Option<&'a ::chrono::naive::NaiveDate>,
5860 ) -> Result<
5861 ResponseValue<types::MultiDocumentResponsePublicDailyActivity>,
5862 Error<types::HttpValidationError>,
5863 > {
5864 let url = format!("{}/v2/sandbox/usercollection/daily_activity", self.baseurl,);
5865 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5866 header_map.append(
5867 ::reqwest::header::HeaderName::from_static("api-version"),
5868 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5869 );
5870 #[allow(unused_mut)]
5871 let mut request = self
5872 .client
5873 .get(url)
5874 .header(
5875 ::reqwest::header::ACCEPT,
5876 ::reqwest::header::HeaderValue::from_static("application/json"),
5877 )
5878 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
5879 .query(&progenitor_client::QueryParam::new(
5880 "next_token",
5881 &next_token,
5882 ))
5883 .query(&progenitor_client::QueryParam::new(
5884 "start_date",
5885 &start_date,
5886 ))
5887 .headers(header_map)
5888 .build()?;
5889 let info = OperationInfo { operation_id : "sandbox_multiple_daily_activity_documents_v2_sandbox_usercollection_daily_activity_get" , } ;
5890 self.pre(&mut request, &info).await?;
5891 let result = self.exec(request, &info).await;
5892 self.post(&result, &info).await?;
5893 let response = result?;
5894 match response.status().as_u16() {
5895 200u16 => ResponseValue::from_response(response).await,
5896 422u16 => Err(Error::ErrorResponse(
5897 ResponseValue::from_response(response).await?,
5898 )),
5899 _ => Err(Error::UnexpectedResponse(response)),
5900 }
5901 }
5902
5903 #[doc = "Sandbox - Single Daily Activity Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_activity/{document_id}`\n\n"]
5904 pub async fn sandbox_single_daily_activity_document_v2_sandbox_usercollection_daily_activity_document_id_get<
5905 'a,
5906 >(
5907 &'a self,
5908 document_id: &'a str,
5909 ) -> Result<ResponseValue<types::PublicDailyActivity>, Error<types::HttpValidationError>> {
5910 let url = format!(
5911 "{}/v2/sandbox/usercollection/daily_activity/{}",
5912 self.baseurl,
5913 encode_path(&document_id.to_string()),
5914 );
5915 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5916 header_map.append(
5917 ::reqwest::header::HeaderName::from_static("api-version"),
5918 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5919 );
5920 #[allow(unused_mut)]
5921 let mut request = self
5922 .client
5923 .get(url)
5924 .header(
5925 ::reqwest::header::ACCEPT,
5926 ::reqwest::header::HeaderValue::from_static("application/json"),
5927 )
5928 .headers(header_map)
5929 .build()?;
5930 let info = OperationInfo { operation_id : "sandbox_single_daily_activity_document_v2_sandbox_usercollection_daily_activity_document_id_get" , } ;
5931 self.pre(&mut request, &info).await?;
5932 let result = self.exec(request, &info).await;
5933 self.post(&result, &info).await?;
5934 let response = result?;
5935 match response.status().as_u16() {
5936 200u16 => ResponseValue::from_response(response).await,
5937 422u16 => Err(Error::ErrorResponse(
5938 ResponseValue::from_response(response).await?,
5939 )),
5940 _ => Err(Error::UnexpectedResponse(response)),
5941 }
5942 }
5943
5944 #[doc = "Sandbox - Multiple Daily Cardiovascular Age Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_cardiovascular_age`\n\n"]
5945 pub async fn sandbox_multiple_daily_cardiovascular_age_documents_v2_sandbox_usercollection_daily_cardiovascular_age_get<
5946 'a,
5947 >(
5948 &'a self,
5949 end_date: Option<&'a ::chrono::naive::NaiveDate>,
5950 next_token: Option<&'a str>,
5951 start_date: Option<&'a ::chrono::naive::NaiveDate>,
5952 ) -> Result<
5953 ResponseValue<types::MultiDocumentResponsePublicDailyCardiovascularAge>,
5954 Error<types::HttpValidationError>,
5955 > {
5956 let url = format!(
5957 "{}/v2/sandbox/usercollection/daily_cardiovascular_age",
5958 self.baseurl,
5959 );
5960 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5961 header_map.append(
5962 ::reqwest::header::HeaderName::from_static("api-version"),
5963 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5964 );
5965 #[allow(unused_mut)]
5966 let mut request = self
5967 .client
5968 .get(url)
5969 .header(
5970 ::reqwest::header::ACCEPT,
5971 ::reqwest::header::HeaderValue::from_static("application/json"),
5972 )
5973 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
5974 .query(&progenitor_client::QueryParam::new(
5975 "next_token",
5976 &next_token,
5977 ))
5978 .query(&progenitor_client::QueryParam::new(
5979 "start_date",
5980 &start_date,
5981 ))
5982 .headers(header_map)
5983 .build()?;
5984 let info = OperationInfo { operation_id : "sandbox_multiple_daily_cardiovascular_age_documents_v2_sandbox_usercollection_daily_cardiovascular_age_get" , } ;
5985 self.pre(&mut request, &info).await?;
5986 let result = self.exec(request, &info).await;
5987 self.post(&result, &info).await?;
5988 let response = result?;
5989 match response.status().as_u16() {
5990 200u16 => ResponseValue::from_response(response).await,
5991 422u16 => Err(Error::ErrorResponse(
5992 ResponseValue::from_response(response).await?,
5993 )),
5994 _ => Err(Error::UnexpectedResponse(response)),
5995 }
5996 }
5997
5998 #[doc = "Sandbox - Single Daily Cardiovascular Age Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_cardiovascular_age/{document_id}`\n\n"]
5999 pub async fn sandbox_single_daily_cardiovascular_age_document_v2_sandbox_usercollection_daily_cardiovascular_age_document_id_get<
6000 'a,
6001 >(
6002 &'a self,
6003 document_id: &'a str,
6004 ) -> Result<ResponseValue<types::PublicDailyCardiovascularAge>, Error<types::HttpValidationError>>
6005 {
6006 let url = format!(
6007 "{}/v2/sandbox/usercollection/daily_cardiovascular_age/{}",
6008 self.baseurl,
6009 encode_path(&document_id.to_string()),
6010 );
6011 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6012 header_map.append(
6013 ::reqwest::header::HeaderName::from_static("api-version"),
6014 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6015 );
6016 #[allow(unused_mut)]
6017 let mut request = self
6018 .client
6019 .get(url)
6020 .header(
6021 ::reqwest::header::ACCEPT,
6022 ::reqwest::header::HeaderValue::from_static("application/json"),
6023 )
6024 .headers(header_map)
6025 .build()?;
6026 let info = OperationInfo { operation_id : "sandbox_single_daily_cardiovascular_age_document_v2_sandbox_usercollection_daily_cardiovascular_age_document_id_get" , } ;
6027 self.pre(&mut request, &info).await?;
6028 let result = self.exec(request, &info).await;
6029 self.post(&result, &info).await?;
6030 let response = result?;
6031 match response.status().as_u16() {
6032 200u16 => ResponseValue::from_response(response).await,
6033 422u16 => Err(Error::ErrorResponse(
6034 ResponseValue::from_response(response).await?,
6035 )),
6036 _ => Err(Error::UnexpectedResponse(response)),
6037 }
6038 }
6039
6040 #[doc = "Sandbox - Multiple Daily Readiness Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_readiness`\n\n"]
6041 pub async fn sandbox_multiple_daily_readiness_documents_v2_sandbox_usercollection_daily_readiness_get<
6042 'a,
6043 >(
6044 &'a self,
6045 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6046 next_token: Option<&'a str>,
6047 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6048 ) -> Result<
6049 ResponseValue<types::MultiDocumentResponsePublicDailyReadiness>,
6050 Error<types::HttpValidationError>,
6051 > {
6052 let url = format!("{}/v2/sandbox/usercollection/daily_readiness", self.baseurl,);
6053 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6054 header_map.append(
6055 ::reqwest::header::HeaderName::from_static("api-version"),
6056 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6057 );
6058 #[allow(unused_mut)]
6059 let mut request = self
6060 .client
6061 .get(url)
6062 .header(
6063 ::reqwest::header::ACCEPT,
6064 ::reqwest::header::HeaderValue::from_static("application/json"),
6065 )
6066 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
6067 .query(&progenitor_client::QueryParam::new(
6068 "next_token",
6069 &next_token,
6070 ))
6071 .query(&progenitor_client::QueryParam::new(
6072 "start_date",
6073 &start_date,
6074 ))
6075 .headers(header_map)
6076 .build()?;
6077 let info = OperationInfo { operation_id : "sandbox_multiple_daily_readiness_documents_v2_sandbox_usercollection_daily_readiness_get" , } ;
6078 self.pre(&mut request, &info).await?;
6079 let result = self.exec(request, &info).await;
6080 self.post(&result, &info).await?;
6081 let response = result?;
6082 match response.status().as_u16() {
6083 200u16 => ResponseValue::from_response(response).await,
6084 422u16 => Err(Error::ErrorResponse(
6085 ResponseValue::from_response(response).await?,
6086 )),
6087 _ => Err(Error::UnexpectedResponse(response)),
6088 }
6089 }
6090
6091 #[doc = "Sandbox - Single Daily Readiness Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_readiness/{document_id}`\n\n"]
6092 pub async fn sandbox_single_daily_readiness_document_v2_sandbox_usercollection_daily_readiness_document_id_get<
6093 'a,
6094 >(
6095 &'a self,
6096 document_id: &'a str,
6097 ) -> Result<ResponseValue<types::PublicDailyReadiness>, Error<types::HttpValidationError>> {
6098 let url = format!(
6099 "{}/v2/sandbox/usercollection/daily_readiness/{}",
6100 self.baseurl,
6101 encode_path(&document_id.to_string()),
6102 );
6103 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6104 header_map.append(
6105 ::reqwest::header::HeaderName::from_static("api-version"),
6106 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6107 );
6108 #[allow(unused_mut)]
6109 let mut request = self
6110 .client
6111 .get(url)
6112 .header(
6113 ::reqwest::header::ACCEPT,
6114 ::reqwest::header::HeaderValue::from_static("application/json"),
6115 )
6116 .headers(header_map)
6117 .build()?;
6118 let info = OperationInfo { operation_id : "sandbox_single_daily_readiness_document_v2_sandbox_usercollection_daily_readiness_document_id_get" , } ;
6119 self.pre(&mut request, &info).await?;
6120 let result = self.exec(request, &info).await;
6121 self.post(&result, &info).await?;
6122 let response = result?;
6123 match response.status().as_u16() {
6124 200u16 => ResponseValue::from_response(response).await,
6125 422u16 => Err(Error::ErrorResponse(
6126 ResponseValue::from_response(response).await?,
6127 )),
6128 _ => Err(Error::UnexpectedResponse(response)),
6129 }
6130 }
6131
6132 #[doc = "Sandbox - Multiple Daily Resilience Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_resilience`\n\n"]
6133 pub async fn sandbox_multiple_daily_resilience_documents_v2_sandbox_usercollection_daily_resilience_get<
6134 'a,
6135 >(
6136 &'a self,
6137 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6138 next_token: Option<&'a str>,
6139 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6140 ) -> Result<
6141 ResponseValue<types::MultiDocumentResponseDailyResilienceModel>,
6142 Error<types::HttpValidationError>,
6143 > {
6144 let url = format!(
6145 "{}/v2/sandbox/usercollection/daily_resilience",
6146 self.baseurl,
6147 );
6148 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6149 header_map.append(
6150 ::reqwest::header::HeaderName::from_static("api-version"),
6151 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6152 );
6153 #[allow(unused_mut)]
6154 let mut request = self
6155 .client
6156 .get(url)
6157 .header(
6158 ::reqwest::header::ACCEPT,
6159 ::reqwest::header::HeaderValue::from_static("application/json"),
6160 )
6161 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
6162 .query(&progenitor_client::QueryParam::new(
6163 "next_token",
6164 &next_token,
6165 ))
6166 .query(&progenitor_client::QueryParam::new(
6167 "start_date",
6168 &start_date,
6169 ))
6170 .headers(header_map)
6171 .build()?;
6172 let info = OperationInfo { operation_id : "sandbox_multiple_daily_resilience_documents_v2_sandbox_usercollection_daily_resilience_get" , } ;
6173 self.pre(&mut request, &info).await?;
6174 let result = self.exec(request, &info).await;
6175 self.post(&result, &info).await?;
6176 let response = result?;
6177 match response.status().as_u16() {
6178 200u16 => ResponseValue::from_response(response).await,
6179 422u16 => Err(Error::ErrorResponse(
6180 ResponseValue::from_response(response).await?,
6181 )),
6182 _ => Err(Error::UnexpectedResponse(response)),
6183 }
6184 }
6185
6186 #[doc = "Sandbox - Single Daily Resilience Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_resilience/{document_id}`\n\n"]
6187 pub async fn sandbox_single_daily_resilience_document_v2_sandbox_usercollection_daily_resilience_document_id_get<
6188 'a,
6189 >(
6190 &'a self,
6191 document_id: &'a str,
6192 ) -> Result<ResponseValue<types::DailyResilienceModel>, Error<types::HttpValidationError>> {
6193 let url = format!(
6194 "{}/v2/sandbox/usercollection/daily_resilience/{}",
6195 self.baseurl,
6196 encode_path(&document_id.to_string()),
6197 );
6198 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6199 header_map.append(
6200 ::reqwest::header::HeaderName::from_static("api-version"),
6201 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6202 );
6203 #[allow(unused_mut)]
6204 let mut request = self
6205 .client
6206 .get(url)
6207 .header(
6208 ::reqwest::header::ACCEPT,
6209 ::reqwest::header::HeaderValue::from_static("application/json"),
6210 )
6211 .headers(header_map)
6212 .build()?;
6213 let info = OperationInfo { operation_id : "sandbox_single_daily_resilience_document_v2_sandbox_usercollection_daily_resilience_document_id_get" , } ;
6214 self.pre(&mut request, &info).await?;
6215 let result = self.exec(request, &info).await;
6216 self.post(&result, &info).await?;
6217 let response = result?;
6218 match response.status().as_u16() {
6219 200u16 => ResponseValue::from_response(response).await,
6220 422u16 => Err(Error::ErrorResponse(
6221 ResponseValue::from_response(response).await?,
6222 )),
6223 _ => Err(Error::UnexpectedResponse(response)),
6224 }
6225 }
6226
6227 #[doc = "Sandbox - Multiple Daily Sleep Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_sleep`\n\n"]
6228 pub async fn sandbox_multiple_daily_sleep_documents_v2_sandbox_usercollection_daily_sleep_get<
6229 'a,
6230 >(
6231 &'a self,
6232 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6233 next_token: Option<&'a str>,
6234 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6235 ) -> Result<
6236 ResponseValue<types::MultiDocumentResponsePublicDailySleep>,
6237 Error<types::HttpValidationError>,
6238 > {
6239 let url = format!("{}/v2/sandbox/usercollection/daily_sleep", self.baseurl,);
6240 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6241 header_map.append(
6242 ::reqwest::header::HeaderName::from_static("api-version"),
6243 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6244 );
6245 #[allow(unused_mut)]
6246 let mut request = self
6247 .client
6248 .get(url)
6249 .header(
6250 ::reqwest::header::ACCEPT,
6251 ::reqwest::header::HeaderValue::from_static("application/json"),
6252 )
6253 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
6254 .query(&progenitor_client::QueryParam::new(
6255 "next_token",
6256 &next_token,
6257 ))
6258 .query(&progenitor_client::QueryParam::new(
6259 "start_date",
6260 &start_date,
6261 ))
6262 .headers(header_map)
6263 .build()?;
6264 let info = OperationInfo {
6265 operation_id:
6266 "sandbox_multiple_daily_sleep_documents_v2_sandbox_usercollection_daily_sleep_get",
6267 };
6268 self.pre(&mut request, &info).await?;
6269 let result = self.exec(request, &info).await;
6270 self.post(&result, &info).await?;
6271 let response = result?;
6272 match response.status().as_u16() {
6273 200u16 => ResponseValue::from_response(response).await,
6274 422u16 => Err(Error::ErrorResponse(
6275 ResponseValue::from_response(response).await?,
6276 )),
6277 _ => Err(Error::UnexpectedResponse(response)),
6278 }
6279 }
6280
6281 #[doc = "Sandbox - Single Daily Sleep Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_sleep/{document_id}`\n\n"]
6282 pub async fn sandbox_single_daily_sleep_document_v2_sandbox_usercollection_daily_sleep_document_id_get<
6283 'a,
6284 >(
6285 &'a self,
6286 document_id: &'a str,
6287 ) -> Result<ResponseValue<types::PublicDailySleep>, Error<types::HttpValidationError>> {
6288 let url = format!(
6289 "{}/v2/sandbox/usercollection/daily_sleep/{}",
6290 self.baseurl,
6291 encode_path(&document_id.to_string()),
6292 );
6293 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6294 header_map.append(
6295 ::reqwest::header::HeaderName::from_static("api-version"),
6296 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6297 );
6298 #[allow(unused_mut)]
6299 let mut request = self
6300 .client
6301 .get(url)
6302 .header(
6303 ::reqwest::header::ACCEPT,
6304 ::reqwest::header::HeaderValue::from_static("application/json"),
6305 )
6306 .headers(header_map)
6307 .build()?;
6308 let info = OperationInfo { operation_id : "sandbox_single_daily_sleep_document_v2_sandbox_usercollection_daily_sleep_document_id_get" , } ;
6309 self.pre(&mut request, &info).await?;
6310 let result = self.exec(request, &info).await;
6311 self.post(&result, &info).await?;
6312 let response = result?;
6313 match response.status().as_u16() {
6314 200u16 => ResponseValue::from_response(response).await,
6315 422u16 => Err(Error::ErrorResponse(
6316 ResponseValue::from_response(response).await?,
6317 )),
6318 _ => Err(Error::UnexpectedResponse(response)),
6319 }
6320 }
6321
6322 #[doc = "Sandbox - Multiple Daily Spo2 Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_spo2`\n\n"]
6323 pub async fn sandbox_multiple_daily_spo2_documents_v2_sandbox_usercollection_daily_spo2_get<
6324 'a,
6325 >(
6326 &'a self,
6327 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6328 next_token: Option<&'a str>,
6329 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6330 ) -> Result<
6331 ResponseValue<types::MultiDocumentResponsePublicDailySpO2>,
6332 Error<types::HttpValidationError>,
6333 > {
6334 let url = format!("{}/v2/sandbox/usercollection/daily_spo2", self.baseurl,);
6335 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6336 header_map.append(
6337 ::reqwest::header::HeaderName::from_static("api-version"),
6338 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6339 );
6340 #[allow(unused_mut)]
6341 let mut request = self
6342 .client
6343 .get(url)
6344 .header(
6345 ::reqwest::header::ACCEPT,
6346 ::reqwest::header::HeaderValue::from_static("application/json"),
6347 )
6348 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
6349 .query(&progenitor_client::QueryParam::new(
6350 "next_token",
6351 &next_token,
6352 ))
6353 .query(&progenitor_client::QueryParam::new(
6354 "start_date",
6355 &start_date,
6356 ))
6357 .headers(header_map)
6358 .build()?;
6359 let info = OperationInfo {
6360 operation_id:
6361 "sandbox_multiple_daily_spo2_documents_v2_sandbox_usercollection_daily_spo2_get",
6362 };
6363 self.pre(&mut request, &info).await?;
6364 let result = self.exec(request, &info).await;
6365 self.post(&result, &info).await?;
6366 let response = result?;
6367 match response.status().as_u16() {
6368 200u16 => ResponseValue::from_response(response).await,
6369 422u16 => Err(Error::ErrorResponse(
6370 ResponseValue::from_response(response).await?,
6371 )),
6372 _ => Err(Error::UnexpectedResponse(response)),
6373 }
6374 }
6375
6376 #[doc = "Sandbox - Single Daily Spo2 Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_spo2/{document_id}`\n\n"]
6377 pub async fn sandbox_single_daily_spo2_document_v2_sandbox_usercollection_daily_spo2_document_id_get<
6378 'a,
6379 >(
6380 &'a self,
6381 document_id: &'a str,
6382 ) -> Result<ResponseValue<types::PublicDailySpO2>, Error<types::HttpValidationError>> {
6383 let url = format!(
6384 "{}/v2/sandbox/usercollection/daily_spo2/{}",
6385 self.baseurl,
6386 encode_path(&document_id.to_string()),
6387 );
6388 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6389 header_map.append(
6390 ::reqwest::header::HeaderName::from_static("api-version"),
6391 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6392 );
6393 #[allow(unused_mut)]
6394 let mut request = self
6395 .client
6396 .get(url)
6397 .header(
6398 ::reqwest::header::ACCEPT,
6399 ::reqwest::header::HeaderValue::from_static("application/json"),
6400 )
6401 .headers(header_map)
6402 .build()?;
6403 let info = OperationInfo { operation_id : "sandbox_single_daily_spo2_document_v2_sandbox_usercollection_daily_spo2_document_id_get" , } ;
6404 self.pre(&mut request, &info).await?;
6405 let result = self.exec(request, &info).await;
6406 self.post(&result, &info).await?;
6407 let response = result?;
6408 match response.status().as_u16() {
6409 200u16 => ResponseValue::from_response(response).await,
6410 422u16 => Err(Error::ErrorResponse(
6411 ResponseValue::from_response(response).await?,
6412 )),
6413 _ => Err(Error::UnexpectedResponse(response)),
6414 }
6415 }
6416
6417 #[doc = "Sandbox - Multiple Daily Stress Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_stress`\n\n"]
6418 pub async fn sandbox_multiple_daily_stress_documents_v2_sandbox_usercollection_daily_stress_get<
6419 'a,
6420 >(
6421 &'a self,
6422 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6423 next_token: Option<&'a str>,
6424 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6425 ) -> Result<
6426 ResponseValue<types::MultiDocumentResponsePublicDailyStress>,
6427 Error<types::HttpValidationError>,
6428 > {
6429 let url = format!("{}/v2/sandbox/usercollection/daily_stress", self.baseurl,);
6430 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6431 header_map.append(
6432 ::reqwest::header::HeaderName::from_static("api-version"),
6433 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6434 );
6435 #[allow(unused_mut)]
6436 let mut request = self
6437 .client
6438 .get(url)
6439 .header(
6440 ::reqwest::header::ACCEPT,
6441 ::reqwest::header::HeaderValue::from_static("application/json"),
6442 )
6443 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
6444 .query(&progenitor_client::QueryParam::new(
6445 "next_token",
6446 &next_token,
6447 ))
6448 .query(&progenitor_client::QueryParam::new(
6449 "start_date",
6450 &start_date,
6451 ))
6452 .headers(header_map)
6453 .build()?;
6454 let info = OperationInfo {
6455 operation_id:
6456 "sandbox_multiple_daily_stress_documents_v2_sandbox_usercollection_daily_stress_get",
6457 };
6458 self.pre(&mut request, &info).await?;
6459 let result = self.exec(request, &info).await;
6460 self.post(&result, &info).await?;
6461 let response = result?;
6462 match response.status().as_u16() {
6463 200u16 => ResponseValue::from_response(response).await,
6464 422u16 => Err(Error::ErrorResponse(
6465 ResponseValue::from_response(response).await?,
6466 )),
6467 _ => Err(Error::UnexpectedResponse(response)),
6468 }
6469 }
6470
6471 #[doc = "Sandbox - Single Daily Stress Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/daily_stress/{document_id}`\n\n"]
6472 pub async fn sandbox_single_daily_stress_document_v2_sandbox_usercollection_daily_stress_document_id_get<
6473 'a,
6474 >(
6475 &'a self,
6476 document_id: &'a str,
6477 ) -> Result<ResponseValue<types::PublicDailyStress>, Error<types::HttpValidationError>> {
6478 let url = format!(
6479 "{}/v2/sandbox/usercollection/daily_stress/{}",
6480 self.baseurl,
6481 encode_path(&document_id.to_string()),
6482 );
6483 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6484 header_map.append(
6485 ::reqwest::header::HeaderName::from_static("api-version"),
6486 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6487 );
6488 #[allow(unused_mut)]
6489 let mut request = self
6490 .client
6491 .get(url)
6492 .header(
6493 ::reqwest::header::ACCEPT,
6494 ::reqwest::header::HeaderValue::from_static("application/json"),
6495 )
6496 .headers(header_map)
6497 .build()?;
6498 let info = OperationInfo { operation_id : "sandbox_single_daily_stress_document_v2_sandbox_usercollection_daily_stress_document_id_get" , } ;
6499 self.pre(&mut request, &info).await?;
6500 let result = self.exec(request, &info).await;
6501 self.post(&result, &info).await?;
6502 let response = result?;
6503 match response.status().as_u16() {
6504 200u16 => ResponseValue::from_response(response).await,
6505 422u16 => Err(Error::ErrorResponse(
6506 ResponseValue::from_response(response).await?,
6507 )),
6508 _ => Err(Error::UnexpectedResponse(response)),
6509 }
6510 }
6511
6512 #[doc = "Sandbox - Multiple Enhanced Tag Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/enhanced_tag`\n\n"]
6513 pub async fn sandbox_multiple_enhanced_tag_documents_v2_sandbox_usercollection_enhanced_tag_get<
6514 'a,
6515 >(
6516 &'a self,
6517 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6518 next_token: Option<&'a str>,
6519 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6520 ) -> Result<
6521 ResponseValue<types::MultiDocumentResponseEnhancedTagModel>,
6522 Error<types::HttpValidationError>,
6523 > {
6524 let url = format!("{}/v2/sandbox/usercollection/enhanced_tag", self.baseurl,);
6525 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6526 header_map.append(
6527 ::reqwest::header::HeaderName::from_static("api-version"),
6528 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6529 );
6530 #[allow(unused_mut)]
6531 let mut request = self
6532 .client
6533 .get(url)
6534 .header(
6535 ::reqwest::header::ACCEPT,
6536 ::reqwest::header::HeaderValue::from_static("application/json"),
6537 )
6538 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
6539 .query(&progenitor_client::QueryParam::new(
6540 "next_token",
6541 &next_token,
6542 ))
6543 .query(&progenitor_client::QueryParam::new(
6544 "start_date",
6545 &start_date,
6546 ))
6547 .headers(header_map)
6548 .build()?;
6549 let info = OperationInfo {
6550 operation_id:
6551 "sandbox_multiple_enhanced_tag_documents_v2_sandbox_usercollection_enhanced_tag_get",
6552 };
6553 self.pre(&mut request, &info).await?;
6554 let result = self.exec(request, &info).await;
6555 self.post(&result, &info).await?;
6556 let response = result?;
6557 match response.status().as_u16() {
6558 200u16 => ResponseValue::from_response(response).await,
6559 422u16 => Err(Error::ErrorResponse(
6560 ResponseValue::from_response(response).await?,
6561 )),
6562 _ => Err(Error::UnexpectedResponse(response)),
6563 }
6564 }
6565
6566 #[doc = "Sandbox - Single Enhanced Tag Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/enhanced_tag/{document_id}`\n\n"]
6567 pub async fn sandbox_single_enhanced_tag_document_v2_sandbox_usercollection_enhanced_tag_document_id_get<
6568 'a,
6569 >(
6570 &'a self,
6571 document_id: &'a str,
6572 ) -> Result<ResponseValue<types::EnhancedTagModel>, Error<types::HttpValidationError>> {
6573 let url = format!(
6574 "{}/v2/sandbox/usercollection/enhanced_tag/{}",
6575 self.baseurl,
6576 encode_path(&document_id.to_string()),
6577 );
6578 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6579 header_map.append(
6580 ::reqwest::header::HeaderName::from_static("api-version"),
6581 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6582 );
6583 #[allow(unused_mut)]
6584 let mut request = self
6585 .client
6586 .get(url)
6587 .header(
6588 ::reqwest::header::ACCEPT,
6589 ::reqwest::header::HeaderValue::from_static("application/json"),
6590 )
6591 .headers(header_map)
6592 .build()?;
6593 let info = OperationInfo { operation_id : "sandbox_single_enhanced_tag_document_v2_sandbox_usercollection_enhanced_tag_document_id_get" , } ;
6594 self.pre(&mut request, &info).await?;
6595 let result = self.exec(request, &info).await;
6596 self.post(&result, &info).await?;
6597 let response = result?;
6598 match response.status().as_u16() {
6599 200u16 => ResponseValue::from_response(response).await,
6600 422u16 => Err(Error::ErrorResponse(
6601 ResponseValue::from_response(response).await?,
6602 )),
6603 _ => Err(Error::UnexpectedResponse(response)),
6604 }
6605 }
6606
6607 #[doc = "Sandbox - Multiple Heartrate Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/heartrate`\n\n"]
6608 pub async fn sandbox_multiple_heartrate_documents_v2_sandbox_usercollection_heartrate_get<
6609 'a,
6610 >(
6611 &'a self,
6612 end_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
6613 next_token: Option<&'a str>,
6614 start_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
6615 ) -> Result<
6616 ResponseValue<
6617 types::ResponseSandboxMultipleHeartrateDocumentsV2SandboxUsercollectionHeartrateGet,
6618 >,
6619 Error<types::HttpValidationError>,
6620 > {
6621 let url = format!("{}/v2/sandbox/usercollection/heartrate", self.baseurl,);
6622 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6623 header_map.append(
6624 ::reqwest::header::HeaderName::from_static("api-version"),
6625 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6626 );
6627 #[allow(unused_mut)]
6628 let mut request = self
6629 .client
6630 .get(url)
6631 .header(
6632 ::reqwest::header::ACCEPT,
6633 ::reqwest::header::HeaderValue::from_static("application/json"),
6634 )
6635 .query(&progenitor_client::QueryParam::new(
6636 "end_datetime",
6637 &end_datetime,
6638 ))
6639 .query(&progenitor_client::QueryParam::new(
6640 "next_token",
6641 &next_token,
6642 ))
6643 .query(&progenitor_client::QueryParam::new(
6644 "start_datetime",
6645 &start_datetime,
6646 ))
6647 .headers(header_map)
6648 .build()?;
6649 let info = OperationInfo {
6650 operation_id:
6651 "sandbox_multiple_heartrate_documents_v2_sandbox_usercollection_heartrate_get",
6652 };
6653 self.pre(&mut request, &info).await?;
6654 let result = self.exec(request, &info).await;
6655 self.post(&result, &info).await?;
6656 let response = result?;
6657 match response.status().as_u16() {
6658 200u16 => ResponseValue::from_response(response).await,
6659 422u16 => Err(Error::ErrorResponse(
6660 ResponseValue::from_response(response).await?,
6661 )),
6662 _ => Err(Error::UnexpectedResponse(response)),
6663 }
6664 }
6665
6666 #[doc = "Sandbox - Multiple Rest Mode Period Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/rest_mode_period`\n\n"]
6667 pub async fn sandbox_multiple_rest_mode_period_documents_v2_sandbox_usercollection_rest_mode_period_get<
6668 'a,
6669 >(
6670 &'a self,
6671 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6672 next_token: Option<&'a str>,
6673 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6674 ) -> Result<
6675 ResponseValue<types::MultiDocumentResponsePublicRestModePeriod>,
6676 Error<types::HttpValidationError>,
6677 > {
6678 let url = format!(
6679 "{}/v2/sandbox/usercollection/rest_mode_period",
6680 self.baseurl,
6681 );
6682 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6683 header_map.append(
6684 ::reqwest::header::HeaderName::from_static("api-version"),
6685 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6686 );
6687 #[allow(unused_mut)]
6688 let mut request = self
6689 .client
6690 .get(url)
6691 .header(
6692 ::reqwest::header::ACCEPT,
6693 ::reqwest::header::HeaderValue::from_static("application/json"),
6694 )
6695 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
6696 .query(&progenitor_client::QueryParam::new(
6697 "next_token",
6698 &next_token,
6699 ))
6700 .query(&progenitor_client::QueryParam::new(
6701 "start_date",
6702 &start_date,
6703 ))
6704 .headers(header_map)
6705 .build()?;
6706 let info = OperationInfo { operation_id : "sandbox_multiple_rest_mode_period_documents_v2_sandbox_usercollection_rest_mode_period_get" , } ;
6707 self.pre(&mut request, &info).await?;
6708 let result = self.exec(request, &info).await;
6709 self.post(&result, &info).await?;
6710 let response = result?;
6711 match response.status().as_u16() {
6712 200u16 => ResponseValue::from_response(response).await,
6713 422u16 => Err(Error::ErrorResponse(
6714 ResponseValue::from_response(response).await?,
6715 )),
6716 _ => Err(Error::UnexpectedResponse(response)),
6717 }
6718 }
6719
6720 #[doc = "Sandbox - Single Rest Mode Period Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/rest_mode_period/{document_id}`\n\n"]
6721 pub async fn sandbox_single_rest_mode_period_document_v2_sandbox_usercollection_rest_mode_period_document_id_get<
6722 'a,
6723 >(
6724 &'a self,
6725 document_id: &'a str,
6726 ) -> Result<ResponseValue<types::PublicRestModePeriod>, Error<types::HttpValidationError>> {
6727 let url = format!(
6728 "{}/v2/sandbox/usercollection/rest_mode_period/{}",
6729 self.baseurl,
6730 encode_path(&document_id.to_string()),
6731 );
6732 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6733 header_map.append(
6734 ::reqwest::header::HeaderName::from_static("api-version"),
6735 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6736 );
6737 #[allow(unused_mut)]
6738 let mut request = self
6739 .client
6740 .get(url)
6741 .header(
6742 ::reqwest::header::ACCEPT,
6743 ::reqwest::header::HeaderValue::from_static("application/json"),
6744 )
6745 .headers(header_map)
6746 .build()?;
6747 let info = OperationInfo { operation_id : "sandbox_single_rest_mode_period_document_v2_sandbox_usercollection_rest_mode_period_document_id_get" , } ;
6748 self.pre(&mut request, &info).await?;
6749 let result = self.exec(request, &info).await;
6750 self.post(&result, &info).await?;
6751 let response = result?;
6752 match response.status().as_u16() {
6753 200u16 => ResponseValue::from_response(response).await,
6754 422u16 => Err(Error::ErrorResponse(
6755 ResponseValue::from_response(response).await?,
6756 )),
6757 _ => Err(Error::UnexpectedResponse(response)),
6758 }
6759 }
6760
6761 #[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 > , >{
6762 let url = format!(
6763 "{}/v2/sandbox/usercollection/ring_battery_level",
6764 self.baseurl,
6765 );
6766 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6767 header_map.append(
6768 ::reqwest::header::HeaderName::from_static("api-version"),
6769 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6770 );
6771 #[allow(unused_mut)]
6772 let mut request = self
6773 .client
6774 .get(url)
6775 .header(
6776 ::reqwest::header::ACCEPT,
6777 ::reqwest::header::HeaderValue::from_static("application/json"),
6778 )
6779 .query(&progenitor_client::QueryParam::new(
6780 "end_datetime",
6781 &end_datetime,
6782 ))
6783 .query(&progenitor_client::QueryParam::new(
6784 "next_token",
6785 &next_token,
6786 ))
6787 .query(&progenitor_client::QueryParam::new(
6788 "start_datetime",
6789 &start_datetime,
6790 ))
6791 .headers(header_map)
6792 .build()?;
6793 let info = OperationInfo { operation_id : "sandbox_multiple_ring_battery_level_documents_v2_sandbox_usercollection_ring_battery_level_get" , } ;
6794 self.pre(&mut request, &info).await?;
6795 let result = self.exec(request, &info).await;
6796 self.post(&result, &info).await?;
6797 let response = result?;
6798 match response.status().as_u16() {
6799 200u16 => ResponseValue::from_response(response).await,
6800 422u16 => Err(Error::ErrorResponse(
6801 ResponseValue::from_response(response).await?,
6802 )),
6803 _ => Err(Error::UnexpectedResponse(response)),
6804 }
6805 }
6806
6807 #[doc = "Sandbox - Multiple Ring Configuration Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/ring_configuration`\n\n"]
6808 pub async fn sandbox_multiple_ring_configuration_documents_v2_sandbox_usercollection_ring_configuration_get<
6809 'a,
6810 >(
6811 &'a self,
6812 next_token: Option<&'a str>,
6813 ) -> Result<
6814 ResponseValue<types::MultiDocumentResponsePublicRingConfiguration>,
6815 Error<types::HttpValidationError>,
6816 > {
6817 let url = format!(
6818 "{}/v2/sandbox/usercollection/ring_configuration",
6819 self.baseurl,
6820 );
6821 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6822 header_map.append(
6823 ::reqwest::header::HeaderName::from_static("api-version"),
6824 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6825 );
6826 #[allow(unused_mut)]
6827 let mut request = self
6828 .client
6829 .get(url)
6830 .header(
6831 ::reqwest::header::ACCEPT,
6832 ::reqwest::header::HeaderValue::from_static("application/json"),
6833 )
6834 .query(&progenitor_client::QueryParam::new(
6835 "next_token",
6836 &next_token,
6837 ))
6838 .headers(header_map)
6839 .build()?;
6840 let info = OperationInfo { operation_id : "sandbox_multiple_ring_configuration_documents_v2_sandbox_usercollection_ring_configuration_get" , } ;
6841 self.pre(&mut request, &info).await?;
6842 let result = self.exec(request, &info).await;
6843 self.post(&result, &info).await?;
6844 let response = result?;
6845 match response.status().as_u16() {
6846 200u16 => ResponseValue::from_response(response).await,
6847 422u16 => Err(Error::ErrorResponse(
6848 ResponseValue::from_response(response).await?,
6849 )),
6850 _ => Err(Error::UnexpectedResponse(response)),
6851 }
6852 }
6853
6854 #[doc = "Sandbox - Single Ring Configuration Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/ring_configuration/{document_id}`\n\n"]
6855 pub async fn sandbox_single_ring_configuration_document_v2_sandbox_usercollection_ring_configuration_document_id_get<
6856 'a,
6857 >(
6858 &'a self,
6859 document_id: &'a str,
6860 ) -> Result<ResponseValue<types::PublicRingConfiguration>, Error<types::HttpValidationError>>
6861 {
6862 let url = format!(
6863 "{}/v2/sandbox/usercollection/ring_configuration/{}",
6864 self.baseurl,
6865 encode_path(&document_id.to_string()),
6866 );
6867 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6868 header_map.append(
6869 ::reqwest::header::HeaderName::from_static("api-version"),
6870 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6871 );
6872 #[allow(unused_mut)]
6873 let mut request = self
6874 .client
6875 .get(url)
6876 .header(
6877 ::reqwest::header::ACCEPT,
6878 ::reqwest::header::HeaderValue::from_static("application/json"),
6879 )
6880 .headers(header_map)
6881 .build()?;
6882 let info = OperationInfo { operation_id : "sandbox_single_ring_configuration_document_v2_sandbox_usercollection_ring_configuration_document_id_get" , } ;
6883 self.pre(&mut request, &info).await?;
6884 let result = self.exec(request, &info).await;
6885 self.post(&result, &info).await?;
6886 let response = result?;
6887 match response.status().as_u16() {
6888 200u16 => ResponseValue::from_response(response).await,
6889 422u16 => Err(Error::ErrorResponse(
6890 ResponseValue::from_response(response).await?,
6891 )),
6892 _ => Err(Error::UnexpectedResponse(response)),
6893 }
6894 }
6895
6896 #[doc = "Sandbox - Multiple Session Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/session`\n\n"]
6897 pub async fn sandbox_multiple_session_documents_v2_sandbox_usercollection_session_get<'a>(
6898 &'a self,
6899 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6900 next_token: Option<&'a str>,
6901 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6902 ) -> Result<
6903 ResponseValue<types::MultiDocumentResponsePublicSession>,
6904 Error<types::HttpValidationError>,
6905 > {
6906 let url = format!("{}/v2/sandbox/usercollection/session", self.baseurl,);
6907 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6908 header_map.append(
6909 ::reqwest::header::HeaderName::from_static("api-version"),
6910 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6911 );
6912 #[allow(unused_mut)]
6913 let mut request = self
6914 .client
6915 .get(url)
6916 .header(
6917 ::reqwest::header::ACCEPT,
6918 ::reqwest::header::HeaderValue::from_static("application/json"),
6919 )
6920 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
6921 .query(&progenitor_client::QueryParam::new(
6922 "next_token",
6923 &next_token,
6924 ))
6925 .query(&progenitor_client::QueryParam::new(
6926 "start_date",
6927 &start_date,
6928 ))
6929 .headers(header_map)
6930 .build()?;
6931 let info = OperationInfo {
6932 operation_id:
6933 "sandbox_multiple_session_documents_v2_sandbox_usercollection_session_get",
6934 };
6935 self.pre(&mut request, &info).await?;
6936 let result = self.exec(request, &info).await;
6937 self.post(&result, &info).await?;
6938 let response = result?;
6939 match response.status().as_u16() {
6940 200u16 => ResponseValue::from_response(response).await,
6941 422u16 => Err(Error::ErrorResponse(
6942 ResponseValue::from_response(response).await?,
6943 )),
6944 _ => Err(Error::UnexpectedResponse(response)),
6945 }
6946 }
6947
6948 #[doc = "Sandbox - Single Session Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/session/{document_id}`\n\n"]
6949 pub async fn sandbox_single_session_document_v2_sandbox_usercollection_session_document_id_get<
6950 'a,
6951 >(
6952 &'a self,
6953 document_id: &'a str,
6954 ) -> Result<ResponseValue<types::PublicSession>, Error<types::HttpValidationError>> {
6955 let url = format!(
6956 "{}/v2/sandbox/usercollection/session/{}",
6957 self.baseurl,
6958 encode_path(&document_id.to_string()),
6959 );
6960 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6961 header_map.append(
6962 ::reqwest::header::HeaderName::from_static("api-version"),
6963 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6964 );
6965 #[allow(unused_mut)]
6966 let mut request = self
6967 .client
6968 .get(url)
6969 .header(
6970 ::reqwest::header::ACCEPT,
6971 ::reqwest::header::HeaderValue::from_static("application/json"),
6972 )
6973 .headers(header_map)
6974 .build()?;
6975 let info = OperationInfo {
6976 operation_id:
6977 "sandbox_single_session_document_v2_sandbox_usercollection_session_document_id_get",
6978 };
6979 self.pre(&mut request, &info).await?;
6980 let result = self.exec(request, &info).await;
6981 self.post(&result, &info).await?;
6982 let response = result?;
6983 match response.status().as_u16() {
6984 200u16 => ResponseValue::from_response(response).await,
6985 422u16 => Err(Error::ErrorResponse(
6986 ResponseValue::from_response(response).await?,
6987 )),
6988 _ => Err(Error::UnexpectedResponse(response)),
6989 }
6990 }
6991
6992 #[doc = "Sandbox - Multiple Sleep Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/sleep`\n\n"]
6993 pub async fn sandbox_multiple_sleep_documents_v2_sandbox_usercollection_sleep_get<'a>(
6994 &'a self,
6995 end_date: Option<&'a ::chrono::naive::NaiveDate>,
6996 next_token: Option<&'a str>,
6997 start_date: Option<&'a ::chrono::naive::NaiveDate>,
6998 ) -> Result<
6999 ResponseValue<types::MultiDocumentResponsePublicModifiedSleepModel>,
7000 Error<types::HttpValidationError>,
7001 > {
7002 let url = format!("{}/v2/sandbox/usercollection/sleep", self.baseurl,);
7003 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7004 header_map.append(
7005 ::reqwest::header::HeaderName::from_static("api-version"),
7006 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7007 );
7008 #[allow(unused_mut)]
7009 let mut request = self
7010 .client
7011 .get(url)
7012 .header(
7013 ::reqwest::header::ACCEPT,
7014 ::reqwest::header::HeaderValue::from_static("application/json"),
7015 )
7016 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7017 .query(&progenitor_client::QueryParam::new(
7018 "next_token",
7019 &next_token,
7020 ))
7021 .query(&progenitor_client::QueryParam::new(
7022 "start_date",
7023 &start_date,
7024 ))
7025 .headers(header_map)
7026 .build()?;
7027 let info = OperationInfo {
7028 operation_id: "sandbox_multiple_sleep_documents_v2_sandbox_usercollection_sleep_get",
7029 };
7030 self.pre(&mut request, &info).await?;
7031 let result = self.exec(request, &info).await;
7032 self.post(&result, &info).await?;
7033 let response = result?;
7034 match response.status().as_u16() {
7035 200u16 => ResponseValue::from_response(response).await,
7036 422u16 => Err(Error::ErrorResponse(
7037 ResponseValue::from_response(response).await?,
7038 )),
7039 _ => Err(Error::UnexpectedResponse(response)),
7040 }
7041 }
7042
7043 #[doc = "Sandbox - Single Sleep Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/sleep/{document_id}`\n\n"]
7044 pub async fn sandbox_single_sleep_document_v2_sandbox_usercollection_sleep_document_id_get<
7045 'a,
7046 >(
7047 &'a self,
7048 document_id: &'a str,
7049 ) -> Result<ResponseValue<types::PublicModifiedSleepModel>, Error<types::HttpValidationError>>
7050 {
7051 let url = format!(
7052 "{}/v2/sandbox/usercollection/sleep/{}",
7053 self.baseurl,
7054 encode_path(&document_id.to_string()),
7055 );
7056 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7057 header_map.append(
7058 ::reqwest::header::HeaderName::from_static("api-version"),
7059 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7060 );
7061 #[allow(unused_mut)]
7062 let mut request = self
7063 .client
7064 .get(url)
7065 .header(
7066 ::reqwest::header::ACCEPT,
7067 ::reqwest::header::HeaderValue::from_static("application/json"),
7068 )
7069 .headers(header_map)
7070 .build()?;
7071 let info = OperationInfo {
7072 operation_id:
7073 "sandbox_single_sleep_document_v2_sandbox_usercollection_sleep_document_id_get",
7074 };
7075 self.pre(&mut request, &info).await?;
7076 let result = self.exec(request, &info).await;
7077 self.post(&result, &info).await?;
7078 let response = result?;
7079 match response.status().as_u16() {
7080 200u16 => ResponseValue::from_response(response).await,
7081 422u16 => Err(Error::ErrorResponse(
7082 ResponseValue::from_response(response).await?,
7083 )),
7084 _ => Err(Error::UnexpectedResponse(response)),
7085 }
7086 }
7087
7088 #[doc = "Sandbox - Multiple Sleep Time Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/sleep_time`\n\n"]
7089 pub async fn sandbox_multiple_sleep_time_documents_v2_sandbox_usercollection_sleep_time_get<
7090 'a,
7091 >(
7092 &'a self,
7093 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7094 next_token: Option<&'a str>,
7095 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7096 ) -> Result<
7097 ResponseValue<types::MultiDocumentResponsePublicSleepTime>,
7098 Error<types::HttpValidationError>,
7099 > {
7100 let url = format!("{}/v2/sandbox/usercollection/sleep_time", self.baseurl,);
7101 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7102 header_map.append(
7103 ::reqwest::header::HeaderName::from_static("api-version"),
7104 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7105 );
7106 #[allow(unused_mut)]
7107 let mut request = self
7108 .client
7109 .get(url)
7110 .header(
7111 ::reqwest::header::ACCEPT,
7112 ::reqwest::header::HeaderValue::from_static("application/json"),
7113 )
7114 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7115 .query(&progenitor_client::QueryParam::new(
7116 "next_token",
7117 &next_token,
7118 ))
7119 .query(&progenitor_client::QueryParam::new(
7120 "start_date",
7121 &start_date,
7122 ))
7123 .headers(header_map)
7124 .build()?;
7125 let info = OperationInfo {
7126 operation_id:
7127 "sandbox_multiple_sleep_time_documents_v2_sandbox_usercollection_sleep_time_get",
7128 };
7129 self.pre(&mut request, &info).await?;
7130 let result = self.exec(request, &info).await;
7131 self.post(&result, &info).await?;
7132 let response = result?;
7133 match response.status().as_u16() {
7134 200u16 => ResponseValue::from_response(response).await,
7135 422u16 => Err(Error::ErrorResponse(
7136 ResponseValue::from_response(response).await?,
7137 )),
7138 _ => Err(Error::UnexpectedResponse(response)),
7139 }
7140 }
7141
7142 #[doc = "Sandbox - Single Sleep Time Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/sleep_time/{document_id}`\n\n"]
7143 pub async fn sandbox_single_sleep_time_document_v2_sandbox_usercollection_sleep_time_document_id_get<
7144 'a,
7145 >(
7146 &'a self,
7147 document_id: &'a str,
7148 ) -> Result<ResponseValue<types::PublicSleepTime>, Error<types::HttpValidationError>> {
7149 let url = format!(
7150 "{}/v2/sandbox/usercollection/sleep_time/{}",
7151 self.baseurl,
7152 encode_path(&document_id.to_string()),
7153 );
7154 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7155 header_map.append(
7156 ::reqwest::header::HeaderName::from_static("api-version"),
7157 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7158 );
7159 #[allow(unused_mut)]
7160 let mut request = self
7161 .client
7162 .get(url)
7163 .header(
7164 ::reqwest::header::ACCEPT,
7165 ::reqwest::header::HeaderValue::from_static("application/json"),
7166 )
7167 .headers(header_map)
7168 .build()?;
7169 let info = OperationInfo { operation_id : "sandbox_single_sleep_time_document_v2_sandbox_usercollection_sleep_time_document_id_get" , } ;
7170 self.pre(&mut request, &info).await?;
7171 let result = self.exec(request, &info).await;
7172 self.post(&result, &info).await?;
7173 let response = result?;
7174 match response.status().as_u16() {
7175 200u16 => ResponseValue::from_response(response).await,
7176 422u16 => Err(Error::ErrorResponse(
7177 ResponseValue::from_response(response).await?,
7178 )),
7179 _ => Err(Error::UnexpectedResponse(response)),
7180 }
7181 }
7182
7183 #[doc = "Sandbox - Multiple Tag Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/tag`\n\n"]
7184 pub async fn sandbox_multiple_tag_documents_v2_sandbox_usercollection_tag_get<'a>(
7185 &'a self,
7186 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7187 next_token: Option<&'a str>,
7188 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7189 ) -> Result<
7190 ResponseValue<types::MultiDocumentResponseTagModel>,
7191 Error<types::HttpValidationError>,
7192 > {
7193 let url = format!("{}/v2/sandbox/usercollection/tag", self.baseurl,);
7194 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7195 header_map.append(
7196 ::reqwest::header::HeaderName::from_static("api-version"),
7197 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7198 );
7199 #[allow(unused_mut)]
7200 let mut request = self
7201 .client
7202 .get(url)
7203 .header(
7204 ::reqwest::header::ACCEPT,
7205 ::reqwest::header::HeaderValue::from_static("application/json"),
7206 )
7207 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7208 .query(&progenitor_client::QueryParam::new(
7209 "next_token",
7210 &next_token,
7211 ))
7212 .query(&progenitor_client::QueryParam::new(
7213 "start_date",
7214 &start_date,
7215 ))
7216 .headers(header_map)
7217 .build()?;
7218 let info = OperationInfo {
7219 operation_id: "sandbox_multiple_tag_documents_v2_sandbox_usercollection_tag_get",
7220 };
7221 self.pre(&mut request, &info).await?;
7222 let result = self.exec(request, &info).await;
7223 self.post(&result, &info).await?;
7224 let response = result?;
7225 match response.status().as_u16() {
7226 200u16 => ResponseValue::from_response(response).await,
7227 422u16 => Err(Error::ErrorResponse(
7228 ResponseValue::from_response(response).await?,
7229 )),
7230 _ => Err(Error::UnexpectedResponse(response)),
7231 }
7232 }
7233
7234 #[doc = "Sandbox - Single Tag Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/tag/{document_id}`\n\n"]
7235 pub async fn sandbox_single_tag_document_v2_sandbox_usercollection_tag_document_id_get<'a>(
7236 &'a self,
7237 document_id: &'a str,
7238 ) -> Result<ResponseValue<types::TagModel>, Error<types::HttpValidationError>> {
7239 let url = format!(
7240 "{}/v2/sandbox/usercollection/tag/{}",
7241 self.baseurl,
7242 encode_path(&document_id.to_string()),
7243 );
7244 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7245 header_map.append(
7246 ::reqwest::header::HeaderName::from_static("api-version"),
7247 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7248 );
7249 #[allow(unused_mut)]
7250 let mut request = self
7251 .client
7252 .get(url)
7253 .header(
7254 ::reqwest::header::ACCEPT,
7255 ::reqwest::header::HeaderValue::from_static("application/json"),
7256 )
7257 .headers(header_map)
7258 .build()?;
7259 let info = OperationInfo {
7260 operation_id:
7261 "sandbox_single_tag_document_v2_sandbox_usercollection_tag_document_id_get",
7262 };
7263 self.pre(&mut request, &info).await?;
7264 let result = self.exec(request, &info).await;
7265 self.post(&result, &info).await?;
7266 let response = result?;
7267 match response.status().as_u16() {
7268 200u16 => ResponseValue::from_response(response).await,
7269 422u16 => Err(Error::ErrorResponse(
7270 ResponseValue::from_response(response).await?,
7271 )),
7272 _ => Err(Error::UnexpectedResponse(response)),
7273 }
7274 }
7275
7276 #[doc = "Sandbox - Multiple Vo2 Max Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/vO2_max`\n\n"]
7277 pub async fn sandbox_multiple_v_o2_max_documents_v2_sandbox_usercollection_v_o2_max_get<'a>(
7278 &'a self,
7279 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7280 next_token: Option<&'a str>,
7281 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7282 ) -> Result<
7283 ResponseValue<types::MultiDocumentResponsePublicVo2Max>,
7284 Error<types::HttpValidationError>,
7285 > {
7286 let url = format!("{}/v2/sandbox/usercollection/vO2_max", self.baseurl,);
7287 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7288 header_map.append(
7289 ::reqwest::header::HeaderName::from_static("api-version"),
7290 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7291 );
7292 #[allow(unused_mut)]
7293 let mut request = self
7294 .client
7295 .get(url)
7296 .header(
7297 ::reqwest::header::ACCEPT,
7298 ::reqwest::header::HeaderValue::from_static("application/json"),
7299 )
7300 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7301 .query(&progenitor_client::QueryParam::new(
7302 "next_token",
7303 &next_token,
7304 ))
7305 .query(&progenitor_client::QueryParam::new(
7306 "start_date",
7307 &start_date,
7308 ))
7309 .headers(header_map)
7310 .build()?;
7311 let info = OperationInfo {
7312 operation_id:
7313 "sandbox_multiple_v_o2_max_documents_v2_sandbox_usercollection_v_o2_max_get",
7314 };
7315 self.pre(&mut request, &info).await?;
7316 let result = self.exec(request, &info).await;
7317 self.post(&result, &info).await?;
7318 let response = result?;
7319 match response.status().as_u16() {
7320 200u16 => ResponseValue::from_response(response).await,
7321 422u16 => Err(Error::ErrorResponse(
7322 ResponseValue::from_response(response).await?,
7323 )),
7324 _ => Err(Error::UnexpectedResponse(response)),
7325 }
7326 }
7327
7328 #[doc = "Sandbox - Single Vo2 Max Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/vO2_max/{document_id}`\n\n"]
7329 pub async fn sandbox_single_v_o2_max_document_v2_sandbox_usercollection_v_o2_max_document_id_get<
7330 'a,
7331 >(
7332 &'a self,
7333 document_id: &'a str,
7334 ) -> Result<ResponseValue<types::PublicVo2Max>, Error<types::HttpValidationError>> {
7335 let url = format!(
7336 "{}/v2/sandbox/usercollection/vO2_max/{}",
7337 self.baseurl,
7338 encode_path(&document_id.to_string()),
7339 );
7340 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7341 header_map.append(
7342 ::reqwest::header::HeaderName::from_static("api-version"),
7343 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7344 );
7345 #[allow(unused_mut)]
7346 let mut request = self
7347 .client
7348 .get(url)
7349 .header(
7350 ::reqwest::header::ACCEPT,
7351 ::reqwest::header::HeaderValue::from_static("application/json"),
7352 )
7353 .headers(header_map)
7354 .build()?;
7355 let info = OperationInfo { operation_id : "sandbox_single_v_o2_max_document_v2_sandbox_usercollection_v_o2_max_document_id_get" , } ;
7356 self.pre(&mut request, &info).await?;
7357 let result = self.exec(request, &info).await;
7358 self.post(&result, &info).await?;
7359 let response = result?;
7360 match response.status().as_u16() {
7361 200u16 => ResponseValue::from_response(response).await,
7362 422u16 => Err(Error::ErrorResponse(
7363 ResponseValue::from_response(response).await?,
7364 )),
7365 _ => Err(Error::UnexpectedResponse(response)),
7366 }
7367 }
7368
7369 #[doc = "Sandbox - Multiple Workout Documents\n\nSends a `GET` request to `/v2/sandbox/usercollection/workout`\n\n"]
7370 pub async fn sandbox_multiple_workout_documents_v2_sandbox_usercollection_workout_get<'a>(
7371 &'a self,
7372 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7373 next_token: Option<&'a str>,
7374 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7375 ) -> Result<
7376 ResponseValue<types::MultiDocumentResponsePublicWorkout>,
7377 Error<types::HttpValidationError>,
7378 > {
7379 let url = format!("{}/v2/sandbox/usercollection/workout", self.baseurl,);
7380 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7381 header_map.append(
7382 ::reqwest::header::HeaderName::from_static("api-version"),
7383 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7384 );
7385 #[allow(unused_mut)]
7386 let mut request = self
7387 .client
7388 .get(url)
7389 .header(
7390 ::reqwest::header::ACCEPT,
7391 ::reqwest::header::HeaderValue::from_static("application/json"),
7392 )
7393 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7394 .query(&progenitor_client::QueryParam::new(
7395 "next_token",
7396 &next_token,
7397 ))
7398 .query(&progenitor_client::QueryParam::new(
7399 "start_date",
7400 &start_date,
7401 ))
7402 .headers(header_map)
7403 .build()?;
7404 let info = OperationInfo {
7405 operation_id:
7406 "sandbox_multiple_workout_documents_v2_sandbox_usercollection_workout_get",
7407 };
7408 self.pre(&mut request, &info).await?;
7409 let result = self.exec(request, &info).await;
7410 self.post(&result, &info).await?;
7411 let response = result?;
7412 match response.status().as_u16() {
7413 200u16 => ResponseValue::from_response(response).await,
7414 422u16 => Err(Error::ErrorResponse(
7415 ResponseValue::from_response(response).await?,
7416 )),
7417 _ => Err(Error::UnexpectedResponse(response)),
7418 }
7419 }
7420
7421 #[doc = "Sandbox - Single Workout Document\n\nSends a `GET` request to `/v2/sandbox/usercollection/workout/{document_id}`\n\n"]
7422 pub async fn sandbox_single_workout_document_v2_sandbox_usercollection_workout_document_id_get<
7423 'a,
7424 >(
7425 &'a self,
7426 document_id: &'a str,
7427 ) -> Result<ResponseValue<types::PublicWorkout>, Error<types::HttpValidationError>> {
7428 let url = format!(
7429 "{}/v2/sandbox/usercollection/workout/{}",
7430 self.baseurl,
7431 encode_path(&document_id.to_string()),
7432 );
7433 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7434 header_map.append(
7435 ::reqwest::header::HeaderName::from_static("api-version"),
7436 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7437 );
7438 #[allow(unused_mut)]
7439 let mut request = self
7440 .client
7441 .get(url)
7442 .header(
7443 ::reqwest::header::ACCEPT,
7444 ::reqwest::header::HeaderValue::from_static("application/json"),
7445 )
7446 .headers(header_map)
7447 .build()?;
7448 let info = OperationInfo {
7449 operation_id:
7450 "sandbox_single_workout_document_v2_sandbox_usercollection_workout_document_id_get",
7451 };
7452 self.pre(&mut request, &info).await?;
7453 let result = self.exec(request, &info).await;
7454 self.post(&result, &info).await?;
7455 let response = result?;
7456 match response.status().as_u16() {
7457 200u16 => ResponseValue::from_response(response).await,
7458 422u16 => Err(Error::ErrorResponse(
7459 ResponseValue::from_response(response).await?,
7460 )),
7461 _ => Err(Error::UnexpectedResponse(response)),
7462 }
7463 }
7464
7465 #[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"]
7466 pub async fn multiple_daily_activity_documents_v2_usercollection_daily_activity_get<'a>(
7467 &'a self,
7468 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7469 fields: Option<&'a str>,
7470 next_token: Option<&'a str>,
7471 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7472 ) -> Result<
7473 ResponseValue<types::MultiDocumentResponsePublicDailyActivity>,
7474 Error<types::HttpValidationError>,
7475 > {
7476 let url = format!("{}/v2/usercollection/daily_activity", self.baseurl,);
7477 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7478 header_map.append(
7479 ::reqwest::header::HeaderName::from_static("api-version"),
7480 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7481 );
7482 #[allow(unused_mut)]
7483 let mut request = self
7484 .client
7485 .get(url)
7486 .header(
7487 ::reqwest::header::ACCEPT,
7488 ::reqwest::header::HeaderValue::from_static("application/json"),
7489 )
7490 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7491 .query(&progenitor_client::QueryParam::new("fields", &fields))
7492 .query(&progenitor_client::QueryParam::new(
7493 "next_token",
7494 &next_token,
7495 ))
7496 .query(&progenitor_client::QueryParam::new(
7497 "start_date",
7498 &start_date,
7499 ))
7500 .headers(header_map)
7501 .build()?;
7502 let info = OperationInfo {
7503 operation_id: "multiple_daily_activity_documents_v2_usercollection_daily_activity_get",
7504 };
7505 self.pre(&mut request, &info).await?;
7506 let result = self.exec(request, &info).await;
7507 self.post(&result, &info).await?;
7508 let response = result?;
7509 match response.status().as_u16() {
7510 200u16 => ResponseValue::from_response(response).await,
7511 422u16 => Err(Error::ErrorResponse(
7512 ResponseValue::from_response(response).await?,
7513 )),
7514 _ => Err(Error::UnexpectedResponse(response)),
7515 }
7516 }
7517
7518 #[doc = "Single Daily Activity Document\n\nSends a `GET` request to `/v2/usercollection/daily_activity/{document_id}`\n\n"]
7519 pub async fn single_daily_activity_document_v2_usercollection_daily_activity_document_id_get<
7520 'a,
7521 >(
7522 &'a self,
7523 document_id: &'a str,
7524 ) -> Result<ResponseValue<types::PublicDailyActivity>, Error<types::HttpValidationError>> {
7525 let url = format!(
7526 "{}/v2/usercollection/daily_activity/{}",
7527 self.baseurl,
7528 encode_path(&document_id.to_string()),
7529 );
7530 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7531 header_map.append(
7532 ::reqwest::header::HeaderName::from_static("api-version"),
7533 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7534 );
7535 #[allow(unused_mut)]
7536 let mut request = self
7537 .client
7538 .get(url)
7539 .header(
7540 ::reqwest::header::ACCEPT,
7541 ::reqwest::header::HeaderValue::from_static("application/json"),
7542 )
7543 .headers(header_map)
7544 .build()?;
7545 let info = OperationInfo {
7546 operation_id:
7547 "single_daily_activity_document_v2_usercollection_daily_activity_document_id_get",
7548 };
7549 self.pre(&mut request, &info).await?;
7550 let result = self.exec(request, &info).await;
7551 self.post(&result, &info).await?;
7552 let response = result?;
7553 match response.status().as_u16() {
7554 200u16 => ResponseValue::from_response(response).await,
7555 422u16 => Err(Error::ErrorResponse(
7556 ResponseValue::from_response(response).await?,
7557 )),
7558 _ => Err(Error::UnexpectedResponse(response)),
7559 }
7560 }
7561
7562 #[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"]
7563 pub async fn multiple_daily_cardiovascular_age_documents_v2_usercollection_daily_cardiovascular_age_get<
7564 'a,
7565 >(
7566 &'a self,
7567 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7568 fields: Option<&'a str>,
7569 next_token: Option<&'a str>,
7570 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7571 ) -> Result<
7572 ResponseValue<types::MultiDocumentResponsePublicDailyCardiovascularAge>,
7573 Error<types::HttpValidationError>,
7574 > {
7575 let url = format!(
7576 "{}/v2/usercollection/daily_cardiovascular_age",
7577 self.baseurl,
7578 );
7579 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7580 header_map.append(
7581 ::reqwest::header::HeaderName::from_static("api-version"),
7582 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7583 );
7584 #[allow(unused_mut)]
7585 let mut request = self
7586 .client
7587 .get(url)
7588 .header(
7589 ::reqwest::header::ACCEPT,
7590 ::reqwest::header::HeaderValue::from_static("application/json"),
7591 )
7592 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7593 .query(&progenitor_client::QueryParam::new("fields", &fields))
7594 .query(&progenitor_client::QueryParam::new(
7595 "next_token",
7596 &next_token,
7597 ))
7598 .query(&progenitor_client::QueryParam::new(
7599 "start_date",
7600 &start_date,
7601 ))
7602 .headers(header_map)
7603 .build()?;
7604 let info = OperationInfo { operation_id : "multiple_daily_cardiovascular_age_documents_v2_usercollection_daily_cardiovascular_age_get" , } ;
7605 self.pre(&mut request, &info).await?;
7606 let result = self.exec(request, &info).await;
7607 self.post(&result, &info).await?;
7608 let response = result?;
7609 match response.status().as_u16() {
7610 200u16 => ResponseValue::from_response(response).await,
7611 422u16 => Err(Error::ErrorResponse(
7612 ResponseValue::from_response(response).await?,
7613 )),
7614 _ => Err(Error::UnexpectedResponse(response)),
7615 }
7616 }
7617
7618 #[doc = "Single Daily Cardiovascular Age Document\n\nSends a `GET` request to `/v2/usercollection/daily_cardiovascular_age/{document_id}`\n\n"]
7619 pub async fn single_daily_cardiovascular_age_document_v2_usercollection_daily_cardiovascular_age_document_id_get<
7620 'a,
7621 >(
7622 &'a self,
7623 document_id: &'a str,
7624 ) -> Result<ResponseValue<types::PublicDailyCardiovascularAge>, Error<types::HttpValidationError>>
7625 {
7626 let url = format!(
7627 "{}/v2/usercollection/daily_cardiovascular_age/{}",
7628 self.baseurl,
7629 encode_path(&document_id.to_string()),
7630 );
7631 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7632 header_map.append(
7633 ::reqwest::header::HeaderName::from_static("api-version"),
7634 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7635 );
7636 #[allow(unused_mut)]
7637 let mut request = self
7638 .client
7639 .get(url)
7640 .header(
7641 ::reqwest::header::ACCEPT,
7642 ::reqwest::header::HeaderValue::from_static("application/json"),
7643 )
7644 .headers(header_map)
7645 .build()?;
7646 let info = OperationInfo { operation_id : "single_daily_cardiovascular_age_document_v2_usercollection_daily_cardiovascular_age_document_id_get" , } ;
7647 self.pre(&mut request, &info).await?;
7648 let result = self.exec(request, &info).await;
7649 self.post(&result, &info).await?;
7650 let response = result?;
7651 match response.status().as_u16() {
7652 200u16 => ResponseValue::from_response(response).await,
7653 422u16 => Err(Error::ErrorResponse(
7654 ResponseValue::from_response(response).await?,
7655 )),
7656 _ => Err(Error::UnexpectedResponse(response)),
7657 }
7658 }
7659
7660 #[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"]
7661 pub async fn multiple_daily_readiness_documents_v2_usercollection_daily_readiness_get<'a>(
7662 &'a self,
7663 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7664 fields: Option<&'a str>,
7665 next_token: Option<&'a str>,
7666 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7667 ) -> Result<
7668 ResponseValue<types::MultiDocumentResponsePublicDailyReadiness>,
7669 Error<types::HttpValidationError>,
7670 > {
7671 let url = format!("{}/v2/usercollection/daily_readiness", self.baseurl,);
7672 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7673 header_map.append(
7674 ::reqwest::header::HeaderName::from_static("api-version"),
7675 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7676 );
7677 #[allow(unused_mut)]
7678 let mut request = self
7679 .client
7680 .get(url)
7681 .header(
7682 ::reqwest::header::ACCEPT,
7683 ::reqwest::header::HeaderValue::from_static("application/json"),
7684 )
7685 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7686 .query(&progenitor_client::QueryParam::new("fields", &fields))
7687 .query(&progenitor_client::QueryParam::new(
7688 "next_token",
7689 &next_token,
7690 ))
7691 .query(&progenitor_client::QueryParam::new(
7692 "start_date",
7693 &start_date,
7694 ))
7695 .headers(header_map)
7696 .build()?;
7697 let info = OperationInfo {
7698 operation_id:
7699 "multiple_daily_readiness_documents_v2_usercollection_daily_readiness_get",
7700 };
7701 self.pre(&mut request, &info).await?;
7702 let result = self.exec(request, &info).await;
7703 self.post(&result, &info).await?;
7704 let response = result?;
7705 match response.status().as_u16() {
7706 200u16 => ResponseValue::from_response(response).await,
7707 422u16 => Err(Error::ErrorResponse(
7708 ResponseValue::from_response(response).await?,
7709 )),
7710 _ => Err(Error::UnexpectedResponse(response)),
7711 }
7712 }
7713
7714 #[doc = "Single Daily Readiness Document\n\nSends a `GET` request to `/v2/usercollection/daily_readiness/{document_id}`\n\n"]
7715 pub async fn single_daily_readiness_document_v2_usercollection_daily_readiness_document_id_get<
7716 'a,
7717 >(
7718 &'a self,
7719 document_id: &'a str,
7720 ) -> Result<ResponseValue<types::PublicDailyReadiness>, Error<types::HttpValidationError>> {
7721 let url = format!(
7722 "{}/v2/usercollection/daily_readiness/{}",
7723 self.baseurl,
7724 encode_path(&document_id.to_string()),
7725 );
7726 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7727 header_map.append(
7728 ::reqwest::header::HeaderName::from_static("api-version"),
7729 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7730 );
7731 #[allow(unused_mut)]
7732 let mut request = self
7733 .client
7734 .get(url)
7735 .header(
7736 ::reqwest::header::ACCEPT,
7737 ::reqwest::header::HeaderValue::from_static("application/json"),
7738 )
7739 .headers(header_map)
7740 .build()?;
7741 let info = OperationInfo {
7742 operation_id:
7743 "single_daily_readiness_document_v2_usercollection_daily_readiness_document_id_get",
7744 };
7745 self.pre(&mut request, &info).await?;
7746 let result = self.exec(request, &info).await;
7747 self.post(&result, &info).await?;
7748 let response = result?;
7749 match response.status().as_u16() {
7750 200u16 => ResponseValue::from_response(response).await,
7751 422u16 => Err(Error::ErrorResponse(
7752 ResponseValue::from_response(response).await?,
7753 )),
7754 _ => Err(Error::UnexpectedResponse(response)),
7755 }
7756 }
7757
7758 #[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"]
7759 pub async fn multiple_daily_resilience_documents_v2_usercollection_daily_resilience_get<'a>(
7760 &'a self,
7761 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7762 fields: Option<&'a str>,
7763 next_token: Option<&'a str>,
7764 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7765 ) -> Result<
7766 ResponseValue<types::MultiDocumentResponseDailyResilienceModel>,
7767 Error<types::HttpValidationError>,
7768 > {
7769 let url = format!("{}/v2/usercollection/daily_resilience", self.baseurl,);
7770 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7771 header_map.append(
7772 ::reqwest::header::HeaderName::from_static("api-version"),
7773 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7774 );
7775 #[allow(unused_mut)]
7776 let mut request = self
7777 .client
7778 .get(url)
7779 .header(
7780 ::reqwest::header::ACCEPT,
7781 ::reqwest::header::HeaderValue::from_static("application/json"),
7782 )
7783 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7784 .query(&progenitor_client::QueryParam::new("fields", &fields))
7785 .query(&progenitor_client::QueryParam::new(
7786 "next_token",
7787 &next_token,
7788 ))
7789 .query(&progenitor_client::QueryParam::new(
7790 "start_date",
7791 &start_date,
7792 ))
7793 .headers(header_map)
7794 .build()?;
7795 let info = OperationInfo {
7796 operation_id:
7797 "multiple_daily_resilience_documents_v2_usercollection_daily_resilience_get",
7798 };
7799 self.pre(&mut request, &info).await?;
7800 let result = self.exec(request, &info).await;
7801 self.post(&result, &info).await?;
7802 let response = result?;
7803 match response.status().as_u16() {
7804 200u16 => ResponseValue::from_response(response).await,
7805 422u16 => Err(Error::ErrorResponse(
7806 ResponseValue::from_response(response).await?,
7807 )),
7808 _ => Err(Error::UnexpectedResponse(response)),
7809 }
7810 }
7811
7812 #[doc = "Single Daily Resilience Document\n\nSends a `GET` request to `/v2/usercollection/daily_resilience/{document_id}`\n\n"]
7813 pub async fn single_daily_resilience_document_v2_usercollection_daily_resilience_document_id_get<
7814 'a,
7815 >(
7816 &'a self,
7817 document_id: &'a str,
7818 ) -> Result<ResponseValue<types::DailyResilienceModel>, Error<types::HttpValidationError>> {
7819 let url = format!(
7820 "{}/v2/usercollection/daily_resilience/{}",
7821 self.baseurl,
7822 encode_path(&document_id.to_string()),
7823 );
7824 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7825 header_map.append(
7826 ::reqwest::header::HeaderName::from_static("api-version"),
7827 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7828 );
7829 #[allow(unused_mut)]
7830 let mut request = self
7831 .client
7832 .get(url)
7833 .header(
7834 ::reqwest::header::ACCEPT,
7835 ::reqwest::header::HeaderValue::from_static("application/json"),
7836 )
7837 .headers(header_map)
7838 .build()?;
7839 let info = OperationInfo { operation_id : "single_daily_resilience_document_v2_usercollection_daily_resilience_document_id_get" , } ;
7840 self.pre(&mut request, &info).await?;
7841 let result = self.exec(request, &info).await;
7842 self.post(&result, &info).await?;
7843 let response = result?;
7844 match response.status().as_u16() {
7845 200u16 => ResponseValue::from_response(response).await,
7846 422u16 => Err(Error::ErrorResponse(
7847 ResponseValue::from_response(response).await?,
7848 )),
7849 _ => Err(Error::UnexpectedResponse(response)),
7850 }
7851 }
7852
7853 #[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"]
7854 pub async fn multiple_daily_sleep_documents_v2_usercollection_daily_sleep_get<'a>(
7855 &'a self,
7856 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7857 fields: Option<&'a str>,
7858 next_token: Option<&'a str>,
7859 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7860 ) -> Result<
7861 ResponseValue<types::MultiDocumentResponsePublicDailySleep>,
7862 Error<types::HttpValidationError>,
7863 > {
7864 let url = format!("{}/v2/usercollection/daily_sleep", self.baseurl,);
7865 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7866 header_map.append(
7867 ::reqwest::header::HeaderName::from_static("api-version"),
7868 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7869 );
7870 #[allow(unused_mut)]
7871 let mut request = self
7872 .client
7873 .get(url)
7874 .header(
7875 ::reqwest::header::ACCEPT,
7876 ::reqwest::header::HeaderValue::from_static("application/json"),
7877 )
7878 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7879 .query(&progenitor_client::QueryParam::new("fields", &fields))
7880 .query(&progenitor_client::QueryParam::new(
7881 "next_token",
7882 &next_token,
7883 ))
7884 .query(&progenitor_client::QueryParam::new(
7885 "start_date",
7886 &start_date,
7887 ))
7888 .headers(header_map)
7889 .build()?;
7890 let info = OperationInfo {
7891 operation_id: "multiple_daily_sleep_documents_v2_usercollection_daily_sleep_get",
7892 };
7893 self.pre(&mut request, &info).await?;
7894 let result = self.exec(request, &info).await;
7895 self.post(&result, &info).await?;
7896 let response = result?;
7897 match response.status().as_u16() {
7898 200u16 => ResponseValue::from_response(response).await,
7899 422u16 => Err(Error::ErrorResponse(
7900 ResponseValue::from_response(response).await?,
7901 )),
7902 _ => Err(Error::UnexpectedResponse(response)),
7903 }
7904 }
7905
7906 #[doc = "Single Daily Sleep Document\n\nSends a `GET` request to `/v2/usercollection/daily_sleep/{document_id}`\n\n"]
7907 pub async fn single_daily_sleep_document_v2_usercollection_daily_sleep_document_id_get<'a>(
7908 &'a self,
7909 document_id: &'a str,
7910 ) -> Result<ResponseValue<types::PublicDailySleep>, Error<types::HttpValidationError>> {
7911 let url = format!(
7912 "{}/v2/usercollection/daily_sleep/{}",
7913 self.baseurl,
7914 encode_path(&document_id.to_string()),
7915 );
7916 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7917 header_map.append(
7918 ::reqwest::header::HeaderName::from_static("api-version"),
7919 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7920 );
7921 #[allow(unused_mut)]
7922 let mut request = self
7923 .client
7924 .get(url)
7925 .header(
7926 ::reqwest::header::ACCEPT,
7927 ::reqwest::header::HeaderValue::from_static("application/json"),
7928 )
7929 .headers(header_map)
7930 .build()?;
7931 let info = OperationInfo {
7932 operation_id:
7933 "single_daily_sleep_document_v2_usercollection_daily_sleep_document_id_get",
7934 };
7935 self.pre(&mut request, &info).await?;
7936 let result = self.exec(request, &info).await;
7937 self.post(&result, &info).await?;
7938 let response = result?;
7939 match response.status().as_u16() {
7940 200u16 => ResponseValue::from_response(response).await,
7941 422u16 => Err(Error::ErrorResponse(
7942 ResponseValue::from_response(response).await?,
7943 )),
7944 _ => Err(Error::UnexpectedResponse(response)),
7945 }
7946 }
7947
7948 #[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"]
7949 pub async fn multiple_daily_spo2_documents_v2_usercollection_daily_spo2_get<'a>(
7950 &'a self,
7951 end_date: Option<&'a ::chrono::naive::NaiveDate>,
7952 fields: Option<&'a str>,
7953 next_token: Option<&'a str>,
7954 start_date: Option<&'a ::chrono::naive::NaiveDate>,
7955 ) -> Result<
7956 ResponseValue<types::MultiDocumentResponsePublicDailySpO2>,
7957 Error<types::HttpValidationError>,
7958 > {
7959 let url = format!("{}/v2/usercollection/daily_spo2", self.baseurl,);
7960 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7961 header_map.append(
7962 ::reqwest::header::HeaderName::from_static("api-version"),
7963 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7964 );
7965 #[allow(unused_mut)]
7966 let mut request = self
7967 .client
7968 .get(url)
7969 .header(
7970 ::reqwest::header::ACCEPT,
7971 ::reqwest::header::HeaderValue::from_static("application/json"),
7972 )
7973 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
7974 .query(&progenitor_client::QueryParam::new("fields", &fields))
7975 .query(&progenitor_client::QueryParam::new(
7976 "next_token",
7977 &next_token,
7978 ))
7979 .query(&progenitor_client::QueryParam::new(
7980 "start_date",
7981 &start_date,
7982 ))
7983 .headers(header_map)
7984 .build()?;
7985 let info = OperationInfo {
7986 operation_id: "multiple_daily_spo2_documents_v2_usercollection_daily_spo2_get",
7987 };
7988 self.pre(&mut request, &info).await?;
7989 let result = self.exec(request, &info).await;
7990 self.post(&result, &info).await?;
7991 let response = result?;
7992 match response.status().as_u16() {
7993 200u16 => ResponseValue::from_response(response).await,
7994 422u16 => Err(Error::ErrorResponse(
7995 ResponseValue::from_response(response).await?,
7996 )),
7997 _ => Err(Error::UnexpectedResponse(response)),
7998 }
7999 }
8000
8001 #[doc = "Single Daily Spo2 Document\n\nSends a `GET` request to `/v2/usercollection/daily_spo2/{document_id}`\n\n"]
8002 pub async fn single_daily_spo2_document_v2_usercollection_daily_spo2_document_id_get<'a>(
8003 &'a self,
8004 document_id: &'a str,
8005 ) -> Result<ResponseValue<types::PublicDailySpO2>, Error<types::HttpValidationError>> {
8006 let url = format!(
8007 "{}/v2/usercollection/daily_spo2/{}",
8008 self.baseurl,
8009 encode_path(&document_id.to_string()),
8010 );
8011 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8012 header_map.append(
8013 ::reqwest::header::HeaderName::from_static("api-version"),
8014 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8015 );
8016 #[allow(unused_mut)]
8017 let mut request = self
8018 .client
8019 .get(url)
8020 .header(
8021 ::reqwest::header::ACCEPT,
8022 ::reqwest::header::HeaderValue::from_static("application/json"),
8023 )
8024 .headers(header_map)
8025 .build()?;
8026 let info = OperationInfo {
8027 operation_id: "single_daily_spo2_document_v2_usercollection_daily_spo2_document_id_get",
8028 };
8029 self.pre(&mut request, &info).await?;
8030 let result = self.exec(request, &info).await;
8031 self.post(&result, &info).await?;
8032 let response = result?;
8033 match response.status().as_u16() {
8034 200u16 => ResponseValue::from_response(response).await,
8035 422u16 => Err(Error::ErrorResponse(
8036 ResponseValue::from_response(response).await?,
8037 )),
8038 _ => Err(Error::UnexpectedResponse(response)),
8039 }
8040 }
8041
8042 #[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"]
8043 pub async fn multiple_daily_stress_documents_v2_usercollection_daily_stress_get<'a>(
8044 &'a self,
8045 end_date: Option<&'a ::chrono::naive::NaiveDate>,
8046 fields: Option<&'a str>,
8047 next_token: Option<&'a str>,
8048 start_date: Option<&'a ::chrono::naive::NaiveDate>,
8049 ) -> Result<
8050 ResponseValue<types::MultiDocumentResponsePublicDailyStress>,
8051 Error<types::HttpValidationError>,
8052 > {
8053 let url = format!("{}/v2/usercollection/daily_stress", self.baseurl,);
8054 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8055 header_map.append(
8056 ::reqwest::header::HeaderName::from_static("api-version"),
8057 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8058 );
8059 #[allow(unused_mut)]
8060 let mut request = self
8061 .client
8062 .get(url)
8063 .header(
8064 ::reqwest::header::ACCEPT,
8065 ::reqwest::header::HeaderValue::from_static("application/json"),
8066 )
8067 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
8068 .query(&progenitor_client::QueryParam::new("fields", &fields))
8069 .query(&progenitor_client::QueryParam::new(
8070 "next_token",
8071 &next_token,
8072 ))
8073 .query(&progenitor_client::QueryParam::new(
8074 "start_date",
8075 &start_date,
8076 ))
8077 .headers(header_map)
8078 .build()?;
8079 let info = OperationInfo {
8080 operation_id: "multiple_daily_stress_documents_v2_usercollection_daily_stress_get",
8081 };
8082 self.pre(&mut request, &info).await?;
8083 let result = self.exec(request, &info).await;
8084 self.post(&result, &info).await?;
8085 let response = result?;
8086 match response.status().as_u16() {
8087 200u16 => ResponseValue::from_response(response).await,
8088 422u16 => Err(Error::ErrorResponse(
8089 ResponseValue::from_response(response).await?,
8090 )),
8091 _ => Err(Error::UnexpectedResponse(response)),
8092 }
8093 }
8094
8095 #[doc = "Single Daily Stress Document\n\nSends a `GET` request to `/v2/usercollection/daily_stress/{document_id}`\n\n"]
8096 pub async fn single_daily_stress_document_v2_usercollection_daily_stress_document_id_get<'a>(
8097 &'a self,
8098 document_id: &'a str,
8099 ) -> Result<ResponseValue<types::PublicDailyStress>, Error<types::HttpValidationError>> {
8100 let url = format!(
8101 "{}/v2/usercollection/daily_stress/{}",
8102 self.baseurl,
8103 encode_path(&document_id.to_string()),
8104 );
8105 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8106 header_map.append(
8107 ::reqwest::header::HeaderName::from_static("api-version"),
8108 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8109 );
8110 #[allow(unused_mut)]
8111 let mut request = self
8112 .client
8113 .get(url)
8114 .header(
8115 ::reqwest::header::ACCEPT,
8116 ::reqwest::header::HeaderValue::from_static("application/json"),
8117 )
8118 .headers(header_map)
8119 .build()?;
8120 let info = OperationInfo {
8121 operation_id:
8122 "single_daily_stress_document_v2_usercollection_daily_stress_document_id_get",
8123 };
8124 self.pre(&mut request, &info).await?;
8125 let result = self.exec(request, &info).await;
8126 self.post(&result, &info).await?;
8127 let response = result?;
8128 match response.status().as_u16() {
8129 200u16 => ResponseValue::from_response(response).await,
8130 422u16 => Err(Error::ErrorResponse(
8131 ResponseValue::from_response(response).await?,
8132 )),
8133 _ => Err(Error::UnexpectedResponse(response)),
8134 }
8135 }
8136
8137 #[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"]
8138 pub async fn multiple_enhanced_tag_documents_v2_usercollection_enhanced_tag_get<'a>(
8139 &'a self,
8140 end_date: Option<&'a ::chrono::naive::NaiveDate>,
8141 fields: Option<&'a str>,
8142 next_token: Option<&'a str>,
8143 start_date: Option<&'a ::chrono::naive::NaiveDate>,
8144 ) -> Result<
8145 ResponseValue<types::MultiDocumentResponseEnhancedTagModel>,
8146 Error<types::HttpValidationError>,
8147 > {
8148 let url = format!("{}/v2/usercollection/enhanced_tag", self.baseurl,);
8149 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8150 header_map.append(
8151 ::reqwest::header::HeaderName::from_static("api-version"),
8152 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8153 );
8154 #[allow(unused_mut)]
8155 let mut request = self
8156 .client
8157 .get(url)
8158 .header(
8159 ::reqwest::header::ACCEPT,
8160 ::reqwest::header::HeaderValue::from_static("application/json"),
8161 )
8162 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
8163 .query(&progenitor_client::QueryParam::new("fields", &fields))
8164 .query(&progenitor_client::QueryParam::new(
8165 "next_token",
8166 &next_token,
8167 ))
8168 .query(&progenitor_client::QueryParam::new(
8169 "start_date",
8170 &start_date,
8171 ))
8172 .headers(header_map)
8173 .build()?;
8174 let info = OperationInfo {
8175 operation_id: "multiple_enhanced_tag_documents_v2_usercollection_enhanced_tag_get",
8176 };
8177 self.pre(&mut request, &info).await?;
8178 let result = self.exec(request, &info).await;
8179 self.post(&result, &info).await?;
8180 let response = result?;
8181 match response.status().as_u16() {
8182 200u16 => ResponseValue::from_response(response).await,
8183 422u16 => Err(Error::ErrorResponse(
8184 ResponseValue::from_response(response).await?,
8185 )),
8186 _ => Err(Error::UnexpectedResponse(response)),
8187 }
8188 }
8189
8190 #[doc = "Single Enhanced Tag Document\n\nSends a `GET` request to `/v2/usercollection/enhanced_tag/{document_id}`\n\n"]
8191 pub async fn single_enhanced_tag_document_v2_usercollection_enhanced_tag_document_id_get<'a>(
8192 &'a self,
8193 document_id: &'a str,
8194 ) -> Result<ResponseValue<types::EnhancedTagModel>, Error<types::HttpValidationError>> {
8195 let url = format!(
8196 "{}/v2/usercollection/enhanced_tag/{}",
8197 self.baseurl,
8198 encode_path(&document_id.to_string()),
8199 );
8200 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8201 header_map.append(
8202 ::reqwest::header::HeaderName::from_static("api-version"),
8203 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8204 );
8205 #[allow(unused_mut)]
8206 let mut request = self
8207 .client
8208 .get(url)
8209 .header(
8210 ::reqwest::header::ACCEPT,
8211 ::reqwest::header::HeaderValue::from_static("application/json"),
8212 )
8213 .headers(header_map)
8214 .build()?;
8215 let info = OperationInfo {
8216 operation_id:
8217 "single_enhanced_tag_document_v2_usercollection_enhanced_tag_document_id_get",
8218 };
8219 self.pre(&mut request, &info).await?;
8220 let result = self.exec(request, &info).await;
8221 self.post(&result, &info).await?;
8222 let response = result?;
8223 match response.status().as_u16() {
8224 200u16 => ResponseValue::from_response(response).await,
8225 422u16 => Err(Error::ErrorResponse(
8226 ResponseValue::from_response(response).await?,
8227 )),
8228 _ => Err(Error::UnexpectedResponse(response)),
8229 }
8230 }
8231
8232 #[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"]
8233 pub async fn multiple_heartrate_documents_v2_usercollection_heartrate_get<'a>(
8234 &'a self,
8235 end_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
8236 fields: Option<&'a str>,
8237 latest: Option<bool>,
8238 next_token: Option<&'a str>,
8239 start_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
8240 ) -> Result<
8241 ResponseValue<types::ResponseMultipleHeartrateDocumentsV2UsercollectionHeartrateGet>,
8242 Error<types::HttpValidationError>,
8243 > {
8244 let url = format!("{}/v2/usercollection/heartrate", self.baseurl,);
8245 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8246 header_map.append(
8247 ::reqwest::header::HeaderName::from_static("api-version"),
8248 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8249 );
8250 #[allow(unused_mut)]
8251 let mut request = self
8252 .client
8253 .get(url)
8254 .header(
8255 ::reqwest::header::ACCEPT,
8256 ::reqwest::header::HeaderValue::from_static("application/json"),
8257 )
8258 .query(&progenitor_client::QueryParam::new(
8259 "end_datetime",
8260 &end_datetime,
8261 ))
8262 .query(&progenitor_client::QueryParam::new("fields", &fields))
8263 .query(&progenitor_client::QueryParam::new("latest", &latest))
8264 .query(&progenitor_client::QueryParam::new(
8265 "next_token",
8266 &next_token,
8267 ))
8268 .query(&progenitor_client::QueryParam::new(
8269 "start_datetime",
8270 &start_datetime,
8271 ))
8272 .headers(header_map)
8273 .build()?;
8274 let info = OperationInfo {
8275 operation_id: "multiple_heartrate_documents_v2_usercollection_heartrate_get",
8276 };
8277 self.pre(&mut request, &info).await?;
8278 let result = self.exec(request, &info).await;
8279 self.post(&result, &info).await?;
8280 let response = result?;
8281 match response.status().as_u16() {
8282 200u16 => ResponseValue::from_response(response).await,
8283 422u16 => Err(Error::ErrorResponse(
8284 ResponseValue::from_response(response).await?,
8285 )),
8286 _ => Err(Error::UnexpectedResponse(response)),
8287 }
8288 }
8289
8290 #[doc = "Single Personal Info Document\n\nSends a `GET` request to `/v2/usercollection/personal_info`\n\n"]
8291 pub async fn single_personal_info_document_v2_usercollection_personal_info_get<'a>(
8292 &'a self,
8293 ) -> Result<ResponseValue<types::PersonalInfoResponse>, Error<()>> {
8294 let url = format!("{}/v2/usercollection/personal_info", self.baseurl,);
8295 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8296 header_map.append(
8297 ::reqwest::header::HeaderName::from_static("api-version"),
8298 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8299 );
8300 #[allow(unused_mut)]
8301 let mut request = self
8302 .client
8303 .get(url)
8304 .header(
8305 ::reqwest::header::ACCEPT,
8306 ::reqwest::header::HeaderValue::from_static("application/json"),
8307 )
8308 .headers(header_map)
8309 .build()?;
8310 let info = OperationInfo {
8311 operation_id: "single_personal_info_document_v2_usercollection_personal_info_get",
8312 };
8313 self.pre(&mut request, &info).await?;
8314 let result = self.exec(request, &info).await;
8315 self.post(&result, &info).await?;
8316 let response = result?;
8317 match response.status().as_u16() {
8318 200u16 => ResponseValue::from_response(response).await,
8319 _ => Err(Error::UnexpectedResponse(response)),
8320 }
8321 }
8322
8323 #[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"]
8324 pub async fn multiple_rest_mode_period_documents_v2_usercollection_rest_mode_period_get<'a>(
8325 &'a self,
8326 end_date: Option<&'a ::chrono::naive::NaiveDate>,
8327 fields: Option<&'a str>,
8328 next_token: Option<&'a str>,
8329 start_date: Option<&'a ::chrono::naive::NaiveDate>,
8330 ) -> Result<
8331 ResponseValue<types::MultiDocumentResponsePublicRestModePeriod>,
8332 Error<types::HttpValidationError>,
8333 > {
8334 let url = format!("{}/v2/usercollection/rest_mode_period", self.baseurl,);
8335 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8336 header_map.append(
8337 ::reqwest::header::HeaderName::from_static("api-version"),
8338 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8339 );
8340 #[allow(unused_mut)]
8341 let mut request = self
8342 .client
8343 .get(url)
8344 .header(
8345 ::reqwest::header::ACCEPT,
8346 ::reqwest::header::HeaderValue::from_static("application/json"),
8347 )
8348 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
8349 .query(&progenitor_client::QueryParam::new("fields", &fields))
8350 .query(&progenitor_client::QueryParam::new(
8351 "next_token",
8352 &next_token,
8353 ))
8354 .query(&progenitor_client::QueryParam::new(
8355 "start_date",
8356 &start_date,
8357 ))
8358 .headers(header_map)
8359 .build()?;
8360 let info = OperationInfo {
8361 operation_id:
8362 "multiple_rest_mode_period_documents_v2_usercollection_rest_mode_period_get",
8363 };
8364 self.pre(&mut request, &info).await?;
8365 let result = self.exec(request, &info).await;
8366 self.post(&result, &info).await?;
8367 let response = result?;
8368 match response.status().as_u16() {
8369 200u16 => ResponseValue::from_response(response).await,
8370 422u16 => Err(Error::ErrorResponse(
8371 ResponseValue::from_response(response).await?,
8372 )),
8373 _ => Err(Error::UnexpectedResponse(response)),
8374 }
8375 }
8376
8377 #[doc = "Single Rest Mode Period Document\n\nSends a `GET` request to `/v2/usercollection/rest_mode_period/{document_id}`\n\n"]
8378 pub async fn single_rest_mode_period_document_v2_usercollection_rest_mode_period_document_id_get<
8379 'a,
8380 >(
8381 &'a self,
8382 document_id: &'a str,
8383 ) -> Result<ResponseValue<types::PublicRestModePeriod>, Error<types::HttpValidationError>> {
8384 let url = format!(
8385 "{}/v2/usercollection/rest_mode_period/{}",
8386 self.baseurl,
8387 encode_path(&document_id.to_string()),
8388 );
8389 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8390 header_map.append(
8391 ::reqwest::header::HeaderName::from_static("api-version"),
8392 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8393 );
8394 #[allow(unused_mut)]
8395 let mut request = self
8396 .client
8397 .get(url)
8398 .header(
8399 ::reqwest::header::ACCEPT,
8400 ::reqwest::header::HeaderValue::from_static("application/json"),
8401 )
8402 .headers(header_map)
8403 .build()?;
8404 let info = OperationInfo { operation_id : "single_rest_mode_period_document_v2_usercollection_rest_mode_period_document_id_get" , } ;
8405 self.pre(&mut request, &info).await?;
8406 let result = self.exec(request, &info).await;
8407 self.post(&result, &info).await?;
8408 let response = result?;
8409 match response.status().as_u16() {
8410 200u16 => ResponseValue::from_response(response).await,
8411 422u16 => Err(Error::ErrorResponse(
8412 ResponseValue::from_response(response).await?,
8413 )),
8414 _ => Err(Error::UnexpectedResponse(response)),
8415 }
8416 }
8417
8418 #[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"]
8419 pub async fn multiple_ring_battery_level_documents_v2_usercollection_ring_battery_level_get<
8420 'a,
8421 >(
8422 &'a self,
8423 end_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
8424 fields: Option<&'a str>,
8425 latest: Option<bool>,
8426 next_token: Option<&'a str>,
8427 start_datetime: Option<&'a ::chrono::DateTime<::chrono::offset::Utc>>,
8428 ) -> Result<
8429 ResponseValue<
8430 types::ResponseMultipleRingBatteryLevelDocumentsV2UsercollectionRingBatteryLevelGet,
8431 >,
8432 Error<types::HttpValidationError>,
8433 > {
8434 let url = format!("{}/v2/usercollection/ring_battery_level", self.baseurl,);
8435 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8436 header_map.append(
8437 ::reqwest::header::HeaderName::from_static("api-version"),
8438 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8439 );
8440 #[allow(unused_mut)]
8441 let mut request = self
8442 .client
8443 .get(url)
8444 .header(
8445 ::reqwest::header::ACCEPT,
8446 ::reqwest::header::HeaderValue::from_static("application/json"),
8447 )
8448 .query(&progenitor_client::QueryParam::new(
8449 "end_datetime",
8450 &end_datetime,
8451 ))
8452 .query(&progenitor_client::QueryParam::new("fields", &fields))
8453 .query(&progenitor_client::QueryParam::new("latest", &latest))
8454 .query(&progenitor_client::QueryParam::new(
8455 "next_token",
8456 &next_token,
8457 ))
8458 .query(&progenitor_client::QueryParam::new(
8459 "start_datetime",
8460 &start_datetime,
8461 ))
8462 .headers(header_map)
8463 .build()?;
8464 let info = OperationInfo {
8465 operation_id:
8466 "multiple_ring_battery_level_documents_v2_usercollection_ring_battery_level_get",
8467 };
8468 self.pre(&mut request, &info).await?;
8469 let result = self.exec(request, &info).await;
8470 self.post(&result, &info).await?;
8471 let response = result?;
8472 match response.status().as_u16() {
8473 200u16 => ResponseValue::from_response(response).await,
8474 422u16 => Err(Error::ErrorResponse(
8475 ResponseValue::from_response(response).await?,
8476 )),
8477 _ => Err(Error::UnexpectedResponse(response)),
8478 }
8479 }
8480
8481 #[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"]
8482 pub async fn multiple_ring_configuration_documents_v2_usercollection_ring_configuration_get<
8483 'a,
8484 >(
8485 &'a self,
8486 fields: Option<&'a str>,
8487 next_token: Option<&'a str>,
8488 ) -> Result<
8489 ResponseValue<types::MultiDocumentResponsePublicRingConfiguration>,
8490 Error<types::HttpValidationError>,
8491 > {
8492 let url = format!("{}/v2/usercollection/ring_configuration", self.baseurl,);
8493 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8494 header_map.append(
8495 ::reqwest::header::HeaderName::from_static("api-version"),
8496 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8497 );
8498 #[allow(unused_mut)]
8499 let mut request = self
8500 .client
8501 .get(url)
8502 .header(
8503 ::reqwest::header::ACCEPT,
8504 ::reqwest::header::HeaderValue::from_static("application/json"),
8505 )
8506 .query(&progenitor_client::QueryParam::new("fields", &fields))
8507 .query(&progenitor_client::QueryParam::new(
8508 "next_token",
8509 &next_token,
8510 ))
8511 .headers(header_map)
8512 .build()?;
8513 let info = OperationInfo {
8514 operation_id:
8515 "multiple_ring_configuration_documents_v2_usercollection_ring_configuration_get",
8516 };
8517 self.pre(&mut request, &info).await?;
8518 let result = self.exec(request, &info).await;
8519 self.post(&result, &info).await?;
8520 let response = result?;
8521 match response.status().as_u16() {
8522 200u16 => ResponseValue::from_response(response).await,
8523 422u16 => Err(Error::ErrorResponse(
8524 ResponseValue::from_response(response).await?,
8525 )),
8526 _ => Err(Error::UnexpectedResponse(response)),
8527 }
8528 }
8529
8530 #[doc = "Single Ring Configuration Document\n\nSends a `GET` request to `/v2/usercollection/ring_configuration/{document_id}`\n\n"]
8531 pub async fn single_ring_configuration_document_v2_usercollection_ring_configuration_document_id_get<
8532 'a,
8533 >(
8534 &'a self,
8535 document_id: &'a str,
8536 ) -> Result<ResponseValue<types::PublicRingConfiguration>, Error<types::HttpValidationError>>
8537 {
8538 let url = format!(
8539 "{}/v2/usercollection/ring_configuration/{}",
8540 self.baseurl,
8541 encode_path(&document_id.to_string()),
8542 );
8543 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8544 header_map.append(
8545 ::reqwest::header::HeaderName::from_static("api-version"),
8546 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8547 );
8548 #[allow(unused_mut)]
8549 let mut request = self
8550 .client
8551 .get(url)
8552 .header(
8553 ::reqwest::header::ACCEPT,
8554 ::reqwest::header::HeaderValue::from_static("application/json"),
8555 )
8556 .headers(header_map)
8557 .build()?;
8558 let info = OperationInfo { operation_id : "single_ring_configuration_document_v2_usercollection_ring_configuration_document_id_get" , } ;
8559 self.pre(&mut request, &info).await?;
8560 let result = self.exec(request, &info).await;
8561 self.post(&result, &info).await?;
8562 let response = result?;
8563 match response.status().as_u16() {
8564 200u16 => ResponseValue::from_response(response).await,
8565 422u16 => Err(Error::ErrorResponse(
8566 ResponseValue::from_response(response).await?,
8567 )),
8568 _ => Err(Error::UnexpectedResponse(response)),
8569 }
8570 }
8571
8572 #[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"]
8573 pub async fn multiple_session_documents_v2_usercollection_session_get<'a>(
8574 &'a self,
8575 end_date: Option<&'a ::chrono::naive::NaiveDate>,
8576 fields: Option<&'a str>,
8577 next_token: Option<&'a str>,
8578 start_date: Option<&'a ::chrono::naive::NaiveDate>,
8579 ) -> Result<
8580 ResponseValue<types::MultiDocumentResponsePublicSession>,
8581 Error<types::HttpValidationError>,
8582 > {
8583 let url = format!("{}/v2/usercollection/session", self.baseurl,);
8584 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8585 header_map.append(
8586 ::reqwest::header::HeaderName::from_static("api-version"),
8587 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8588 );
8589 #[allow(unused_mut)]
8590 let mut request = self
8591 .client
8592 .get(url)
8593 .header(
8594 ::reqwest::header::ACCEPT,
8595 ::reqwest::header::HeaderValue::from_static("application/json"),
8596 )
8597 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
8598 .query(&progenitor_client::QueryParam::new("fields", &fields))
8599 .query(&progenitor_client::QueryParam::new(
8600 "next_token",
8601 &next_token,
8602 ))
8603 .query(&progenitor_client::QueryParam::new(
8604 "start_date",
8605 &start_date,
8606 ))
8607 .headers(header_map)
8608 .build()?;
8609 let info = OperationInfo {
8610 operation_id: "multiple_session_documents_v2_usercollection_session_get",
8611 };
8612 self.pre(&mut request, &info).await?;
8613 let result = self.exec(request, &info).await;
8614 self.post(&result, &info).await?;
8615 let response = result?;
8616 match response.status().as_u16() {
8617 200u16 => ResponseValue::from_response(response).await,
8618 422u16 => Err(Error::ErrorResponse(
8619 ResponseValue::from_response(response).await?,
8620 )),
8621 _ => Err(Error::UnexpectedResponse(response)),
8622 }
8623 }
8624
8625 #[doc = "Single Session Document\n\nSends a `GET` request to `/v2/usercollection/session/{document_id}`\n\n"]
8626 pub async fn single_session_document_v2_usercollection_session_document_id_get<'a>(
8627 &'a self,
8628 document_id: &'a str,
8629 ) -> Result<ResponseValue<types::PublicSession>, Error<types::HttpValidationError>> {
8630 let url = format!(
8631 "{}/v2/usercollection/session/{}",
8632 self.baseurl,
8633 encode_path(&document_id.to_string()),
8634 );
8635 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8636 header_map.append(
8637 ::reqwest::header::HeaderName::from_static("api-version"),
8638 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8639 );
8640 #[allow(unused_mut)]
8641 let mut request = self
8642 .client
8643 .get(url)
8644 .header(
8645 ::reqwest::header::ACCEPT,
8646 ::reqwest::header::HeaderValue::from_static("application/json"),
8647 )
8648 .headers(header_map)
8649 .build()?;
8650 let info = OperationInfo {
8651 operation_id: "single_session_document_v2_usercollection_session_document_id_get",
8652 };
8653 self.pre(&mut request, &info).await?;
8654 let result = self.exec(request, &info).await;
8655 self.post(&result, &info).await?;
8656 let response = result?;
8657 match response.status().as_u16() {
8658 200u16 => ResponseValue::from_response(response).await,
8659 422u16 => Err(Error::ErrorResponse(
8660 ResponseValue::from_response(response).await?,
8661 )),
8662 _ => Err(Error::UnexpectedResponse(response)),
8663 }
8664 }
8665
8666 #[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"]
8667 pub async fn multiple_sleep_documents_v2_usercollection_sleep_get<'a>(
8668 &'a self,
8669 end_date: Option<&'a ::chrono::naive::NaiveDate>,
8670 fields: Option<&'a str>,
8671 next_token: Option<&'a str>,
8672 start_date: Option<&'a ::chrono::naive::NaiveDate>,
8673 ) -> Result<
8674 ResponseValue<types::MultiDocumentResponsePublicModifiedSleepModel>,
8675 Error<types::HttpValidationError>,
8676 > {
8677 let url = format!("{}/v2/usercollection/sleep", self.baseurl,);
8678 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8679 header_map.append(
8680 ::reqwest::header::HeaderName::from_static("api-version"),
8681 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8682 );
8683 #[allow(unused_mut)]
8684 let mut request = self
8685 .client
8686 .get(url)
8687 .header(
8688 ::reqwest::header::ACCEPT,
8689 ::reqwest::header::HeaderValue::from_static("application/json"),
8690 )
8691 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
8692 .query(&progenitor_client::QueryParam::new("fields", &fields))
8693 .query(&progenitor_client::QueryParam::new(
8694 "next_token",
8695 &next_token,
8696 ))
8697 .query(&progenitor_client::QueryParam::new(
8698 "start_date",
8699 &start_date,
8700 ))
8701 .headers(header_map)
8702 .build()?;
8703 let info = OperationInfo {
8704 operation_id: "multiple_sleep_documents_v2_usercollection_sleep_get",
8705 };
8706 self.pre(&mut request, &info).await?;
8707 let result = self.exec(request, &info).await;
8708 self.post(&result, &info).await?;
8709 let response = result?;
8710 match response.status().as_u16() {
8711 200u16 => ResponseValue::from_response(response).await,
8712 422u16 => Err(Error::ErrorResponse(
8713 ResponseValue::from_response(response).await?,
8714 )),
8715 _ => Err(Error::UnexpectedResponse(response)),
8716 }
8717 }
8718
8719 #[doc = "Single Sleep Document\n\nSends a `GET` request to `/v2/usercollection/sleep/{document_id}`\n\n"]
8720 pub async fn single_sleep_document_v2_usercollection_sleep_document_id_get<'a>(
8721 &'a self,
8722 document_id: &'a str,
8723 ) -> Result<ResponseValue<types::PublicModifiedSleepModel>, Error<types::HttpValidationError>>
8724 {
8725 let url = format!(
8726 "{}/v2/usercollection/sleep/{}",
8727 self.baseurl,
8728 encode_path(&document_id.to_string()),
8729 );
8730 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8731 header_map.append(
8732 ::reqwest::header::HeaderName::from_static("api-version"),
8733 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8734 );
8735 #[allow(unused_mut)]
8736 let mut request = self
8737 .client
8738 .get(url)
8739 .header(
8740 ::reqwest::header::ACCEPT,
8741 ::reqwest::header::HeaderValue::from_static("application/json"),
8742 )
8743 .headers(header_map)
8744 .build()?;
8745 let info = OperationInfo {
8746 operation_id: "single_sleep_document_v2_usercollection_sleep_document_id_get",
8747 };
8748 self.pre(&mut request, &info).await?;
8749 let result = self.exec(request, &info).await;
8750 self.post(&result, &info).await?;
8751 let response = result?;
8752 match response.status().as_u16() {
8753 200u16 => ResponseValue::from_response(response).await,
8754 422u16 => Err(Error::ErrorResponse(
8755 ResponseValue::from_response(response).await?,
8756 )),
8757 _ => Err(Error::UnexpectedResponse(response)),
8758 }
8759 }
8760
8761 #[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"]
8762 pub async fn multiple_sleep_time_documents_v2_usercollection_sleep_time_get<'a>(
8763 &'a self,
8764 end_date: Option<&'a ::chrono::naive::NaiveDate>,
8765 fields: Option<&'a str>,
8766 next_token: Option<&'a str>,
8767 start_date: Option<&'a ::chrono::naive::NaiveDate>,
8768 ) -> Result<
8769 ResponseValue<types::MultiDocumentResponsePublicSleepTime>,
8770 Error<types::HttpValidationError>,
8771 > {
8772 let url = format!("{}/v2/usercollection/sleep_time", self.baseurl,);
8773 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8774 header_map.append(
8775 ::reqwest::header::HeaderName::from_static("api-version"),
8776 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8777 );
8778 #[allow(unused_mut)]
8779 let mut request = self
8780 .client
8781 .get(url)
8782 .header(
8783 ::reqwest::header::ACCEPT,
8784 ::reqwest::header::HeaderValue::from_static("application/json"),
8785 )
8786 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
8787 .query(&progenitor_client::QueryParam::new("fields", &fields))
8788 .query(&progenitor_client::QueryParam::new(
8789 "next_token",
8790 &next_token,
8791 ))
8792 .query(&progenitor_client::QueryParam::new(
8793 "start_date",
8794 &start_date,
8795 ))
8796 .headers(header_map)
8797 .build()?;
8798 let info = OperationInfo {
8799 operation_id: "multiple_sleep_time_documents_v2_usercollection_sleep_time_get",
8800 };
8801 self.pre(&mut request, &info).await?;
8802 let result = self.exec(request, &info).await;
8803 self.post(&result, &info).await?;
8804 let response = result?;
8805 match response.status().as_u16() {
8806 200u16 => ResponseValue::from_response(response).await,
8807 422u16 => Err(Error::ErrorResponse(
8808 ResponseValue::from_response(response).await?,
8809 )),
8810 _ => Err(Error::UnexpectedResponse(response)),
8811 }
8812 }
8813
8814 #[doc = "Single Sleep Time Document\n\nSends a `GET` request to `/v2/usercollection/sleep_time/{document_id}`\n\n"]
8815 pub async fn single_sleep_time_document_v2_usercollection_sleep_time_document_id_get<'a>(
8816 &'a self,
8817 document_id: &'a str,
8818 ) -> Result<ResponseValue<types::PublicSleepTime>, Error<types::HttpValidationError>> {
8819 let url = format!(
8820 "{}/v2/usercollection/sleep_time/{}",
8821 self.baseurl,
8822 encode_path(&document_id.to_string()),
8823 );
8824 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8825 header_map.append(
8826 ::reqwest::header::HeaderName::from_static("api-version"),
8827 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8828 );
8829 #[allow(unused_mut)]
8830 let mut request = self
8831 .client
8832 .get(url)
8833 .header(
8834 ::reqwest::header::ACCEPT,
8835 ::reqwest::header::HeaderValue::from_static("application/json"),
8836 )
8837 .headers(header_map)
8838 .build()?;
8839 let info = OperationInfo {
8840 operation_id: "single_sleep_time_document_v2_usercollection_sleep_time_document_id_get",
8841 };
8842 self.pre(&mut request, &info).await?;
8843 let result = self.exec(request, &info).await;
8844 self.post(&result, &info).await?;
8845 let response = result?;
8846 match response.status().as_u16() {
8847 200u16 => ResponseValue::from_response(response).await,
8848 422u16 => Err(Error::ErrorResponse(
8849 ResponseValue::from_response(response).await?,
8850 )),
8851 _ => Err(Error::UnexpectedResponse(response)),
8852 }
8853 }
8854
8855 #[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"]
8856 pub async fn multiple_tag_documents_v2_usercollection_tag_get<'a>(
8857 &'a self,
8858 end_date: Option<&'a ::chrono::naive::NaiveDate>,
8859 fields: Option<&'a str>,
8860 next_token: Option<&'a str>,
8861 start_date: Option<&'a ::chrono::naive::NaiveDate>,
8862 ) -> Result<
8863 ResponseValue<types::MultiDocumentResponseTagModel>,
8864 Error<types::HttpValidationError>,
8865 > {
8866 let url = format!("{}/v2/usercollection/tag", self.baseurl,);
8867 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8868 header_map.append(
8869 ::reqwest::header::HeaderName::from_static("api-version"),
8870 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8871 );
8872 #[allow(unused_mut)]
8873 let mut request = self
8874 .client
8875 .get(url)
8876 .header(
8877 ::reqwest::header::ACCEPT,
8878 ::reqwest::header::HeaderValue::from_static("application/json"),
8879 )
8880 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
8881 .query(&progenitor_client::QueryParam::new("fields", &fields))
8882 .query(&progenitor_client::QueryParam::new(
8883 "next_token",
8884 &next_token,
8885 ))
8886 .query(&progenitor_client::QueryParam::new(
8887 "start_date",
8888 &start_date,
8889 ))
8890 .headers(header_map)
8891 .build()?;
8892 let info = OperationInfo {
8893 operation_id: "multiple_tag_documents_v2_usercollection_tag_get",
8894 };
8895 self.pre(&mut request, &info).await?;
8896 let result = self.exec(request, &info).await;
8897 self.post(&result, &info).await?;
8898 let response = result?;
8899 match response.status().as_u16() {
8900 200u16 => ResponseValue::from_response(response).await,
8901 422u16 => Err(Error::ErrorResponse(
8902 ResponseValue::from_response(response).await?,
8903 )),
8904 _ => Err(Error::UnexpectedResponse(response)),
8905 }
8906 }
8907
8908 #[doc = "Single Tag Document\n\nSends a `GET` request to `/v2/usercollection/tag/{document_id}`\n\n"]
8909 pub async fn single_tag_document_v2_usercollection_tag_document_id_get<'a>(
8910 &'a self,
8911 document_id: &'a str,
8912 ) -> Result<ResponseValue<types::TagModel>, Error<types::HttpValidationError>> {
8913 let url = format!(
8914 "{}/v2/usercollection/tag/{}",
8915 self.baseurl,
8916 encode_path(&document_id.to_string()),
8917 );
8918 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8919 header_map.append(
8920 ::reqwest::header::HeaderName::from_static("api-version"),
8921 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8922 );
8923 #[allow(unused_mut)]
8924 let mut request = self
8925 .client
8926 .get(url)
8927 .header(
8928 ::reqwest::header::ACCEPT,
8929 ::reqwest::header::HeaderValue::from_static("application/json"),
8930 )
8931 .headers(header_map)
8932 .build()?;
8933 let info = OperationInfo {
8934 operation_id: "single_tag_document_v2_usercollection_tag_document_id_get",
8935 };
8936 self.pre(&mut request, &info).await?;
8937 let result = self.exec(request, &info).await;
8938 self.post(&result, &info).await?;
8939 let response = result?;
8940 match response.status().as_u16() {
8941 200u16 => ResponseValue::from_response(response).await,
8942 422u16 => Err(Error::ErrorResponse(
8943 ResponseValue::from_response(response).await?,
8944 )),
8945 _ => Err(Error::UnexpectedResponse(response)),
8946 }
8947 }
8948
8949 #[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"]
8950 pub async fn multiple_v_o2_max_documents_v2_usercollection_v_o2_max_get<'a>(
8951 &'a self,
8952 end_date: Option<&'a ::chrono::naive::NaiveDate>,
8953 fields: Option<&'a str>,
8954 next_token: Option<&'a str>,
8955 start_date: Option<&'a ::chrono::naive::NaiveDate>,
8956 ) -> Result<
8957 ResponseValue<types::MultiDocumentResponsePublicVo2Max>,
8958 Error<types::HttpValidationError>,
8959 > {
8960 let url = format!("{}/v2/usercollection/vO2_max", self.baseurl,);
8961 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8962 header_map.append(
8963 ::reqwest::header::HeaderName::from_static("api-version"),
8964 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8965 );
8966 #[allow(unused_mut)]
8967 let mut request = self
8968 .client
8969 .get(url)
8970 .header(
8971 ::reqwest::header::ACCEPT,
8972 ::reqwest::header::HeaderValue::from_static("application/json"),
8973 )
8974 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
8975 .query(&progenitor_client::QueryParam::new("fields", &fields))
8976 .query(&progenitor_client::QueryParam::new(
8977 "next_token",
8978 &next_token,
8979 ))
8980 .query(&progenitor_client::QueryParam::new(
8981 "start_date",
8982 &start_date,
8983 ))
8984 .headers(header_map)
8985 .build()?;
8986 let info = OperationInfo {
8987 operation_id: "multiple_v_o2_max_documents_v2_usercollection_v_o2_max_get",
8988 };
8989 self.pre(&mut request, &info).await?;
8990 let result = self.exec(request, &info).await;
8991 self.post(&result, &info).await?;
8992 let response = result?;
8993 match response.status().as_u16() {
8994 200u16 => ResponseValue::from_response(response).await,
8995 422u16 => Err(Error::ErrorResponse(
8996 ResponseValue::from_response(response).await?,
8997 )),
8998 _ => Err(Error::UnexpectedResponse(response)),
8999 }
9000 }
9001
9002 #[doc = "Single Vo2 Max Document\n\nSends a `GET` request to `/v2/usercollection/vO2_max/{document_id}`\n\n"]
9003 pub async fn single_v_o2_max_document_v2_usercollection_v_o2_max_document_id_get<'a>(
9004 &'a self,
9005 document_id: &'a str,
9006 ) -> Result<ResponseValue<types::PublicVo2Max>, Error<types::HttpValidationError>> {
9007 let url = format!(
9008 "{}/v2/usercollection/vO2_max/{}",
9009 self.baseurl,
9010 encode_path(&document_id.to_string()),
9011 );
9012 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9013 header_map.append(
9014 ::reqwest::header::HeaderName::from_static("api-version"),
9015 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9016 );
9017 #[allow(unused_mut)]
9018 let mut request = self
9019 .client
9020 .get(url)
9021 .header(
9022 ::reqwest::header::ACCEPT,
9023 ::reqwest::header::HeaderValue::from_static("application/json"),
9024 )
9025 .headers(header_map)
9026 .build()?;
9027 let info = OperationInfo {
9028 operation_id: "single_v_o2_max_document_v2_usercollection_v_o2_max_document_id_get",
9029 };
9030 self.pre(&mut request, &info).await?;
9031 let result = self.exec(request, &info).await;
9032 self.post(&result, &info).await?;
9033 let response = result?;
9034 match response.status().as_u16() {
9035 200u16 => ResponseValue::from_response(response).await,
9036 422u16 => Err(Error::ErrorResponse(
9037 ResponseValue::from_response(response).await?,
9038 )),
9039 _ => Err(Error::UnexpectedResponse(response)),
9040 }
9041 }
9042
9043 #[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"]
9044 pub async fn multiple_workout_documents_v2_usercollection_workout_get<'a>(
9045 &'a self,
9046 end_date: Option<&'a ::chrono::naive::NaiveDate>,
9047 fields: Option<&'a str>,
9048 next_token: Option<&'a str>,
9049 start_date: Option<&'a ::chrono::naive::NaiveDate>,
9050 ) -> Result<
9051 ResponseValue<types::MultiDocumentResponsePublicWorkout>,
9052 Error<types::HttpValidationError>,
9053 > {
9054 let url = format!("{}/v2/usercollection/workout", self.baseurl,);
9055 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9056 header_map.append(
9057 ::reqwest::header::HeaderName::from_static("api-version"),
9058 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9059 );
9060 #[allow(unused_mut)]
9061 let mut request = self
9062 .client
9063 .get(url)
9064 .header(
9065 ::reqwest::header::ACCEPT,
9066 ::reqwest::header::HeaderValue::from_static("application/json"),
9067 )
9068 .query(&progenitor_client::QueryParam::new("end_date", &end_date))
9069 .query(&progenitor_client::QueryParam::new("fields", &fields))
9070 .query(&progenitor_client::QueryParam::new(
9071 "next_token",
9072 &next_token,
9073 ))
9074 .query(&progenitor_client::QueryParam::new(
9075 "start_date",
9076 &start_date,
9077 ))
9078 .headers(header_map)
9079 .build()?;
9080 let info = OperationInfo {
9081 operation_id: "multiple_workout_documents_v2_usercollection_workout_get",
9082 };
9083 self.pre(&mut request, &info).await?;
9084 let result = self.exec(request, &info).await;
9085 self.post(&result, &info).await?;
9086 let response = result?;
9087 match response.status().as_u16() {
9088 200u16 => ResponseValue::from_response(response).await,
9089 422u16 => Err(Error::ErrorResponse(
9090 ResponseValue::from_response(response).await?,
9091 )),
9092 _ => Err(Error::UnexpectedResponse(response)),
9093 }
9094 }
9095
9096 #[doc = "Single Workout Document\n\nSends a `GET` request to `/v2/usercollection/workout/{document_id}`\n\n"]
9097 pub async fn single_workout_document_v2_usercollection_workout_document_id_get<'a>(
9098 &'a self,
9099 document_id: &'a str,
9100 ) -> Result<ResponseValue<types::PublicWorkout>, Error<types::HttpValidationError>> {
9101 let url = format!(
9102 "{}/v2/usercollection/workout/{}",
9103 self.baseurl,
9104 encode_path(&document_id.to_string()),
9105 );
9106 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9107 header_map.append(
9108 ::reqwest::header::HeaderName::from_static("api-version"),
9109 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9110 );
9111 #[allow(unused_mut)]
9112 let mut request = self
9113 .client
9114 .get(url)
9115 .header(
9116 ::reqwest::header::ACCEPT,
9117 ::reqwest::header::HeaderValue::from_static("application/json"),
9118 )
9119 .headers(header_map)
9120 .build()?;
9121 let info = OperationInfo {
9122 operation_id: "single_workout_document_v2_usercollection_workout_document_id_get",
9123 };
9124 self.pre(&mut request, &info).await?;
9125 let result = self.exec(request, &info).await;
9126 self.post(&result, &info).await?;
9127 let response = result?;
9128 match response.status().as_u16() {
9129 200u16 => ResponseValue::from_response(response).await,
9130 422u16 => Err(Error::ErrorResponse(
9131 ResponseValue::from_response(response).await?,
9132 )),
9133 _ => Err(Error::UnexpectedResponse(response)),
9134 }
9135 }
9136
9137 #[doc = "List Webhook Subscriptions\n\nSends a `GET` request to `/v2/webhook/subscription`\n\n"]
9138 pub async fn list_webhook_subscriptions_v2_webhook_subscription_get<'a>(
9139 &'a self,
9140 ) -> Result<ResponseValue<::std::vec::Vec<types::WebhookSubscriptionModel>>, Error<()>> {
9141 let url = format!("{}/v2/webhook/subscription", self.baseurl,);
9142 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9143 header_map.append(
9144 ::reqwest::header::HeaderName::from_static("api-version"),
9145 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9146 );
9147 #[allow(unused_mut)]
9148 let mut request = self
9149 .client
9150 .get(url)
9151 .header(
9152 ::reqwest::header::ACCEPT,
9153 ::reqwest::header::HeaderValue::from_static("application/json"),
9154 )
9155 .headers(header_map)
9156 .build()?;
9157 let info = OperationInfo {
9158 operation_id: "list_webhook_subscriptions_v2_webhook_subscription_get",
9159 };
9160 self.pre(&mut request, &info).await?;
9161 let result = self.exec(request, &info).await;
9162 self.post(&result, &info).await?;
9163 let response = result?;
9164 match response.status().as_u16() {
9165 200u16 => ResponseValue::from_response(response).await,
9166 _ => Err(Error::UnexpectedResponse(response)),
9167 }
9168 }
9169
9170 #[doc = "Create Webhook Subscription\n\nSends a `POST` request to `/v2/webhook/subscription`\n\n"]
9171 pub async fn create_webhook_subscription_v2_webhook_subscription_post<'a>(
9172 &'a self,
9173 body: &'a types::CreateWebhookSubscriptionRequest,
9174 ) -> Result<ResponseValue<types::WebhookSubscriptionModel>, Error<types::HttpValidationError>>
9175 {
9176 let url = format!("{}/v2/webhook/subscription", self.baseurl,);
9177 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9178 header_map.append(
9179 ::reqwest::header::HeaderName::from_static("api-version"),
9180 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9181 );
9182 #[allow(unused_mut)]
9183 let mut request = self
9184 .client
9185 .post(url)
9186 .header(
9187 ::reqwest::header::ACCEPT,
9188 ::reqwest::header::HeaderValue::from_static("application/json"),
9189 )
9190 .json(&body)
9191 .headers(header_map)
9192 .build()?;
9193 let info = OperationInfo {
9194 operation_id: "create_webhook_subscription_v2_webhook_subscription_post",
9195 };
9196 self.pre(&mut request, &info).await?;
9197 let result = self.exec(request, &info).await;
9198 self.post(&result, &info).await?;
9199 let response = result?;
9200 match response.status().as_u16() {
9201 201u16 => ResponseValue::from_response(response).await,
9202 422u16 => Err(Error::ErrorResponse(
9203 ResponseValue::from_response(response).await?,
9204 )),
9205 _ => Err(Error::UnexpectedResponse(response)),
9206 }
9207 }
9208
9209 #[doc = "Renew Webhook Subscription\n\nSends a `PUT` request to `/v2/webhook/subscription/renew/{id}`\n\n"]
9210 pub async fn renew_webhook_subscription_v2_webhook_subscription_renew_id_put<'a>(
9211 &'a self,
9212 id: &'a str,
9213 ) -> Result<ResponseValue<types::WebhookSubscriptionModel>, Error<types::HttpValidationError>>
9214 {
9215 let url = format!(
9216 "{}/v2/webhook/subscription/renew/{}",
9217 self.baseurl,
9218 encode_path(&id.to_string()),
9219 );
9220 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9221 header_map.append(
9222 ::reqwest::header::HeaderName::from_static("api-version"),
9223 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9224 );
9225 #[allow(unused_mut)]
9226 let mut request = self
9227 .client
9228 .put(url)
9229 .header(
9230 ::reqwest::header::ACCEPT,
9231 ::reqwest::header::HeaderValue::from_static("application/json"),
9232 )
9233 .headers(header_map)
9234 .build()?;
9235 let info = OperationInfo {
9236 operation_id: "renew_webhook_subscription_v2_webhook_subscription_renew_id_put",
9237 };
9238 self.pre(&mut request, &info).await?;
9239 let result = self.exec(request, &info).await;
9240 self.post(&result, &info).await?;
9241 let response = result?;
9242 match response.status().as_u16() {
9243 200u16 => ResponseValue::from_response(response).await,
9244 422u16 => Err(Error::ErrorResponse(
9245 ResponseValue::from_response(response).await?,
9246 )),
9247 _ => Err(Error::UnexpectedResponse(response)),
9248 }
9249 }
9250
9251 #[doc = "Get Webhook Subscription\n\nSends a `GET` request to `/v2/webhook/subscription/{id}`\n\n"]
9252 pub async fn get_webhook_subscription_v2_webhook_subscription_id_get<'a>(
9253 &'a self,
9254 id: &'a str,
9255 ) -> Result<ResponseValue<types::WebhookSubscriptionModel>, Error<types::HttpValidationError>>
9256 {
9257 let url = format!(
9258 "{}/v2/webhook/subscription/{}",
9259 self.baseurl,
9260 encode_path(&id.to_string()),
9261 );
9262 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9263 header_map.append(
9264 ::reqwest::header::HeaderName::from_static("api-version"),
9265 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9266 );
9267 #[allow(unused_mut)]
9268 let mut request = self
9269 .client
9270 .get(url)
9271 .header(
9272 ::reqwest::header::ACCEPT,
9273 ::reqwest::header::HeaderValue::from_static("application/json"),
9274 )
9275 .headers(header_map)
9276 .build()?;
9277 let info = OperationInfo {
9278 operation_id: "get_webhook_subscription_v2_webhook_subscription_id_get",
9279 };
9280 self.pre(&mut request, &info).await?;
9281 let result = self.exec(request, &info).await;
9282 self.post(&result, &info).await?;
9283 let response = result?;
9284 match response.status().as_u16() {
9285 200u16 => ResponseValue::from_response(response).await,
9286 422u16 => Err(Error::ErrorResponse(
9287 ResponseValue::from_response(response).await?,
9288 )),
9289 _ => Err(Error::UnexpectedResponse(response)),
9290 }
9291 }
9292
9293 #[doc = "Update Webhook Subscription\n\nSends a `PUT` request to `/v2/webhook/subscription/{id}`\n\n"]
9294 pub async fn update_webhook_subscription_v2_webhook_subscription_id_put<'a>(
9295 &'a self,
9296 id: &'a str,
9297 body: &'a types::UpdateWebhookSubscriptionRequest,
9298 ) -> Result<ResponseValue<types::WebhookSubscriptionModel>, Error<types::HttpValidationError>>
9299 {
9300 let url = format!(
9301 "{}/v2/webhook/subscription/{}",
9302 self.baseurl,
9303 encode_path(&id.to_string()),
9304 );
9305 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9306 header_map.append(
9307 ::reqwest::header::HeaderName::from_static("api-version"),
9308 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9309 );
9310 #[allow(unused_mut)]
9311 let mut request = self
9312 .client
9313 .put(url)
9314 .header(
9315 ::reqwest::header::ACCEPT,
9316 ::reqwest::header::HeaderValue::from_static("application/json"),
9317 )
9318 .json(&body)
9319 .headers(header_map)
9320 .build()?;
9321 let info = OperationInfo {
9322 operation_id: "update_webhook_subscription_v2_webhook_subscription_id_put",
9323 };
9324 self.pre(&mut request, &info).await?;
9325 let result = self.exec(request, &info).await;
9326 self.post(&result, &info).await?;
9327 let response = result?;
9328 match response.status().as_u16() {
9329 200u16 => ResponseValue::from_response(response).await,
9330 422u16 => Err(Error::ErrorResponse(
9331 ResponseValue::from_response(response).await?,
9332 )),
9333 _ => Err(Error::UnexpectedResponse(response)),
9334 }
9335 }
9336
9337 #[doc = "Delete Webhook Subscription\n\nSends a `DELETE` request to `/v2/webhook/subscription/{id}`\n\n"]
9338 pub async fn delete_webhook_subscription_v2_webhook_subscription_id_delete<'a>(
9339 &'a self,
9340 id: &'a str,
9341 ) -> Result<ResponseValue<()>, Error<types::HttpValidationError>> {
9342 let url = format!(
9343 "{}/v2/webhook/subscription/{}",
9344 self.baseurl,
9345 encode_path(&id.to_string()),
9346 );
9347 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9348 header_map.append(
9349 ::reqwest::header::HeaderName::from_static("api-version"),
9350 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9351 );
9352 #[allow(unused_mut)]
9353 let mut request = self
9354 .client
9355 .delete(url)
9356 .header(
9357 ::reqwest::header::ACCEPT,
9358 ::reqwest::header::HeaderValue::from_static("application/json"),
9359 )
9360 .headers(header_map)
9361 .build()?;
9362 let info = OperationInfo {
9363 operation_id: "delete_webhook_subscription_v2_webhook_subscription_id_delete",
9364 };
9365 self.pre(&mut request, &info).await?;
9366 let result = self.exec(request, &info).await;
9367 self.post(&result, &info).await?;
9368 let response = result?;
9369 match response.status().as_u16() {
9370 204u16 => Ok(ResponseValue::empty(response)),
9371 422u16 => Err(Error::ErrorResponse(
9372 ResponseValue::from_response(response).await?,
9373 )),
9374 _ => Err(Error::UnexpectedResponse(response)),
9375 }
9376 }
9377}
9378
9379#[doc = r" Items consumers will typically use such as the Client."]
9380pub mod prelude {
9381 #[allow(unused_imports)]
9382 pub use super::Client;
9383}