# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from chromiumos.test.lab.api.passport import switch_service_pb2 as chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2


class SwitchServiceStub(object):
    """SwitchService is a service which controls a set of physical switches
    connected to a dedicated host. These switches are used to disable/enable
    individual peripheral components at runtime.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetSwitches = channel.unary_unary(
                '/chromiumos.test.lab.api.passport.SwitchService/GetSwitches',
                request_serializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.GetSwitchesRequest.SerializeToString,
                response_deserializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.GetSwitchesResponse.FromString,
                )
        self.ResetAllSwitches = channel.unary_unary(
                '/chromiumos.test.lab.api.passport.SwitchService/ResetAllSwitches',
                request_serializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ResetAllSwitchesRequest.SerializeToString,
                response_deserializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ResetAllSwitchesResponse.FromString,
                )
        self.ConfigureSwitchPort = channel.unary_unary(
                '/chromiumos.test.lab.api.passport.SwitchService/ConfigureSwitchPort',
                request_serializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ConfigureSwitchPortRequest.SerializeToString,
                response_deserializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ConfigureSwitchPortResponse.FromString,
                )


class SwitchServiceServicer(object):
    """SwitchService is a service which controls a set of physical switches
    connected to a dedicated host. These switches are used to disable/enable
    individual peripheral components at runtime.
    """

    def GetSwitches(self, request, context):
        """GetSwitches probes all connected switches to the host device.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ResetAllSwitches(self, request, context):
        """ResetAllSwitches re-initializes all found switches and sets them to the
        "disabled" state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ConfigureSwitchPort(self, request, context):
        """ConfigureSwitchPort configures a single port on a switch.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SwitchServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetSwitches': grpc.unary_unary_rpc_method_handler(
                    servicer.GetSwitches,
                    request_deserializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.GetSwitchesRequest.FromString,
                    response_serializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.GetSwitchesResponse.SerializeToString,
            ),
            'ResetAllSwitches': grpc.unary_unary_rpc_method_handler(
                    servicer.ResetAllSwitches,
                    request_deserializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ResetAllSwitchesRequest.FromString,
                    response_serializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ResetAllSwitchesResponse.SerializeToString,
            ),
            'ConfigureSwitchPort': grpc.unary_unary_rpc_method_handler(
                    servicer.ConfigureSwitchPort,
                    request_deserializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ConfigureSwitchPortRequest.FromString,
                    response_serializer=chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ConfigureSwitchPortResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'chromiumos.test.lab.api.passport.SwitchService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class SwitchService(object):
    """SwitchService is a service which controls a set of physical switches
    connected to a dedicated host. These switches are used to disable/enable
    individual peripheral components at runtime.
    """

    @staticmethod
    def GetSwitches(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, '/chromiumos.test.lab.api.passport.SwitchService/GetSwitches',
            chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.GetSwitchesRequest.SerializeToString,
            chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.GetSwitchesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ResetAllSwitches(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, '/chromiumos.test.lab.api.passport.SwitchService/ResetAllSwitches',
            chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ResetAllSwitchesRequest.SerializeToString,
            chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ResetAllSwitchesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ConfigureSwitchPort(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, '/chromiumos.test.lab.api.passport.SwitchService/ConfigureSwitchPort',
            chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ConfigureSwitchPortRequest.SerializeToString,
            chromiumos_dot_test_dot_lab_dot_api_dot_passport_dot_switch__service__pb2.ConfigureSwitchPortResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
