google-cloud-app_engine-v1 1.0.1 → 1.1.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 +30 -20
- data/lib/google/cloud/app_engine/v1/applications/client.rb +30 -5
- data/lib/google/cloud/app_engine/v1/applications/operations.rb +12 -15
- data/lib/google/cloud/app_engine/v1/applications/rest/client.rb +30 -5
- data/lib/google/cloud/app_engine/v1/applications/rest/operations.rb +43 -38
- data/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb +46 -26
- data/lib/google/cloud/app_engine/v1/authorized_certificates/client.rb +28 -6
- data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/client.rb +28 -6
- data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb +54 -32
- data/lib/google/cloud/app_engine/v1/authorized_domains/client.rb +28 -2
- data/lib/google/cloud/app_engine/v1/authorized_domains/rest/client.rb +28 -2
- data/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb +22 -8
- data/lib/google/cloud/app_engine/v1/domain_mappings/client.rb +31 -6
- data/lib/google/cloud/app_engine/v1/domain_mappings/operations.rb +12 -15
- data/lib/google/cloud/app_engine/v1/domain_mappings/rest/client.rb +31 -6
- data/lib/google/cloud/app_engine/v1/domain_mappings/rest/operations.rb +43 -38
- data/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb +54 -32
- data/lib/google/cloud/app_engine/v1/firewall/client.rb +28 -7
- data/lib/google/cloud/app_engine/v1/firewall/rest/client.rb +28 -7
- data/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb +62 -38
- data/lib/google/cloud/app_engine/v1/instances/client.rb +30 -5
- data/lib/google/cloud/app_engine/v1/instances/operations.rb +12 -15
- data/lib/google/cloud/app_engine/v1/instances/rest/client.rb +30 -5
- data/lib/google/cloud/app_engine/v1/instances/rest/operations.rb +43 -38
- data/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb +46 -26
- data/lib/google/cloud/app_engine/v1/services/client.rb +30 -5
- data/lib/google/cloud/app_engine/v1/services/operations.rb +12 -15
- data/lib/google/cloud/app_engine/v1/services/rest/client.rb +30 -5
- data/lib/google/cloud/app_engine/v1/services/rest/operations.rb +43 -38
- data/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb +46 -26
- data/lib/google/cloud/app_engine/v1/version.rb +1 -1
- data/lib/google/cloud/app_engine/v1/versions/client.rb +31 -6
- data/lib/google/cloud/app_engine/v1/versions/operations.rb +12 -15
- data/lib/google/cloud/app_engine/v1/versions/rest/client.rb +31 -6
- data/lib/google/cloud/app_engine/v1/versions/rest/operations.rb +43 -38
- data/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb +54 -32
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
@@ -156,8 +156,28 @@ module Google
|
|
156
156
|
universe_domain: @config.universe_domain,
|
157
157
|
channel_args: @config.channel_args,
|
158
158
|
interceptors: @config.interceptors,
|
159
|
-
channel_pool_config: @config.channel_pool
|
159
|
+
channel_pool_config: @config.channel_pool,
|
160
|
+
logger: @config.logger
|
160
161
|
)
|
162
|
+
|
163
|
+
@authorized_certificates_stub.stub_logger&.info do |entry|
|
164
|
+
entry.set_system_name
|
165
|
+
entry.set_service
|
166
|
+
entry.message = "Created client for #{entry.service}"
|
167
|
+
entry.set_credentials_fields credentials
|
168
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
169
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
170
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# The logger used for request/response debug logging.
|
176
|
+
#
|
177
|
+
# @return [Logger]
|
178
|
+
#
|
179
|
+
def logger
|
180
|
+
@authorized_certificates_stub.logger
|
161
181
|
end
|
162
182
|
|
163
183
|
# Service calls
|
@@ -253,7 +273,7 @@ module Google
|
|
253
273
|
@authorized_certificates_stub.call_rpc :list_authorized_certificates, request, options: options do |response, operation|
|
254
274
|
response = ::Gapic::PagedEnumerable.new @authorized_certificates_stub, :list_authorized_certificates, request, response, operation, options
|
255
275
|
yield response, operation if block_given?
|
256
|
-
|
276
|
+
throw :response, response
|
257
277
|
end
|
258
278
|
rescue ::GRPC::BadStatus => e
|
259
279
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -342,7 +362,6 @@ module Google
|
|
342
362
|
|
343
363
|
@authorized_certificates_stub.call_rpc :get_authorized_certificate, request, options: options do |response, operation|
|
344
364
|
yield response, operation if block_given?
|
345
|
-
return response
|
346
365
|
end
|
347
366
|
rescue ::GRPC::BadStatus => e
|
348
367
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -430,7 +449,6 @@ module Google
|
|
430
449
|
|
431
450
|
@authorized_certificates_stub.call_rpc :create_authorized_certificate, request, options: options do |response, operation|
|
432
451
|
yield response, operation if block_given?
|
433
|
-
return response
|
434
452
|
end
|
435
453
|
rescue ::GRPC::BadStatus => e
|
436
454
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -527,7 +545,6 @@ module Google
|
|
527
545
|
|
528
546
|
@authorized_certificates_stub.call_rpc :update_authorized_certificate, request, options: options do |response, operation|
|
529
547
|
yield response, operation if block_given?
|
530
|
-
return response
|
531
548
|
end
|
532
549
|
rescue ::GRPC::BadStatus => e
|
533
550
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -614,7 +631,6 @@ module Google
|
|
614
631
|
|
615
632
|
@authorized_certificates_stub.call_rpc :delete_authorized_certificate, request, options: options do |response, operation|
|
616
633
|
yield response, operation if block_given?
|
617
|
-
return response
|
618
634
|
end
|
619
635
|
rescue ::GRPC::BadStatus => e
|
620
636
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -703,6 +719,11 @@ module Google
|
|
703
719
|
# default endpoint URL. The default value of nil uses the environment
|
704
720
|
# universe (usually the default "googleapis.com" universe).
|
705
721
|
# @return [::String,nil]
|
722
|
+
# @!attribute [rw] logger
|
723
|
+
# A custom logger to use for request/response debug logging, or the value
|
724
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
725
|
+
# explicitly disable logging.
|
726
|
+
# @return [::Logger,:default,nil]
|
706
727
|
#
|
707
728
|
class Configuration
|
708
729
|
extend ::Gapic::Config
|
@@ -727,6 +748,7 @@ module Google
|
|
727
748
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
728
749
|
config_attr :quota_project, nil, ::String, nil
|
729
750
|
config_attr :universe_domain, nil, ::String, nil
|
751
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
730
752
|
|
731
753
|
# @private
|
732
754
|
def initialize parent_config = nil
|
@@ -149,8 +149,28 @@ module Google
|
|
149
149
|
endpoint: @config.endpoint,
|
150
150
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
151
151
|
universe_domain: @config.universe_domain,
|
152
|
-
credentials: credentials
|
152
|
+
credentials: credentials,
|
153
|
+
logger: @config.logger
|
153
154
|
)
|
155
|
+
|
156
|
+
@authorized_certificates_stub.logger(stub: true)&.info do |entry|
|
157
|
+
entry.set_system_name
|
158
|
+
entry.set_service
|
159
|
+
entry.message = "Created client for #{entry.service}"
|
160
|
+
entry.set_credentials_fields credentials
|
161
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
162
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
163
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
##
|
168
|
+
# The logger used for request/response debug logging.
|
169
|
+
#
|
170
|
+
# @return [Logger]
|
171
|
+
#
|
172
|
+
def logger
|
173
|
+
@authorized_certificates_stub.logger
|
154
174
|
end
|
155
175
|
|
156
176
|
# Service calls
|
@@ -239,7 +259,7 @@ module Google
|
|
239
259
|
@authorized_certificates_stub.list_authorized_certificates request, options do |result, operation|
|
240
260
|
result = ::Gapic::Rest::PagedEnumerable.new @authorized_certificates_stub, :list_authorized_certificates, "certificates", request, result, options
|
241
261
|
yield result, operation if block_given?
|
242
|
-
|
262
|
+
throw :response, result
|
243
263
|
end
|
244
264
|
rescue ::Gapic::Rest::Error => e
|
245
265
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -321,7 +341,6 @@ module Google
|
|
321
341
|
|
322
342
|
@authorized_certificates_stub.get_authorized_certificate request, options do |result, operation|
|
323
343
|
yield result, operation if block_given?
|
324
|
-
return result
|
325
344
|
end
|
326
345
|
rescue ::Gapic::Rest::Error => e
|
327
346
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -402,7 +421,6 @@ module Google
|
|
402
421
|
|
403
422
|
@authorized_certificates_stub.create_authorized_certificate request, options do |result, operation|
|
404
423
|
yield result, operation if block_given?
|
405
|
-
return result
|
406
424
|
end
|
407
425
|
rescue ::Gapic::Rest::Error => e
|
408
426
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -492,7 +510,6 @@ module Google
|
|
492
510
|
|
493
511
|
@authorized_certificates_stub.update_authorized_certificate request, options do |result, operation|
|
494
512
|
yield result, operation if block_given?
|
495
|
-
return result
|
496
513
|
end
|
497
514
|
rescue ::Gapic::Rest::Error => e
|
498
515
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -572,7 +589,6 @@ module Google
|
|
572
589
|
|
573
590
|
@authorized_certificates_stub.delete_authorized_certificate request, options do |result, operation|
|
574
591
|
yield result, operation if block_given?
|
575
|
-
return result
|
576
592
|
end
|
577
593
|
rescue ::Gapic::Rest::Error => e
|
578
594
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -652,6 +668,11 @@ module Google
|
|
652
668
|
# default endpoint URL. The default value of nil uses the environment
|
653
669
|
# universe (usually the default "googleapis.com" universe).
|
654
670
|
# @return [::String,nil]
|
671
|
+
# @!attribute [rw] logger
|
672
|
+
# A custom logger to use for request/response debug logging, or the value
|
673
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
674
|
+
# explicitly disable logging.
|
675
|
+
# @return [::Logger,:default,nil]
|
655
676
|
#
|
656
677
|
class Configuration
|
657
678
|
extend ::Gapic::Config
|
@@ -673,6 +694,7 @@ module Google
|
|
673
694
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
674
695
|
config_attr :quota_project, nil, ::String, nil
|
675
696
|
config_attr :universe_domain, nil, ::String, nil
|
697
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
676
698
|
|
677
699
|
# @private
|
678
700
|
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 list_authorized_certificates 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: "list_authorized_certificates",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::AppEngine::V1::ListAuthorizedCertificatesResponse.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: "get_authorized_certificate",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::AppEngine::V1::AuthorizedCertificate.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
|
##
|
@@ -163,16 +179,18 @@ module Google
|
|
163
179
|
|
164
180
|
response = @client_stub.make_http_request(
|
165
181
|
verb,
|
166
|
-
uri:
|
167
|
-
body:
|
168
|
-
params:
|
182
|
+
uri: uri,
|
183
|
+
body: body || "",
|
184
|
+
params: query_string_params,
|
185
|
+
method_name: "create_authorized_certificate",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Cloud::AppEngine::V1::AuthorizedCertificate.decode_json response.body, ignore_unknown_fields: true
|
173
|
-
|
174
|
-
|
175
|
-
|
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:
|
205
|
-
body:
|
206
|
-
params:
|
222
|
+
uri: uri,
|
223
|
+
body: body || "",
|
224
|
+
params: query_string_params,
|
225
|
+
method_name: "update_authorized_certificate",
|
207
226
|
options: options
|
208
227
|
)
|
209
228
|
operation = ::Gapic::Rest::TransportOperation.new response
|
210
229
|
result = ::Google::Cloud::AppEngine::V1::AuthorizedCertificate.decode_json response.body, ignore_unknown_fields: true
|
211
|
-
|
212
|
-
|
213
|
-
|
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:
|
243
|
-
body:
|
244
|
-
params:
|
262
|
+
uri: uri,
|
263
|
+
body: body || "",
|
264
|
+
params: query_string_params,
|
265
|
+
method_name: "delete_authorized_certificate",
|
245
266
|
options: options
|
246
267
|
)
|
247
268
|
operation = ::Gapic::Rest::TransportOperation.new response
|
248
269
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
249
|
-
|
250
|
-
|
251
|
-
|
270
|
+
catch :response do
|
271
|
+
yield result, operation if block_given?
|
272
|
+
result
|
273
|
+
end
|
252
274
|
end
|
253
275
|
|
254
276
|
##
|
@@ -157,8 +157,28 @@ module Google
|
|
157
157
|
universe_domain: @config.universe_domain,
|
158
158
|
channel_args: @config.channel_args,
|
159
159
|
interceptors: @config.interceptors,
|
160
|
-
channel_pool_config: @config.channel_pool
|
160
|
+
channel_pool_config: @config.channel_pool,
|
161
|
+
logger: @config.logger
|
161
162
|
)
|
163
|
+
|
164
|
+
@authorized_domains_stub.stub_logger&.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
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# The logger used for request/response debug logging.
|
177
|
+
#
|
178
|
+
# @return [Logger]
|
179
|
+
#
|
180
|
+
def logger
|
181
|
+
@authorized_domains_stub.logger
|
162
182
|
end
|
163
183
|
|
164
184
|
# Service calls
|
@@ -252,7 +272,7 @@ module Google
|
|
252
272
|
@authorized_domains_stub.call_rpc :list_authorized_domains, request, options: options do |response, operation|
|
253
273
|
response = ::Gapic::PagedEnumerable.new @authorized_domains_stub, :list_authorized_domains, request, response, operation, options
|
254
274
|
yield response, operation if block_given?
|
255
|
-
|
275
|
+
throw :response, response
|
256
276
|
end
|
257
277
|
rescue ::GRPC::BadStatus => e
|
258
278
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -341,6 +361,11 @@ module Google
|
|
341
361
|
# default endpoint URL. The default value of nil uses the environment
|
342
362
|
# universe (usually the default "googleapis.com" universe).
|
343
363
|
# @return [::String,nil]
|
364
|
+
# @!attribute [rw] logger
|
365
|
+
# A custom logger to use for request/response debug logging, or the value
|
366
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
367
|
+
# explicitly disable logging.
|
368
|
+
# @return [::Logger,:default,nil]
|
344
369
|
#
|
345
370
|
class Configuration
|
346
371
|
extend ::Gapic::Config
|
@@ -365,6 +390,7 @@ module Google
|
|
365
390
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
366
391
|
config_attr :quota_project, nil, ::String, nil
|
367
392
|
config_attr :universe_domain, nil, ::String, nil
|
393
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
368
394
|
|
369
395
|
# @private
|
370
396
|
def initialize parent_config = nil
|
@@ -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
|
+
@authorized_domains_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
|
+
@authorized_domains_stub.logger
|
155
175
|
end
|
156
176
|
|
157
177
|
# Service calls
|
@@ -238,7 +258,7 @@ module Google
|
|
238
258
|
@authorized_domains_stub.list_authorized_domains request, options do |result, operation|
|
239
259
|
result = ::Gapic::Rest::PagedEnumerable.new @authorized_domains_stub, :list_authorized_domains, "domains", request, result, options
|
240
260
|
yield result, operation if block_given?
|
241
|
-
|
261
|
+
throw :response, result
|
242
262
|
end
|
243
263
|
rescue ::Gapic::Rest::Error => e
|
244
264
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -318,6 +338,11 @@ module Google
|
|
318
338
|
# default endpoint URL. The default value of nil uses the environment
|
319
339
|
# universe (usually the default "googleapis.com" universe).
|
320
340
|
# @return [::String,nil]
|
341
|
+
# @!attribute [rw] logger
|
342
|
+
# A custom logger to use for request/response debug logging, or the value
|
343
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
344
|
+
# explicitly disable logging.
|
345
|
+
# @return [::Logger,:default,nil]
|
321
346
|
#
|
322
347
|
class Configuration
|
323
348
|
extend ::Gapic::Config
|
@@ -339,6 +364,7 @@ module Google
|
|
339
364
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
340
365
|
config_attr :quota_project, nil, ::String, nil
|
341
366
|
config_attr :universe_domain, nil, ::String, nil
|
367
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
342
368
|
|
343
369
|
# @private
|
344
370
|
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 list_authorized_domains 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: "list_authorized_domains",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsResponse.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
|
##
|
@@ -162,8 +162,19 @@ module Google
|
|
162
162
|
universe_domain: @config.universe_domain,
|
163
163
|
channel_args: @config.channel_args,
|
164
164
|
interceptors: @config.interceptors,
|
165
|
-
channel_pool_config: @config.channel_pool
|
165
|
+
channel_pool_config: @config.channel_pool,
|
166
|
+
logger: @config.logger
|
166
167
|
)
|
168
|
+
|
169
|
+
@domain_mappings_stub.stub_logger&.info do |entry|
|
170
|
+
entry.set_system_name
|
171
|
+
entry.set_service
|
172
|
+
entry.message = "Created client for #{entry.service}"
|
173
|
+
entry.set_credentials_fields credentials
|
174
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
175
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
176
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
177
|
+
end
|
167
178
|
end
|
168
179
|
|
169
180
|
##
|
@@ -173,6 +184,15 @@ module Google
|
|
173
184
|
#
|
174
185
|
attr_reader :operations_client
|
175
186
|
|
187
|
+
##
|
188
|
+
# The logger used for request/response debug logging.
|
189
|
+
#
|
190
|
+
# @return [Logger]
|
191
|
+
#
|
192
|
+
def logger
|
193
|
+
@domain_mappings_stub.logger
|
194
|
+
end
|
195
|
+
|
176
196
|
# Service calls
|
177
197
|
|
178
198
|
##
|
@@ -264,7 +284,7 @@ module Google
|
|
264
284
|
@domain_mappings_stub.call_rpc :list_domain_mappings, request, options: options do |response, operation|
|
265
285
|
response = ::Gapic::PagedEnumerable.new @domain_mappings_stub, :list_domain_mappings, request, response, operation, options
|
266
286
|
yield response, operation if block_given?
|
267
|
-
|
287
|
+
throw :response, response
|
268
288
|
end
|
269
289
|
rescue ::GRPC::BadStatus => e
|
270
290
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -351,7 +371,6 @@ module Google
|
|
351
371
|
|
352
372
|
@domain_mappings_stub.call_rpc :get_domain_mapping, request, options: options do |response, operation|
|
353
373
|
yield response, operation if block_given?
|
354
|
-
return response
|
355
374
|
end
|
356
375
|
rescue ::GRPC::BadStatus => e
|
357
376
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -452,7 +471,7 @@ module Google
|
|
452
471
|
@domain_mappings_stub.call_rpc :create_domain_mapping, request, options: options do |response, operation|
|
453
472
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
454
473
|
yield response, operation if block_given?
|
455
|
-
|
474
|
+
throw :response, response
|
456
475
|
end
|
457
476
|
rescue ::GRPC::BadStatus => e
|
458
477
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -555,7 +574,7 @@ module Google
|
|
555
574
|
@domain_mappings_stub.call_rpc :update_domain_mapping, request, options: options do |response, operation|
|
556
575
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
557
576
|
yield response, operation if block_given?
|
558
|
-
|
577
|
+
throw :response, response
|
559
578
|
end
|
560
579
|
rescue ::GRPC::BadStatus => e
|
561
580
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -652,7 +671,7 @@ module Google
|
|
652
671
|
@domain_mappings_stub.call_rpc :delete_domain_mapping, request, options: options do |response, operation|
|
653
672
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
654
673
|
yield response, operation if block_given?
|
655
|
-
|
674
|
+
throw :response, response
|
656
675
|
end
|
657
676
|
rescue ::GRPC::BadStatus => e
|
658
677
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -741,6 +760,11 @@ module Google
|
|
741
760
|
# default endpoint URL. The default value of nil uses the environment
|
742
761
|
# universe (usually the default "googleapis.com" universe).
|
743
762
|
# @return [::String,nil]
|
763
|
+
# @!attribute [rw] logger
|
764
|
+
# A custom logger to use for request/response debug logging, or the value
|
765
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
766
|
+
# explicitly disable logging.
|
767
|
+
# @return [::Logger,:default,nil]
|
744
768
|
#
|
745
769
|
class Configuration
|
746
770
|
extend ::Gapic::Config
|
@@ -765,6 +789,7 @@ module Google
|
|
765
789
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
766
790
|
config_attr :quota_project, nil, ::String, nil
|
767
791
|
config_attr :universe_domain, nil, ::String, nil
|
792
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
768
793
|
|
769
794
|
# @private
|
770
795
|
def initialize parent_config = nil
|