# MatchmakingRequest

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/matchmaking/MatchmakingRequest.kt+class:androidx.health.connect.client.matchmaking.MatchmakingRequest) Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

*** ** * ** ***


```
@ExperimentalMatchmakingApi
class MatchmakingRequest
```

<br />

*** ** * ** ***

Request class for matchmaking flow.

Use this class to launch a matchmaking flow to discover apps and devices that can write health data that the calling app has permission to read.

To check if matchmaking is available, call `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` and pass `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_MATCHMAKING()` as an argument.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#MatchmakingRequest(kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set)( recordTypes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/Record>>, includedDataSources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin>, excludedDataSources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin> )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#excludedDataSources()` Set of `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin` to exclude from the matchmaking results. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#includedDataSources()` Set of `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin` to include in the matchmaking results. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/Record>>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#recordTypes()` Set of `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/Record` classes to find matching apps and devices for. |

## Public constructors

### MatchmakingRequest

```
MatchmakingRequest(
    recordTypes: Set<KClass<Record>> = emptySet(),
    includedDataSources: Set<DataOrigin> = emptySet(),
    excludedDataSources: Set<DataOrigin> = emptySet()
)
```

## Public functions

### equals

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

### hashCode

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

### toString

```
open fun toString(): String
```

## Public properties

### excludedDataSources

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
val excludedDataSources: Set<DataOrigin>
```

Set of `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin` to exclude from the matchmaking results. Data sources whose package names are present in this set are excluded.

Note: If a data source is an app, the calling app must have visibility of the package name (e.g. declared in the manifest inside `<queries>`). If a data source is a device, the calling app does not need to declare it in the manifest.

`https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#includedDataSources()` and `https://developer.android.com/reference/kotlin/androidx/health/connect/client/matchmaking/MatchmakingRequest#excludedDataSources()` cannot both be set at the same time.

### includedDataSources

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
val includedDataSources: Set<DataOrigin>
```

Set of `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/DataOrigin` to include in the matchmaking results. If non-empty, only data sources whose package names are present in this set are considered.

### recordTypes

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
val recordTypes: Set<KClass<Record>>
```

Set of `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/Record` classes to find matching apps and devices for. If empty, the flow focuses on all record types for which the calling package has permission to read.