google-cloud-discovery_engine-v1beta 0.13.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -1
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +219 -0
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +205 -0
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +136 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +19 -1
  7. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +19 -1
  8. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +10 -1
  9. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +10 -1
  10. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +3 -1
  11. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +3 -1
  12. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/paths.rb +68 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +50 -1
  14. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +68 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +50 -1
  16. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +139 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +132 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +75 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  20. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
  21. data/lib/google/cloud/discoveryengine/v1beta/completion_pb.rb +2 -1
  22. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +1 -1
  23. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +8 -0
  24. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
  25. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
  26. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +2 -1
  27. data/lib/google/cloud/discoveryengine/v1beta/data_store_service_pb.rb +1 -1
  28. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +6 -1
  29. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +7 -1
  30. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +16 -1
  31. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +2 -1
  32. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +5 -0
  33. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +14 -0
  34. data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +31 -0
  35. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +28 -0
  36. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +16 -0
  37. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +25 -0
  38. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +10 -0
  39. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +114 -0
  40. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +119 -0
  41. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +332 -0
  42. metadata +2 -2
@@ -824,7 +824,7 @@ module Google
824
824
  # @param options [::Gapic::CallOptions, ::Hash]
825
825
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
826
826
  #
827
- # @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)
827
+ # @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)
828
828
  # Pass arguments to `answer_query` via keyword arguments. Note that at
829
829
  # least one keyword argument is required. To specify no parameters, or to keep all
830
830
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -875,6 +875,24 @@ module Google
875
875
  #
876
876
  # The field must be a UTF-8 encoded string with a length limit of 128
877
877
  # characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
878
+ # @param user_labels [::Hash{::String => ::String}]
879
+ # The user labels applied to a resource must meet the following requirements:
880
+ #
881
+ # * Each resource can have multiple labels, up to a maximum of 64.
882
+ # * Each label must be a key-value pair.
883
+ # * Keys have a minimum length of 1 character and a maximum length of 63
884
+ # characters and cannot be empty. Values can be empty and have a maximum
885
+ # length of 63 characters.
886
+ # * Keys and values can contain only lowercase letters, numeric characters,
887
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
888
+ # international characters are allowed.
889
+ # * The key portion of a label must be unique. However, you can use the same
890
+ # key with multiple resources.
891
+ # * Keys must start with a lowercase letter or international character.
892
+ #
893
+ # See [Google Cloud
894
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
895
+ # for more details.
878
896
  #
879
897
  # @yield [response, operation] Access the result along with the RPC operation
880
898
  # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse]
@@ -775,7 +775,7 @@ module Google
775
775
  # @param options [::Gapic::CallOptions, ::Hash]
776
776
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
777
777
  #
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)
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)
779
779
  # Pass arguments to `answer_query` via keyword arguments. Note that at
780
780
  # least one keyword argument is required. To specify no parameters, or to keep all
781
781
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -826,6 +826,24 @@ module Google
826
826
  #
827
827
  # The field must be a UTF-8 encoded string with a length limit of 128
828
828
  # characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
829
+ # @param user_labels [::Hash{::String => ::String}]
830
+ # The user labels applied to a resource must meet the following requirements:
831
+ #
832
+ # * Each resource can have multiple labels, up to a maximum of 64.
833
+ # * Each label must be a key-value pair.
834
+ # * Keys have a minimum length of 1 character and a maximum length of 63
835
+ # characters and cannot be empty. Values can be empty and have a maximum
836
+ # length of 63 characters.
837
+ # * Keys and values can contain only lowercase letters, numeric characters,
838
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
839
+ # international characters are allowed.
840
+ # * The key portion of a label must be unique. However, you can use the same
841
+ # key with multiple resources.
842
+ # * Keys must start with a lowercase letter or international character.
843
+ #
844
+ # See [Google Cloud
845
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
846
+ # for more details.
829
847
  # @yield [result, operation] Access the result along with the TransportOperation object
830
848
  # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryResponse]
831
849
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -212,7 +212,7 @@ module Google
212
212
  # @param options [::Gapic::CallOptions, ::Hash]
213
213
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
214
214
  #
215
- # @overload create_data_store(parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil)
215
+ # @overload create_data_store(parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil, skip_default_schema_creation: nil)
216
216
  # Pass arguments to `create_data_store` via keyword arguments. Note that at
