Service call to delete all emails in inbox

I’m trying to create an automation to clear/delete all emails in an inbox. From my understanding, python script is the best way to achieve this however this is beyond me.

I found this sample for deleting all emails in inbox…

…but not sure how to put everything together. Appreciate if someone can help me on this. Thank you in advance.

Anyway, I found a workaround using a python script and shell command…