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

from prompits.plugs.protos import agent_pb2 as prompits_dot_plugs_dot_protos_dot_agent__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in prompits/plugs/protos/agent_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class AgentStub(object):
    """Agent service definition
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SendMessage = channel.unary_unary(
                '/prompits.plugs.protos.Agent/SendMessage',
                request_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.SerializeToString,
                response_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.MessageResponse.FromString,
                _registered_method=True)
        self.Echo = channel.unary_unary(
                '/prompits.plugs.protos.Agent/Echo',
                request_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.SerializeToString,
                response_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.FromString,
                _registered_method=True)
        self.GetAgentInfo = channel.unary_unary(
                '/prompits.plugs.protos.Agent/GetAgentInfo',
                request_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Empty.SerializeToString,
                response_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.AgentInfo.FromString,
                _registered_method=True)
        self.ListPractices = channel.unary_unary(
                '/prompits.plugs.protos.Agent/ListPractices',
                request_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Empty.SerializeToString,
                response_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeList.FromString,
                _registered_method=True)
        self.ExecutePractice = channel.unary_unary(
                '/prompits.plugs.protos.Agent/ExecutePractice',
                request_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeRequest.SerializeToString,
                response_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeResponse.FromString,
                _registered_method=True)


class AgentServicer(object):
    """Agent service definition
    """

    def SendMessage(self, request, context):
        """Send a message to the agent
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Echo(self, request, context):
        """Echo a message back to the sender
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetAgentInfo(self, request, context):
        """Get agent information
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListPractices(self, request, context):
        """List available practices
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExecutePractice(self, request, context):
        """Execute a practice
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AgentServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SendMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.SendMessage,
                    request_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.FromString,
                    response_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.MessageResponse.SerializeToString,
            ),
            'Echo': grpc.unary_unary_rpc_method_handler(
                    servicer.Echo,
                    request_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.FromString,
                    response_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.SerializeToString,
            ),
            'GetAgentInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAgentInfo,
                    request_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Empty.FromString,
                    response_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.AgentInfo.SerializeToString,
            ),
            'ListPractices': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPractices,
                    request_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.Empty.FromString,
                    response_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeList.SerializeToString,
            ),
            'ExecutePractice': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecutePractice,
                    request_deserializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeRequest.FromString,
                    response_serializer=prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'prompits.plugs.protos.Agent', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('prompits.plugs.protos.Agent', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Agent(object):
    """Agent service definition
    """

    @staticmethod
    def SendMessage(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,
            '/prompits.plugs.protos.Agent/SendMessage',
            prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.SerializeToString,
            prompits_dot_plugs_dot_protos_dot_agent__pb2.MessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Echo(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,
            '/prompits.plugs.protos.Agent/Echo',
            prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.SerializeToString,
            prompits_dot_plugs_dot_protos_dot_agent__pb2.Message.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetAgentInfo(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,
            '/prompits.plugs.protos.Agent/GetAgentInfo',
            prompits_dot_plugs_dot_protos_dot_agent__pb2.Empty.SerializeToString,
            prompits_dot_plugs_dot_protos_dot_agent__pb2.AgentInfo.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListPractices(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,
            '/prompits.plugs.protos.Agent/ListPractices',
            prompits_dot_plugs_dot_protos_dot_agent__pb2.Empty.SerializeToString,
            prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExecutePractice(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,
            '/prompits.plugs.protos.Agent/ExecutePractice',
            prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeRequest.SerializeToString,
            prompits_dot_plugs_dot_protos_dot_agent__pb2.PracticeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
