From 594f82453fc1e08733393041ac5f266b039940b8 Mon Sep 17 00:00:00 2001 From: Anunay Maheshwari Date: Thu, 15 May 2025 17:53:54 +0530 Subject: [PATCH 1/2] feat(room_service): move participant api --- livekit-api/livekit/api/room_service.py | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/livekit-api/livekit/api/room_service.py b/livekit-api/livekit/api/room_service.py index 3d521548..d0a0832c 100644 --- a/livekit-api/livekit/api/room_service.py +++ b/livekit-api/livekit/api/room_service.py @@ -20,6 +20,8 @@ UpdateSubscriptionsResponse, ForwardParticipantRequest, ForwardParticipantResponse, + MoveParticipantRequest, + MoveParticipantResponse, ) from livekit.protocol.models import Room, ParticipantInfo from ._service import Service @@ -223,6 +225,30 @@ async def forward_participant(self, forward: ForwardParticipantRequest) -> None: ForwardParticipantResponse, ) + async def move_participant(self, move: MoveParticipantRequest) -> None: + """Moves a participant from one room to another. + + This feature is only available for LiveKit Cloud/Private Cloud. + + Args: + move (MoveParticipantRequest): arg containing: + - room: str - Room name + - identity: str - Participant identity + - destination_room: str - Destination room name + """ + # currently nothing is returned + await self._client.request( + SVC, + "MoveParticipant", + move, + self._auth_header( + VideoGrants( + room_admin=True, room=move.room, destination_room=move.destination_room, + ) + ), + MoveParticipantResponse, + ) + async def mute_published_track( self, update: MuteRoomTrackRequest, From eb38e5cbd7abde90cbdc95ad6378a39af26927df Mon Sep 17 00:00:00 2001 From: Anunay Maheshwari Date: Thu, 15 May 2025 17:55:39 +0530 Subject: [PATCH 2/2] chore(ruff): fmt --- livekit-api/livekit/api/room_service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/livekit-api/livekit/api/room_service.py b/livekit-api/livekit/api/room_service.py index d0a0832c..5c0e3b76 100644 --- a/livekit-api/livekit/api/room_service.py +++ b/livekit-api/livekit/api/room_service.py @@ -243,7 +243,9 @@ async def move_participant(self, move: MoveParticipantRequest) -> None: move, self._auth_header( VideoGrants( - room_admin=True, room=move.room, destination_room=move.destination_room, + room_admin=True, + room=move.room, + destination_room=move.destination_room, ) ), MoveParticipantResponse,