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

from sensory_cloud.generated.v1.file import file_pb2 as v1_dot_file_dot_file__pb2


class FileStub(object):
    """Handles all file-related functions
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetInfo = channel.unary_unary(
                '/sensory.api.v1.file.File/GetInfo',
                request_serializer=v1_dot_file_dot_file__pb2.FileRequest.SerializeToString,
                response_deserializer=v1_dot_file_dot_file__pb2.FileInfo.FromString,
                )
        self.GetCatalog = channel.unary_unary(
                '/sensory.api.v1.file.File/GetCatalog',
                request_serializer=v1_dot_file_dot_file__pb2.FileCatalogRequest.SerializeToString,
                response_deserializer=v1_dot_file_dot_file__pb2.FileCatalogResponse.FromString,
                )
        self.GetCompleteCatalog = channel.unary_unary(
                '/sensory.api.v1.file.File/GetCompleteCatalog',
                request_serializer=v1_dot_file_dot_file__pb2.FileCompleteCatalogRequest.SerializeToString,
                response_deserializer=v1_dot_file_dot_file__pb2.FileCatalogResponse.FromString,
                )
        self.Download = channel.unary_stream(
                '/sensory.api.v1.file.File/Download',
                request_serializer=v1_dot_file_dot_file__pb2.FileRequest.SerializeToString,
                response_deserializer=v1_dot_file_dot_file__pb2.FileResponse.FromString,
                )


class FileServicer(object):
    """Handles all file-related functions
    """

    def GetInfo(self, request, context):
        """Allows a client to request information about a file in the cloud.
        Authorization metadata is required {"authorization": "Bearer <TOKEN>"}
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetCatalog(self, request, context):
        """Allows a client to request a list of all the files it is allowed to access
        Authorization metadata is required {"authorization": "Bearer <TOKEN>"}
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetCompleteCatalog(self, request, context):
        """Allows a root client to request the full list of files
        Authorization metadata is required {"authorization": "Bearer <TOKEN>"}
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Download(self, request, context):
        """Allows a client to request a file from the cloud.
        Download streams a FileResponse until the entire file is downloaded
        Authorization metadata is required {"authorization": "Bearer <TOKEN>"}
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_FileServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetInfo,
                    request_deserializer=v1_dot_file_dot_file__pb2.FileRequest.FromString,
                    response_serializer=v1_dot_file_dot_file__pb2.FileInfo.SerializeToString,
            ),
            'GetCatalog': grpc.unary_unary_rpc_method_handler(
                    servicer.GetCatalog,
                    request_deserializer=v1_dot_file_dot_file__pb2.FileCatalogRequest.FromString,
                    response_serializer=v1_dot_file_dot_file__pb2.FileCatalogResponse.SerializeToString,
            ),
            'GetCompleteCatalog': grpc.unary_unary_rpc_method_handler(
                    servicer.GetCompleteCatalog,
                    request_deserializer=v1_dot_file_dot_file__pb2.FileCompleteCatalogRequest.FromString,
                    response_serializer=v1_dot_file_dot_file__pb2.FileCatalogResponse.SerializeToString,
            ),
            'Download': grpc.unary_stream_rpc_method_handler(
                    servicer.Download,
                    request_deserializer=v1_dot_file_dot_file__pb2.FileRequest.FromString,
                    response_serializer=v1_dot_file_dot_file__pb2.FileResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'sensory.api.v1.file.File', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class File(object):
    """Handles all file-related functions
    """

    @staticmethod
    def GetInfo(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, '/sensory.api.v1.file.File/GetInfo',
            v1_dot_file_dot_file__pb2.FileRequest.SerializeToString,
            v1_dot_file_dot_file__pb2.FileInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetCatalog(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, '/sensory.api.v1.file.File/GetCatalog',
            v1_dot_file_dot_file__pb2.FileCatalogRequest.SerializeToString,
            v1_dot_file_dot_file__pb2.FileCatalogResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetCompleteCatalog(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, '/sensory.api.v1.file.File/GetCompleteCatalog',
            v1_dot_file_dot_file__pb2.FileCompleteCatalogRequest.SerializeToString,
            v1_dot_file_dot_file__pb2.FileCatalogResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Download(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, '/sensory.api.v1.file.File/Download',
            v1_dot_file_dot_file__pb2.FileRequest.SerializeToString,
            v1_dot_file_dot_file__pb2.FileResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
