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

from . import diff_pb2 as diff__pb2


class DiffServiceStub(object):
    """DiffService is a service which provides RPCs to inspect differences
    introduced between a set of commits.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CommitDiff = channel.unary_stream(
                '/gitaly.DiffService/CommitDiff',
                request_serializer=diff__pb2.CommitDiffRequest.SerializeToString,
                response_deserializer=diff__pb2.CommitDiffResponse.FromString,
                )
        self.CommitDelta = channel.unary_stream(
                '/gitaly.DiffService/CommitDelta',
                request_serializer=diff__pb2.CommitDeltaRequest.SerializeToString,
                response_deserializer=diff__pb2.CommitDeltaResponse.FromString,
                )
        self.RawDiff = channel.unary_stream(
                '/gitaly.DiffService/RawDiff',
                request_serializer=diff__pb2.RawDiffRequest.SerializeToString,
                response_deserializer=diff__pb2.RawDiffResponse.FromString,
                )
        self.RawPatch = channel.unary_stream(
                '/gitaly.DiffService/RawPatch',
                request_serializer=diff__pb2.RawPatchRequest.SerializeToString,
                response_deserializer=diff__pb2.RawPatchResponse.FromString,
                )
        self.DiffStats = channel.unary_stream(
                '/gitaly.DiffService/DiffStats',
                request_serializer=diff__pb2.DiffStatsRequest.SerializeToString,
                response_deserializer=diff__pb2.DiffStatsResponse.FromString,
                )
        self.FindChangedPaths = channel.unary_stream(
                '/gitaly.DiffService/FindChangedPaths',
                request_serializer=diff__pb2.FindChangedPathsRequest.SerializeToString,
                response_deserializer=diff__pb2.FindChangedPathsResponse.FromString,
                )
        self.GetPatchID = channel.unary_unary(
                '/gitaly.DiffService/GetPatchID',
                request_serializer=diff__pb2.GetPatchIDRequest.SerializeToString,
                response_deserializer=diff__pb2.GetPatchIDResponse.FromString,
                )
        self.RawRangeDiff = channel.unary_stream(
                '/gitaly.DiffService/RawRangeDiff',
                request_serializer=diff__pb2.RawRangeDiffRequest.SerializeToString,
                response_deserializer=diff__pb2.RawRangeDiffResponse.FromString,
                )
        self.RangeDiff = channel.unary_stream(
                '/gitaly.DiffService/RangeDiff',
                request_serializer=diff__pb2.RangeDiffRequest.SerializeToString,
                response_deserializer=diff__pb2.RangeDiffResponse.FromString,
                )
        self.DiffBlobs = channel.unary_stream(
                '/gitaly.DiffService/DiffBlobs',
                request_serializer=diff__pb2.DiffBlobsRequest.SerializeToString,
                response_deserializer=diff__pb2.DiffBlobsResponse.FromString,
                )


class DiffServiceServicer(object):
    """DiffService is a service which provides RPCs to inspect differences
    introduced between a set of commits.
    """

    def CommitDiff(self, request, context):
        """CommitDiff returns a diff between two different commits. The patch data is
        chunked across messages and get streamed back to the client.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CommitDelta(self, request, context):
        """CommitDelta returns the deltas between two different commits. A delta
        includes everything that changed about a set of paths except for the actual
        diff.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RawDiff(self, request, context):
        """RawDiff returns a diff between two commits. The output is the unmodified
        output from git-diff(1). This is not to be confused with git-diff(1)'s
        --raw mode.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RawPatch(self, request, context):
        """RawPatch returns a diff between two commits in a formatted patch.The output
        is the unmodified output from git-format-patch(1). This is not to be confused with
        git-diff(1)'s --raw mode.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DiffStats(self, request, context):
        """DiffStats returns the diff stats between two commits such as number of lines
        changed, etc.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FindChangedPaths(self, request, context):
        """FindChangedPaths returns a list of files changed along with the status of each file
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetPatchID(self, request, context):
        """GetPatchID computes a patch ID for a patch. Patch IDs are a unique ID computed by hashing
        a patch with some parameters like line numbers ignored. The patch ID can thus be used to compare
        whether diffs make the same change. Please refer to git-patch-id(1) for further information.
        If the difference between old and new change is empty then this RPC returns an error.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RawRangeDiff(self, request, context):
        """RawRangeDiff outputs the raw range diff data for a given range specification.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RangeDiff(self, request, context):
        """RangeDiff outputs the parsed commit pairs from range diff for a given range specification.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DiffBlobs(self, request, context):
        """DiffBlobs computes diffs between pairs of blobs. A batch of blob pairs is sent to the server.
        The resulting patches are then chucked across response messages and streamed to the client.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DiffServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CommitDiff': grpc.unary_stream_rpc_method_handler(
                    servicer.CommitDiff,
                    request_deserializer=diff__pb2.CommitDiffRequest.FromString,
                    response_serializer=diff__pb2.CommitDiffResponse.SerializeToString,
            ),
            'CommitDelta': grpc.unary_stream_rpc_method_handler(
                    servicer.CommitDelta,
                    request_deserializer=diff__pb2.CommitDeltaRequest.FromString,
                    response_serializer=diff__pb2.CommitDeltaResponse.SerializeToString,
            ),
            'RawDiff': grpc.unary_stream_rpc_method_handler(
                    servicer.RawDiff,
                    request_deserializer=diff__pb2.RawDiffRequest.FromString,
                    response_serializer=diff__pb2.RawDiffResponse.SerializeToString,
            ),
            'RawPatch': grpc.unary_stream_rpc_method_handler(
                    servicer.RawPatch,
                    request_deserializer=diff__pb2.RawPatchRequest.FromString,
                    response_serializer=diff__pb2.RawPatchResponse.SerializeToString,
            ),
            'DiffStats': grpc.unary_stream_rpc_method_handler(
                    servicer.DiffStats,
                    request_deserializer=diff__pb2.DiffStatsRequest.FromString,
                    response_serializer=diff__pb2.DiffStatsResponse.SerializeToString,
            ),
            'FindChangedPaths': grpc.unary_stream_rpc_method_handler(
                    servicer.FindChangedPaths,
                    request_deserializer=diff__pb2.FindChangedPathsRequest.FromString,
                    response_serializer=diff__pb2.FindChangedPathsResponse.SerializeToString,
            ),
            'GetPatchID': grpc.unary_unary_rpc_method_handler(
                    servicer.GetPatchID,
                    request_deserializer=diff__pb2.GetPatchIDRequest.FromString,
                    response_serializer=diff__pb2.GetPatchIDResponse.SerializeToString,
            ),
            'RawRangeDiff': grpc.unary_stream_rpc_method_handler(
                    servicer.RawRangeDiff,
                    request_deserializer=diff__pb2.RawRangeDiffRequest.FromString,
                    response_serializer=diff__pb2.RawRangeDiffResponse.SerializeToString,
            ),
            'RangeDiff': grpc.unary_stream_rpc_method_handler(
                    servicer.RangeDiff,
                    request_deserializer=diff__pb2.RangeDiffRequest.FromString,
                    response_serializer=diff__pb2.RangeDiffResponse.SerializeToString,
            ),
            'DiffBlobs': grpc.unary_stream_rpc_method_handler(
                    servicer.DiffBlobs,
                    request_deserializer=diff__pb2.DiffBlobsRequest.FromString,
                    response_serializer=diff__pb2.DiffBlobsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'gitaly.DiffService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class DiffService(object):
    """DiffService is a service which provides RPCs to inspect differences
    introduced between a set of commits.
    """

    @staticmethod
    def CommitDiff(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, '/gitaly.DiffService/CommitDiff',
            diff__pb2.CommitDiffRequest.SerializeToString,
            diff__pb2.CommitDiffResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CommitDelta(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, '/gitaly.DiffService/CommitDelta',
            diff__pb2.CommitDeltaRequest.SerializeToString,
            diff__pb2.CommitDeltaResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RawDiff(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, '/gitaly.DiffService/RawDiff',
            diff__pb2.RawDiffRequest.SerializeToString,
            diff__pb2.RawDiffResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RawPatch(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, '/gitaly.DiffService/RawPatch',
            diff__pb2.RawPatchRequest.SerializeToString,
            diff__pb2.RawPatchResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DiffStats(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, '/gitaly.DiffService/DiffStats',
            diff__pb2.DiffStatsRequest.SerializeToString,
            diff__pb2.DiffStatsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def FindChangedPaths(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, '/gitaly.DiffService/FindChangedPaths',
            diff__pb2.FindChangedPathsRequest.SerializeToString,
            diff__pb2.FindChangedPathsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetPatchID(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, '/gitaly.DiffService/GetPatchID',
            diff__pb2.GetPatchIDRequest.SerializeToString,
            diff__pb2.GetPatchIDResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RawRangeDiff(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, '/gitaly.DiffService/RawRangeDiff',
            diff__pb2.RawRangeDiffRequest.SerializeToString,
            diff__pb2.RawRangeDiffResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RangeDiff(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, '/gitaly.DiffService/RangeDiff',
            diff__pb2.RangeDiffRequest.SerializeToString,
            diff__pb2.RangeDiffResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DiffBlobs(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, '/gitaly.DiffService/DiffBlobs',
            diff__pb2.DiffBlobsRequest.SerializeToString,
            diff__pb2.DiffBlobsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
