def get_ynab_budget_id_mapping(ynab_client):
    """Build a mapping of YNAB budget names to internal ids

    Args:
        ynab_client (ynab_client): YNAB configured client with the credentials

    Returns:
        dict: Dictionary with budget names as keys and ids as values
    """
    response = ynab_client.BudgetsApi().get_budgets().data.budgets
    mapping = {budget.name: budget.id for budget in response}
    return mapping