from functools import wraps
from defence360agent.contracts.config import (
    is_mi_freemium_license,
)


def unavailable_on_freemium(coro):
    @wraps(coro)
    async def wrapper(*args, **kwargs):
        if is_mi_freemium_license():
            raise ValueError("Forbidden for freemium")
        return await coro(*args, **kwargs)

    return wrapper
