Once you become familiar with the code to call one method on one Google service, you will be able to infer how to call any method on any Google service.
First, we make a connection to the service using the credential object instantiated in the previous example:
service = build(
SERVICE_NAME,
...