Open timcortesi opened 2 years ago
Due to a bug in Google's API (https://issuetracker.google.com/issues/179777261), we cannot specify the email we're looking for when listing the deleted accounts in Google. This might be resolved when the Google API bug is resolved.
@alikemaltanriverdi -- please investigate:
It looks like it is possible to query google in such a way that it includes deleted accounts: https://developers.google.com/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin Looks like you add: showDeleted=true
It also looks like you should be able to see if a user is deleted: https://developers.google.com/admin-sdk/directory/reference/rest/v1/users "deletionTime": string,
It also looks like there is an undelete API to undelete users: https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/undelete
So ... When creating or updating a google account, we should see if that account was deleted. If the account was deleted, instead of creating a new account, we should undelete it and then update it accordingly.