# MatterTraitClient

# MatterTraitClient


```
interface MatterTraitClient : TraitStateInvalidation
```

<br />

*** ** * ** ***

Provides a very constrained surface for interacting with an individual object and individual cluster

## Summary

| ### Public functions |
|---|---|
| `ObjectCommand` | `<REQUEST : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> https://developers.home.google.com/reference/kotlin/com/google/home/matter/MatterTraitClient#createObjectCommand(com.google.home.matter.serialization.ScopedCommandId,com.google.home.matter.serialization.StructAdapter,kotlin.Any,kotlin.Boolean)( commandId: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/ScopedCommandId, requestAdapter: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/StructAdapter<REQUEST>, request: REQUEST, useTimedCommand: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html )` Create an object command for the given command request |
| `suspend RESPONSE` | `<REQUEST : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?, RESPONSE : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> https://developers.home.google.com/reference/kotlin/com/google/home/matter/MatterTraitClient#sendCommand(com.google.home.matter.serialization.ScopedCommandId,com.google.home.matter.serialization.StructAdapter,com.google.home.matter.serialization.StructAdapter,kotlin.Any,kotlin.Boolean)( commandId: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/ScopedCommandId, requestAdapter: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/StructAdapter<REQUEST>, responseAdapter: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/StructAdapter<RESPONSE>, request: REQUEST, useTimedCommand: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html )` Send the given command. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/MatterTraitClient#strictOperationValidation()()` |
| `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `<T : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> https://developers.home.google.com/reference/kotlin/com/google/home/matter/MatterTraitClient#write(com.google.home.matter.serialization.StructAdapter,kotlin.Any,kotlin.Boolean)( adapter: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/StructAdapter<T>, attributes: T, useTimedInteraction: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html )` Write the attributes of the trait |

| ### Inherited functions |
|---|
| From [com.google.home.TraitStateInvalidation](https://developers.home.google.com/reference/kotlin/com/google/home/TraitStateInvalidation) |---|---| | `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/TraitStateInvalidation#forceRead()()` | |

## Public functions

### createObjectCommand

```
fun <REQUEST : Any?> createObjectCommand(
    commandId: ScopedCommandId,
    requestAdapter: StructAdapter<REQUEST>,
    request: REQUEST,
    useTimedCommand: Boolean
): ObjectCommand
```

Create an object command for the given command request

### sendCommand

```
suspend fun <REQUEST : Any?, RESPONSE : Any?> sendCommand(
    commandId: ScopedCommandId,
    requestAdapter: StructAdapter<REQUEST>,
    responseAdapter: StructAdapter<RESPONSE>,
    request: REQUEST,
    useTimedCommand: Boolean
): RESPONSE
```

Send the given command. Defines how requests and responses are to be encoded

### strictOperationValidation

```
fun strictOperationValidation(): Boolean
```

### write

```
suspend fun <T : Any?> write(
    adapter: StructAdapter<T>,
    attributes: T,
    useTimedInteraction: Boolean = false
): Unit
```

Write the attributes of the trait