Set group as shared group using API

I’m trying to write a plugin that will automatically take groups from my integrated custom DB and set them as shared groups - is there an API function that will do this? I looked through the Group & Roster classes but didn’t seem to see anything applicable.