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

```
public final 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/androidx/credentials/provider/BeginGetCredentialOption` that have parameters to be used to query credentials, and return a `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialResponse`, containing a list `https://developer.android.com/reference/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/androidx/credentials/provider/BeginGetCredentialRequest#beginGetCredentialOptions()` is null |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest#BeginGetCredentialRequest(kotlin.collections.List,androidx.credentials.provider.CallingAppInfo)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialOption> beginGetCredentialOptions, https://developer.android.com/reference/androidx/credentials/provider/CallingAppInfo callingAppInfo )` constructs an instance of `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest` |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest#asBundle(androidx.credentials.provider.BeginGetCredentialRequest)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest request)` 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. |
| `static final https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest` | `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest#fromBundle(android.os.Bundle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html bundle)` Helper method to convert a `https://developer.android.com/reference/android/os/Bundle.html` retrieved through `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest#asBundle(androidx.credentials.provider.BeginGetCredentialRequest)`, back to an instance of `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialOption>` | `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest#getBeginGetCredentialOptions()()` the list of type specific credential options to to be processed in order to produce a `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialResponse` |
| `final https://developer.android.com/reference/androidx/credentials/provider/CallingAppInfo` | `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialRequest#getCallingAppInfo()()` info pertaining to the app requesting credentials |

## Public constructors

### BeginGetCredentialRequest

```
public BeginGetCredentialRequest(
    @NonNull List<@NonNull BeginGetCredentialOption> beginGetCredentialOptions,
    CallingAppInfo callingAppInfo
)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialOption> beginGetCredentialOptions` | the list of type specific credential options to to be processed in order to produce a `https://developer.android.com/reference/androidx/credentials/provider/BeginGetCredentialResponse` |
| `https://developer.android.com/reference/androidx/credentials/provider/CallingAppInfo callingAppInfo` | info pertaining to the app requesting credentials |

## Public methods

### asBundle

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

```
public static final @NonNull Bundle asBundle(@NonNull BeginGetCredentialRequest request)
```

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

```
public static final BeginGetCredentialRequest fromBundle(@NonNull Bundle bundle)
```

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

### getBeginGetCredentialOptions

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

```
public final @NonNull List<@NonNull BeginGetCredentialOption> getBeginGetCredentialOptions()
```

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

### getCallingAppInfo

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

```
public final CallingAppInfo getCallingAppInfo()
```

info pertaining to the app requesting credentials