# AlarmInstance

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

*** ** * ** ***


```
@Document(name = "builtin:AlarmInstance")
class AlarmInstance : Thing
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing) ||
|   | ↳ | [androidx.appsearch.builtintypes.AlarmInstance](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance) |

*** ** * ** ***

AppSearch document representing an `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` entity.

An `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` must be associated with an `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm`. It represents a particular point in time for that Alarm. For example, if an Alarm is set to repeat every Monday, then each `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` for it will be the exact Mondays that the Alarm did trigger.

The scheduled time should be timezone independent so that it remains unchanged across timezones. E.g.: An `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` set to fire at 7am GMT should also fire at 7am when the timezone is changed to PST.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.BuilderProducer class https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance.Builder : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance.Builder!>` Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`. |
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi class https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<T : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<T!>?> : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase<T!>` |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_DISMISSED() = 3` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` has been dismissed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_FIRING() = 2` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is firing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_MISSED() = 5` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` has been missed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_SCHEDULED() = 1` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is scheduled to fire at some point in the future. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_SNOOZED() = 4` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` has been snoozed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_UNKNOWN() = 0` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is in an unknown error state. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#AlarmInstance(androidx.appsearch.builtintypes.AlarmInstance.BuilderBase<?>)(builder: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<*>)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#getScheduledTime()()` Returns the time that this is expected to fire in ISO 8601 format. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#getSnoozeDurationMillis()()` Returns the length of time in milliseconds the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` will remain snoozed before it fires again, or -1 if it does not support snoozing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#getStatus()()` Returns the current status. |

### Inherited functions

From [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing) `(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://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getAlternateNames()()`

Returns an unmodifiable list of aliases, if any, for this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()()`

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDescription()()`

Returns a description of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDocumentScore()()`

Returns the intrinsic score (or importance) of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDocumentTtlMillis()()`

Returns the time-to-live timestamp, in milliseconds since `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()`, for this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getId()()`

Returns the unique identifier for this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getImage()()`

Returns the URL for an image of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getName()()`

Returns the name of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getNamespace()()`

Returns the namespace (or logical grouping) for this item.
`(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/builtintypes/PotentialAction!>` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getPotentialActions()()`

Returns the actions that can be taken on this object.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getUrl()()`

Returns the deeplink URL of this item.

## Constants

### STATUS_DISMISSED

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

```
const val STATUS_DISMISSED = 3: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` has been dismissed.

### STATUS_FIRING

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

```
const val STATUS_FIRING = 2: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is firing.

### STATUS_MISSED

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

```
const val STATUS_MISSED = 5: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` has been missed.

### STATUS_SCHEDULED

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

```
const val STATUS_SCHEDULED = 1: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is scheduled to fire at some point in the future.

### STATUS_SNOOZED

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

```
const val STATUS_SNOOZED = 4: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` has been snoozed.

### STATUS_UNKNOWN

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

```
const val STATUS_UNKNOWN = 0: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is in an unknown error state.

## Public constructors

### AlarmInstance

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

```
@ExperimentalAppSearchApi
AlarmInstance(builder: AlarmInstance.BuilderBase<*>)
```

Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

| Parameters |
|---|---|
| `builder: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<*>` | The builder to construct the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` from. |

## Public functions

### getScheduledTime

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

```
fun getScheduledTime(): String
```

Returns the time that this is expected to fire in ISO 8601 format. E.g.: 2022-01-14T00:00:00

The scheduledTime is a timezone independent date time. When used, it should be converted into a date time in the local timezone.

### getSnoozeDurationMillis

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

```
fun getSnoozeDurationMillis(): Long
```

Returns the length of time in milliseconds the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` will remain snoozed before it fires again, or -1 if it does not support snoozing.

### getStatus

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

```
fun getStatus(): Int
```

Returns the current status.

Status can be either `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_UNKNOWN()`, `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_SCHEDULED()`, `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_FIRING()`, `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_DISMISSED()`, `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_SNOOZED()`, or `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance#STATUS_MISSED()`.