# DoorLockTrait.SetCredentialCommand.Request

# DoorLockTrait.SetCredentialCommand.Request


```
class DoorLockTrait.SetCredentialCommand.Request : ClusterStruct
```

<br />

*** ** * ** ***

The request payload for the SetCredential command.

## 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/DoorLockTrait.SetCredentialCommand.Request.CommandFields : 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 command's request fields. |

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.SetCredentialCommand.Request#Request(com.google.home.matter.standard.DoorLockTrait.DataOperationTypeEnum,com.google.home.matter.standard.DoorLockTrait.CredentialStruct,kotlin.ByteArray,kotlin.UShort,com.google.home.matter.standard.DoorLockTrait.UserStatusEnum,com.google.home.matter.standard.DoorLockTrait.UserTypeEnum)( operationType: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.DataOperationTypeEnum, credential: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.CredentialStruct, credentialData: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html, userIndex: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html?, userStatus: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.UserStatusEnum?, userType: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.UserTypeEnum? )` Creates a request payload for the SetCredential command. |

| ### 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/DoorLockTrait.SetCredentialCommand.Request#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/DoorLockTrait.SetCredentialCommand.Request#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/standard/DoorLockTrait.CredentialStruct` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.SetCredentialCommand.Request#credential()` The credential to be set. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.SetCredentialCommand.Request#credentialData()` The credential data to set for the credential being added or modified. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.DataOperationTypeEnum` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.SetCredentialCommand.Request#operationType()` The operation to be performed. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.SetCredentialCommand.Request#userIndex()` The unique identifier for the user record that corresponds to the credential being added or modified. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.UserStatusEnum?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.SetCredentialCommand.Request#userStatus()` The user status to use in the new user record if a new user is being created. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.UserTypeEnum?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.SetCredentialCommand.Request#userType()` The user type to use in the new user record if a new user is being created. |

## Public constructors

### Request

```
Request(
    operationType: DoorLockTrait.DataOperationTypeEnum = DataOperationTypeEnum.Add,
    credential: DoorLockTrait.CredentialStruct = CredentialStruct(),
    credentialData: ByteArray = ByteArray(0),
    userIndex: UShort? = null,
    userStatus: DoorLockTrait.UserStatusEnum? = null,
    userType: DoorLockTrait.UserTypeEnum? = null
)
```

Creates a request payload for the SetCredential command.

## 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

### credential

```
val credential: DoorLockTrait.CredentialStruct
```

The credential to be set.

### credentialData

```
val credentialData: ByteArray
```

The credential data to set for the credential being added or modified.

### operationType

```
val operationType: DoorLockTrait.DataOperationTypeEnum
```

The operation to be performed.

### userIndex

```
val userIndex: UShort?
```

The unique identifier for the user record that corresponds to the credential being added or modified.

### userStatus

```
val userStatus: DoorLockTrait.UserStatusEnum?
```

The user status to use in the new user record if a new user is being created. Valid values are defined by `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.UserStatusEnum`.

### userType

```
val userType: DoorLockTrait.UserTypeEnum?
```

The user type to use in the new user record if a new user is being created. Valid values are defined by `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DoorLockTrait.UserTypeEnum`.