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
@@ -172,14 +172,26 @@ module Google
172
172
  universe_domain: @config.universe_domain,
173
173
  channel_args: @config.channel_args,
174
174
  interceptors: @config.interceptors,
175
- channel_pool_config: @config.channel_pool
175
+ channel_pool_config: @config.channel_pool,
176
+ logger: @config.logger
176
177
  )
177
178
 
179
+ @environments_stub.stub_logger&.info do |entry|
180
+ entry.set_system_name
181
+ entry.set_service
182
+ entry.message = "Created client for #{entry.service}"
183
+ entry.set_credentials_fields credentials
184
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
185
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
186
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
187
+ end
188
+
178
189
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
179
190
  config.credentials = credentials
180
191
  config.quota_project = @quota_project_id
181
192
  config.endpoint = @environments_stub.endpoint
182
193
  config.universe_domain = @environments_stub.universe_domain
194
+ config.logger = @environments_stub.logger if config.respond_to? :logger=
183
195
  end
184
196
  end
185
197
 
@@ -197,6 +209,15 @@ module Google
197
209
  #
198
210
  attr_reader :location_client
199
211
 
212
+ ##
213
+ # The logger used for request/response debug logging.
214
+ #
215
+ # @return [Logger]
216
+ #
217
+ def logger
218
+ @environments_stub.logger
219
+ end
220
+
200
221
  # Service calls
201
222
 
202
223
  ##
@@ -292,7 +313,7 @@ module Google
292
313
  @environments_stub.call_rpc :list_environments, request, options: options do |response, operation|
293
314
  response = ::Gapic::PagedEnumerable.new @environments_stub, :list_environments, request, response, operation, options
294
315
  yield response, operation if block_given?
295
- return response
316
+ throw :response, response
296
317
  end
297
318
  rescue ::GRPC::BadStatus => e
298
319
  raise ::Google::Cloud::Error.from_error(e)
@@ -381,7 +402,6 @@ module Google
381
402
 
382
403
  @environments_stub.call_rpc :get_environment, request, options: options do |response, operation|
383
404
  yield response, operation if block_given?
384
- return response
385
405
  end
386
406
  rescue ::GRPC::BadStatus => e
387
407
  raise ::Google::Cloud::Error.from_error(e)
@@ -488,7 +508,7 @@ module Google
488
508
  @environments_stub.call_rpc :create_environment, request, options: options do |response, operation|
489
509
  response = ::Gapic::Operation.new response, @operations_client, options: options
490
510
  yield response, operation if block_given?
491
- return response
511
+ throw :response, response
492
512
  end
493
513
  rescue ::GRPC::BadStatus => e
494
514
  raise ::Google::Cloud::Error.from_error(e)
@@ -593,7 +613,7 @@ module Google
593
613
  @environments_stub.call_rpc :update_environment, request, options: options do |response, operation|
594
614
  response = ::Gapic::Operation.new response, @operations_client, options: options
595
615
  yield response, operation if block_given?
596
- return response
616
+ throw :response, response
597
617
  end
598
618
  rescue ::GRPC::BadStatus => e
599
619
  raise ::Google::Cloud::Error.from_error(e)
@@ -682,7 +702,6 @@ module Google
682
702
 
683
703
  @environments_stub.call_rpc :delete_environment, request, options: options do |response, operation|
684
704
  yield response, operation if block_given?
685
- return response
686
705
  end
687
706
  rescue ::GRPC::BadStatus => e
688
707
  raise ::Google::Cloud::Error.from_error(e)
@@ -781,7 +800,7 @@ module Google
781
800
  @environments_stub.call_rpc :lookup_environment_history, request, options: options do |response, operation|
782
801
  response = ::Gapic::PagedEnumerable.new @environments_stub, :lookup_environment_history, request, response, operation, options
783
802
  yield response, operation if block_given?
784
- return response
803
+ throw :response, response
785
804
  end
786
805
  rescue ::GRPC::BadStatus => e
787
806
  raise ::Google::Cloud::Error.from_error(e)
