google-cloud-discovery_engine-v1 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +235 -4
  3. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +801 -0
  4. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +221 -4
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +1091 -0
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +136 -0
  7. data/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb +1 -0
  8. data/lib/google/cloud/discovery_engine/v1/completion_service.rb +1 -0
  9. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +20 -3
  10. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +91 -0
  11. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +20 -3
  12. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +45 -0
  13. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +924 -0
  14. data/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb +47 -0
  15. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +801 -0
  16. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +97 -0
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +863 -0
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +1091 -0
  19. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb +403 -0
  20. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb +54 -0
  21. data/lib/google/cloud/discovery_engine/v1/data_store_service.rb +57 -0
  22. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +14 -0
  23. data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +885 -0
  24. data/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb +47 -0
  25. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +801 -0
  26. data/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb +73 -0
  27. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +824 -0
  28. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +1091 -0
  29. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb +366 -0
  30. data/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb +54 -0
  31. data/lib/google/cloud/discovery_engine/v1/engine_service.rb +57 -0
  32. data/lib/google/cloud/discovery_engine/v1/rest.rb +3 -0
  33. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +14 -0
  34. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +40 -4
  35. data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +19 -0
  36. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +40 -4
  37. data/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +8 -0
  38. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +1631 -0
  39. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +801 -0
  41. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb +127 -0
  42. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +1521 -0
  43. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +1091 -0
  44. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb +860 -0
  45. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb +53 -0
  46. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb +56 -0
  47. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +14 -0
  48. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  49. data/lib/google/cloud/discovery_engine/v1.rb +3 -0
  50. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +5 -1
  51. data/lib/google/cloud/discoveryengine/v1/completion_pb.rb +45 -0
  52. data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +4 -1
  53. data/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +8 -0
  54. data/lib/google/cloud/discoveryengine/v1/conversation_pb.rb +1 -1
  55. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +1 -1
  56. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +49 -0
  57. data/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb +62 -0
  58. data/lib/google/cloud/discoveryengine/v1/data_store_service_services_pb.rb +61 -0
  59. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +1 -1
  60. data/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +1 -1
  61. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +53 -0
  62. data/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb +62 -0
  63. data/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb +55 -0
  64. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +7 -1
  65. data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +6 -1
  66. data/lib/google/cloud/discoveryengine/v1/schema_pb.rb +1 -1
  67. data/lib/google/cloud/discoveryengine/v1/schema_service_pb.rb +1 -1
  68. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +8 -1
  69. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +54 -0
  70. data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb +82 -0
  71. data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb +73 -0
  72. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
  73. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
  74. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +51 -0
  75. data/proto_docs/google/cloud/discoveryengine/v1/completion.rb +53 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb +10 -4
  77. data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +2 -0
  78. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +19 -1
  79. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +88 -0
  80. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +214 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +1 -1
  82. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +214 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb +177 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +66 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +41 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +149 -4
  87. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +160 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb +525 -0
  89. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +3 -3
  90. metadata +48 -2
@@ -149,6 +149,13 @@ module Google
149
149
  @quota_project_id = @config.quota_project
150
150
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
151
 
