# -*- coding: utf-8 -*-
# Generated by https://github.com/verloop/twirpy/protoc-gen-twirpy.  DO NOT EDIT!
# source: livekit_egress.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 EgressServer(TwirpServer):
    def __init__(self, *args, service, server_path_prefix="/twirp"):
        super().__init__(service=service)
        self._prefix = f"{server_path_prefix}/livekit.Egress"
        self._endpoints = {
            "StartRoomCompositeEgress": Endpoint(
                service_name="Egress",
                name="StartRoomCompositeEgress",
                function=getattr(service, "StartRoomCompositeEgress"),
                input=_sym_db.GetSymbol("livekit.RoomCompositeEgressRequest"),
                output=_sym_db.GetSymbol("livekit.EgressInfo"),
            ),
            "StartTrackCompositeEgress": Endpoint(
                service_name="Egress",
                name="StartTrackCompositeEgress",
                function=getattr(service, "StartTrackCompositeEgress"),
                input=_sym_db.GetSymbol("livekit.TrackCompositeEgressRequest"),
                output=_sym_db.GetSymbol("livekit.EgressInfo"),
            ),
            "StartTrackEgress": Endpoint(
                service_name="Egress",
                name="StartTrackEgress",
                function=getattr(service, "StartTrackEgress"),
                input=_sym_db.GetSymbol("livekit.TrackEgressRequest"),
                output=_sym_db.GetSymbol("livekit.EgressInfo"),
            ),
            "StartWebEgress": Endpoint(
                service_name="Egress",
                name="StartWebEgress",
                function=getattr(service, "StartWebEgress"),
                input=_sym_db.GetSymbol("livekit.WebEgressRequest"),
                output=_sym_db.GetSymbol("livekit.EgressInfo"),
            ),
            "UpdateLayout": Endpoint(
                service_name="Egress",
                name="UpdateLayout",
                function=getattr(service, "UpdateLayout"),
                input=_sym_db.GetSymbol("livekit.UpdateLayoutRequest"),
                output=_sym_db.GetSymbol("livekit.EgressInfo"),
            ),
            "UpdateStream": Endpoint(
                service_name="Egress",
                name="UpdateStream",
                function=getattr(service, "UpdateStream"),
                input=_sym_db.GetSymbol("livekit.UpdateStreamRequest"),
                output=_sym_db.GetSymbol("livekit.EgressInfo"),
            ),
            "ListEgress": Endpoint(
                service_name="Egress",
                name="ListEgress",
                function=getattr(service, "ListEgress"),
                input=_sym_db.GetSymbol("livekit.ListEgressRequest"),
                output=_sym_db.GetSymbol("livekit.ListEgressResponse"),
            ),
            "StopEgress": Endpoint(
                service_name="Egress",
                name="StopEgress",
                function=getattr(service, "StopEgress"),
                input=_sym_db.GetSymbol("livekit.StopEgressRequest"),
                output=_sym_db.GetSymbol("livekit.EgressInfo"),
            ),
        }


class EgressClient(TwirpClient):
    def StartRoomCompositeEgress(
        self, *args, ctx, request, server_path_prefix="/twirp", **kwargs
    ):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.Egress/StartRoomCompositeEgress",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("livekit.EgressInfo"),
            **kwargs,
        )

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

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

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

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

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

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

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