from typing import List
from typing import Dict


def _mock_translate_response(
    target_language: str, source_language: str, model: str, values: List[str],
) -> List[Dict[str, str]]:
    """
    A simulated response for the Google Translate Client get_languages() call
    https://github.com/googleapis/python-translate/blob/master/google/cloud/translate_v2/client.py

    Args:
        target_language: The language to translate to (ignored in mock response)
        source_language: The language to translate from
        model: The model used by the google client for language detection
        values: The values to detect the language for
    Returns:
        A list of JSON responses per input value
    """

    if sum(len(value) for value in values) > 100000:
        raise RuntimeError("User Rate Limit Exceeded")

    translated_values = {
        "cheddar cheese": "fromage cheddar",
        "ground beef": "boeuf haché",
        "skim milk": "lait écrémé",
        "whole chicken": "poulet entier",
        "bacon": "Bacon",
        "american cheese": "Fromage Américain",
        "roast beef": "rôti de bœuf",
        "boneless chicken breasts": "poitrines de poulet désossées",
        "swiss cheese": "fromage suisse",
    }
    mock_response = []
    for value in values:
        if source_language is None:
            mock_response.append(
                {
                    "translatedText": translated_values[value],
                    "detectedSourceLanguage": "en",
                    "model": model,
                    "input": value,
                }
            )
        else:
            mock_response.append(
                {"translatedText": translated_values[value], "model": model, "input": value}
            )
    return mock_response