Class: Google::Apis::HealthV4::Sleep

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Sleep

Returns a new instance of Sleep.



3653
3654
3655
# File 'lib/google/apis/health_v4/classes.rb', line 3653

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#create_timeString

Output only. Creation time of this sleep observation. Corresponds to the JSON property createTime

Returns:

  • (String)


3614
3615
3616
# File 'lib/google/apis/health_v4/classes.rb', line 3614

def create_time
  @create_time
end

#intervalGoogle::Apis::HealthV4::SessionTimeInterval

Represents a time interval of session data point, which bundles multiple observed metrics together. Corresponds to the JSON property interval



3620
3621
3622
# File 'lib/google/apis/health_v4/classes.rb', line 3620

def interval
  @interval
end

#metadataGoogle::Apis::HealthV4::SleepMetadata

Additional information about how the sleep was processed. Corresponds to the JSON property metadata



3625
3626
3627
# File 'lib/google/apis/health_v4/classes.rb', line 3625

def 
  @metadata
end

#out_of_bed_segmentsArray<Google::Apis::HealthV4::OutOfBedSegment>

Optional. “Out of bed” segments that can overlap with sleep stages. Corresponds to the JSON property outOfBedSegments



3630
3631
3632
# File 'lib/google/apis/health_v4/classes.rb', line 3630

def out_of_bed_segments
  @out_of_bed_segments
end

#stagesArray<Google::Apis::HealthV4::SleepStage>

Optional. List of non-overlapping contiguous sleep stage segments that cover the sleep period. Corresponds to the JSON property stages



3636
3637
3638
# File 'lib/google/apis/health_v4/classes.rb', line 3636

def stages
  @stages
end

#summaryGoogle::Apis::HealthV4::SleepSummary

Sleep summary: metrics and stages summary. Corresponds to the JSON property summary



3641
3642
3643
# File 'lib/google/apis/health_v4/classes.rb', line 3641

def summary
  @summary
end

#typeString

Optional. SleepType: classic or stages. Corresponds to the JSON property type

Returns:

  • (String)


3646
3647
3648
# File 'lib/google/apis/health_v4/classes.rb', line 3646

def type
  @type
end

#update_timeString

Output only. Last update time of this sleep observation. Corresponds to the JSON property updateTime

Returns:

  • (String)


3651
3652
3653
# File 'lib/google/apis/health_v4/classes.rb', line 3651

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
# File 'lib/google/apis/health_v4/classes.rb', line 3658

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)
  @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