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

from ai.stigmer.agentic.session.v1 import api_pb2 as ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_api__pb2
from ai.stigmer.agentic.session.v1 import io_pb2 as ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2


class SessionQueryControllerStub(object):
    """SessionQueryController handles read operations for agent sessions.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.get = channel.unary_unary(
                '/ai.stigmer.agentic.session.v1.SessionQueryController/get',
                request_serializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionId.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_api__pb2.Session.FromString,
                _registered_method=True)
        self.list = channel.unary_unary(
                '/ai.stigmer.agentic.session.v1.SessionQueryController/list',
                request_serializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.ListSessionsRequest.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionList.FromString,
                _registered_method=True)
        self.listByAgent = channel.unary_unary(
                '/ai.stigmer.agentic.session.v1.SessionQueryController/listByAgent',
                request_serializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.ListSessionsByAgentRequest.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionList.FromString,
                _registered_method=True)


class SessionQueryControllerServicer(object):
    """SessionQueryController handles read operations for agent sessions.
    """

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

    def list(self, request, context):
        """List all sessions with pagination and optional filtering.
        Authorization is handled in-handler via FGA-filtered queries.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def listByAgent(self, request, context):
        """List all sessions for a specific agent.
        Authorization is handled in-handler via FGA-filtered queries.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SessionQueryControllerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionId.FromString,
                    response_serializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_api__pb2.Session.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.ListSessionsRequest.FromString,
                    response_serializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionList.SerializeToString,
            ),
            'listByAgent': grpc.unary_unary_rpc_method_handler(
                    servicer.listByAgent,
                    request_deserializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.ListSessionsByAgentRequest.FromString,
                    response_serializer=ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionList.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ai.stigmer.agentic.session.v1.SessionQueryController', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('ai.stigmer.agentic.session.v1.SessionQueryController', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class SessionQueryController(object):
    """SessionQueryController handles read operations for agent sessions.
    """

    @staticmethod
    def get(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,
            '/ai.stigmer.agentic.session.v1.SessionQueryController/get',
            ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionId.SerializeToString,
            ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_api__pb2.Session.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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_unary(
            request,
            target,
            '/ai.stigmer.agentic.session.v1.SessionQueryController/list',
            ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.ListSessionsRequest.SerializeToString,
            ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def listByAgent(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,
            '/ai.stigmer.agentic.session.v1.SessionQueryController/listByAgent',
            ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.ListSessionsByAgentRequest.SerializeToString,
            ai_dot_stigmer_dot_agentic_dot_session_dot_v1_dot_io__pb2.SessionList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
