google-cloud-discovery_engine-v1beta 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +186 -6
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +12 -15
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/paths.rb +62 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +179 -6
  7. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +43 -38
  8. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +131 -31
  9. data/lib/google/cloud/discovery_engine/v1beta/control_service/client.rb +35 -12
  10. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/client.rb +35 -12
  11. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/service_stub.rb +54 -32
  12. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +48 -27
  13. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +48 -27
  14. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +118 -80
  15. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +31 -6
  16. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +12 -15
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +31 -6
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +43 -38
  19. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/service_stub.rb +54 -32
  20. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +31 -9
  21. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +12 -15
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +25 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +31 -9
  24. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +43 -38
  25. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +78 -50
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +35 -12
  27. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +12 -15
  28. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +35 -12
  29. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +43 -38
  30. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +78 -50
  31. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +31 -5
  32. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +12 -15
  33. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +31 -5
  34. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +43 -38
  35. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +46 -26
  36. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +244 -6
  37. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +85 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +152 -6
  39. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +83 -7
  40. data/lib/google/cloud/discovery_engine/v1beta/project_service/client.rb +29 -2
  41. data/lib/google/cloud/discovery_engine/v1beta/project_service/operations.rb +12 -15
  42. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/client.rb +29 -2
  43. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +43 -38
  44. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/service_stub.rb +22 -8
  45. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +29 -3
  46. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +29 -3
  47. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +22 -8
  48. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +28 -2
  49. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +28 -2
  50. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +22 -8
  51. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +30 -7
  52. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +12 -15
  53. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +30 -7
  54. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +43 -38
  55. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +62 -38
  56. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +29 -6
  57. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +29 -6
  58. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +54 -32
  59. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +32 -6
  60. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +12 -15
  61. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +32 -6
  62. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +43 -38
  63. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +54 -32
  64. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +427 -3
  65. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +417 -3
  66. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +99 -7
  67. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +29 -3
  68. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +12 -15
  69. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +29 -3
  70. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +43 -38
  71. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +30 -14
  72. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +31 -6
  73. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +31 -6
  74. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/service_stub.rb +38 -20
  75. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +361 -14
  76. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +12 -15
  77. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/paths.rb +49 -0
  78. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +340 -14
  79. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +43 -38
  80. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/service_stub.rb +308 -73
  81. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +31 -6
  82. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +12 -15
  83. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +31 -6
  84. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +43 -38
  85. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +46 -26
  86. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  87. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
  88. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  89. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +18 -1
  90. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +2 -0
  91. data/lib/google/cloud/discoveryengine/v1beta/control_pb.rb +1 -1
  92. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +4 -1
  93. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
  94. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +7 -1
  95. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +2 -1
  96. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +1 -1
  97. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +24 -1
  98. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +4 -0
  99. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +2 -1
  100. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +3 -1
  101. data/lib/google/cloud/discoveryengine/v1beta/search_service_services_pb.rb +14 -0
  102. data/lib/google/cloud/discoveryengine/v1beta/serving_config_pb.rb +2 -2
  103. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +2 -1
  104. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_pb.rb +10 -1
  105. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_services_pb.rb +7 -0
  106. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  107. data/proto_docs/google/api/client.rb +39 -0
  108. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +20 -6
  109. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +268 -0
  110. data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +9 -0
  111. data/proto_docs/google/cloud/discoveryengine/v1beta/control_service.rb +6 -6
  112. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +95 -15
  113. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +8 -3
  114. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +131 -0
  115. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +7 -5
  116. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +19 -0
  117. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +5 -1
  118. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +4 -4
  119. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +396 -1
  120. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +10 -0
  121. data/proto_docs/google/cloud/discoveryengine/v1beta/project.rb +1 -1
  122. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +1 -1
  123. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +1 -1
  124. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +71 -0
  125. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +16 -0
  126. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config_service.rb +2 -2
  127. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +17 -0
  128. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine_service.rb +147 -1
  129. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +9 -1
  130. data/proto_docs/google/longrunning/operations.rb +19 -14
  131. metadata +5 -5
@@ -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
  ##
@@ -196,16 +217,16 @@ module Google
196
217
  #
197
218
  # @param name [::String]
198
219
  # Required. The resource name of the Conversation to get. Format:
199
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
220
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
200
221
  # Use
201
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
222
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
202
223
  # to activate auto session mode, which automatically creates a new
203
224
  # conversation inside a ConverseConversation session.
204
225
  # @param query [::Google::Cloud::DiscoveryEngine::V1beta::TextInput, ::Hash]
