google-ads-ad_manager-v1 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -0
  3. data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/client.rb +29 -4
  4. data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/service_stub.rb +38 -20
  5. data/lib/google/ads/ad_manager/v1/company_service/rest/client.rb +28 -3
  6. data/lib/google/ads/ad_manager/v1/company_service/rest/service_stub.rb +30 -14
  7. data/lib/google/ads/ad_manager/v1/custom_field_service/rest/client.rb +28 -3
  8. data/lib/google/ads/ad_manager/v1/custom_field_service/rest/service_stub.rb +30 -14
  9. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/client.rb +28 -3
  10. data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/service_stub.rb +30 -14
  11. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/client.rb +28 -3
  12. data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/service_stub.rb +30 -14
  13. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/client.rb +28 -7
  14. data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/service_stub.rb +62 -38
  15. data/lib/google/ads/ad_manager/v1/network_service/rest/client.rb +27 -3
  16. data/lib/google/ads/ad_manager/v1/network_service/rest/service_stub.rb +30 -14
  17. data/lib/google/ads/ad_manager/v1/order_service/rest/client.rb +28 -3
  18. data/lib/google/ads/ad_manager/v1/order_service/rest/service_stub.rb +30 -14
  19. data/lib/google/ads/ad_manager/v1/placement_service/rest/client.rb +28 -3
  20. data/lib/google/ads/ad_manager/v1/placement_service/rest/service_stub.rb +30 -14
  21. data/lib/google/ads/ad_manager/v1/report_service/rest/client.rb +29 -7
  22. data/lib/google/ads/ad_manager/v1/report_service/rest/operations.rb +43 -38
  23. data/lib/google/ads/ad_manager/v1/report_service/rest/service_stub.rb +62 -38
  24. data/lib/google/ads/ad_manager/v1/role_service/rest/client.rb +28 -3
  25. data/lib/google/ads/ad_manager/v1/role_service/rest/service_stub.rb +30 -14
  26. data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/client.rb +28 -3
  27. data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/service_stub.rb +30 -14
  28. data/lib/google/ads/ad_manager/v1/user_service/rest/client.rb +27 -2
  29. data/lib/google/ads/ad_manager/v1/user_service/rest/service_stub.rb +22 -8
  30. data/lib/google/ads/ad_manager/v1/version.rb +1 -1
  31. data/proto_docs/google/api/client.rb +25 -0
  32. data/proto_docs/google/longrunning/operations.rb +19 -14
  33. metadata +5 -5
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the get_custom_targeting_key REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "get_custom_targeting_key",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Ads::AdManager::V1::CustomTargetingKey.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "list_custom_targeting_keys",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Ads::AdManager::V1::ListCustomTargetingKeysResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -150,8 +150,28 @@ module Google
150
150
  endpoint: @config.endpoint,
151
151
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
152
  universe_domain: @config.universe_domain,
153
- credentials: credentials
153
+ credentials: credentials,
154
+ logger: @config.logger
154
155
  )
156
+
157
+ @custom_targeting_value_service_stub.logger(stub: true)&.info do |entry|
158
+ entry.set_system_name
159
+ entry.set_service
160
+ entry.message = "Created client for #{entry.service}"
161
+ entry.set_credentials_fields credentials
162
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
163
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
164
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
165
+ end
166
+ end
167
+
168
+ ##
169
+ # The logger used for request/response debug logging.
170
+ #
171
+ # @return [Logger]
172
+ #
173
+ def logger
174
+ @custom_targeting_value_service_stub.logger
155
175
  end
156
176
 
157
177
  # Service calls
@@ -231,7 +251,6 @@ module Google
231
251
 
232
252
  @custom_targeting_value_service_stub.get_custom_targeting_value request, options do |result, operation|
233
253
  yield result, operation if block_given?
234
- return result
235
254
  end
236
255
  rescue ::Gapic::Rest::Error => e
237
256
  raise ::Google::Cloud::Error.from_error(e)
@@ -340,7 +359,7 @@ module Google
340
359
  @custom_targeting_value_service_stub.list_custom_targeting_values request, options do |result, operation|
341
360
  result = ::Gapic::Rest::PagedEnumerable.new @custom_targeting_value_service_stub, :list_custom_targeting_values, "custom_targeting_values", request, result, options
342
361
  yield result, operation if block_given?