217
217
  # least one keyword argument is required. To specify no parameters, or to keep all
218
218
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -238,6 +238,15 @@ module Google
238
238
  # If the data store is not configured as site
239
239
  # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will
240
240
  # be ignored.
241
+ # @param skip_default_schema_creation [::Boolean]
242
+ # A boolean flag indicating whether to skip the default schema creation for
243
+ # the data store. Only enable this flag if you are certain that the default
244
+ # schema is incompatible with your use case.
245
+ #
246
+ # If set to true, you must manually create a schema for the data store before
247
+ # any documents can be ingested.
248
+ #
249
+ # This flag cannot be specified if `data_store.starting_schema` is specified.
241
250
  #
242
251
  # @yield [response, operation] Access the result along with the RPC operation
243
252
  # @yieldparam response [::Gapic::Operation]
@@ -205,7 +205,7 @@ module Google
205
205
  # @param options [::Gapic::CallOptions, ::Hash]
206
206
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
207
207
  #
208
- # @overload create_data_store(parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil)
208
+ # @overload create_data_store(parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil, skip_default_schema_creation: nil)
209
209
  # Pass arguments to `create_data_store` via keyword arguments. Note that at
210
210
  # least one keyword argument is required. To specify no parameters, or to keep all
211
211
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -231,6 +231,15 @@ module Google
231
231
  # If the data store is not configured as site
232
232
  # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will
233
233
  # be ignored.
234
+ # @param skip_default_schema_creation [::Boolean]
235
+ # A boolean flag indicating whether to skip the default schema creation for
236
+ # the data store. Only enable this flag if you are certain that the default
237
+ # schema is incompatible with your use case.
238
+ #
239
+ # If set to true, you must manually create a schema for the data store before
240
+ # any documents can be ingested.
241
+ #
242
+ # This flag cannot be specified if `data_store.starting_schema` is specified.
234
243
  # @yield [result, operation] Access the result along with the TransportOperation object
235
244
  # @yieldparam result [::Gapic::Operation]
236
245
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -739,7 +739,7 @@ module Google
739
739
  # @param options [::Gapic::CallOptions, ::Hash]
740
740
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
741
741
  #
742
- # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil)
742
+ # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, alloy_db_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil)
743
743
  # Pass arguments to `import_documents` via keyword arguments. Note that at
744
744
  # least one keyword argument is required. To specify no parameters, or to keep all
745
745
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -758,6 +758,8 @@ module Google
758
758
  # Cloud SQL input source.
759
759
  # @param firestore_source [::Google::Cloud::DiscoveryEngine::V1beta::FirestoreSource, ::Hash]
760
760
  # Firestore input source.
761
+ # @param alloy_db_source [::Google::Cloud::DiscoveryEngine::V1beta::AlloyDbSource, ::Hash]
762
+ # AlloyDB input source.
761
763
  # @param bigtable_source [::Google::Cloud::DiscoveryEngine::V1beta::BigtableSource, ::Hash]
762
764
  # Cloud Bigtable input source.
763
765
  # @param parent [::String]
@@ -697,7 +697,7 @@ module Google
697
697
  # @param options [::Gapic::CallOptions, ::Hash]
698
698
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
699
699
  #
700
- # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil)
700
+ # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, alloy_db_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil)
701
701
  # Pass arguments to `import_documents` via keyword arguments. Note that at
702
702
  # least one keyword argument is required. To specify no parameters, or to keep all
703
703
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -716,6 +716,8 @@ module Google
716
716
  # Cloud SQL input source.
717
717
  # @param firestore_source [::Google::Cloud::DiscoveryEngine::V1beta::FirestoreSource, ::Hash]
718
718
  # Firestore input source.
719
+ # @param alloy_db_source [::Google::Cloud::DiscoveryEngine::V1beta::AlloyDbSource, ::Hash]
720
+ # AlloyDB input source.
719
721
  # @param bigtable_source [::Google::Cloud::DiscoveryEngine::V1beta::BigtableSource, ::Hash]
720
722
  # Cloud Bigtable input source.
721
723
  # @param parent [::String]
@@ -241,6 +241,74 @@ module Google
241
241
  resource.call(**args)
242
242
  end
243
243
 
