# A2uiClientEventMessage

Artifact: [androidx.a2ui:a2ui-model](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/model/protocol/A2uiClientToServerMessage.kt+class:androidx.a2ui.model.protocol.A2uiClientEventMessage) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
public final class A2uiClientEventMessage implements A2uiClientToServerMessage
```

<br />

*** ** * ** ***

Represents a client event message to be sent to the server.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#A2uiClientEventMessage(kotlin.String,kotlin.String,kotlin.String,kotlin.Long,kotlin.collections.Map,androidx.a2ui.model.protocol.A2uiClientDataModel)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html type, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html surfaceId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html componentId, long timestamp, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html> context, https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientDataModel clientDataModel )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientDataModel` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#getClientDataModel()()` An optional snapshot of active client data models to be synchronized with the server alongside this event. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#getComponentId()()` The unique identifier of the component that was interacted with. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html>` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#getContext()()` A map containing custom properties and metadata associated with this action. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#getSurfaceId()()` The unique identifier of the surface where the action occurred. |
| `final long` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#getTimestamp()()` The timestamp of when the action occurred, represented as milliseconds since the epoch. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#getType()()` The type of the action performed (e.g., "click", "swipe"). |
| `int` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientEventMessage#toString()()` |

## Public constructors

### A2uiClientEventMessage

```
public A2uiClientEventMessage(
    @NonNull String type,
    @NonNull String surfaceId,
    @NonNull String componentId,
    long timestamp,
    @NonNull Map<@NonNull String, Object> context,
    A2uiClientDataModel clientDataModel
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getClientDataModel

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

```
public final A2uiClientDataModel getClientDataModel()
```

An optional snapshot of active client data models to be synchronized with the server alongside this event.

### getComponentId

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

```
public final @NonNull String getComponentId()
```

The unique identifier of the component that was interacted with.

### getContext

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

```
public final @NonNull Map<@NonNull String, Object> getContext()
```

A map containing custom properties and metadata associated with this action.

### getSurfaceId

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

```
public final @NonNull String getSurfaceId()
```

The unique identifier of the surface where the action occurred.

### getTimestamp

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

```
public final long getTimestamp()
```

The timestamp of when the action occurred, represented as milliseconds since the epoch.

### getType

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

```
public final @NonNull String getType()
```

The type of the action performed (e.g., "click", "swipe").

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```