# 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 workspace_pb2 as host_dot_workspace__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/workspace_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 WorkspaceServiceStub(object):
    """Provides methods for working with workspaces/projects.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.getWorkspacePaths = channel.unary_unary(
                '/host.WorkspaceService/getWorkspacePaths',
                request_serializer=host_dot_workspace__pb2.GetWorkspacePathsRequest.SerializeToString,
                response_deserializer=host_dot_workspace__pb2.GetWorkspacePathsResponse.FromString,
                _registered_method=True)
        self.saveOpenDocumentIfDirty = channel.unary_unary(
                '/host.WorkspaceService/saveOpenDocumentIfDirty',
                request_serializer=host_dot_workspace__pb2.SaveOpenDocumentIfDirtyRequest.SerializeToString,
                response_deserializer=host_dot_workspace__pb2.SaveOpenDocumentIfDirtyResponse.FromString,
                _registered_method=True)
        self.getDiagnostics = channel.unary_unary(
                '/host.WorkspaceService/getDiagnostics',
                request_serializer=host_dot_workspace__pb2.GetDiagnosticsRequest.SerializeToString,
                response_deserializer=host_dot_workspace__pb2.GetDiagnosticsResponse.FromString,
                _registered_method=True)
        self.openProblemsPanel = channel.unary_unary(
                '/host.WorkspaceService/openProblemsPanel',
                request_serializer=host_dot_workspace__pb2.OpenProblemsPanelRequest.SerializeToString,
                response_deserializer=host_dot_workspace__pb2.OpenProblemsPanelResponse.FromString,
                _registered_method=True)
        self.openInFileExplorerPanel = channel.unary_unary(
                '/host.WorkspaceService/openInFileExplorerPanel',
                request_serializer=host_dot_workspace__pb2.OpenInFileExplorerPanelRequest.SerializeToString,
                response_deserializer=host_dot_workspace__pb2.OpenInFileExplorerPanelResponse.FromString,
                _registered_method=True)
        self.openClineSidebarPanel = channel.unary_unary(
                '/host.WorkspaceService/openClineSidebarPanel',
                request_serializer=host_dot_workspace__pb2.OpenClineSidebarPanelRequest.SerializeToString,
                response_deserializer=host_dot_workspace__pb2.OpenClineSidebarPanelResponse.FromString,
                _registered_method=True)
        self.openTerminalPanel = channel.unary_unary(
                '/host.WorkspaceService/openTerminalPanel',
                request_serializer=host_dot_workspace__pb2.OpenTerminalRequest.SerializeToString,
                response_deserializer=host_dot_workspace__pb2.OpenTerminalResponse.FromString,
                _registered_method=True)
        self.executeCommandInTerminal = channel.unary_unary(
                '/host.WorkspaceService/executeCommandInTerminal',
                request_serializer=host_dot_workspace__pb2.ExecuteCommandInTerminalRequest.SerializeToString,
                response_deserializer=host_dot_workspace__pb2.ExecuteCommandInTerminalResponse.FromString,
                _registered_method=True)


class WorkspaceServiceServicer(object):
    """Provides methods for working with workspaces/projects.
    """

    def getWorkspacePaths(self, request, context):
        """Returns a list of the top level directories of the workspace.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def saveOpenDocumentIfDirty(self, request, context):
        """Saves an open document if it's open in the editor and has unsaved changes.
        Returns true if the document was saved, returns false if the document was not found, or did not
        need to be saved.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getDiagnostics(self, request, context):
        """Get diagnostics from the workspace.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def openProblemsPanel(self, request, context):
        """Makes the problems panel/pane visible in the IDE and focuses it.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def openInFileExplorerPanel(self, request, context):
        """Opens the IDE file explorer panel and selects a file or directory.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def openClineSidebarPanel(self, request, context):
        """Opens and focuses the Cline sidebar panel in the host IDE.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def openTerminalPanel(self, request, context):
        """Opens and focuses the terminal panel.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def executeCommandInTerminal(self, request, context):
        """Executes a command in a new terminal
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_WorkspaceServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'getWorkspacePaths': grpc.unary_unary_rpc_method_handler(
                    servicer.getWorkspacePaths,
                    request_deserializer=host_dot_workspace__pb2.GetWorkspacePathsRequest.FromString,
                    response_serializer=host_dot_workspace__pb2.GetWorkspacePathsResponse.SerializeToString,
            ),
            'saveOpenDocumentIfDirty': grpc.unary_unary_rpc_method_handler(
                    servicer.saveOpenDocumentIfDirty,
                    request_deserializer=host_dot_workspace__pb2.SaveOpenDocumentIfDirtyRequest.FromString,
                    response_serializer=host_dot_workspace__pb2.SaveOpenDocumentIfDirtyResponse.SerializeToString,
            ),
            'getDiagnostics': grpc.unary_unary_rpc_method_handler(
                    servicer.getDiagnostics,
                    request_deserializer=host_dot_workspace__pb2.GetDiagnosticsRequest.FromString,
                    response_serializer=host_dot_workspace__pb2.GetDiagnosticsResponse.SerializeToString,
            ),
            'openProblemsPanel': grpc.unary_unary_rpc_method_handler(
                    servicer.openProblemsPanel,
                    request_deserializer=host_dot_workspace__pb2.OpenProblemsPanelRequest.FromString,
                    response_serializer=host_dot_workspace__pb2.OpenProblemsPanelResponse.SerializeToString,
            ),
            'openInFileExplorerPanel': grpc.unary_unary_rpc_method_handler(
                    servicer.openInFileExplorerPanel,
                    request_deserializer=host_dot_workspace__pb2.OpenInFileExplorerPanelRequest.FromString,
                    response_serializer=host_dot_workspace__pb2.OpenInFileExplorerPanelResponse.SerializeToString,
            ),
            'openClineSidebarPanel': grpc.unary_unary_rpc_method_handler(
                    servicer.openClineSidebarPanel,
                    request_deserializer=host_dot_workspace__pb2.OpenClineSidebarPanelRequest.FromString,
                    response_serializer=host_dot_workspace__pb2.OpenClineSidebarPanelResponse.SerializeToString,
            ),
            'openTerminalPanel': grpc.unary_unary_rpc_method_handler(
                    servicer.openTerminalPanel,
                    request_deserializer=host_dot_workspace__pb2.OpenTerminalRequest.FromString,
                    response_serializer=host_dot_workspace__pb2.OpenTerminalResponse.SerializeToString,
            ),
            'executeCommandInTerminal': grpc.unary_unary_rpc_method_handler(
                    servicer.executeCommandInTerminal,
                    request_deserializer=host_dot_workspace__pb2.ExecuteCommandInTerminalRequest.FromString,
                    response_serializer=host_dot_workspace__pb2.ExecuteCommandInTerminalResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'host.WorkspaceService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('host.WorkspaceService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class WorkspaceService(object):
    """Provides methods for working with workspaces/projects.
    """

    @staticmethod
    def getWorkspacePaths(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.WorkspaceService/getWorkspacePaths',
            host_dot_workspace__pb2.GetWorkspacePathsRequest.SerializeToString,
            host_dot_workspace__pb2.GetWorkspacePathsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def saveOpenDocumentIfDirty(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.WorkspaceService/saveOpenDocumentIfDirty',
            host_dot_workspace__pb2.SaveOpenDocumentIfDirtyRequest.SerializeToString,
            host_dot_workspace__pb2.SaveOpenDocumentIfDirtyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getDiagnostics(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.WorkspaceService/getDiagnostics',
            host_dot_workspace__pb2.GetDiagnosticsRequest.SerializeToString,
            host_dot_workspace__pb2.GetDiagnosticsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def openProblemsPanel(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.WorkspaceService/openProblemsPanel',
            host_dot_workspace__pb2.OpenProblemsPanelRequest.SerializeToString,
            host_dot_workspace__pb2.OpenProblemsPanelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def openInFileExplorerPanel(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.WorkspaceService/openInFileExplorerPanel',
            host_dot_workspace__pb2.OpenInFileExplorerPanelRequest.SerializeToString,
            host_dot_workspace__pb2.OpenInFileExplorerPanelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def openClineSidebarPanel(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.WorkspaceService/openClineSidebarPanel',
            host_dot_workspace__pb2.OpenClineSidebarPanelRequest.SerializeToString,
            host_dot_workspace__pb2.OpenClineSidebarPanelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def openTerminalPanel(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.WorkspaceService/openTerminalPanel',
            host_dot_workspace__pb2.OpenTerminalRequest.SerializeToString,
            host_dot_workspace__pb2.OpenTerminalResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def executeCommandInTerminal(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.WorkspaceService/executeCommandInTerminal',
            host_dot_workspace__pb2.ExecuteCommandInTerminalRequest.SerializeToString,
            host_dot_workspace__pb2.ExecuteCommandInTerminalResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
