# 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 google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from tast.cros.services.cros.inputs import keyboard_service_pb2 as tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2

GRPC_GENERATED_VERSION = '1.71.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},'
        + f' but the generated code in tast/cros/services/cros/inputs/keyboard_service_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 KeyboardServiceStub(object):
    """KeyboardService provides functionalities to interact with keyboard device
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Type = channel.unary_unary(
                '/tast.cros.inputs.KeyboardService/Type',
                request_serializer=tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.TypeRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.Accel = channel.unary_unary(
                '/tast.cros.inputs.KeyboardService/Accel',
                request_serializer=tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.AccelPress = channel.unary_unary(
                '/tast.cros.inputs.KeyboardService/AccelPress',
                request_serializer=tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelPressRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.AccelRelease = channel.unary_unary(
                '/tast.cros.inputs.KeyboardService/AccelRelease',
                request_serializer=tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelReleaseRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)


class KeyboardServiceServicer(object):
    """KeyboardService provides functionalities to interact with keyboard device
    """

    def Type(self, request, context):
        """Type injects key events suitable for generating the string s.
        Only characters that can be typed using a QWERTY keyboard are supported,
        and the current keyboard layout must be QWERTY. The left Shift key is
        automatically pressed and released for uppercase letters or other
        characters that can be typed using Shift.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Accel(self, request, context):
        """Accel injects a sequence of key events simulating the accelerator (a.k.a.
        hotkey) described by s being typed.
        Accelerators are described as a sequence of '+'-separated, case-insensitive
        key characters or names. In addition to non-whitespace characters that are
        present on a QWERTY keyboard, the following key names may be used:
        	Modifiers:     "Ctrl", "Alt", "Search", "Shift"
        	Whitespace:    "Enter", "Space", "Tab", "Backspace"
        	Function keys: "F1", "F2", ..., "F12"
        "Shift" must be included for keys that are typed using Shift; for example,
        use "Ctrl+Shift+/" rather than "Ctrl+?".
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AccelPress(self, request, context):
        """AccelPress injects a sequence of key events simulating pressing the
        accelerator (a.k.a. hotkey) described by s.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AccelRelease(self, request, context):
        """AccelRelease injects a sequence of key events simulating release the
        accelerator (a.k.a. hotkey) described by s.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_KeyboardServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Type': grpc.unary_unary_rpc_method_handler(
                    servicer.Type,
                    request_deserializer=tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.TypeRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Accel': grpc.unary_unary_rpc_method_handler(
                    servicer.Accel,
                    request_deserializer=tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'AccelPress': grpc.unary_unary_rpc_method_handler(
                    servicer.AccelPress,
                    request_deserializer=tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelPressRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'AccelRelease': grpc.unary_unary_rpc_method_handler(
                    servicer.AccelRelease,
                    request_deserializer=tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelReleaseRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'tast.cros.inputs.KeyboardService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('tast.cros.inputs.KeyboardService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class KeyboardService(object):
    """KeyboardService provides functionalities to interact with keyboard device
    """

    @staticmethod
    def Type(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,
            '/tast.cros.inputs.KeyboardService/Type',
            tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.TypeRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Accel(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,
            '/tast.cros.inputs.KeyboardService/Accel',
            tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AccelPress(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,
            '/tast.cros.inputs.KeyboardService/AccelPress',
            tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelPressRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AccelRelease(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,
            '/tast.cros.inputs.KeyboardService/AccelRelease',
            tast_dot_cros_dot_services_dot_cros_dot_inputs_dot_keyboard__service__pb2.AccelReleaseRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
