terra.models.v2.daily

  1#  Copyright 2022 Terra Enabling Developers Limited
  2#
  3#  Licensed under the Apache License, Version 2.0 (the "License");
  4#  you may not use this file except in compliance with the License.
  5#  You may obtain a copy of the License at
  6#
  7#      http://www.apache.org/licenses/LICENSE-2.0
  8#
  9#  Unless required by applicable law or agreed to in writing, software
 10#  distributed under the License is distributed on an "AS IS" BASIS,
 11#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12#  See the License for the specific language governing permissions and
 13#  limitations under the License.
 14import dataclasses
 15import typing
 16
 17from terra.models import base_model
 18from terra.models.v2 import samples as samples_
 19from terra.models.v2.activity import ActiveDurationsData
 20from terra.models.v2.activity import CaloriesData
 21from terra.models.v2.activity import DeviceData
 22from terra.models.v2.activity import ElevationSummary
 23from terra.models.v2.activity import HeartRateData
 24from terra.models.v2.activity import METData
 25from terra.models.v2.activity import OxygenData
 26from terra.models.v2.activity import SwimmingSummary
 27
 28__all__ = ["Daily"]
 29
 30
 31@dataclasses.dataclass
 32class Metadata(base_model.TerraDataModel):
 33    start_time: typing.Optional[str] = dataclasses.field(default=None)
 34    end_time: typing.Optional[str] = dataclasses.field(default=None)
 35    upload_type: typing.Optional[int] = dataclasses.field(default=None)
 36
 37
 38@dataclasses.dataclass
 39class DistanceDataDetailed(base_model.TerraDataModel):
 40    step_samples: typing.List[samples_.StepSample] = dataclasses.field(default_factory=list)
 41    distance_samples: typing.List[samples_.DistanceSample] = dataclasses.field(default_factory=list)
 42    elevation_samples: typing.List[samples_.ElevationSample] = dataclasses.field(default_factory=list)
 43    floors_climbed_samples: typing.List[samples_.FloorsClimbedSample] = dataclasses.field(default_factory=list)
 44
 45
 46@dataclasses.dataclass
 47class StrainData(base_model.TerraDataModel):
 48    strain_level: typing.Optional[float] = dataclasses.field(default=None)
 49
 50
 51@dataclasses.dataclass
 52class DistanceData(base_model.TerraDataModel):
 53    distance_meters: typing.Optional[float] = dataclasses.field(default=None)
 54    steps: typing.Optional[int] = dataclasses.field(default=None)
 55    floors_climbed: typing.Optional[int] = dataclasses.field(default=None)
 56    swimming: SwimmingSummary = dataclasses.field(default_factory=SwimmingSummary)
 57    elevation: ElevationSummary = dataclasses.field(default_factory=ElevationSummary)
 58    detailed: DistanceDataDetailed = dataclasses.field(default_factory=DistanceDataDetailed)
 59
 60
 61@dataclasses.dataclass
 62class TagEntry(base_model.TerraDataModel):
 63    tag_name: typing.Optional[str] = dataclasses.field(default=None)
 64    timestamp: typing.Optional[str] = dataclasses.field(default=None)
 65    notes: typing.Optional[str] = dataclasses.field(default=None)
 66
 67
 68@dataclasses.dataclass
 69class TagData(base_model.TerraDataModel):
 70    tags: typing.List[TagEntry] = dataclasses.field(default_factory=list)
 71
 72
 73@dataclasses.dataclass
 74class StressData(base_model.TerraDataModel):
 75    stress_duration_seconds: typing.Optional[float] = dataclasses.field(default=None)
 76    rest_stress_duration_seconds: typing.Optional[float] = dataclasses.field(default=None)
 77    activity_stress_duration_seconds: typing.Optional[float] = dataclasses.field(default=None)
 78    low_stress_duration_seconds: typing.Optional[float] = dataclasses.field(default=None)
 79    medium_stress_duration_seconds: typing.Optional[float] = dataclasses.field(default=None)
 80    high_stress_duration_seconds: typing.Optional[float] = dataclasses.field(default=None)
 81    avg_stress_level: typing.Optional[float] = dataclasses.field(default=None)
 82    max_stress_level: typing.Optional[float] = dataclasses.field(default=None)
 83    samples: typing.List[samples_.StressSample] = dataclasses.field(default_factory=list)
 84
 85
 86@dataclasses.dataclass
 87class Scores(base_model.TerraDataModel):
 88    recovery: typing.Optional[float] = dataclasses.field(default=None)
 89    activity: typing.Optional[float] = dataclasses.field(default=None)
 90    sleep: typing.Optional[float] = dataclasses.field(default=None)
 91
 92
 93@dataclasses.dataclass
 94class Daily(base_model.TerraDataModel):
 95    metadata: Metadata = dataclasses.field(default_factory=Metadata)
 96    tag_data: TagData = dataclasses.field(default_factory=TagData)
 97    active_durations_data: ActiveDurationsData = dataclasses.field(default_factory=ActiveDurationsData)
 98    distance_data: DistanceData = dataclasses.field(default_factory=DistanceData)
 99    heart_rate_data: HeartRateData = dataclasses.field(default_factory=HeartRateData)
