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

*** ** * ** ***


```
public final class PutDocumentsRequest
```

<br />

*** ** * ** ***

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

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

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

## Summary

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

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/app/GenericDocument>` | `https://developer.android.com/reference/androidx/appsearch/app/PutDocumentsRequest#getGenericDocuments()()` Returns a list of `https://developer.android.com/reference/androidx/appsearch/app/GenericDocument` objects that are part of this request. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/app/GenericDocument>` | `https://developer.android.com/reference/androidx/appsearch/app/PutDocumentsRequest#getTakenActionGenericDocuments()()` Returns a list of `https://developer.android.com/reference/androidx/appsearch/app/GenericDocument` objects containing taken action metrics that are part of this request. |

## Public methods

### getGenericDocuments

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

```
public @NonNull List<GenericDocument> getGenericDocuments()
```

Returns a list of `https://developer.android.com/reference/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)

```
public @NonNull List<GenericDocument> getTakenActionGenericDocuments()
```

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

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