I have a map in ArcGIS pro that I can upload to ArcGIS online using the "Share as Web Map" dialog, which gives me various options for how I want the data copied (in my case it creates an ArcGIS Online web map and a feature layer). I'd like to automate that in Python but having some trouble figuring out how to do it.
This question was asked previously but the answer seems to imply that I have to build the web map from scratch using the ArcGIS Api for Python WebMap object, then call the save() method. Even if I do that, I suspect that does not handle all of the options available on the ArcGIS Pro Share as Web Map dialog.
I was hoping I could do it with more simply with arcpy objects. Has anybody been able to do this? I'm on ArcGIS Pro 2.9.5