244
+ ##
245
+ # Create a fully-qualified Session resource string.
246
+ #
247
+ # @overload session_path(project:, location:, data_store:, session:)
248
+ # The resource will be in the following format:
249
+ #
250
+ # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}`
251
+ #
252
+ # @param project [String]
253
+ # @param location [String]
254
+ # @param data_store [String]
255
+ # @param session [String]
256
+ #
257
+ # @overload session_path(project:, location:, collection:, data_store:, session:)
258
+ # The resource will be in the following format:
259
+ #
260
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}`
261
+ #
262
+ # @param project [String]
263
+ # @param location [String]
264
+ # @param collection [String]
265
+ # @param data_store [String]
266
+ # @param session [String]
267
+ #
268
+ # @overload session_path(project:, location:, collection:, engine:, session:)
269
+ # The resource will be in the following format:
270
+ #
271
+ # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`
272
+ #
273
+ # @param project [String]
274
+ # @param location [String]
275
+ # @param collection [String]
276
+ # @param engine [String]
277
+ # @param session [String]
278
+ #
279
+ # @return [::String]
280
+ def session_path **args
281
+ resources = {
282
+ "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:|
283
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
284
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
285
+ raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
286
+
287
+ "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}"
288
+ end),
289
+ "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:|
290
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
291
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
292
+ raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
293
+ raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
294
+
295
+ "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}"
296
+ end),
297
+ "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:|
298
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
299
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
300
+ raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
301
+ raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/"
302
+
303
+ "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}"
304
+ end)
305
+ }
306
+
307
+ resource = resources[args.keys.sort.join(":")]
308
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
309
+ resource.call(**args)
310
+ end
311
+
244
312
  extend self
245
313
  end
246
314
  end
@@ -196,7 +196,7 @@ module Google
196
196
  # @param options [::Gapic::CallOptions, ::Hash]
197
197
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
198
198
  #
199
- # @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, embedding_spec: nil, ranking_expression: nil, safe_search: nil, user_labels: nil)
199
+ # @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, region_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, embedding_spec: nil, ranking_expression: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, session: nil, session_spec: nil)
200
200
  # Pass arguments to `search` via keyword arguments. Note that at
201
201
  # least one keyword argument is required. To specify no parameters, or to keep all
202
202
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -295,6 +295,17 @@ module Google
295
295
  # Highly recommended for analytics.
296
296
  # {::Google::Cloud::DiscoveryEngine::V1beta::UserInfo#user_agent UserInfo.user_agent}
297
297
  # is used to deduce `device_type` for analytics.
298
+ # @param language_code [::String]
299
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
300
+ # information, see [Standard
301
+ # fields](https://cloud.google.com/apis/design/standard_fields). This field
302
+ # helps to better interpret the query. If a value isn't specified, the query
303
+ # language code is automatically detected, which may not be accurate.
304
+ # @param region_code [::String]
305
+ # The Unicode country/region code (CLDR) of a location, such as "US" and
306
+ # "419". For more information, see [Standard
307
+ # fields](https://cloud.google.com/apis/design/standard_fields). If set,
308
+ # then results will be boosted based on the region_code provided.
298
309
  # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec, ::Hash>]
299
310
  # Facet specifications for faceted search. If empty, no facets are returned.
300
311
  #
@@ -402,6 +413,44 @@ module Google
402
413
  # See [Google Cloud
403
414
  # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
404
415
  # for more details.
