# ActionBuilder

# ActionBuilder


```
@AutomationDsl
class ActionBuilder
```

<br />

*** ** * ** ***

Type-safe builder that builds an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action` node.

## Summary

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder#ActionBuilder(com.google.home.HasId,com.google.home.DeviceTypeFactory,com.google.home.automation.Expression)( entity: https://developers.home.google.com/reference/kotlin/com/google/home/HasId?, deviceType: https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>?, entityExpression: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression )` Create an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder` instance. |

| ### Public functions |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder#build()()` Build an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder#command(com.google.home.automation.Command)(command: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command)` Build a `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command`. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `<T : https://developers.home.google.com/reference/kotlin/com/google/home/Trait> https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder#update(com.google.home.TraitFactory,kotlin.Function1)(trait: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<T>, block: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater<T>.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Build an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Update` from an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater`. |

| ### Public properties |
|---|---|
| `lateinit https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBehavior` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder#actionBehavior()` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder#deviceType()` The `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType` associated with the `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HasId?` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder#entity()` The unique ID of the entity associated with the `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder#entityExpression()` The entity `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression` associated with the `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`. |

## Public constructors

### ActionBuilder

```
ActionBuilder(
    entity: HasId? = null,
    deviceType: DeviceTypeFactory<DeviceType>? = null,
    entityExpression: Expression
)
```

Create an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/ActionBuilder` instance.

## Public functions

### build

```
fun build(): Action
```

Build an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`.

| Returns |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action` | An `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action` instance. |

### command

```
fun command(command: Command): Unit
```

Build a `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command`.

| Parameters |
|---|---|
| `command: https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command` | The `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Command` associated with the `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`. |

### update

```
fun <T : Trait> update(trait: TraitFactory<T>, block: Updater<T>.() -> Unit): Unit
```

Build an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Update` from an `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Updater`.

## Public properties

### actionBehavior

```
lateinit var actionBehavior: ActionBehavior
```

### deviceType

```
val deviceType: DeviceTypeFactory<DeviceType>?
```

The `https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType` associated with the `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`.

### entity

```
val entity: HasId?
```

The unique ID of the entity associated with the `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`.

### entityExpression

```
val entityExpression: Expression
```

The entity `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Expression` associated with the `https://developers.home.google.com/reference/kotlin/com/google/home/automation/Action`.