def _clean_intenum(obj):
    """Remove all IntEnum classes from a map."""

    if isinstance(obj, dict):
        for key, value in obj.items():
            if isinstance(value, IntEnum):
                obj[key] = value.value
            elif isinstance(value, (dict, list)):
                obj[key] = _clean_intenum(value)
    elif isinstance(obj, list):
        for i, value in enumerate(obj):
            if isinstance(value, IntEnum):
                obj[i] = value.value
            elif isinstance(value, (dict, list)):
                obj[i] = _clean_intenum(value)

    return obj
Remove all IntEnum classes from a map.