# CommandCandidate

# CommandCandidate


```
class CommandCandidate : ActionCandidate
```

<br />

*** ** * ** ***

Represents automation candidate node corresponding to a command. These can be used in actions.

## Summary

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#CommandCandidate(com.google.home.HasId,kotlin.collections.List,com.google.home.TraitFactory,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.List,kotlin.String,com.google.home.CommandDescriptor)( entity: https://developers.home.google.com/reference/kotlin/com/google/home/HasId, types: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceTypeFactory<https://developers.home.google.com/reference/kotlin/com/google/home/DeviceType>>, trait: https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>, fields: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandFieldDetails>, fieldDetailsMap: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/Field, https://developers.home.google.com/reference/kotlin/com/google/home/automation/FieldDetails>, unsupportedReasons: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/automation/UnsupportedCandidateReason>, commandId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, commandDescriptor: https://developers.home.google.com/reference/kotlin/com/google/home/CommandDescriptor )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#equals(kotlin.Any)(other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#hashCode()()` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#toString()()` |

| ### Public properties |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/CommandDescriptor` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#commandDescriptor()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#commandId()` **This property is deprecated.** Use commandDescriptor instead |
| `open https://developers.home.google.com/reference/kotlin/com/google/home/HasId` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#entity()` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/Field, https://developers.home.google.com/reference/kotlin/com/google/home/automation/FieldDetails>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#fieldDetailsMap()` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandFieldDetails>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#fields()` **This property is deprecated.** Use fieldDetailsMap instead |
| `open https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/Trait>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#trait()` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<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/CommandCandidate#types()` |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/automation/UnsupportedCandidateReason>` | `https://developers.home.google.com/reference/kotlin/com/google/home/automation/CommandCandidate#unsupportedReasons()` |

## Public constructors

### CommandCandidate

```
CommandCandidate(
    entity: HasId,
    types: List<DeviceTypeFactory<DeviceType>>,
    trait: TraitFactory<Trait>,
    fields: Map<String, CommandFieldDetails>,
    fieldDetailsMap: Map<Field, FieldDetails> = emptyMap(),
    unsupportedReasons: List<UnsupportedCandidateReason> = emptyList(),
    commandId: String,
    commandDescriptor: CommandDescriptor
)
```

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### commandDescriptor

```
val commandDescriptor: CommandDescriptor
```

### commandId

```
val commandId: String
```

> [!CAUTION]
> **This property is deprecated.**   
> Use commandDescriptor instead

### entity

```
open val entity: HasId
```

### fieldDetailsMap

```
open val fieldDetailsMap: Map<Field, FieldDetails>
```

### fields

```
open val fields: Map<String, CommandFieldDetails>
```

> [!CAUTION]
> **This property is deprecated.**   
> Use fieldDetailsMap instead

### trait

```
open val trait: TraitFactory<Trait>
```

### types

```
open val types: List<DeviceTypeFactory<DeviceType>>
```

### unsupportedReasons

```
open val unsupportedReasons: List<UnsupportedCandidateReason>
```