Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to get Google Ads API ENUM Text Value From The The Returned Integer Index - Google Ads API ENUM Mapping
The Enum's come with some methods to translate between index and string
# client_service is the GoogleAdsClient object.
channel_types = client_service.get_type('AdvertisingChannelTypeEnum')
# => 2
# => 'SEARCH'
This was found by looking at docstrings, e.g.
# => 'A utility for finding the names of enum values.'
Thanks to Heath-Winning @ StackOverflow for this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment