# 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.ui import check_power_menu_service_pb2 as tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__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/ui/check_power_menu_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 PowerMenuServiceStub(object):
    """PowerMenuService provides the ability to check if the power menu is present.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.NewChrome = channel.unary_unary(
                '/tast.cros.ui.PowerMenuService/NewChrome',
                request_serializer=tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.NewChromeRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.CloseChrome = channel.unary_unary(
                '/tast.cros.ui.PowerMenuService/CloseChrome',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.PowerMenuPresent = channel.unary_unary(
                '/tast.cros.ui.PowerMenuService/PowerMenuPresent',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.PowerMenuPresentResponse.FromString,
                _registered_method=True)
        self.PowerMenuItem = channel.unary_unary(
                '/tast.cros.ui.PowerMenuService/PowerMenuItem',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.PowerMenuItemResponse.FromString,
                _registered_method=True)


class PowerMenuServiceServicer(object):
    """PowerMenuService provides the ability to check if the power menu is present.
    """

    def NewChrome(self, request, context):
        """NewChrome starts a Chrome session and processes the sign-in request.
        CloseChrome must be called later to clean up the associated resources.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CloseChrome(self, request, context):
        """Close releases the resources obtained by NewChrome.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PowerMenuPresent(self, request, context):
        """PowerMenuPresent returns a bool to indicate whether the presence of a power menu
        is true. Chrome instance is necessary prior to the deployment. For this reason,
        NewChrome must be called in prior, but not CloseChrome.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PowerMenuItem(self, request, context):
        """PowerMenuItem returns a slice which contains names of power menu items.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PowerMenuServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'NewChrome': grpc.unary_unary_rpc_method_handler(
                    servicer.NewChrome,
                    request_deserializer=tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.NewChromeRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'CloseChrome': grpc.unary_unary_rpc_method_handler(
                    servicer.CloseChrome,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'PowerMenuPresent': grpc.unary_unary_rpc_method_handler(
                    servicer.PowerMenuPresent,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.PowerMenuPresentResponse.SerializeToString,
            ),
            'PowerMenuItem': grpc.unary_unary_rpc_method_handler(
                    servicer.PowerMenuItem,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.PowerMenuItemResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'tast.cros.ui.PowerMenuService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('tast.cros.ui.PowerMenuService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class PowerMenuService(object):
    """PowerMenuService provides the ability to check if the power menu is present.
    """

    @staticmethod
    def NewChrome(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.ui.PowerMenuService/NewChrome',
            tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.NewChromeRequest.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 CloseChrome(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.ui.PowerMenuService/CloseChrome',
            google_dot_protobuf_dot_empty__pb2.Empty.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 PowerMenuPresent(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.ui.PowerMenuService/PowerMenuPresent',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.PowerMenuPresentResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PowerMenuItem(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.ui.PowerMenuService/PowerMenuItem',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            tast_dot_cros_dot_services_dot_cros_dot_ui_dot_check__power__menu__service__pb2.PowerMenuItemResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
