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


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

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

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


@router.post('/v1/operations/onboarding', response_model=None, tags=['Onboarding'])
def on_board(body: Onboard) -> None:
    """
    Endpoint to onboard connector
    """
    return call_handler('Onboarding', on_board.__name__, body)


@router.post(
    '/v1/operations/status', response_model=StatusResponse, tags=['Onboarding']
)
def get_on_boarding_status(body: StatusRequest) -> StatusResponse:
    """
    Endpoint to get onboarding status
    """
    return call_handler('Onboarding', get_on_boarding_status.__name__, body)
