How to change aspect ratio of Game View from Unity Editor scripting API

I would like to change acpect ratio in GameView from Editor’s script, because navigating in dropdown menu is annoying our designer. He often changes landscape and portrait view and he would like to have buttons to change aspect quickly. Ideally, it would be great to place such buttons right in Game View Toolbar (as I drew in red on screenshot below):
But having buttons inside separate tool window would be nice too. The problem is that I can’t find how to change aspect programmatically.

Maybe this could help? Add and Select Game View Resolution Programatically - Questions & Answers - Unity Discussions

I’m making dasm30 link answer into keyboard shortcut version.

ALT+1 = 1280x720 (not added by default, you have to add it manually to work)
ALT+2 = 1920x1080
ALT+3 = 2560x1440

It is global shortcut key, and will be shown in “Edit > Shortcuts” menu.

To change the resolution the key is taking, you must modify the hard code.

It is editor script, so save it somewhere right for editor script. e.g., Assets/Scripts/Editor