# A2uiCreateSurfaceMessage

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/A2uiServerToClientMessage.kt+class:androidx.a2ui.model.protocol.A2uiCreateSurfaceMessage) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
class A2uiCreateSurfaceMessage : A2uiServerToClientMessage
```

<br />

*** ** * ** ***

Creates a new surface instance on the client.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#A2uiCreateSurfaceMessage(kotlin.String,kotlin.String,kotlin.collections.Map,kotlin.Boolean)( surfaceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, catalogId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, theme: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>, shouldSendDataModel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#catalogId()` The ID of the component catalog to use for this surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#shouldSendDataModel()` If true, the client will append its active UI data model state tree as metadata to subsequent outgoing messages. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#surfaceId()` The unique ID to assign to the new surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/protocol/A2uiCreateSurfaceMessage#theme()` An optional map of theme-specific property overrides (e.g., colors, spacing). |

## Public constructors

### A2uiCreateSurfaceMessage

```
A2uiCreateSurfaceMessage(
    surfaceId: String,
    catalogId: String,
    theme: Map<String, Any?> = emptyMap(),
    shouldSendDataModel: Boolean = false
)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### catalogId

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

```
val catalogId: String
```

The ID of the component catalog to use for this surface.

### shouldSendDataModel

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

```
val shouldSendDataModel: Boolean
```

If true, the client will append its active UI data model state tree as metadata to subsequent outgoing messages. Defaults to false.

### surfaceId

```
open val surfaceId: String
```

The unique ID to assign to the new surface.

### theme

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

```
val theme: Map<String, Any?>
```

An optional map of theme-specific property overrides (e.g., colors, spacing).