343
- return result
362
+ throw :response, result
344
363
  end
345
364
  rescue ::Gapic::Rest::Error => e
346
365
  raise ::Google::Cloud::Error.from_error(e)
@@ -420,6 +439,11 @@ module Google
420
439
  # default endpoint URL. The default value of nil uses the environment
421
440
  # universe (usually the default "googleapis.com" universe).
422
441
  # @return [::String,nil]
442
+ # @!attribute [rw] logger
443
+ # A custom logger to use for request/response debug logging, or the value
444
+ # `:default` (the default) to construct a default logger, or `nil` to
445
+ # explicitly disable logging.
446
+ # @return [::Logger,:default,nil]
423
447
  #
424
448
  class Configuration
425
449
  extend ::Gapic::Config
@@ -441,6 +465,7 @@ module Google
441
465
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
442
466
  config_attr :quota_project, nil, ::String, nil
443
467
  config_attr :universe_domain, nil, ::String, nil
468
+ config_attr :logger, :default, ::Logger, nil, :default
444
469
 
445
470
  # @private
446
471
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the get_custom_targeting_value REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "get_custom_targeting_value",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Ads::AdManager::V1::CustomTargetingValue.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "list_custom_targeting_values",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Ads::AdManager::V1::ListCustomTargetingValuesResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -150,8 +150,28 @@ module Google
150
150
  endpoint: @config.endpoint,
151
151
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
152
  universe_domain: @config.universe_domain,
153
- credentials: credentials
153
+ credentials: credentials,
154
+ logger: @config.logger
154
155
  )
156
+
157
+ @entity_signals_mapping_service_stub.logger(stub: true)&.info do |entry|
158
+ entry.set_system_name
159
+ entry.set_service
160
+ entry.message = "Created client for #{entry.service}"
161
+ entry.set_credentials_fields credentials
162
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
163
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
164
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
165
+ end
166
+ end
167
+
168
+ ##
169
+ # The logger used for request/response debug logging.
170
+ #
171
+ # @return [Logger]
172
+ #
173
+ def logger
174
+ @entity_signals_mapping_service_stub.logger
155
175
  end
156
176
 
157
177
  # Service calls
@@ -231,7 +251,6 @@ module Google
231
251
 
232
252
  @entity_signals_mapping_service_stub.get_entity_signals_mapping request, options do |result, operation|
233
253
  yield result, operation if block_given?
234
- return result
235
254
  end
236
255
  rescue ::Gapic::Rest::Error => e
237
256
  raise ::Google::Cloud::Error.from_error(e)
@@ -339,7 +358,7 @@ module Google
339
358
  @entity_signals_mapping_service_stub.list_entity_signals_mappings request, options do |result, operation|
340
359
  result = ::Gapic::Rest::PagedEnumerable.new @entity_signals_mapping_service_stub, :list_entity_signals_mappings, "entity_signals_mappings", request, result, options
341
360
  yield result, operation if block_given?
342
- return result
361
+ throw :response, result
343
362
  end
344
363
  rescue ::Gapic::Rest::Error => e
345
364
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,7 +440,6 @@ module Google
421
440
 
422
441
  @entity_signals_mapping_service_stub.create_entity_signals_mapping request, options do |result, operation|
423
442
  yield result, operation if block_given?
424
- return result
425
443
  end
426
444
  rescue ::Gapic::Rest::Error => e
427
445
  raise ::Google::Cloud::Error.from_error(e)
@@ -507,7 +525,6 @@ module Google
507
525
 
508
526
  @entity_signals_mapping_service_stub.update_entity_signals_mapping request, options do |result, operation|
509
527
  yield result, operation if block_given?
510
- return result
511
528
  end
512
529
  rescue ::Gapic::Rest::Error => e
513
530
  raise ::Google::Cloud::Error.from_error(e)
@@ -591,7 +608,6 @@ module Google
591
608
 
592
609
  @entity_signals_mapping_service_stub.batch_create_entity_signals_mappings request, options do |result, operation|
593
610
  yield result, operation if block_given?
594
- return result
595
611
  end
596
612
  rescue ::Gapic::Rest::Error => e
597
613
  raise ::Google::Cloud::Error.from_error(e)
@@ -675,7 +691,6 @@ module Google
675
691
 
676
692
  @entity_signals_mapping_service_stub.batch_update_entity_signals_mappings request, options do |result, operation|
