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

from aruna.api.internal.v1 import proxy_pb2 as aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2


class InternalProxyServiceStub(object):
    """Definition for the internal API that is used to communicate with all internal
    components.

    All uploads should follow this procedure:
    1. Init a new upload.
    2. Create a Upload Presigned URL (The URL should contain a specifier for the
    upload and part id)
    3. Use the presigned URL to upload individual parts, 1-x times.
    4. When all parts are uploaded, call FinishPresignedUpload to complete the
    upload and provide the parts list.

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.InitPresignedUpload = channel.unary_unary(
                '/aruna.api.internal.v1.InternalProxyService/InitPresignedUpload',
                request_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.InitPresignedUploadRequest.SerializeToString,
                response_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.InitPresignedUploadResponse.FromString,
                )
        self.CreatePresignedUploadUrl = channel.unary_unary(
                '/aruna.api.internal.v1.InternalProxyService/CreatePresignedUploadUrl',
                request_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedUploadUrlRequest.SerializeToString,
                response_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedUploadUrlResponse.FromString,
                )
        self.FinishPresignedUpload = channel.unary_unary(
                '/aruna.api.internal.v1.InternalProxyService/FinishPresignedUpload',
                request_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.FinishPresignedUploadRequest.SerializeToString,
                response_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.FinishPresignedUploadResponse.FromString,
                )
        self.CreatePresignedDownload = channel.unary_unary(
                '/aruna.api.internal.v1.InternalProxyService/CreatePresignedDownload',
                request_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedDownloadRequest.SerializeToString,
                response_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedDownloadResponse.FromString,
                )
        self.CreateBucket = channel.unary_unary(
                '/aruna.api.internal.v1.InternalProxyService/CreateBucket',
                request_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreateBucketRequest.SerializeToString,
                response_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreateBucketResponse.FromString,
                )


class InternalProxyServiceServicer(object):
    """Definition for the internal API that is used to communicate with all internal
    components.

    All uploads should follow this procedure:
    1. Init a new upload.
    2. Create a Upload Presigned URL (The URL should contain a specifier for the
    upload and part id)
    3. Use the presigned URL to upload individual parts, 1-x times.
    4. When all parts are uploaded, call FinishPresignedUpload to complete the
    upload and provide the parts list.

    """

    def InitPresignedUpload(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 CreatePresignedUploadUrl(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 FinishPresignedUpload(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 CreatePresignedDownload(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 CreateBucket(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_InternalProxyServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'InitPresignedUpload': grpc.unary_unary_rpc_method_handler(
                    servicer.InitPresignedUpload,
                    request_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.InitPresignedUploadRequest.FromString,
                    response_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.InitPresignedUploadResponse.SerializeToString,
            ),
            'CreatePresignedUploadUrl': grpc.unary_unary_rpc_method_handler(
                    servicer.CreatePresignedUploadUrl,
                    request_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedUploadUrlRequest.FromString,
                    response_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedUploadUrlResponse.SerializeToString,
            ),
            'FinishPresignedUpload': grpc.unary_unary_rpc_method_handler(
                    servicer.FinishPresignedUpload,
                    request_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.FinishPresignedUploadRequest.FromString,
                    response_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.FinishPresignedUploadResponse.SerializeToString,
            ),
            'CreatePresignedDownload': grpc.unary_unary_rpc_method_handler(
                    servicer.CreatePresignedDownload,
                    request_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedDownloadRequest.FromString,
                    response_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedDownloadResponse.SerializeToString,
            ),
            'CreateBucket': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateBucket,
                    request_deserializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreateBucketRequest.FromString,
                    response_serializer=aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreateBucketResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'aruna.api.internal.v1.InternalProxyService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class InternalProxyService(object):
    """Definition for the internal API that is used to communicate with all internal
    components.

    All uploads should follow this procedure:
    1. Init a new upload.
    2. Create a Upload Presigned URL (The URL should contain a specifier for the
    upload and part id)
    3. Use the presigned URL to upload individual parts, 1-x times.
    4. When all parts are uploaded, call FinishPresignedUpload to complete the
    upload and provide the parts list.

    """

    @staticmethod
    def InitPresignedUpload(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, '/aruna.api.internal.v1.InternalProxyService/InitPresignedUpload',
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.InitPresignedUploadRequest.SerializeToString,
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.InitPresignedUploadResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreatePresignedUploadUrl(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, '/aruna.api.internal.v1.InternalProxyService/CreatePresignedUploadUrl',
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedUploadUrlRequest.SerializeToString,
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedUploadUrlResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def FinishPresignedUpload(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, '/aruna.api.internal.v1.InternalProxyService/FinishPresignedUpload',
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.FinishPresignedUploadRequest.SerializeToString,
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.FinishPresignedUploadResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreatePresignedDownload(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, '/aruna.api.internal.v1.InternalProxyService/CreatePresignedDownload',
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedDownloadRequest.SerializeToString,
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreatePresignedDownloadResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateBucket(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, '/aruna.api.internal.v1.InternalProxyService/CreateBucket',
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreateBucketRequest.SerializeToString,
            aruna_dot_api_dot_internal_dot_v1_dot_proxy__pb2.CreateBucketResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
