fetchGroups

abstract suspend fun fetchGroups(offset: Int = 0, limit: Int = DEFAULT_LIMIT_FETCH_GROUPS): RainbowResult<List<Group>>

Fetches all groups for the user.

Retrieves a paginated list of groups that the user has created. The result is returned as a RainbowResult containing a list of Group objects.

This method supports pagination via the offset and limit parameters, allowing for the retrieval of a subset of groups if desired. By default, it fetches a limited number of groups, defined by DEFAULT_LIMIT_FETCH_GROUPS.

Note:

  • The offset parameter allows for fetching groups starting from a specific index.

  • The limit parameter controls the maximum number of groups fetched in this operation.

  • Since this is a suspend function, it should be called within a coroutine scope.

Return

A RainbowResult containing either a list of Group objects on success or an error on failure.

Parameters

offset

The starting point for fetching groups. Defaults to 0.

limit

The maximum number of groups to fetch. Defaults to DEFAULT_LIMIT_FETCH_GROUPS.