This is just an example class to demostrate how to use google drive API including googleTeamDrive and to demostrate how to service account.
- a service account must be setup, follow the following link to setup a service account. https://support.google.com/a/answer/7378726?hl=en
- go to Credentials > Manage Service Account then 'View Client ID'. copy the client ID to clipboard
- launch the GSuite Admin Console
- Go to Security>Advanced Settings>Mange API client access.
- Paste the Client ID in the Client Name field, add the following API scopes and click Authorize: https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/calendar.readonly, https://www.googleapis.com/auth/drive