416
+ # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash]
417
+ # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional
418
+ # natural language query understanding will be done.
419
+ # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec, ::Hash]
420
+ # Search as you type configuration. Only supported for the
421
+ # {::Google::Cloud::DiscoveryEngine::V1beta::IndustryVertical::MEDIA IndustryVertical.MEDIA}
422
+ # vertical.
423
+ # @param session [::String]
424
+ # The session resource name. Optional.
425
+ #
426
+ # Session allows users to do multi-turn /search API calls or coordination
427
+ # between /search API calls and /answer API calls.
428
+ #
429
+ # Example #1 (multi-turn /search API calls):
430
+ # 1. Call /search API with the auto-session mode (see below).
431
+ # 2. Call /search API with the session ID generated in the first call.
432
+ # Here, the previous search query gets considered in query
433
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
434
+ # and the current query is "How about 2023?", the current query will
435
+ # be interpreted as "How did Alphabet do in 2023?".
436
+ #
437
+ # Example #2 (coordination between /search API calls and /answer API calls):
438
+ # 1. Call /search API with the auto-session mode (see below).
439
+ # 2. Call /answer API with the session ID generated in the first call.
440
+ # Here, the answer generation happens in the context of the search
441
+ # results from the first search call.
442
+ #
443
+ # Auto-session mode: when `projects/.../sessions/-` is used, a new session
444
+ # gets automatically created. Otherwise, users can use the create-session API
445
+ # to create a session manually.
446
+ #
447
+ # Multi-turn Search feature is currently at private GA stage. Please use
448
+ # v1alpha or v1beta version instead before we launch this feature to public
449
+ # GA. Or ask for allowlisting through Google Support team.
450
+ # @param session_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SessionSpec, ::Hash]
451
+ # Session specification.
452
+ #
453
+ # Can be used only when `session` is set.
405
454
  #
406
455
  # @yield [response, operation] Access the result along with the RPC operation
407
456
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult>]
@@ -186,6 +186,74 @@ module Google
186
186
  resource.call(**args)
187
187
  end
188
188
 
189
+ ##
190
+ # Create a fully-qualified Session resource string.
191
+ #
192
+ # @overload session_path(project:, location:, data_store:, session:)
193
+ # The resource will be in the following format:
194
+ #
195
+ # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}`
196
+ #
197
+ # @param project [String]
198
+ # @param location [String]
199
+ # @param data_store [String]
200
+ # @param session [String]
201
+ #
202
+ # @overload session_path(project:, location:, collection:, data_store:, session:)
203
+ # The resource will be in the following format:
204
+ #
205
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}`
206
+ #
207
+ # @param project [String]
208
+ # @param location [String]
209
+ # @param collection [String]
210
+ # @param data_store [String]
211
+ # @param session [String]
212
+ #
213
+ # @overload session_path(project:, location:, collection:, engine:, session:)
214
+ # The resource will be in the following format:
215
+ #
216
+ # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`
217
+ #
218
+ # @param project [String]
219
+ # @param location [String]
220
+ # @param collection [String]
221
+ # @param engine [String]
222
+ # @param session [String]
223
+ #
224
+ # @return [::String]
225
+ def session_path **args
226
+ resources = {
227
+ "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:|
228
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
229
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
230
+ raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
231
+
232
+ "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}"
233
+ end),
234
+ "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:|
235
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
236
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
237
+ raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
238
+ raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
239
+
240
+ "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}"
241
+ end),
242
+ "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:|
243
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
244
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
245
+ raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
246
+ raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/"
247
+
248
+ "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}"
249
+ end)
250
+ }
251
+
252
+ resource = resources[args.keys.sort.join(":")]
253
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
254
+ resource.call(**args)
255
+ end
256
+
189
257
  extend self
190
258
  end
191
259
  end
@@ -189,7 +189,7 @@ module Google
189
189
  # @param options [::Gapic::CallOptions, ::Hash]
190
190
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
191
191
  #
192
- # @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, embedding_spec: nil, ranking_expression: nil, safe_search: nil, user_labels: nil)
192
+ # @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, region_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, embedding_spec: nil, ranking_expression: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, session: nil, session_spec: nil)
193
193
  # Pass arguments to `search` via keyword arguments. Note that at
194
194
  # least one keyword argument is required. To specify no parameters, or to keep all
195
195
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -288,6 +288,17 @@ module Google
288
288
  # Highly recommended for analytics.
289
289
  # {::Google::Cloud::DiscoveryEngine::V1beta::UserInfo#user_agent UserInfo.user_agent}
290
290
  # is used to deduce `device_type` for analytics.
291
+ # @param language_code [::String]
292
+ # The BCP-47 language code, such as "en-US" or "sr-Latn". For more
293
+ # information, see [Standard
294
+ # fields](https://cloud.google.com/apis/design/standard_fields). This field
295
+ # helps to better interpret the query. If a value isn't specified, the query
296
+ # language code is automatically detected, which may not be accurate.
297
+ # @param region_code [::String]
298
+ # The Unicode country/region code (CLDR) of a location, such as "US" and
299
+ # "419". For more information, see [Standard
300
+ # fields](https://cloud.google.com/apis/design/standard_fields). If set,
301
+ # then results will be boosted based on the region_code provided.
291
302
  # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec, ::Hash>]
