# FetchAndJoinCustomAudienceRequest.Builder

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

# Builder

*** ** * ** ***

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

```
class Builder
```

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

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

## Summary

|                                                                                                                                                                                                                                                                                   Public constructors                                                                                                                                                                                                                                                                                    ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#Builder(android.net.Uri))`(`fetchUri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)`)` Instantiates a[FetchAndJoinCustomAudienceRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#)with the[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)from which the custom audience is to be fetched. |

|                                                                                                                                                                                                                                                                                                                                     Public methods                                                                                                                                                                                                                                                                                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [FetchAndJoinCustomAudienceRequest](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest)                  | [build](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#build())`()` Builds an instance of a[FetchAndJoinCustomAudienceRequest](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest).                                                                                                                                                                              |
| [FetchAndJoinCustomAudienceRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#) | [setActivationTime](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#setActivationTime(java.time.Instant))`(`activationTime:` `[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)?`)` Sets the[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)by which joining the custom audience will be delayed.                                                                |
| [FetchAndJoinCustomAudienceRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#) | [setExpirationTime](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#setExpirationTime(java.time.Instant))`(`expirationTime:` `[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)?`)` Sets the[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)by when the membership to the custom audience will expire.                                                           |
| [FetchAndJoinCustomAudienceRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#) | [setFetchUri](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#setFetchUri(android.net.Uri))`(`fetchUri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)`)` Sets the[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)from which the custom audience is to be fetched.                                                                                                      |
| [FetchAndJoinCustomAudienceRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#) | [setName](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#setName(kotlin.String))`(`name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Sets the[String](https://developer.android.com/reference/kotlin/java/lang/String.html#)name of the custom audience to join.                                                                                                                      |
| [FetchAndJoinCustomAudienceRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#) | [setUserBiddingSignals](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#setUserBiddingSignals(android.adservices.common.AdSelectionSignals))`(`userBiddingSignals:` `[AdSelectionSignals](https://developer.android.com/reference/kotlin/android/adservices/common/AdSelectionSignals.html#)?`)` Sets the buyer signals to be consumed by the buyer-provided JavaScript when the custom audience participates in an ad selection. |

## Public constructors

### Builder

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

```
Builder(fetchUri: Uri)
```

Instantiates a[FetchAndJoinCustomAudienceRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest.Builder#)with the[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)from which the custom audience is to be fetched.

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

## Public methods

### build

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

```
fun build(): FetchAndJoinCustomAudienceRequest
```

Builds an instance of a[FetchAndJoinCustomAudienceRequest](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest).

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

|                              Exceptions                              ||
|----------------------------------|------------------------------------|
| `java.lang.NullPointerException` | if any non-null parameter is null. |

### setActivationTime

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

```
fun setActivationTime(activationTime: Instant?): FetchAndJoinCustomAudienceRequest.Builder
```

Sets the[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)by which joining the custom audience will be delayed.

See[getActivationTime()](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest#getActivationTime())for details.

|                                                          Parameters                                                           ||
|------------------|-------------------------------------------------------------------------------------------------------------|
| `activationTime` | [Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)?:This value may be`null`. |

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

### setExpirationTime

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

```
fun setExpirationTime(expirationTime: Instant?): FetchAndJoinCustomAudienceRequest.Builder
```

Sets the[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)by when the membership to the custom audience will expire.

See[getExpirationTime()](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest#getExpirationTime())for details.

|                                                          Parameters                                                           ||
|------------------|-------------------------------------------------------------------------------------------------------------|
| `expirationTime` | [Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)?:This value may be`null`. |

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

### setFetchUri

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

```
fun setFetchUri(fetchUri: Uri): FetchAndJoinCustomAudienceRequest.Builder
```

Sets the[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)from which the custom audience is to be fetched.

See[getFetchUri()](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest#getFetchUri())()} for details.

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

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

### setName

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

```
fun setName(name: String?): FetchAndJoinCustomAudienceRequest.Builder
```

Sets the[String](https://developer.android.com/reference/kotlin/java/lang/String.html#)name of the custom audience to join.

See[getName()](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest#getName())for details.

|                                                     Parameters                                                     ||
|--------|------------------------------------------------------------------------------------------------------------|
| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:This value may be`null`. |

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

### setUserBiddingSignals

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

```
fun setUserBiddingSignals(userBiddingSignals: AdSelectionSignals?): FetchAndJoinCustomAudienceRequest.Builder
```

Sets the buyer signals to be consumed by the buyer-provided JavaScript when the custom audience participates in an ad selection.

See[getUserBiddingSignals()](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest#getUserBiddingSignals())for details.

|                                                                               Parameters                                                                                ||
|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| `userBiddingSignals` | [AdSelectionSignals](https://developer.android.com/reference/kotlin/android/adservices/common/AdSelectionSignals.html#)?:This value may be`null`. |

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