google-ads-ad_manager-v1 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -1
- data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/client.rb +36 -4
- data/lib/google/ads/ad_manager/v1/ad_unit_service/rest/service_stub.rb +38 -20
- data/lib/google/ads/ad_manager/v1/company_service/rest/client.rb +35 -3
- data/lib/google/ads/ad_manager/v1/company_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/custom_field_service/rest/client.rb +35 -3
- data/lib/google/ads/ad_manager/v1/custom_field_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/client.rb +35 -3
- data/lib/google/ads/ad_manager/v1/custom_targeting_key_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/client.rb +35 -3
- data/lib/google/ads/ad_manager/v1/custom_targeting_value_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/client.rb +35 -7
- data/lib/google/ads/ad_manager/v1/entity_signals_mapping_service/rest/service_stub.rb +62 -38
- data/lib/google/ads/ad_manager/v1/network_service/rest/client.rb +34 -3
- data/lib/google/ads/ad_manager/v1/network_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/order_service/rest/client.rb +35 -3
- data/lib/google/ads/ad_manager/v1/order_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/placement_service/rest/client.rb +35 -3
- data/lib/google/ads/ad_manager/v1/placement_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/report_service/rest/client.rb +36 -7
- data/lib/google/ads/ad_manager/v1/report_service/rest/operations.rb +50 -38
- data/lib/google/ads/ad_manager/v1/report_service/rest/service_stub.rb +62 -38
- data/lib/google/ads/ad_manager/v1/role_service/rest/client.rb +35 -3
- data/lib/google/ads/ad_manager/v1/role_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/client.rb +35 -3
- data/lib/google/ads/ad_manager/v1/taxonomy_category_service/rest/service_stub.rb +30 -14
- data/lib/google/ads/ad_manager/v1/user_service/rest/client.rb +34 -2
- data/lib/google/ads/ad_manager/v1/user_service/rest/service_stub.rb +22 -8
- data/lib/google/ads/ad_manager/v1/version.rb +1 -1
- data/proto_docs/google/ads/admanager/v1/custom_field_value.rb +8 -0
- data/proto_docs/google/ads/admanager/v1/entity_signals_mapping_messages.rb +6 -0
- data/proto_docs/google/ads/admanager/v1/report_service.rb +34 -0
- data/proto_docs/google/api/client.rb +25 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- metadata +6 -9
@@ -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)
|
@@ -349,6 +367,13 @@ module Google
|
|
349
367
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
350
368
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
351
369
|
# * (`nil`) indicating no credentials
|
370
|
+
#
|
371
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
372
|
+
# external source for authentication to Google Cloud, you must validate it before
|
373
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
374
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
375
|
+
# For more information, refer to [Validate credential configurations from external
|
376
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
352
377
|
# @return [::Object]
|
353
378
|
# @!attribute [rw] scope
|
354
379
|
# The OAuth scopes
|
@@ -381,6 +406,11 @@ module Google
|
|
381
406
|
# default endpoint URL. The default value of nil uses the environment
|
382
407
|
# universe (usually the default "googleapis.com" universe).
|
383
408
|
# @return [::String,nil]
|
409
|
+
# @!attribute [rw] logger
|
410
|
+
# A custom logger to use for request/response debug logging, or the value
|
411
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
412
|
+
# explicitly disable logging.
|
413
|
+
# @return [::Logger,:default,nil]
|
384
414
|
#
|
385
415
|
class Configuration
|
386
416
|
extend ::Gapic::Config
|
@@ -402,6 +432,7 @@ module Google
|
|
402
432
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
403
433
|
config_attr :quota_project, nil, ::String, nil
|
404
434
|
config_attr :universe_domain, nil, ::String, nil
|
435
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
405
436
|
|
406
437
|
# @private
|
407
438
|
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
|
-
|
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
|
-
|
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:
|
91
|
-
body:
|
92
|
-
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
|
-
|
99
|
-
|
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:
|
129
|
-
body:
|
130
|
-
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
|
-
|
137
|
-
|
150
|
+
catch :response do
|
151
|
+
yield result, operation if block_given?
|
152
|
+
result
|
153
|
+
end
|
138
154
|
end
|
139
155
|
|
140
156
|
##
|
@@ -155,8 +155,28 @@ module Google
|
|
155
155
|
endpoint: @config.endpoint,
|
156
156
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
157
157
|
universe_domain: @config.universe_domain,
|
158
|
-
credentials: credentials
|
158
|
+
credentials: credentials,
|
159
|
+
logger: @config.logger
|
159
160
|
)
|
161
|
+
|
162
|
+
@order_service_stub.logger(stub: true)&.info do |entry|
|
163
|
+
entry.set_system_name
|
164
|
+
entry.set_service
|
165
|
+
entry.message = "Created client for #{entry.service}"
|
166
|
+
entry.set_credentials_fields credentials
|
167
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
168
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
169
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# The logger used for request/response debug logging.
|
175
|
+
#
|
176
|
+
# @return [Logger]
|
177
|
+
#
|
178
|
+
def logger
|
179
|
+
@order_service_stub.logger
|
160
180
|
end
|
161
181
|
|
162
182
|
# Service calls
|
@@ -235,7 +255,6 @@ module Google
|
|
235
255
|
|
236
256
|
@order_service_stub.get_order request, options do |result, operation|
|
237
257
|
yield result, operation if block_given?
|
238
|
-
return result
|
239
258
|
end
|
240
259
|
rescue ::Gapic::Rest::Error => e
|
241
260
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -346,7 +365,7 @@ module Google
|
|
346
365
|
@order_service_stub.list_orders request, options do |result, operation|
|
347
366
|
result = ::Gapic::Rest::PagedEnumerable.new @order_service_stub, :list_orders, "orders", request, result, options
|
348
367
|
yield result, operation if block_given?
|
349
|
-
|
368
|
+
throw :response, result
|
350
369
|
end
|
351
370
|
rescue ::Gapic::Rest::Error => e
|
352
371
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -394,6 +413,13 @@ module Google
|
|
394
413
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
395
414
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
396
415
|
# * (`nil`) indicating no credentials
|
416
|
+
#
|
417
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
418
|
+
# external source for authentication to Google Cloud, you must validate it before
|
419
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
420
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
421
|
+
# For more information, refer to [Validate credential configurations from external
|
422
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
397
423
|
# @return [::Object]
|
398
424
|
# @!attribute [rw] scope
|
399
425
|
# The OAuth scopes
|
@@ -426,6 +452,11 @@ module Google
|
|
426
452
|
# default endpoint URL. The default value of nil uses the environment
|
427
453
|
# universe (usually the default "googleapis.com" universe).
|
428
454
|
# @return [::String,nil]
|
455
|
+
# @!attribute [rw] logger
|
456
|
+
# A custom logger to use for request/response debug logging, or the value
|
457
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
458
|
+
# explicitly disable logging.
|
459
|
+
# @return [::Logger,:default,nil]
|
429
460
|
#
|
430
461
|
class Configuration
|
431
462
|
extend ::Gapic::Config
|
@@ -447,6 +478,7 @@ module Google
|
|
447
478
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
448
479
|
config_attr :quota_project, nil, ::String, nil
|
449
480
|
config_attr :universe_domain, nil, ::String, nil
|
481
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
450
482
|
|
451
483
|
# @private
|
452
484
|
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
|
-
|
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
|
-
|
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_order 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:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "get_order",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Ads::AdManager::V1::Order.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
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:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "list_orders",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Ads::AdManager::V1::ListOrdersResponse.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
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
|
+
@placement_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
|
+
@placement_service_stub.logger
|
155
175
|
end
|
156
176
|
|
157
177
|
# Service calls
|
@@ -230,7 +250,6 @@ module Google
|
|
230
250
|
|
231
251
|
@placement_service_stub.get_placement 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)
|
@@ -336,7 +355,7 @@ module Google
|
|
336
355
|
@placement_service_stub.list_placements request, options do |result, operation|
|
337
356
|
result = ::Gapic::Rest::PagedEnumerable.new @placement_service_stub, :list_placements, "placements", request, result, options
|
338
357
|
yield result, operation if block_given?
|
339
|
-
|
358
|
+
throw :response, result
|
340
359
|
end
|
341
360
|
rescue ::Gapic::Rest::Error => e
|
342
361
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -384,6 +403,13 @@ module Google
|
|
384
403
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
385
404
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
386
405
|
# * (`nil`) indicating no credentials
|
406
|
+
#
|
407
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
408
|
+
# external source for authentication to Google Cloud, you must validate it before
|
409
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
410
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
411
|
+
# For more information, refer to [Validate credential configurations from external
|
412
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
387
413
|
# @return [::Object]
|
388
414
|
# @!attribute [rw] scope
|
389
415
|
# The OAuth scopes
|
@@ -416,6 +442,11 @@ module Google
|
|
416
442
|
# default endpoint URL. The default value of nil uses the environment
|
417
443
|
# universe (usually the default "googleapis.com" universe).
|
418
444
|
# @return [::String,nil]
|
445
|
+
# @!attribute [rw] logger
|
446
|
+
# A custom logger to use for request/response debug logging, or the value
|
447
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
448
|
+
# explicitly disable logging.
|
449
|
+
# @return [::Logger,:default,nil]
|
419
450
|
#
|
420
451
|
class Configuration
|
421
452
|
extend ::Gapic::Config
|
@@ -437,6 +468,7 @@ module Google
|
|
437
468
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
438
469
|
config_attr :quota_project, nil, ::String, nil
|
439
470
|
config_attr :universe_domain, nil, ::String, nil
|
471
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
440
472
|
|
441
473
|
# @private
|
442
474
|
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
|
-
|
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
|
-
|
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_placement 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:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "get_placement",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Ads::AdManager::V1::Placement.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
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:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "list_placements",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Ads::AdManager::V1::ListPlacementsResponse.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
150
|
+
catch :response do
|
151
|
+
yield result, operation if block_given?
|
152
|
+
result
|
153
|
+
end
|
138
154
|
end
|
139
155
|
|
140
156
|
##
|
@@ -157,8 +157,19 @@ module Google
|
|
157
157
|
endpoint: @config.endpoint,
|
158
158
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
159
159
|
universe_domain: @config.universe_domain,
|
160
|
-
credentials: credentials
|
160
|
+
credentials: credentials,
|
161
|
+
logger: @config.logger
|
161
162
|
)
|
163
|
+
|
164
|
+
@report_service_stub.logger(stub: true)&.info do |entry|
|
165
|
+
entry.set_system_name
|
166
|
+
entry.set_service
|
167
|
+
entry.message = "Created client for #{entry.service}"
|
168
|
+
entry.set_credentials_fields credentials
|
169
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
170
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
171
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
172
|
+
end
|
162
173
|
end
|
163
174
|
|
164
175
|
##
|
@@ -168,6 +179,15 @@ module Google
|
|
168
179
|
#
|
169
180
|
attr_reader :operations_client
|
170
181
|
|
182
|
+
##
|
183
|
+
# The logger used for request/response debug logging.
|
184
|
+
#
|
185
|
+
# @return [Logger]
|
186
|
+
#
|
187
|
+
def logger
|
188
|
+
@report_service_stub.logger
|
189
|
+
end
|
190
|
+
|
171
191
|
# Service calls
|
172
192
|
|
173
193
|
##
|
@@ -244,7 +264,6 @@ module Google
|
|
244
264
|
|
245
265
|
@report_service_stub.get_report request, options do |result, operation|
|
246
266
|
yield result, operation if block_given?
|
247
|
-
return result
|
248
267
|
end
|
249
268
|
rescue ::Gapic::Rest::Error => e
|
250
269
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -350,7 +369,7 @@ module Google
|
|
350
369
|
@report_service_stub.list_reports request, options do |result, operation|
|
351
370
|
result = ::Gapic::Rest::PagedEnumerable.new @report_service_stub, :list_reports, "reports", request, result, options
|
352
371
|
yield result, operation if block_given?
|
353
|
-
|
372
|
+
throw :response, result
|
354
373
|
end
|
355
374
|
rescue ::Gapic::Rest::Error => e
|
356
375
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -432,7 +451,6 @@ module Google
|
|
432
451
|
|
433
452
|
@report_service_stub.create_report request, options do |result, operation|
|
434
453
|
yield result, operation if block_given?
|
435
|
-
return result
|
436
454
|
end
|
437
455
|
rescue ::Gapic::Rest::Error => e
|
438
456
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -513,7 +531,6 @@ module Google
|
|
513
531
|
|
514
532
|
@report_service_stub.update_report request, options do |result, operation|
|
515
533
|
yield result, operation if block_given?
|
516
|
-
return result
|
517
534
|
end
|
518
535
|
rescue ::Gapic::Rest::Error => e
|
519
536
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -608,7 +625,7 @@ module Google
|
|
608
625
|
@report_service_stub.run_report request, options do |result, operation|
|
609
626
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
610
627
|
yield result, operation if block_given?
|
611
|
-
|
628
|
+
throw :response, result
|
612
629
|
end
|
613
630
|
rescue ::Gapic::Rest::Error => e
|
614
631
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -703,7 +720,6 @@ module Google
|
|
703
720
|
|
704
721
|
@report_service_stub.fetch_report_result_rows request, options do |result, operation|
|
705
722
|
yield result, operation if block_given?
|
706
|
-
return result
|
707
723
|
end
|
708
724
|
rescue ::Gapic::Rest::Error => e
|
709
725
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -751,6 +767,13 @@ module Google
|
|
751
767
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
752
768
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
753
769
|
# * (`nil`) indicating no credentials
|
770
|
+
#
|
771
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
772
|
+
# external source for authentication to Google Cloud, you must validate it before
|
773
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
774
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
775
|
+
# For more information, refer to [Validate credential configurations from external
|
776
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
754
777
|
# @return [::Object]
|
755
778
|
# @!attribute [rw] scope
|
756
779
|
# The OAuth scopes
|
@@ -783,6 +806,11 @@ module Google
|
|
783
806
|
# default endpoint URL. The default value of nil uses the environment
|
784
807
|
# universe (usually the default "googleapis.com" universe).
|
785
808
|
# @return [::String,nil]
|
809
|
+
# @!attribute [rw] logger
|
810
|
+
# A custom logger to use for request/response debug logging, or the value
|
811
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
812
|
+
# explicitly disable logging.
|
813
|
+
# @return [::Logger,:default,nil]
|
786
814
|
#
|
787
815
|
class Configuration
|
788
816
|
extend ::Gapic::Config
|
@@ -804,6 +832,7 @@ module Google
|
|
804
832
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
805
833
|
config_attr :quota_project, nil, ::String, nil
|
806
834
|
config_attr :universe_domain, nil, ::String, nil
|
835
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
807
836
|
|
808
837
|
# @private
|
809
838
|
def initialize parent_config = nil
|