Good to hear that it was helpful.
The easiest would be to create/update credentials via the UI and then looking at what kind of data does get sent. You can find the code which creates the credentials here:
Additionally, can you find the OAuth2 related code here:
If you authenticate via OAuth2 with Google and output some information there, before it updates the credentials, you should be able to figure out quite fast how to make that work.