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.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -21
  3. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +44 -12
  4. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +19 -15
  5. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +44 -12
  6. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +50 -38
  7. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +102 -68
  8. data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +36 -3
  9. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +36 -3
  10. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +30 -14
  11. data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +36 -3
  12. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +36 -3
  13. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +30 -14
  14. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +46 -8
  15. data/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb +19 -15
  16. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +46 -8
  17. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb +50 -38
  18. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +70 -44
  19. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +42 -10
  20. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +19 -15
  21. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +42 -10
  22. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +50 -38
  23. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +86 -56
  24. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +36 -8
  25. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +36 -8
  26. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +70 -44
  27. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +43 -11
  28. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +19 -15
  29. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +43 -11
  30. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +50 -38
  31. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +94 -62
  32. data/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +36 -6
  33. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +36 -6
  34. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +54 -32
  35. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +46 -8
  36. data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +19 -15
  37. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +46 -8
  38. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +50 -38
  39. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +70 -44
  40. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +36 -6
  41. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +36 -6
  42. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +54 -32
  43. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +36 -6
  44. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +36 -6
  45. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +54 -32
  46. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +36 -6
  47. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +36 -6
  48. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +54 -32
  49. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +35 -7
  50. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +35 -5
  51. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +47 -26
  52. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +45 -13
  53. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +19 -15
  54. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +45 -13
  55. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +50 -38
  56. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +110 -74
  57. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +36 -6
  58. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +36 -6
  59. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +54 -32
  60. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  61. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +38 -8
  62. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +19 -15
  63. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +38 -8
  64. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +50 -38
  65. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +70 -44
  66. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +36 -6
  67. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +36 -6
  68. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +54 -32
  69. data/proto_docs/google/api/client.rb +19 -0
  70. data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +12 -0
  71. data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +12 -0
  72. data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +4 -0
  73. data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +8 -0
  74. data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +4 -0
  75. data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +12 -0
  76. data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +12 -0
  77. data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +28 -0
  78. data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +4 -0
  79. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +32 -0
  80. data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +22 -0
  81. data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +18 -0
  82. data/proto_docs/google/longrunning/operations.rb +23 -14
  83. data/proto_docs/google/protobuf/struct.rb +12 -0
  84. 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
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
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
- raise_faraday_errors: false
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_test_cases 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: uri,
92
- body: body || "",
93
- params: query_string_params,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "list_test_cases",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCasesResponse.decode_json response.body, ignore_unknown_fields: true
98
-
99
- yield result, operation if block_given?
100
- result
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: uri,
130
- body: body || "",
131
- params: query_string_params,
143
+ uri: uri,
144
+ body: body || "",
145
+ params: query_string_params,
146
+ method_name: "batch_delete_test_cases",
132
147
  options: options
133
148
  )
134
149
  operation = ::Gapic::Rest::TransportOperation.new response
135
150
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
136
-
137
- yield result, operation if block_given?
138
- result
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: uri,
168
- body: body || "",
169
- params: query_string_params,
183
+ uri: uri,
184
+ body: body || "",
185
+ params: query_string_params,
186
+ method_name: "get_test_case",
170
187
  options: options
171
188
  )
172
189
  operation = ::Gapic::Rest::TransportOperation.new response
173
190
  result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.decode_json response.body, ignore_unknown_fields: true
174
-
175
- yield result, operation if block_given?
176
- result
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: uri,
206
- body: body || "",
207
- params: query_string_params,
223
+ uri: uri,
224
+ body: body || "",
225
+ params: query_string_params,
226
+ method_name: "create_test_case",
208
227
  options: options
209
228
  )
210
229
  operation = ::Gapic::Rest::TransportOperation.new response
211
230
  result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.decode_json response.body, ignore_unknown_fields: true
212
-
213
- yield result, operation if block_given?
214
- result
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: uri,
244
- body: body || "",
245
- params: query_string_params,
263
+ uri: uri,
264
+ body: body || "",
265
+ params: query_string_params,
266
+ method_name: "update_test_case",
246
267
  options: options
247
268
  )
248
269
  operation = ::Gapic::Rest::TransportOperation.new response
249
270
  result = ::Google::Cloud::Dialogflow::CX::V3::TestCase.decode_json response.body, ignore_unknown_fields: true
