GroupService

abstract class GroupService : BaseService

An abstract class representing a GroupService, which provides methods for managing groups. It extends the BaseService class and requires a context parameter for initialization.

Parameters

context

The context used for initialization and performing operations.

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun addUserToGroup(groupCode: String, userId: String, userRole: String): Group

Adds a user to a group associated with current user id asynchronously.

abstract fun addUserToGroup(groupCode: String, userId: String, userRole: String, completionCallback: CompletionCallback<Group>)

Adds a user to a group associated with current user id asynchronously with a completion callback.

Link copied to clipboard
abstract suspend fun createGroup(groupName: String, initialUserRole: String): Group

Creates a new group asynchronously and associate with current user id.

abstract fun createGroup(groupName: String, initialUserRole: String, completionCallback: CompletionCallback<Group>)

Creates a new group and associate with current user id asynchronously with a completion callback.

Link copied to clipboard
abstract suspend fun deleteGroup(groupId: String): Group

Deletes an existing group associated with current user id asynchronously.

abstract fun deleteGroup(groupId: String, completionCallback: CompletionCallback<Group>)

Deletes an existing group associated with current user id asynchronously with a completion callback.

Link copied to clipboard
abstract suspend fun deleteUserInGroup(groupId: String, userId: String): Group

Deletes a user from a group associated with current user id asynchronously.

abstract fun deleteUserInGroup(groupId: String, userId: String, completionCallback: CompletionCallback<Group>)

Deletes a user from a group associated with current user id asynchronously with a completion callback.

Link copied to clipboard
abstract suspend fun getGroup(groupId: String): Group

Retrieves a specific group associated with the current user ID asynchronously.

abstract fun getGroup(groupId: String, completionCallback: CompletionCallback<Group>)

Retrieves a specific group associated with current user id asynchronously with a completion callback.

Link copied to clipboard
abstract suspend fun getGroups(): List<Group>

Retrieves a list of groups associated with the current user ID asynchronously.

abstract fun getGroups(completionCallback: CompletionCallback<List<Group>>)

Retrieves a list of groups associated with current user id asynchronously with a completion callback.

Link copied to clipboard
abstract suspend fun joinGroup(groupCode: String, userRole: String): Group

Joins a group asynchronously.

abstract fun joinGroup(groupCode: String, userRole: String, completionCallback: CompletionCallback<Group>)

Joins current user to a group asynchronously with a completion callback.

Link copied to clipboard
abstract suspend fun updateGroup(groupId: String, name: String): Group

Updates an existing group associated with current user id asynchronously.

abstract fun updateGroup(groupId: String, name: String, completionCallback: CompletionCallback<Group>)

Updates an existing group associated with current user id asynchronously with a completion callback.