152
+ @operations_client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Operations.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ config.universe_domain = @config.universe_domain
157
+ end
158
+
152
159
  @completion_service_stub = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.new(
153
160
  endpoint: @config.endpoint,
154
161
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
@@ -164,6 +171,13 @@ module Google
164
171
  end
165
172
  end
166
173
 
174
+ ##
175
+ # Get the associated client for long-running operations.
176
+ #
177
+ # @return [::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Operations]
178
+ #
179
+ attr_reader :operations_client
180
+
167
181
  ##
168
182
  # Get the associated client for mix-in of the Locations.
169
183
  #
@@ -199,8 +213,9 @@ module Google
199
213
  # Required. The typeahead input used to fetch suggestions. Maximum length is
200
214
  # 128 characters.
201
215
  # @param query_model [::String]
202
- # Selects data model of query suggestions for serving. Currently supported
203
- # values:
216
+ # Specifies the autocomplete data model. This overrides any model specified
217
+ # in the Configuration > Autocomplete section of the Cloud console. Currently
218
+ # supported values:
204
219
  #
205
220
  # * `document` - Using suggestions generated from user-imported documents.
206
221
  # * `search-history` - Using suggestions generated from the past history of
@@ -214,8 +229,7 @@ module Google
214
229
  # Default values:
215
230
  #
216
231
  # * `document` is the default model for regular dataStores.
217
- # * `search-history` is the default model for
218
- # [IndustryVertical.SITE_SEARCH][] dataStores.
232
+ # * `search-history` is the default model for site search dataStores.
219
233
  # @param user_pseudo_id [::String]
220
234
  # A unique identifier for tracking visitors. For example, this could be
221
235
  # implemented with an HTTP cookie, which should be able to uniquely identify
@@ -294,6 +308,195 @@ module Google
294
308
  raise ::Google::Cloud::Error.from_error(e)
295
309
  end
296
310
 
311
+ ##
312
+ # Imports all
313
+ # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry}
314
+ # for a DataStore.
315
+ #
316
+ # @overload import_suggestion_deny_list_entries(request, options = nil)
317
+ # Pass arguments to `import_suggestion_deny_list_entries` via a request object, either of type
318
+ # {::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest} or an equivalent Hash.
319
+ #
320
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, ::Hash]
321
+ # A request object representing the call parameters. Required. To specify no
322
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
323
+ # @param options [::Gapic::CallOptions, ::Hash]
324
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
325
+ #
326
+ # @overload import_suggestion_deny_list_entries(inline_source: nil, gcs_source: nil, parent: nil)
327
+ # Pass arguments to `import_suggestion_deny_list_entries` via keyword arguments. Note that at
328
+ # least one keyword argument is required. To specify no parameters, or to keep all
329
+ # the default parameter values, pass an empty Hash as a request object (see above).
330
+ #
331
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource, ::Hash]
332
+ # The Inline source for the input content for suggestion deny list entries.
333
+ # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash]
334
+ # Cloud Storage location for the input content.
335
+ #
336
+ # Only 1 file can be specified that contains all entries to import.
337
+ # Supported values `gcs_source.schema` for autocomplete suggestion deny
338
+ # list entry imports:
339
+ #
340
+ # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry]
341
+ # per line.
342
+ # @param parent [::String]
343
+ # Required. The parent data store resource name for which to import denylist
344
+ # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*.
345
+ # @yield [result, operation] Access the result along with the TransportOperation object
346
+ # @yieldparam result [::Gapic::Operation]
347
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
348
+ #
349
+ # @return [::Gapic::Operation]
350
+ #
351
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
352
+ #
353
+ # @example Basic example
354
+ # require "google/cloud/discovery_engine/v1"
355
+ #
356
+ # # Create a client object. The client can be reused for multiple calls.
357
+ # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new
358
+ #
359
+ # # Create a request. To set request fields, pass in keyword arguments.
360
+ # request = Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new
361
+ #
362
+ # # Call the import_suggestion_deny_list_entries method.
363
+ # result = client.import_suggestion_deny_list_entries request
364
+ #
365
+ # # The returned object is of type Gapic::Operation. You can use it to
366
+ # # check the status of an operation, cancel it, or wait for results.
367
+ # # Here is how to wait for a response.
368
+ # result.wait_until_done! timeout: 60
369
+ # if result.response?
370
+ # p result.response
371
+ # else
372
+ # puts "No response received."
373
+ # end
374
+ #
375
+ def import_suggestion_deny_list_entries request, options = nil
376
+ raise ::ArgumentError, "request must be provided" if request.nil?
377
+
378
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest
379
+
380
+ # Converts hash and nil to an options object
381
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
382
+
383
+ # Customize the options with defaults
384
+ call_metadata = @config.rpcs.import_suggestion_deny_list_entries.metadata.to_h
385
+
386
+ # Set x-goog-api-client and x-goog-user-project headers
387
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
388
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
389
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
390
+ transports_version_send: [:rest]
391
+
392
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
393
+
394
+ options.apply_defaults timeout: @config.rpcs.import_suggestion_deny_list_entries.timeout,
395
+ metadata: call_metadata,
396
+ retry_policy: @config.rpcs.import_suggestion_deny_list_entries.retry_policy
397
+
398
+ options.apply_defaults timeout: @config.timeout,
399
+ metadata: @config.metadata,
400
+ retry_policy: @config.retry_policy
401
+
402
+ @completion_service_stub.import_suggestion_deny_list_entries request, options do |result, operation|
403
+ result = ::Gapic::Operation.new result, @operations_client, options: options
404
+ yield result, operation if block_given?
405
+ return result
406
+ end
407
+ rescue ::Gapic::Rest::Error => e
408
+ raise ::Google::Cloud::Error.from_error(e)
409
+ end
410
+
411
+ ##
412
+ # Permanently deletes all
413
+ # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry}
414
+ # for a DataStore.
415
+ #
416
+ # @overload purge_suggestion_deny_list_entries(request, options = nil)
417
+ # Pass arguments to `purge_suggestion_deny_list_entries` via a request object, either of type
418
+ # {::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest} or an equivalent Hash.
419
+ #
420
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, ::Hash]
421
+ # A request object representing the call parameters. Required. To specify no
422
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
423
+ # @param options [::Gapic::CallOptions, ::Hash]
424
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
425
+ #
426
+ # @overload purge_suggestion_deny_list_entries(parent: nil)
427
+ # Pass arguments to `purge_suggestion_deny_list_entries` via keyword arguments. Note that at
428
+ # least one keyword argument is required. To specify no parameters, or to keep all
429
+ # the default parameter values, pass an empty Hash as a request object (see above).
430
+ #
431
+ # @param parent [::String]
432
+ # Required. The parent data store resource name for which to import denylist
433
+ # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*.
434
+ # @yield [result, operation] Access the result along with the TransportOperation object
435
+ # @yieldparam result [::Gapic::Operation]
436
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
437
+ #
438
+ # @return [::Gapic::Operation]
439
+ #
440
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
441
+ #
442
+ # @example Basic example
443
+ # require "google/cloud/discovery_engine/v1"
444
+ #
445
+ # # Create a client object. The client can be reused for multiple calls.
446
+ # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new
447
+ #
448
+ # # Create a request. To set request fields, pass in keyword arguments.
449
+ # request = Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new
450
+ #
451
+ # # Call the purge_suggestion_deny_list_entries method.
452
+ # result = client.purge_suggestion_deny_list_entries request
453
+ #
454
+ # # The returned object is of type Gapic::Operation. You can use it to
455
+ # # check the status of an operation, cancel it, or wait for results.
456
+ # # Here is how to wait for a response.
457
+ # result.wait_until_done! timeout: 60
458
+ # if result.response?
459
+ # p result.response
460
+ # else
461
+ # puts "No response received."
462
+ # end
463
+ #
464
+ def purge_suggestion_deny_list_entries request, options = nil
465
+ raise ::ArgumentError, "request must be provided" if request.nil?
466
+
467
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest
468
+
469
+ # Converts hash and nil to an options object
470
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
471
+
472
+ # Customize the options with defaults
473
+ call_metadata = @config.rpcs.purge_suggestion_deny_list_entries.metadata.to_h
474
+
475
+ # Set x-goog-api-client and x-goog-user-project headers
476
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
477
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
478
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
479
+ transports_version_send: [:rest]
480
+
481
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
482
+
483
+ options.apply_defaults timeout: @config.rpcs.purge_suggestion_deny_list_entries.timeout,
484
+ metadata: call_metadata,
485
+ retry_policy: @config.rpcs.purge_suggestion_deny_list_entries.retry_policy
486
+
487
+ options.apply_defaults timeout: @config.timeout,
488
+ metadata: @config.metadata,
489
+ retry_policy: @config.retry_policy
490
+
491
+ @completion_service_stub.purge_suggestion_deny_list_entries request, options do |result, operation|
492
+ result = ::Gapic::Operation.new result, @operations_client, options: options
493
+ yield result, operation if block_given?
494
+ return result
495
+ end
496
+ rescue ::Gapic::Rest::Error => e
497
+ raise ::Google::Cloud::Error.from_error(e)
498
+ end
499
+
297
500
  ##