292
303
  # Facet specifications for faceted search. If empty, no facets are returned.
293
304
  #
@@ -395,6 +406,44 @@ module Google
395
406
  # See [Google Cloud
396
407
  # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
397
408
  # for more details.
409
+ # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash]
410
+ # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional
411
+ # natural language query understanding will be done.
412
+ # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SearchAsYouTypeSpec, ::Hash]
413
+ # Search as you type configuration. Only supported for the
414
+ # {::Google::Cloud::DiscoveryEngine::V1beta::IndustryVertical::MEDIA IndustryVertical.MEDIA}
415
+ # vertical.
416
+ # @param session [::String]
417
+ # The session resource name. Optional.
418
+ #
419
+ # Session allows users to do multi-turn /search API calls or coordination
420
+ # between /search API calls and /answer API calls.
421
+ #
422
+ # Example #1 (multi-turn /search API calls):
423
+ # 1. Call /search API with the auto-session mode (see below).
424
+ # 2. Call /search API with the session ID generated in the first call.
425
+ # Here, the previous search query gets considered in query
426
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
427
+ # and the current query is "How about 2023?", the current query will
428
+ # be interpreted as "How did Alphabet do in 2023?".
429
+ #
430
+ # Example #2 (coordination between /search API calls and /answer API calls):
431
+ # 1. Call /search API with the auto-session mode (see below).
432
+ # 2. Call /answer API with the session ID generated in the first call.
433
+ # Here, the answer generation happens in the context of the search
434
+ # results from the first search call.
435
+ #
436
+ # Auto-session mode: when `projects/.../sessions/-` is used, a new session
437
+ # gets automatically created. Otherwise, users can use the create-session API
438
+ # to create a session manually.
439
+ #
440
+ # Multi-turn Search feature is currently at private GA stage. Please use
441
+ # v1alpha or v1beta version instead before we launch this feature to public
442
+ # GA. Or ask for allowlisting through Google Support team.
443
+ # @param session_spec [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SessionSpec, ::Hash]
444
+ # Session specification.
445
+ #
446
+ # Can be used only when `session` is set.
398
447
  # @yield [result, operation] Access the result along with the TransportOperation object
399
448
  # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse]
400
449
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -405,6 +405,138 @@ module Google
405
405
  raise ::Google::Cloud::Error.from_error(e)
406
406
  end
407
407
 
