'Google Directory API: remove license via code (Java)

I have an organization group on my company's Gmail, and this group gets a license that we bought from Google (this is done automatically by some options in the admin console). But when we remove a user from this group, he doesn't lose his license, and it has to be done manually.

Is there a whey to do that using directory API via code? We have sometimes hundreds of users being removed from the group that has the license, and it's inviable to do that manually every day.

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source