# BeginGetCredentialRequest

Artifact: [androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/provider/BeginGetCredentialRequest.kt+class:androidx.credentials.provider.BeginGetCredentialRequest) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

*** ** * ** ***

<br />

```
class BeginGetCredentialRequest
```

<br />

*** ** * ** ***

Query stage request for getting user's credentials from a given credential provider.

This request contains a list of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption` that have parameters to be used to query credentials, and return a `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse`, containing a list `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CredentialEntry` that are presented to the user on an selector.

Note : Credential providers are not expected to utilize the constructor in this class for any production flow. This constructor must only be used for testing purposes.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-null-pointer-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#beginGetCredentialOptions()` is null |

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#asBundle(androidx.credentials.provider.BeginGetCredentialRequest)(request: https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest)` Helper method to convert the class to a parcelable `https://developer.android.com/reference/android/os/Bundle.html`, in case the class instance needs to be sent across a process. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest?` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html)` Helper method to convert a `https://developer.android.com/reference/android/os/Bundle.html` retrieved through `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#asBundle(androidx.credentials.provider.BeginGetCredentialRequest)`, back to an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#BeginGetCredentialRequest(kotlin.collections.List,androidx.credentials.provider.CallingAppInfo)( beginGetCredentialOptions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption>, callingAppInfo: https://developer.android.com/reference/kotlin/androidx/credentials/provider/CallingAppInfo? )` constructs an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption>` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#beginGetCredentialOptions()` the list of type specific credential options to to be processed in order to produce a `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse` |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CallingAppInfo?` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#callingAppInfo()` info pertaining to the app requesting credentials |

## Public companion functions

### asBundle

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
fun asBundle(request: BeginGetCredentialRequest): Bundle
```

Helper method to convert the class to a parcelable `https://developer.android.com/reference/android/os/Bundle.html`, in case the class instance needs to be sent across a process. Consumers of this method should use `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#fromBundle(android.os.Bundle)` to reconstruct the class instance back from the bundle returned here.

### fromBundle

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
fun fromBundle(bundle: Bundle): BeginGetCredentialRequest?
```

Helper method to convert a `https://developer.android.com/reference/android/os/Bundle.html` retrieved through `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest#asBundle(androidx.credentials.provider.BeginGetCredentialRequest)`, back to an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest`.

## Public constructors

### BeginGetCredentialRequest

```
BeginGetCredentialRequest(
    beginGetCredentialOptions: List<BeginGetCredentialOption>,
    callingAppInfo: CallingAppInfo? = null
)
```

constructs an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialRequest`

| Parameters |
|---|---|
| `beginGetCredentialOptions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialOption>` | the list of type specific credential options to to be processed in order to produce a `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse` |
| `callingAppInfo: https://developer.android.com/reference/kotlin/androidx/credentials/provider/CallingAppInfo? = null` | info pertaining to the app requesting credentials |

## Public properties

### beginGetCredentialOptions

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
val beginGetCredentialOptions: List<BeginGetCredentialOption>
```

the list of type specific credential options to to be processed in order to produce a `https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse`

### callingAppInfo

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

```
val callingAppInfo: CallingAppInfo?
```

info pertaining to the app requesting credentials