Your first link involves laws passed by Congress. But there is no relevant law that requires "viewpoint diversity" (whatever that means) or most of the other demands in the government letter, this is simply an executive diktat.
Your second link involves a change in IRS policy. But there was no such change, instead again we have an executive diktat, despite the fact that the law explicitly forbids the President or his office from targeting specific institutions for audits or investigations: https://www.law.cornell.edu/uscode/text/26/7217