from dataclasses import is_dataclass, asdict
from collections.abc import Mapping
from typing import Any


def normalize_object_to_dictionary(obj: Any) -> dict:
    if is_dataclass(obj):
        return asdict(obj)

    if isinstance(obj, Mapping):
        return dict(obj)

    if hasattr(obj, "__dict__"):
        return vars(obj)

    raise TypeError(f"Cannot normalize object of type {type(obj).__name__}")
