AggregateRequest

Represents a request for an aggregation query over a period of time by applying aggregate operations, such as TOTAL, LAST, MIN and MAX.

Available aggregation operations differ by data type. See a data type's available aggregate operations in AggregateOperation. For example, NutritionType provides the TOTAL_CALORIES operation.

This request can include filters, such as the source and time filters. For example, if both of the following conditions have been applied for an aggregate request:

The following sample retrieves aggregated data ? in this case, the total count of real steps:

suspend fun readStepsData() {
     val healthDataStore = HealthDataService.getStore(context)
     val readRequest = DataType.StepsType.TOTAL.requestBuilder
         // set some filters or conditions
         .build()

     // make asynchronous call for result
     val result = healthDataStore.aggregateData(readRequest)
     // process data
}

Since

1.0.0

Types

Link copied to clipboard

A local date time builder for all data sources to create an AggregateRequest instance.

Link copied to clipboard
interface Builder<T : Any>

The interface of the builder for creating an AggregateRequest.

Link copied to clipboard

A dual time builder to create an AggregateRequest instance.

Link copied to clipboard

A local date builder to create an AggregateRequest instance.

Link copied to clipboard

A local time builder to create an AggregateRequest instance.

Properties

Link copied to clipboard

The data type of this request.

Link copied to clipboard

The time filter of this request as an InstantTimeFilter.

Link copied to clipboard

The time group of this request as an InstantTimeGroup.

Link copied to clipboard

The time filter of this request as a LocalTimeFilter.

Link copied to clipboard

The time group of this request as a LocalTimeGroup.

Link copied to clipboard

The ordering of the response for this request.

Link copied to clipboard

The page size of the response for this request, which means the size of the data in one result page.

Link copied to clipboard

The page token of the response for this request.

Link copied to clipboard

The source filter of this request.

Link copied to clipboard

Preferences Submitted

You have successfully updated your cookie preferences.