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

from . import kyrodb_pb2 as kyrodb__pb2

GRPC_GENERATED_VERSION = '1.76.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in kyrodb_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class KyroDBServiceStub(object):
    """Core KyroDB service - all operations for vector storage and retrieval
    ============================================================================
    WRITE OPERATIONS
    ============================================================================
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Insert = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/Insert',
                request_serializer=kyrodb__pb2.InsertRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.InsertResponse.FromString,
                _registered_method=True)
        self.BulkInsert = channel.stream_unary(
                '/kyrodb.v1.KyroDBService/BulkInsert',
                request_serializer=kyrodb__pb2.InsertRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.InsertResponse.FromString,
                _registered_method=True)
        self.BulkLoadHnsw = channel.stream_unary(
                '/kyrodb.v1.KyroDBService/BulkLoadHnsw',
                request_serializer=kyrodb__pb2.InsertRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.BulkLoadResponse.FromString,
                _registered_method=True)
        self.Delete = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/Delete',
                request_serializer=kyrodb__pb2.DeleteRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.DeleteResponse.FromString,
                _registered_method=True)
        self.UpdateMetadata = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/UpdateMetadata',
                request_serializer=kyrodb__pb2.UpdateMetadataRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.UpdateMetadataResponse.FromString,
                _registered_method=True)
        self.Query = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/Query',
                request_serializer=kyrodb__pb2.QueryRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.QueryResponse.FromString,
                _registered_method=True)
        self.Search = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/Search',
                request_serializer=kyrodb__pb2.SearchRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.SearchResponse.FromString,
                _registered_method=True)
        self.BulkSearch = channel.stream_stream(
                '/kyrodb.v1.KyroDBService/BulkSearch',
                request_serializer=kyrodb__pb2.SearchRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.SearchResponse.FromString,
                _registered_method=True)
        self.BulkQuery = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/BulkQuery',
                request_serializer=kyrodb__pb2.BulkQueryRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.BulkQueryResponse.FromString,
                _registered_method=True)
        self.BatchDelete = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/BatchDelete',
                request_serializer=kyrodb__pb2.BatchDeleteRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.BatchDeleteResponse.FromString,
                _registered_method=True)
        self.Health = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/Health',
                request_serializer=kyrodb__pb2.HealthRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.HealthResponse.FromString,
                _registered_method=True)
        self.Metrics = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/Metrics',
                request_serializer=kyrodb__pb2.MetricsRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.MetricsResponse.FromString,
                _registered_method=True)
        self.FlushHotTier = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/FlushHotTier',
                request_serializer=kyrodb__pb2.FlushRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.FlushResponse.FromString,
                _registered_method=True)
        self.CreateSnapshot = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/CreateSnapshot',
                request_serializer=kyrodb__pb2.SnapshotRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.SnapshotResponse.FromString,
                _registered_method=True)
        self.GetConfig = channel.unary_unary(
                '/kyrodb.v1.KyroDBService/GetConfig',
                request_serializer=kyrodb__pb2.ConfigRequest.SerializeToString,
                response_deserializer=kyrodb__pb2.ConfigResponse.FromString,
                _registered_method=True)


class KyroDBServiceServicer(object):
    """Core KyroDB service - all operations for vector storage and retrieval
    ============================================================================
    WRITE OPERATIONS
    ============================================================================
    """

    def Insert(self, request, context):
        """Insert a single document with embedding
        Durability: ACK after WAL append (per fsync policy) and cold-tier update.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BulkInsert(self, request_iterator, context):
        """Insert multiple documents in a streaming fashion
        Use for bulk imports (millions of vectors)
        Throughput: 50K-100K docs/sec
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BulkLoadHnsw(self, request_iterator, context):
        """Bulk load directly to HNSW index (bypasses hot tier)
        Use for benchmarks and data migrations - NOT for production traffic!
        This provides maximum indexing speed at the cost of no hot-tier caching.
        Warning: Data is only searchable after this call completes.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Delete a document by ID
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateMetadata(self, request, context):
        """Update document metadata without changing embedding
        Supports merge (extend existing) or replace (overwrite all) semantics
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Query(self, request, context):
        """============================================================================
        READ OPERATIONS
        ============================================================================

        Query for a specific document by ID (point lookup)
        Latency: <100ns cache hit, <1ms cache miss
        Query path: Cache → Hot Tier → HNSW
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Search(self, request, context):
        """k-NN vector similarity search
        Latency/recall depend on HNSW params, dataset, and hardware.
        Returns top-k most similar documents
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BulkSearch(self, request_iterator, context):
        """Bulk search: multiple queries in one request (streaming)
        Use for batch inference workloads
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BulkQuery(self, request, context):
        """Bulk query: retrieve multiple documents by ID
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BatchDelete(self, request, context):
        """Batch delete: delete documents by ID or metadata filter
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Health(self, request, context):
        """============================================================================
        HEALTH & OBSERVABILITY
        ============================================================================

        Health check for load balancer / orchestrator
        Returns component-level health status
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Metrics(self, request, context):
        """Metrics for monitoring and alerting
        Returns cache hit rates, latencies, throughput
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FlushHotTier(self, request, context):
        """============================================================================
        ADMIN OPERATIONS
        ============================================================================

        Force flush hot tier to cold tier (for testing/backups)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateSnapshot(self, request, context):
        """Create snapshot for backup
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetConfig(self, request, context):
        """Get engine configuration (read-only)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_KyroDBServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Insert': grpc.unary_unary_rpc_method_handler(
                    servicer.Insert,
                    request_deserializer=kyrodb__pb2.InsertRequest.FromString,
                    response_serializer=kyrodb__pb2.InsertResponse.SerializeToString,
            ),
            'BulkInsert': grpc.stream_unary_rpc_method_handler(
                    servicer.BulkInsert,
                    request_deserializer=kyrodb__pb2.InsertRequest.FromString,
                    response_serializer=kyrodb__pb2.InsertResponse.SerializeToString,
            ),
            'BulkLoadHnsw': grpc.stream_unary_rpc_method_handler(
                    servicer.BulkLoadHnsw,
                    request_deserializer=kyrodb__pb2.InsertRequest.FromString,
                    response_serializer=kyrodb__pb2.BulkLoadResponse.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=kyrodb__pb2.DeleteRequest.FromString,
                    response_serializer=kyrodb__pb2.DeleteResponse.SerializeToString,
            ),
            'UpdateMetadata': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateMetadata,
                    request_deserializer=kyrodb__pb2.UpdateMetadataRequest.FromString,
                    response_serializer=kyrodb__pb2.UpdateMetadataResponse.SerializeToString,
            ),
            'Query': grpc.unary_unary_rpc_method_handler(
                    servicer.Query,
                    request_deserializer=kyrodb__pb2.QueryRequest.FromString,
                    response_serializer=kyrodb__pb2.QueryResponse.SerializeToString,
            ),
            'Search': grpc.unary_unary_rpc_method_handler(
                    servicer.Search,
                    request_deserializer=kyrodb__pb2.SearchRequest.FromString,
                    response_serializer=kyrodb__pb2.SearchResponse.SerializeToString,
            ),
            'BulkSearch': grpc.stream_stream_rpc_method_handler(
                    servicer.BulkSearch,
                    request_deserializer=kyrodb__pb2.SearchRequest.FromString,
                    response_serializer=kyrodb__pb2.SearchResponse.SerializeToString,
            ),
            'BulkQuery': grpc.unary_unary_rpc_method_handler(
                    servicer.BulkQuery,
                    request_deserializer=kyrodb__pb2.BulkQueryRequest.FromString,
                    response_serializer=kyrodb__pb2.BulkQueryResponse.SerializeToString,
            ),
            'BatchDelete': grpc.unary_unary_rpc_method_handler(
                    servicer.BatchDelete,
                    request_deserializer=kyrodb__pb2.BatchDeleteRequest.FromString,
                    response_serializer=kyrodb__pb2.BatchDeleteResponse.SerializeToString,
            ),
            'Health': grpc.unary_unary_rpc_method_handler(
                    servicer.Health,
                    request_deserializer=kyrodb__pb2.HealthRequest.FromString,
                    response_serializer=kyrodb__pb2.HealthResponse.SerializeToString,
            ),
            'Metrics': grpc.unary_unary_rpc_method_handler(
                    servicer.Metrics,
                    request_deserializer=kyrodb__pb2.MetricsRequest.FromString,
                    response_serializer=kyrodb__pb2.MetricsResponse.SerializeToString,
            ),
            'FlushHotTier': grpc.unary_unary_rpc_method_handler(
                    servicer.FlushHotTier,
                    request_deserializer=kyrodb__pb2.FlushRequest.FromString,
                    response_serializer=kyrodb__pb2.FlushResponse.SerializeToString,
            ),
            'CreateSnapshot': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateSnapshot,
                    request_deserializer=kyrodb__pb2.SnapshotRequest.FromString,
                    response_serializer=kyrodb__pb2.SnapshotResponse.SerializeToString,
            ),
            'GetConfig': grpc.unary_unary_rpc_method_handler(
                    servicer.GetConfig,
                    request_deserializer=kyrodb__pb2.ConfigRequest.FromString,
                    response_serializer=kyrodb__pb2.ConfigResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'kyrodb.v1.KyroDBService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('kyrodb.v1.KyroDBService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class KyroDBService(object):
    """Core KyroDB service - all operations for vector storage and retrieval
    ============================================================================
    WRITE OPERATIONS
    ============================================================================
    """

    @staticmethod
    def Insert(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,
            '/kyrodb.v1.KyroDBService/Insert',
            kyrodb__pb2.InsertRequest.SerializeToString,
            kyrodb__pb2.InsertResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BulkInsert(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,
            '/kyrodb.v1.KyroDBService/BulkInsert',
            kyrodb__pb2.InsertRequest.SerializeToString,
            kyrodb__pb2.InsertResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BulkLoadHnsw(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,
            '/kyrodb.v1.KyroDBService/BulkLoadHnsw',
            kyrodb__pb2.InsertRequest.SerializeToString,
            kyrodb__pb2.BulkLoadResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            '/kyrodb.v1.KyroDBService/Delete',
            kyrodb__pb2.DeleteRequest.SerializeToString,
            kyrodb__pb2.DeleteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateMetadata(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,
            '/kyrodb.v1.KyroDBService/UpdateMetadata',
            kyrodb__pb2.UpdateMetadataRequest.SerializeToString,
            kyrodb__pb2.UpdateMetadataResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Query(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,
            '/kyrodb.v1.KyroDBService/Query',
            kyrodb__pb2.QueryRequest.SerializeToString,
            kyrodb__pb2.QueryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Search(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,
            '/kyrodb.v1.KyroDBService/Search',
            kyrodb__pb2.SearchRequest.SerializeToString,
            kyrodb__pb2.SearchResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BulkSearch(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,
            '/kyrodb.v1.KyroDBService/BulkSearch',
            kyrodb__pb2.SearchRequest.SerializeToString,
            kyrodb__pb2.SearchResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BulkQuery(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,
            '/kyrodb.v1.KyroDBService/BulkQuery',
            kyrodb__pb2.BulkQueryRequest.SerializeToString,
            kyrodb__pb2.BulkQueryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BatchDelete(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,
            '/kyrodb.v1.KyroDBService/BatchDelete',
            kyrodb__pb2.BatchDeleteRequest.SerializeToString,
            kyrodb__pb2.BatchDeleteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Health(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,
            '/kyrodb.v1.KyroDBService/Health',
            kyrodb__pb2.HealthRequest.SerializeToString,
            kyrodb__pb2.HealthResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Metrics(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,
            '/kyrodb.v1.KyroDBService/Metrics',
            kyrodb__pb2.MetricsRequest.SerializeToString,
            kyrodb__pb2.MetricsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def FlushHotTier(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,
            '/kyrodb.v1.KyroDBService/FlushHotTier',
            kyrodb__pb2.FlushRequest.SerializeToString,
            kyrodb__pb2.FlushResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CreateSnapshot(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,
            '/kyrodb.v1.KyroDBService/CreateSnapshot',
            kyrodb__pb2.SnapshotRequest.SerializeToString,
            kyrodb__pb2.SnapshotResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetConfig(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,
            '/kyrodb.v1.KyroDBService/GetConfig',
            kyrodb__pb2.ConfigRequest.SerializeToString,
            kyrodb__pb2.ConfigResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
