# DeletionRequest

Artifact: [androidx.privacysandbox.ads:ads-adservices](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/ads/adservices/measurement/DeletionRequest.kt+class:androidx.privacysandbox.ads.adservices.measurement.DeletionRequest) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

*** ** * ** ***


```
@RequiresApi(value = 26)
class DeletionRequest
```

<br />

*** ** * ** ***

Deletion Request.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 26) class https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest.Builder` Builder for {@link DeletionRequest} objects. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#DELETION_MODE_ALL() = 0` Deletion mode to delete all data associated with the selected records. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#DELETION_MODE_EXCLUDE_INTERNAL_DATA() = 1` Deletion mode to delete all data except the internal data (e.g. rate limits) for the selected records. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_DELETE() = 0` Match behavior option to delete the supplied params (Origin/Domains). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_PRESERVE() = 1` Match behavior option to preserve the supplied params (Origin/Domains) and delete everything else. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#DeletionRequest(kotlin.Int,kotlin.Int,java.time.Instant,java.time.Instant,kotlin.collections.List,kotlin.collections.List)( deletionMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, matchBehavior: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, start: https://developer.android.com/reference/java/time/Instant.html, end: https://developer.android.com/reference/java/time/Instant.html, domainUris: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html>, originUris: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html> )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#deletionMode()` Set the deletion mode for the supplied params. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html>` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#domainUris()` the list of domain URI which will be used for matching. |
| `https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#end()` `https://developer.android.com/reference/java/time/Instant.html` Set the end of the deletion range. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#matchBehavior()` Set the match behavior for the supplied params. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html>` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#originUris()` the list of origin URI which will be used for matching. |
| `https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#start()` `https://developer.android.com/reference/java/time/Instant.html` Set the start of the deletion range. |

## Constants

### DELETION_MODE_ALL

```
const val DELETION_MODE_ALL = 0: Int
```

Deletion mode to delete all data associated with the selected records.

### DELETION_MODE_EXCLUDE_INTERNAL_DATA

```
const val DELETION_MODE_EXCLUDE_INTERNAL_DATA = 1: Int
```

Deletion mode to delete all data except the internal data (e.g. rate limits) for the selected records.

### MATCH_BEHAVIOR_DELETE

```
const val MATCH_BEHAVIOR_DELETE = 0: Int
```

Match behavior option to delete the supplied params (Origin/Domains).

### MATCH_BEHAVIOR_PRESERVE

```
const val MATCH_BEHAVIOR_PRESERVE = 1: Int
```

Match behavior option to preserve the supplied params (Origin/Domains) and delete everything else.

## Public constructors

### DeletionRequest

```
DeletionRequest(
    deletionMode: Int,
    matchBehavior: Int,
    start: Instant = Instant.MIN,
    end: Instant = Instant.MAX,
    domainUris: List<Uri> = emptyList(),
    originUris: List<Uri> = emptyList()
)
```

| Parameters |
|---|---|
| `deletionMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Set the deletion mode for the supplied params. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#DELETION_MODE_ALL()`: All data associated with the selected records will be deleted. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#DELETION_MODE_EXCLUDE_INTERNAL_DATA()`: All data except the internal system data (e.g. rate limits) associated with the selected records will be deleted. Value is one of the following: - `0` - `1` <br /> |
| `matchBehavior: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Set the match behavior for the supplied params. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_DELETE()`: This option will use the supplied params (Origin URIs \& Domain URIs) for selecting records for deletion. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_PRESERVE()`: This option will preserve the data associated with the supplied params (Origin URIs \& Domain URIs) and select remaining records for deletion. Value is one of the following: - `0` - `1` <br /> |
| `start: https://developer.android.com/reference/java/time/Instant.html = Instant.MIN` | `https://developer.android.com/reference/java/time/Instant.html` Set the start of the deletion range. Not setting this or passing in java.time.Instant#MIN will cause everything from the oldest record to the specified end be deleted. |
| `end: https://developer.android.com/reference/java/time/Instant.html = Instant.MAX` | `https://developer.android.com/reference/java/time/Instant.html` Set the end of the deletion range. Not setting this or passing in java.time.Instant#MAX will cause everything from the specified start until the newest record to be deleted. |
| `domainUris: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html> = emptyList()` | the list of domain URI which will be used for matching. These will be matched with records using the same domain or any subdomains. E.g. If domainUri is {@code https://example.com}, then {@code https://a.example.com}, {@code https://example.com} and {@code https://b.example.com} will match; {@code https://abcexample.com} will NOT match. A null or empty list will match everything. |
| `originUris: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html> = emptyList()` | the list of origin URI which will be used for matching. These will be matched with records using the same origin only, i.e. subdomains won't match. E.g. If originUri is {@code https://a.example.com}, then {@code https://a.example.com} will match; {@code https://example.com}, {@code https://b.example.com} and {@code https://abcexample.com} will NOT match. A null or empty list will match everything. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### deletionMode

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val deletionMode: Int
```

Set the deletion mode for the supplied params. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#DELETION_MODE_ALL()`: All data associated with the selected records will be deleted. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#DELETION_MODE_EXCLUDE_INTERNAL_DATA()`: All data except the internal system data (e.g. rate limits) associated with the selected records will be deleted.

Value is one of the following:

- `0`
- `1`

<br />

### domainUris

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val domainUris: List<Uri>
```

the list of domain URI which will be used for matching. These will be matched with records using the same domain or any subdomains. E.g. If domainUri is {@code https://example.com}, then {@code https://a.example.com}, {@code https://example.com} and {@code https://b.example.com} will match; {@code https://abcexample.com} will NOT match. A null or empty list will match everything.

### end

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val end: Instant
```

`https://developer.android.com/reference/java/time/Instant.html` Set the end of the deletion range. Not setting this or passing in java.time.Instant#MAX will cause everything from the specified start until the newest record to be deleted.

### matchBehavior

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val matchBehavior: Int
```

Set the match behavior for the supplied params. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_DELETE()`: This option will use the supplied params (Origin URIs \& Domain URIs) for selecting records for deletion. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_PRESERVE()`: This option will preserve the data associated with the supplied params (Origin URIs \& Domain URIs) and select remaining records for deletion.

Value is one of the following:

- `0`
- `1`

<br />

### originUris

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val originUris: List<Uri>
```

the list of origin URI which will be used for matching. These will be matched with records using the same origin only, i.e. subdomains won't match. E.g. If originUri is {@code https://a.example.com}, then {@code https://a.example.com} will match; {@code https://example.com}, {@code https://b.example.com} and {@code https://abcexample.com} will NOT match. A null or empty list will match everything.

### start

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val start: Instant
```

`https://developer.android.com/reference/java/time/Instant.html` Set the start of the deletion range. Not setting this or passing in java.time.Instant#MIN will cause everything from the oldest record to the specified end be deleted.