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

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from th2_grpc_read_db import read_db_pb2 as th2__grpc__read__db_dot_read__db__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Execute = channel.unary_stream(
                '/th2.read_db.ReadDb/Execute',
                request_serializer=th2__grpc__read__db_dot_read__db__pb2.QueryRequest.SerializeToString,
                response_deserializer=th2__grpc__read__db_dot_read__db__pb2.QueryResponse.FromString,
                )
        self.StartPulling = channel.unary_unary(
                '/th2.read_db.ReadDb/StartPulling',
                request_serializer=th2__grpc__read__db_dot_read__db__pb2.DbPullRequest.SerializeToString,
                response_deserializer=th2__grpc__read__db_dot_read__db__pb2.DbPullResponse.FromString,
                )
        self.StopPulling = channel.unary_unary(
                '/th2.read_db.ReadDb/StopPulling',
                request_serializer=th2__grpc__read__db_dot_read__db__pb2.StopPullingRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )


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

    def Execute(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 StartPulling(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 StopPulling(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_ReadDbServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Execute': grpc.unary_stream_rpc_method_handler(
                    servicer.Execute,
                    request_deserializer=th2__grpc__read__db_dot_read__db__pb2.QueryRequest.FromString,
                    response_serializer=th2__grpc__read__db_dot_read__db__pb2.QueryResponse.SerializeToString,
            ),
            'StartPulling': grpc.unary_unary_rpc_method_handler(
                    servicer.StartPulling,
                    request_deserializer=th2__grpc__read__db_dot_read__db__pb2.DbPullRequest.FromString,
                    response_serializer=th2__grpc__read__db_dot_read__db__pb2.DbPullResponse.SerializeToString,
            ),
            'StopPulling': grpc.unary_unary_rpc_method_handler(
                    servicer.StopPulling,
                    request_deserializer=th2__grpc__read__db_dot_read__db__pb2.StopPullingRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'th2.read_db.ReadDb', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Execute(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, '/th2.read_db.ReadDb/Execute',
            th2__grpc__read__db_dot_read__db__pb2.QueryRequest.SerializeToString,
            th2__grpc__read__db_dot_read__db__pb2.QueryResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StartPulling(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, '/th2.read_db.ReadDb/StartPulling',
            th2__grpc__read__db_dot_read__db__pb2.DbPullRequest.SerializeToString,
            th2__grpc__read__db_dot_read__db__pb2.DbPullResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StopPulling(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, '/th2.read_db.ReadDb/StopPulling',
            th2__grpc__read__db_dot_read__db__pb2.StopPullingRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
