# 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.cline import common_pb2 as cline_dot_common__pb2
from cline_core.proto.host import env_pb2 as host_dot_env__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/env_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 EnvServiceStub(object):
    """Provides methods for working with the user's environment.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.clipboardWriteText = channel.unary_unary(
                '/host.EnvService/clipboardWriteText',
                request_serializer=cline_dot_common__pb2.StringRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.Empty.FromString,
                _registered_method=True)
        self.clipboardReadText = channel.unary_unary(
                '/host.EnvService/clipboardReadText',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.String.FromString,
                _registered_method=True)
        self.getHostVersion = channel.unary_unary(
                '/host.EnvService/getHostVersion',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=host_dot_env__pb2.GetHostVersionResponse.FromString,
                _registered_method=True)
        self.getIdeRedirectUri = channel.unary_unary(
                '/host.EnvService/getIdeRedirectUri',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.String.FromString,
                _registered_method=True)
        self.getTelemetrySettings = channel.unary_unary(
                '/host.EnvService/getTelemetrySettings',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=host_dot_env__pb2.GetTelemetrySettingsResponse.FromString,
                _registered_method=True)
        self.subscribeToTelemetrySettings = channel.unary_stream(
                '/host.EnvService/subscribeToTelemetrySettings',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=host_dot_env__pb2.TelemetrySettingsEvent.FromString,
                _registered_method=True)
        self.shutdown = channel.unary_unary(
                '/host.EnvService/shutdown',
                request_serializer=cline_dot_common__pb2.EmptyRequest.SerializeToString,
                response_deserializer=cline_dot_common__pb2.Empty.FromString,
                _registered_method=True)


class EnvServiceServicer(object):
    """Provides methods for working with the user's environment.
    """

    def clipboardWriteText(self, request, context):
        """Writes text to the system clipboard.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def clipboardReadText(self, request, context):
        """Reads text from the system clipboard.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getHostVersion(self, request, context):
        """Returns the name and version of the host IDE or environment.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getIdeRedirectUri(self, request, context):
        """Returns a URI that will redirect to the host environment.
        e.g. vscode://saoudrizwan.claude-dev, idea://, pycharm://, etc.
        If the host does not support URIs it should return empty.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getTelemetrySettings(self, request, context):
        """Returns the telemetry settings of the host environment. This may return UNSUPPORTED
        if the host does not specify telemetry settings for the plugin.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def subscribeToTelemetrySettings(self, request, context):
        """Returns events when the telemetry settings change.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def shutdown(self, request, context):
        """Initiates a graceful shutdown of the host bridge service.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_EnvServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'clipboardWriteText': grpc.unary_unary_rpc_method_handler(
                    servicer.clipboardWriteText,
                    request_deserializer=cline_dot_common__pb2.StringRequest.FromString,
                    response_serializer=cline_dot_common__pb2.Empty.SerializeToString,
            ),
            'clipboardReadText': grpc.unary_unary_rpc_method_handler(
                    servicer.clipboardReadText,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_common__pb2.String.SerializeToString,
            ),
            'getHostVersion': grpc.unary_unary_rpc_method_handler(
                    servicer.getHostVersion,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=host_dot_env__pb2.GetHostVersionResponse.SerializeToString,
            ),
            'getIdeRedirectUri': grpc.unary_unary_rpc_method_handler(
                    servicer.getIdeRedirectUri,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_common__pb2.String.SerializeToString,
            ),
            'getTelemetrySettings': grpc.unary_unary_rpc_method_handler(
                    servicer.getTelemetrySettings,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=host_dot_env__pb2.GetTelemetrySettingsResponse.SerializeToString,
            ),
            'subscribeToTelemetrySettings': grpc.unary_stream_rpc_method_handler(
                    servicer.subscribeToTelemetrySettings,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=host_dot_env__pb2.TelemetrySettingsEvent.SerializeToString,
            ),
            'shutdown': grpc.unary_unary_rpc_method_handler(
                    servicer.shutdown,
                    request_deserializer=cline_dot_common__pb2.EmptyRequest.FromString,
                    response_serializer=cline_dot_common__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'host.EnvService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('host.EnvService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class EnvService(object):
    """Provides methods for working with the user's environment.
    """

    @staticmethod
    def clipboardWriteText(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.EnvService/clipboardWriteText',
            cline_dot_common__pb2.StringRequest.SerializeToString,
            cline_dot_common__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def clipboardReadText(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.EnvService/clipboardReadText',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_common__pb2.String.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getHostVersion(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.EnvService/getHostVersion',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            host_dot_env__pb2.GetHostVersionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getIdeRedirectUri(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.EnvService/getIdeRedirectUri',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_common__pb2.String.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getTelemetrySettings(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.EnvService/getTelemetrySettings',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            host_dot_env__pb2.GetTelemetrySettingsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def subscribeToTelemetrySettings(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,
            '/host.EnvService/subscribeToTelemetrySettings',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            host_dot_env__pb2.TelemetrySettingsEvent.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def shutdown(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.EnvService/shutdown',
            cline_dot_common__pb2.EmptyRequest.SerializeToString,
            cline_dot_common__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
