Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#nestedclasses) \| [Constants](https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#constants) \| [Methods](https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#inhmethods)

# DeletionRequest

*** ** * ** ***

` public class DeletionRequest `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.adservices.measurement.DeletionRequest |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 37.**   

The Rubidium (Rb) Measurement APIs, including those in android.adservices.measurement, are being deprecated. There are no direct replacement APIs for the Measurement APIs. Developers currently using these APIs should cease integration, as calls to these APIs will be rejected in upcoming Android releases as part of a soft removal process. Please refer to the official Privacy Sandbox developer documentation and announcements for more details on this deprecation and the future roadmap of Privacy Sandbox on Android: https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/

Deletion Request.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest.Builder` *This class was deprecated in API level 37. See `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest` for the deprecation details.* |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#DELETION_MODE_ALL` Deletion mode to delete all data associated with the selected records. |
| `int` | `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#DELETION_MODE_EXCLUDE_INTERNAL_DATA` Deletion mode to delete all data except the internal data (e.g. rate limits) for the selected records. |
| `int` | `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_DELETE` Match behavior option to delete the supplied params (Origin/Domains). |
| `int` | `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_PRESERVE` Match behavior option to preserve the supplied params (Origin/Domains) and delete everything else. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#getDeletionMode()() ` Get the deletion mode. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri>` | ` https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#getDomainUris()() ` Get the list of domain URIs. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#getEnd()() ` Get the end of the deletion range. |
| ` int` | ` https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#getMatchBehavior()() ` Get the match behavior. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri>` | ` https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#getOriginUris()() ` Get the list of origin URIs. |
| ` https://developer.android.com/reference/java/time/Instant` | ` https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#getStart()() ` Get the start of the deletion range. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### DELETION_MODE_ALL

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DELETION_MODE_ALL
```

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

<br />

Constant Value: 0 (0x00000000)

### DELETION_MODE_EXCLUDE_INTERNAL_DATA

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DELETION_MODE_EXCLUDE_INTERNAL_DATA
```

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

<br />

Constant Value: 1 (0x00000001)

### MATCH_BEHAVIOR_DELETE

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MATCH_BEHAVIOR_DELETE
```

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

<br />

Constant Value: 0 (0x00000000)

### MATCH_BEHAVIOR_PRESERVE

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MATCH_BEHAVIOR_PRESERVE
```

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

<br />

Constant Value: 1 (0x00000001)

## Public methods

### getDeletionMode

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getDeletionMode ()
```

Get the deletion mode.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#DELETION_MODE_ALL` - `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#DELETION_MODE_EXCLUDE_INTERNAL_DATA` |

### getDomainUris

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Uri> getDomainUris ()
```

Get the list of domain URIs.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri>` | This value cannot be `null`. <br /> |

### getEnd

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Instant getEnd ()
```

Get the end of the deletion range.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | This value cannot be `null`. <br /> |

### getMatchBehavior

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMatchBehavior ()
```

Get the match behavior.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_DELETE` - `https://developer.android.com/reference/android/adservices/measurement/DeletionRequest#MATCH_BEHAVIOR_PRESERVE` |

### getOriginUris

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Uri> getOriginUris ()
```

Get the list of origin URIs.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri>` | This value cannot be `null`. <br /> |

### getStart

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Instant getStart ()
```

Get the start of the deletion range.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Instant` | This value cannot be `null`. <br /> |