# Groups

class Groups

The group service.

This class allows performing group related actions such as creating a new group, retrieving available groups or deleting an exiting one. It also allows adding a listener to receive general group events (@see GroupsListener).

## Properties

rx
Link copied to clipboard
val rx: GroupsRx

Access to the reactive API of the service.

## Functions

addListener
Link copied to clipboard
fun addListener(listener: GroupsListener)

Adds a listener to receive group events.

create
Link copied to clipboard
fun create(groupName: String, onCompletion: (Either<Group, SippoResourceError>) -> Unit)

Creates a new group.

delete
Link copied to clipboard
fun delete(group: Group, onCompletion: (SippoResourceError?) -> Unit)

Deletes the specified group. Note: The user needs to be the group's owner.

getGroup
Link copied to clipboard
fun getGroup(groupId: String, onCompletion: (Either<Group, SippoResourceError>) -> Unit)

Gets the group identified by a given groupId.

getGroups
Link copied to clipboard
fun getGroups(userIsParticipant: Boolean, onCompletion: (Either<List<Group>, SippoResourceError>) -> Unit)

Gets the user's groups.

leaveAllGroups
Link copied to clipboard
fun leaveAllGroups(onCompletion: (SippoResourceError?) -> Unit)

Leaves all the groups where the current user is present as participant.

removeListener
Link copied to clipboard
fun removeListener(listener: GroupsListener)

Removes the specified listener.