# generated by fastapi-codegen:
#   filename:  connector
#   timestamp: 2025-08-06T07:59:35+00:00

from __future__ import annotations

from abc import ABC, abstractmethod

from fastapi import APIRouter, HTTPException

from ..dependencies import *
from ..handler_registry import call_handler

router = APIRouter(tags=['Agents'])


class AgentsHandler(ABC):
    def __init__(self):
        pass

    @abstractmethod
    def set_agent_info(self, body: AgentsInfo) -> None:
        """This method should be implemented by the subclass."""
        raise HTTPException(status_code=404, detail=f"set_agent_info not implemented")

    @abstractmethod
    def update_agent_info(self, body: AgentsInfo) -> None:
        """This method should be implemented by the subclass."""
        raise HTTPException(
            status_code=404, detail=f"update_agent_info not implemented"
        )


@router.post('/v1/consumer/agents-info', response_model=None, tags=['Agents'])
def set_agent_info(body: AgentsInfo) -> None:
    """
    Report info about Centra agents, overrides any previous provided data
    """
    return call_handler('Agents', set_agent_info.__name__, body)


@router.put('/v1/consumer/agents-info', response_model=None, tags=['Agents'])
def update_agent_info(body: AgentsInfo) -> None:
    """
    Report Centra agents info, in addition to the already provided data
    """
    return call_handler('Agents', update_agent_info.__name__, body)
