google-cloud-discovery_engine-v1 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +32 -6
  4. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +12 -15
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +32 -6
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +43 -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 +29 -6
  9. data/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +29 -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 +30 -14
  12. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +30 -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 +31 -6
  15. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +12 -15
  16. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +31 -6
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +43 -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 +31 -9
  20. data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +12 -15
  21. data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +31 -9
  22. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +43 -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 +31 -6
  25. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +12 -15
  26. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +31 -6
  27. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +43 -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 +28 -4
  30. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +28 -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 +29 -2
  33. data/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +12 -15
  34. data/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb +29 -2
  35. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +43 -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 +28 -2
  38. data/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +28 -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 +28 -2
  41. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +28 -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 +32 -6
  44. data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +12 -15
  45. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +32 -6
  46. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +43 -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 +30 -3
  49. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +28 -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 +29 -3
  52. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb +12 -15
  53. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb +29 -3
  54. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +43 -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 +38 -13
  57. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +12 -15
  58. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +38 -13
  59. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +43 -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 +30 -5
  62. data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +12 -15
  63. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +30 -5
  64. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +43 -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/longrunning/operations.rb +19 -14
  69. metadata +5 -5
@@ -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)
@@ -1615,6 +1625,11 @@ module Google
1615
1625
  # default endpoint URL. The default value of nil uses the environment
1616
1626
  # universe (usually the default "googleapis.com" universe).
1617
1627
  # @return [::String,nil]
1628
+ # @!attribute [rw] logger
1629
+ # A custom logger to use for request/response debug logging, or the value
1630
+ # `:default` (the default) to construct a default logger, or `nil` to
1631
+ # explicitly disable logging.
1632
+ # @return [::Logger,:default,nil]
1618
1633
  #
1619
1634
  class Configuration
1620
1635
  extend ::Gapic::Config
@@ -1639,6 +1654,7 @@ module Google
1639
1654
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1640
1655
  config_attr :quota_project, nil, ::String, nil
1641
1656
  config_attr :universe_domain, nil, ::String, nil
1657
+ config_attr :logger, :default, ::Logger, nil, :default
1642
1658
 
1643
1659
  # @private
1644
1660
  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)
@@ -1508,6 +1518,11 @@ module Google
1508
1518
  # default endpoint URL. The default value of nil uses the environment
1509
1519
  # universe (usually the default "googleapis.com" universe).
1510
1520
  # @return [::String,nil]
1521
+ # @!attribute [rw] logger
1522
+ # A custom logger to use for request/response debug logging, or the value
1523
+ # `:default` (the default) to construct a default logger, or `nil` to
1524
+ # explicitly disable logging.
1525
+ # @return [::Logger,:default,nil]
1511
1526
  #
1512
1527
  class Configuration
1513
1528
  extend ::Gapic::Config
@@ -1529,6 +1544,7 @@ module Google
1529
1544
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1530
1545
  config_attr :quota_project, nil, ::String, nil
1531
1546
  config_attr :universe_domain, nil, ::String, nil
1547
+ config_attr :logger, :default, ::Logger, nil, :default
1532
1548
 
1533
1549
  # @private
1534
1550
  def initialize parent_config = nil