from typing import List
from typing import Dict
from typing import Any
import copy


def expected_gui_urls(gui_urls: List[Dict[str, Any]],
                      haproxy: bool, yarl: bool) -> List[Dict[str, Any]]:
    """Get the expected value of a gui-url list for a single product.

    The implementation transforms the list in slightly different ways depending
    on context.

    Parameters
    ----------
    gui_urls
        Expected value, with `href` properties set to the haproxy URL and URLs represented
        as :class:`yarl.URL` objects.
    haproxy
        If false, replace `href` with `orig_href`.
    yarl
        If false, replace `href` and `orig_href` with plain strings
    """
    gui_urls = copy.deepcopy(gui_urls)
    for gui in gui_urls:
        if not haproxy:
            gui['href'] = gui['orig_href']
        if not yarl:
            gui['href'] = str(gui['href'])
            gui['orig_href'] = str(gui['orig_href'])
    return gui_urls