# MessagesCommands

# MessagesCommands


```
@Generated(value = ["GoogleHomePlatformCodegen"])
interface MessagesCommands
```

<br />

Known direct subclasses [Messages](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/Messages)

|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/Messages` | API for the Messages trait. |

*** ** * ** ***

Commands for the Messages trait.

## Summary

| ### Public functions |
|---|---|
| `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesCommands#cancelMessagesRequest(kotlin.collections.List)(messageIds: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html>)` Cancels the messages in the passed fields. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesCommands#cancelMessagesRequestBatchable(kotlin.collections.List)(messageIds: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html>)` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesCommands#cancelMessagesRequest(kotlin.collections.List)` command. |
| `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesCommands#presentMessagesRequest(kotlin.ByteArray,com.google.home.matter.standard.MessagesTrait.MessagePriorityEnum,com.google.home.matter.standard.MessagesTrait.MessageControlBitmap,kotlin.UInt,kotlin.ULong,kotlin.String,kotlin.Function1)( messageId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html, priority: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessagePriorityEnum, messageControl: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageControlBitmap, startTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html?, duration: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?, messageText: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, optionalArgs: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.PresentMessagesRequestCommand.OptionalArgs.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html )` Appends the message in the passed fields to the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.Attributes#messages()` attribute. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesCommands#presentMessagesRequestBatchable(kotlin.ByteArray,com.google.home.matter.standard.MessagesTrait.MessagePriorityEnum,com.google.home.matter.standard.MessagesTrait.MessageControlBitmap,kotlin.UInt,kotlin.ULong,kotlin.String,kotlin.Function1)( messageId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html, priority: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessagePriorityEnum, messageControl: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageControlBitmap, startTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html?, duration: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?, messageText: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, optionalArgs: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.PresentMessagesRequestCommand.OptionalArgs.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html )` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesCommands#presentMessagesRequest(kotlin.ByteArray,com.google.home.matter.standard.MessagesTrait.MessagePriorityEnum,com.google.home.matter.standard.MessagesTrait.MessageControlBitmap,kotlin.UInt,kotlin.ULong,kotlin.String,kotlin.Function1)` command. |

## Public functions

### cancelMessagesRequest

```
suspend fun cancelMessagesRequest(messageIds: List<ByteArray>): Unit
```

Cancels the messages in the passed fields.

### cancelMessagesRequestBatchable

```
fun cancelMessagesRequestBatchable(messageIds: List<ByteArray>): BatchableCommand<Unit>
```

The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesCommands#cancelMessagesRequest(kotlin.collections.List)` command.

Cancels the messages in the passed fields.

| Returns |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html>` | BatchableCommand |

### presentMessagesRequest

```
suspend fun presentMessagesRequest(
    messageId: ByteArray,
    priority: MessagesTrait.MessagePriorityEnum,
    messageControl: MessagesTrait.MessageControlBitmap,
    startTime: UInt?,
    duration: ULong?,
    messageText: String,
    optionalArgs: MessagesTrait.PresentMessagesRequestCommand.OptionalArgs.() -> Unit = {}
): Unit
```

Appends the message in the passed fields to the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.Attributes#messages()` attribute. If appending the message would cause the number of messages to be greater than the capacity of the list, the device will not append any message to `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.Attributes#messages()`, and will return a status code of `RESOURCE_EXHAUSTED`.

| Parameters |
|---|---|
| `priority: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessagePriorityEnum` | The priority level for this message. |
| `messageControl: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageControlBitmap` | The control information related to the message. |
| `startTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html?` | The time, in UTC, at which the message becomes available to be presented. A null value indicates that the message is available immediately. |
| `duration: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?` | The amount of time, in milliseconds, after the `startTime` during which the message is available to be presented. A null value means that the `duration` time remains the same until it's actively changed. |
| `messageText: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | A string that contains the message to be presented to the user. |
| `optionalArgs: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.PresentMessagesRequestCommand.OptionalArgs.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html = {}` | Receiver for the optional arguments of this command |

### presentMessagesRequestBatchable

```
fun presentMessagesRequestBatchable(
    messageId: ByteArray,
    priority: MessagesTrait.MessagePriorityEnum,
    messageControl: MessagesTrait.MessageControlBitmap,
    startTime: UInt?,
    duration: ULong?,
    messageText: String,
    optionalArgs: MessagesTrait.PresentMessagesRequestCommand.OptionalArgs.() -> Unit = {}
): BatchableCommand<Unit>
```

The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesCommands#presentMessagesRequest(kotlin.ByteArray,com.google.home.matter.standard.MessagesTrait.MessagePriorityEnum,com.google.home.matter.standard.MessagesTrait.MessageControlBitmap,kotlin.UInt,kotlin.ULong,kotlin.String,kotlin.Function1)` command.

Appends the message in the passed fields to the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.Attributes#messages()` attribute. If appending the message would cause the number of messages to be greater than the capacity of the list, the device will not append any message to `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.Attributes#messages()`, and will return a status code of `RESOURCE_EXHAUSTED`.

| Parameters |
|---|---|
| `priority: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessagePriorityEnum` | The priority level for this message. |
| `messageControl: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageControlBitmap` | The control information related to the message. |
| `startTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html?` | The time, in UTC, at which the message becomes available to be presented. A null value indicates that the message is available immediately. |
| `duration: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?` | The amount of time, in milliseconds, after the `startTime` during which the message is available to be presented. A null value means that the `duration` time remains the same until it's actively changed. |
| `messageText: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | A string that contains the message to be presented to the user. |
| `optionalArgs: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.PresentMessagesRequestCommand.OptionalArgs.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html = {}` | Receiver for the optional arguments of this command |

| Returns |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html>` | BatchableCommand |