250
-
251
- yield result, operation if block_given?
252
- result
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: uri,
282
- body: body || "",
283
- params: query_string_params,
303
+ uri: uri,
304
+ body: body || "",
305
+ params: query_string_params,
306
+ method_name: "run_test_case",
284
307
  options: options
285
308
  )
286
309
  operation = ::Gapic::Rest::TransportOperation.new response
287
310
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
288
-
289
- yield result, operation if block_given?
290
- result
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: uri,
320
- body: body || "",
321
- params: query_string_params,
343
+ uri: uri,
344
+ body: body || "",
345
+ params: query_string_params,
346
+ method_name: "batch_run_test_cases",
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
- yield result, operation if block_given?
328
- result
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: uri,
358
- body: body || "",
359
- params: query_string_params,
383
+ uri: uri,
384
+ body: body || "",
385
+ params: query_string_params,
386
+ method_name: "calculate_coverage",
360
387
  options: options
361
388
  )
362
389
  operation = ::Gapic::Rest::TransportOperation.new response
363
390
  result = ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse.decode_json response.body, ignore_unknown_fields: true
364
-
365
- yield result, operation if block_given?
366
- result
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: uri,
396
- body: body || "",
397
- params: query_string_params,
423
+ uri: uri,
424
+ body: body || "",
425
+ params: query_string_params,
426
+ method_name: "import_test_cases",
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
- yield result, operation if block_given?
404
- result
431
+ catch :response do
432
+ yield result, operation if block_given?
433
+ result
434
+ end
405
435
  end
406
436
 
407
437
  ##
@@ -430,16 +460,18 @@ module Google
430
460
 
431
461
  response = @client_stub.make_http_request(
432
462
  verb,
433
- uri: uri,
434
- body: body || "",
435
- params: query_string_params,
463
+ uri: uri,
464
+ body: body || "",
465
+ params: query_string_params,
466
+ method_name: "export_test_cases",
436
467
  options: options
437
468
  )
438
469
  operation = ::Gapic::Rest::TransportOperation.new response
439
470
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
440
-
441
- yield result, operation if block_given?
442
- result
471
+ catch :response do
472
+ yield result, operation if block_given?
473
+ result
474
+ end
443
475
  end
444
476
 
445
477
  ##
@@ -468,16 +500,18 @@ module Google
468
500
 
469
501
  response = @client_stub.make_http_request(
470
502
  verb,
471
- uri: uri,
472
- body: body || "",
473
- params: query_string_params,
503
+ uri: uri,
504
+ body: body || "",
505
+ params: query_string_params,
506
+ method_name: "list_test_case_results",
474
507
  options: options
475
508
  )
476
509
  operation = ::Gapic::Rest::TransportOperation.new response
477
510
  result = ::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsResponse.decode_json response.body, ignore_unknown_fields: true
478
-
479
- yield result, operation if block_given?
480
- result
511
+ catch :response do
512
+ yield result, operation if block_given?
513
+ result
514
+ end
481
515
  end
482
516
 
483
517
  ##
@@ -506,16 +540,18 @@ module Google
506
540
 
507
541
  response = @client_stub.make_http_request(
508
542
  verb,
509
- uri: uri,
510
- body: body || "",
511
- params: query_string_params,
543
+ uri: uri,
544
+ body: body || "",
545
+ params: query_string_params,
546
+ method_name: "get_test_case_result",
512
547
  options: options
513
548
  )
514
549
  operation = ::Gapic::Rest::TransportOperation.new response
515
550
  result = ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult.decode_json response.body, ignore_unknown_fields: true
516
-
517
- yield result, operation if block_given?
518
- result
551
+ catch :response do
552
+ yield result, operation if block_given?
553
+ result
554
+ end
519
555
  end
520
556
 
521
557
  ##
@@ -165,14 +165,26 @@ module Google
165
165
  universe_domain: @config.universe_domain,
166
166
  channel_args: @config.channel_args,
167
167
  interceptors: @config.interceptors,
168
- channel_pool_config: @config.channel_pool
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
169
170
  )
170
171
 
172
+ @transition_route_groups_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+
171
182
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
172
183
  config.credentials = credentials
173
184
  config.quota_project = @quota_project_id
174
185
  config.endpoint = @transition_route_groups_stub.endpoint
175
186
  config.universe_domain = @transition_route_groups_stub.universe_domain
