# 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=['Control'])


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

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


@router.post(
    '/version-handshake', response_model=VersionHandshakeData, tags=['Control']
)
def version_hanshake(body: VersionHandshakeData) -> VersionHandshakeData:
    """
    Perform version handshake
    """
    return call_handler('Control', version_hanshake.__name__, body)