408
+ ##
409
+ # Deletes permanently all user events specified by the filter provided.
410
+ # Depending on the number of events specified by the filter, this operation
411
+ # could take hours or days to complete. To test a filter, use the list
412
+ # command first.
413
+ #
414
+ # @overload purge_user_events(request, options = nil)
415
+ # Pass arguments to `purge_user_events` via a request object, either of type
416
+ # {::Google::Cloud::DiscoveryEngine::V1beta::PurgeUserEventsRequest} or an equivalent Hash.
417
+ #
418
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::PurgeUserEventsRequest, ::Hash]
419
+ # A request object representing the call parameters. Required. To specify no
420
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
421
+ # @param options [::Gapic::CallOptions, ::Hash]
422
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
423
+ #
424
+ # @overload purge_user_events(parent: nil, filter: nil, force: nil)
425
+ # Pass arguments to `purge_user_events` via keyword arguments. Note that at
426
+ # least one keyword argument is required. To specify no parameters, or to keep all
427
+ # the default parameter values, pass an empty Hash as a request object (see above).
428
+ #
429
+ # @param parent [::String]
430
+ # Required. The resource name of the catalog under which the events are
431
+ # created. The format is
432
+ # `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
433
+ # @param filter [::String]
434
+ # Required. The filter string to specify the events to be deleted with a
435
+ # length limit of 5,000 characters. The eligible fields for filtering are:
436
+ #
437
+ # * `eventType`: Double quoted
438
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UserEvent#event_type UserEvent.event_type}
439
+ # string.
440
+ # * `eventTime`: in ISO 8601 "zulu" format.
441
+ # * `userPseudoId`: Double quoted string. Specifying this will delete all
442
+ # events associated with a visitor.
443
+ # * `userId`: Double quoted string. Specifying this will delete all events
444
+ # associated with a user.
445
+ #
446
+ # Examples:
447
+ #
448
+ # * Deleting all events in a time range:
449
+ # `eventTime > "2012-04-23T18:25:43.511Z"
450
+ # eventTime < "2012-04-23T18:30:43.511Z"`
451
+ # * Deleting specific eventType:
452
+ # `eventType = "search"`
453
+ # * Deleting all events for a specific visitor:
454
+ # `userPseudoId = "visitor1024"`
455
+ # * Deleting all events inside a DataStore:
456
+ # `*`
457
+ #
458
+ # The filtering fields are assumed to have an implicit AND.
459
+ # @param force [::Boolean]
460
+ # The `force` field is currently not supported. Purge user event requests
461
+ # will permanently delete all purgeable events. Once the development is
462
+ # complete:
463
+ # If `force` is set to false, the method will return the expected
464
+ # purge count without deleting any user events. This field will default to
465
+ # false if not included in the request.
466
+ #
467
+ # @yield [response, operation] Access the result along with the RPC operation
468
+ # @yieldparam response [::Gapic::Operation]
469
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
470
+ #
471
+ # @return [::Gapic::Operation]
472
+ #
473
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
474
+ #
475
+ # @example Basic example
476
+ # require "google/cloud/discovery_engine/v1beta"
477
+ #
478
+ # # Create a client object. The client can be reused for multiple calls.
479
+ # client = Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Client.new
480
+ #
481
+ # # Create a request. To set request fields, pass in keyword arguments.
482
+ # request = Google::Cloud::DiscoveryEngine::V1beta::PurgeUserEventsRequest.new
483
+ #
484
+ # # Call the purge_user_events method.
485
+ # result = client.purge_user_events request
486
+ #
487
+ # # The returned object is of type Gapic::Operation. You can use it to
488
+ # # check the status of an operation, cancel it, or wait for results.
489
+ # # Here is how to wait for a response.
490
+ # result.wait_until_done! timeout: 60
491
+ # if result.response?
492
+ # p result.response
493
+ # else
494
+ # puts "No response received."
495
+ # end
496
+ #
497
+ def purge_user_events request, options = nil
498
+ raise ::ArgumentError, "request must be provided" if request.nil?
499
+
500
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::PurgeUserEventsRequest
501
+
502
+ # Converts hash and nil to an options object
503
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
504
+
505
+ # Customize the options with defaults
506
+ metadata = @config.rpcs.purge_user_events.metadata.to_h
507
+
508
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
509
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
510
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
511
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
512
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
513
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
514
+
515
+ header_params = {}
516
+ if request.parent
517
+ header_params["parent"] = request.parent
518
+ end
519
+
520
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
521
+ metadata[:"x-goog-request-params"] ||= request_params_header
522
+
523
+ options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout,
524
+ metadata: metadata,
525
+ retry_policy: @config.rpcs.purge_user_events.retry_policy
526
+
527
+ options.apply_defaults timeout: @config.timeout,
528
+ metadata: @config.metadata,
529
+ retry_policy: @config.retry_policy
530
+
531
+ @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation|
532
+ response = ::Gapic::Operation.new response, @operations_client, options: options
533
+ yield response, operation if block_given?
534
+ return response
535
+ end
536
+ rescue ::GRPC::BadStatus => e
537
+ raise ::Google::Cloud::Error.from_error(e)
538
+ end
539
+
408
540
  ##
409
541
  # Bulk import of user events. Request processing might be
410
542
  # synchronous. Events that already exist are skipped.
@@ -679,6 +811,11 @@ module Google
679
811
  #
680
812
  attr_reader :collect_user_event
681
813
  ##
814
+ # RPC-specific configuration for `purge_user_events`
815
+ # @return [::Gapic::Config::Method]
816
+ #
817
+ attr_reader :purge_user_events
818
+ ##
682
819
  # RPC-specific configuration for `import_user_events`
683
820
  # @return [::Gapic::Config::Method]
684
821
  #
@@ -690,6 +827,8 @@ module Google
690
827
  @write_user_event = ::Gapic::Config::Method.new write_user_event_config
691
828
  collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event
692
829
  @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config
830
+ purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events
831
+ @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config
693
832
  import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events
694
833
  @import_user_events = ::Gapic::Config::Method.new import_user_events_config
695
834