# 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 device_agent_pb2 as device__agent_dot_device__agent__pb2

GRPC_GENERATED_VERSION = '1.65.1'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.66.0'
SCHEDULED_RELEASE_DATE = 'August 6, 2024'
_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:
    warnings.warn(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in device_agent/device_agent_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}.'
        + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
        + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
        RuntimeWarning
    )


class deviceAgentStub(object):
    """The doover device agent service definition.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.TestComms = channel.unary_unary(
                '/device_agent.deviceAgent/TestComms',
                request_serializer=device__agent_dot_device__agent__pb2.TestCommsRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.TestCommsResponse.FromString,
                _registered_method=True)
        self.GetChannelSubscription = channel.unary_stream(
                '/device_agent.deviceAgent/GetChannelSubscription',
                request_serializer=device__agent_dot_device__agent__pb2.ChannelSubscriptionRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.ChannelSubscriptionResponse.FromString,
                _registered_method=True)
        self.ChannelEventSubscription = channel.unary_stream(
                '/device_agent.deviceAgent/ChannelEventSubscription',
                request_serializer=device__agent_dot_device__agent__pb2.ChannelEventSubscriptionRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.ChannelEventSubscriptionResponse.FromString,
                _registered_method=True)
        self.WriteToChannel = channel.unary_unary(
                '/device_agent.deviceAgent/WriteToChannel',
                request_serializer=device__agent_dot_device__agent__pb2.ChannelWriteRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.ChannelWriteResponse.FromString,
                _registered_method=True)
        self.GetDebugInfo = channel.unary_unary(
                '/device_agent.deviceAgent/GetDebugInfo',
                request_serializer=device__agent_dot_device__agent__pb2.DebugInfoRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.DebugInfoResponse.FromString,
                _registered_method=True)
        self.GetAggregate = channel.unary_unary(
                '/device_agent.deviceAgent/GetAggregate',
                request_serializer=device__agent_dot_device__agent__pb2.GetAggregateRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.GetAggregateResponse.FromString,
                _registered_method=True)
        self.GetTurnCredential = channel.unary_unary(
                '/device_agent.deviceAgent/GetTurnCredential',
                request_serializer=device__agent_dot_device__agent__pb2.TurnCredentialRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.TurnCredentialResponse.FromString,
                _registered_method=True)
        self.CreateMessage = channel.unary_unary(
                '/device_agent.deviceAgent/CreateMessage',
                request_serializer=device__agent_dot_device__agent__pb2.CreateMessageRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.CreateMessageResponse.FromString,
                _registered_method=True)
        self.UpdateMessage = channel.unary_unary(
                '/device_agent.deviceAgent/UpdateMessage',
                request_serializer=device__agent_dot_device__agent__pb2.UpdateMessageRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.UpdateMessageResponse.FromString,
                _registered_method=True)
        self.UpdateAggregate = channel.unary_unary(
                '/device_agent.deviceAgent/UpdateAggregate',
                request_serializer=device__agent_dot_device__agent__pb2.UpdateAggregateRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.UpdateAggregateResponse.FromString,
                _registered_method=True)
        self.GetMessage = channel.unary_unary(
                '/device_agent.deviceAgent/GetMessage',
                request_serializer=device__agent_dot_device__agent__pb2.GetMessageRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.GetMessageResponse.FromString,
                _registered_method=True)
        self.GetMessages = channel.unary_unary(
                '/device_agent.deviceAgent/GetMessages',
                request_serializer=device__agent_dot_device__agent__pb2.GetMessagesRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.GetMessagesResponse.FromString,
                _registered_method=True)
        self.FetchAttachment = channel.unary_unary(
                '/device_agent.deviceAgent/FetchAttachment',
                request_serializer=device__agent_dot_device__agent__pb2.FetchAttachmentRequest.SerializeToString,
                response_deserializer=device__agent_dot_device__agent__pb2.FetchAttachmentResponse.FromString,
                _registered_method=True)


class deviceAgentServicer(object):
    """The doover device agent service definition.
    """

    def TestComms(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 GetChannelSubscription(self, request, context):
        """rpc GetChannelDetails (ChannelDetailsRequest) returns (ChannelDetailsResponse) {}

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

    def ChannelEventSubscription(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 WriteToChannel(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 GetDebugInfo(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 GetAggregate(self, request, context):
        """rpc GetTempAPIToken (TempAPITokenRequest) returns (TempAPITokenResponse) {}
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetTurnCredential(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 CreateMessage(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 UpdateMessage(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 UpdateAggregate(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 GetMessage(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 GetMessages(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 FetchAttachment(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_deviceAgentServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'TestComms': grpc.unary_unary_rpc_method_handler(
                    servicer.TestComms,
                    request_deserializer=device__agent_dot_device__agent__pb2.TestCommsRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.TestCommsResponse.SerializeToString,
            ),
            'GetChannelSubscription': grpc.unary_stream_rpc_method_handler(
                    servicer.GetChannelSubscription,
                    request_deserializer=device__agent_dot_device__agent__pb2.ChannelSubscriptionRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.ChannelSubscriptionResponse.SerializeToString,
            ),
            'ChannelEventSubscription': grpc.unary_stream_rpc_method_handler(
                    servicer.ChannelEventSubscription,
                    request_deserializer=device__agent_dot_device__agent__pb2.ChannelEventSubscriptionRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.ChannelEventSubscriptionResponse.SerializeToString,
            ),
            'WriteToChannel': grpc.unary_unary_rpc_method_handler(
                    servicer.WriteToChannel,
                    request_deserializer=device__agent_dot_device__agent__pb2.ChannelWriteRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.ChannelWriteResponse.SerializeToString,
            ),
            'GetDebugInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDebugInfo,
                    request_deserializer=device__agent_dot_device__agent__pb2.DebugInfoRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.DebugInfoResponse.SerializeToString,
            ),
            'GetAggregate': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAggregate,
                    request_deserializer=device__agent_dot_device__agent__pb2.GetAggregateRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.GetAggregateResponse.SerializeToString,
            ),
            'GetTurnCredential': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTurnCredential,
                    request_deserializer=device__agent_dot_device__agent__pb2.TurnCredentialRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.TurnCredentialResponse.SerializeToString,
            ),
            'CreateMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateMessage,
                    request_deserializer=device__agent_dot_device__agent__pb2.CreateMessageRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.CreateMessageResponse.SerializeToString,
            ),
            'UpdateMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateMessage,
                    request_deserializer=device__agent_dot_device__agent__pb2.UpdateMessageRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.UpdateMessageResponse.SerializeToString,
            ),
            'UpdateAggregate': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateAggregate,
                    request_deserializer=device__agent_dot_device__agent__pb2.UpdateAggregateRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.UpdateAggregateResponse.SerializeToString,
            ),
            'GetMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.GetMessage,
                    request_deserializer=device__agent_dot_device__agent__pb2.GetMessageRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.GetMessageResponse.SerializeToString,
            ),
            'GetMessages': grpc.unary_unary_rpc_method_handler(
                    servicer.GetMessages,
                    request_deserializer=device__agent_dot_device__agent__pb2.GetMessagesRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.GetMessagesResponse.SerializeToString,
            ),
            'FetchAttachment': grpc.unary_unary_rpc_method_handler(
                    servicer.FetchAttachment,
                    request_deserializer=device__agent_dot_device__agent__pb2.FetchAttachmentRequest.FromString,
                    response_serializer=device__agent_dot_device__agent__pb2.FetchAttachmentResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'device_agent.deviceAgent', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('device_agent.deviceAgent', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class deviceAgent(object):
    """The doover device agent service definition.
    """

    @staticmethod
    def TestComms(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_agent.deviceAgent/TestComms',
            device__agent_dot_device__agent__pb2.TestCommsRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.TestCommsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetChannelSubscription(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_agent.deviceAgent/GetChannelSubscription',
            device__agent_dot_device__agent__pb2.ChannelSubscriptionRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.ChannelSubscriptionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ChannelEventSubscription(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_agent.deviceAgent/ChannelEventSubscription',
            device__agent_dot_device__agent__pb2.ChannelEventSubscriptionRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.ChannelEventSubscriptionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def WriteToChannel(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_agent.deviceAgent/WriteToChannel',
            device__agent_dot_device__agent__pb2.ChannelWriteRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.ChannelWriteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetDebugInfo(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_agent.deviceAgent/GetDebugInfo',
            device__agent_dot_device__agent__pb2.DebugInfoRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.DebugInfoResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetAggregate(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_agent.deviceAgent/GetAggregate',
            device__agent_dot_device__agent__pb2.GetAggregateRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.GetAggregateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetTurnCredential(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_agent.deviceAgent/GetTurnCredential',
            device__agent_dot_device__agent__pb2.TurnCredentialRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.TurnCredentialResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateMessage(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_agent.deviceAgent/CreateMessage',
            device__agent_dot_device__agent__pb2.CreateMessageRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.CreateMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateMessage(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_agent.deviceAgent/UpdateMessage',
            device__agent_dot_device__agent__pb2.UpdateMessageRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.UpdateMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateAggregate(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_agent.deviceAgent/UpdateAggregate',
            device__agent_dot_device__agent__pb2.UpdateAggregateRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.UpdateAggregateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetMessage(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_agent.deviceAgent/GetMessage',
            device__agent_dot_device__agent__pb2.GetMessageRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.GetMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetMessages(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_agent.deviceAgent/GetMessages',
            device__agent_dot_device__agent__pb2.GetMessagesRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.GetMessagesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def FetchAttachment(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_agent.deviceAgent/FetchAttachment',
            device__agent_dot_device__agent__pb2.FetchAttachmentRequest.SerializeToString,
            device__agent_dot_device__agent__pb2.FetchAttachmentResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
