google-cloud-dialogflow-cx-v3 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +31 -21
- data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +44 -12
- data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +44 -12
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +50 -38
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +102 -68
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +36 -3
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +36 -3
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +30 -14
- data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +36 -3
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +36 -3
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +30 -14
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +46 -8
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +46 -8
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb +50 -38
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +42 -10
- data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +42 -10
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +50 -38
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +86 -56
- data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +36 -8
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +36 -8
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +43 -11
- data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +43 -11
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +50 -38
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +94 -62
- data/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +46 -8
- data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +46 -8
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +50 -38
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +35 -7
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +35 -5
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +47 -26
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +45 -13
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +45 -13
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +50 -38
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +110 -74
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +38 -8
- data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +38 -8
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +50 -38
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +54 -32
- data/proto_docs/google/api/client.rb +19 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +12 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +12 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +8 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +12 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +12 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +28 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +32 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +22 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +18 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- data/proto_docs/google/protobuf/struct.rb +12 -0
- metadata +6 -9
@@ -31,7 +31,8 @@ module Google
|
|
31
31
|
# including transcoding, making the REST call, and deserialing the response.
|
32
32
|
#
|
33
33
|
class ServiceStub
|
34
|
-
|
34
|
+
# @private
|
35
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
35
36
|
# These require statements are intentionally placed here to initialize
|
36
37
|
# the REST modules only when it's required.
|
37
38
|
require "gapic/rest"
|
@@ -41,7 +42,9 @@ module Google
|
|
41
42
|
universe_domain: universe_domain,
|
42
43
|
credentials: credentials,
|
43
44
|
numeric_enums: true,
|
44
|
-
|
45
|
+
service_name: self.class,
|
46
|
+
raise_faraday_errors: false,
|
47
|
+
logger: logger
|
45
48
|
end
|
46
49
|
|
47
50
|
##
|
@@ -62,6 +65,15 @@ module Google
|
|
62
65
|
@client_stub.endpoint
|
63
66
|
end
|
64
67
|
|
68
|
+
##
|
69
|
+
# The logger used for request/response debug logging.
|
70
|
+
#
|
71
|
+
# @return [Logger]
|
72
|
+
#
|
73
|
+
def logger stub: false
|
74
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
75
|
+
end
|
76
|
+
|
65
77
|
##
|
66
78
|
# Baseline implementation for the list_environments REST call
|
67
79
|
#
|
@@ -88,16 +100,18 @@ module Google
|
|
88
100
|
|
89
101
|
response = @client_stub.make_http_request(
|
90
102
|
verb,
|
91
|
-
uri:
|
92
|
-
body:
|
93
|
-
params:
|
103
|
+
uri: uri,
|
104
|
+
body: body || "",
|
105
|
+
params: query_string_params,
|
106
|
+
method_name: "list_environments",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsResponse.decode_json response.body, ignore_unknown_fields: true
|
98
|
-
|
99
|
-
|
100
|
-
|
111
|
+
catch :response do
|
112
|
+
yield result, operation if block_given?
|
113
|
+
result
|
114
|
+
end
|
101
115
|
end
|
102
116
|
|
103
117
|
##
|
@@ -126,16 +140,18 @@ module Google
|
|
126
140
|
|
127
141
|
response = @client_stub.make_http_request(
|
128
142
|
verb,
|
129
|
-
uri:
|
130
|
-
body:
|
131
|
-
params:
|
143
|
+
uri: uri,
|
144
|
+
body: body || "",
|
145
|
+
params: query_string_params,
|
146
|
+
method_name: "get_environment",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Cloud::Dialogflow::CX::V3::Environment.decode_json response.body, ignore_unknown_fields: true
|
136
|
-
|
137
|
-
|
138
|
-
|
151
|
+
catch :response do
|
152
|
+
yield result, operation if block_given?
|
153
|
+
result
|
154
|
+
end
|
139
155
|
end
|
140
156
|
|
141
157
|
##
|
@@ -164,16 +180,18 @@ module Google
|
|
164
180
|
|
165
181
|
response = @client_stub.make_http_request(
|
166
182
|
verb,
|
167
|
-
uri:
|
168
|
-
body:
|
169
|
-
params:
|
183
|
+
uri: uri,
|
184
|
+
body: body || "",
|
185
|
+
params: query_string_params,
|
186
|
+
method_name: "create_environment",
|
170
187
|
options: options
|
171
188
|
)
|
172
189
|
operation = ::Gapic::Rest::TransportOperation.new response
|
173
190
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
174
|
-
|
175
|
-
|
176
|
-
|
191
|
+
catch :response do
|
192
|
+
yield result, operation if block_given?
|
193
|
+
result
|
194
|
+
end
|
177
195
|
end
|
178
196
|
|
179
197
|
##
|
@@ -202,16 +220,18 @@ module Google
|
|
202
220
|
|
203
221
|
response = @client_stub.make_http_request(
|
204
222
|
verb,
|
205
|
-
uri:
|
206
|
-
body:
|
207
|
-
params:
|
223
|
+
uri: uri,
|
224
|
+
body: body || "",
|
225
|
+
params: query_string_params,
|
226
|
+
method_name: "update_environment",
|
208
227
|
options: options
|
209
228
|
)
|
210
229
|
operation = ::Gapic::Rest::TransportOperation.new response
|
211
230
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
212
|
-
|
213
|
-
|
214
|
-
|
231
|
+
catch :response do
|
232
|
+
yield result, operation if block_given?
|
233
|
+
result
|
234
|
+
end
|
215
235
|
end
|
216
236
|
|
217
237
|
##
|
@@ -240,16 +260,18 @@ module Google
|
|
240
260
|
|
241
261
|
response = @client_stub.make_http_request(
|
242
262
|
verb,
|
243
|
-
uri:
|
244
|
-
body:
|
245
|
-
params:
|
263
|
+
uri: uri,
|
264
|
+
body: body || "",
|
265
|
+
params: query_string_params,
|
266
|
+
method_name: "delete_environment",
|
246
267
|
options: options
|
247
268
|
)
|
248
269
|
operation = ::Gapic::Rest::TransportOperation.new response
|
249
270
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
250
|
-
|
251
|
-
|
252
|
-
|
271
|
+
catch :response do
|
272
|
+
yield result, operation if block_given?
|
273
|
+
result
|
274
|
+
end
|
253
275
|
end
|
254
276
|
|
255
277
|
##
|
@@ -278,16 +300,18 @@ module Google
|
|
278
300
|
|
279
301
|
response = @client_stub.make_http_request(
|
280
302
|
verb,
|
281
|
-
uri:
|
282
|
-
body:
|
283
|
-
params:
|
303
|
+
uri: uri,
|
304
|
+
body: body || "",
|
305
|
+
params: query_string_params,
|
306
|
+
method_name: "lookup_environment_history",
|
284
307
|
options: options
|
285
308
|
)
|
286
309
|
operation = ::Gapic::Rest::TransportOperation.new response
|
287
310
|
result = ::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryResponse.decode_json response.body, ignore_unknown_fields: true
|
288
|
-
|
289
|
-
|
290
|
-
|
311
|
+
catch :response do
|
312
|
+
yield result, operation if block_given?
|
313
|
+
result
|
314
|
+
end
|
291
315
|
end
|
292
316
|
|
293
317
|
##
|
@@ -316,16 +340,18 @@ module Google
|
|
316
340
|
|
317
341
|
response = @client_stub.make_http_request(
|
318
342
|
verb,
|
319
|
-
uri:
|
320
|
-
body:
|
321
|
-
params:
|
343
|
+
uri: uri,
|
344
|
+
body: body || "",
|
345
|
+
params: query_string_params,
|
346
|
+
method_name: "run_continuous_test",
|
322
347
|
options: options
|
323
348
|
)
|
324
349
|
operation = ::Gapic::Rest::TransportOperation.new response
|
325
350
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
326
|
-
|
327
|
-
|
328
|
-
|
351
|
+
catch :response do
|
352
|
+
yield result, operation if block_given?
|
353
|
+
result
|
354
|
+
end
|
329
355
|
end
|
330
356
|
|
331
357
|
##
|
@@ -354,16 +380,18 @@ module Google
|
|
354
380
|
|
355
381
|
response = @client_stub.make_http_request(
|
356
382
|
verb,
|
357
|
-
uri:
|
358
|
-
body:
|
359
|
-
params:
|
383
|
+
uri: uri,
|
384
|
+
body: body || "",
|
385
|
+
params: query_string_params,
|
386
|
+
method_name: "list_continuous_test_results",
|
360
387
|
options: options
|
361
388
|
)
|
362
389
|
operation = ::Gapic::Rest::TransportOperation.new response
|
363
390
|
result = ::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsResponse.decode_json response.body, ignore_unknown_fields: true
|
364
|
-
|
365
|
-
|
366
|
-
|
391
|
+
catch :response do
|
392
|
+
yield result, operation if block_given?
|
393
|
+
result
|
394
|
+
end
|
367
395
|
end
|
368
396
|
|
369
397
|
##
|
@@ -392,16 +420,18 @@ module Google
|
|
392
420
|
|
393
421
|
response = @client_stub.make_http_request(
|
394
422
|
verb,
|
395
|
-
uri:
|
396
|
-
body:
|
397
|
-
params:
|
423
|
+
uri: uri,
|
424
|
+
body: body || "",
|
425
|
+
params: query_string_params,
|
426
|
+
method_name: "deploy_flow",
|
398
427
|
options: options
|
399
428
|
)
|
400
429
|
operation = ::Gapic::Rest::TransportOperation.new response
|
401
430
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
402
|
-
|
403
|
-
|
404
|
-
|
431
|
+
catch :response do
|
432
|
+
yield result, operation if block_given?
|
433
|
+
result
|
434
|
+
end
|
405
435
|
end
|
406
436
|
|
407
437
|
##
|
@@ -164,14 +164,26 @@ module Google
|
|
164
164
|
universe_domain: @config.universe_domain,
|
165
165
|
channel_args: @config.channel_args,
|
166
166
|
interceptors: @config.interceptors,
|
167
|
-
channel_pool_config: @config.channel_pool
|
167
|
+
channel_pool_config: @config.channel_pool,
|
168
|
+
logger: @config.logger
|
168
169
|
)
|
169
170
|
|
171
|
+
@experiments_stub.stub_logger&.info do |entry|
|
172
|
+
entry.set_system_name
|
173
|
+
entry.set_service
|
174
|
+
entry.message = "Created client for #{entry.service}"
|
175
|
+
entry.set_credentials_fields credentials
|
176
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
177
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
178
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
179
|
+
end
|
180
|
+
|
170
181
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
171
182
|
config.credentials = credentials
|
172
183
|
config.quota_project = @quota_project_id
|
173
184
|
config.endpoint = @experiments_stub.endpoint
|
174
185
|
config.universe_domain = @experiments_stub.universe_domain
|
186
|
+
config.logger = @experiments_stub.logger if config.respond_to? :logger=
|
175
187
|
end
|
176
188
|
end
|
177
189
|
|
@@ -182,6 +194,15 @@ module Google
|
|
182
194
|
#
|
183
195
|
attr_reader :location_client
|
184
196
|
|
197
|
+
##
|
198
|
+
# The logger used for request/response debug logging.
|
199
|
+
#
|
200
|
+
# @return [Logger]
|
201
|
+
#
|
202
|
+
def logger
|
203
|
+
@experiments_stub.logger
|
204
|
+
end
|
205
|
+
|
185
206
|
# Service calls
|
186
207
|
|
187
208
|
##
|
@@ -277,7 +298,7 @@ module Google
|
|
277
298
|
@experiments_stub.call_rpc :list_experiments, request, options: options do |response, operation|
|
278
299
|
response = ::Gapic::PagedEnumerable.new @experiments_stub, :list_experiments, request, response, operation, options
|
279
300
|
yield response, operation if block_given?
|
280
|
-
|
301
|
+
throw :response, response
|
281
302
|
end
|
282
303
|
rescue ::GRPC::BadStatus => e
|
283
304
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -366,7 +387,6 @@ module Google
|
|
366
387
|
|
367
388
|
@experiments_stub.call_rpc :get_experiment, request, options: options do |response, operation|
|
368
389
|
yield response, operation if block_given?
|
369
|
-
return response
|
370
390
|
end
|
371
391
|
rescue ::GRPC::BadStatus => e
|
372
392
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -457,7 +477,6 @@ module Google
|
|
457
477
|
|
458
478
|
@experiments_stub.call_rpc :create_experiment, request, options: options do |response, operation|
|
459
479
|
yield response, operation if block_given?
|
460
|
-
return response
|
461
480
|
end
|
462
481
|
rescue ::GRPC::BadStatus => e
|
463
482
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -546,7 +565,6 @@ module Google
|
|
546
565
|
|
547
566
|
@experiments_stub.call_rpc :update_experiment, request, options: options do |response, operation|
|
548
567
|
yield response, operation if block_given?
|
549
|
-
return response
|
550
568
|
end
|
551
569
|
rescue ::GRPC::BadStatus => e
|
552
570
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -635,7 +653,6 @@ module Google
|
|
635
653
|
|
636
654
|
@experiments_stub.call_rpc :delete_experiment, request, options: options do |response, operation|
|
637
655
|
yield response, operation if block_given?
|
638
|
-
return response
|
639
656
|
end
|
640
657
|
rescue ::GRPC::BadStatus => e
|
641
658
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -725,7 +742,6 @@ module Google
|
|
725
742
|
|
726
743
|
@experiments_stub.call_rpc :start_experiment, request, options: options do |response, operation|
|
727
744
|
yield response, operation if block_given?
|
728
|
-
return response
|
729
745
|
end
|
730
746
|
rescue ::GRPC::BadStatus => e
|
731
747
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -814,7 +830,6 @@ module Google
|
|
814
830
|
|
815
831
|
@experiments_stub.call_rpc :stop_experiment, request, options: options do |response, operation|
|
816
832
|
yield response, operation if block_given?
|
817
|
-
return response
|
818
833
|
end
|
819
834
|
rescue ::GRPC::BadStatus => e
|
820
835
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -864,6 +879,13 @@ module Google
|
|
864
879
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
865
880
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
866
881
|
# * (`nil`) indicating no credentials
|
882
|
+
#
|
883
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
884
|
+
# external source for authentication to Google Cloud, you must validate it before
|
885
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
886
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
887
|
+
# For more information, refer to [Validate credential configurations from external
|
888
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
867
889
|
# @return [::Object]
|
868
890
|
# @!attribute [rw] scope
|
869
891
|
# The OAuth scopes
|
@@ -903,6 +925,11 @@ module Google
|
|
903
925
|
# default endpoint URL. The default value of nil uses the environment
|
904
926
|
# universe (usually the default "googleapis.com" universe).
|
905
927
|
# @return [::String,nil]
|
928
|
+
# @!attribute [rw] logger
|
929
|
+
# A custom logger to use for request/response debug logging, or the value
|
930
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
931
|
+
# explicitly disable logging.
|
932
|
+
# @return [::Logger,:default,nil]
|
906
933
|
#
|
907
934
|
class Configuration
|
908
935
|
extend ::Gapic::Config
|
@@ -927,6 +954,7 @@ module Google
|
|
927
954
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
928
955
|
config_attr :quota_project, nil, ::String, nil
|
929
956
|
config_attr :universe_domain, nil, ::String, nil
|
957
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
930
958
|
|
931
959
|
# @private
|
932
960
|
def initialize parent_config = nil
|
@@ -157,15 +157,27 @@ 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
|
)
|
162
163
|
|
164
|
+
@experiments_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
|
173
|
+
|
163
174
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
164
175
|
config.credentials = credentials
|
165
176
|
config.quota_project = @quota_project_id
|
166
177
|
config.endpoint = @experiments_stub.endpoint
|
167
178
|
config.universe_domain = @experiments_stub.universe_domain
|
168
179
|
config.bindings_override = @config.bindings_override
|
180
|
+
config.logger = @experiments_stub.logger if config.respond_to? :logger=
|
169
181
|
end
|
170
182
|
end
|
171
183
|
|
@@ -176,6 +188,15 @@ module Google
|
|
176
188
|
#
|
177
189
|
attr_reader :location_client
|
178
190
|
|
191
|
+
##
|
192
|
+
# The logger used for request/response debug logging.
|
193
|
+
#
|
194
|
+
# @return [Logger]
|
195
|
+
#
|
196
|
+
def logger
|
197
|
+
@experiments_stub.logger
|
198
|
+
end
|
199
|
+
|
179
200
|
# Service calls
|
180
201
|
|
181
202
|
##
|
@@ -264,7 +285,7 @@ module Google
|
|
264
285
|
@experiments_stub.list_experiments request, options do |result, operation|
|
265
286
|
result = ::Gapic::Rest::PagedEnumerable.new @experiments_stub, :list_experiments, "experiments", request, result, options
|
266
287
|
yield result, operation if block_given?
|
267
|
-
|
288
|
+
throw :response, result
|
268
289
|
end
|
269
290
|
rescue ::Gapic::Rest::Error => e
|
270
291
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -346,7 +367,6 @@ module Google
|
|
346
367
|
|
347
368
|
@experiments_stub.get_experiment request, options do |result, operation|
|
348
369
|
yield result, operation if block_given?
|
349
|
-
return result
|
350
370
|
end
|
351
371
|
rescue ::Gapic::Rest::Error => e
|
352
372
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -430,7 +450,6 @@ module Google
|
|
430
450
|
|
431
451
|
@experiments_stub.create_experiment request, options do |result, operation|
|
432
452
|
yield result, operation if block_given?
|
433
|
-
return result
|
434
453
|
end
|
435
454
|
rescue ::Gapic::Rest::Error => e
|
436
455
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -512,7 +531,6 @@ module Google
|
|
512
531
|
|
513
532
|
@experiments_stub.update_experiment request, options do |result, operation|
|
514
533
|
yield result, operation if block_given?
|
515
|
-
return result
|
516
534
|
end
|
517
535
|
rescue ::Gapic::Rest::Error => e
|
518
536
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -594,7 +612,6 @@ module Google
|
|
594
612
|
|
595
613
|
@experiments_stub.delete_experiment request, options do |result, operation|
|
596
614
|
yield result, operation if block_given?
|
597
|
-
return result
|
598
615
|
end
|
599
616
|
rescue ::Gapic::Rest::Error => e
|
600
617
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -677,7 +694,6 @@ module Google
|
|
677
694
|
|
678
695
|
@experiments_stub.start_experiment request, options do |result, operation|
|
679
696
|
yield result, operation if block_given?
|
680
|
-
return result
|
681
697
|
end
|
682
698
|
rescue ::Gapic::Rest::Error => e
|
683
699
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -759,7 +775,6 @@ module Google
|
|
759
775
|
|
760
776
|
@experiments_stub.stop_experiment request, options do |result, operation|
|
761
777
|
yield result, operation if block_given?
|
762
|
-
return result
|
763
778
|
end
|
764
779
|
rescue ::Gapic::Rest::Error => e
|
765
780
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -807,6 +822,13 @@ module Google
|
|
807
822
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
808
823
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
809
824
|
# * (`nil`) indicating no credentials
|
825
|
+
#
|
826
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
827
|
+
# external source for authentication to Google Cloud, you must validate it before
|
828
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
829
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
830
|
+
# For more information, refer to [Validate credential configurations from external
|
831
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
810
832
|
# @return [::Object]
|
811
833
|
# @!attribute [rw] scope
|
812
834
|
# The OAuth scopes
|
@@ -839,6 +861,11 @@ module Google
|
|
839
861
|
# default endpoint URL. The default value of nil uses the environment
|
840
862
|
# universe (usually the default "googleapis.com" universe).
|
841
863
|
# @return [::String,nil]
|
864
|
+
# @!attribute [rw] logger
|
865
|
+
# A custom logger to use for request/response debug logging, or the value
|
866
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
867
|
+
# explicitly disable logging.
|
868
|
+
# @return [::Logger,:default,nil]
|
842
869
|
#
|
843
870
|
class Configuration
|
844
871
|
extend ::Gapic::Config
|
@@ -867,6 +894,7 @@ module Google
|
|
867
894
|
# by the host service.
|
868
895
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
869
896
|
config_attr :bindings_override, {}, ::Hash, nil
|
897
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
870
898
|
|
871
899
|
# @private
|
872
900
|
def initialize parent_config = nil
|