from typing import Dict, Type, Set

from dependencyinjection import DependencyBuilder


class DependencyMap:
    def __init__(
        self,
        classes: Dict[Type, Type] = None,
        classes_by_parent: Dict[Type, Set[Type]] = None,
        builders: Dict[Type, Type[DependencyBuilder]] = None,
    ):
        self.classes = classes or {}
        self.classes_by_parent = classes_by_parent or {}
        self.builders = builders or {}

    def clone(self):
        return DependencyMap(
            classes={**self.classes},
            classes_by_parent={**self.classes_by_parent},
            builders={**self.builders},
        )
