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.



3592
3593
3594
# File 'lib/google/apis/health_v4/classes.rb', line 3592

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)


3553
3554
3555
# File 'lib/google/apis/health_v4/classes.rb', line 3553

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



3559
3560
3561
# File 'lib/google/apis/health_v4/classes.rb', line 3559

def interval
  @interval
end

#metadataGoogle::Apis::HealthV4::SleepMetadata

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



3564
3565
3566
# File 'lib/google/apis/health_v4/classes.rb', line 3564

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



3569
3570
3571
# File 'lib/google/apis/health_v4/classes.rb', line 3569

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



3575
3576
3577
# File 'lib/google/apis/health_v4/classes.rb', line 3575

def stages
  @stages
end

#summaryGoogle::Apis::HealthV4::SleepSummary

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



3580
3581
3582
# File 'lib/google/apis/health_v4/classes.rb', line 3580

def summary
  @summary
end

#typeString

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

Returns:

  • (String)


3585
3586
3587
# File 'lib/google/apis/health_v4/classes.rb', line 3585

def type
  @type
end

#update_timeString

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

Returns:

  • (String)


3590
3591
3592
# File 'lib/google/apis/health_v4/classes.rb', line 3590

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
# File 'lib/google/apis/health_v4/classes.rb', line 3597

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