@@ -886,7 +905,7 @@ module Google
886
905
  @environments_stub.call_rpc :run_continuous_test, request, options: options do |response, operation|
887
906
  response = ::Gapic::Operation.new response, @operations_client, options: options
888
907
  yield response, operation if block_given?
889
- return response
908
+ throw :response, response
890
909
  end
891
910
  rescue ::GRPC::BadStatus => e
892
911
  raise ::Google::Cloud::Error.from_error(e)
@@ -984,7 +1003,7 @@ module Google
984
1003
  @environments_stub.call_rpc :list_continuous_test_results, request, options: options do |response, operation|
985
1004
  response = ::Gapic::PagedEnumerable.new @environments_stub, :list_continuous_test_results, request, response, operation, options
986
1005
  yield response, operation if block_given?
987
- return response
1006
+ throw :response, response
988
1007
  end
989
1008
  rescue ::GRPC::BadStatus => e
990
1009
  raise ::Google::Cloud::Error.from_error(e)
@@ -1094,7 +1113,7 @@ module Google
1094
1113
  @environments_stub.call_rpc :deploy_flow, request, options: options do |response, operation|
1095
1114
  response = ::Gapic::Operation.new response, @operations_client, options: options
1096
1115
  yield response, operation if block_given?
1097
- return response
1116
+ throw :response, response
1098
1117
  end
1099
1118
  rescue ::GRPC::BadStatus => e
1100
1119
  raise ::Google::Cloud::Error.from_error(e)
@@ -1144,6 +1163,13 @@ module Google
1144
1163
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1145
1164
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1146
1165
  # * (`nil`) indicating no credentials
1166
+ #
1167
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1168
+ # external source for authentication to Google Cloud, you must validate it before
1169
+ # providing it to a Google API client library. Providing an unvalidated credential
1170
+ # configuration to Google APIs can compromise the security of your systems and data.
1171
+ # For more information, refer to [Validate credential configurations from external
1172
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1147
1173
  # @return [::Object]
1148
1174
  # @!attribute [rw] scope
1149
1175
  # The OAuth scopes
@@ -1183,6 +1209,11 @@ module Google
1183
1209
  # default endpoint URL. The default value of nil uses the environment
1184
1210
  # universe (usually the default "googleapis.com" universe).
1185
1211
  # @return [::String,nil]
1212
+ # @!attribute [rw] logger
1213
+ # A custom logger to use for request/response debug logging, or the value
1214
+ # `:default` (the default) to construct a default logger, or `nil` to
1215
+ # explicitly disable logging.
1216
+ # @return [::Logger,:default,nil]
1186
1217
  #
1187
1218
  class Configuration
1188
1219
  extend ::Gapic::Config
@@ -1207,6 +1238,7 @@ module Google
1207
1238
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1208
1239
  config_attr :quota_project, nil, ::String, nil
1209
1240
  config_attr :universe_domain, nil, ::String, nil
1241
+ config_attr :logger, :default, ::Logger, nil, :default
1210
1242
 
1211
1243
  # @private
1212
1244
  def initialize parent_config = nil
@@ -125,14 +125,6 @@ module Google
125
125
  # Lists operations that match the specified filter in the request. If the
126
126
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
127
127
  #
128
- # NOTE: the `name` binding allows API services to override the binding
129
- # to use different resource name schemes, such as `users/*/operations`. To
130
- # override the binding, API services can add a binding such as
131
- # `"/v1/{name=users/*}/operations"` to their service configuration.
132
- # For backwards compatibility, the default name includes the operations
133
- # collection id, however overriding users must ensure the name binding
134
- # is the parent resource, without the operations collection id.
135
- #
136
128
  # @overload list_operations(request, options = nil)
137
129
  # Pass arguments to `list_operations` via a request object, either of type
138
130
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -222,7 +214,7 @@ module Google
222
214
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
223
215
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
224
216
  yield response, operation if block_given?
225
- return response
217
+ throw :response, response
226
218
  end
227
219
  rescue ::GRPC::BadStatus => e
228
220
  raise ::Google::Cloud::Error.from_error(e)
