# 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 powerpay_protos import device_pb2 as powerpay__protos_dot_device__pb2

GRPC_GENERATED_VERSION = '1.68.1'
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 powerpay_protos/device_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 DeviceServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.ControlDevice = channel.unary_unary(
                '/powerpay.device.DeviceService/ControlDevice',
                request_serializer=powerpay__protos_dot_device__pb2.DeviceControlRequest.SerializeToString,
                response_deserializer=powerpay__protos_dot_device__pb2.DeviceResponse.FromString,
                _registered_method=True)
        self.GetDeviceStatus = channel.unary_unary(
                '/powerpay.device.DeviceService/GetDeviceStatus',
                request_serializer=powerpay__protos_dot_device__pb2.DeviceStatusRequest.SerializeToString,
                response_deserializer=powerpay__protos_dot_device__pb2.DeviceStatusResponse.FromString,
                _registered_method=True)
        self.CreateDevice = channel.unary_unary(
                '/powerpay.device.DeviceService/CreateDevice',
                request_serializer=powerpay__protos_dot_device__pb2.CreateDeviceRequest.SerializeToString,
                response_deserializer=powerpay__protos_dot_device__pb2.DeviceResponse.FromString,
                _registered_method=True)
        self.UpdateDevice = channel.unary_unary(
                '/powerpay.device.DeviceService/UpdateDevice',
                request_serializer=powerpay__protos_dot_device__pb2.UpdateDeviceRequest.SerializeToString,
                response_deserializer=powerpay__protos_dot_device__pb2.DeviceResponse.FromString,
                _registered_method=True)
        self.DeleteDevice = channel.unary_unary(
                '/powerpay.device.DeviceService/DeleteDevice',
                request_serializer=powerpay__protos_dot_device__pb2.DeleteDeviceRequest.SerializeToString,
                response_deserializer=powerpay__protos_dot_device__pb2.DeviceResponse.FromString,
                _registered_method=True)


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

    def ControlDevice(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 GetDeviceStatus(self, request, context):
        """Maby rename to GetDeviceState ?
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateDevice(self, request, context):
        """Does get device make sense? What does Chirpstack or Easee know that the DB does not?
        rpc GetDevice (GetDeviceRequest) returns (Device) {}

        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateDevice(self, request, context):
        """What would we like to update in a integration?
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteDevice(self, request, context):
        """What does Delete mean in relation to a integration?
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DeviceServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ControlDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.ControlDevice,
                    request_deserializer=powerpay__protos_dot_device__pb2.DeviceControlRequest.FromString,
                    response_serializer=powerpay__protos_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
            'GetDeviceStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDeviceStatus,
                    request_deserializer=powerpay__protos_dot_device__pb2.DeviceStatusRequest.FromString,
                    response_serializer=powerpay__protos_dot_device__pb2.DeviceStatusResponse.SerializeToString,
            ),
            'CreateDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateDevice,
                    request_deserializer=powerpay__protos_dot_device__pb2.CreateDeviceRequest.FromString,
                    response_serializer=powerpay__protos_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
            'UpdateDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateDevice,
                    request_deserializer=powerpay__protos_dot_device__pb2.UpdateDeviceRequest.FromString,
                    response_serializer=powerpay__protos_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
            'DeleteDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteDevice,
                    request_deserializer=powerpay__protos_dot_device__pb2.DeleteDeviceRequest.FromString,
                    response_serializer=powerpay__protos_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'powerpay.device.DeviceService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('powerpay.device.DeviceService', rpc_method_handlers)


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

    @staticmethod
    def ControlDevice(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,
            '/powerpay.device.DeviceService/ControlDevice',
            powerpay__protos_dot_device__pb2.DeviceControlRequest.SerializeToString,
            powerpay__protos_dot_device__pb2.DeviceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetDeviceStatus(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,
            '/powerpay.device.DeviceService/GetDeviceStatus',
            powerpay__protos_dot_device__pb2.DeviceStatusRequest.SerializeToString,
            powerpay__protos_dot_device__pb2.DeviceStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateDevice(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,
            '/powerpay.device.DeviceService/CreateDevice',
            powerpay__protos_dot_device__pb2.CreateDeviceRequest.SerializeToString,
            powerpay__protos_dot_device__pb2.DeviceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateDevice(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,
            '/powerpay.device.DeviceService/UpdateDevice',
            powerpay__protos_dot_device__pb2.UpdateDeviceRequest.SerializeToString,
            powerpay__protos_dot_device__pb2.DeviceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeleteDevice(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,
            '/powerpay.device.DeviceService/DeleteDevice',
            powerpay__protos_dot_device__pb2.DeleteDeviceRequest.SerializeToString,
            powerpay__protos_dot_device__pb2.DeviceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
