TOTAL_DURATION

The aggregate operation to obtain the total duration in the retrieved SleepType data.

This helps to create an AggregateRequest instance to get the total sleep duration simply and easily.

This aggregate operation allows the app to set the following:

// set a Local date range with one week ago including today
val today = LocalDate.now()
val localDateFilter = LocalDateFilter.of(today.minusDays(6), today)
val localDateGroup = LocalDateGroup.of(LocalDateGroupUnit.DAILY, 1)

val aggregateRequest = DataType.SleepType.TOTAL_DURATION.requestBuilder
    .setLocalDateFilterWithGroup(localDateFilter, localDateGroup)
    .setOrdering(Ordering.DESC)
    // set other conditions
    .build()

Since

1.0.0

See also

Preferences Submitted

You have successfully updated your cookie preferences.