# GetTopicsRequest

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest "View this page in Java")

<br />

```
class GetTopicsRequest
```

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                            ### Nested types                                                                                                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[GetTopicsRequest.Builder](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest.Builder) Builder for[GetTopicsRequest](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest). |

|                                                                                                                                                                                       ### Public constructors                                                                                                                                                                                       |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [GetTopicsRequest](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#GetTopicsRequest(kotlin.String,kotlin.Boolean))`(adsSdkName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`, shouldRecordObservation: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#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/privacysandbox/ads/adservices/topics/GetTopicsRequest#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#toString())`()`                                                                                            |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)   | [adsSdkName](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#adsSdkName()) The Ads SDK name.                                                                                           |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [shouldRecordObservation](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/GetTopicsRequest#shouldRecordObservation()) whether to record that the caller has observed the topics of the host app or not. |

## Public constructors

### GetTopicsRequest

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

```
GetTopicsRequest(
    adsSdkName: String = "",
    shouldRecordObservation: Boolean = false
)
```  

|                                                        Parameters                                                        |
|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `adsSdkName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` = ""`                   | The Ads SDK name. This must be called by SDKs running outside of the Sandbox. Other clients must not call it.                                                           |
| `shouldRecordObservation: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` = false` | 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 functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### adsSdkName

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

```
val adsSdkName: String
```

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

### shouldRecordObservation

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

```
val shouldRecordObservation: Boolean
```

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.