IamUtil.getUserAsync() Overload 1

DESCRIPTION

Asynchronously get details about a specific user.

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

DECLARATION

static public func getUserAsync(connection: Connection,
                                    username: String,
                                    closure: @escaping AsyncIamResultReceiverWithData<IamUser>)

PARAMETERS

connection:
An established connection to the device
username:
Username of the user to get
closure:
Invoked when the user information is successfully retrieved or retrieval fails.

Overload 2

DESCRIPTION

Asynchronously get details about a specific user.

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

DECLARATION

static public func getUserAsync(connection: Connection, username: String) async throws -> IamUser

PARAMETERS

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

THROWS ERRORS

USER_DOES_NOT_EXIST:
if the user does not exist on the device
BLOCKED_BY_DEVICE_CONFIGURATION:
if the device configuration does not allow retrieving this user (the IAM:GetUser action is not set for the requesting role)
IAM_NOT_SUPPORTED:
if Nabto Edge IAM is not supported by the device

RETURNS

an IamUser instance describing the requested user