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


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

    @abstractmethod
    def set_enforcement_policy_inventory(
        self, action: Optional[Action] = 'set', body: EnforcementPolicyInventory = ...
    ) -> None:
        """This method should be implemented by the subclass."""
        raise HTTPException(
            status_code=404, detail=f"set_enforcement_policy_inventory not implemented"
        )

    @abstractmethod
    def set_enforcement_policy(
        self, action: Optional[Action] = 'set', body: EnforcementPolicy = ...
    ) -> None:
        """This method should be implemented by the subclass."""
        raise HTTPException(
            status_code=404, detail=f"set_enforcement_policy not implemented"
        )


@router.post('/v1/consumer/inventory', response_model=None, tags=['Enforcement'])
def set_enforcement_policy_inventory(
    action: Optional[Action] = 'set', body: EnforcementPolicyInventory = ...
) -> None:
    """
    Set enforcement policy inventory
    """
    return call_handler(
        'Enforcement', set_enforcement_policy_inventory.__name__, action, body
    )


@router.post('/v1/consumer/policy', response_model=None, tags=['Enforcement'])
def set_enforcement_policy(
    action: Optional[Action] = 'set', body: EnforcementPolicy = ...
) -> None:
    """
    Set enforcement policy
    """
    return call_handler('Enforcement', set_enforcement_policy.__name__, action, body)