205
226
  # Required. Current user input.
206
227
  # @param serving_config [::String]
207
228
  # The resource name of the Serving Config to use. Format:
208
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
229
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
209
230
  # If this is not set, the default serving config will be used.
210
231
  # @param conversation [::Google::Cloud::DiscoveryEngine::V1beta::Conversation, ::Hash]
211
232
  # The conversation to be used by auto session only. The name field will be
@@ -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)
@@ -336,7 +356,7 @@ module Google
336
356
  #
337
357
  # @param parent [::String]
338
358
  # Required. Full resource name of parent data store. Format:
339
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
359
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
340
360
  # @param conversation [::Google::Cloud::DiscoveryEngine::V1beta::Conversation, ::Hash]
341
361
  # Required. The conversation to create.
342
362
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -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)
@@ -421,7 +440,7 @@ module Google
421
440
  #
422
441
  # @param name [::String]
423
442
  # Required. The resource name of the Conversation to delete. Format:
424
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
443
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
425
444
  # @yield [result, operation] Access the result along with the TransportOperation object
426
445
  # @yieldparam result [::Google::Protobuf::Empty]
427
446
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -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)
@@ -593,7 +610,7 @@ module Google
593
610
  #
594
611
  # @param name [::String]
595
612
  # Required. The resource name of the Conversation to get. Format:
596
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
613
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
597
614
  # @yield [result, operation] Access the result along with the TransportOperation object
598
615
  # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Conversation]
599
616
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -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)
@@ -674,7 +690,7 @@ module Google
674
690
  #
675
691
  # @param parent [::String]
676
692
  # Required. The data store resource name. Format:
677
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
693
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
678
694
  # @param page_size [::Integer]
679
695
  # Maximum number of results to return. If unspecified, defaults
680
696
  # to 50. Max allowed value is 1000.
@@ -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)
@@ -775,7 +791,7 @@ module Google
775
791
  # @param options [::Gapic::CallOptions, ::Hash]
776
792
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
777
793
  #
778
- # @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil)
794
+ # @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil)
779
795
  # Pass arguments to `answer_query` via keyword arguments. Note that at
780
796
  # least one keyword argument is required. To specify no parameters, or to keep all
781
797
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -800,6 +816,8 @@ module Google
800
816
  # Model specification.
801
817
  # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash]
802
818
  # Related questions specification.
819
+ # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::GroundingSpec, ::Hash]
820
+ # Optional. Grounding specification.
803
821
  # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec, ::Hash]
804
822
  # Answer generation specification.
805
823
  # @param search_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec, ::Hash]
@@ -807,6 +825,9 @@ module Google
807
825
  # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash]
808
826
  # Query understanding specification.
809
827
  # @param asynchronous_mode [::Boolean]
828
+ # Deprecated: This field is deprecated. Streaming Answer API will be
829
+ # supported.
830
+ #
810
831
  # Asynchronous mode control.
811
832
  #
812
833
  # If enabled, the response will be returned with answer/session resource
@@ -897,7 +918,6 @@ module Google
897
918
 
898
919
  @conversational_search_service_stub.answer_query request, options do |result, operation|
899
920
  yield result, operation if block_given?
900
- return result
901
921
  end
902
922
  rescue ::Gapic::Rest::Error => e
903
923
  raise ::Google::Cloud::Error.from_error(e)
@@ -923,7 +943,7 @@ module Google
923
943
  #
924
944
  # @param name [::String]
925
945
  # Required. The resource name of the Answer to get. Format:
926
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
946
+ # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
927
947
  # @yield [result, operation] Access the result along with the TransportOperation object
928
948
  # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Answer]
929
949
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -977,7 +997,6 @@ module Google
977
997
 
978
998
  @conversational_search_service_stub.get_answer request, options do |result, operation|
979
999
  yield result, operation if block_given?
980
- return result
981
1000
  end
982
1001
  rescue ::Gapic::Rest::Error => e
983
1002
  raise ::Google::Cloud::Error.from_error(e)
@@ -1006,7 +1025,7 @@ module Google
1006
1025
  #
1007
1026
  # @param parent [::String]
1008
1027
  # Required. Full resource name of parent data store. Format:
1009
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
1028
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
1010
1029
  # @param session [::Google::Cloud::DiscoveryEngine::V1beta::Session, ::Hash]
1011
1030
  # Required. The session to create.
1012
1031
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -1062,7 +1081,6 @@ module Google
1062
1081
 
1063
1082
  @conversational_search_service_stub.create_session request, options do |result, operation|
