Inherits from UPBaseEvent : NSObject
Declared in UPSleepAPI.h
UPSleepAPI.m

Overview

Represents a single sleep session. A user can have multiple sleeps per day.

Properties

asleepTime

The time when the user went to sleep.

@property (nonatomic, strong) NSDate *asleepTime

Discussion

The time when the user went to sleep.

Declared In

UPSleepAPI.h

awakeTime

The time when the user woke up.

@property (nonatomic, strong) NSDate *awakeTime

Discussion

The time when the user woke up.

Declared In

UPSleepAPI.h

awakenings

The number of times the user woke up during the sleep.

@property (nonatomic, strong) NSNumber *awakenings

Discussion

The number of times the user woke up during the sleep.

Declared In

UPSleepAPI.h

graphImageURL

The URL to the graph of the sleep event.

@property (nonatomic, strong) NSString *graphImageURL

Discussion

The URL to the graph of the sleep event.

Declared In

UPSleepAPI.h

quality

The quality of the sleep.

@property (nonatomic, strong) NSNumber *quality

Discussion

The quality of the sleep.

Declared In

UPSleepAPI.h

smartAlarmFireTime

The time that the user’s smart sleep alarm fired.

@property (nonatomic, strong) NSDate *smartAlarmFireTime

Discussion

The time that the user’s smart sleep alarm fired.

Declared In

UPSleepAPI.h

timeCompleted

The time the sleep was completed.

@property (nonatomic, strong) NSDate *timeCompleted

Discussion

The time the sleep was completed.

Declared In

UPSleepAPI.h

totalTime

The total time the user was asleep.

@property (nonatomic, strong) NSNumber *totalTime

Discussion

The total time the user was asleep.

Declared In

UPSleepAPI.h

totalTimeAwake

The total amount of time the user was awake during the sleep.

@property (nonatomic, strong) NSNumber *totalTimeAwake

Discussion

The total amount of time the user was awake during the sleep.

Declared In

UPSleepAPI.h

totalTimeLight

The total time the user spent in light sleep.

@property (nonatomic, strong) NSNumber *totalTimeLight

Discussion

The total time the user spent in light sleep.

Declared In

UPSleepAPI.h

totalTimeSound

The total time the user spent in sound sleep.

@property (nonatomic, strong) NSNumber *totalTimeSound

Discussion

The total time the user spent in sound sleep.

Declared In

UPSleepAPI.h

Class Methods

sleepWithStartTime:endTime:

Create a new sleep event.

+ (UPSleep *)sleepWithStartTime:(NSDate *)startTime endTime:(NSDate *)endTime

Parameters

startTime

The time the user went to sleep.

endTime

The time the user woke up.

Return Value

Returns a new sleep event.

Discussion

Create a new sleep event.

Declared In

UPSleepAPI.h

Instance Methods

apiType

- (NSString *)apiType

Declared In

UPBaseEventAPI.h

decodeFromDictionary:

- (void)decodeFromDictionary:(NSDictionary *)dictionary

Declared In

UPBaseEventAPI.h

encodeToDictionary

Encodes an object to a JSON dictionary.

- (NSDictionary *)encodeToDictionary

Discussion

Encodes an object to a JSON dictionary.

Declared In

UPBaseEventAPI.h