# GetTopicsRequest

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/topics/GetTopicsRequest.kt+class:androidx.privacysandbox.ads.adservices.topics.GetTopicsRequest) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

*** ** * ** ***


```
public final class GetTopicsRequest
```

<br />

*** ** * ** ***

Represents the request for the getTopics API (which takes a `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest` and returns a `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsResponse`.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest.Builder` Builder for `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#GetTopicsRequest(kotlin.String,kotlin.Boolean)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html adsSdkName, boolean shouldRecordObservation )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @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/topics/GetTopicsRequest#getAdsSdkName()()` The Ads SDK name. |
| `int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#hashCode()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#shouldRecordObservation()()` whether to record that the caller has observed the topics of the host app or not. |
| `@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/topics/GetTopicsRequest#toString()()` |

## Public constructors

### GetTopicsRequest

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

```
public GetTopicsRequest(
    @NonNull String adsSdkName,
    boolean shouldRecordObservation
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html adsSdkName` | The Ads SDK name. This must be called by SDKs running outside of the Sandbox. Other clients must not call it. |
| `boolean shouldRecordObservation` | whether to record that the caller has observed the topics of the host app or not. This will be used to determine if the caller can receive the topic in the next epoch. |

## Public methods

### equals

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

### getAdsSdkName

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

```
public final @NonNull String getAdsSdkName()
```

The Ads SDK name. This must be called by SDKs running outside of the Sandbox. Other clients must not call it.

### hashCode

```
public int hashCode()
```

### shouldRecordObservation

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

```
public final boolean shouldRecordObservation()
```

whether to record that the caller has observed the topics of the host app or not. This will be used to determine if the caller can receive the topic in the next epoch.

### toString

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