# 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 . import devices_pb2 as device_dot_v1_dot_devices__pb2

GRPC_GENERATED_VERSION = '1.72.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 device/v1/devices_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 DevicesServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetDevices = channel.unary_unary(
                '/device.v1.DevicesService/GetDevices',
                request_serializer=device_dot_v1_dot_devices__pb2.GetDevicesRequest.SerializeToString,
                response_deserializer=device_dot_v1_dot_devices__pb2.GetDevicesResponse.FromString,
                _registered_method=True)
        self.GetDeviceDetails = channel.unary_unary(
                '/device.v1.DevicesService/GetDeviceDetails',
                request_serializer=device_dot_v1_dot_devices__pb2.GetDeviceDetailsRequest.SerializeToString,
                response_deserializer=device_dot_v1_dot_devices__pb2.GetDeviceDetailsResponse.FromString,
                _registered_method=True)
        self.CreateDeviceDetails = channel.unary_unary(
                '/device.v1.DevicesService/CreateDeviceDetails',
                request_serializer=device_dot_v1_dot_devices__pb2.CreateDeviceDetailsRequest.SerializeToString,
                response_deserializer=device_dot_v1_dot_devices__pb2.CreateDeviceDetailsResponse.FromString,
                _registered_method=True)
        self.StreamDevices = channel.unary_stream(
                '/device.v1.DevicesService/StreamDevices',
                request_serializer=device_dot_v1_dot_devices__pb2.StreamDevicesRequest.SerializeToString,
                response_deserializer=device_dot_v1_dot_devices__pb2.StreamDevicesResponse.FromString,
                _registered_method=True)
        self.GetStates = channel.unary_unary(
                '/device.v1.DevicesService/GetStates',
                request_serializer=device_dot_v1_dot_devices__pb2.GetStatesRequest.SerializeToString,
                response_deserializer=device_dot_v1_dot_devices__pb2.GetStatesResponse.FromString,
                _registered_method=True)
        self.StreamStates = channel.unary_stream(
                '/device.v1.DevicesService/StreamStates',
                request_serializer=device_dot_v1_dot_devices__pb2.StreamStatesRequest.SerializeToString,
                response_deserializer=device_dot_v1_dot_devices__pb2.StreamStatesResponse.FromString,
                _registered_method=True)


class DevicesServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def GetDevices(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDeviceDetails(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateDeviceDetails(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamDevices(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetStates(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamStates(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DevicesServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetDevices': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDevices,
                    request_deserializer=device_dot_v1_dot_devices__pb2.GetDevicesRequest.FromString,
                    response_serializer=device_dot_v1_dot_devices__pb2.GetDevicesResponse.SerializeToString,
            ),
            'GetDeviceDetails': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDeviceDetails,
                    request_deserializer=device_dot_v1_dot_devices__pb2.GetDeviceDetailsRequest.FromString,
                    response_serializer=device_dot_v1_dot_devices__pb2.GetDeviceDetailsResponse.SerializeToString,
            ),
            'CreateDeviceDetails': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateDeviceDetails,
                    request_deserializer=device_dot_v1_dot_devices__pb2.CreateDeviceDetailsRequest.FromString,
                    response_serializer=device_dot_v1_dot_devices__pb2.CreateDeviceDetailsResponse.SerializeToString,
            ),
            'StreamDevices': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamDevices,
                    request_deserializer=device_dot_v1_dot_devices__pb2.StreamDevicesRequest.FromString,
                    response_serializer=device_dot_v1_dot_devices__pb2.StreamDevicesResponse.SerializeToString,
            ),
            'GetStates': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStates,
                    request_deserializer=device_dot_v1_dot_devices__pb2.GetStatesRequest.FromString,
                    response_serializer=device_dot_v1_dot_devices__pb2.GetStatesResponse.SerializeToString,
            ),
            'StreamStates': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamStates,
                    request_deserializer=device_dot_v1_dot_devices__pb2.StreamStatesRequest.FromString,
                    response_serializer=device_dot_v1_dot_devices__pb2.StreamStatesResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'device.v1.DevicesService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('device.v1.DevicesService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class DevicesService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetDevices(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,
            '/device.v1.DevicesService/GetDevices',
            device_dot_v1_dot_devices__pb2.GetDevicesRequest.SerializeToString,
            device_dot_v1_dot_devices__pb2.GetDevicesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetDeviceDetails(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,
            '/device.v1.DevicesService/GetDeviceDetails',
            device_dot_v1_dot_devices__pb2.GetDeviceDetailsRequest.SerializeToString,
            device_dot_v1_dot_devices__pb2.GetDeviceDetailsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateDeviceDetails(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,
            '/device.v1.DevicesService/CreateDeviceDetails',
            device_dot_v1_dot_devices__pb2.CreateDeviceDetailsRequest.SerializeToString,
            device_dot_v1_dot_devices__pb2.CreateDeviceDetailsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamDevices(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,
            '/device.v1.DevicesService/StreamDevices',
            device_dot_v1_dot_devices__pb2.StreamDevicesRequest.SerializeToString,
            device_dot_v1_dot_devices__pb2.StreamDevicesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetStates(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,
            '/device.v1.DevicesService/GetStates',
            device_dot_v1_dot_devices__pb2.GetStatesRequest.SerializeToString,
            device_dot_v1_dot_devices__pb2.GetStatesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamStates(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,
            '/device.v1.DevicesService/StreamStates',
            device_dot_v1_dot_devices__pb2.StreamStatesRequest.SerializeToString,
            device_dot_v1_dot_devices__pb2.StreamStatesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)