# ReportUsageRequest

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

*** ** * ** ***


```
public final class ReportUsageRequest
```

<br />

*** ** * ** ***

A request to report usage of a document.

See `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession#reportUsageAsync(androidx.appsearch.app.ReportUsageRequest)` for a detailed description of usage reporting.

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

## Summary

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

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest#getDocumentId()()` Returns the ID of document that was used. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest#getNamespace()()` Returns the namespace of the document that was used. |
| `long` | `https://developer.android.com/reference/androidx/appsearch/app/ReportUsageRequest#getUsageTimestampMillis()()` Returns the timestamp in milliseconds of the usage report (the time at which the document was used). |

## Public methods

### getDocumentId

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

```
public @NonNull String getDocumentId()
```

Returns the ID of document that was used.

### getNamespace

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

```
public @NonNull String getNamespace()
```

Returns the namespace of the document that was used.

### getUsageTimestampMillis

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

```
public long getUsageTimestampMillis()
```

Returns the timestamp in milliseconds of the usage report (the time at which the document was used).

The value is in the `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()` time base.