google-cloud-discovery_engine-v1 1.3.0 → 1.5.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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -21
  3. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +49 -6
  4. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +19 -15
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +49 -6
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +50 -38
  7. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +54 -32
  8. data/lib/google/cloud/discovery_engine/v1/control_service/client.rb +36 -6
  9. data/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +36 -6
  10. data/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb +54 -32
  11. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +37 -14
  12. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +37 -14
  13. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +118 -80
  14. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +38 -6
  15. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +19 -15
  16. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +38 -6
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +50 -38
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb +54 -32
  19. data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +60 -9
  20. data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +19 -15
  21. data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +60 -9
  22. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +50 -38
  23. data/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb +78 -50
  24. data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +38 -6
  25. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +19 -15
  26. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +38 -6
  27. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +50 -38
  28. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb +54 -32
  29. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +35 -4
  30. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +35 -3
  31. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb +30 -14
  32. data/lib/google/cloud/discovery_engine/v1/project_service/client.rb +36 -2
  33. data/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +19 -15
  34. data/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb +36 -2
  35. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +50 -38
  36. data/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb +22 -8
  37. data/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +35 -2
  38. data/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +35 -2
  39. data/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb +22 -8
  40. data/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +35 -2
  41. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +35 -2
  42. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb +22 -8
  43. data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +39 -6
  44. data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +19 -15
  45. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +39 -6
  46. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +50 -38
  47. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb +54 -32
  48. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +37 -3
  49. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +35 -3
  50. data/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +30 -14
  51. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb +36 -3
  52. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb +19 -15
  53. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb +36 -3
  54. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +50 -38
  55. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb +30 -14
  56. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +45 -13
  57. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +19 -15
  58. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +45 -13
  59. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +50 -38
  60. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb +110 -74
  61. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +43 -5
  62. data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +19 -15
  63. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +43 -5
  64. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +50 -38
  65. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +46 -26
  66. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  67. data/proto_docs/google/api/client.rb +25 -0
  68. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +6 -0
  69. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +8 -0
  70. data/proto_docs/google/cloud/discoveryengine/v1/completion.rb +4 -0
  71. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +8 -0
  72. data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +4 -0
  73. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +8 -0
  74. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +8 -0
  75. data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +6 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +8 -0
  77. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +4 -0
  78. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +6 -0
  79. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +34 -0
  80. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +4 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1/schema.rb +4 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +4 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +6 -0
  84. data/proto_docs/google/longrunning/operations.rb +23 -14
  85. data/proto_docs/google/protobuf/struct.rb +12 -0
  86. metadata +6 -9
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the create_control REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "create_control",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "delete_control",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "update_control",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "get_control",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "list_controls",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -163,14 +163,26 @@ module Google
163
163
  universe_domain: @config.universe_domain,
164
164
  channel_args: @config.channel_args,
165
165
  interceptors: @config.interceptors,
166
- channel_pool_config: @config.channel_pool
166
+ channel_pool_config: @config.channel_pool,
167
+ logger: @config.logger
167
168
  )
168
169
 
170
+ @conversational_search_service_stub.stub_logger&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+
169
180
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
170
181
  config.credentials = credentials
171
182
  config.quota_project = @quota_project_id
172
183
  config.endpoint = @conversational_search_service_stub.endpoint
173
184
  config.universe_domain = @conversational_search_service_stub.universe_domain
185
+ config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger=
174
186
  end
175
187
  end
176
188
 
@@ -181,6 +193,15 @@ module Google
181
193
  #
182
194
  attr_reader :location_client
183
195
 
196
+ ##
197
+ # The logger used for request/response debug logging.
198
+ #
199
+ # @return [Logger]
200
+ #
201
+ def logger
202
+ @conversational_search_service_stub.logger
203
+ end
204
+
184
205
  # Service calls
185
206
 
186
207
  ##
@@ -321,7 +342,6 @@ module Google
321
342
 
322
343
  @conversational_search_service_stub.call_rpc :converse_conversation, request, options: options do |response, operation|
323
344
  yield response, operation if block_given?
324
- return response
325
345
  end
326
346
  rescue ::GRPC::BadStatus => e
327
347
  raise ::Google::Cloud::Error.from_error(e)
@@ -413,7 +433,6 @@ module Google
413
433
 
414
434
  @conversational_search_service_stub.call_rpc :create_conversation, request, options: options do |response, operation|
415
435
  yield response, operation if block_given?
416
- return response
417
436
  end
418
437
  rescue ::GRPC::BadStatus => e
419
438
  raise ::Google::Cloud::Error.from_error(e)
