class GroupsRx
Reactive API of Groups.
This class replicates some of the methods included in Groups but using Rx types as return values instead of callbacks. It also exposes the same group events using Rx observables.
val groupAdded: Observable<Group>
Emits a Group instance when a new group is created. |
|
val groupDeleted: Observable<String>
Emits a group identifier when that group is removed. |
|
val groupUpdated: Observable<Group>
Emits a Group when the name or the participants of a group are modified. |
fun create(groupName: String): Single<Group>
Creates a new Group. |
|
fun delete(group: Group): Completable
Deletes the specified group. Note: The user needs to be the group's owner. |
|
fun getGroup(groupId: String): Single<Group>
Gets the group identified by a given groupId. |
|
fun getGroups(userIsParticipant: Boolean): Single<List<Group>>
Gets the user's groups. |
|
fun leaveAllGroups(): Completable
Leaves all the groups where the current user is present as participant. |