Google announced that Google Ads scripts now support Performance Max campaigns. Google said, "this treated as a brand new campaign type in scripts, similar to how video or shopping campaigns already work."
The technical details on how this works is in the performance max campaigns selector on the AdsApp.
Once you've selected a PerformanceMaxCampaign, you can perform common operations like pausing or enabling the campaign, as well as selecting and modifying most asset types in asset groups.
You cannot modify text assets this way, and you cannot create new campaigns or asset groups through scripts.
Google said, "Performance Max retail campaigns are supported in only a limited fashion as listing groups cannot be managed via Scripts."
Forum discussion at Twitter.