# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from . import broadcast_pb2 as broadcast__pb2


class BroadcastStub(object):
    """Service to be consumed by clients (e.g. frontend, app, etc) to watch the match.
    The game server implements a Broadcast service. This service may help you to control or watch the game during
    training sessions.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.OnEvent = channel.unary_stream(
                '/lugo.Broadcast/OnEvent',
                request_serializer=broadcast__pb2.WatcherRequest.SerializeToString,
                response_deserializer=broadcast__pb2.GameEvent.FromString,
                )
        self.GetGameSetup = channel.unary_unary(
                '/lugo.Broadcast/GetGameSetup',
                request_serializer=broadcast__pb2.WatcherRequest.SerializeToString,
                response_deserializer=broadcast__pb2.GameSetup.FromString,
                )
        self.StartGame = channel.unary_unary(
                '/lugo.Broadcast/StartGame',
                request_serializer=broadcast__pb2.StartRequest.SerializeToString,
                response_deserializer=broadcast__pb2.GameSetup.FromString,
                )


class BroadcastServicer(object):
    """Service to be consumed by clients (e.g. frontend, app, etc) to watch the match.
    The game server implements a Broadcast service. This service may help you to control or watch the game during
    training sessions.
    """

    def OnEvent(self, request, context):
        """Keep an open stream that publish all important events in the match.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetGameSetup(self, request, context):
        """Returns the game setup configuration.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StartGame(self, request, context):
        """StartGame allows the master watcher to start the match.
        See the Game Server starting mode to understand how it works.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_BroadcastServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'OnEvent': grpc.unary_stream_rpc_method_handler(
                    servicer.OnEvent,
                    request_deserializer=broadcast__pb2.WatcherRequest.FromString,
                    response_serializer=broadcast__pb2.GameEvent.SerializeToString,
            ),
            'GetGameSetup': grpc.unary_unary_rpc_method_handler(
                    servicer.GetGameSetup,
                    request_deserializer=broadcast__pb2.WatcherRequest.FromString,
                    response_serializer=broadcast__pb2.GameSetup.SerializeToString,
            ),
            'StartGame': grpc.unary_unary_rpc_method_handler(
                    servicer.StartGame,
                    request_deserializer=broadcast__pb2.StartRequest.FromString,
                    response_serializer=broadcast__pb2.GameSetup.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'lugo.Broadcast', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Broadcast(object):
    """Service to be consumed by clients (e.g. frontend, app, etc) to watch the match.
    The game server implements a Broadcast service. This service may help you to control or watch the game during
    training sessions.
    """

    @staticmethod
    def OnEvent(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(request, target, '/lugo.Broadcast/OnEvent',
            broadcast__pb2.WatcherRequest.SerializeToString,
            broadcast__pb2.GameEvent.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetGameSetup(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/lugo.Broadcast/GetGameSetup',
            broadcast__pb2.WatcherRequest.SerializeToString,
            broadcast__pb2.GameSetup.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StartGame(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/lugo.Broadcast/StartGame',
            broadcast__pb2.StartRequest.SerializeToString,
            broadcast__pb2.GameSetup.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
