IamUtil.deleteUserAsync() Overload 1

DESCRIPTION

Asynchronously delete the specified user from device.

The specified AsyncIamResultReceiver closure is invoked with IamError.OK upon successful completion or with an error if an error occurs. See the deleteUser() function for details about possible error codes.

DECLARATION

static public func deleteUserAsync(connection: Connection, username: String,
                                       closure: @escaping AsyncIamResultReceiver)

PARAMETERS

connection:
An established connection to the device
username:
Username of the user to delete
closure:
Invoked when the user is deleted or an error occurs

Overload 2

DESCRIPTION

Asynchronously delete the specified user from device.

Uses Swift concurrency and is therefore only available on iOS 13 and above.

DECLARATION

static public func deleteUserAsync(connection: Connection, username: String) async throws

PARAMETERS

connection:
An established connection to the device
username:
Username of the user to delete

THROWS ERRORS

USER_DOES_NOT_EXIST:
if the specified user does not exist on the device
BLOCKED_BY_DEVICE_CONFIGURATION:
if the device configuration does not allow deleting this user (the IAM:DeleteUser action for the IAM:Username attribute is not allowed for the requesting role)
IAM_NOT_SUPPORTED:
if Nabto Edge IAM is not supported by the device