google-cloud-dialogflow-cx-v3 1.1.1 → 1.3.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 (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +1 -1
  4. data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +2 -1
  5. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +44 -25
  6. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +12 -15
  7. data/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +19 -0
  8. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +44 -25
  9. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +43 -38
  10. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +102 -68
  11. data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +1 -1
  12. data/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb +1 -1
  13. data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +32 -6
  14. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +32 -6
  15. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +30 -14
  16. data/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb +1 -1
  17. data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +32 -8
  18. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +32 -8
  19. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +30 -14
  20. data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +1 -1
  21. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +43 -21
  22. data/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb +12 -15
  23. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +43 -21
  24. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb +43 -38
  25. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +70 -44
  26. data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +1 -1
  27. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +50 -27
  28. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +12 -15
  29. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +50 -27
  30. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +43 -38
  31. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +86 -56
  32. data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +1 -1
  33. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +38 -21
  34. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +38 -21
  35. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +70 -44
  36. data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +1 -1
  37. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +47 -26
  38. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +12 -15
  39. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +47 -26
  40. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +43 -38
  41. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +94 -62
  42. data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +1 -1
  43. data/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb +1 -1
  44. data/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb +1 -1
  45. data/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb +2 -1
  46. data/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +35 -12
  47. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +35 -12
  48. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +54 -32
  49. data/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb +1 -1
  50. data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +1 -1
  51. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +41 -19
  52. data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +12 -15
  53. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +41 -19
  54. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +43 -38
  55. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +70 -44
  56. data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +1 -1
  57. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +37 -14
  58. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +37 -14
  59. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +54 -32
  60. data/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb +1 -1
  61. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +35 -12
  62. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +35 -12
  63. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +54 -32
  64. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +54 -29
  65. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +54 -29
  66. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +54 -32
  67. data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +5 -1
  68. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +40 -16
  69. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +40 -14
  70. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +47 -26
  71. data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +1 -1
  72. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +59 -38
  73. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +12 -15
  74. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +59 -38
  75. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +43 -38
  76. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +110 -74
  77. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +1 -1
  78. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +43 -21
  79. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +43 -21
  80. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +54 -32
  81. data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +1 -1
  82. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  83. data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +1 -1
  84. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +44 -22
  85. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +12 -15
  86. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +44 -22
  87. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +43 -38
  88. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +70 -44
  89. data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +1 -1
  90. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +35 -12
  91. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +35 -12
  92. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +54 -32
  93. data/proto_docs/google/api/client.rb +39 -0
  94. data/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb +1 -1
  95. data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +44 -20
  96. data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +6 -0
  97. data/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb +5 -5
  98. data/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb +11 -13
  99. data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +16 -17
  100. data/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +26 -28
  101. data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +15 -19
  102. data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +28 -27
  103. data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +2 -2
  104. data/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb +2 -2
  105. data/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb +41 -8
  106. data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +19 -19
  107. data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +33 -33
  108. data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +2 -1
  109. data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +14 -14
  110. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +107 -22
  111. data/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb +30 -28
  112. data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +41 -43
  113. data/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb +16 -18
  114. data/proto_docs/google/cloud/dialogflow/cx/v3/version.rb +19 -19
  115. data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +24 -25
  116. data/proto_docs/google/longrunning/operations.rb +19 -14
  117. metadata +5 -5
@@ -169,15 +169,27 @@ module Google
169
169
  endpoint: @config.endpoint,
170
170
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
171
171
  universe_domain: @config.universe_domain,
172
- credentials: credentials
172
+ credentials: credentials,
173
+ logger: @config.logger
173
174
  )
174
175
 
176
+ @agents_stub.logger(stub: true)&.info do |entry|
177
+ entry.set_system_name
178
+ entry.set_service
179
+ entry.message = "Created client for #{entry.service}"
180
+ entry.set_credentials_fields credentials
181
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
182
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
183
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
184
+ end
185
+
175
186
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
176
187
  config.credentials = credentials
177
188
  config.quota_project = @quota_project_id
178
189
  config.endpoint = @agents_stub.endpoint
179
190
  config.universe_domain = @agents_stub.universe_domain
180
191
  config.bindings_override = @config.bindings_override
192
+ config.logger = @agents_stub.logger if config.respond_to? :logger=
181
193
  end
