fetchGroups

abstract fun fetchGroups(offset: Int = 0, limit: Int = DEFAULT_LIMIT_FETCH_GROUPS, listener: RainbowListener<List<Group>, Unit>? = null)

Fetches all groups for the user.

Retrieves a list of groups that the user has created, and updates the groups property with the fetched data. The groups property will then contain all the groups.

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.

If a listener is provided, it will be notified with the list of Group objects once the operation is complete. If you have already subscribed to changes in the groups property, you can ignore the listener as the property will be updated automatically.

Note: The offset parameter allows for fetching groups starting from a specific index, and the limit parameter controls the maximum number of groups fetched in this operation.

Parameters

offset

An optional parameter specifying the starting point for fetching groups. Defaults to 0.

limit

An optional parameter specifying the maximum number of groups to fetch. Defaults to DEFAULT_LIMIT_FETCH_GROUPS.

listener

An optional RainbowListener that will be notified with the result of the fetch operation. The listener receives a List<Group> objects as its result.