# 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 supabase_service_pb2 as supabase__service__pb2

GRPC_GENERATED_VERSION = '1.75.1'
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},'
        + f' but the generated code in supabase_service_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 SupabaseServiceStub(object):
    """========================================
    Supabase 数据库与向量服务
    ========================================
    Supabase 提供：
    - PostgreSQL 数据库 (完整 SQL 支持)
    - pgvector 向量搜索 (语义搜索、RAG)
    - PostgREST API (自动生成 REST 接口)
    - 实时订阅 (Database changes)
    - 用户认证 (GoTrue Auth)

    本服务封装 Supabase 的核心功能，提供 gRPC 接口

    ========== 数据库操作 (Database CRUD) ==========
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Query = channel.unary_unary(
                '/isa.supabase.SupabaseService/Query',
                request_serializer=supabase__service__pb2.QueryRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.QueryResponse.FromString,
                _registered_method=True)
        self.Insert = channel.unary_unary(
                '/isa.supabase.SupabaseService/Insert',
                request_serializer=supabase__service__pb2.InsertRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.InsertResponse.FromString,
                _registered_method=True)
        self.Update = channel.unary_unary(
                '/isa.supabase.SupabaseService/Update',
                request_serializer=supabase__service__pb2.UpdateRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.UpdateResponse.FromString,
                _registered_method=True)
        self.Delete = channel.unary_unary(
                '/isa.supabase.SupabaseService/Delete',
                request_serializer=supabase__service__pb2.DeleteRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.DeleteResponse.FromString,
                _registered_method=True)
        self.Upsert = channel.unary_unary(
                '/isa.supabase.SupabaseService/Upsert',
                request_serializer=supabase__service__pb2.UpsertRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.UpsertResponse.FromString,
                _registered_method=True)
        self.ExecuteRPC = channel.unary_unary(
                '/isa.supabase.SupabaseService/ExecuteRPC',
                request_serializer=supabase__service__pb2.RPCRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.RPCResponse.FromString,
                _registered_method=True)
        self.UpsertEmbedding = channel.unary_unary(
                '/isa.supabase.SupabaseService/UpsertEmbedding',
                request_serializer=supabase__service__pb2.UpsertEmbeddingRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.UpsertEmbeddingResponse.FromString,
                _registered_method=True)
        self.SimilaritySearch = channel.unary_unary(
                '/isa.supabase.SupabaseService/SimilaritySearch',
                request_serializer=supabase__service__pb2.SimilaritySearchRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.SimilaritySearchResponse.FromString,
                _registered_method=True)
        self.HybridSearch = channel.unary_unary(
                '/isa.supabase.SupabaseService/HybridSearch',
                request_serializer=supabase__service__pb2.HybridSearchRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.HybridSearchResponse.FromString,
                _registered_method=True)
        self.DeleteEmbedding = channel.unary_unary(
                '/isa.supabase.SupabaseService/DeleteEmbedding',
                request_serializer=supabase__service__pb2.DeleteEmbeddingRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.DeleteEmbeddingResponse.FromString,
                _registered_method=True)
        self.BatchInsert = channel.unary_unary(
                '/isa.supabase.SupabaseService/BatchInsert',
                request_serializer=supabase__service__pb2.BatchInsertRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.BatchInsertResponse.FromString,
                _registered_method=True)
        self.BatchUpsertEmbeddings = channel.unary_unary(
                '/isa.supabase.SupabaseService/BatchUpsertEmbeddings',
                request_serializer=supabase__service__pb2.BatchUpsertEmbeddingsRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.BatchUpsertEmbeddingsResponse.FromString,
                _registered_method=True)
        self.HealthCheck = channel.unary_unary(
                '/isa.supabase.SupabaseService/HealthCheck',
                request_serializer=supabase__service__pb2.HealthCheckRequest.SerializeToString,
                response_deserializer=supabase__service__pb2.HealthCheckResponse.FromString,
                _registered_method=True)


class SupabaseServiceServicer(object):
    """========================================
    Supabase 数据库与向量服务
    ========================================
    Supabase 提供：
    - PostgreSQL 数据库 (完整 SQL 支持)
    - pgvector 向量搜索 (语义搜索、RAG)
    - PostgREST API (自动生成 REST 接口)
    - 实时订阅 (Database changes)
    - 用户认证 (GoTrue Auth)

    本服务封装 Supabase 的核心功能，提供 gRPC 接口

    ========== 数据库操作 (Database CRUD) ==========
    """

    def Query(self, request, context):
        """Query - 查询数据 (SELECT)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Insert(self, request, context):
        """Insert - 插入数据
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Update - 更新数据
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Delete - 删除数据
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Upsert(self, request, context):
        """Upsert - 插入或更新 (INSERT ON CONFLICT UPDATE)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExecuteRPC(self, request, context):
        """RPC - 调用 PostgreSQL 函数/存储过程
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpsertEmbedding(self, request, context):
        """========== 向量操作 (Vector Operations - pgvector) ==========

        UpsertEmbedding - 插入或更新向量嵌入
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SimilaritySearch(self, request, context):
        """SimilaritySearch - 向量相似度搜索
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def HybridSearch(self, request, context):
        """HybridSearch - 混合搜索 (全文 + 向量)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteEmbedding(self, request, context):
        """DeleteEmbedding - 删除向量
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BatchInsert(self, request, context):
        """========== 批量操作 (Batch Operations) ==========

        BatchInsert - 批量插入
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BatchUpsertEmbeddings(self, request, context):
        """BatchUpsertEmbeddings - 批量插入向量
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def HealthCheck(self, request, context):
        """========== 健康检查 ==========

        HealthCheck - 服务健康检查
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SupabaseServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Query': grpc.unary_unary_rpc_method_handler(
                    servicer.Query,
                    request_deserializer=supabase__service__pb2.QueryRequest.FromString,
                    response_serializer=supabase__service__pb2.QueryResponse.SerializeToString,
            ),
            'Insert': grpc.unary_unary_rpc_method_handler(
                    servicer.Insert,
                    request_deserializer=supabase__service__pb2.InsertRequest.FromString,
                    response_serializer=supabase__service__pb2.InsertResponse.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=supabase__service__pb2.UpdateRequest.FromString,
                    response_serializer=supabase__service__pb2.UpdateResponse.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=supabase__service__pb2.DeleteRequest.FromString,
                    response_serializer=supabase__service__pb2.DeleteResponse.SerializeToString,
            ),
            'Upsert': grpc.unary_unary_rpc_method_handler(
                    servicer.Upsert,
                    request_deserializer=supabase__service__pb2.UpsertRequest.FromString,
                    response_serializer=supabase__service__pb2.UpsertResponse.SerializeToString,
            ),
            'ExecuteRPC': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecuteRPC,
                    request_deserializer=supabase__service__pb2.RPCRequest.FromString,
                    response_serializer=supabase__service__pb2.RPCResponse.SerializeToString,
            ),
            'UpsertEmbedding': grpc.unary_unary_rpc_method_handler(
                    servicer.UpsertEmbedding,
                    request_deserializer=supabase__service__pb2.UpsertEmbeddingRequest.FromString,
                    response_serializer=supabase__service__pb2.UpsertEmbeddingResponse.SerializeToString,
            ),
            'SimilaritySearch': grpc.unary_unary_rpc_method_handler(
                    servicer.SimilaritySearch,
                    request_deserializer=supabase__service__pb2.SimilaritySearchRequest.FromString,
                    response_serializer=supabase__service__pb2.SimilaritySearchResponse.SerializeToString,
            ),
            'HybridSearch': grpc.unary_unary_rpc_method_handler(
                    servicer.HybridSearch,
                    request_deserializer=supabase__service__pb2.HybridSearchRequest.FromString,
                    response_serializer=supabase__service__pb2.HybridSearchResponse.SerializeToString,
            ),
            'DeleteEmbedding': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteEmbedding,
                    request_deserializer=supabase__service__pb2.DeleteEmbeddingRequest.FromString,
                    response_serializer=supabase__service__pb2.DeleteEmbeddingResponse.SerializeToString,
            ),
            'BatchInsert': grpc.unary_unary_rpc_method_handler(
                    servicer.BatchInsert,
                    request_deserializer=supabase__service__pb2.BatchInsertRequest.FromString,
                    response_serializer=supabase__service__pb2.BatchInsertResponse.SerializeToString,
            ),
            'BatchUpsertEmbeddings': grpc.unary_unary_rpc_method_handler(
                    servicer.BatchUpsertEmbeddings,
                    request_deserializer=supabase__service__pb2.BatchUpsertEmbeddingsRequest.FromString,
                    response_serializer=supabase__service__pb2.BatchUpsertEmbeddingsResponse.SerializeToString,
            ),
            'HealthCheck': grpc.unary_unary_rpc_method_handler(
                    servicer.HealthCheck,
                    request_deserializer=supabase__service__pb2.HealthCheckRequest.FromString,
                    response_serializer=supabase__service__pb2.HealthCheckResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'isa.supabase.SupabaseService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('isa.supabase.SupabaseService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class SupabaseService(object):
    """========================================
    Supabase 数据库与向量服务
    ========================================
    Supabase 提供：
    - PostgreSQL 数据库 (完整 SQL 支持)
    - pgvector 向量搜索 (语义搜索、RAG)
    - PostgREST API (自动生成 REST 接口)
    - 实时订阅 (Database changes)
    - 用户认证 (GoTrue Auth)

    本服务封装 Supabase 的核心功能，提供 gRPC 接口

    ========== 数据库操作 (Database CRUD) ==========
    """

    @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,
            '/isa.supabase.SupabaseService/Query',
            supabase__service__pb2.QueryRequest.SerializeToString,
            supabase__service__pb2.QueryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            '/isa.supabase.SupabaseService/Insert',
            supabase__service__pb2.InsertRequest.SerializeToString,
            supabase__service__pb2.InsertResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            '/isa.supabase.SupabaseService/Update',
            supabase__service__pb2.UpdateRequest.SerializeToString,
            supabase__service__pb2.UpdateResponse.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,
            '/isa.supabase.SupabaseService/Delete',
            supabase__service__pb2.DeleteRequest.SerializeToString,
            supabase__service__pb2.DeleteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Upsert(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,
            '/isa.supabase.SupabaseService/Upsert',
            supabase__service__pb2.UpsertRequest.SerializeToString,
            supabase__service__pb2.UpsertResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExecuteRPC(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,
            '/isa.supabase.SupabaseService/ExecuteRPC',
            supabase__service__pb2.RPCRequest.SerializeToString,
            supabase__service__pb2.RPCResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpsertEmbedding(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,
            '/isa.supabase.SupabaseService/UpsertEmbedding',
            supabase__service__pb2.UpsertEmbeddingRequest.SerializeToString,
            supabase__service__pb2.UpsertEmbeddingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SimilaritySearch(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,
            '/isa.supabase.SupabaseService/SimilaritySearch',
            supabase__service__pb2.SimilaritySearchRequest.SerializeToString,
            supabase__service__pb2.SimilaritySearchResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def HybridSearch(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,
            '/isa.supabase.SupabaseService/HybridSearch',
            supabase__service__pb2.HybridSearchRequest.SerializeToString,
            supabase__service__pb2.HybridSearchResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeleteEmbedding(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,
            '/isa.supabase.SupabaseService/DeleteEmbedding',
            supabase__service__pb2.DeleteEmbeddingRequest.SerializeToString,
            supabase__service__pb2.DeleteEmbeddingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BatchInsert(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,
            '/isa.supabase.SupabaseService/BatchInsert',
            supabase__service__pb2.BatchInsertRequest.SerializeToString,
            supabase__service__pb2.BatchInsertResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BatchUpsertEmbeddings(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,
            '/isa.supabase.SupabaseService/BatchUpsertEmbeddings',
            supabase__service__pb2.BatchUpsertEmbeddingsRequest.SerializeToString,
            supabase__service__pb2.BatchUpsertEmbeddingsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def HealthCheck(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,
            '/isa.supabase.SupabaseService/HealthCheck',
            supabase__service__pb2.HealthCheckRequest.SerializeToString,
            supabase__service__pb2.HealthCheckResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