100    calories_data: CaloriesData = dataclasses.field(default_factory=CaloriesData)
101    MET_data: METData = dataclasses.field(default_factory=METData)
102    stress_data: StressData = dataclasses.field(default_factory=StressData)
103    oxygen_data: OxygenData = dataclasses.field(default_factory=OxygenData)
104    strain_data: StrainData = dataclasses.field(default_factory=StrainData)
105    device_data: DeviceData = dataclasses.field(default_factory=DeviceData)
106    scores: Scores = dataclasses.field(default_factory=Scores)
@dataclasses.dataclass
class Daily(terra.models.base_model.TerraDataModel):
 94@dataclasses.dataclass
 95class Daily(base_model.TerraDataModel):
 96    metadata: Metadata = dataclasses.field(default_factory=Metadata)
 97    tag_data: TagData = dataclasses.field(default_factory=TagData)
 98    active_durations_data: ActiveDurationsData = dataclasses.field(default_factory=ActiveDurationsData)
 99    distance_data: DistanceData = dataclasses.field(default_factory=DistanceData)
100    heart_rate_data: HeartRateData = dataclasses.field(default_factory=HeartRateData)
101    calories_data: CaloriesData = dataclasses.field(default_factory=CaloriesData)
102    MET_data: METData = dataclasses.field(default_factory=METData)
103    stress_data: StressData = dataclasses.field(default_factory=StressData)
104    oxygen_data: OxygenData = dataclasses.field(default_factory=OxygenData)
105    strain_data: StrainData = dataclasses.field(default_factory=StrainData)
106    device_data: DeviceData = dataclasses.field(default_factory=DeviceData)
107    scores: Scores = dataclasses.field(default_factory=Scores)

Daily(metadata: terra.models.v2.daily.Metadata = , tag_data: terra.models.v2.daily.TagData = , active_durations_data: terra.models.v2.activity.ActiveDurationsData = , distance_data: terra.models.v2.daily.DistanceData = , heart_rate_data: terra.models.v2.activity.HeartRateData = , calories_data: terra.models.v2.activity.CaloriesData = , MET_data: terra.models.v2.activity.METData = , stress_data: terra.models.v2.daily.StressData = , oxygen_data: terra.models.v2.activity.OxygenData = , strain_data: terra.models.v2.daily.StrainData = , device_data: terra.models.v2.activity.DeviceData = , scores: terra.models.v2.daily.Scores = )

Daily( metadata: terra.models.v2.daily.Metadata = <factory>, tag_data: terra.models.v2.daily.TagData = <factory>, active_durations_data: terra.models.v2.activity.ActiveDurationsData = <factory>, distance_data: terra.models.v2.daily.DistanceData = <factory>, heart_rate_data: terra.models.v2.activity.HeartRateData = <factory>, calories_data: terra.models.v2.activity.CaloriesData = <factory>, MET_data: terra.models.v2.activity.METData = <factory>, stress_data: terra.models.v2.daily.StressData = <factory>, oxygen_data: terra.models.v2.activity.OxygenData = <factory>, strain_data: terra.models.v2.daily.StrainData = <factory>, device_data: terra.models.v2.activity.DeviceData = <factory>, scores: terra.models.v2.daily.Scores = <factory>)