Class
PCUserRestore
public final class PCUserRestore
Restores and backups users
Methods
getRegisteredExtAuthType(for:targetQueue:completion:)
public static func getRegisteredExtAuthType(
for user: PCUser,
targetQueue: DispatchQueue = .main,
completion: @escaping (_ result: Result<PCExtendedAuthType, Error>) -> Void
)
Returns registered extended authentication method for a user
Parameters
Name | Type | Description |
---|---|---|
user | PCUser |
The user templates will be provided for |
targetQueue | DispatchQueue |
The queue where a closure will be invoked on |
completion | @escaping (_ result: Result<PCExtendedAuthType, Error>) -> Void |
A closure to be invoked after finishing registration |
result | Returns registered templates when success. Otherwise, returns error |
createBackupData(user:backupPassword:targetQueue:completion:)
public static func createBackupData(
user: PCUser,
backupPassword: String,
targetQueue: DispatchQueue = .main,
completion: @escaping (_ result: Result<PCUserBackupData, Error>) -> Void
)
Creates a backup data for the user
Parameters
Name | Type | Description |
---|---|---|
user | PCUser |
The user a backup data will be created for |
completion | @escaping (_ result: Result<PCUserBackupData, Error>) -> Void |
A closure to be invoked after finishing registration |
result | Returns a backup data when success. Otherwise, returns error |
restore(userID:systemID:interactionURL:extAuthTemplate:targetQueue:completion:)
public static func restore(
userID: String,
systemID: String,
interactionURL: URL,
extAuthTemplate: PCExtendedAuthTemplate,
targetQueue: DispatchQueue = .main,
completion: @escaping (_ result: Result<PCUser, Error>) -> Void
)
Restores PCUser
using extended authentication template
Parameters
Name | Type | Description |
---|---|---|
userID | String |
The identifier of the user to be restored |
systemID | String |
The system identifier of the user to be restored |
interactionURL | URL |
The interaction url of the user to be restored |
extAuthTemplate | PCExtendedAuthTemplate |
The registered extended authentication template |
targetQueue | DispatchQueue |
The queue where a closure will be invoked on |
completion | @escaping (_ result: Result<PCUser, Error>) -> Void |
A closure to be invoked after finishing registration |
result | Returns activated instance of restored |
restore(qrValue:extAuthTemplate:targetQueue:completion:)
public static func restore(
qrValue: String,
extAuthTemplate: PCExtendedAuthTemplate,
targetQueue: DispatchQueue = .main,
completion: @escaping (_ result: Result<PCUser, Error>) -> Void
)
Restores PCUser
using extended authentication template using QR code with restoration requisites
Parameters
Name | Type | Description |
---|---|---|
requisites | The qr code with requisites |
|
extAuthTemplate | PCExtendedAuthTemplate |
The registered extended authentication template |
targetQueue | DispatchQueue |
The queue where a closure will be invoked on |
completion | @escaping (_ result: Result<PCUser, Error>) -> Void |
A closure to be invoked after finishing registration |
result | Returns activated instance of restored |
restore(backupData:backupPassword:targetQueue:completion:)
public static func restore(
backupData: PCUserBackupData,
backupPassword: String,
targetQueue: DispatchQueue = .main,
completion: @escaping (_ result: Result<PCUser, Error>) -> Void
)
Restores PCUser
from a backup data
Parameters
Name | Type | Description |
---|---|---|
backupData | PCUserBackupData |
The user's backup data |
targetQueue | DispatchQueue |
The queue where a closure will be invoked on |
completion | @escaping (_ result: Result<PCUser, Error>) -> Void |
A closure to be invoked after finishing registration |
result | Returns activated instance of restored |