MembershipClient
public class MembershipClient
An iOS client wrapper of the Cisco Webex Space Memberships REST API .
Since
1.2.0-
The callback to receive events about membership changes.
Since
2.3.0Declaration
Swift
public var onEvent: ((MembershipEvent) -> Void)? { get set } -
The callback to receive events with the event payload about membership changes.
Since
2.3.0Declaration
Swift
public var onEventWithPayload: ((MembershipEvent, WebexEventPayload) -> Void)? { get set } -
Lists all space memberships where the authenticated user belongs.
Since
1.2.0Declaration
Swift
public func list(max: Int? = nil, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<[Membership]>) -> Void)Parameters
maxThe maximum number of items 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
-
Lists all memberships in the given space by space Id.
Since
1.2.0Declaration
Swift
public func list(spaceId: String, max: Int? = nil, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<[Membership]>) -> Void)Parameters
spaceIdThe identifier of the space where the membership belongs. (Derived parameter: Use
SpaceClient.list(...)to get the list of spaces. Then useSpace.idto retrieve the spaceId)maxThe maximum number of memberships 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
-
Lists any space memberships for the given space (by space id) and person (by person id).
Since
1.2.0Declaration
Swift
public func list(spaceId: String, personId: String, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<[Membership]>) -> Void)Parameters
spaceIdThe identifier of the space where the memberships belong. (Derived parameter: Use
SpaceClient.list(...)to get the list of spaces. Then useSpace.idto retrieve the spaceId)personIdThe identifier of the person who has the memberships. (Derived parameter: Use
MembershipClient.list(...)to get the list of members. Then useMembership.personIdto get the personId of the member)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
-
Lists any space memberships for the given space (by space id) and person (by email address).
Since
1.2.0Declaration
Swift
public func list(spaceId: String, personEmail: EmailAddress, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<[Membership]>) -> Void)Parameters
spaceIdThe identifier of the space where the memberships belong. (Derived parameter: Use
SpaceClient.list(...)to get the list of spaces. Then useSpace.idto retrieve the spaceId)personEmailThe email address of the person who has the memberships. (Derived parameter: Use
MembershipClient.list(...)to get the list of members. Then useMembership.personEmailto get the email address of the member)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 membership by membership id.
Since
1.2.0Declaration
Swift
public func get(membershipId: String, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<Membership>) -> Void)Parameters
membershipIdThe identifier of the membership. (Derived parameter: Use
MembershipClient.list(...)to get the list of members. Then useMembership.idto retrieve the membershipId)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
-
Adds a person to a space by person id; optionally making the person a moderator.
Since
1.2.0Declaration
Swift
public func create(spaceId: String, personId: String, isModerator: Bool = false, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<Membership>) -> Void)Parameters
spaceIdThe identifier of the space where the person is to be added. (Derived parameter: Use
SpaceClient.list(...)to get the list of spaces. Then useSpace.idto retrieve the spaceId)personIdThe identifier of the person to be added. (Derived parameter: Use
MembershipClient.list(...)to get the list of members. Then useMembership.personIdto get the personId of the member)isModeratorIf true, make the person a moderator of the space. The default is false.
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
-
Adds a person to a space by email address; optionally making the person a moderator.
Since
1.2.0Declaration
Swift
public func create(spaceId: String, personEmail: EmailAddress, isModerator: Bool = false, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<Membership>) -> Void)Parameters
spaceIdThe identifier of the space where the person is to be added. (Derived parameter: Use
SpaceClient.list(...)to get the list of spaces. Then useSpace.idto retrieve the spaceId)personEmailThe email address of the person to be added. (Derived parameter: Use
MembershipClient.list(...)to get the list of members. Then useMembership.personEmailto get the email address of the member)isModeratorIf true, make the person a moderator of the space. The default is false.
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
-
Updates the properties of a membership by membership id.
Since
1.2.0Declaration
Swift
public func update(membershipId: String, isModerator: Bool, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<Membership>) -> Void)Parameters
membershipIdThe identifier of the membership. (Derived parameter: Use
MembershipClient.list(...)to get the list of members. Then useMembership.idto retrieve the membershipId)isModeratorIf true, make the person a moderator of the space in this membership. The default is false.
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
-
Deletes a membership by membership id. It removes the person from the space where the membership belongs.
Since
1.2.0Declaration
Swift
public func delete(membershipId: String, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<Void>) -> Void)Parameters
membershipIdThe identifier of the membership. (Derived parameter: Use
MembershipClient.list(...)to get the list of members. Then useMembership.idto retrieve the membershipId)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
-
Returns a list of memberships with details about the lastSeenId for each user so that application can tell which message was the last message was read by each user.
Since
2.3.0Declaration
Swift
public func listWithReadStatus(spaceId: String, queue: DispatchQueue? = nil, completionHandler: @escaping (Result<[MembershipReadStatus]>) -> Void)Parameters
spaceIdThe identifier of the space. (Derived parameter: Use
SpaceClient.list(...)to get the list of spaces. Then useSpace.idto retrieve the spaceId)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