To enable the pub/sub and Gmail APIs in your project:
Log in to the Google Cloud Console: https://console.cloud.google.com/.
Select the project you created from the project drop-down in the top navigation bar.
In the top navigation search bar, search for "Cloud Pub/Sub API".
Select the Cloud Pub/Sub API result that says "API" to the left.
Click Enable.
In the top navigation search bar, search for "Gmail API".
Select the Gmail API result that has a shopping cart emblem to the left.
Click Enable.