# ReportImpressionRequest

Artifact: [androidx.privacysandbox.ads:ads-adservices](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest.kt+class:androidx.privacysandbox.ads.adservices.adselection.ReportImpressionRequest) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

*** ** * ** ***


```
public final class ReportImpressionRequest
```

<br />

*** ** * ** ***

Represent input parameters to the reportImpression API.

## Summary

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/common/ExperimentalFeatures.Ext8OptIn https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest#ReportImpressionRequest(kotlin.Long)(long adSelectionId)` |
| `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest#ReportImpressionRequest(kotlin.Long,androidx.privacysandbox.ads.adservices.adselection.AdSelectionConfig)( long adSelectionId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/AdSelectionConfig adSelectionConfig )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` Checks whether two `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest` objects contain the same information. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/AdSelectionConfig` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest#getAdSelectionConfig()()` optional config used in the selectAds() call identified by the provided ad selection ID. |
| `final long` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest#getAdSelectionId()()` An ID unique only to a device user that identifies a successful ad selection. |
| `int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest#hashCode()()` Returns the hash of the `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest` object's data. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest#toString()()` Overrides the toString method. |

## Public constructors

### ReportImpressionRequest

Added in [1.1.0-beta12](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.1.0-beta12)

```
@ExperimentalFeatures.Ext8OptIn
public ReportImpressionRequest(long adSelectionId)
```

### ReportImpressionRequest

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
public ReportImpressionRequest(
    long adSelectionId,
    @NonNull AdSelectionConfig adSelectionConfig
)
```

| Parameters |
|---|---|
| `long adSelectionId` | An ID unique only to a device user that identifies a successful ad selection. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/AdSelectionConfig adSelectionConfig` | optional config used in the selectAds() call identified by the provided ad selection ID. If the {@code adSelectionId} is for a on-device auction run using AdSelectionManager#selectAds, then the config must be included. If the {@code adSelectionId} is for a server auction run where device info collected by \[AdSelectionManager#getAdSelectionData} then the impression reporting request should only include the ad selection id. |

## Public methods

### equals

```
public boolean equals(Object other)
```

Checks whether two `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest` objects contain the same information.

### getAdSelectionConfig

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
public final @NonNull AdSelectionConfig getAdSelectionConfig()
```

optional config used in the selectAds() call identified by the provided ad selection ID. If the {@code adSelectionId} is for a on-device auction run using AdSelectionManager#selectAds, then the config must be included. If the {@code adSelectionId} is for a server auction run where device info collected by \[AdSelectionManager#getAdSelectionData} then the impression reporting request should only include the ad selection id.

### getAdSelectionId

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
public final long getAdSelectionId()
```

An ID unique only to a device user that identifies a successful ad selection.

### hashCode

```
public int hashCode()
```

Returns the hash of the `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/adselection/ReportImpressionRequest` object's data.

### toString

```
public @NonNull String toString()
```

Overrides the toString method.