@@ -318,7 +310,7 @@ module Google
318
310
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
319
311
  response = ::Gapic::Operation.new response, @operations_client, options: options
320
312
  yield response, operation if block_given?
321
- return response
313
+ throw :response, response
322
314
  end
323
315
  rescue ::GRPC::BadStatus => e
324
316
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +399,6 @@ module Google
407
399
 
408
400
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
409
401
  yield response, operation if block_given?
410
- return response
411
402
  end
412
403
  rescue ::GRPC::BadStatus => e
413
404
  raise ::Google::Cloud::Error.from_error(e)
@@ -422,8 +413,9 @@ module Google
422
413
  # other methods to check whether the cancellation succeeded or whether the
423
414
  # operation completed despite cancellation. On successful cancellation,
424
415
  # the operation is not deleted; instead, it becomes an operation with
425
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
426
- # corresponding to `Code.CANCELLED`.
416
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
417
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
418
+ # `Code.CANCELLED`.
427
419
  #
428
420
  # @overload cancel_operation(request, options = nil)
429
421
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -502,7 +494,6 @@ module Google
502
494
 
503
495
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
504
496
  yield response, operation if block_given?
505
- return response
506
497
  end
507
498
  rescue ::GRPC::BadStatus => e
508
499
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +591,7 @@ module Google
600
591
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
601
592
  response = ::Gapic::Operation.new response, @operations_client, options: options
602
593
  yield response, operation if block_given?
603
- return response
594
+ throw :response, response
604
595
  end
605
596
  rescue ::GRPC::BadStatus => e
606
597
  raise ::Google::Cloud::Error.from_error(e)
@@ -650,6 +641,13 @@ module Google
650
641
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
651
642
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
652
643
  # * (`nil`) indicating no credentials
644
+ #
645
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
646
+ # external source for authentication to Google Cloud, you must validate it before
647
+ # providing it to a Google API client library. Providing an unvalidated credential
648
+ # configuration to Google APIs can compromise the security of your systems and data.
649
+ # For more information, refer to [Validate credential configurations from external
650
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
653
651
  # @return [::Object]
654
652
  # @!attribute [rw] scope
655
653
  # The OAuth scopes
@@ -689,6 +687,11 @@ module Google
689
687
  # default endpoint URL. The default value of nil uses the environment
690
688
  # universe (usually the default "googleapis.com" universe).
691
689
  # @return [::String,nil]
690
+ # @!attribute [rw] logger
691
+ # A custom logger to use for request/response debug logging, or the value
692
+ # `:default` (the default) to construct a default logger, or `nil` to
693
+ # explicitly disable logging.
694
+ # @return [::Logger,:default,nil]
692
695
  #
693
696
  class Configuration
694
697
  extend ::Gapic::Config
@@ -713,6 +716,7 @@ module Google
713
716
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
714
717
  config_attr :quota_project, nil, ::String, nil
715
718
  config_attr :universe_domain, nil, ::String, nil
719
+ config_attr :logger, :default, ::Logger, nil, :default
716
720
 
717
721
  # @private
718
722
  def initialize parent_config = nil
@@ -165,15 +165,27 @@ module Google
165
165
  endpoint: @config.endpoint,
166
166
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
167
167
  universe_domain: @config.universe_domain,
168
- credentials: credentials
168
+ credentials: credentials,
169
+ logger: @config.logger
169
170
  )
170
171
 
172
+ @environments_stub.logger(stub: true)&.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::Rest::Client.new do |config|
172
183
  config.credentials = credentials
173
184
  config.quota_project = @quota_project_id
174
185
  config.endpoint = @environments_stub.endpoint
175
186
  config.universe_domain = @environments_stub.universe_domain
176
187
  config.bindings_override = @config.bindings_override
188
+ config.logger = @environments_stub.logger if config.respond_to? :logger=
177
189
  end
178
190
  end
179
191
 
@@ -191,6 +203,15 @@ module Google
191
203
  #
192
204
  attr_reader :location_client
193
205
 
206
+ ##
207
+ # The logger used for request/response debug logging.
208
+ #
209
+ # @return [Logger]
210
+ #
211
+ def logger
212
+ @environments_stub.logger
213
+ end
214
+
194
215
  # Service calls
