from typing import Dict
from typing import Any


def get_role_dependency_link(metadata: Dict[str, Any]) -> str:
    """
    Returns role dependency link

    Args:
        metadata (Dict[str, Any]): role metadata

    Returns:
        str: role dependency link
    """
    role_name = metadata.get("role_name", None)
    namespace = metadata.get("namespace", None)

    if not namespace or not role_name:
        raise ValueError(
            f"Can not generate dependency link for {namespace}.{role_name}"
        )

    return (
        f"<b>"
        f'<a href="https://galaxy.ansible.com/{namespace}/{role_name}" '
        f'title="{namespace}.{role_name} on Ansible Galaxy" target="_'
        f'blank">{namespace}.{role_name}</a></b>'
    )