google-cloud-discovery_engine-v1beta 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +219 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +205 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +136 -0
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +19 -1
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +19 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +10 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +10 -1
- data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +3 -1
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +3 -1
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +824 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +809 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/paths.rb +318 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +770 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +1106 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +306 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1beta/evaluation_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/rest.rb +3 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +1035 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +809 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/paths.rb +73 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +967 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +1106 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +426 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +911 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/paths.rb +69 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +850 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +366 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +60 -5
- data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +68 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +60 -5
- data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +139 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +132 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +14 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +75 -0
- data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1beta.rb +3 -0
- data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/chunk_pb.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +8 -0
- data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/data_store_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +4 -1
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_pb.rb +56 -0
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_services_pb.rb +57 -0
- data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +12 -1
- data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +7 -1
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_services_pb.rb +63 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_pb.rb +47 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_pb.rb +57 -0
- data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_services_pb.rb +59 -0
- data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +20 -1
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +5 -0
- data/proto_docs/google/api/client.rb +14 -10
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +14 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/chunk.rb +119 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +31 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +38 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +16 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +25 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +10 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +43 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation.rb +223 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation_service.rb +194 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +199 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +119 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query.rb +82 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_service.rb +179 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set.rb +57 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set_service.rb +186 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +401 -8
- data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +11 -5
- metadata +44 -2
@@ -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
|
#
|
@@ -352,20 +363,26 @@ module Google
|
|
352
363
|
# documents. This overrides
|
353
364
|
# {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig#ranking_expression ServingConfig.ranking_expression}.
|
354
365
|
# The ranking expression is a single function or multiple functions that are
|
355
|
-
#
|
366
|
+
# joined by "+".
|
367
|
+
#
|
356
368
|
# * ranking_expression = function, { " + ", function };
|
369
|
+
#
|
357
370
|
# Supported functions:
|
371
|
+
#
|
358
372
|
# * double * relevance_score
|
359
373
|
# * double * dotProduct(embedding_field_path)
|
374
|
+
#
|
360
375
|
# Function variables:
|
361
|
-
#
|
376
|
+
#
|
377
|
+
# * `relevance_score`: pre-defined keywords, used for measure relevance
|
362
378
|
# between query and document.
|
363
|
-
# `embedding_field_path`: the document embedding field
|
379
|
+
# * `embedding_field_path`: the document embedding field
|
364
380
|
# used with query embedding vector.
|
365
|
-
# `dotProduct`: embedding function between embedding_field_path and query
|
381
|
+
# * `dotProduct`: embedding function between embedding_field_path and query
|
366
382
|
# embedding vector.
|
367
383
|
#
|
368
384
|
# Example ranking expression:
|
385
|
+
#
|
369
386
|
# If document has an embedding field doc_embedding, the ranking expression
|
370
387
|
# could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
|
371
388
|
# @param safe_search [::Boolean]
|
@@ -389,6 +406,44 @@ module Google
|
|
389
406
|
# See [Google Cloud
|
390
407
|
# Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
391
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.
|
392
447
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
393
448
|
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse]
|
394
449
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1016,6 +1016,13 @@ module Google
|
|
1016
1016
|
["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false]
|
1017
1017
|
]
|
1018
1018
|
)
|
1019
|
+
.with_bindings(
|
1020
|
+
uri_method: :get,
|
1021
|
+
uri_template: "/v1beta/{name}",
|
1022
|
+
matches: [
|
1023
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false]
|
1024
|
+
]
|
1025
|
+
)
|
1019
1026
|
.with_bindings(
|
1020
1027
|
uri_method: :get,
|
1021
1028
|
uri_template: "/v1beta/{name}",
|
@@ -1023,6 +1030,13 @@ module Google
|
|
1023
1030
|
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
|
1024
1031
|
]
|
1025
1032
|
)
|
1033
|
+
.with_bindings(
|
1034
|
+
uri_method: :get,
|
1035
|
+
uri_template: "/v1beta/{name}",
|
1036
|
+
matches: [
|
1037
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/sampleQuerySets/[^/]+/operations/[^/]+/?$}, false]
|
1038
|
+
]
|
1039
|
+
)
|
1026
1040
|
.with_bindings(
|
1027
1041
|
uri_method: :get,
|
1028
1042
|
uri_template: "/v1beta/{name}",
|
@@ -1016,6 +1016,13 @@ module Google
|
|
1016
1016
|
["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false]
|
1017
1017
|
]
|
1018
1018
|
)
|
1019
|
+
.with_bindings(
|
1020
|
+
uri_method: :get,
|
1021
|
+
uri_template: "/v1beta/{name}",
|
1022
|
+
matches: [
|
1023
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false]
|
1024
|
+
]
|
1025
|
+
)
|
1019
1026
|
.with_bindings(
|
1020
1027
|
uri_method: :get,
|
1021
1028
|
uri_template: "/v1beta/{name}",
|
@@ -1023,6 +1030,13 @@ module Google
|
|
1023
1030
|
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
|
1024
1031
|
]
|
1025
1032
|
)
|
1033
|
+
.with_bindings(
|
1034
|
+
uri_method: :get,
|
1035
|
+
uri_template: "/v1beta/{name}",
|
1036
|
+
matches: [
|
1037
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/sampleQuerySets/[^/]+/operations/[^/]+/?$}, false]
|
1038
|
+
]
|
1039
|
+
)
|
1026
1040
|
.with_bindings(
|
1027
1041
|
uri_method: :get,
|
1028
1042
|
uri_template: "/v1beta/{name}",
|
@@ -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
|
|
@@ -384,6 +384,131 @@ module Google
|
|
384
384
|
raise ::Google::Cloud::Error.from_error(e)
|
385
385
|
end
|
386
386
|
|
387
|
+
##
|
388
|
+
# Deletes permanently all user events specified by the filter provided.
|
389
|
+
# Depending on the number of events specified by the filter, this operation
|
390
|
+
# could take hours or days to complete. To test a filter, use the list
|
391
|
+
# command first.
|
392
|
+
#
|
393
|
+
# @overload purge_user_events(request, options = nil)
|
394
|
+
# Pass arguments to `purge_user_events` via a request object, either of type
|
395
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::PurgeUserEventsRequest} or an equivalent Hash.
|
396
|
+
#
|
397
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1beta::PurgeUserEventsRequest, ::Hash]
|
398
|
+
# A request object representing the call parameters. Required. To specify no
|
399
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
400
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
401
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
402
|
+
#
|
403
|
+
# @overload purge_user_events(parent: nil, filter: nil, force: nil)
|
404
|
+
# Pass arguments to `purge_user_events` via keyword arguments. Note that at
|
405
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
406
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
407
|
+
#
|
408
|
+
# @param parent [::String]
|
409
|
+
# Required. The resource name of the catalog under which the events are
|
410
|
+
# created. The format is
|
411
|
+
# `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
|
412
|
+
# @param filter [::String]
|
413
|
+
# Required. The filter string to specify the events to be deleted with a
|
414
|
+
# length limit of 5,000 characters. The eligible fields for filtering are:
|
415
|
+
#
|
416
|
+
# * `eventType`: Double quoted
|
417
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::UserEvent#event_type UserEvent.event_type}
|
418
|
+
# string.
|
419
|
+
# * `eventTime`: in ISO 8601 "zulu" format.
|
420
|
+
# * `userPseudoId`: Double quoted string. Specifying this will delete all
|
421
|
+
# events associated with a visitor.
|
422
|
+
# * `userId`: Double quoted string. Specifying this will delete all events
|
423
|
+
# associated with a user.
|
424
|
+
#
|
425
|
+
# Examples:
|
426
|
+
#
|
427
|
+
# * Deleting all events in a time range:
|
428
|
+
# `eventTime > "2012-04-23T18:25:43.511Z"
|
429
|
+
# eventTime < "2012-04-23T18:30:43.511Z"`
|
430
|
+
# * Deleting specific eventType:
|
431
|
+
# `eventType = "search"`
|
432
|
+
# * Deleting all events for a specific visitor:
|
433
|
+
# `userPseudoId = "visitor1024"`
|
434
|
+
# * Deleting all events inside a DataStore:
|
435
|
+
# `*`
|
436
|
+
#
|
437
|
+
# The filtering fields are assumed to have an implicit AND.
|
438
|
+
# @param force [::Boolean]
|
439
|
+
# The `force` field is currently not supported. Purge user event requests
|
440
|
+
# will permanently delete all purgeable events. Once the development is
|
441
|
+
# complete:
|
442
|
+
# If `force` is set to false, the method will return the expected
|
443
|
+
# purge count without deleting any user events. This field will default to
|
444
|
+
# false if not included in the request.
|
445
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
446
|
+
# @yieldparam result [::Gapic::Operation]
|
447
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
448
|
+
#
|
449
|
+
# @return [::Gapic::Operation]
|
450
|
+
#
|
451
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
452
|
+
#
|
453
|
+
# @example Basic example
|
454
|
+
# require "google/cloud/discovery_engine/v1beta"
|
455
|
+
#
|
456
|
+
# # Create a client object. The client can be reused for multiple calls.
|
457
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Rest::Client.new
|
458
|
+
#
|
459
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
460
|
+
# request = Google::Cloud::DiscoveryEngine::V1beta::PurgeUserEventsRequest.new
|
461
|
+
#
|
462
|
+
# # Call the purge_user_events method.
|
463
|
+
# result = client.purge_user_events request
|
464
|
+
#
|
465
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
466
|
+
# # check the status of an operation, cancel it, or wait for results.
|
467
|
+
# # Here is how to wait for a response.
|
468
|
+
# result.wait_until_done! timeout: 60
|
469
|
+
# if result.response?
|
470
|
+
# p result.response
|
471
|
+
# else
|
472
|
+
# puts "No response received."
|
473
|
+
# end
|
474
|
+
#
|
475
|
+
def purge_user_events request, options = nil
|
476
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
477
|
+
|
478
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::PurgeUserEventsRequest
|
479
|
+
|
480
|
+
# Converts hash and nil to an options object
|
481
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
482
|
+
|
483
|
+
# Customize the options with defaults
|
484
|
+
call_metadata = @config.rpcs.purge_user_events.metadata.to_h
|
485
|
+
|
486
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
487
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
488
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
489
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
|
490
|
+
transports_version_send: [:rest]
|
491
|
+
|
492
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
493
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
494
|
+
|
495
|
+
options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout,
|
496
|
+
metadata: call_metadata,
|
497
|
+
retry_policy: @config.rpcs.purge_user_events.retry_policy
|
498
|
+
|
499
|
+
options.apply_defaults timeout: @config.timeout,
|
500
|
+
metadata: @config.metadata,
|
501
|
+
retry_policy: @config.retry_policy
|
502
|
+
|
503
|
+
@user_event_service_stub.purge_user_events request, options do |result, operation|
|
504
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
505
|
+
yield result, operation if block_given?
|
506
|
+
return result
|
507
|
+
end
|
508
|
+
rescue ::Gapic::Rest::Error => e
|
509
|
+
raise ::Google::Cloud::Error.from_error(e)
|
510
|
+
end
|
511
|
+
|
387
512
|
##
|
388
513
|
# Bulk import of user events. Request processing might be
|
389
514
|
# synchronous. Events that already exist are skipped.
|
@@ -631,6 +756,11 @@ module Google
|
|
631
756
|
#
|
632
757
|
attr_reader :collect_user_event
|
633
758
|
##
|
759
|
+
# RPC-specific configuration for `purge_user_events`
|
760
|
+
# @return [::Gapic::Config::Method]
|
761
|
+
#
|
762
|
+
attr_reader :purge_user_events
|
763
|
+
##
|
634
764
|
# RPC-specific configuration for `import_user_events`
|
635
765
|
# @return [::Gapic::Config::Method]
|
636
766
|
#
|
@@ -642,6 +772,8 @@ module Google
|
|
642
772
|
@write_user_event = ::Gapic::Config::Method.new write_user_event_config
|
643
773
|
collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event
|
644
774
|
@collect_user_event = ::Gapic::Config::Method.new collect_user_event_config
|
775
|
+
purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events
|
776
|
+
@purge_user_events = ::Gapic::Config::Method.new purge_user_events_config
|
645
777
|
import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events
|
646
778
|
@import_user_events = ::Gapic::Config::Method.new import_user_events_config
|
647
779
|
|
@@ -1016,6 +1016,13 @@ module Google
|
|
1016
1016
|
["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false]
|
1017
1017
|
]
|
1018
1018
|
)
|
1019
|
+
.with_bindings(
|
1020
|
+
uri_method: :get,
|
1021
|
+
uri_template: "/v1beta/{name}",
|
1022
|
+
matches: [
|
1023
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false]
|
1024
|
+
]
|
1025
|
+
)
|
1019
1026
|
.with_bindings(
|
1020
1027
|
uri_method: :get,
|
1021
1028
|
uri_template: "/v1beta/{name}",
|
@@ -1023,6 +1030,13 @@ module Google
|
|
1023
1030
|
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
|
1024
1031
|
]
|
1025
1032
|
)
|
1033
|
+
.with_bindings(
|
1034
|
+
uri_method: :get,
|
1035
|
+
uri_template: "/v1beta/{name}",
|
1036
|
+
matches: [
|
1037
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/sampleQuerySets/[^/]+/operations/[^/]+/?$}, false]
|
1038
|
+
]
|
1039
|
+
)
|
1026
1040
|
.with_bindings(
|
1027
1041
|
uri_method: :get,
|
1028
1042
|
uri_template: "/v1beta/{name}",
|