677
693
  yield result, operation if block_given?
678
- return result
679
694
  end
680
695
  rescue ::Gapic::Rest::Error => e
681
696
  raise ::Google::Cloud::Error.from_error(e)
@@ -755,6 +770,11 @@ module Google
755
770
  # default endpoint URL. The default value of nil uses the environment
756
771
  # universe (usually the default "googleapis.com" universe).
757
772
  # @return [::String,nil]
773
+ # @!attribute [rw] logger
774
+ # A custom logger to use for request/response debug logging, or the value
775
+ # `:default` (the default) to construct a default logger, or `nil` to
776
+ # explicitly disable logging.
777
+ # @return [::Logger,:default,nil]
758
778
  #
759
779
  class Configuration
760
780
  extend ::Gapic::Config
@@ -776,6 +796,7 @@ module Google
776
796
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
777
797
  config_attr :quota_project, nil, ::String, nil
778
798
  config_attr :universe_domain, nil, ::String, nil
799
+ config_attr :logger, :default, ::Logger, nil, :default
779
800
 
780
801
  # @private
781
802
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the get_entity_signals_mapping REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "get_entity_signals_mapping",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Ads::AdManager::V1::EntitySignalsMapping.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "list_entity_signals_mappings",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Ads::AdManager::V1::ListEntitySignalsMappingsResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "create_entity_signals_mapping",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Ads::AdManager::V1::EntitySignalsMapping.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "update_entity_signals_mapping",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Ads::AdManager::V1::EntitySignalsMapping.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "batch_create_entity_signals_mappings",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Ads::AdManager::V1::BatchCreateEntitySignalsMappingsResponse.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "batch_update_entity_signals_mappings",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Ads::AdManager::V1::BatchUpdateEntitySignalsMappingsResponse.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -150,8 +150,28 @@ module Google
150
150
  endpoint: @config.endpoint,
151
151
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
152
  universe_domain: @config.universe_domain,
153
- credentials: credentials
153
+ credentials: credentials,
154
+ logger: @config.logger
154
155
  )
156
+
157
+ @network_service_stub.logger(stub: true)&.info do |entry|
158
+ entry.set_system_name
159
+ entry.set_service
160
+ entry.message = "Created client for #{entry.service}"
161
+ entry.set_credentials_fields credentials
162
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
163
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
164
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
165
+ end
166
+ end
167
+
168
+ ##
169
+ # The logger used for request/response debug logging.
170
+ #
171
+ # @return [Logger]
172
+ #
173
+ def logger
174
+ @network_service_stub.logger
155
175
  end
156
176
 
157
177
  # Service calls
@@ -230,7 +250,6 @@ module Google
230
250
 
231
251
  @network_service_stub.get_network request, options do |result, operation|
232
252
  yield result, operation if block_given?
233
- return result
234
253
  end
235
254
  rescue ::Gapic::Rest::Error => e
236
255
  raise ::Google::Cloud::Error.from_error(e)
@@ -301,7 +320,6 @@ module Google
301
320
 
302
321
  @network_service_stub.list_networks request, options do |result, operation|
303
322
  yield result, operation if block_given?
304
- return result
305
323
  end
306
324
  rescue ::Gapic::Rest::Error => e
307
325
  raise ::Google::Cloud::Error.from_error(e)
@@ -381,6 +399,11 @@ module Google
381
399
  # default endpoint URL. The default value of nil uses the environment
382
400
  # universe (usually the default "googleapis.com" universe).
383
401
  # @return [::String,nil]
402
+ # @!attribute [rw] logger
403
+ # A custom logger to use for request/response debug logging, or the value
404
+ # `:default` (the default) to construct a default logger, or `nil` to
405
+ # explicitly disable logging.
406
+ # @return [::Logger,:default,nil]
384
407
  #
385
408
  class Configuration
386
409
  extend ::Gapic::Config
@@ -402,6 +425,7 @@ module Google
402
425
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
403
426
  config_attr :quota_project, nil, ::String, nil
404
427
  config_attr :universe_domain, nil, ::String, nil
428
+ config_attr :logger, :default, ::Logger, nil, :default
405
429
 
406
430
  # @private
407
431
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the get_network REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "get_network",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Ads::AdManager::V1::Network.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "list_networks",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Ads::AdManager::V1::ListNetworksResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##