298
501
  # Configuration class for the CompletionService REST API.
299
502
  #
@@ -432,11 +635,25 @@ module Google
432
635
  # @return [::Gapic::Config::Method]
433
636
  #
434
637
  attr_reader :complete_query
638
+ ##
639
+ # RPC-specific configuration for `import_suggestion_deny_list_entries`
640
+ # @return [::Gapic::Config::Method]
641
+ #
642
+ attr_reader :import_suggestion_deny_list_entries
643
+ ##
644
+ # RPC-specific configuration for `purge_suggestion_deny_list_entries`
645
+ # @return [::Gapic::Config::Method]
646
+ #
647
+ attr_reader :purge_suggestion_deny_list_entries
435
648
 
436
649
  # @private
437
650
  def initialize parent_rpcs = nil
438
651
  complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query
439
652
  @complete_query = ::Gapic::Config::Method.new complete_query_config
653
+ import_suggestion_deny_list_entries_config = parent_rpcs.import_suggestion_deny_list_entries if parent_rpcs.respond_to? :import_suggestion_deny_list_entries
654
+ @import_suggestion_deny_list_entries = ::Gapic::Config::Method.new import_suggestion_deny_list_entries_config
655
+ purge_suggestion_deny_list_entries_config = parent_rpcs.purge_suggestion_deny_list_entries if parent_rpcs.respond_to? :purge_suggestion_deny_list_entries
656
+ @purge_suggestion_deny_list_entries = ::Gapic::Config::Method.new purge_suggestion_deny_list_entries_config
440
657
 
441
658
  yield self if block_given?
442
659
  end