# TrustedBiddingData.Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/adservices/customaudience/TrustedBiddingData.Builder "View this page in Java")  

```
class Builder
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                               ||
| ↳ | [android.adservices.customaudience.TrustedBiddingData.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData.Builder#) |

Builder for[TrustedBiddingData](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData)objects.

## Summary

|                                                              Public constructors                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData.Builder#Builder())`()` <br /> |

|                                                                                                                                                                                                                                                                                                         Public methods                                                                                                                                                                                                                                                                                                         ||
|--------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TrustedBiddingData](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData)                  | [build](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData.Builder#build())`()` Builds the[TrustedBiddingData](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData)object.                                                                                                                                                                                                        |
| [TrustedBiddingData.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData.Builder#) | [setTrustedBiddingKeys](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData.Builder#setTrustedBiddingKeys(kotlin.collections.MutableList))`(`trustedBiddingKeys:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>`)` Sets the list of keys to query the trusted key-value server with. |
| [TrustedBiddingData.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData.Builder#) | [setTrustedBiddingUri](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData.Builder#setTrustedBiddingUri(android.net.Uri))`(`trustedBiddingUri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)`)` Sets the URI pointing to a trusted key-value server used to fetch bidding signals during the ad selection process.                                                                                 |

## Public constructors

### Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
Builder()
```

## Public methods

### build

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
fun build(): TrustedBiddingData
```

Builds the[TrustedBiddingData](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData)object.

|                                                                         Return                                                                         ||
|---------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [TrustedBiddingData](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData) | This value cannot be`null`. |

|                               Exceptions                                ||
|----------------------------------|---------------------------------------|
| `java.lang.NullPointerException` | if any parameters are null when built |

### setTrustedBiddingKeys

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
fun setTrustedBiddingKeys(trustedBiddingKeys: MutableList<String!>): TrustedBiddingData.Builder
```

Sets the list of keys to query the trusted key-value server with.

This list is permitted to be empty, but it must not be null.

|                                                                                                                   Parameters                                                                                                                   ||
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `trustedBiddingKeys` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>:This value cannot be`null`. |

### setTrustedBiddingUri

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
fun setTrustedBiddingUri(trustedBiddingUri: Uri): TrustedBiddingData.Builder
```

Sets the URI pointing to a trusted key-value server used to fetch bidding signals during the ad selection process. The URI must use HTTPS.

|                                                          Parameters                                                          ||
|---------------------|---------------------------------------------------------------------------------------------------------|
| `trustedBiddingUri` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#):This value cannot be`null`. |

|                                                                                 Return                                                                                  ||
|--------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [TrustedBiddingData.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/TrustedBiddingData.Builder#) | This value cannot be`null`. |