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

import p2p_file_system_pb2 as p2p__file__system__pb2


class P2PFileServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.UploadFile = channel.stream_unary(
                '/p2p.P2PFileService/UploadFile',
                request_serializer=p2p__file__system__pb2.FileChunk.SerializeToString,
                response_deserializer=p2p__file__system__pb2.UploadResponse.FromString,
                )
        self.DownloadFile = channel.unary_stream(
                '/p2p.P2PFileService/DownloadFile',
                request_serializer=p2p__file__system__pb2.FileRequest.SerializeToString,
                response_deserializer=p2p__file__system__pb2.FileData.FromString,
                )


class P2PFileServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def UploadFile(self, request_iterator, 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 DownloadFile(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_P2PFileServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'UploadFile': grpc.stream_unary_rpc_method_handler(
                    servicer.UploadFile,
                    request_deserializer=p2p__file__system__pb2.FileChunk.FromString,
                    response_serializer=p2p__file__system__pb2.UploadResponse.SerializeToString,
            ),
            'DownloadFile': grpc.unary_stream_rpc_method_handler(
                    servicer.DownloadFile,
                    request_deserializer=p2p__file__system__pb2.FileRequest.FromString,
                    response_serializer=p2p__file__system__pb2.FileData.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'p2p.P2PFileService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class P2PFileService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def UploadFile(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, '/p2p.P2PFileService/UploadFile',
            p2p__file__system__pb2.FileChunk.SerializeToString,
            p2p__file__system__pb2.UploadResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DownloadFile(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, '/p2p.P2PFileService/DownloadFile',
            p2p__file__system__pb2.FileRequest.SerializeToString,
            p2p__file__system__pb2.FileData.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
