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

from apibara.application import \
    indexer_service_pb2 as apibara_dot_application_dot_indexer__service__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateIndexer = channel.unary_unary(
            "/apibara.application.v1alpha1.IndexerManager/CreateIndexer",
            request_serializer=apibara_dot_application_dot_indexer__service__pb2.CreateIndexerRequest.SerializeToString,
            response_deserializer=apibara_dot_application_dot_indexer__service__pb2.CreateIndexerResponse.FromString,
        )
        self.GetIndexer = channel.unary_unary(
            "/apibara.application.v1alpha1.IndexerManager/GetIndexer",
            request_serializer=apibara_dot_application_dot_indexer__service__pb2.GetIndexerRequest.SerializeToString,
            response_deserializer=apibara_dot_application_dot_indexer__service__pb2.GetIndexerResponse.FromString,
        )
        self.ListIndexer = channel.unary_unary(
            "/apibara.application.v1alpha1.IndexerManager/ListIndexer",
            request_serializer=apibara_dot_application_dot_indexer__service__pb2.ListIndexerRequest.SerializeToString,
            response_deserializer=apibara_dot_application_dot_indexer__service__pb2.ListIndexerResponse.FromString,
        )
        self.DeleteIndexer = channel.unary_unary(
            "/apibara.application.v1alpha1.IndexerManager/DeleteIndexer",
            request_serializer=apibara_dot_application_dot_indexer__service__pb2.DeleteIndexerRequest.SerializeToString,
            response_deserializer=apibara_dot_application_dot_indexer__service__pb2.DeleteIndexerResponse.FromString,
        )
        self.ConnectIndexer = channel.stream_stream(
            "/apibara.application.v1alpha1.IndexerManager/ConnectIndexer",
            request_serializer=apibara_dot_application_dot_indexer__service__pb2.ConnectIndexerRequest.SerializeToString,
            response_deserializer=apibara_dot_application_dot_indexer__service__pb2.ConnectIndexerResponse.FromString,
        )


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

    def CreateIndexer(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 GetIndexer(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 ListIndexer(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 DeleteIndexer(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 ConnectIndexer(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 add_IndexerManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "CreateIndexer": grpc.unary_unary_rpc_method_handler(
            servicer.CreateIndexer,
            request_deserializer=apibara_dot_application_dot_indexer__service__pb2.CreateIndexerRequest.FromString,
            response_serializer=apibara_dot_application_dot_indexer__service__pb2.CreateIndexerResponse.SerializeToString,
        ),
        "GetIndexer": grpc.unary_unary_rpc_method_handler(
            servicer.GetIndexer,
            request_deserializer=apibara_dot_application_dot_indexer__service__pb2.GetIndexerRequest.FromString,
            response_serializer=apibara_dot_application_dot_indexer__service__pb2.GetIndexerResponse.SerializeToString,
        ),
        "ListIndexer": grpc.unary_unary_rpc_method_handler(
            servicer.ListIndexer,
            request_deserializer=apibara_dot_application_dot_indexer__service__pb2.ListIndexerRequest.FromString,
            response_serializer=apibara_dot_application_dot_indexer__service__pb2.ListIndexerResponse.SerializeToString,
        ),
        "DeleteIndexer": grpc.unary_unary_rpc_method_handler(
            servicer.DeleteIndexer,
            request_deserializer=apibara_dot_application_dot_indexer__service__pb2.DeleteIndexerRequest.FromString,
            response_serializer=apibara_dot_application_dot_indexer__service__pb2.DeleteIndexerResponse.SerializeToString,
        ),
        "ConnectIndexer": grpc.stream_stream_rpc_method_handler(
            servicer.ConnectIndexer,
            request_deserializer=apibara_dot_application_dot_indexer__service__pb2.ConnectIndexerRequest.FromString,
            response_serializer=apibara_dot_application_dot_indexer__service__pb2.ConnectIndexerResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "apibara.application.v1alpha1.IndexerManager", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def CreateIndexer(
        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,
            "/apibara.application.v1alpha1.IndexerManager/CreateIndexer",
            apibara_dot_application_dot_indexer__service__pb2.CreateIndexerRequest.SerializeToString,
            apibara_dot_application_dot_indexer__service__pb2.CreateIndexerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetIndexer(
        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,
            "/apibara.application.v1alpha1.IndexerManager/GetIndexer",
            apibara_dot_application_dot_indexer__service__pb2.GetIndexerRequest.SerializeToString,
            apibara_dot_application_dot_indexer__service__pb2.GetIndexerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ListIndexer(
        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,
            "/apibara.application.v1alpha1.IndexerManager/ListIndexer",
            apibara_dot_application_dot_indexer__service__pb2.ListIndexerRequest.SerializeToString,
            apibara_dot_application_dot_indexer__service__pb2.ListIndexerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def DeleteIndexer(
        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,
            "/apibara.application.v1alpha1.IndexerManager/DeleteIndexer",
            apibara_dot_application_dot_indexer__service__pb2.DeleteIndexerRequest.SerializeToString,
            apibara_dot_application_dot_indexer__service__pb2.DeleteIndexerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def ConnectIndexer(
        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,
            "/apibara.application.v1alpha1.IndexerManager/ConnectIndexer",
            apibara_dot_application_dot_indexer__service__pb2.ConnectIndexerRequest.SerializeToString,
            apibara_dot_application_dot_indexer__service__pb2.ConnectIndexerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
