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

from sensory_cloud.generated.v1.management import device_pb2 as v1_dot_management_dot_device__pb2


class DeviceServiceStub(object):
    """Service to manage Devices in the database
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.EnrollDevice = channel.unary_unary(
                '/sensory.api.v1.management.DeviceService/EnrollDevice',
                request_serializer=v1_dot_management_dot_device__pb2.EnrollDeviceRequest.SerializeToString,
                response_deserializer=v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
                )
        self.RenewDeviceCredential = channel.unary_unary(
                '/sensory.api.v1.management.DeviceService/RenewDeviceCredential',
                request_serializer=v1_dot_management_dot_device__pb2.RenewDeviceCredentialRequest.SerializeToString,
                response_deserializer=v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
                )
        self.GetWhoAmI = channel.unary_unary(
                '/sensory.api.v1.management.DeviceService/GetWhoAmI',
                request_serializer=v1_dot_management_dot_device__pb2.DeviceGetWhoAmIRequest.SerializeToString,
                response_deserializer=v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
                )
        self.GetDevice = channel.unary_unary(
                '/sensory.api.v1.management.DeviceService/GetDevice',
                request_serializer=v1_dot_management_dot_device__pb2.DeviceRequest.SerializeToString,
                response_deserializer=v1_dot_management_dot_device__pb2.GetDeviceResponse.FromString,
                )
        self.GetDevices = channel.unary_unary(
                '/sensory.api.v1.management.DeviceService/GetDevices',
                request_serializer=v1_dot_management_dot_device__pb2.GetDevicesRequest.SerializeToString,
                response_deserializer=v1_dot_management_dot_device__pb2.DeviceListResponse.FromString,
                )
        self.UpdateDevice = channel.unary_unary(
                '/sensory.api.v1.management.DeviceService/UpdateDevice',
                request_serializer=v1_dot_management_dot_device__pb2.UpdateDeviceRequest.SerializeToString,
                response_deserializer=v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
                )
        self.DeleteDevice = channel.unary_unary(
                '/sensory.api.v1.management.DeviceService/DeleteDevice',
                request_serializer=v1_dot_management_dot_device__pb2.DeviceRequest.SerializeToString,
                response_deserializer=v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
                )


class DeviceServiceServicer(object):
    """Service to manage Devices in the database
    """

    def EnrollDevice(self, request, context):
        """Create a new device in the database
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RenewDeviceCredential(self, request, context):
        """Renew a device's credential, which links the device to a key in the database.
        This endpoint can be used to assign a new credential to a device if the old credential has expired.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetWhoAmI(self, request, context):
        """Allows a device to fetch information about itself
        Authorization metadata is required {"authorization": "Bearer <TOKEN>"}
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDevice(self, request, context):
        """Returns device information
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDevices(self, request, context):
        """Returns a list of devices associated with the given userId
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateDevice(self, request, context):
        """Allows the name of a device to be updated
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteDevice(self, request, context):
        """Allows a device to be deleted
        """
        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 = {
            'EnrollDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.EnrollDevice,
                    request_deserializer=v1_dot_management_dot_device__pb2.EnrollDeviceRequest.FromString,
                    response_serializer=v1_dot_management_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
            'RenewDeviceCredential': grpc.unary_unary_rpc_method_handler(
                    servicer.RenewDeviceCredential,
                    request_deserializer=v1_dot_management_dot_device__pb2.RenewDeviceCredentialRequest.FromString,
                    response_serializer=v1_dot_management_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
            'GetWhoAmI': grpc.unary_unary_rpc_method_handler(
                    servicer.GetWhoAmI,
                    request_deserializer=v1_dot_management_dot_device__pb2.DeviceGetWhoAmIRequest.FromString,
                    response_serializer=v1_dot_management_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
            'GetDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDevice,
                    request_deserializer=v1_dot_management_dot_device__pb2.DeviceRequest.FromString,
                    response_serializer=v1_dot_management_dot_device__pb2.GetDeviceResponse.SerializeToString,
            ),
            'GetDevices': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDevices,
                    request_deserializer=v1_dot_management_dot_device__pb2.GetDevicesRequest.FromString,
                    response_serializer=v1_dot_management_dot_device__pb2.DeviceListResponse.SerializeToString,
            ),
            'UpdateDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateDevice,
                    request_deserializer=v1_dot_management_dot_device__pb2.UpdateDeviceRequest.FromString,
                    response_serializer=v1_dot_management_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
            'DeleteDevice': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteDevice,
                    request_deserializer=v1_dot_management_dot_device__pb2.DeviceRequest.FromString,
                    response_serializer=v1_dot_management_dot_device__pb2.DeviceResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'sensory.api.v1.management.DeviceService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class DeviceService(object):
    """Service to manage Devices in the database
    """

    @staticmethod
    def EnrollDevice(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, '/sensory.api.v1.management.DeviceService/EnrollDevice',
            v1_dot_management_dot_device__pb2.EnrollDeviceRequest.SerializeToString,
            v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RenewDeviceCredential(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, '/sensory.api.v1.management.DeviceService/RenewDeviceCredential',
            v1_dot_management_dot_device__pb2.RenewDeviceCredentialRequest.SerializeToString,
            v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetWhoAmI(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, '/sensory.api.v1.management.DeviceService/GetWhoAmI',
            v1_dot_management_dot_device__pb2.DeviceGetWhoAmIRequest.SerializeToString,
            v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetDevice(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, '/sensory.api.v1.management.DeviceService/GetDevice',
            v1_dot_management_dot_device__pb2.DeviceRequest.SerializeToString,
            v1_dot_management_dot_device__pb2.GetDeviceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/sensory.api.v1.management.DeviceService/GetDevices',
            v1_dot_management_dot_device__pb2.GetDevicesRequest.SerializeToString,
            v1_dot_management_dot_device__pb2.DeviceListResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/sensory.api.v1.management.DeviceService/UpdateDevice',
            v1_dot_management_dot_device__pb2.UpdateDeviceRequest.SerializeToString,
            v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/sensory.api.v1.management.DeviceService/DeleteDevice',
            v1_dot_management_dot_device__pb2.DeviceRequest.SerializeToString,
            v1_dot_management_dot_device__pb2.DeviceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
