# -*- coding: utf-8 -*-
# Generated by https://github.com/verloop/twirpy/protoc-gen-twirpy.  DO NOT EDIT!
# source: video/sfu/cascading_rpc/gossip.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 GossipRPCServer(TwirpServer):

	def __init__(self, *args, service, server_path_prefix="/twirp"):
		super().__init__(service=service)
		self._prefix = F"{server_path_prefix}/stream.video.sfu.gossip.GossipRPC"
		self._endpoints = {
			"JoinCall": Endpoint(
				service_name="GossipRPC",
				name="JoinCall",
				function=getattr(service, "JoinCall"),
				input=_sym_db.GetSymbol("stream.video.sfu.gossip.JoinCallRequest"),
				output=_sym_db.GetSymbol("stream.video.sfu.gossip.JoinCallResponse"),
			),
			"SendEvent": Endpoint(
				service_name="GossipRPC",
				name="SendEvent",
				function=getattr(service, "SendEvent"),
				input=_sym_db.GetSymbol("stream.video.sfu.gossip.SendEventRequest"),
				output=_sym_db.GetSymbol("stream.video.sfu.gossip.SendEventResponse"),
			),
			"GetCallState": Endpoint(
				service_name="GossipRPC",
				name="GetCallState",
				function=getattr(service, "GetCallState"),
				input=_sym_db.GetSymbol("stream.video.sfu.gossip.GetCallStateRequest"),
				output=_sym_db.GetSymbol("stream.video.sfu.gossip.GetCallStateResponse"),
			),
		}

class GossipRPCClient(TwirpClient):

	def JoinCall(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.video.sfu.gossip.GossipRPC/JoinCall",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.video.sfu.gossip.JoinCallResponse"),
			**kwargs,
		)

	def SendEvent(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.video.sfu.gossip.GossipRPC/SendEvent",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.video.sfu.gossip.SendEventResponse"),
			**kwargs,
		)

	def GetCallState(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.video.sfu.gossip.GossipRPC/GetCallState",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.video.sfu.gossip.GetCallStateResponse"),
			**kwargs,
		)
