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

import rl_assistant_pb2 as rl__assistant__pb2
import server_pb2 as server__pb2


class RLAssistantStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.StartSession = channel.unary_stream(
                '/lugo.RLAssistant/StartSession',
                request_serializer=rl__assistant__pb2.RLSessionConfig.SerializeToString,
                response_deserializer=server__pb2.GameSnapshot.FromString,
                )
        self.SendPlayersOrders = channel.unary_unary(
                '/lugo.RLAssistant/SendPlayersOrders',
                request_serializer=rl__assistant__pb2.PlayersOrders.SerializeToString,
                response_deserializer=rl__assistant__pb2.TurnOutcome.FromString,
                )
        self.ResetEnv = channel.unary_unary(
                '/lugo.RLAssistant/ResetEnv',
                request_serializer=rl__assistant__pb2.RLResetConfig.SerializeToString,
                response_deserializer=rl__assistant__pb2.TurnOutcome.FromString,
                )


class RLAssistantServicer(object):
    """Missing associated documentation comment in .proto file."""

    def StartSession(self, request, context):
        """StartSession will create 11 player connections on each team and wait the game to be on the waiting status
        It will return a stream of game snapshots, like "Game.JoinATeam" does, but these GameSnapshot will be the
        same one returned by SendPlayersOrders. But you need to keep the stream open, otherwise the server will
        consider that the session is done.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendPlayersOrders(self, request, context):
        """SendPlayersOrders will send all payers orders, and ignore the ones that do not have orders
        If there is no order from a player, it will behave are defined in PlayersOrders.default_behaviour.
        The valid values for default_behaviour are defined by the server. Please run the server help command
        for more information.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ResetEnv(self, request, context):
        """The training environment will need to reset the game status multiple times during the training session.
        Each time this occurs, the RL assistant must be notified by the trainer, as the game server does not emit any
        related events.
        When the environment is reset, the RL assistant will also reset its controllers to maintain synchronization with
        the game server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_RLAssistantServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'StartSession': grpc.unary_stream_rpc_method_handler(
                    servicer.StartSession,
                    request_deserializer=rl__assistant__pb2.RLSessionConfig.FromString,
                    response_serializer=server__pb2.GameSnapshot.SerializeToString,
            ),
            'SendPlayersOrders': grpc.unary_unary_rpc_method_handler(
                    servicer.SendPlayersOrders,
                    request_deserializer=rl__assistant__pb2.PlayersOrders.FromString,
                    response_serializer=rl__assistant__pb2.TurnOutcome.SerializeToString,
            ),
            'ResetEnv': grpc.unary_unary_rpc_method_handler(
                    servicer.ResetEnv,
                    request_deserializer=rl__assistant__pb2.RLResetConfig.FromString,
                    response_serializer=rl__assistant__pb2.TurnOutcome.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'lugo.RLAssistant', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class RLAssistant(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def StartSession(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.RLAssistant/StartSession',
            rl__assistant__pb2.RLSessionConfig.SerializeToString,
            server__pb2.GameSnapshot.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendPlayersOrders(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.RLAssistant/SendPlayersOrders',
            rl__assistant__pb2.PlayersOrders.SerializeToString,
            rl__assistant__pb2.TurnOutcome.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ResetEnv(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.RLAssistant/ResetEnv',
            rl__assistant__pb2.RLResetConfig.SerializeToString,
            rl__assistant__pb2.TurnOutcome.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
