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

from yandex.cloud.mdb.sqlserver.v1 import database_pb2 as yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__pb2
from yandex.cloud.mdb.sqlserver.v1 import database_service_pb2 as yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2
from yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2


class DatabaseServiceStub(object):
    """A set of methods for managing SQL Server databases.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Get = channel.unary_unary(
                '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Get',
                request_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.GetDatabaseRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__pb2.Database.FromString,
                )
        self.List = channel.unary_unary(
                '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/List',
                request_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ListDatabasesRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ListDatabasesResponse.FromString,
                )
        self.Create = channel.unary_unary(
                '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Create',
                request_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.CreateDatabaseRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.Restore = channel.unary_unary(
                '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Restore',
                request_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.RestoreDatabaseRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.ImportBackup = channel.unary_unary(
                '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/ImportBackup',
                request_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ImportDatabaseBackupRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.ExportBackup = channel.unary_unary(
                '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/ExportBackup',
                request_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ExportDatabaseBackupRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.Delete = channel.unary_unary(
                '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Delete',
                request_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.DeleteDatabaseRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )


class DatabaseServiceServicer(object):
    """A set of methods for managing SQL Server databases.
    """

    def Get(self, request, context):
        """Returns the specified SQL Server database.

        To get the list of available SQL Server databases, make a [List] request.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def List(self, request, context):
        """Retrieves the list of SQL Server databases in the specified cluster.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Create(self, request, context):
        """Creates a new SQL Server database in the specified cluster.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Restore(self, request, context):
        """Creates a new SQL Server database in the specified cluster from a backup.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ImportBackup(self, request, context):
        """Imports a new SQL Server database from an external backup.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExportBackup(self, request, context):
        """Exports the last database backup to an external backup.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Deletes the specified SQL Server database.
        """
        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 = {
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.GetDatabaseRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__pb2.Database.SerializeToString,
            ),
            'List': grpc.unary_unary_rpc_method_handler(
                    servicer.List,
                    request_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ListDatabasesRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ListDatabasesResponse.SerializeToString,
            ),
            'Create': grpc.unary_unary_rpc_method_handler(
                    servicer.Create,
                    request_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.CreateDatabaseRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Restore': grpc.unary_unary_rpc_method_handler(
                    servicer.Restore,
                    request_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.RestoreDatabaseRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'ImportBackup': grpc.unary_unary_rpc_method_handler(
                    servicer.ImportBackup,
                    request_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ImportDatabaseBackupRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'ExportBackup': grpc.unary_unary_rpc_method_handler(
                    servicer.ExportBackup,
                    request_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ExportDatabaseBackupRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.DeleteDatabaseRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.mdb.sqlserver.v1.DatabaseService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class DatabaseService(object):
    """A set of methods for managing SQL Server databases.
    """

    @staticmethod
    def Get(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, '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Get',
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.GetDatabaseRequest.SerializeToString,
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__pb2.Database.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def List(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, '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/List',
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ListDatabasesRequest.SerializeToString,
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ListDatabasesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Create(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, '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Create',
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.CreateDatabaseRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Restore(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, '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Restore',
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.RestoreDatabaseRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ImportBackup(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, '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/ImportBackup',
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ImportDatabaseBackupRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ExportBackup(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, '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/ExportBackup',
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.ExportDatabaseBackupRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Delete(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, '/yandex.cloud.mdb.sqlserver.v1.DatabaseService/Delete',
            yandex_dot_cloud_dot_mdb_dot_sqlserver_dot_v1_dot_database__service__pb2.DeleteDatabaseRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
