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

from . import Common_pb2 as Common__pb2
from . import UdsOnCanTP_pb2 as UdsOnCanTP__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.subscribe = channel.unary_unary(
                '/UdsOnCanTP.UdsOnCanTP/subscribe',
                request_serializer=UdsOnCanTP__pb2.node_info.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.generate_key = channel.unary_unary(
                '/UdsOnCanTP.UdsOnCanTP/generate_key',
                request_serializer=UdsOnCanTP__pb2.request_para.SerializeToString,
                response_deserializer=UdsOnCanTP__pb2.key_value_list.FromString,
                )


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

    def subscribe(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 generate_key(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_UdsOnCanTPServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'subscribe': grpc.unary_unary_rpc_method_handler(
                    servicer.subscribe,
                    request_deserializer=UdsOnCanTP__pb2.node_info.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'generate_key': grpc.unary_unary_rpc_method_handler(
                    servicer.generate_key,
                    request_deserializer=UdsOnCanTP__pb2.request_para.FromString,
                    response_serializer=UdsOnCanTP__pb2.key_value_list.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'UdsOnCanTP.UdsOnCanTP', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def subscribe(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, '/UdsOnCanTP.UdsOnCanTP/subscribe',
            UdsOnCanTP__pb2.node_info.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def generate_key(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, '/UdsOnCanTP.UdsOnCanTP/generate_key',
            UdsOnCanTP__pb2.request_para.SerializeToString,
            UdsOnCanTP__pb2.key_value_list.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
