Fetching references to proto classes when using the API requires that you either
have an intrinsic understanding of the API or frequently look up the proto
reference documentation for the exact namespace path.

## ProtoLookupUtil

The lookup utility methods on `GoogleAdsClient` (backed by
[Factories](https://developers.google.com/google-ads/api/docs/client-libs/ruby/factories.md.txt) and `ServiceLookup`, replacing the legacy
`ProtoLookupUtil` class) let you look up and create instances of services,
operations, enumerations, and resources without having to keep track of API
version numbers and module namespaces. By default, these methods use the highest
API version supported by your installed gem (`V26` in the
latest release, where minor API releases such as v26.1 use their
major version module `V26`), or you can specify an
explicit version prefix (such as
`v26`) on the lookup call.

Without the lookup utility, you instantiate a campaign resource directly from
its versioned namespace:

```ruby
campaign =
  Google::Ads::GoogleAds::V26::Resources::Campaign.new
```

With the client lookup methods, you can instantiate the resource directly from
the client:

```ruby
campaign = client.resource.campaign
```

When fetching a resource, service, or operation, an instance of that entity is
returned:

```ruby
# Instantiate an operation
operation = client.operation.campaign
```

### Service lookup

Use the `client.service` method to fetch service clients, even if you don't use
this utility for other entities. `client.service` automatically configures your
authentication credentials and transport settings on the returned service
client:

```ruby
campaign_service = client.service.campaign
```

### Enumeration lookup

For enum fields on protobuf messages, assign a Ruby symbol directly instead of
looking up the enumeration module:

```ruby
campaign.status = :PAUSED
```

To inspect or iterate over all valid symbols for an enumeration at runtime, use
`client.enum`, which returns the `Google::Protobuf::EnumDescriptor` for that
enum:

```ruby
status_enum = client.enum.campaign_status
status_enum.each { |status| p status }
```