# AggregateRequest

# AggregateRequest

Artifact:[androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect)  
[View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/request/AggregateRequest.kt+class:androidx.health.connect.client.request.AggregateRequest)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/health/connect/client/request/AggregateRequest "View this page in Java")

<br />

```
class AggregateRequest
```

<br />

*** ** * ** ***

Request object to read aggregations for given[AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)s in Health Connect.  

|                                                                                     See also                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [aggregate](https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectClient#aggregate(androidx.health.connect.client.request.AggregateRequest)) |   |

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                               ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AggregateRequest](https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/AggregateRequest#AggregateRequest(kotlin.collections.Set,androidx.health.connect.client.time.TimeRangeFilter,kotlin.collections.Set))`(` ` metrics: `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)`<*>>,` ` timeRangeFilter: `[TimeRangeFilter](https://developer.android.com/reference/kotlin/androidx/health/connect/client/time/TimeRangeFilter)`,` ` dataOriginFilter: `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[DataOrigin](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin)`>` `)` |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/AggregateRequest#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/health/connect/client/request/AggregateRequest#hashCode())`()`                                                                                            |

## Public constructors

### AggregateRequest

```
AggregateRequest(
    metrics: Set<AggregateMetric<*>>,
    timeRangeFilter: TimeRangeFilter,
    dataOriginFilter: Set<DataOrigin> = emptySet()
)
```  

|                                                                                                                      Parameters                                                                                                                       |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `metrics: `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)`<*>>`                 | Set of[AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)s to aggregate.                      |
| `timeRangeFilter: `[TimeRangeFilter](https://developer.android.com/reference/kotlin/androidx/health/connect/client/time/TimeRangeFilter)                                                                                                              | The[TimeRangeFilter](https://developer.android.com/reference/kotlin/androidx/health/connect/client/time/TimeRangeFilter)to read from.                                |
| `dataOriginFilter: `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[DataOrigin](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin)`> = emptySet()` | Set of[DataOrigin](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin)s to read from, or empty for no filter. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```