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

import api_pb2 as api__pb2


class DgraphStub(object):
    """Graph response.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Login = channel.unary_unary(
                '/api.Dgraph/Login',
                request_serializer=api__pb2.LoginRequest.SerializeToString,
                response_deserializer=api__pb2.Response.FromString,
                )
        self.Query = channel.unary_unary(
                '/api.Dgraph/Query',
                request_serializer=api__pb2.Request.SerializeToString,
                response_deserializer=api__pb2.Response.FromString,
                )
        self.Alter = channel.unary_unary(
                '/api.Dgraph/Alter',
                request_serializer=api__pb2.Operation.SerializeToString,
                response_deserializer=api__pb2.Payload.FromString,
                )
        self.CommitOrAbort = channel.unary_unary(
                '/api.Dgraph/CommitOrAbort',
                request_serializer=api__pb2.TxnContext.SerializeToString,
                response_deserializer=api__pb2.TxnContext.FromString,
                )
        self.CheckVersion = channel.unary_unary(
                '/api.Dgraph/CheckVersion',
                request_serializer=api__pb2.Check.SerializeToString,
                response_deserializer=api__pb2.Version.FromString,
                )


class DgraphServicer(object):
    """Graph response.
    """

    def Login(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 Query(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 Alter(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 CommitOrAbort(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 CheckVersion(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_DgraphServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Login': grpc.unary_unary_rpc_method_handler(
                    servicer.Login,
                    request_deserializer=api__pb2.LoginRequest.FromString,
                    response_serializer=api__pb2.Response.SerializeToString,
            ),
            'Query': grpc.unary_unary_rpc_method_handler(
                    servicer.Query,
                    request_deserializer=api__pb2.Request.FromString,
                    response_serializer=api__pb2.Response.SerializeToString,
            ),
            'Alter': grpc.unary_unary_rpc_method_handler(
                    servicer.Alter,
                    request_deserializer=api__pb2.Operation.FromString,
                    response_serializer=api__pb2.Payload.SerializeToString,
            ),
            'CommitOrAbort': grpc.unary_unary_rpc_method_handler(
                    servicer.CommitOrAbort,
                    request_deserializer=api__pb2.TxnContext.FromString,
                    response_serializer=api__pb2.TxnContext.SerializeToString,
            ),
            'CheckVersion': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckVersion,
                    request_deserializer=api__pb2.Check.FromString,
                    response_serializer=api__pb2.Version.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'api.Dgraph', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Dgraph(object):
    """Graph response.
    """

    @staticmethod
    def Login(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, '/api.Dgraph/Login',
            api__pb2.LoginRequest.SerializeToString,
            api__pb2.Response.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_unary(request, target, '/api.Dgraph/Query',
            api__pb2.Request.SerializeToString,
            api__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Alter(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, '/api.Dgraph/Alter',
            api__pb2.Operation.SerializeToString,
            api__pb2.Payload.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CommitOrAbort(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, '/api.Dgraph/CommitOrAbort',
            api__pb2.TxnContext.SerializeToString,
            api__pb2.TxnContext.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CheckVersion(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, '/api.Dgraph/CheckVersion',
            api__pb2.Check.SerializeToString,
            api__pb2.Version.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