195
216
 
196
217
  ##
@@ -279,7 +300,7 @@ module Google
279
300
  @environments_stub.list_environments request, options do |result, operation|
280
301
  result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :list_environments, "environments", request, result, options
281
302
  yield result, operation if block_given?
282
- return result
303
+ throw :response, result
283
304
  end
284
305
  rescue ::Gapic::Rest::Error => e
285
306
  raise ::Google::Cloud::Error.from_error(e)
@@ -361,7 +382,6 @@ module Google
361
382
 
362
383
  @environments_stub.get_environment request, options do |result, operation|
363
384
  yield result, operation if block_given?
364
- return result
365
385
  end
366
386
  rescue ::Gapic::Rest::Error => e
367
387
  raise ::Google::Cloud::Error.from_error(e)
@@ -461,7 +481,7 @@ module Google
461
481
  @environments_stub.create_environment request, options do |result, operation|
462
482
  result = ::Gapic::Operation.new result, @operations_client, options: options
463
483
  yield result, operation if block_given?
464
- return result
484
+ throw :response, result
465
485
  end
466
486
  rescue ::Gapic::Rest::Error => e
467
487
  raise ::Google::Cloud::Error.from_error(e)
@@ -559,7 +579,7 @@ module Google
559
579
  @environments_stub.update_environment request, options do |result, operation|
560
580
  result = ::Gapic::Operation.new result, @operations_client, options: options
561
581
  yield result, operation if block_given?
562
- return result
582
+ throw :response, result
563
583
  end
564
584
  rescue ::Gapic::Rest::Error => e
565
585
  raise ::Google::Cloud::Error.from_error(e)
@@ -641,7 +661,6 @@ module Google
641
661
 
642
662
  @environments_stub.delete_environment request, options do |result, operation|
643
663
  yield result, operation if block_given?
644
- return result
645
664
  end
646
665
  rescue ::Gapic::Rest::Error => e
647
666
  raise ::Google::Cloud::Error.from_error(e)
@@ -733,7 +752,7 @@ module Google
733
752
  @environments_stub.lookup_environment_history request, options do |result, operation|
734
753
  result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :lookup_environment_history, "environments", request, result, options
735
754
  yield result, operation if block_given?
736
- return result
755
+ throw :response, result
737
756
  end
738
757
  rescue ::Gapic::Rest::Error => e
739
758
  raise ::Google::Cloud::Error.from_error(e)
@@ -831,7 +850,7 @@ module Google
831
850
  @environments_stub.run_continuous_test request, options do |result, operation|
832
851
  result = ::Gapic::Operation.new result, @operations_client, options: options
833
852
  yield result, operation if block_given?
834
- return result
853
+ throw :response, result
835
854
  end
836
855
  rescue ::Gapic::Rest::Error => e
837
856
  raise ::Google::Cloud::Error.from_error(e)
@@ -922,7 +941,7 @@ module Google
922
941
  @environments_stub.list_continuous_test_results request, options do |result, operation|
923
942
  result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :list_continuous_test_results, "continuous_test_results", request, result, options
924
943
  yield result, operation if block_given?
925
- return result
944
+ throw :response, result
926
945
  end
927
946
  rescue ::Gapic::Rest::Error => e
928
947
  raise ::Google::Cloud::Error.from_error(e)
@@ -1025,7 +1044,7 @@ module Google
1025
1044
  @environments_stub.deploy_flow request, options do |result, operation|
1026
1045
  result = ::Gapic::Operation.new result, @operations_client, options: options
1027
1046
  yield result, operation if block_given?
1028
- return result
1047
+ throw :response, result
1029
1048
  end
1030
1049
  rescue ::Gapic::Rest::Error => e
1031
1050
  raise ::Google::Cloud::Error.from_error(e)
@@ -1073,6 +1092,13 @@ module Google
1073
1092
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1074
1093
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1075
1094
  # * (`nil`) indicating no credentials
