Update sample to be compatible with v2 of the API.
Update sample to be compatible with v2 of the API.

gsuitedevs/apps-script-samples,googleworkspace/apps-script-samples,gsuitedevs/apps-script-samples,googleworkspace/apps-script-samples