@RichardHowe you can get lists of the hosted feature layer's feature layers' and tables' integer indexes by doing something like the following:
# Get the your hosted feature layer as an item using its itemID.
item = gis.content.get('item_id_of_your_hosted_feature_layer')
# Generate lists of the layers' and tables' index integers for the hosted feature layer
# you are copying. A hosted feature layer item has properties for the lists of URLs
# for its feature layers and tables (e.g., item.layers and item.tables.)
# Each entry in those lists has an ID property that reflects its integer index.
layer_ids = [layer.properties.id for layer in item.layers]
table_ids = [table.properties.id for table in item.tables]
# Create a copy of your hosted feature layer's schema, inclusive of all layers and tables.
# (If the hosted feature layer did not contain any feature layers or tables, then it
# is okay to pass the empty lists calculated above to those parameters.)
copy = item.copy_feature_layer_collection(
service_name = "copy of my hosted feature layer",
layers = layer_ids,
tables = table_ids
)
Note that clone_items() will generate a second item with the same item name as the original hosted feature layer, as there is no rule against having two items with the same name. The underlying feature service for the cloned item, however, will have a different URL, derived from the original, with a unique identifier appended, as there is a rule against having two feature services with the same name.
item.copy_feature_layer_collection(), however, will use the specified service_name for both the copy's item name and the feature service name, as long as there isn't already a feature service using that name.