@@ -503,7 +522,6 @@ module Google
503
522
 
504
523
  @conversational_search_service_stub.call_rpc :delete_conversation, request, options: options do |response, operation|
505
524
  yield response, operation if block_given?
506
- return response
507
525
  end
508
526
  rescue ::GRPC::BadStatus => e
509
527
  raise ::Google::Cloud::Error.from_error(e)
@@ -602,7 +620,6 @@ module Google
602
620
 
603
621
  @conversational_search_service_stub.call_rpc :update_conversation, request, options: options do |response, operation|
604
622
  yield response, operation if block_given?
605
- return response
606
623
  end
607
624
  rescue ::GRPC::BadStatus => e
608
625
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,7 +706,6 @@ module Google
689
706
 
690
707
  @conversational_search_service_stub.call_rpc :get_conversation, request, options: options do |response, operation|
691
708
  yield response, operation if block_given?
692
- return response
693
709
  end
694
710
  rescue ::GRPC::BadStatus => e
695
711
  raise ::Google::Cloud::Error.from_error(e)
@@ -805,7 +821,7 @@ module Google
805
821
  @conversational_search_service_stub.call_rpc :list_conversations, request, options: options do |response, operation|
806
822
  response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_conversations, request, response, operation, options
807
823
  yield response, operation if block_given?
808
- return response
824
+ throw :response, response
809
825
  end
810
826
  rescue ::GRPC::BadStatus => e
811
827
  raise ::Google::Cloud::Error.from_error(e)
@@ -956,7 +972,6 @@ module Google
956
972
 
957
973
  @conversational_search_service_stub.call_rpc :answer_query, request, options: options do |response, operation|
958
974
  yield response, operation if block_given?
959
- return response
960
975
  end
961
976
  rescue ::GRPC::BadStatus => e
962
977
  raise ::Google::Cloud::Error.from_error(e)
@@ -1043,7 +1058,6 @@ module Google
1043
1058
 
1044
1059
  @conversational_search_service_stub.call_rpc :get_answer, request, options: options do |response, operation|
1045
1060
  yield response, operation if block_given?
1046
- return response
1047
1061
  end
1048
1062
  rescue ::GRPC::BadStatus => e
1049
1063
  raise ::Google::Cloud::Error.from_error(e)
@@ -1135,7 +1149,6 @@ module Google
1135
1149
 
1136
1150
  @conversational_search_service_stub.call_rpc :create_session, request, options: options do |response, operation|
1137
1151
  yield response, operation if block_given?
1138
- return response
1139
1152
  end
1140
1153
  rescue ::GRPC::BadStatus => e
1141
1154
  raise ::Google::Cloud::Error.from_error(e)
@@ -1225,7 +1238,6 @@ module Google
1225
1238
 
1226
1239
  @conversational_search_service_stub.call_rpc :delete_session, request, options: options do |response, operation|
1227
1240
  yield response, operation if block_given?
1228
- return response
1229
1241
  end
1230
1242
  rescue ::GRPC::BadStatus => e
1231
1243
  raise ::Google::Cloud::Error.from_error(e)
@@ -1323,7 +1335,6 @@ module Google
1323
1335
 
1324
1336
  @conversational_search_service_stub.call_rpc :update_session, request, options: options do |response, operation|
1325
1337
  yield response, operation if block_given?
1326
- return response
1327
1338
  end
1328
1339
  rescue ::GRPC::BadStatus => e
1329
1340
  raise ::Google::Cloud::Error.from_error(e)
@@ -1410,7 +1421,6 @@ module Google
1410
1421
 
1411
1422
  @conversational_search_service_stub.call_rpc :get_session, request, options: options do |response, operation|
1412
1423
  yield response, operation if block_given?
1413
- return response
1414
1424
  end
1415
1425
  rescue ::GRPC::BadStatus => e
1416
1426
  raise ::Google::Cloud::Error.from_error(e)
@@ -1526,7 +1536,7 @@ module Google
1526
1536
  @conversational_search_service_stub.call_rpc :list_sessions, request, options: options do |response, operation|
1527
1537
  response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, request, response, operation, options
1528
1538
  yield response, operation if block_given?
1529
- return response
1539
+ throw :response, response
1530
1540
  end
1531
1541
  rescue ::GRPC::BadStatus => e
1532
1542
  raise ::Google::Cloud::Error.from_error(e)
@@ -1576,6 +1586,13 @@ module Google
1576
1586
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1577
1587
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1578
1588
  # * (`nil`) indicating no credentials
