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

from agntcy.dir.core.v1 import record_pb2 as agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2
from agntcy.dir.store.v1 import store_service_pb2 as agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class StoreServiceStub(object):
    """Defines an interface for content-addressable storage
    service for objects.

    Max object size: 4MB (to fully fit in a single request)
    Max metadata size: 100KB

    Store service can be implemented by various storage backends,
    such as local file system, OCI registry, etc.

    Middleware should be used to control who can perform these RPCs.
    Policies for the middleware can be handled via separate service.

    Each operation is performed sequentially, meaning that
    for the N-th request, N-th response will be returned.
    If an error occurs, the stream will be cancelled.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Push = channel.stream_stream(
                '/agntcy.dir.store.v1.StoreService/Push',
                request_serializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.Record.SerializeToString,
                response_deserializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.FromString,
                _registered_method=True)
        self.Pull = channel.stream_stream(
                '/agntcy.dir.store.v1.StoreService/Pull',
                request_serializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.SerializeToString,
                response_deserializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.Record.FromString,
                _registered_method=True)
        self.Lookup = channel.stream_stream(
                '/agntcy.dir.store.v1.StoreService/Lookup',
                request_serializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.SerializeToString,
                response_deserializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordMeta.FromString,
                _registered_method=True)
        self.Delete = channel.stream_unary(
                '/agntcy.dir.store.v1.StoreService/Delete',
                request_serializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                _registered_method=True)
        self.PushReferrer = channel.stream_stream(
                '/agntcy.dir.store.v1.StoreService/PushReferrer',
                request_serializer=agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PushReferrerRequest.SerializeToString,
                response_deserializer=agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PushReferrerResponse.FromString,
                _registered_method=True)
        self.PullReferrer = channel.stream_stream(
                '/agntcy.dir.store.v1.StoreService/PullReferrer',
                request_serializer=agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PullReferrerRequest.SerializeToString,
                response_deserializer=agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PullReferrerResponse.FromString,
                _registered_method=True)


class StoreServiceServicer(object):
    """Defines an interface for content-addressable storage
    service for objects.

    Max object size: 4MB (to fully fit in a single request)
    Max metadata size: 100KB

    Store service can be implemented by various storage backends,
    such as local file system, OCI registry, etc.

    Middleware should be used to control who can perform these RPCs.
    Policies for the middleware can be handled via separate service.

    Each operation is performed sequentially, meaning that
    for the N-th request, N-th response will be returned.
    If an error occurs, the stream will be cancelled.
    """

    def Push(self, request_iterator, context):
        """Push performs write operation for given records.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Pull(self, request_iterator, context):
        """Pull performs read operation for given records.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Lookup(self, request_iterator, context):
        """Lookup resolves basic metadata for the records.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request_iterator, context):
        """Remove performs delete operation for the records.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PushReferrer(self, request_iterator, context):
        """PushReferrer performs write operation for record referrers.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PullReferrer(self, request_iterator, context):
        """PullReferrer performs read operation for record referrers.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_StoreServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Push': grpc.stream_stream_rpc_method_handler(
                    servicer.Push,
                    request_deserializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.Record.FromString,
                    response_serializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.SerializeToString,
            ),
            'Pull': grpc.stream_stream_rpc_method_handler(
                    servicer.Pull,
                    request_deserializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.FromString,
                    response_serializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.Record.SerializeToString,
            ),
            'Lookup': grpc.stream_stream_rpc_method_handler(
                    servicer.Lookup,
                    request_deserializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.FromString,
                    response_serializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordMeta.SerializeToString,
            ),
            'Delete': grpc.stream_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'PushReferrer': grpc.stream_stream_rpc_method_handler(
                    servicer.PushReferrer,
                    request_deserializer=agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PushReferrerRequest.FromString,
                    response_serializer=agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PushReferrerResponse.SerializeToString,
            ),
            'PullReferrer': grpc.stream_stream_rpc_method_handler(
                    servicer.PullReferrer,
                    request_deserializer=agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PullReferrerRequest.FromString,
                    response_serializer=agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PullReferrerResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'agntcy.dir.store.v1.StoreService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('agntcy.dir.store.v1.StoreService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class StoreService(object):
    """Defines an interface for content-addressable storage
    service for objects.

    Max object size: 4MB (to fully fit in a single request)
    Max metadata size: 100KB

    Store service can be implemented by various storage backends,
    such as local file system, OCI registry, etc.

    Middleware should be used to control who can perform these RPCs.
    Policies for the middleware can be handled via separate service.

    Each operation is performed sequentially, meaning that
    for the N-th request, N-th response will be returned.
    If an error occurs, the stream will be cancelled.
    """

    @staticmethod
    def Push(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,
            '/agntcy.dir.store.v1.StoreService/Push',
            agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.Record.SerializeToString,
            agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Pull(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,
            '/agntcy.dir.store.v1.StoreService/Pull',
            agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.SerializeToString,
            agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.Record.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Lookup(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,
            '/agntcy.dir.store.v1.StoreService/Lookup',
            agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.SerializeToString,
            agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordMeta.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Delete(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,
            '/agntcy.dir.store.v1.StoreService/Delete',
            agntcy_dot_dir_dot_core_dot_v1_dot_record__pb2.RecordRef.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PushReferrer(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,
            '/agntcy.dir.store.v1.StoreService/PushReferrer',
            agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PushReferrerRequest.SerializeToString,
            agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PushReferrerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PullReferrer(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,
            '/agntcy.dir.store.v1.StoreService/PullReferrer',
            agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PullReferrerRequest.SerializeToString,
            agntcy_dot_dir_dot_store_dot_v1_dot_store__service__pb2.PullReferrerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
