File tree Expand file tree Collapse file tree
lib/google/ads/google_ads Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 39.1.0
2+ -----
3+ - Added workaround for gRPC issue affecting metadata headers.
4+
1539.0.0
26-----
37- Compatibility with v23.2 of the API: https://developers.google.com/google-ads/api/docs/release-notes
Original file line number Diff line number Diff line change @@ -58,8 +58,7 @@ def update_metadata(metadata)
5858 metadata [ :"linked-customer-id" ] = @linked_customer_id . to_s
5959 end
6060
61- # The python library iterates over metadata and modifies x-goog-api-client
62- # Here we can directly access it.
61+ # Update metadata for x-goog-api-client
6362 if metadata . key? ( :"x-goog-api-client" )
6463 if @ads_assistant
6564 metadata [ :"x-goog-api-client" ] += " gaada/#{ @ads_assistant } "
Original file line number Diff line number Diff line change @@ -78,22 +78,26 @@ def gax_service_params
7878 # Pass headers as initial metadata here until the upstream fix
7979 # (grpc/grpc#42073) is released.
8080 def headers
81- h = { }
81+ headers = { }
8282 if config . login_customer_id
8383 validate_customer_id ( :login_customer_id )
84- h [ :"login-customer-id" ] = config . login_customer_id . to_s
84+ headers [ :"login-customer-id" ] = config . login_customer_id . to_s
8585 end
8686
8787 if config . linked_customer_id
8888 validate_customer_id ( :linked_customer_id )
89- h [ :"linked-customer-id" ] = config . linked_customer_id . to_s
89+ headers [ :"linked-customer-id" ] = config . linked_customer_id . to_s
9090 end
9191
9292 unless config . use_cloud_org_for_api_access
93- h [ :"developer-token" ] = config . developer_token if config . developer_token
93+ headers [ :"developer-token" ] = config . developer_token if config . developer_token
9494 end
9595
96- h
96+ if config . ads_assistant
97+ headers [ :"x-goog-api-client" ] = "gaada/#{ config . ads_assistant } "
98+ end
99+
100+ headers
97101 end
98102
99103 def validate_customer_id ( field )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ module Google
2020 module Ads
2121 module GoogleAds
2222 CLIENT_LIB_NAME = 'gccl' . freeze
23- CLIENT_LIB_VERSION = '39.0 .0' . freeze
23+ CLIENT_LIB_VERSION = '39.1 .0' . freeze
2424 VERSION = CLIENT_LIB_VERSION
2525 end
2626 end
Original file line number Diff line number Diff line change @@ -29,13 +29,15 @@ def test_headers_includes_all_when_fully_configured
2929 c . login_customer_id = 1234567890
3030 c . linked_customer_id = 9876543210
3131 c . developer_token = "test-dev-token"
32+ c . ads_assistant = "v0"
3233 end
3334 lookup = create_lookup ( config )
3435
3536 headers = lookup . send ( :headers )
3637 assert_equal "1234567890" , headers [ :"login-customer-id" ]
3738 assert_equal "9876543210" , headers [ :"linked-customer-id" ]
3839 assert_equal "test-dev-token" , headers [ :"developer-token" ]
40+ assert_equal "gaada/v0" , headers [ :"x-goog-api-client" ]
3941 end
4042
4143 def test_headers_excludes_developer_token_when_cloud_org
You can’t perform that action at this time.
0 commit comments