# 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 synapse.proto import a2a_pb2 as a2a__pb2

GRPC_GENERATED_VERSION = '1.76.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},'
        + ' but the generated code in a2a_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 A2AServiceStub(object):
    """============================================================
    gRPC Service Definition
    ============================================================

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetAgentCard = channel.unary_unary(
                '/synapse.a2a.A2AService/GetAgentCard',
                request_serializer=a2a__pb2.GetAgentCardRequest.SerializeToString,
                response_deserializer=a2a__pb2.GetAgentCardResponse.FromString,
                _registered_method=True)
        self.SendMessage = channel.unary_unary(
                '/synapse.a2a.A2AService/SendMessage',
                request_serializer=a2a__pb2.SendMessageRequest.SerializeToString,
                response_deserializer=a2a__pb2.SendMessageResponse.FromString,
                _registered_method=True)
        self.GetTask = channel.unary_unary(
                '/synapse.a2a.A2AService/GetTask',
                request_serializer=a2a__pb2.GetTaskRequest.SerializeToString,
                response_deserializer=a2a__pb2.GetTaskResponse.FromString,
                _registered_method=True)
        self.ListTasks = channel.unary_unary(
                '/synapse.a2a.A2AService/ListTasks',
                request_serializer=a2a__pb2.ListTasksRequest.SerializeToString,
                response_deserializer=a2a__pb2.ListTasksResponse.FromString,
                _registered_method=True)
        self.CancelTask = channel.unary_unary(
                '/synapse.a2a.A2AService/CancelTask',
                request_serializer=a2a__pb2.CancelTaskRequest.SerializeToString,
                response_deserializer=a2a__pb2.CancelTaskResponse.FromString,
                _registered_method=True)
        self.Subscribe = channel.unary_stream(
                '/synapse.a2a.A2AService/Subscribe',
                request_serializer=a2a__pb2.SubscribeRequest.SerializeToString,
                response_deserializer=a2a__pb2.TaskStreamEvent.FromString,
                _registered_method=True)
        self.SendPriorityMessage = channel.unary_unary(
                '/synapse.a2a.A2AService/SendPriorityMessage',
                request_serializer=a2a__pb2.SendPriorityMessageRequest.SerializeToString,
                response_deserializer=a2a__pb2.SendMessageResponse.FromString,
                _registered_method=True)


class A2AServiceServicer(object):
    """============================================================
    gRPC Service Definition
    ============================================================

    """

    def GetAgentCard(self, request, context):
        """Agent Discovery
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendMessage(self, request, context):
        """Task Management
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetTask(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListTasks(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelTask(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Subscribe(self, request, context):
        """Streaming (replaces SSE)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendPriorityMessage(self, request, context):
        """Priority extension
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_A2AServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetAgentCard': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAgentCard,
                    request_deserializer=a2a__pb2.GetAgentCardRequest.FromString,
                    response_serializer=a2a__pb2.GetAgentCardResponse.SerializeToString,
            ),
            'SendMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.SendMessage,
                    request_deserializer=a2a__pb2.SendMessageRequest.FromString,
                    response_serializer=a2a__pb2.SendMessageResponse.SerializeToString,
            ),
            'GetTask': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTask,
                    request_deserializer=a2a__pb2.GetTaskRequest.FromString,
                    response_serializer=a2a__pb2.GetTaskResponse.SerializeToString,
            ),
            'ListTasks': grpc.unary_unary_rpc_method_handler(
                    servicer.ListTasks,
                    request_deserializer=a2a__pb2.ListTasksRequest.FromString,
                    response_serializer=a2a__pb2.ListTasksResponse.SerializeToString,
            ),
            'CancelTask': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelTask,
                    request_deserializer=a2a__pb2.CancelTaskRequest.FromString,
                    response_serializer=a2a__pb2.CancelTaskResponse.SerializeToString,
            ),
            'Subscribe': grpc.unary_stream_rpc_method_handler(
                    servicer.Subscribe,
                    request_deserializer=a2a__pb2.SubscribeRequest.FromString,
                    response_serializer=a2a__pb2.TaskStreamEvent.SerializeToString,
            ),
            'SendPriorityMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.SendPriorityMessage,
                    request_deserializer=a2a__pb2.SendPriorityMessageRequest.FromString,
                    response_serializer=a2a__pb2.SendMessageResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'synapse.a2a.A2AService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('synapse.a2a.A2AService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class A2AService(object):
    """============================================================
    gRPC Service Definition
    ============================================================

    """

    @staticmethod
    def GetAgentCard(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,
            '/synapse.a2a.A2AService/GetAgentCard',
            a2a__pb2.GetAgentCardRequest.SerializeToString,
            a2a__pb2.GetAgentCardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            '/synapse.a2a.A2AService/SendMessage',
            a2a__pb2.SendMessageRequest.SerializeToString,
            a2a__pb2.SendMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetTask(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,
            '/synapse.a2a.A2AService/GetTask',
            a2a__pb2.GetTaskRequest.SerializeToString,
            a2a__pb2.GetTaskResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListTasks(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,
            '/synapse.a2a.A2AService/ListTasks',
            a2a__pb2.ListTasksRequest.SerializeToString,
            a2a__pb2.ListTasksResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CancelTask(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,
            '/synapse.a2a.A2AService/CancelTask',
            a2a__pb2.CancelTaskRequest.SerializeToString,
            a2a__pb2.CancelTaskResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Subscribe(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,
            '/synapse.a2a.A2AService/Subscribe',
            a2a__pb2.SubscribeRequest.SerializeToString,
            a2a__pb2.TaskStreamEvent.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SendPriorityMessage(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,
            '/synapse.a2a.A2AService/SendPriorityMessage',
            a2a__pb2.SendPriorityMessageRequest.SerializeToString,
            a2a__pb2.SendMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
