Inherits from NSObject
Declared in UPSleepAPI.h
UPSleepAPI.m

Overview

Provides an interface for interacting with the user’s sleeps.

Class Methods

deleteSleep:completion:

Delete a sleep event. The event must belong to the currently authenticated user.

+ (void)deleteSleep:(UPSleep *)sleep completion:(UPBaseEventAPICompletion)completion

Parameters

sleep

The sleep event to be deleted.

completion

Block to be executed upon completion. The block is passed a completion object.

Discussion

Delete a sleep event. The event must belong to the currently authenticated user.

Declared In

UPSleepAPI.h

getSleepGraphImage:completion:

Request an image containing a graph for the sleep event. The event must be visible to the currently authenticated user.

+ (void)getSleepGraphImage:(UPSleep *)sleep completion:(UPBaseEventAPIImageCompletion)completion

Parameters

sleep

The sleep event to request.

completion

Block to be executed upon completion. The block is passed the result.

Discussion

Request an image containing a graph for the sleep event. The event must be visible to the currently authenticated user.

Declared In

UPSleepAPI.h

getSleepTicks:completion:

Requests ticks of the sleep. The ticks provide finer detail about the sleep.

+ (void)getSleepTicks:(UPSleep *)sleep completion:(UPBaseEventAPIArrayCompletion)completion

Parameters

sleep

The sleep event to request the snapshot for.

completion

Block to be executed upon completion. The block is passed the result.

Discussion

Requests ticks of the sleep. The ticks provide finer detail about the sleep.

Declared In

UPSleepAPI.h

getSleepsFromStartDate:toEndDate:completion:

Request sleep events between two points in time for the currently authenticated user.

+ (void)getSleepsFromStartDate:(NSDate *)startDate toEndDate:(NSDate *)endDate completion:(UPBaseEventAPIArrayCompletion)completion

Parameters

completion

Block to be executed upon completion. The block is passed the results.

Discussion

Request sleep events between two points in time for the currently authenticated user.

Declared In

UPSleepAPI.h

getSleepsWithLimit:completion:

Request recent sleep sleep for the currently authenticated user.

+ (void)getSleepsWithLimit:(NSUInteger)limit completion:(UPBaseEventAPIArrayCompletion)completion

Parameters

limit

The maximum number of events that will be returned.

completion

Block to be executed upon completion. The block is passed the results.

Discussion

Request recent sleep sleep for the currently authenticated user.

Declared In

UPSleepAPI.h

postSleep:completion:

Post a new sleep event to the user’s timeline.

+ (void)postSleep:(UPSleep *)sleep completion:(UPSleepAPICompletion)completion

Parameters

sleep

A new sleep event.

completion

Block to be executed upon completion. The block is passed the results.

Discussion

Post a new sleep event to the user’s timeline.

Declared In

UPSleepAPI.h

refreshSleep:completion:

Request sleep recent sleep events for the currently authenticated user.

+ (void)refreshSleep:(UPSleep *)sleep completion:(UPSleepAPICompletion)completion

Parameters

completion

Block to be executed upon completion. The block is passed the results.

Discussion

Request sleep recent sleep events for the currently authenticated user.

@param limit

Declared In

UPSleepAPI.h