When google updates a service in GCP that is a dependency of these or any other official google code samples referenced in google docs, Google should deploy and test these samples as part of the GCP release process.
Seriously.
Its frustrating to try something in official google docs/repos, and not have it work due to the samples being out of date.