182
194
  end
183
195
 
@@ -195,6 +207,15 @@ module Google
195
207
  #
196
208
  attr_reader :location_client
197
209
 
210
+ ##
211
+ # The logger used for request/response debug logging.
212
+ #
213
+ # @return [Logger]
214
+ #
215
+ def logger
216
+ @agents_stub.logger
217
+ end
218
+
198
219
  # Service calls
199
220
 
200
221
  ##
@@ -217,7 +238,7 @@ module Google
217
238
  #
218
239
  # @param parent [::String]
219
240
  # Required. The location to list all agents for.
220
- # Format: `projects/<Project ID>/locations/<Location ID>`.
241
+ # Format: `projects/<ProjectID>/locations/<LocationID>`.
221
242
  # @param page_size [::Integer]
222
243
  # The maximum number of items to return in a single page. By default 100 and
223
244
  # at most 1000.
@@ -281,7 +302,7 @@ module Google
281
302
  @agents_stub.list_agents request, options do |result, operation|
282
303
  result = ::Gapic::Rest::PagedEnumerable.new @agents_stub, :list_agents, "agents", request, result, options
283
304
  yield result, operation if block_given?
284
- return result
305
+ throw :response, result
285
306
  end
286
307
  rescue ::Gapic::Rest::Error => e
287
308
  raise ::Google::Cloud::Error.from_error(e)
@@ -307,7 +328,7 @@ module Google
307
328
  #
308
329
  # @param name [::String]
309
330
  # Required. The name of the agent.
310
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
331
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
311
332
  # @yield [result, operation] Access the result along with the TransportOperation object
312
333
  # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Agent]
313
334
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -361,7 +382,6 @@ module Google
361
382
 
362
383
  @agents_stub.get_agent 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)
@@ -391,7 +411,7 @@ module Google
391
411
  #
392
412
  # @param parent [::String]
393
413
  # Required. The location to create a agent for.
394
- # Format: `projects/<Project ID>/locations/<Location ID>`.
414
+ # Format: `projects/<ProjectID>/locations/<LocationID>`.
395
415
  # @param agent [::Google::Cloud::Dialogflow::CX::V3::Agent, ::Hash]
396
416
  # Required. The agent to create.
397
417
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -447,7 +467,6 @@ module Google
447
467
 
448
468
  @agents_stub.create_agent request, options do |result, operation|
449
469
  yield result, operation if block_given?
450
- return result
451
470
  end
452
471
  rescue ::Gapic::Rest::Error => e
453
472
  raise ::Google::Cloud::Error.from_error(e)
@@ -533,7 +552,6 @@ module Google
533
552
 
534
553
  @agents_stub.update_agent request, options do |result, operation|
535
554
  yield result, operation if block_given?
536
- return result
537
555
  end
538
556
  rescue ::Gapic::Rest::Error => e
539
557
  raise ::Google::Cloud::Error.from_error(e)
@@ -559,7 +577,7 @@ module Google
559
577
  #
560
578
  # @param name [::String]
561
579
  # Required. The name of the agent to delete.
562
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
580
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
563
581
  # @yield [result, operation] Access the result along with the TransportOperation object
564
582
  # @yieldparam result [::Google::Protobuf::Empty]
565
583
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -613,7 +631,6 @@ module Google
613
631
 
614
632
  @agents_stub.delete_agent request, options do |result, operation|
615
633
  yield result, operation if block_given?
616
- return result
617
634
  end
618
635
  rescue ::Gapic::Rest::Error => e
619
636
  raise ::Google::Cloud::Error.from_error(e)
@@ -648,7 +665,7 @@ module Google
648
665
  #
649
666
  # @param name [::String]
650
667
  # Required. The name of the agent to export.
651
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
668
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
652
669
  # @param agent_uri [::String]
653
670
  # Optional. The [Google Cloud
654
671
  # Storage](https://cloud.google.com/storage/docs/) URI to export the agent
@@ -665,8 +682,8 @@ module Google
665
682
  # is assumed.
666
683
  # @param environment [::String]
667
684
  # Optional. Environment name. If not set, draft environment is assumed.
