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

from google.protobuf import symbol_database as _symbol_database

from twirp.base import Endpoint
from twirp.server import TwirpServer
from twirp.client import TwirpClient

_sym_db = _symbol_database.Default()

class EgressRPCServer(TwirpServer):

	def __init__(self, *args, service, server_path_prefix="/twirp"):
		super().__init__(service=service)
		self._prefix = F"{server_path_prefix}/stream.video.egress.egress_v1_rpc.EgressRPC"
		self._endpoints = {
			"StartBroadcast": Endpoint(
				service_name="EgressRPC",
				name="StartBroadcast",
				function=getattr(service, "StartBroadcast"),
				input=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StartBroadcastRequest"),
				output=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StartBroadcastResponse"),
			),
			"StopBroadcast": Endpoint(
				service_name="EgressRPC",
				name="StopBroadcast",
				function=getattr(service, "StopBroadcast"),
				input=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StopBroadcastRequest"),
				output=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StopBroadcastResponse"),
			),
			"StartRecording": Endpoint(
				service_name="EgressRPC",
				name="StartRecording",
				function=getattr(service, "StartRecording"),
				input=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StartRecordingRequest"),
				output=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StartRecordingResponse"),
			),
			"StopRecording": Endpoint(
				service_name="EgressRPC",
				name="StopRecording",
				function=getattr(service, "StopRecording"),
				input=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StopRecordingRequest"),
				output=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StopRecordingResponse"),
			),
		}

class EgressRPCClient(TwirpClient):

	def StartBroadcast(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.video.egress.egress_v1_rpc.EgressRPC/StartBroadcast",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StartBroadcastResponse"),
			**kwargs,
		)

	def StopBroadcast(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.video.egress.egress_v1_rpc.EgressRPC/StopBroadcast",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StopBroadcastResponse"),
			**kwargs,
		)

	def StartRecording(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.video.egress.egress_v1_rpc.EgressRPC/StartRecording",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StartRecordingResponse"),
			**kwargs,
		)

	def StopRecording(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.video.egress.egress_v1_rpc.EgressRPC/StopRecording",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.video.egress.egress_v1_rpc.StopRecordingResponse"),
			**kwargs,
		)
