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

import oocd_tool.openocd_pb2 as openocd__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.ProgramDevice = channel.stream_stream(
                '/rpi.OpenOcd/ProgramDevice',
                request_serializer=openocd__pb2.ProgramRequest.SerializeToString,
                response_deserializer=openocd__pb2.LogStreamResponse.FromString,
                )
        self.ResetDevice = channel.unary_stream(
                '/rpi.OpenOcd/ResetDevice',
                request_serializer=openocd__pb2.void.SerializeToString,
                response_deserializer=openocd__pb2.LogStreamResponse.FromString,
                )
        self.StartDebug = channel.unary_unary(
                '/rpi.OpenOcd/StartDebug',
                request_serializer=openocd__pb2.void.SerializeToString,
                response_deserializer=openocd__pb2.void.FromString,
                )
        self.StopDebug = channel.unary_unary(
                '/rpi.OpenOcd/StopDebug',
                request_serializer=openocd__pb2.void.SerializeToString,
                response_deserializer=openocd__pb2.void.FromString,
                )
        self.LogStreamCreate = channel.unary_stream(
                '/rpi.OpenOcd/LogStreamCreate',
                request_serializer=openocd__pb2.LogStreamRequest.SerializeToString,
                response_deserializer=openocd__pb2.LogStreamResponse.FromString,
                )


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

    def ProgramDevice(self, request_iterator, 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 ResetDevice(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 StartDebug(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 StopDebug(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 LogStreamCreate(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_OpenOcdServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ProgramDevice': grpc.stream_stream_rpc_method_handler(
                    servicer.ProgramDevice,
                    request_deserializer=openocd__pb2.ProgramRequest.FromString,
                    response_serializer=openocd__pb2.LogStreamResponse.SerializeToString,
            ),
            'ResetDevice': grpc.unary_stream_rpc_method_handler(
                    servicer.ResetDevice,
                    request_deserializer=openocd__pb2.void.FromString,
                    response_serializer=openocd__pb2.LogStreamResponse.SerializeToString,
            ),
            'StartDebug': grpc.unary_unary_rpc_method_handler(
                    servicer.StartDebug,
                    request_deserializer=openocd__pb2.void.FromString,
                    response_serializer=openocd__pb2.void.SerializeToString,
            ),
            'StopDebug': grpc.unary_unary_rpc_method_handler(
                    servicer.StopDebug,
                    request_deserializer=openocd__pb2.void.FromString,
                    response_serializer=openocd__pb2.void.SerializeToString,
            ),
            'LogStreamCreate': grpc.unary_stream_rpc_method_handler(
                    servicer.LogStreamCreate,
                    request_deserializer=openocd__pb2.LogStreamRequest.FromString,
                    response_serializer=openocd__pb2.LogStreamResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'rpi.OpenOcd', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def ProgramDevice(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/rpi.OpenOcd/ProgramDevice',
            openocd__pb2.ProgramRequest.SerializeToString,
            openocd__pb2.LogStreamResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ResetDevice(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, '/rpi.OpenOcd/ResetDevice',
            openocd__pb2.void.SerializeToString,
            openocd__pb2.LogStreamResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StartDebug(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, '/rpi.OpenOcd/StartDebug',
            openocd__pb2.void.SerializeToString,
            openocd__pb2.void.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StopDebug(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, '/rpi.OpenOcd/StopDebug',
            openocd__pb2.void.SerializeToString,
            openocd__pb2.void.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def LogStreamCreate(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, '/rpi.OpenOcd/LogStreamCreate',
            openocd__pb2.LogStreamRequest.SerializeToString,
            openocd__pb2.LogStreamResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