1589
+ #
1590
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1591
+ # external source for authentication to Google Cloud, you must validate it before
1592
+ # providing it to a Google API client library. Providing an unvalidated credential
1593
+ # configuration to Google APIs can compromise the security of your systems and data.
1594
+ # For more information, refer to [Validate credential configurations from external
1595
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1579
1596
  # @return [::Object]
1580
1597
  # @!attribute [rw] scope
1581
1598
  # The OAuth scopes
@@ -1615,6 +1632,11 @@ module Google
1615
1632
  # default endpoint URL. The default value of nil uses the environment
1616
1633
  # universe (usually the default "googleapis.com" universe).
1617
1634
  # @return [::String,nil]
1635
+ # @!attribute [rw] logger
1636
+ # A custom logger to use for request/response debug logging, or the value
1637
+ # `:default` (the default) to construct a default logger, or `nil` to
1638
+ # explicitly disable logging.
1639
+ # @return [::Logger,:default,nil]
1618
1640
  #
1619
1641
  class Configuration
1620
1642
  extend ::Gapic::Config
@@ -1639,6 +1661,7 @@ module Google
1639
1661
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1640
1662
  config_attr :quota_project, nil, ::String, nil
1641
1663
  config_attr :universe_domain, nil, ::String, nil
1664
+ config_attr :logger, :default, ::Logger, nil, :default
1642
1665
 
1643
1666
  # @private
1644
1667
  def initialize parent_config = nil
@@ -156,14 +156,26 @@ module Google
156
156
  endpoint: @config.endpoint,
157
157
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
158
  universe_domain: @config.universe_domain,
159
- credentials: credentials
159
+ credentials: credentials,
160
+ logger: @config.logger
160
161
  )
161
162
 
163
+ @conversational_search_service_stub.logger(stub: true)&.info do |entry|
164
+ entry.set_system_name
165
+ entry.set_service
166
+ entry.message = "Created client for #{entry.service}"
167
+ entry.set_credentials_fields credentials
168
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
169
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
170
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
171
+ end
172
+
162
173
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
163
174
  config.credentials = credentials
164
175
  config.quota_project = @quota_project_id
165
176
  config.endpoint = @conversational_search_service_stub.endpoint
166
177
  config.universe_domain = @conversational_search_service_stub.universe_domain
178
+ config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger=
167
179
  end
168
180
  end
169
181
 
@@ -174,6 +186,15 @@ module Google
174
186
  #
175
187
  attr_reader :location_client
176
188
 
189
+ ##
190
+ # The logger used for request/response debug logging.
191
+ #
192
+ # @return [Logger]
193
+ #
194
+ def logger
195
+ @conversational_search_service_stub.logger
196
+ end
197
+
177
198
  # Service calls
178
199
 
179
200
  ##
@@ -307,7 +328,6 @@ module Google
307
328
 
308
329
  @conversational_search_service_stub.converse_conversation request, options do |result, operation|
309
330
  yield result, operation if block_given?
310
- return result
311
331
  end
312
332
  rescue ::Gapic::Rest::Error => e
313
333
  raise ::Google::Cloud::Error.from_error(e)
@@ -392,7 +412,6 @@ module Google
392
412
 
393
413
  @conversational_search_service_stub.create_conversation request, options do |result, operation|
394
414
  yield result, operation if block_given?
395
- return result
396
415
  end
397
416
  rescue ::Gapic::Rest::Error => e
398
417
  raise ::Google::Cloud::Error.from_error(e)
@@ -475,7 +494,6 @@ module Google
475
494
 
476
495
  @conversational_search_service_stub.delete_conversation request, options do |result, operation|
477
496
  yield result, operation if block_given?
478
- return result
479
497
  end
480
498
  rescue ::Gapic::Rest::Error => e
481
499
  raise ::Google::Cloud::Error.from_error(e)
@@ -567,7 +585,6 @@ module Google
567
585
 
568
586
  @conversational_search_service_stub.update_conversation request, options do |result, operation|
569
587
  yield result, operation if block_given?
570
- return result
571
588
  end
572
589
  rescue ::Gapic::Rest::Error => e
573
590
  raise ::Google::Cloud::Error.from_error(e)
@@ -647,7 +664,6 @@ module Google
647
664
 
648
665
  @conversational_search_service_stub.get_conversation request, options do |result, operation|
649
666
  yield result, operation if block_given?
650
- return result
651
667
  end
652
668
  rescue ::Gapic::Rest::Error => e
653
669
  raise ::Google::Cloud::Error.from_error(e)
@@ -756,7 +772,7 @@ module Google
756
772
  @conversational_search_service_stub.list_conversations request, options do |result, operation|
