HAResponseCurrentUser
public struct HAResponseCurrentUser : HADataDecodable
The current user
-
The ID of the user; this is a long hex string
Declaration
Swift
public var id: String
-
The name of the user, if one is set
Declaration
Swift
public var name: String?
-
Whether the user is an owner
Declaration
Swift
public var isOwner: Bool
-
Whether the user is an admin
Admins have access to a different set of commands; you may need to handle failures for commands which are not allowed to be executed by non-admins.
Declaration
Swift
public var isAdmin: Bool
-
Which credentials apply to this user
Declaration
Swift
public var credentials: [Credential]
-
Which MFA modules are available, which may include those not enabled
Declaration
Swift
public var mfaModules: [MFAModule]
-
A credential authentication provider
See moreDeclaration
Swift
public struct Credential : HADataDecodable
-
An MFA module
See moreDeclaration
Swift
public struct MFAModule : HADataDecodable
-
Create with data
Throws
If any required keys are missingDeclaration
Swift
public init(data: HAData) throws
Parameters
data
The data from the server
-
Create with information
Declaration
Swift
public init( id: String, name: String?, isOwner: Bool, isAdmin: Bool, credentials: [Credential], mfaModules: [MFAModule] )
Parameters
id
The id of the user
name
The name of the user
isOwner
Whether the user is an owner
isAdmin
Whether the user is an admin
credentials
Credentials for the user
mfaModules
MFA Modules for the user