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

from containerd.services.content.v1 import content_pb2 as containerd_dot_services_dot_content_dot_v1_dot_content__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class ContentStub(object):
    """Content provides access to a content addressable storage system.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Info = channel.unary_unary(
                '/containerd.services.content.v1.Content/Info',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.InfoRequest.SerializeToString,
                response_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.InfoResponse.FromString,
                )
        self.Update = channel.unary_unary(
                '/containerd.services.content.v1.Content/Update',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.UpdateRequest.SerializeToString,
                response_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.UpdateResponse.FromString,
                )
        self.List = channel.unary_stream(
                '/containerd.services.content.v1.Content/List',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListContentRequest.SerializeToString,
                response_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListContentResponse.FromString,
                )
        self.Delete = channel.unary_unary(
                '/containerd.services.content.v1.Content/Delete',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.DeleteContentRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.Read = channel.unary_stream(
                '/containerd.services.content.v1.Content/Read',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ReadContentRequest.SerializeToString,
                response_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ReadContentResponse.FromString,
                )
        self.Status = channel.unary_unary(
                '/containerd.services.content.v1.Content/Status',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.StatusRequest.SerializeToString,
                response_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.StatusResponse.FromString,
                )
        self.ListStatuses = channel.unary_unary(
                '/containerd.services.content.v1.Content/ListStatuses',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListStatusesRequest.SerializeToString,
                response_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListStatusesResponse.FromString,
                )
        self.Write = channel.stream_stream(
                '/containerd.services.content.v1.Content/Write',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.WriteContentRequest.SerializeToString,
                response_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.WriteContentResponse.FromString,
                )
        self.Abort = channel.unary_unary(
                '/containerd.services.content.v1.Content/Abort',
                request_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.AbortRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )


class ContentServicer(object):
    """Content provides access to a content addressable storage system.
    """

    def Info(self, request, context):
        """Info returns information about a committed object.

        This call can be used for getting the size of content and checking for
        existence.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Update updates content metadata.

        This call can be used to manage the mutable content labels. The
        immutable metadata such as digest, size, and committed at cannot
        be updated.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def List(self, request, context):
        """List streams the entire set of content as Info objects and closes the
        stream.

        Typically, this will yield a large response, chunked into messages.
        Clients should make provisions to ensure they can handle the entire data
        set.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Delete will delete the referenced object.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Read(self, request, context):
        """Read allows one to read an object based on the offset into the content.

        The requested data may be returned in one or more messages.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Status(self, request, context):
        """Status returns the status for a single reference.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListStatuses(self, request, context):
        """ListStatuses returns the status of ongoing object ingestions, started via
        Write.

        Only those matching the regular expression will be provided in the
        response. If the provided regular expression is empty, all ingestions
        will be provided.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Write(self, request_iterator, context):
        """Write begins or resumes writes to a resource identified by a unique ref.
        Only one active stream may exist at a time for each ref.

        Once a write stream has started, it may only write to a single ref, thus
        once a stream is started, the ref may be omitted on subsequent writes.

        For any write transaction represented by a ref, only a single write may
        be made to a given offset. If overlapping writes occur, it is an error.
        Writes should be sequential and implementations may throw an error if
        this is required.

        If expected_digest is set and already part of the content store, the
        write will fail.

        When completed, the commit flag should be set to true. If expected size
        or digest is set, the content will be validated against those values.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Abort(self, request, context):
        """Abort cancels the ongoing write named in the request. Any resources
        associated with the write will be collected.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ContentServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Info': grpc.unary_unary_rpc_method_handler(
                    servicer.Info,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.InfoRequest.FromString,
                    response_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.InfoResponse.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.UpdateRequest.FromString,
                    response_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.UpdateResponse.SerializeToString,
            ),
            'List': grpc.unary_stream_rpc_method_handler(
                    servicer.List,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListContentRequest.FromString,
                    response_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListContentResponse.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.DeleteContentRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Read': grpc.unary_stream_rpc_method_handler(
                    servicer.Read,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ReadContentRequest.FromString,
                    response_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ReadContentResponse.SerializeToString,
            ),
            'Status': grpc.unary_unary_rpc_method_handler(
                    servicer.Status,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.StatusRequest.FromString,
                    response_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.StatusResponse.SerializeToString,
            ),
            'ListStatuses': grpc.unary_unary_rpc_method_handler(
                    servicer.ListStatuses,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListStatusesRequest.FromString,
                    response_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListStatusesResponse.SerializeToString,
            ),
            'Write': grpc.stream_stream_rpc_method_handler(
                    servicer.Write,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.WriteContentRequest.FromString,
                    response_serializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.WriteContentResponse.SerializeToString,
            ),
            'Abort': grpc.unary_unary_rpc_method_handler(
                    servicer.Abort,
                    request_deserializer=containerd_dot_services_dot_content_dot_v1_dot_content__pb2.AbortRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'containerd.services.content.v1.Content', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Content(object):
    """Content provides access to a content addressable storage system.
    """

    @staticmethod
    def Info(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, '/containerd.services.content.v1.Content/Info',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.InfoRequest.SerializeToString,
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.InfoResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Update(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, '/containerd.services.content.v1.Content/Update',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.UpdateRequest.SerializeToString,
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.UpdateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def List(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, '/containerd.services.content.v1.Content/List',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListContentRequest.SerializeToString,
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListContentResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Delete(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, '/containerd.services.content.v1.Content/Delete',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.DeleteContentRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Read(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, '/containerd.services.content.v1.Content/Read',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ReadContentRequest.SerializeToString,
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ReadContentResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Status(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, '/containerd.services.content.v1.Content/Status',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.StatusRequest.SerializeToString,
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.StatusResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListStatuses(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, '/containerd.services.content.v1.Content/ListStatuses',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListStatusesRequest.SerializeToString,
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.ListStatusesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Write(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, '/containerd.services.content.v1.Content/Write',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.WriteContentRequest.SerializeToString,
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.WriteContentResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Abort(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, '/containerd.services.content.v1.Content/Abort',
            containerd_dot_services_dot_content_dot_v1_dot_content__pb2.AbortRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
