# MessagesTrait.MessageStruct

# MessagesTrait.MessageStruct


```
class MessagesTrait.MessageStruct : ClusterStruct
```

<br />

*** ** * ** ***

Information about a single message.

## Summary

| ### Nested types |
|---|
| `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi enum https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct.StructFields : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/Field` Descriptor enum for this struct's fields. |

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#MessageStruct(kotlin.ByteArray,com.google.home.matter.standard.MessagesTrait.MessagePriorityEnum,com.google.home.matter.standard.MessagesTrait.MessageControlBitmap,kotlin.UInt,kotlin.ULong,kotlin.String,com.google.home.matter.serialization.OptionalValue)( 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, responses: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageResponseOptionStruct>> )` Creates the MessageStruct class. |

| ### Public functions |
|---|---|
| `open https://developers.home.google.com/reference/kotlin/com/google/home/StructDescriptor` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#getDescriptor()()` Returns the descriptor for the struct. |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#getFieldValueById(kotlin.UInt)(tagId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html)` Returns the value of the field for the given tag ID. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#duration()` The amount of time, in milliseconds, after the `startTime` during which the message is available to be presented. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageControlBitmap` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#messageControl()` Control information related to the message. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#messageId()` A globally unique ID for this message. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#messageText()` A string that contains the message to be presented. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessagePriorityEnum` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#priority()` The priority level for this message. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageResponseOptionStruct>>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#responses()` A list of responses that the user can select to dismiss the message. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MessagesTrait.MessageStruct#startTime()` The time, in UTC, at which the message becomes available to be presented. |

## Public constructors

### MessageStruct

```
MessageStruct(
    messageId: ByteArray = ByteArray(0),
    priority: MessagesTrait.MessagePriorityEnum = MessagePriorityEnum.Low,
    messageControl: MessagesTrait.MessageControlBitmap = MessageControlBitmap(),
    startTime: UInt? = null,
    duration: ULong? = null,
    messageText: String = "",
    responses: OptionalValue<List<MessagesTrait.MessageResponseOptionStruct>> = OptionalValue.absent()
)
```

Creates the MessageStruct class.

## Public functions

### getDescriptor

```
@HomeExperimentalGenericApi
open fun getDescriptor(): StructDescriptor
```

Returns the descriptor for the struct.

### getFieldValueById

```
@HomeExperimentalGenericApi
open fun getFieldValueById(tagId: UInt): Any?
```

Returns the value of the field for the given tag ID.

## Public properties

### duration

```
val duration: ULong?
```

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.

### messageControl

```
val messageControl: MessagesTrait.MessageControlBitmap
```

Control information related to the message.

### messageId

```
val messageId: ByteArray
```

A globally unique ID for this message.

### messageText

```
val messageText: String
```

A string that contains the message to be presented.

### priority

```
val priority: MessagesTrait.MessagePriorityEnum
```

The priority level for this message.

### responses

```
val responses: OptionalValue<List<MessagesTrait.MessageResponseOptionStruct>>
```

A list of responses that the user can select to dismiss the message.

### startTime

```
val startTime: UInt?
```

The time, in UTC, at which the message becomes available to be presented. A null value indicates that the message is available immediately.