668
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
669
- # ID>/environments/<Environment ID>`.
685
+ # Format:
686
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>`.
670
687
  # @param git_destination [::Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest::GitDestination, ::Hash]
671
688
  # Optional. The Git branch to export the agent to.
672
689
  # @param include_bigquery_export_settings [::Boolean]
@@ -732,7 +749,7 @@ module Google
732
749
  @agents_stub.export_agent request, options do |result, operation|
733
750
  result = ::Gapic::Operation.new result, @operations_client, options: options
734
751
  yield result, operation if block_given?
735
- return result
752
+ throw :response, result
736
753
  end
737
754
  rescue ::Gapic::Rest::Error => e
738
755
  raise ::Google::Cloud::Error.from_error(e)
@@ -774,7 +791,7 @@ module Google
774
791
  #
775
792
  # @param name [::String]
776
793
  # Required. The name of the agent to restore into.
777
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
794
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
778
795
  # @param agent_uri [::String]
779
796
  # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
780
797
  # to restore agent from. The format of this URI must be
@@ -852,7 +869,7 @@ module Google
852
869
  @agents_stub.restore_agent request, options do |result, operation|
853
870
  result = ::Gapic::Operation.new result, @operations_client, options: options
854
871
  yield result, operation if block_given?
855
- return result
872
+ throw :response, result
856
873
  end
857
874
  rescue ::Gapic::Rest::Error => e
858
875
  raise ::Google::Cloud::Error.from_error(e)
@@ -880,7 +897,7 @@ module Google
880
897
  #
881
898
  # @param name [::String]
882
899
  # Required. The agent to validate.
883
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
900
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
884
901
  # @param language_code [::String]
885
902
  # If not specified, the agent's default language is used.
886
903
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -936,7 +953,6 @@ module Google
936
953
 
937
954
  @agents_stub.validate_agent request, options do |result, operation|
938
955
  yield result, operation if block_given?
939
- return result
940
956
  end
941
957
  rescue ::Gapic::Rest::Error => e
942
958
  raise ::Google::Cloud::Error.from_error(e)
@@ -963,8 +979,8 @@ module Google
963
979
  #
964
980
  # @param name [::String]
965
981
  # Required. The agent name.
966
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
967
- # ID>/validationResult`.
982
+ # Format:
983
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/validationResult`.
968
984
  # @param language_code [::String]
969
985
  # If not specified, the agent's default language is used.
970
986
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -1020,7 +1036,6 @@ module Google
1020
1036
 
1021
1037
  @agents_stub.get_agent_validation_result request, options do |result, operation|
1022
1038
  yield result, operation if block_given?
1023
- return result
1024
1039
  end
1025
1040
  rescue ::Gapic::Rest::Error => e
1026
1041
  raise ::Google::Cloud::Error.from_error(e)
@@ -1045,8 +1060,8 @@ module Google
1045
1060
  # the default parameter values, pass an empty Hash as a request object (see above).
1046
1061
  #
1047
1062
  # @param name [::String]
1048
- # Required. Format: `projects/<Project ID>/locations/<Location
1049
- # ID>/agents/<Agent ID>/generativeSettings`.
1063
+ # Required. Format:
1064
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/generativeSettings`.
1050
1065
  # @param language_code [::String]
1051
1066
  # Required. Language code of the generative settings.
1052
1067
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -1102,7 +1117,6 @@ module Google
1102
1117
 
1103
1118
  @agents_stub.get_generative_settings request, options do |result, operation|
1104
1119
  yield result, operation if block_given?
1105
- return result
1106
1120
  end
1107
1121
  rescue ::Gapic::Rest::Error => e
1108
1122
  raise ::Google::Cloud::Error.from_error(e)
@@ -1184,7 +1198,6 @@ module Google
1184
1198
 
1185
1199
  @agents_stub.update_generative_settings request, options do |result, operation|
1186
1200
  yield result, operation if block_given?
1187
- return result
1188
1201
  end
1189
1202
  rescue ::Gapic::Rest::Error => e
1190
1203
  raise ::Google::Cloud::Error.from_error(e)
@@ -1264,6 +1277,11 @@ module Google
1264
1277
  # default endpoint URL. The default value of nil uses the environment
1265
1278
  # universe (usually the default "googleapis.com" universe).
1266
1279
  # @return [::String,nil]
1280
+ # @!attribute [rw] logger
1281
+ # A custom logger to use for request/response debug logging, or the value
1282
+ # `:default` (the default) to construct a default logger, or `nil` to
1283
+ # explicitly disable logging.
1284
+ # @return [::Logger,:default,nil]
1267
1285
  #
1268
1286
  class Configuration
1269
1287
  extend ::Gapic::Config
@@ -1292,6 +1310,7 @@ module Google
1292
1310
  # by the host service.
1293
1311
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1294
1312
  config_attr :bindings_override, {}, ::Hash, nil
1313
+ config_attr :logger, :default, ::Logger, nil, :default
1295
1314
 
1296
1315
  # @private
1297
1316
  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)
@@ -544,6 +535,11 @@ module Google
544
535
  # default endpoint URL. The default value of nil uses the environment
545
536
  # universe (usually the default "googleapis.com" universe).
546
537
  # @return [::String,nil]
538
+ # @!attribute [rw] logger
539
+ # A custom logger to use for request/response debug logging, or the value
540
+ # `:default` (the default) to construct a default logger, or `nil` to
541
+ # explicitly disable logging.
542
+ # @return [::Logger,:default,nil]
547
543
  #
548
544
  class Configuration
549
545
  extend ::Gapic::Config
@@ -565,6 +561,7 @@ module Google
565
561
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
566
562
  config_attr :quota_project, nil, ::String, nil
567
563
  config_attr :universe_domain, nil, ::String, nil
564
+ config_attr :logger, :default, ::Logger, nil, :default
568
565
 
569
566
  # @private
570
567
  def initialize parent_config = nil
@@ -684,16 +681,18 @@ module Google
684
681
 
685
682
  response = @client_stub.make_http_request(
686
683
  verb,
687
- uri: uri,
688
- body: body || "",
689
- params: query_string_params,
684
+ uri: uri,
685
+ body: body || "",
686
+ params: query_string_params,
687
+ method_name: "list_operations",
690
688
  options: options
691
689
  )
692
690
  operation = ::Gapic::Rest::TransportOperation.new response
693
691
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
694
-
695
- yield result, operation if block_given?
696
- result
692
+ catch :response do
693
+ yield result, operation if block_given?
694
+ result
695
+ end
697
696
  end
698
697
 
699
698
  ##
@@ -722,16 +721,18 @@ module Google
722
721
 
723
722
  response = @client_stub.make_http_request(
724
723
  verb,
725
- uri: uri,
726
- body: body || "",
727
- params: query_string_params,
724
+ uri: uri,
725
+ body: body || "",
726
+ params: query_string_params,
727
+ method_name: "get_operation",
728
728
  options: options
729
729
  )
730
730
  operation = ::Gapic::Rest::TransportOperation.new response
731
731
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
732
-
733
- yield result, operation if block_given?
734
- result
732
+ catch :response do
733
+ yield result, operation if block_given?
734
+ result
735
+ end
735
736
  end
736
737
 
737
738
  ##
@@ -760,16 +761,18 @@ module Google
760
761
 
761
762
  response = @client_stub.make_http_request(
762
763
  verb,
763
- uri: uri,
764
- body: body || "",
765
- params: query_string_params,
764
+ uri: uri,
765
+ body: body || "",
766
+ params: query_string_params,
767
+ method_name: "delete_operation",
766
768
  options: options
767
769
  )
768
770
  operation = ::Gapic::Rest::TransportOperation.new response
769
771
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
770
-
771
- yield result, operation if block_given?
772
- result
772
+ catch :response do
773
+ yield result, operation if block_given?
774
+ result
775
+ end
773
776
  end
774
777
 
775
778
  ##
@@ -798,16 +801,18 @@ module Google
798
801
 
799
802
  response = @client_stub.make_http_request(
800
803
  verb,
801
- uri: uri,
802
- body: body || "",
803
- params: query_string_params,
804
+ uri: uri,
805
+ body: body || "",
806
+ params: query_string_params,
807
+ method_name: "cancel_operation",
804
808
  options: options
805
809
  )
806
810
  operation = ::Gapic::Rest::TransportOperation.new response
807
811
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
808
-
809
- yield result, operation if block_given?
810
- result
812
+ catch :response do
813
+ yield result, operation if block_given?
814
+ result
815
+ end
811
816
  end
812
817
 
813
818
  ##