757
773
  result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_conversations, "conversations", request, result, options
758
774
  yield result, operation if block_given?
759
- return result
775
+ throw :response, result
760
776
  end
761
777
  rescue ::Gapic::Rest::Error => e
762
778
  raise ::Google::Cloud::Error.from_error(e)
@@ -900,7 +916,6 @@ module Google
900
916
 
901
917
  @conversational_search_service_stub.answer_query request, options do |result, operation|
902
918
  yield result, operation if block_given?
903
- return result
904
919
  end
905
920
  rescue ::Gapic::Rest::Error => e
906
921
  raise ::Google::Cloud::Error.from_error(e)
@@ -980,7 +995,6 @@ module Google
980
995
 
981
996
  @conversational_search_service_stub.get_answer request, options do |result, operation|
982
997
  yield result, operation if block_given?
983
- return result
984
998
  end
985
999
  rescue ::Gapic::Rest::Error => e
986
1000
  raise ::Google::Cloud::Error.from_error(e)
@@ -1065,7 +1079,6 @@ module Google
1065
1079
 
1066
1080
  @conversational_search_service_stub.create_session request, options do |result, operation|
1067
1081
  yield result, operation if block_given?
1068
- return result
1069
1082
  end
1070
1083
  rescue ::Gapic::Rest::Error => e
1071
1084
  raise ::Google::Cloud::Error.from_error(e)
@@ -1148,7 +1161,6 @@ module Google
1148
1161
 
1149
1162
  @conversational_search_service_stub.delete_session request, options do |result, operation|
1150
1163
  yield result, operation if block_given?
1151
- return result
1152
1164
  end
1153
1165
  rescue ::Gapic::Rest::Error => e
1154
1166
  raise ::Google::Cloud::Error.from_error(e)
@@ -1239,7 +1251,6 @@ module Google
1239
1251
 
1240
1252
  @conversational_search_service_stub.update_session request, options do |result, operation|
1241
1253
  yield result, operation if block_given?
1242
- return result
1243
1254
  end
1244
1255
  rescue ::Gapic::Rest::Error => e
1245
1256
  raise ::Google::Cloud::Error.from_error(e)
@@ -1319,7 +1330,6 @@ module Google
1319
1330
 
1320
1331
  @conversational_search_service_stub.get_session request, options do |result, operation|
1321
1332
  yield result, operation if block_given?
1322
- return result
1323
1333
  end
1324
1334
  rescue ::Gapic::Rest::Error => e
1325
1335
  raise ::Google::Cloud::Error.from_error(e)
@@ -1428,7 +1438,7 @@ module Google
1428
1438
  @conversational_search_service_stub.list_sessions request, options do |result, operation|
1429
1439
  result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, "sessions", request, result, options
1430
1440
  yield result, operation if block_given?
1431
- return result
1441
+ throw :response, result
1432
1442
  end
1433
1443
  rescue ::Gapic::Rest::Error => e
1434
1444
  raise ::Google::Cloud::Error.from_error(e)
@@ -1476,6 +1486,13 @@ module Google
1476
1486
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1477
1487
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1478
1488
  # * (`nil`) indicating no credentials
1489
+ #
1490
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1491
+ # external source for authentication to Google Cloud, you must validate it before
1492
+ # providing it to a Google API client library. Providing an unvalidated credential
1493
+ # configuration to Google APIs can compromise the security of your systems and data.
1494
+ # For more information, refer to [Validate credential configurations from external
1495
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1479
1496
  # @return [::Object]
1480
1497
  # @!attribute [rw] scope
1481
1498
  # The OAuth scopes
@@ -1508,6 +1525,11 @@ module Google
1508
1525
  # default endpoint URL. The default value of nil uses the environment
1509
1526
  # universe (usually the default "googleapis.com" universe).
1510
1527
  # @return [::String,nil]
1528
+ # @!attribute [rw] logger
1529
+ # A custom logger to use for request/response debug logging, or the value
1530
+ # `:default` (the default) to construct a default logger, or `nil` to
1531
+ # explicitly disable logging.
1532
+ # @return [::Logger,:default,nil]
1511
1533
  #
1512
1534
  class Configuration
1513
1535
  extend ::Gapic::Config
@@ -1529,6 +1551,7 @@ module Google
1529
1551
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1530
1552
  config_attr :quota_project, nil, ::String, nil
1531
1553
  config_attr :universe_domain, nil, ::String, nil
1554
+ config_attr :logger, :default, ::Logger, nil, :default
1532
1555
 
1533
1556
  # @private
1534
1557
  def initialize parent_config = nil