---
title: "setCredentialWith(_:expectedValues:expectedValueInterval:completion:)"
framework: matter
role: symbol
role_heading: Instance Method
path: "matter/mtrclusterdoorlock/setcredentialwith(_:expectedvalues:expectedvalueinterval:completion:)"
---

# setCredentialWith(_:expectedValues:expectedValueInterval:completion:)

## Declaration

```swift
func setCredentialWith(_ params: MTRDoorLockClusterSetCredentialParams, expectedValues expectedDataValueDictionaries: [[String : Any]]?, expectedValueInterval expectedValueIntervalMs: NSNumber?, completion: @escaping @Sendable (MTRDoorLockClusterSetCredentialResponseParams?, (any Error)?) -> Void)
```

```swift
func setCredentialWith(_ params: MTRDoorLockClusterSetCredentialParams, expectedValues expectedDataValueDictionaries: [[String : Any]]?, expectedValueInterval expectedValueIntervalMs: NSNumber?) async throws -> MTRDoorLockClusterSetCredentialResponseParams
```
