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


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

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

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

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


@router.get(
    '/v1/operations/flags', response_model=V1OperationsFlagsGetResponse, tags=['Health']
)
def get_integration_flags() -> V1OperationsFlagsGetResponse:
    """
    Endpoint to retrieve components flags
    """
    return call_handler(
        'Health',
        get_integration_flags.__name__,
    )


@router.get(
    '/v1/operations/health',
    response_model=V1OperationsHealthGetResponse,
    tags=['Health'],
)
def get_integration_status() -> V1OperationsHealthGetResponse:
    """
    Endpoint to retrieve components status
    """
    return call_handler(
        'Health',
        get_integration_status.__name__,
    )


@router.get(
    '/v1/operations/metrics',
    response_model=V1OperationsMetricsGetResponse,
    tags=['Health'],
)
def get_integration_metrics() -> V1OperationsMetricsGetResponse:
    """
    Endpoint to retrieve components metrics
    """
    return call_handler(
        'Health',
        get_integration_metrics.__name__,
    )