187
+ config.logger = @transition_route_groups_stub.logger if config.respond_to? :logger=
176
188
  end
177
189
  end
178
190
 
@@ -183,6 +195,15 @@ module Google
183
195
  #
184
196
  attr_reader :location_client
185
197
 
198
+ ##
199
+ # The logger used for request/response debug logging.
200
+ #
201
+ # @return [Logger]
202
+ #
203
+ def logger
204
+ @transition_route_groups_stub.logger
205
+ end
206
+
186
207
  # Service calls
187
208
 
188
209
  ##
@@ -291,7 +312,7 @@ module Google
291
312
  @transition_route_groups_stub.call_rpc :list_transition_route_groups, request, options: options do |response, operation|
292
313
  response = ::Gapic::PagedEnumerable.new @transition_route_groups_stub, :list_transition_route_groups, request, response, operation, options
293
314
  yield response, operation if block_given?
294
- return response
315
+ throw :response, response
295
316
  end
296
317
  rescue ::GRPC::BadStatus => e
297
318
  raise ::Google::Cloud::Error.from_error(e)
@@ -396,7 +417,6 @@ module Google
396
417
 
397
418
  @transition_route_groups_stub.call_rpc :get_transition_route_group, request, options: options do |response, operation|
398
419
  yield response, operation if block_given?
399
- return response
400
420
  end
401
421
  rescue ::GRPC::BadStatus => e
402
422
  raise ::Google::Cloud::Error.from_error(e)
@@ -507,7 +527,6 @@ module Google
507
527
 
508
528
  @transition_route_groups_stub.call_rpc :create_transition_route_group, request, options: options do |response, operation|
509
529
  yield response, operation if block_given?
510
- return response
511
530
  end
512
531
  rescue ::GRPC::BadStatus => e
513
532
  raise ::Google::Cloud::Error.from_error(e)
@@ -612,7 +631,6 @@ module Google
612
631
 
613
632
  @transition_route_groups_stub.call_rpc :update_transition_route_group, request, options: options do |response, operation|
614
633
  yield response, operation if block_given?
615
- return response
616
634
  end
617
635
  rescue ::GRPC::BadStatus => e
618
636
  raise ::Google::Cloud::Error.from_error(e)
@@ -716,7 +734,6 @@ module Google
716
734
 
717
735
  @transition_route_groups_stub.call_rpc :delete_transition_route_group, request, options: options do |response, operation|
718
736
  yield response, operation if block_given?
719
- return response
720
737
  end
721
738
  rescue ::GRPC::BadStatus => e
722
739
  raise ::Google::Cloud::Error.from_error(e)
@@ -766,6 +783,13 @@ module Google
766
783
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
767
784
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
768
785
  # * (`nil`) indicating no credentials
786
+ #
787
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
788
+ # external source for authentication to Google Cloud, you must validate it before
789
+ # providing it to a Google API client library. Providing an unvalidated credential
790
+ # configuration to Google APIs can compromise the security of your systems and data.
791
+ # For more information, refer to [Validate credential configurations from external
792
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
769
793
  # @return [::Object]
770
794
  # @!attribute [rw] scope
771
795
  # The OAuth scopes
@@ -805,6 +829,11 @@ module Google
805
829
  # default endpoint URL. The default value of nil uses the environment
806
830
  # universe (usually the default "googleapis.com" universe).
807
831
  # @return [::String,nil]
832
+ # @!attribute [rw] logger
833
+ # A custom logger to use for request/response debug logging, or the value
834
+ # `:default` (the default) to construct a default logger, or `nil` to
835
+ # explicitly disable logging.
836
+ # @return [::Logger,:default,nil]
808
837
  #
809
838
  class Configuration
810
839
  extend ::Gapic::Config
@@ -829,6 +858,7 @@ module Google
829
858
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
830
859
  config_attr :quota_project, nil, ::String, nil
831
860
  config_attr :universe_domain, nil, ::String, nil
861
+ config_attr :logger, :default, ::Logger, nil, :default
832
862
 
833
863
  # @private
834
864
  def initialize parent_config = nil
@@ -158,15 +158,27 @@ module Google
158
158
  endpoint: @config.endpoint,
159
159
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
160
  universe_domain: @config.universe_domain,
161
- credentials: credentials
161
+ credentials: credentials,
162
+ logger: @config.logger
162
163
  )