1095
+ #
1096
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1097
+ # external source for authentication to Google Cloud, you must validate it before
1098
+ # providing it to a Google API client library. Providing an unvalidated credential
1099
+ # configuration to Google APIs can compromise the security of your systems and data.
1100
+ # For more information, refer to [Validate credential configurations from external
1101
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1076
1102
  # @return [::Object]
1077
1103
  # @!attribute [rw] scope
1078
1104
  # The OAuth scopes
@@ -1105,6 +1131,11 @@ module Google
1105
1131
  # default endpoint URL. The default value of nil uses the environment
1106
1132
  # universe (usually the default "googleapis.com" universe).
1107
1133
  # @return [::String,nil]
1134
+ # @!attribute [rw] logger
1135
+ # A custom logger to use for request/response debug logging, or the value
1136
+ # `:default` (the default) to construct a default logger, or `nil` to
1137
+ # explicitly disable logging.
1138
+ # @return [::Logger,:default,nil]
1108
1139
  #
1109
1140
  class Configuration
1110
1141
  extend ::Gapic::Config
@@ -1133,6 +1164,7 @@ module Google
1133
1164
  # by the host service.
1134
1165
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1135
1166
  config_attr :bindings_override, {}, ::Hash, nil
1167
+ config_attr :logger, :default, ::Logger, nil, :default
1136
1168
 
1137
1169
  # @private
1138
1170
  def initialize parent_config = nil
@@ -116,14 +116,6 @@ module Google
116
116
  # Lists operations that match the specified filter in the request. If the
117
117
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
118
118
  #
119
- # NOTE: the `name` binding allows API services to override the binding
120
- # to use different resource name schemes, such as `users/*/operations`. To
121
- # override the binding, API services can add a binding such as
122
- # `"/v1/{name=users/*}/operations"` to their service configuration.
123
- # For backwards compatibility, the default name includes the operations
124
- # collection id, however overriding users must ensure the name binding
125
- # is the parent resource, without the operations collection id.
126
- #
127
119
  # @overload list_operations(request, options = nil)
128
120
  # Pass arguments to `list_operations` via a request object, either of type
129
121
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -205,7 +197,7 @@ module Google
205
197
  @operations_stub.list_operations request, options do |result, operation|
206
198
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
207
199
  yield result, operation if block_given?
208
- return result
200
+ throw :response, result
209
201
  end
210
202
  rescue ::Gapic::Rest::Error => e
211
203
  raise ::Google::Cloud::Error.from_error(e)
@@ -294,7 +286,7 @@ module Google
294
286
  @operations_stub.get_operation request, options do |result, operation|
295
287
  result = ::Gapic::Operation.new result, @operations_client, options: options
296
288
  yield result, operation if block_given?
297
- return result
289
+ throw :response, result
298
290
  end
299
291
  rescue ::Gapic::Rest::Error => e
300
292
  raise ::Google::Cloud::Error.from_error(e)
@@ -376,7 +368,6 @@ module Google
376
368
 
377
369
  @operations_stub.delete_operation request, options do |result, operation|
378
370
  yield result, operation if block_given?
379
- return result
380
371
  end
381
372
  rescue ::Gapic::Rest::Error => e
382
373
  raise ::Google::Cloud::Error.from_error(e)
@@ -391,8 +382,9 @@ module Google
391
382
  # other methods to check whether the cancellation succeeded or whether the
392
383
  # operation completed despite cancellation. On successful cancellation,
393
384
  # the operation is not deleted; instead, it becomes an operation with
394
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
395
- # corresponding to `Code.CANCELLED`.
385
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
386
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
387
+ # `Code.CANCELLED`.
396
388
  #
397
389
  # @overload cancel_operation(request, options = nil)
398
390
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -464,7 +456,6 @@ module Google
464
456
 
465
457
  @operations_stub.cancel_operation request, options do |result, operation|
466
458
  yield result, operation if block_given?
467
- return result
468
459
  end
469
460
  rescue ::Gapic::Rest::Error => e
470
461
  raise ::Google::Cloud::Error.from_error(e)
@@ -512,6 +503,13 @@ module Google
512
503
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
513
504
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
514
505
  # * (`nil`) indicating no credentials
