PersonClient
public class PersonClient
An iOS client wrapper of the Cisco Spark People REST API .
Since
1.2.0-
Lists people in the authenticated user’s organization.
Since
1.2.0Declaration
Swift
public func list(email: EmailAddress? = nil, displayName: String? = nil, id: String? = nil, orgId: String? = nil, max: Int? = nil, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<[Person]>) -> Void)Parameters
emailif not nil, only list people with this email address.
displayNameif not nil, only list people whose name starts with this string.
idList people by ID. Accepts up to 85 person IDs separated by commas.
orgIdList people in this organization. Only admin users of another organization (such as partners) may use this parameter.
maxThe maximum number of people in the response.
queueIf not nil, the queue on which the completion handler is dispatched. Otherwise, the handler is dispatched on the application’s main thread.
completionHandlerA closure to be executed once the request has finished.
Return Value
Void
-
Retrieves the details for a person by person id.
Since
1.2.0Declaration
Swift
public func get(personId: String, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Person>) -> Void)Parameters
personIdThe identifier of the person.
queueIf not nil, the queue on which the completion handler is dispatched. Otherwise, the handler is dispatched on the application’s main thread.
completionHandlerA closure to be executed once the request has finished.
Return Value
Void
-
Retrieves the details for the authenticated user.
Since
1.2.0Declaration
Swift
public func getMe(queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Person>) -> Void)Parameters
queueIf not nil, the queue on which the completion handler is dispatched. Otherwise, the handler is dispatched on the application’s main thread.
completionHandlerA closure to be executed once the request has finished.
Return Value
Void
-
Create people in the authenticated user’s organization. Only admins are able to use this function
Since
1.4.0Declaration
Swift
public func create(email: EmailAddress, displayName: String? = nil, firstName: String? = nil, lastName: String? = nil, avatar: String? = nil, orgId: String? = nil, roles: String? = nil, licenses: String? = nil, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Person>) -> Void)Parameters
emailEmail address of the person.
displayNameFull name of the person.
firstNamefirstName name of the person.
lastNamelastName firstName name of the person.
avatarURL to the person’s avatar in PNG format.
orgIdID of the organization to which this person belongs.
rolesRoles of the person.
licensesLicenses allocated to the person.
queueIf not nil, the queue on which the completion handler is dispatched. Otherwise, the handler is dispatched on the application’s main thread.
completionHandlerA closure to be executed once the request has finished.
Return Value
Person
-
update(personId:email:displayName:firstName:lastName:avatar:orgId:roles:licenses:queue:completionHandler:)Update people in the authenticated user’s organization. Only admins are able to use this function
Since
1.4.0Declaration
Swift
public func update(personId: String, email: EmailAddress? = nil, displayName: String? = nil, firstName: String? = nil, lastName: String? = nil, avatar: String? = nil, orgId: String? = nil, roles: String? = nil, licenses: String? = nil, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Person>) -> Void)Parameters
personIdThe identifier of the person.
emailEmail address of the person.
displayNameFull name of the person.
firstNamefirstName name of the person.
lastNamelastName firstName name of the person.
avatarURL to the person’s avatar in PNG format.
orgIdID of the organization to which this person belongs.
rolesRoles of the person.
licensesLicenses allocated to the person.
queueIf not nil, the queue on which the completion handler is dispatched. Otherwise, the handler is dispatched on the application’s main thread.
completionHandlerA closure to be executed once the request has finished.
Return Value
Person
-
Delete the details of person by person id. Only admins are able to use this function
Since
1.4.0Declaration
Swift
public func delete(personId: String, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Any>) -> Void)Parameters
personIdThe identifier of the person.
queueIf not nil, the queue on which the completion handler is dispatched. Otherwise, the handler is dispatched on the application’s main thread.
completionHandlerA closure to be executed once the request has finished.
Return Value
Void
View on GitHub
PersonClient Class Reference