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

import database_pb2 as database__pb2


class DatabaseServiceStub(object):
    """SERVICE
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.listDatabases = channel.unary_stream(
                '/DatabaseService/listDatabases',
                request_serializer=database__pb2.DbListRequest.SerializeToString,
                response_deserializer=database__pb2.DbListResponse.FromString,
                )
        self.databaseLogin = channel.unary_unary(
                '/DatabaseService/databaseLogin',
                request_serializer=database__pb2.DbAuthRequest.SerializeToString,
                response_deserializer=database__pb2.DbAuthResponse.FromString,
                )
        self.databaseUpload = channel.stream_unary(
                '/DatabaseService/databaseUpload',
                request_serializer=database__pb2.DbUploadRequest.SerializeToString,
                response_deserializer=database__pb2.DbUploadResponse.FromString,
                )


class DatabaseServiceServicer(object):
    """SERVICE
    """

    def listDatabases(self, request, context):
        """SERVER STREAMING
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def databaseLogin(self, request, context):
        """UNARY
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def databaseUpload(self, request_iterator, context):
        """CLIENT STREAMING
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DatabaseServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'listDatabases': grpc.unary_stream_rpc_method_handler(
                    servicer.listDatabases,
                    request_deserializer=database__pb2.DbListRequest.FromString,
                    response_serializer=database__pb2.DbListResponse.SerializeToString,
            ),
            'databaseLogin': grpc.unary_unary_rpc_method_handler(
                    servicer.databaseLogin,
                    request_deserializer=database__pb2.DbAuthRequest.FromString,
                    response_serializer=database__pb2.DbAuthResponse.SerializeToString,
            ),
            'databaseUpload': grpc.stream_unary_rpc_method_handler(
                    servicer.databaseUpload,
                    request_deserializer=database__pb2.DbUploadRequest.FromString,
                    response_serializer=database__pb2.DbUploadResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'DatabaseService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class DatabaseService(object):
    """SERVICE
    """

    @staticmethod
    def listDatabases(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, '/DatabaseService/listDatabases',
            database__pb2.DbListRequest.SerializeToString,
            database__pb2.DbListResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def databaseLogin(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, '/DatabaseService/databaseLogin',
            database__pb2.DbAuthRequest.SerializeToString,
            database__pb2.DbAuthResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def databaseUpload(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, '/DatabaseService/databaseUpload',
            database__pb2.DbUploadRequest.SerializeToString,
            database__pb2.DbUploadResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
