AvatarManager
public class AvatarManager
AvatarManagerCloud
is used to handle all operations with avatars in cloud version of SDK.
-
Is used to create avatar on the server.
Declaration
Swift
public class func createAvatar(fromImage image: ImageFrame, name: String = "Default", description: String = "", parameters: PipelineParameters) -> TaskHandler<AvatarModel>
Parameters
image
Image frame which will be used for the avatar generation.
name
Name for this avatar.
description
Description for this avatar.
parameters
Parameters for this avatar.
exportParameters
ExportParameters for this avatar.
Return Value
Task handler object which can be used for subscription on progress and completion callbacks.
-
Is used to retrieve paginated list of available avatar models for current user sorted by date.
Declaration
Swift
public class func getAvatars(useCache: CacheType = .fromServerIfCacheIsEmpty, beforeDate date: Date? = nil, completion: @escaping CompletionHandler<[AvatarModel]>)
Parameters
useCache
Defines where a list of avatar models will be downloaded from.
beforeDate
Avatars in the next retrieved part will start from the specified date. If not specified, the first part of avatars will be retrived.
completion
Closure to be executed once the request has finished.
-
Is used to retrieve the
AvatarModel
from the server.Declaration
Swift
public class func getAvatar(code: String, completion: @escaping CompletionHandler<AvatarModel>)
Parameters
code
The avatar model ID for which the server information should be downloaded.
completion
Closure to be executed once the request has finished.
-
Is used to download the avatar files from the server.
Declaration
Swift
public class func downloadAvatar(avatarModel: AvatarModel) -> TaskHandler<AvatarModel>
Parameters
avatarModel
The avatar model which files should be downloaded.
Return Value
Task handler object which can be used for subscription on progress and completion callbacks.
-
Is used to delete avatar from the server. If this avatar was downloaded on this device than it will be also deleted from the device.
Declaration
Swift
public class func deleteAvatar(avatarModel: AvatarModel, completion: @escaping CompletionHandler<Bool>)
Parameters
avatarModel
The avatar model that should be deleted.
completion
Closure to be executed once the request has finished.
-
Is used to build
AvatarModel
from the server response.Declaration
Swift
public class func buildAvatar(fromResponse response: ResponseAvatarModel) -> AvatarModel
Parameters
response
Information about avatar received from server.
Return Value
The avatar model.