163
164
 
165
+ @transition_route_groups_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
164
175
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
165
176
  config.credentials = credentials
166
177
  config.quota_project = @quota_project_id
167
178
  config.endpoint = @transition_route_groups_stub.endpoint
168
179
  config.universe_domain = @transition_route_groups_stub.universe_domain
169
180
  config.bindings_override = @config.bindings_override
181
+ config.logger = @transition_route_groups_stub.logger if config.respond_to? :logger=
170
182
  end
171
183
  end
172
184
 
@@ -177,6 +189,15 @@ module Google
177
189
  #
178
190
  attr_reader :location_client
179
191
 
192
+ ##
193
+ # The logger used for request/response debug logging.
194
+ #
195
+ # @return [Logger]
196
+ #
197
+ def logger
198
+ @transition_route_groups_stub.logger
199
+ end
200
+
180
201
  # Service calls
181
202
 
182
203
  ##
@@ -278,7 +299,7 @@ module Google
278
299
  @transition_route_groups_stub.list_transition_route_groups request, options do |result, operation|
279
300
  result = ::Gapic::Rest::PagedEnumerable.new @transition_route_groups_stub, :list_transition_route_groups, "transition_route_groups", request, result, options
280
301
  yield result, operation if block_given?
281
- return result
302
+ throw :response, result
282
303
  end
283
304
  rescue ::Gapic::Rest::Error => e
284
305
  raise ::Google::Cloud::Error.from_error(e)
@@ -376,7 +397,6 @@ module Google
376
397
 
377
398
  @transition_route_groups_stub.get_transition_route_group request, options do |result, operation|
378
399
  yield result, operation if block_given?
379
- return result
380
400
  end
381
401
  rescue ::Gapic::Rest::Error => e
382
402
  raise ::Google::Cloud::Error.from_error(e)
@@ -480,7 +500,6 @@ module Google
480
500
 
481
501
  @transition_route_groups_stub.create_transition_route_group request, options do |result, operation|
482
502
  yield result, operation if block_given?
483
- return result
484
503
  end
485
504
  rescue ::Gapic::Rest::Error => e
486
505
  raise ::Google::Cloud::Error.from_error(e)
@@ -578,7 +597,6 @@ module Google
578
597
 
579
598
  @transition_route_groups_stub.update_transition_route_group request, options do |result, operation|
580
599
  yield result, operation if block_given?
581
- return result
582
600
  end
583
601
  rescue ::Gapic::Rest::Error => e
584
602
  raise ::Google::Cloud::Error.from_error(e)
@@ -675,7 +693,6 @@ module Google
675
693
 
676
694
  @transition_route_groups_stub.delete_transition_route_group request, options do |result, operation|
677
695
  yield result, operation if block_given?
678
- return result
679
696
  end
680
697
  rescue ::Gapic::Rest::Error => e
681
698
  raise ::Google::Cloud::Error.from_error(e)
@@ -723,6 +740,13 @@ module Google
723
740
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
724
741
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
725
742
  # * (`nil`) indicating no credentials
743
+ #
744
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
745
+ # external source for authentication to Google Cloud, you must validate it before
746
+ # providing it to a Google API client library. Providing an unvalidated credential
747
+ # configuration to Google APIs can compromise the security of your systems and data.
748
+ # For more information, refer to [Validate credential configurations from external
749
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
726
750
  # @return [::Object]
727
751
  # @!attribute [rw] scope
728
752
  # The OAuth scopes
@@ -755,6 +779,11 @@ module Google
755
779
  # default endpoint URL. The default value of nil uses the environment
756
780
  # universe (usually the default "googleapis.com" universe).
757
781
  # @return [::String,nil]
782
+ # @!attribute [rw] logger
783
+ # A custom logger to use for request/response debug logging, or the value
784
+ # `:default` (the default) to construct a default logger, or `nil` to
785
+ # explicitly disable logging.
786
+ # @return [::Logger,:default,nil]
758
787
  #
759
788
  class Configuration
760
789
  extend ::Gapic::Config
@@ -783,6 +812,7 @@ module Google
783
812
  # by the host service.
784
813
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
785
814
  config_attr :bindings_override, {}, ::Hash, nil
815
+ config_attr :logger, :default, ::Logger, nil, :default
786
816
 
787
817
  # @private
788
818
  def initialize parent_config = nil