def _validate_dict(
    _object: Any, var_name: str, value_type: type, nested: bool = False
) -> None:
    if not isinstance(_object, dict):
        raise ValueError(f"{var_name} must be a dict")
    if not all(isinstance(x, str) for x in _object):
        raise ValueError(f"{var_name} all keys must be strings")
    if not all(isinstance(x, value_type) for x in _object.values()):
        nested_text = "nested dictionary " if nested else ""
        raise ValueError(
            f"{var_name} {nested_text}all values must be {value_type.__name__}"
        )