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

import odbc_pb2 as odbc__pb2


class MDBServiceStub(object):
    """Query Services
    Query Services define all the different gRPC queries that can be performed within the bSQL Protocol Buffer
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.InitializeConnection = channel.unary_unary(
                '/odbc.v1.MDBService/InitializeConnection',
                request_serializer=odbc__pb2.InitializationRequest.SerializeToString,
                response_deserializer=odbc__pb2.authPacket.FromString,
                )
        self.Begin = channel.unary_unary(
                '/odbc.v1.MDBService/Begin',
                request_serializer=odbc__pb2.XactRequest.SerializeToString,
                response_deserializer=odbc__pb2.XactResponse.FromString,
                )
        self.Close = channel.unary_unary(
                '/odbc.v1.MDBService/Close',
                request_serializer=odbc__pb2.authPacket.SerializeToString,
                response_deserializer=odbc__pb2.CloseResponse.FromString,
                )
        self.Exec = channel.unary_unary(
                '/odbc.v1.MDBService/Exec',
                request_serializer=odbc__pb2.ExecRequest.SerializeToString,
                response_deserializer=odbc__pb2.ExecResponse.FromString,
                )
        self.Query = channel.unary_stream(
                '/odbc.v1.MDBService/Query',
                request_serializer=odbc__pb2.QueryRequest.SerializeToString,
                response_deserializer=odbc__pb2.QueryResponse.FromString,
                )
        self.CloseQuery = channel.unary_unary(
                '/odbc.v1.MDBService/CloseQuery',
                request_serializer=odbc__pb2.authPacket.SerializeToString,
                response_deserializer=odbc__pb2.CloseQueryResponse.FromString,
                )
        self.StoreFile = channel.stream_unary(
                '/odbc.v1.MDBService/StoreFile',
                request_serializer=odbc__pb2.StoreFileRequest.SerializeToString,
                response_deserializer=odbc__pb2.StoreFileResponse.FromString,
                )
        self.ExportFile = channel.unary_stream(
                '/odbc.v1.MDBService/ExportFile',
                request_serializer=odbc__pb2.ExportFileRequest.SerializeToString,
                response_deserializer=odbc__pb2.ExportFileResponse.FromString,
                )


class MDBServiceServicer(object):
    """Query Services
    Query Services define all the different gRPC queries that can be performed within the bSQL Protocol Buffer
    """

    def InitializeConnection(self, request, context):
        """//////////////////////////////////////////////////////////////////////////////
        //                            Unary requests                              ////
        //////////////////////////////////////////////////////////////////////////////

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

    def Begin(self, request, context):
        """Transactions    //

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

    def Close(self, request, context):
        """Close: Close session and all active transactions
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Exec(self, request, context):
        """Commands    //

        Exec:  Execute a statement / command
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Query(self, request, context):
        """Query: Query the database for information
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CloseQuery(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 StoreFile(self, request_iterator, context):
        """Query sends a single bSQL statement and returns its corresponding response
        rpc Query(QueryRequest) returns (QueryResponse) {};

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

    def ExportFile(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_MDBServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'InitializeConnection': grpc.unary_unary_rpc_method_handler(
                    servicer.InitializeConnection,
                    request_deserializer=odbc__pb2.InitializationRequest.FromString,
                    response_serializer=odbc__pb2.authPacket.SerializeToString,
            ),
            'Begin': grpc.unary_unary_rpc_method_handler(
                    servicer.Begin,
                    request_deserializer=odbc__pb2.XactRequest.FromString,
                    response_serializer=odbc__pb2.XactResponse.SerializeToString,
            ),
            'Close': grpc.unary_unary_rpc_method_handler(
                    servicer.Close,
                    request_deserializer=odbc__pb2.authPacket.FromString,
                    response_serializer=odbc__pb2.CloseResponse.SerializeToString,
            ),
            'Exec': grpc.unary_unary_rpc_method_handler(
                    servicer.Exec,
                    request_deserializer=odbc__pb2.ExecRequest.FromString,
                    response_serializer=odbc__pb2.ExecResponse.SerializeToString,
            ),
            'Query': grpc.unary_stream_rpc_method_handler(
                    servicer.Query,
                    request_deserializer=odbc__pb2.QueryRequest.FromString,
                    response_serializer=odbc__pb2.QueryResponse.SerializeToString,
            ),
            'CloseQuery': grpc.unary_unary_rpc_method_handler(
                    servicer.CloseQuery,
                    request_deserializer=odbc__pb2.authPacket.FromString,
                    response_serializer=odbc__pb2.CloseQueryResponse.SerializeToString,
            ),
            'StoreFile': grpc.stream_unary_rpc_method_handler(
                    servicer.StoreFile,
                    request_deserializer=odbc__pb2.StoreFileRequest.FromString,
                    response_serializer=odbc__pb2.StoreFileResponse.SerializeToString,
            ),
            'ExportFile': grpc.unary_stream_rpc_method_handler(
                    servicer.ExportFile,
                    request_deserializer=odbc__pb2.ExportFileRequest.FromString,
                    response_serializer=odbc__pb2.ExportFileResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'odbc.v1.MDBService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class MDBService(object):
    """Query Services
    Query Services define all the different gRPC queries that can be performed within the bSQL Protocol Buffer
    """

    @staticmethod
    def InitializeConnection(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, '/odbc.v1.MDBService/InitializeConnection',
            odbc__pb2.InitializationRequest.SerializeToString,
            odbc__pb2.authPacket.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Begin(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, '/odbc.v1.MDBService/Begin',
            odbc__pb2.XactRequest.SerializeToString,
            odbc__pb2.XactResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Close(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, '/odbc.v1.MDBService/Close',
            odbc__pb2.authPacket.SerializeToString,
            odbc__pb2.CloseResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Exec(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, '/odbc.v1.MDBService/Exec',
            odbc__pb2.ExecRequest.SerializeToString,
            odbc__pb2.ExecResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Query(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, '/odbc.v1.MDBService/Query',
            odbc__pb2.QueryRequest.SerializeToString,
            odbc__pb2.QueryResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CloseQuery(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, '/odbc.v1.MDBService/CloseQuery',
            odbc__pb2.authPacket.SerializeToString,
            odbc__pb2.CloseQueryResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StoreFile(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_unary(request_iterator, target, '/odbc.v1.MDBService/StoreFile',
            odbc__pb2.StoreFileRequest.SerializeToString,
            odbc__pb2.StoreFileResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ExportFile(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, '/odbc.v1.MDBService/ExportFile',
            odbc__pb2.ExportFileRequest.SerializeToString,
            odbc__pb2.ExportFileResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
