diff --git a/google-ads-ruby.code-workspace b/google-ads-ruby.code-workspace new file mode 100644 index 000000000..876a1499c --- /dev/null +++ b/google-ads-ruby.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": {} +} \ No newline at end of file diff --git a/google_ads_config.rb b/google_ads_config.rb index 2a45a0f80..3a29b2c1d 100644 --- a/google_ads_config.rb +++ b/google_ads_config.rb @@ -35,7 +35,7 @@ # project instead of developer token to determine your Google Ads API access levels. # Use this flag only if you are enrolled into a limited pilot that supports # this configuration. - # c.use_cloud_org_for_api_access = false + c.use_cloud_org_for_api_access = false # You can also authenticate using a service account. If "keyfile" is # specified below, then service account authentication will be assumed and diff --git a/lib/google/ads/google_ads/google_ads_client.rb b/lib/google/ads/google_ads/google_ads_client.rb index f891e20ae..75347a8b1 100644 --- a/lib/google/ads/google_ads/google_ads_client.rb +++ b/lib/google/ads/google_ads/google_ads_client.rb @@ -110,6 +110,10 @@ def load_environment_config # Client library-specific variables @config.log_level = ENV.fetch("GOOGLE_ADS_RUBY_LOG_LEVEL", @config.log_level) @config.http_proxy = ENV.fetch("GOOGLE_ADS_RUBY_HTTP_PROXY", @config.http_proxy) + @config.use_cloud_org_for_api_access = ENV.fetch("GOOGLE_ADS_USE_CLOUD_ORG_FOR_API_ACCESS", @config.use_cloud_org_for_api_access) + if @config.use_cloud_org_for_api_access.is_a?(String) + @config.use_cloud_org_for_api_access = @config.use_cloud_org_for_api_access.downcase == "true" + end end # Return a service for the provided entity type. For example, passing