# PutDocumentsRequest

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/PutDocumentsRequest.java+class:androidx.appsearch.app.PutDocumentsRequest) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
class PutDocumentsRequest
```

<br />

*** ** * ** ***

Encapsulates a request to index documents into an `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession` database.

Documents added to the request can be instances of classes annotated with `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document` or instances of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#putAsync(androidx.appsearch.app.PutDocumentsRequest)` |   |

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/appsearch/app/PutDocumentsRequest.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PutDocumentsRequest` objects. |

| ### Public functions |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PutDocumentsRequest#getGenericDocuments()()` Returns a list of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument` objects that are part of this request. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PutDocumentsRequest#getTakenActionGenericDocuments()()` Returns a list of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument` objects containing taken action metrics that are part of this request. |

## Public functions

### getGenericDocuments

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

```
fun getGenericDocuments(): (Mutable)List<GenericDocument!>
```

Returns a list of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument` objects that are part of this request.

### getTakenActionGenericDocuments

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

```
fun getTakenActionGenericDocuments(): (Mutable)List<GenericDocument!>
```

Returns a list of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument` objects containing taken action metrics that are part of this request.

See `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PutDocumentsRequest.Builder#addTakenActions(androidx.appsearch.usagereporting.TakenAction...)`.