# BeginGetCredentialRequest.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/service/credentials/BeginGetCredentialRequest.Builder "View this page in Java")  

```
class Builder
```

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

Builder for[BeginGetCredentialRequest](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest).

## Summary

|                                                               Public constructors                                                               ||
|----------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest.Builder#Builder())`()` <br /> |

|                                                                                                                                                                                                                                                                                                                                                              Public methods                                                                                                                                                                                                                                                                                                                                                              ||
|----------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BeginGetCredentialRequest.Builder](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest.Builder#) | [addBeginGetCredentialOption](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest.Builder#addBeginGetCredentialOption(android.service.credentials.BeginGetCredentialOption))`(`beginGetCredentialOption:` `[BeginGetCredentialOption](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialOption)`)` Adds a single[BeginGetCredentialOption](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialOption)object to the list of credential options. |
| [BeginGetCredentialRequest](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest)                  | [build](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest.Builder#build())`()` Builds a new[BeginGetCredentialRequest](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest)instance.                                                                                                                                                                                                                                                                                             |
| [BeginGetCredentialRequest.Builder](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest.Builder#) | [setBeginGetCredentialOptions](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest.Builder#setBeginGetCredentialOptions(kotlin.collections.MutableList))`(`getBeginCredentialOptions:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[BeginGetCredentialOption](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialOption)!>`)` Sets the list of credential options.                                                           |
| [BeginGetCredentialRequest.Builder](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest.Builder#) | [setCallingAppInfo](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest.Builder#setCallingAppInfo(android.service.credentials.CallingAppInfo))`(`callingAppInfo:` `[CallingAppInfo](https://developer.android.com/reference/kotlin/android/service/credentials/CallingAppInfo)?`)` Sets information pertaining to the calling app.                                                                                                                                                                                                  |

## Public constructors

### Builder

```
Builder()
```

## Public methods

### addBeginGetCredentialOption

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

```
fun addBeginGetCredentialOption(beginGetCredentialOption: BeginGetCredentialOption): BeginGetCredentialRequest.Builder
```

Adds a single[BeginGetCredentialOption](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialOption)object to the list of credential options.

|                                                                                       Parameters                                                                                        ||
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `beginGetCredentialOption` | [BeginGetCredentialOption](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialOption):This value cannot be`null`. |

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

|                               Exceptions                               ||
|----------------------------------|--------------------------------------|
| `java.lang.NullPointerException` | If`beginGetCredentialOption`is null. |

### build

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

```
fun build(): BeginGetCredentialRequest
```

Builds a new[BeginGetCredentialRequest](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest)instance.

|                                                                             Return                                                                             ||
|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [BeginGetCredentialRequest](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialRequest) | This value cannot be`null`. |

|                                                     Exceptions                                                      ||
|--------------------------------------|-------------------------------------------------------------------------------|
| `java.lang.NullPointerException`     | If`beginGetCredentialOptions`is null.                                         |
| `java.lang.IllegalArgumentException` | If`beginGetCredentialOptions`is empty, or if`callingAppInfo`is null or empty. |

### setBeginGetCredentialOptions

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

```
fun setBeginGetCredentialOptions(getBeginCredentialOptions: MutableList<BeginGetCredentialOption!>): BeginGetCredentialRequest.Builder
```

Sets the list of credential options.

|                                                                                                                                              Parameters                                                                                                                                              ||
|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `getBeginCredentialOptions` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[BeginGetCredentialOption](https://developer.android.com/reference/kotlin/android/service/credentials/BeginGetCredentialOption)!\>:This value cannot be`null`. |

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

|                                                Exceptions                                                 ||
|--------------------------------------|---------------------------------------------------------------------|
| `java.lang.NullPointerException`     | If`getBeginCredentialOptions`itself or any of its elements is null. |
| `java.lang.IllegalArgumentException` | If`getBeginCredentialOptions`is empty.                              |

### setCallingAppInfo

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

```
fun setCallingAppInfo(callingAppInfo: CallingAppInfo?): BeginGetCredentialRequest.Builder
```

Sets information pertaining to the calling app.

|                                                                                                       Parameters                                                                                                        ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `callingAppInfo` | [CallingAppInfo](https://developer.android.com/reference/kotlin/android/service/credentials/CallingAppInfo)?:the info object containing the package name, and app signatures This value may be`null`. |

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