provide dynamically loading client settings by object instead of using load_by_string
See original GitHub issueFollowing the example, we need to make a yaml file to set client settings and use GoogleAdsClient.load_from_storage
to create a new client instance, but it does not make sense in production service that provides multiple customers to fetch their ads.
My current solution is like this,
configuration_string = '\n'.join([
'developer_token: %s' % developer_token,
'client_id: %s' % client_id,
'client_secret: %s' % client_secret,
'refresh_token: %s' % refresh_token,
'login_customer_id: %s' % login_customer_id
])
client = google.ads.google_ads.client.GoogleAdsClient.load_from_string(configuration_string)
I use GoogleAdsClient.load_from_string
to make a string as yaml format, but I think it had better provide a function to load settings by dictionary(object), and it will be more easy to use.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Load dynamic objects from application.properties in Spring Boot
This is how you can load dynamic objects from application.properties in Spring Boot with Kotlin: Suppose you have an object class called ...
Read more >changelog.txt - GitHub
... rewriters not recognizing WP Offload Media Path (object prefix) setting ... Lazy Load picture elements use right-sized img placeholder instead of 1x1 ......
Read more >Configuring dynamic client registration settings
Go to System → OAuth Settings → Client Settings and click Dynamic Client Registration. Select the check boxes for the options that you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yo8568 Thanks for that info, it does make sense. I’ll keep this issue open as a feature request to add a method
load_from_dict
that allows the client to receive a dict of credentials.In the meantime you can sort-of achieve this by initializing the client directly. You’ll need to import the OAuth client and create a set of Credentials through it, like so (we do this here in the client):
You can reference the initialization method here to see what other keyword parameters are available.
#139 was merged and release in library version 3.1.0.