# 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 window_pb2 as host_dot_window__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/window_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 WindowServiceStub(object):
    """Provides methods for working with IDE windows and editors.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.showTextDocument = channel.unary_unary(
                '/host.WindowService/showTextDocument',
                request_serializer=host_dot_window__pb2.ShowTextDocumentRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.TextEditorInfo.FromString,
                _registered_method=True)
        self.showOpenDialogue = channel.unary_unary(
                '/host.WindowService/showOpenDialogue',
                request_serializer=host_dot_window__pb2.ShowOpenDialogueRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.SelectedResources.FromString,
                _registered_method=True)
        self.showMessage = channel.unary_unary(
                '/host.WindowService/showMessage',
                request_serializer=host_dot_window__pb2.ShowMessageRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.SelectedResponse.FromString,
                _registered_method=True)
        self.showInputBox = channel.unary_unary(
                '/host.WindowService/showInputBox',
                request_serializer=host_dot_window__pb2.ShowInputBoxRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.ShowInputBoxResponse.FromString,
                _registered_method=True)
        self.showSaveDialog = channel.unary_unary(
                '/host.WindowService/showSaveDialog',
                request_serializer=host_dot_window__pb2.ShowSaveDialogRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.ShowSaveDialogResponse.FromString,
                _registered_method=True)
        self.openFile = channel.unary_unary(
                '/host.WindowService/openFile',
                request_serializer=host_dot_window__pb2.OpenFileRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.OpenFileResponse.FromString,
                _registered_method=True)
        self.openSettings = channel.unary_unary(
                '/host.WindowService/openSettings',
                request_serializer=host_dot_window__pb2.OpenSettingsRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.OpenSettingsResponse.FromString,
                _registered_method=True)
        self.getOpenTabs = channel.unary_unary(
                '/host.WindowService/getOpenTabs',
                request_serializer=host_dot_window__pb2.GetOpenTabsRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.GetOpenTabsResponse.FromString,
                _registered_method=True)
        self.getVisibleTabs = channel.unary_unary(
                '/host.WindowService/getVisibleTabs',
                request_serializer=host_dot_window__pb2.GetVisibleTabsRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.GetVisibleTabsResponse.FromString,
                _registered_method=True)
        self.getActiveEditor = channel.unary_unary(
                '/host.WindowService/getActiveEditor',
                request_serializer=host_dot_window__pb2.GetActiveEditorRequest.SerializeToString,
                response_deserializer=host_dot_window__pb2.GetActiveEditorResponse.FromString,
                _registered_method=True)


class WindowServiceServicer(object):
    """Provides methods for working with IDE windows and editors.
    """

    def showTextDocument(self, request, context):
        """Opens a text document in the IDE editor and returns editor information.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def showOpenDialogue(self, request, context):
        """Shows the open file dialogue / file picker.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def showMessage(self, request, context):
        """Shows a notification.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def showInputBox(self, request, context):
        """Prompts the user for input and returns the response.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def showSaveDialog(self, request, context):
        """Shows the file save dialogue / file picker.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def openFile(self, request, context):
        """Opens a file in the IDE.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def openSettings(self, request, context):
        """Opens the host settings UI, optionally focusing a specific query/section.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getOpenTabs(self, request, context):
        """Returns the open tabs.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getVisibleTabs(self, request, context):
        """Returns the visible tabs.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getActiveEditor(self, request, context):
        """Returns information about the current editor
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_WindowServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'showTextDocument': grpc.unary_unary_rpc_method_handler(
                    servicer.showTextDocument,
                    request_deserializer=host_dot_window__pb2.ShowTextDocumentRequest.FromString,
                    response_serializer=host_dot_window__pb2.TextEditorInfo.SerializeToString,
            ),
            'showOpenDialogue': grpc.unary_unary_rpc_method_handler(
                    servicer.showOpenDialogue,
                    request_deserializer=host_dot_window__pb2.ShowOpenDialogueRequest.FromString,
                    response_serializer=host_dot_window__pb2.SelectedResources.SerializeToString,
            ),
            'showMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.showMessage,
                    request_deserializer=host_dot_window__pb2.ShowMessageRequest.FromString,
                    response_serializer=host_dot_window__pb2.SelectedResponse.SerializeToString,
            ),
            'showInputBox': grpc.unary_unary_rpc_method_handler(
                    servicer.showInputBox,
                    request_deserializer=host_dot_window__pb2.ShowInputBoxRequest.FromString,
                    response_serializer=host_dot_window__pb2.ShowInputBoxResponse.SerializeToString,
            ),
            'showSaveDialog': grpc.unary_unary_rpc_method_handler(
                    servicer.showSaveDialog,
                    request_deserializer=host_dot_window__pb2.ShowSaveDialogRequest.FromString,
                    response_serializer=host_dot_window__pb2.ShowSaveDialogResponse.SerializeToString,
            ),
            'openFile': grpc.unary_unary_rpc_method_handler(
                    servicer.openFile,
                    request_deserializer=host_dot_window__pb2.OpenFileRequest.FromString,
                    response_serializer=host_dot_window__pb2.OpenFileResponse.SerializeToString,
            ),
            'openSettings': grpc.unary_unary_rpc_method_handler(
                    servicer.openSettings,
                    request_deserializer=host_dot_window__pb2.OpenSettingsRequest.FromString,
                    response_serializer=host_dot_window__pb2.OpenSettingsResponse.SerializeToString,
            ),
            'getOpenTabs': grpc.unary_unary_rpc_method_handler(
                    servicer.getOpenTabs,
                    request_deserializer=host_dot_window__pb2.GetOpenTabsRequest.FromString,
                    response_serializer=host_dot_window__pb2.GetOpenTabsResponse.SerializeToString,
            ),
            'getVisibleTabs': grpc.unary_unary_rpc_method_handler(
                    servicer.getVisibleTabs,
                    request_deserializer=host_dot_window__pb2.GetVisibleTabsRequest.FromString,
                    response_serializer=host_dot_window__pb2.GetVisibleTabsResponse.SerializeToString,
            ),
            'getActiveEditor': grpc.unary_unary_rpc_method_handler(
                    servicer.getActiveEditor,
                    request_deserializer=host_dot_window__pb2.GetActiveEditorRequest.FromString,
                    response_serializer=host_dot_window__pb2.GetActiveEditorResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'host.WindowService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('host.WindowService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class WindowService(object):
    """Provides methods for working with IDE windows and editors.
    """

    @staticmethod
    def showTextDocument(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.WindowService/showTextDocument',
            host_dot_window__pb2.ShowTextDocumentRequest.SerializeToString,
            host_dot_window__pb2.TextEditorInfo.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def showOpenDialogue(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.WindowService/showOpenDialogue',
            host_dot_window__pb2.ShowOpenDialogueRequest.SerializeToString,
            host_dot_window__pb2.SelectedResources.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def showMessage(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.WindowService/showMessage',
            host_dot_window__pb2.ShowMessageRequest.SerializeToString,
            host_dot_window__pb2.SelectedResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def showInputBox(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.WindowService/showInputBox',
            host_dot_window__pb2.ShowInputBoxRequest.SerializeToString,
            host_dot_window__pb2.ShowInputBoxResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def showSaveDialog(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.WindowService/showSaveDialog',
            host_dot_window__pb2.ShowSaveDialogRequest.SerializeToString,
            host_dot_window__pb2.ShowSaveDialogResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def openFile(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.WindowService/openFile',
            host_dot_window__pb2.OpenFileRequest.SerializeToString,
            host_dot_window__pb2.OpenFileResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def openSettings(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.WindowService/openSettings',
            host_dot_window__pb2.OpenSettingsRequest.SerializeToString,
            host_dot_window__pb2.OpenSettingsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getOpenTabs(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.WindowService/getOpenTabs',
            host_dot_window__pb2.GetOpenTabsRequest.SerializeToString,
            host_dot_window__pb2.GetOpenTabsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getVisibleTabs(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.WindowService/getVisibleTabs',
            host_dot_window__pb2.GetVisibleTabsRequest.SerializeToString,
            host_dot_window__pb2.GetVisibleTabsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getActiveEditor(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.WindowService/getActiveEditor',
            host_dot_window__pb2.GetActiveEditorRequest.SerializeToString,
            host_dot_window__pb2.GetActiveEditorResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