506
+ #
507
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
508
+ # external source for authentication to Google Cloud, you must validate it before
509
+ # providing it to a Google API client library. Providing an unvalidated credential
510
+ # configuration to Google APIs can compromise the security of your systems and data.
511
+ # For more information, refer to [Validate credential configurations from external
512
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
515
513
  # @return [::Object]
516
514
  # @!attribute [rw] scope
517
515
  # The OAuth scopes
@@ -544,6 +542,11 @@ module Google
544
542
  # default endpoint URL. The default value of nil uses the environment
545
543
  # universe (usually the default "googleapis.com" universe).
546
544
  # @return [::String,nil]
545
+ # @!attribute [rw] logger
546
+ # A custom logger to use for request/response debug logging, or the value
547
+ # `:default` (the default) to construct a default logger, or `nil` to
548
+ # explicitly disable logging.
549
+ # @return [::Logger,:default,nil]
547
550
  #
548
551
  class Configuration
549
552
  extend ::Gapic::Config
@@ -565,6 +568,7 @@ module Google
565
568
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
566
569
  config_attr :quota_project, nil, ::String, nil
567
570
  config_attr :universe_domain, nil, ::String, nil
571
+ config_attr :logger, :default, ::Logger, nil, :default
568
572
 
569
573
  # @private
570
574
  def initialize parent_config = nil
@@ -684,16 +688,18 @@ module Google
684
688
 
685
689
  response = @client_stub.make_http_request(
686
690
  verb,
687
- uri: uri,
688
- body: body || "",
689
- params: query_string_params,
691
+ uri: uri,
692
+ body: body || "",
693
+ params: query_string_params,
694
+ method_name: "list_operations",
690
695
  options: options
691
696
  )
692
697
  operation = ::Gapic::Rest::TransportOperation.new response
693
698
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
694
-
695
- yield result, operation if block_given?
696
- result
699
+ catch :response do
700
+ yield result, operation if block_given?
701
+ result
702
+ end
697
703
  end
698
704
 
699
705
  ##
@@ -722,16 +728,18 @@ module Google
722
728
 
723
729
  response = @client_stub.make_http_request(
724
730
  verb,
725
- uri: uri,
726
- body: body || "",
727
- params: query_string_params,
731
+ uri: uri,
732
+ body: body || "",
733
+ params: query_string_params,
734
+ method_name: "get_operation",
728
735
  options: options
729
736
  )
730
737
  operation = ::Gapic::Rest::TransportOperation.new response
731
738
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
732
-
733
- yield result, operation if block_given?
734
- result
739
+ catch :response do
740
+ yield result, operation if block_given?
741
+ result
742
+ end
735
743
  end
736
744
 
737
745
  ##
@@ -760,16 +768,18 @@ module Google
760
768
 
761
769
  response = @client_stub.make_http_request(
762
770
  verb,
763
- uri: uri,
764
- body: body || "",
765
- params: query_string_params,
771
+ uri: uri,
772
+ body: body || "",
773
+ params: query_string_params,
774
+ method_name: "delete_operation",
766
775
  options: options
767
776
  )
768
777
  operation = ::Gapic::Rest::TransportOperation.new response
769
778
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
770
-
771
- yield result, operation if block_given?
772
- result
779
+ catch :response do
780
+ yield result, operation if block_given?
781
+ result
782
+ end
773
783
  end
774
784
 
775
785
  ##
@@ -798,16 +808,18 @@ module Google
798
808
 
799
809
  response = @client_stub.make_http_request(
800
810
  verb,
801
- uri: uri,
802
- body: body || "",
803
- params: query_string_params,
811
+ uri: uri,
812
+ body: body || "",
813
+ params: query_string_params,
814
+ method_name: "cancel_operation",
804
815
  options: options
805
816
  )
806
817
  operation = ::Gapic::Rest::TransportOperation.new response
807
818
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
808
-
809
- yield result, operation if block_given?
810
- result
819
+ catch :response do
820
+ yield result, operation if block_given?
821
+ result
822
+ end
811
823
  end
812
824
 
813
825
  ##