updateGroup

abstract suspend fun updateGroup(    groupId: String?,     @Size(min = 0, max = 255) name: String?,     @Size(min = 0, max = 255) description: String?): RainbowResult<Group>

Updates the details of an existing group.

This method updates the information of a specific group identified by the given groupId. You can modify the group's name and description with new values. The result is returned as a RainbowResult, containing the updated Group or an error in case of failure. Upon success, the updated group is refreshed in the groups property.

Validation Rules:

  • groupId must not be null or empty.

  • name (optional) must be between 1 and 255 characters if provided.

  • description (optional) must not exceed 255 characters.

Behavior:

  • If groupId is null or empty, the function returns a Failure with an appropriate error message.

  • If the name or description exceed the length constraints, the function fails with an error.

  • If the update is successful, a RainbowResult containing the updated Group is returned.

Return

A RainbowResult containing the updated Group on success or an error on failure.

Parameters

groupId

The unique identifier of the group to update. Must not be null or empty.

name

The new name for the group. Must be between 1 and 255 characters if provided. Can be null if no change is needed.

description

The new description for the group. Must not exceed 255 characters. Can be null if no change is needed.