RoomContainer

interface RoomContainer

This module provides methods for managing room containers.

In this context, a Container acts as a folder-like structure for organizing and storing rooms. This interface offers functionality to interact with room containers, allowing users to retrieve, create, delete, and modify containers, as well as manage the rooms contained within them.

This interface can be used to:

  • Retrieve room containers: Access a list of existing room containers created by the user.

  • Create new room containers: Define and establish containers to better organize rooms according to user needs.

  • Delete room containers: Remove containers that are no longer needed or relevant.

  • Modify container details: Update the properties of a container, such as its name or description.

  • Manage rooms within containers: Add or remove rooms from a container, ensuring that the container's contents remain organized and relevant.

Each room within a container is represented by its ID.

Samples

com.ale.rainbowsdk.samples.RoomContainersSample

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val containers: StateFlow<List<Container>>

A reactive hot flow of the user's room containers.

Functions

Link copied to clipboard
abstract suspend fun addRoomsToContainer(containerId: String, roomIds: List<String>): RainbowResult<Pair<Container, List<InvalidRoom>?>>

Adds multiple rooms identified by the specified list of room IDs to the container identified by the given container ID.

Link copied to clipboard
abstract suspend fun createContainer(    name: String,     description: String? = null,     roomIds: List<String>? = null): RainbowResult<Pair<Container, List<InvalidRoom>?>>

Creates a new room container with the specified name and optional description and room IDs.

Link copied to clipboard
abstract suspend fun deleteContainer(containerId: String): RainbowResult<Container>

Deletes a room container identified by its unique ID.

Link copied to clipboard
abstract suspend fun deleteContainers(containerIds: List<String>): RainbowResult<Map<String, Failure>>

Deletes multiple room containers identified by the given list of container IDs.

Link copied to clipboard
abstract suspend fun fetchContainerById(containerId: String): RainbowResult<Container>

Retrieves the details of a specific room container identified by its unique ID.

Link copied to clipboard
abstract suspend fun fetchContainers(    @IntRange(from = 1) limit: Int = DEFAULT_LIMIT_FETCH_CONTAINER,     @IntRange(from = 0) offset: Int = 0,     sortOrder: Int = SORT_ASCENDING): RainbowResult<List<Container>>

Fetches a list of room containers from the server.

Link copied to clipboard
abstract suspend fun fetchRoomsForContainerIfNeeded(container: Container): RainbowResult<List<IRainbowRoom>>

Fetches all rooms from the specified container, retrieving from the server only if not already fetched.

Link copied to clipboard
abstract fun getContainerById(containerId: String): Container?

Retrieves a room container by its unique ID.

Link copied to clipboard
abstract suspend fun moveRooms(    oldContainerId: String,     newContainerId: String,     roomIds: List<String>): RainbowResult<Pair<Container, List<InvalidRoom>?>>

Moves multiple rooms identified by the specified list of room IDs from one container to another.

Link copied to clipboard
abstract suspend fun removeRoomsFromContainer(    containerId: String,     roomIds: List<String>): RainbowResult<Pair<Container, List<InvalidRoom>?>>

Removes multiple rooms identified by the specified list of room IDs from the container identified by the given container ID.

Link copied to clipboard
abstract suspend fun updateContainer(containerId: String, newName: String, newDescription: String? = null): RainbowResult<Container>

Updates the details of an existing room container identified by its unique ID.