Create version of DITA programmatically
In AEM Guides Editor Console, there is a button to save the dita/ditamap as a new Version.

I have a requirement to create version of dita document programmatically based on updated event.
How can I achieve this programmatically?