# ZoneManagementTrait.TwoDCartesianZoneStruct

# ZoneManagementTrait.TwoDCartesianZoneStruct


```
class ZoneManagementTrait.TwoDCartesianZoneStruct : ClusterStruct
```

<br />

*** ** * ** ***

Encodes all information needed to define a `TwoDCartesianZone`.

## 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/ZoneManagementTrait.TwoDCartesianZoneStruct.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/ZoneManagementTrait.TwoDCartesianZoneStruct#TwoDCartesianZoneStruct(kotlin.String,com.google.home.matter.standard.ZoneManagementTrait.ZoneUseEnum,kotlin.collections.List,com.google.home.matter.serialization.OptionalValue)( name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, use: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.ZoneUseEnum, vertices: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.TwoDCartesianVertexStruct>, color: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html> )` Creates the TwoDCartesianZoneStruct 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/ZoneManagementTrait.TwoDCartesianZoneStruct#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/ZoneManagementTrait.TwoDCartesianZoneStruct#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://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.TwoDCartesianZoneStruct#color()` The color, in RGB or RGBA, used for attaching a color to the zone definition. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.TwoDCartesianZoneStruct#name()` A string representing the name of the Zone. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.ZoneUseEnum` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.TwoDCartesianZoneStruct#use()` A `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.ZoneUseEnum` value representing the purpose of the zone. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.TwoDCartesianVertexStruct>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.TwoDCartesianZoneStruct#vertices()` A list of vertices of type `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.TwoDCartesianVertexStruct`. |

## Public constructors

### TwoDCartesianZoneStruct

```
TwoDCartesianZoneStruct(
    name: String = "",
    use: ZoneManagementTrait.ZoneUseEnum = ZoneUseEnum.Motion,
    vertices: List<ZoneManagementTrait.TwoDCartesianVertexStruct> = emptyList(),
    color: OptionalValue<String> = OptionalValue.absent()
)
```

Creates the TwoDCartesianZoneStruct 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

### color

```
val color: OptionalValue<String>
```

The color, in RGB or RGBA, used for attaching a color to the zone definition. This value is informational only and has no effect on the behavior of the zone.

### name

```
val name: String
```

A string representing the name of the Zone. This is not guaranteed to be unique.

### use

```
val use: ZoneManagementTrait.ZoneUseEnum
```

A `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.ZoneUseEnum` value representing the purpose of the zone.

### vertices

```
val vertices: List<ZoneManagementTrait.TwoDCartesianVertexStruct>
```

A list of vertices of type `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ZoneManagementTrait.TwoDCartesianVertexStruct`. These vertices define a simple polygon on the TwoD Cartesian plane, which represents the bounds of the `TwoD Cartesian Zone` with an implicit connection between the last and first list items.