1064
1083
  yield result, operation if block_given?
1065
- return result
1066
1084
  end
1067
1085
  rescue ::Gapic::Rest::Error => e
1068
1086
  raise ::Google::Cloud::Error.from_error(e)
@@ -1091,7 +1109,7 @@ module Google
1091
1109
  #
1092
1110
  # @param name [::String]
1093
1111
  # Required. The resource name of the Session to delete. Format:
1094
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1112
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1095
1113
  # @yield [result, operation] Access the result along with the TransportOperation object
1096
1114
  # @yieldparam result [::Google::Protobuf::Empty]
1097
1115
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1145,7 +1163,6 @@ module Google
1145
1163
 
1146
1164
  @conversational_search_service_stub.delete_session request, options do |result, operation|
1147
1165
  yield result, operation if block_given?
1148
- return result
1149
1166
  end
1150
1167
  rescue ::Gapic::Rest::Error => e
1151
1168
  raise ::Google::Cloud::Error.from_error(e)
@@ -1236,7 +1253,6 @@ module Google
1236
1253
 
1237
1254
  @conversational_search_service_stub.update_session request, options do |result, operation|
1238
1255
  yield result, operation if block_given?
1239
- return result
1240
1256
  end
1241
1257
  rescue ::Gapic::Rest::Error => e
1242
1258
  raise ::Google::Cloud::Error.from_error(e)
@@ -1262,7 +1278,7 @@ module Google
1262
1278
  #
1263
1279
  # @param name [::String]
1264
1280
  # Required. The resource name of the Session to get. Format:
1265
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1281
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1266
1282
  # @yield [result, operation] Access the result along with the TransportOperation object
1267
1283
  # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Session]
1268
1284
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1316,7 +1332,6 @@ module Google
1316
1332
 
1317
1333
  @conversational_search_service_stub.get_session request, options do |result, operation|
1318
1334
  yield result, operation if block_given?
1319
- return result
1320
1335
  end
1321
1336
  rescue ::Gapic::Rest::Error => e
1322
1337
  raise ::Google::Cloud::Error.from_error(e)
@@ -1343,7 +1358,7 @@ module Google
1343
1358
  #
1344
1359
  # @param parent [::String]
1345
1360
  # Required. The data store resource name. Format:
1346
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
1361
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
1347
1362
  # @param page_size [::Integer]
1348
1363
  # Maximum number of results to return. If unspecified, defaults
1349
1364
  # to 50. Max allowed value is 1000.
@@ -1425,7 +1440,7 @@ module Google
1425
1440
  @conversational_search_service_stub.list_sessions request, options do |result, operation|
1426
1441
  result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, "sessions", request, result, options
1427
1442
  yield result, operation if block_given?
1428
- return result
1443
+ throw :response, result
1429
1444
  end
1430
1445
  rescue ::Gapic::Rest::Error => e
1431
1446
  raise ::Google::Cloud::Error.from_error(e)
@@ -1505,6 +1520,11 @@ module Google
1505
1520
  # default endpoint URL. The default value of nil uses the environment
1506
1521
  # universe (usually the default "googleapis.com" universe).
1507
1522
  # @return [::String,nil]
1523
+ # @!attribute [rw] logger
1524
+ # A custom logger to use for request/response debug logging, or the value
1525
+ # `:default` (the default) to construct a default logger, or `nil` to
1526
+ # explicitly disable logging.
1527
+ # @return [::Logger,:default,nil]
1508
1528
  #
1509
1529
  class Configuration
1510
1530
  extend ::Gapic::Config
@@ -1526,6 +1546,7 @@ module Google
1526
1546
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1527
1547
  config_attr :quota_project, nil, ::String, nil
1528
1548
  config_attr :universe_domain, nil, ::String, nil
1549
+ config_attr :logger, :default, ::Logger, nil, :default
1529
1550
 
1530
1551
  # @private
1531
1552
  def initialize parent_config = nil
@@ -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 converse_conversation 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: "converse_conversation",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse.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: "create_conversation",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Conversation.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: "delete_conversation",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Protobuf::Empty.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: "update_conversation",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Conversation.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: "get_conversation",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Conversation.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
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "list_conversations",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::DiscoveryEngine::V1beta::ListConversationsResponse.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -315,16 +339,18 @@ module Google
315
339
 
