Hi, I would like to create an exact replica (with a different name) of a hosted feature service (with multiple feature layers) within the same portal of ArcGIS Online via python. Doesn't seem like a massive ask, and it's something I can do manually fairly easily.
The documentation here seemingly gives me two options, but...
When I use the item.copy() method on a hosted feature layer, then what I am left with is just a feature layer (it loses its "hosted" status and I can't enable editing on it etc.) which is no use to me.
When I use the item.copy_feature_layer_collection method then I can only get the script to work when I specify the first layer within it (i.e. "layers=[0]") anything else throws an error (and in reality I might not know how many layers I wish to copy each time I run the script - I'd like to specify "all"). The documentation implies that the layers parameter is optional (not true - it fails without it) and also that it accepts a comma separated list e.g. (as per documentation) "layers="1,4,5,8"" - also not true.
Please can anyone suggest the way to do this simply?