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


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

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

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


@router.get(
    '/v1/operations/internal/config_metadata',
    response_model=InternalConfigMetadata,
    tags=['Operations'],
)
def get_integration_configuration_options() -> InternalConfigMetadata:
    """
    Endpoint to retrieve internal configuration options
    """
    return call_handler(
        'Operations',
        get_integration_configuration_options.__name__,
    )


@router.post(
    '/v1/operations/internal/internal_config', response_model=None, tags=['Operations']
)
def set_integration_configuration(body: InternalConfig) -> None:
    """
    Endpoint to set internal services configuration
    """
    return call_handler('Operations', set_integration_configuration.__name__, body)