316
340
  response = @client_stub.make_http_request(
317
341
  verb,
318
- uri: uri,
319
- body: body || "",
320
- params: query_string_params,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "answer_query",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse.decode_json response.body, ignore_unknown_fields: true
325
-
326
- yield result, operation if block_given?
327
- result
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
328
354
  end
329
355
 
330
356
  ##
@@ -353,16 +379,18 @@ module Google
353
379
 
354
380
  response = @client_stub.make_http_request(
355
381
  verb,
356
- uri: uri,
357
- body: body || "",
358
- params: query_string_params,
382
+ uri: uri,
383
+ body: body || "",
384
+ params: query_string_params,
385
+ method_name: "get_answer",
359
386
  options: options
360
387
  )
361
388
  operation = ::Gapic::Rest::TransportOperation.new response
362
389
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Answer.decode_json response.body, ignore_unknown_fields: true
363
-
364
- yield result, operation if block_given?
365
- result
390
+ catch :response do
391
+ yield result, operation if block_given?
392
+ result
393
+ end
366
394
  end
367
395
 
368
396
  ##
@@ -391,16 +419,18 @@ module Google
391
419
 
392
420
  response = @client_stub.make_http_request(
393
421
  verb,
394
- uri: uri,
395
- body: body || "",
396
- params: query_string_params,
422
+ uri: uri,
423
+ body: body || "",
424
+ params: query_string_params,
425
+ method_name: "create_session",
397
426
  options: options
398
427
  )
399
428
  operation = ::Gapic::Rest::TransportOperation.new response
400
429
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Session.decode_json response.body, ignore_unknown_fields: true
401
-
402
- yield result, operation if block_given?
403
- result
430
+ catch :response do
431
+ yield result, operation if block_given?
432
+ result
433
+ end
404
434
  end
405
435
 
406
436
  ##
@@ -429,16 +459,18 @@ module Google
429
459
 
430
460
  response = @client_stub.make_http_request(
431
461
  verb,
432
- uri: uri,
433
- body: body || "",
434
- params: query_string_params,
462
+ uri: uri,
463
+ body: body || "",
464
+ params: query_string_params,
465
+ method_name: "delete_session",
435
466
  options: options
436
467
  )
437
468
  operation = ::Gapic::Rest::TransportOperation.new response
438
469
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
439
-
440
- yield result, operation if block_given?
441
- result
470
+ catch :response do
471
+ yield result, operation if block_given?
472
+ result
473
+ end
442
474
  end
443
475
 
444
476
  ##
@@ -467,16 +499,18 @@ module Google
467
499
 
468
500
  response = @client_stub.make_http_request(
469
501
  verb,
470
- uri: uri,
471
- body: body || "",
472
- params: query_string_params,
502
+ uri: uri,
503
+ body: body || "",
504
+ params: query_string_params,
505
+ method_name: "update_session",
473
506
  options: options
474
507
  )
475
508
  operation = ::Gapic::Rest::TransportOperation.new response
476
509
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Session.decode_json response.body, ignore_unknown_fields: true
477
-
478
- yield result, operation if block_given?
479
- result
510
+ catch :response do
511
+ yield result, operation if block_given?
512
+ result
513
+ end
480
514
  end
481
515
 
482
516
  ##
@@ -505,16 +539,18 @@ module Google
505
539
 
506
540
  response = @client_stub.make_http_request(
507
541
  verb,
508
- uri: uri,
509
- body: body || "",
510
- params: query_string_params,
542
+ uri: uri,
543
+ body: body || "",
544
+ params: query_string_params,
545
+ method_name: "get_session",
511
546
  options: options
512
547
  )
513
548
  operation = ::Gapic::Rest::TransportOperation.new response
514
549
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Session.decode_json response.body, ignore_unknown_fields: true
515
-
516
- yield result, operation if block_given?
517
- result
550
+ catch :response do
551
+ yield result, operation if block_given?
552
+ result
553
+ end
518
554
  end
519
555
 
520
556
  ##
@@ -543,16 +579,18 @@ module Google
543
579
 
544
580
  response = @client_stub.make_http_request(
545
581
  verb,
546
- uri: uri,
547
- body: body || "",
548
- params: query_string_params,
582
+ uri: uri,
583
+ body: body || "",
584
+ params: query_string_params,
585
+ method_name: "list_sessions",
549
586
  options: options
550
587
  )
551
588
  operation = ::Gapic::Rest::TransportOperation.new response
552
589
  result = ::Google::Cloud::DiscoveryEngine::V1beta::ListSessionsResponse.decode_json response.body, ignore_unknown_fields: true
553
-
554
- yield result, operation if block_given?
555
- result
590
+ catch :response do
591
+ yield result, operation if block_given?
592
+ result
593
+ end
556
594
  end
557
595
 
558
596
  ##