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

from . import analysis_pb2 as analysis__pb2


class AnalysisServiceStub(object):
    """AnalysisService is a gRPC service providing RPCs that analyze objects in a repository.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CheckBlobsGenerated = channel.stream_stream(
                '/gitaly.AnalysisService/CheckBlobsGenerated',
                request_serializer=analysis__pb2.CheckBlobsGeneratedRequest.SerializeToString,
                response_deserializer=analysis__pb2.CheckBlobsGeneratedResponse.FromString,
                )


class AnalysisServiceServicer(object):
    """AnalysisService is a gRPC service providing RPCs that analyze objects in a repository.
    """

    def CheckBlobsGenerated(self, request_iterator, context):
        """CheckBlobsGenerated checks a provided set of blobs in a specified repository to determine
        whether the file is considered generated. This RPC supports bidirectional streaming because the
        client may specify any number of files to check across multiple request messages and the server
        responds to each request with a separate set of response messages.

        Each provided blob in the request is validated when received. Improperly formatted requests
        result in RPC termination and an error being returned to the client. The RPC also aborts and
        returns an error if requests are made that list Git revisions which do not resolve to a blob
        and/or cannot be found in the repository.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AnalysisServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CheckBlobsGenerated': grpc.stream_stream_rpc_method_handler(
                    servicer.CheckBlobsGenerated,
                    request_deserializer=analysis__pb2.CheckBlobsGeneratedRequest.FromString,
                    response_serializer=analysis__pb2.CheckBlobsGeneratedResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'gitaly.AnalysisService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class AnalysisService(object):
    """AnalysisService is a gRPC service providing RPCs that analyze objects in a repository.
    """

    @staticmethod
    def CheckBlobsGenerated(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_stream(request_iterator, target, '/gitaly.AnalysisService/CheckBlobsGenerated',
            analysis__pb2.CheckBlobsGeneratedRequest.SerializeToString,
            analysis__pb2.CheckBlobsGeneratedResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
