Class: Google::Apis::HealthV4::Sleep
- Inherits:
-
Object
- Object
- Google::Apis::HealthV4::Sleep
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/health_v4/classes.rb,
lib/google/apis/health_v4/representations.rb,
lib/google/apis/health_v4/representations.rb
Overview
A sleep session possibly including stages.
Instance Attribute Summary collapse
-
#create_time ⇒ String
Output only.
-
#interval ⇒ Google::Apis::HealthV4::SessionTimeInterval
Represents a time interval of session data point, which bundles multiple observed metrics together.
-
#metadata ⇒ Google::Apis::HealthV4::SleepMetadata
Additional information about how the sleep was processed.
-
#out_of_bed_segments ⇒ Array<Google::Apis::HealthV4::OutOfBedSegment>
Optional.
-
#short_awakenings ⇒ Array<Google::Apis::HealthV4::SleepStage>
Output only.
-
#stages ⇒ Array<Google::Apis::HealthV4::SleepStage>
Optional.
-
#summary ⇒ Google::Apis::HealthV4::SleepSummary
Sleep summary: metrics and stages summary.
-
#type ⇒ String
Optional.
-
#update_time ⇒ String
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Sleep
constructor
A new instance of Sleep.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Sleep
Returns a new instance of Sleep.
5204 5205 5206 |
# File 'lib/google/apis/health_v4/classes.rb', line 5204 def initialize(**args) update!(**args) end |
Instance Attribute Details
#create_time ⇒ String
Output only. Creation time of this sleep observation.
Corresponds to the JSON property createTime
5159 5160 5161 |
# File 'lib/google/apis/health_v4/classes.rb', line 5159 def create_time @create_time end |
#interval ⇒ Google::Apis::HealthV4::SessionTimeInterval
Represents a time interval of session data point, which bundles multiple
observed metrics together.
Corresponds to the JSON property interval
5165 5166 5167 |
# File 'lib/google/apis/health_v4/classes.rb', line 5165 def interval @interval end |
#metadata ⇒ Google::Apis::HealthV4::SleepMetadata
Additional information about how the sleep was processed.
Corresponds to the JSON property metadata
5170 5171 5172 |
# File 'lib/google/apis/health_v4/classes.rb', line 5170 def @metadata end |
#out_of_bed_segments ⇒ Array<Google::Apis::HealthV4::OutOfBedSegment>
Optional. “Out of bed” segments that can overlap with sleep stages.
Corresponds to the JSON property outOfBedSegments
5175 5176 5177 |
# File 'lib/google/apis/health_v4/classes.rb', line 5175 def out_of_bed_segments @out_of_bed_segments end |
#short_awakenings ⇒ Array<Google::Apis::HealthV4::SleepStage>
Output only. List of short awake segments (under a set threshold) that are
part of the sleep session. These can overlap with sleep stages.
Corresponds to the JSON property shortAwakenings
5181 5182 5183 |
# File 'lib/google/apis/health_v4/classes.rb', line 5181 def short_awakenings @short_awakenings end |
#stages ⇒ Array<Google::Apis::HealthV4::SleepStage>
Optional. List of non-overlapping contiguous sleep stage segments that cover
the sleep period.
Corresponds to the JSON property stages
5187 5188 5189 |
# File 'lib/google/apis/health_v4/classes.rb', line 5187 def stages @stages end |
#summary ⇒ Google::Apis::HealthV4::SleepSummary
Sleep summary: metrics and stages summary.
Corresponds to the JSON property summary
5192 5193 5194 |
# File 'lib/google/apis/health_v4/classes.rb', line 5192 def summary @summary end |
#type ⇒ String
Optional. SleepType: classic or stages.
Corresponds to the JSON property type
5197 5198 5199 |
# File 'lib/google/apis/health_v4/classes.rb', line 5197 def type @type end |
#update_time ⇒ String
Output only. Last update time of this sleep observation.
Corresponds to the JSON property updateTime
5202 5203 5204 |
# File 'lib/google/apis/health_v4/classes.rb', line 5202 def update_time @update_time end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 |
# File 'lib/google/apis/health_v4/classes.rb', line 5209 def update!(**args) @create_time = args[:create_time] if args.key?(:create_time) @interval = args[:interval] if args.key?(:interval) @metadata = args[:metadata] if args.key?(:metadata) @out_of_bed_segments = args[:out_of_bed_segments] if args.key?(:out_of_bed_segments) @short_awakenings = args[:short_awakenings] if args.key?(:short_awakenings) @stages = args[:stages] if args.key?(:stages) @summary = args[:summary] if args.key?(:summary) @type = args[:type] if args.key?(:type) @update_time = args[:update_time] if args.key?(:update_time) end |