def METHOD_NAME(
    key: str, validation_func: Callable, generation_func: Callable
) -> str:
    """
    This method will try to get a credential and if it isn't supplied or doesn't exist
    it will generate one and save it. If the one supplied doesn't match the one saved
    it will raise an Exception.
    """
    file_credential = get_credentials_file_key(key)
    env_credential = get_env(key)
    # supplying a different key means something has gone wrong so raise Exception
    if (
        file_credential != env_credential
        and file_credential is not None
        and env_credential is not None
    ):
        raise Exception(f"{key} from ENV must match {key} in {CREDENTIALS_PATH}")
    if env_credential is not None and file_credential is None:
        # if there is no key in the credential file but one is passed in ENV then save it
        return save_credential(key, validation_func(env_credential))
    elif file_credential is None and env_credential is None:
        # we can generate one for the user and save it
        return save_credential(key, validation_func(generation_func()))
    elif file_credential is not None and validation_func(file_credential):
        return file_credential
    raise Exception("Failed to get or generate Private Key")