Is there a way to make the insert and assignment of a user to a group a single, unit operation with the Admin SDK API? Currently I have to make separate calls to directory.users().insert(<user>).execute()
and directory.members().insert(<groupKey>, <member>).execute()
.
I think there's a problem with this approach because one operation can complete successfully and the other not. So the user is inserted, but is not assigned to any group. It would be nice if we could specify the group information along with the user information when we insert the user.
Is there a way to do this?