Share your feedback about the Google Ads (AdWords) API. Take the 2021 AdWords API and Google Ads API Annual Survey.

Lookup Util

Fetching references to all the various proto classes required to use the API in Ruby can be verbose and requires you to have an intrinsic understanding of the API or frequently context-switch to reference the protos or documentation.

ProtoLookupUtil

The proto lookup util lets you look up and create instances of services, operations, enumerations, and resources without needing to worry about API version numbers or long namespaces.

You don't have to use this utility, and could instantiate a campaign for example like this:

campaign = Google::Ads::GoogleAds::V9::Resources::Campaign.new

The proto lookup util lets you shortcut this if you prefer:

campaign = client.resource(:Campaign)

When fetching a resource, service, or operation, an instance of that entity will be returned to you. When fetching an enumeration, a reference to the class will be returned without instantiation.

For enumerations, there is a shorthand you should use to bypass the need for looking up the enumeration protos.

campaign.status = :PAUSED

It is recommended to use the client.service method for fetching services even if you don't use this utility for any other use cases. There is extra logic built into this method to pass along your developer token and authentication details, which you would have to handle manually if you bypassed it.