# -*- coding: utf-8 -*-
# Generated by https://github.com/verloop/twirpy/protoc-gen-twirpy.  DO NOT EDIT!
# source: livekit_room.proto

from google.protobuf import symbol_database as _symbol_database
from twirp.base import Endpoint
from twirp.client import TwirpClient
from twirp.server import TwirpServer

_sym_db = _symbol_database.Default()


class RoomServiceServer(TwirpServer):
    def __init__(self, *args, service, server_path_prefix="/twirp"):
        super().__init__(service=service)
        self._prefix = f"{server_path_prefix}/livekit.RoomService"
        self._endpoints = {
            "CreateRoom": Endpoint(
                service_name="RoomService",
                name="CreateRoom",
                function=getattr(service, "CreateRoom"),
                input=_sym_db.GetSymbol("livekit.CreateRoomRequest"),
                output=_sym_db.GetSymbol("livekit.Room"),
            ),
            "ListRooms": Endpoint(
                service_name="RoomService",
                name="ListRooms",
                function=getattr(service, "ListRooms"),
                input=_sym_db.GetSymbol("livekit.ListRoomsRequest"),
                output=_sym_db.GetSymbol("livekit.ListRoomsResponse"),
            ),
            "DeleteRoom": Endpoint(
                service_name="RoomService",
                name="DeleteRoom",
                function=getattr(service, "DeleteRoom"),
                input=_sym_db.GetSymbol("livekit.DeleteRoomRequest"),
                output=_sym_db.GetSymbol("livekit.DeleteRoomResponse"),
            ),
            "ListParticipants": Endpoint(
                service_name="RoomService",
                name="ListParticipants",
                function=getattr(service, "ListParticipants"),
                input=_sym_db.GetSymbol("livekit.ListParticipantsRequest"),
                output=_sym_db.GetSymbol("livekit.ListParticipantsResponse"),
            ),
            "GetParticipant": Endpoint(
                service_name="RoomService",
                name="GetParticipant",
                function=getattr(service, "GetParticipant"),
                input=_sym_db.GetSymbol("livekit.RoomParticipantIdentity"),
                output=_sym_db.GetSymbol("livekit.ParticipantInfo"),
            ),
            "RemoveParticipant": Endpoint(
                service_name="RoomService",
                name="RemoveParticipant",
                function=getattr(service, "RemoveParticipant"),
                input=_sym_db.GetSymbol("livekit.RoomParticipantIdentity"),
                output=_sym_db.GetSymbol("livekit.RemoveParticipantResponse"),
            ),
            "MutePublishedTrack": Endpoint(
                service_name="RoomService",
                name="MutePublishedTrack",
                function=getattr(service, "MutePublishedTrack"),
                input=_sym_db.GetSymbol("livekit.MuteRoomTrackRequest"),
                output=_sym_db.GetSymbol("livekit.MuteRoomTrackResponse"),
            ),
            "UpdateParticipant": Endpoint(
                service_name="RoomService",
                name="UpdateParticipant",
                function=getattr(service, "UpdateParticipant"),
                input=_sym_db.GetSymbol("livekit.UpdateParticipantRequest"),
                output=_sym_db.GetSymbol("livekit.ParticipantInfo"),
            ),
            "UpdateSubscriptions": Endpoint(
                service_name="RoomService",
                name="UpdateSubscriptions",
                function=getattr(service, "UpdateSubscriptions"),
                input=_sym_db.GetSymbol("livekit.UpdateSubscriptionsRequest"),
                output=_sym_db.GetSymbol("livekit.UpdateSubscriptionsResponse"),
            ),
            "SendData": Endpoint(
                service_name="RoomService",
                name="SendData",
                function=getattr(service, "SendData"),
                input=_sym_db.GetSymbol("livekit.SendDataRequest"),
                output=_sym_db.GetSymbol("livekit.SendDataResponse"),
            ),
            "UpdateRoomMetadata": Endpoint(
                service_name="RoomService",
                name="UpdateRoomMetadata",
                function=getattr(service, "UpdateRoomMetadata"),
                input=_sym_db.GetSymbol("livekit.UpdateRoomMetadataRequest"),
                output=_sym_db.GetSymbol("livekit.Room"),
            ),
        }


class RoomServiceClient(TwirpClient):
    def CreateRoom(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/CreateRoom",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.Room"),
            **kwargs,
        )

    def ListRooms(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/ListRooms",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.ListRoomsResponse"),
            **kwargs,
        )

    def DeleteRoom(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/DeleteRoom",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.DeleteRoomResponse"),
            **kwargs,
        )

    def ListParticipants(
        self, *args, ctx, request, server_path_prefix="/twirp", **kwargs
    ):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/ListParticipants",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.ListParticipantsResponse"),
            **kwargs,
        )

    def GetParticipant(
        self, *args, ctx, request, server_path_prefix="/twirp", **kwargs
    ):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/GetParticipant",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.ParticipantInfo"),
            **kwargs,
        )

    def RemoveParticipant(
        self, *args, ctx, request, server_path_prefix="/twirp", **kwargs
    ):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/RemoveParticipant",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.RemoveParticipantResponse"),
            **kwargs,
        )

    def MutePublishedTrack(
        self, *args, ctx, request, server_path_prefix="/twirp", **kwargs
    ):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/MutePublishedTrack",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.MuteRoomTrackResponse"),
            **kwargs,
        )

    def UpdateParticipant(
        self, *args, ctx, request, server_path_prefix="/twirp", **kwargs
    ):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/UpdateParticipant",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.ParticipantInfo"),
            **kwargs,
        )

    def UpdateSubscriptions(
        self, *args, ctx, request, server_path_prefix="/twirp", **kwargs
    ):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/UpdateSubscriptions",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.UpdateSubscriptionsResponse"),
            **kwargs,
        )

    def SendData(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/SendData",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.SendDataResponse"),
            **kwargs,
        )

    def UpdateRoomMetadata(
        self, *args, ctx, request, server_path_prefix="/twirp", **kwargs
    ):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.RoomService/UpdateRoomMetadata",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.Room"),
            **kwargs,
        )
