# 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 cline_core.proto.host import diff_pb2 as host_dot_diff__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 host/diff_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 DiffServiceStub(object):
    """Provides methods for diff views.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.openDiff = channel.unary_unary(
                '/host.DiffService/openDiff',
                request_serializer=host_dot_diff__pb2.OpenDiffRequest.SerializeToString,
                response_deserializer=host_dot_diff__pb2.OpenDiffResponse.FromString,
                _registered_method=True)
        self.getDocumentText = channel.unary_unary(
                '/host.DiffService/getDocumentText',
                request_serializer=host_dot_diff__pb2.GetDocumentTextRequest.SerializeToString,
                response_deserializer=host_dot_diff__pb2.GetDocumentTextResponse.FromString,
                _registered_method=True)
        self.replaceText = channel.unary_unary(
                '/host.DiffService/replaceText',
                request_serializer=host_dot_diff__pb2.ReplaceTextRequest.SerializeToString,
                response_deserializer=host_dot_diff__pb2.ReplaceTextResponse.FromString,
                _registered_method=True)
        self.scrollDiff = channel.unary_unary(
                '/host.DiffService/scrollDiff',
                request_serializer=host_dot_diff__pb2.ScrollDiffRequest.SerializeToString,
                response_deserializer=host_dot_diff__pb2.ScrollDiffResponse.FromString,
                _registered_method=True)
        self.truncateDocument = channel.unary_unary(
                '/host.DiffService/truncateDocument',
                request_serializer=host_dot_diff__pb2.TruncateDocumentRequest.SerializeToString,
                response_deserializer=host_dot_diff__pb2.TruncateDocumentResponse.FromString,
                _registered_method=True)
        self.saveDocument = channel.unary_unary(
                '/host.DiffService/saveDocument',
                request_serializer=host_dot_diff__pb2.SaveDocumentRequest.SerializeToString,
                response_deserializer=host_dot_diff__pb2.SaveDocumentResponse.FromString,
                _registered_method=True)
        self.closeAllDiffs = channel.unary_unary(
                '/host.DiffService/closeAllDiffs',
                request_serializer=host_dot_diff__pb2.CloseAllDiffsRequest.SerializeToString,
                response_deserializer=host_dot_diff__pb2.CloseAllDiffsResponse.FromString,
                _registered_method=True)
        self.openMultiFileDiff = channel.unary_unary(
                '/host.DiffService/openMultiFileDiff',
                request_serializer=host_dot_diff__pb2.OpenMultiFileDiffRequest.SerializeToString,
                response_deserializer=host_dot_diff__pb2.OpenMultiFileDiffResponse.FromString,
                _registered_method=True)


class DiffServiceServicer(object):
    """Provides methods for diff views.
    """

    def openDiff(self, request, context):
        """Open the diff view/editor.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getDocumentText(self, request, context):
        """Get the contents of the diff view.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def replaceText(self, request, context):
        """Replace a text selection in the diff.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def scrollDiff(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 truncateDocument(self, request, context):
        """Truncate the diff document.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def saveDocument(self, request, context):
        """Save the diff document.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def closeAllDiffs(self, request, context):
        """Close all the diff editor windows/tabs.
        Any diff editors with unsaved content should not be closed.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def openMultiFileDiff(self, request, context):
        """Display a diff view comparing before/after states for multiple files.
        Content is passed as in-memory data, not read from the file system.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DiffServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'openDiff': grpc.unary_unary_rpc_method_handler(
                    servicer.openDiff,
                    request_deserializer=host_dot_diff__pb2.OpenDiffRequest.FromString,
                    response_serializer=host_dot_diff__pb2.OpenDiffResponse.SerializeToString,
            ),
            'getDocumentText': grpc.unary_unary_rpc_method_handler(
                    servicer.getDocumentText,
                    request_deserializer=host_dot_diff__pb2.GetDocumentTextRequest.FromString,
                    response_serializer=host_dot_diff__pb2.GetDocumentTextResponse.SerializeToString,
            ),
            'replaceText': grpc.unary_unary_rpc_method_handler(
                    servicer.replaceText,
                    request_deserializer=host_dot_diff__pb2.ReplaceTextRequest.FromString,
                    response_serializer=host_dot_diff__pb2.ReplaceTextResponse.SerializeToString,
            ),
            'scrollDiff': grpc.unary_unary_rpc_method_handler(
                    servicer.scrollDiff,
                    request_deserializer=host_dot_diff__pb2.ScrollDiffRequest.FromString,
                    response_serializer=host_dot_diff__pb2.ScrollDiffResponse.SerializeToString,
            ),
            'truncateDocument': grpc.unary_unary_rpc_method_handler(
                    servicer.truncateDocument,
                    request_deserializer=host_dot_diff__pb2.TruncateDocumentRequest.FromString,
                    response_serializer=host_dot_diff__pb2.TruncateDocumentResponse.SerializeToString,
            ),
            'saveDocument': grpc.unary_unary_rpc_method_handler(
                    servicer.saveDocument,
                    request_deserializer=host_dot_diff__pb2.SaveDocumentRequest.FromString,
                    response_serializer=host_dot_diff__pb2.SaveDocumentResponse.SerializeToString,
            ),
            'closeAllDiffs': grpc.unary_unary_rpc_method_handler(
                    servicer.closeAllDiffs,
                    request_deserializer=host_dot_diff__pb2.CloseAllDiffsRequest.FromString,
                    response_serializer=host_dot_diff__pb2.CloseAllDiffsResponse.SerializeToString,
            ),
            'openMultiFileDiff': grpc.unary_unary_rpc_method_handler(
                    servicer.openMultiFileDiff,
                    request_deserializer=host_dot_diff__pb2.OpenMultiFileDiffRequest.FromString,
                    response_serializer=host_dot_diff__pb2.OpenMultiFileDiffResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'host.DiffService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('host.DiffService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class DiffService(object):
    """Provides methods for diff views.
    """

    @staticmethod
    def openDiff(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,
            '/host.DiffService/openDiff',
            host_dot_diff__pb2.OpenDiffRequest.SerializeToString,
            host_dot_diff__pb2.OpenDiffResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getDocumentText(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,
            '/host.DiffService/getDocumentText',
            host_dot_diff__pb2.GetDocumentTextRequest.SerializeToString,
            host_dot_diff__pb2.GetDocumentTextResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def replaceText(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,
            '/host.DiffService/replaceText',
            host_dot_diff__pb2.ReplaceTextRequest.SerializeToString,
            host_dot_diff__pb2.ReplaceTextResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def scrollDiff(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,
            '/host.DiffService/scrollDiff',
            host_dot_diff__pb2.ScrollDiffRequest.SerializeToString,
            host_dot_diff__pb2.ScrollDiffResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def truncateDocument(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,
            '/host.DiffService/truncateDocument',
            host_dot_diff__pb2.TruncateDocumentRequest.SerializeToString,
            host_dot_diff__pb2.TruncateDocumentResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def saveDocument(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,
            '/host.DiffService/saveDocument',
            host_dot_diff__pb2.SaveDocumentRequest.SerializeToString,
            host_dot_diff__pb2.SaveDocumentResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def closeAllDiffs(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,
            '/host.DiffService/closeAllDiffs',
            host_dot_diff__pb2.CloseAllDiffsRequest.SerializeToString,
            host_dot_diff__pb2.CloseAllDiffsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def openMultiFileDiff(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,
            '/host.DiffService/openMultiFileDiff',
            host_dot_diff__pb2.OpenMultiFileDiffRequest.SerializeToString,
            host_dot_diff__pb2.OpenMultiFileDiffResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
