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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +219 -0
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +205 -0
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +14 -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/data_store_service/rest/operations.rb +14 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +3 -1
  12. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +3 -1
  13. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +14 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +14 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +824 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/credentials.rb +47 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +809 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/paths.rb +318 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +770 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +1106 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +306 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest.rb +54 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service.rb +57 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +14 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +3 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +1035 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/credentials.rb +47 -0
  28. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +809 -0
  29. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/paths.rb +73 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +967 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +1106 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +426 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest.rb +54 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service.rb +57 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +911 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/credentials.rb +47 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/paths.rb +69 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +850 -0
  39. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +366 -0
  40. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest.rb +53 -0
  41. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service.rb +56 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +14 -0
  43. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +60 -5
  44. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +68 -0
  45. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +60 -5
  46. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +14 -0
  47. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +14 -0
  48. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +139 -0
  49. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +132 -0
  50. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +14 -0
  51. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +75 -0
  52. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  53. data/lib/google/cloud/discovery_engine/v1beta.rb +3 -0
  54. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
  55. data/lib/google/cloud/discoveryengine/v1beta/chunk_pb.rb +50 -0
  56. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  57. data/lib/google/cloud/discoveryengine/v1beta/completion_pb.rb +2 -1
  58. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +1 -1
  59. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +8 -0
  60. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
  61. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
  62. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +2 -1
  63. data/lib/google/cloud/discoveryengine/v1beta/data_store_service_pb.rb +1 -1
  64. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +4 -1
  65. data/lib/google/cloud/discoveryengine/v1beta/evaluation_pb.rb +56 -0
  66. data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_pb.rb +59 -0
  67. data/lib/google/cloud/discoveryengine/v1beta/evaluation_service_services_pb.rb +57 -0
  68. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +12 -1
  69. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +7 -1
  70. data/lib/google/cloud/discoveryengine/v1beta/sample_query_pb.rb +49 -0
  71. data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_pb.rb +59 -0
  72. data/lib/google/cloud/discoveryengine/v1beta/sample_query_service_services_pb.rb +63 -0
  73. data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_pb.rb +47 -0
  74. data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_pb.rb +57 -0
  75. data/lib/google/cloud/discoveryengine/v1beta/sample_query_set_service_services_pb.rb +59 -0
  76. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +20 -1
  77. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +2 -1
  78. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +5 -0
  79. data/proto_docs/google/api/client.rb +14 -10
  80. data/proto_docs/google/api/resource.rb +7 -2
  81. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +14 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1beta/chunk.rb +119 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +31 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +38 -2
  85. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +16 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +25 -0
  87. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +10 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +1 -1
  89. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +43 -2
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation.rb +223 -0
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/evaluation_service.rb +194 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +199 -0
  93. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +119 -0
  94. data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query.rb +82 -0
  95. data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_service.rb +179 -0
  96. data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set.rb +57 -0
  97. data/proto_docs/google/cloud/discoveryengine/v1beta/sample_query_set_service.rb +186 -0
  98. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +401 -8
  99. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +11 -5
  100. metadata +44 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dacecff5d9aa1e447d58734b858e60a3a1c9aabfef904cf83e275ac7fab799e5
4
- data.tar.gz: 96726ca09966b607dea199064047899af79308858f63d42b398607e8a42e3510
3
+ metadata.gz: 768fb7ac0412015526653a93e4313f495155769f0a34f1c2450e0cf875718340
4
+ data.tar.gz: b75ba5e6a5cd75bbbc905e4e70c2059999c676425024d39b6aed1bf3717ddc2a
5
5
  SHA512:
6
- metadata.gz: 15f2f0a50349e7cc9259acda52b865299cbb4d03bd0f47d813b5bb4ac5366403e0e4df532b479a1d62ce2c3c1af76e72cef1730054391f9c8c4f7f899a933aff
7
- data.tar.gz: 8e620d6b4a3a7c3c7c0ef734f2cdfc2eea65c52d1bebcbf1d3433e5eed342f45cf2383fcfec894565c142bb90b5480812a5e2ac3ea3b2db4ec13066c07fea212
6
+ metadata.gz: d653b00354b737e11b71ae2f9d4b6b6220ebafa3652075d057da960e15ffa986d5f52600d4a4a1046362d536561ab12976077c3c3e6a9cfb0b93f50bb1604e85
7
+ data.tar.gz: 7616742d0175477b3c5543a6a9295e4d448efbd2b4d036b90f4a269cd2a1ab611d7e51f64f7f9b66bf0c8a8dd865e5b737b9551b62fc827a2f3edba4f67ff66a
@@ -531,6 +531,211 @@ module Google
531
531
  raise ::Google::Cloud::Error.from_error(e)
532
532
  end
533
533
 
534
+ ##
535
+ # Imports
536
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CompletionSuggestion CompletionSuggestion}s
537
+ # for a DataStore.
538
+ #
539
+ # @overload import_completion_suggestions(request, options = nil)
540
+ # Pass arguments to `import_completion_suggestions` via a request object, either of type
541
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest} or an equivalent Hash.
542
+ #
543
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest, ::Hash]
544
+ # A request object representing the call parameters. Required. To specify no
545
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
546
+ # @param options [::Gapic::CallOptions, ::Hash]
547
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
548
+ #
549
+ # @overload import_completion_suggestions(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil)
550
+ # Pass arguments to `import_completion_suggestions` via keyword arguments. Note that at
551
+ # least one keyword argument is required. To specify no parameters, or to keep all
552
+ # the default parameter values, pass an empty Hash as a request object (see above).
553
+ #
554
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest::InlineSource, ::Hash]
555
+ # The Inline source for suggestion entries.
556
+ # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1beta::GcsSource, ::Hash]
557
+ # Cloud Storage location for the input content.
558
+ # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1beta::BigQuerySource, ::Hash]
559
+ # BigQuery input source.
560
+ # @param parent [::String]
561
+ # Required. The parent data store resource name for which to import customer
562
+ # autocomplete suggestions.
563
+ #
564
+ # Follows pattern `projects/*/locations/*/collections/*/dataStores/*`
565
+ # @param error_config [::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig, ::Hash]
566
+ # The desired location of errors incurred during the Import.
567
+ #
568
+ # @yield [response, operation] Access the result along with the RPC operation
569
+ # @yieldparam response [::Gapic::Operation]
570
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
571
+ #
572
+ # @return [::Gapic::Operation]
573
+ #
574
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
575
+ #
576
+ # @example Basic example
577
+ # require "google/cloud/discovery_engine/v1beta"
578
+ #
579
+ # # Create a client object. The client can be reused for multiple calls.
580
+ # client = Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Client.new
581
+ #
582
+ # # Create a request. To set request fields, pass in keyword arguments.
583
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest.new
584
+ #
585
+ # # Call the import_completion_suggestions method.
586
+ # result = client.import_completion_suggestions request
587
+ #
588
+ # # The returned object is of type Gapic::Operation. You can use it to
589
+ # # check the status of an operation, cancel it, or wait for results.
590
+ # # Here is how to wait for a response.
591
+ # result.wait_until_done! timeout: 60
592
+ # if result.response?
593
+ # p result.response
594
+ # else
595
+ # puts "No response received."
596
+ # end
597
+ #
598
+ def import_completion_suggestions request, options = nil
599
+ raise ::ArgumentError, "request must be provided" if request.nil?
600
+
601
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest
602
+
603
+ # Converts hash and nil to an options object
604
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
605
+
606
+ # Customize the options with defaults
607
+ metadata = @config.rpcs.import_completion_suggestions.metadata.to_h
608
+
609
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
610
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
611
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
612
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
613
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
614
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
615
+
616
+ header_params = {}
617
+ if request.parent
618
+ header_params["parent"] = request.parent
619
+ end
620
+
621
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
622
+ metadata[:"x-goog-request-params"] ||= request_params_header
623
+
624
+ options.apply_defaults timeout: @config.rpcs.import_completion_suggestions.timeout,
625
+ metadata: metadata,
626
+ retry_policy: @config.rpcs.import_completion_suggestions.retry_policy
627
+
628
+ options.apply_defaults timeout: @config.timeout,
629
+ metadata: @config.metadata,
630
+ retry_policy: @config.retry_policy
631
+
632
+ @completion_service_stub.call_rpc :import_completion_suggestions, request, options: options do |response, operation|
633
+ response = ::Gapic::Operation.new response, @operations_client, options: options
634
+ yield response, operation if block_given?
635
+ return response
636
+ end
637
+ rescue ::GRPC::BadStatus => e
638
+ raise ::Google::Cloud::Error.from_error(e)
639
+ end
640
+
641
+ ##
642
+ # Permanently deletes all
643
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CompletionSuggestion CompletionSuggestion}s
644
+ # for a DataStore.
645
+ #
646
+ # @overload purge_completion_suggestions(request, options = nil)
647
+ # Pass arguments to `purge_completion_suggestions` via a request object, either of type
648
+ # {::Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest} or an equivalent Hash.
649
+ #
650
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest, ::Hash]
651
+ # A request object representing the call parameters. Required. To specify no
652
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
653
+ # @param options [::Gapic::CallOptions, ::Hash]
654
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
655
+ #
656
+ # @overload purge_completion_suggestions(parent: nil)
657
+ # Pass arguments to `purge_completion_suggestions` via keyword arguments. Note that at
658
+ # least one keyword argument is required. To specify no parameters, or to keep all
659
+ # the default parameter values, pass an empty Hash as a request object (see above).
660
+ #
661
+ # @param parent [::String]
662
+ # Required. The parent data store resource name for which to purge completion
663
+ # suggestions. Follows pattern
664
+ # projects/*/locations/*/collections/*/dataStores/*.
665
+ #
666
+ # @yield [response, operation] Access the result along with the RPC operation
667
+ # @yieldparam response [::Gapic::Operation]
668
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
669
+ #
670
+ # @return [::Gapic::Operation]
671
+ #
672
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
673
+ #
674
+ # @example Basic example
675
+ # require "google/cloud/discovery_engine/v1beta"
676
+ #
677
+ # # Create a client object. The client can be reused for multiple calls.
678
+ # client = Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Client.new
679
+ #
680
+ # # Create a request. To set request fields, pass in keyword arguments.
681
+ # request = Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest.new
682
+ #
683
+ # # Call the purge_completion_suggestions method.
684
+ # result = client.purge_completion_suggestions request
685
+ #
686
+ # # The returned object is of type Gapic::Operation. You can use it to
687
+ # # check the status of an operation, cancel it, or wait for results.
688
+ # # Here is how to wait for a response.
689
+ # result.wait_until_done! timeout: 60
690
+ # if result.response?
691
+ # p result.response
692
+ # else
693
+ # puts "No response received."
694
+ # end
695
+ #
696
+ def purge_completion_suggestions request, options = nil
697
+ raise ::ArgumentError, "request must be provided" if request.nil?
698
+
699
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest
700
+
701
+ # Converts hash and nil to an options object
702
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
703
+
704
+ # Customize the options with defaults
705
+ metadata = @config.rpcs.purge_completion_suggestions.metadata.to_h
706
+
707
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
708
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
709
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
710
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
711
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
712
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
713
+
714
+ header_params = {}
715
+ if request.parent
716
+ header_params["parent"] = request.parent
717
+ end
718
+
719
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
720
+ metadata[:"x-goog-request-params"] ||= request_params_header
721
+
722
+ options.apply_defaults timeout: @config.rpcs.purge_completion_suggestions.timeout,
723
+ metadata: metadata,
724
+ retry_policy: @config.rpcs.purge_completion_suggestions.retry_policy
725
+
726
+ options.apply_defaults timeout: @config.timeout,
727
+ metadata: @config.metadata,
728
+ retry_policy: @config.retry_policy
729
+
730
+ @completion_service_stub.call_rpc :purge_completion_suggestions, request, options: options do |response, operation|
731
+ response = ::Gapic::Operation.new response, @operations_client, options: options
732
+ yield response, operation if block_given?
733
+ return response
734
+ end
735
+ rescue ::GRPC::BadStatus => e
736
+ raise ::Google::Cloud::Error.from_error(e)
737
+ end
738
+
534
739
  ##
535
740
  # Configuration class for the CompletionService API.
536
741
  #
@@ -699,6 +904,16 @@ module Google
699
904
  # @return [::Gapic::Config::Method]
700
905
  #
701
906
  attr_reader :purge_suggestion_deny_list_entries
907
+ ##
908
+ # RPC-specific configuration for `import_completion_suggestions`
909
+ # @return [::Gapic::Config::Method]
910
+ #
911
+ attr_reader :import_completion_suggestions
912
+ ##
913
+ # RPC-specific configuration for `purge_completion_suggestions`
914
+ # @return [::Gapic::Config::Method]
915
+ #
916
+ attr_reader :purge_completion_suggestions
702
917
 
703
918
  # @private
704
919
  def initialize parent_rpcs = nil
@@ -708,6 +923,10 @@ module Google
708
923
  @import_suggestion_deny_list_entries = ::Gapic::Config::Method.new import_suggestion_deny_list_entries_config
709
924
  purge_suggestion_deny_list_entries_config = parent_rpcs.purge_suggestion_deny_list_entries if parent_rpcs.respond_to? :purge_suggestion_deny_list_entries
710
925
  @purge_suggestion_deny_list_entries = ::Gapic::Config::Method.new purge_suggestion_deny_list_entries_config
926
+ import_completion_suggestions_config = parent_rpcs.import_completion_suggestions if parent_rpcs.respond_to? :import_completion_suggestions
927
+ @import_completion_suggestions = ::Gapic::Config::Method.new import_completion_suggestions_config
928
+ purge_completion_suggestions_config = parent_rpcs.purge_completion_suggestions if parent_rpcs.respond_to? :purge_completion_suggestions
929
+ @purge_completion_suggestions = ::Gapic::Config::Method.new purge_completion_suggestions_config
711
930
 
712
931
  yield self if block_given?
713
932
  end
@@ -503,6 +503,197 @@ module Google
503
503
  raise ::Google::Cloud::Error.from_error(e)
504
504
  end
505
505
 
506
+ ##
507
+ # Imports
508
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CompletionSuggestion CompletionSuggestion}s
509
+ # for a DataStore.
510
+ #
511
+ # @overload import_completion_suggestions(request, options = nil)
512
+ # Pass arguments to `import_completion_suggestions` via a request object, either of type
513
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest} or an equivalent Hash.
514
+ #
515
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest, ::Hash]
516
+ # A request object representing the call parameters. Required. To specify no
517
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
518
+ # @param options [::Gapic::CallOptions, ::Hash]
519
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
520
+ #
521
+ # @overload import_completion_suggestions(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil)
522
+ # Pass arguments to `import_completion_suggestions` via keyword arguments. Note that at
523
+ # least one keyword argument is required. To specify no parameters, or to keep all
524
+ # the default parameter values, pass an empty Hash as a request object (see above).
525
+ #
526
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest::InlineSource, ::Hash]
527
+ # The Inline source for suggestion entries.
528
+ # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1beta::GcsSource, ::Hash]
529
+ # Cloud Storage location for the input content.
530
+ # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1beta::BigQuerySource, ::Hash]
531
+ # BigQuery input source.
532
+ # @param parent [::String]
533
+ # Required. The parent data store resource name for which to import customer
534
+ # autocomplete suggestions.
535
+ #
536
+ # Follows pattern `projects/*/locations/*/collections/*/dataStores/*`
537
+ # @param error_config [::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig, ::Hash]
538
+ # The desired location of errors incurred during the Import.
539
+ # @yield [result, operation] Access the result along with the TransportOperation object
540
+ # @yieldparam result [::Gapic::Operation]
541
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
542
+ #
543
+ # @return [::Gapic::Operation]
544
+ #
545
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
546
+ #
547
+ # @example Basic example
548
+ # require "google/cloud/discovery_engine/v1beta"
549
+ #
550
+ # # Create a client object. The client can be reused for multiple calls.
551
+ # client = Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Rest::Client.new
552
+ #
553
+ # # Create a request. To set request fields, pass in keyword arguments.
554
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest.new
555
+ #
556
+ # # Call the import_completion_suggestions method.
557
+ # result = client.import_completion_suggestions request
558
+ #
559
+ # # The returned object is of type Gapic::Operation. You can use it to
560
+ # # check the status of an operation, cancel it, or wait for results.
561
+ # # Here is how to wait for a response.
562
+ # result.wait_until_done! timeout: 60
563
+ # if result.response?
564
+ # p result.response
565
+ # else
566
+ # puts "No response received."
567
+ # end
568
+ #
569
+ def import_completion_suggestions request, options = nil
570
+ raise ::ArgumentError, "request must be provided" if request.nil?
571
+
572
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest
573
+
574
+ # Converts hash and nil to an options object
575
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
576
+
577
+ # Customize the options with defaults
578
+ call_metadata = @config.rpcs.import_completion_suggestions.metadata.to_h
579
+
580
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
581
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
582
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
583
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
584
+ transports_version_send: [:rest]
585
+
586
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
587
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
588
+
589
+ options.apply_defaults timeout: @config.rpcs.import_completion_suggestions.timeout,
590
+ metadata: call_metadata,
591
+ retry_policy: @config.rpcs.import_completion_suggestions.retry_policy
592
+
593
+ options.apply_defaults timeout: @config.timeout,
594
+ metadata: @config.metadata,
595
+ retry_policy: @config.retry_policy
596
+
597
+ @completion_service_stub.import_completion_suggestions request, options do |result, operation|
598
+ result = ::Gapic::Operation.new result, @operations_client, options: options
599
+ yield result, operation if block_given?
600
+ return result
601
+ end
602
+ rescue ::Gapic::Rest::Error => e
603
+ raise ::Google::Cloud::Error.from_error(e)
604
+ end
605
+
606
+ ##
607
+ # Permanently deletes all
608
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CompletionSuggestion CompletionSuggestion}s
609
+ # for a DataStore.
610
+ #
611
+ # @overload purge_completion_suggestions(request, options = nil)
612
+ # Pass arguments to `purge_completion_suggestions` via a request object, either of type
613
+ # {::Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest} or an equivalent Hash.
614
+ #
615
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest, ::Hash]
616
+ # A request object representing the call parameters. Required. To specify no
617
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
618
+ # @param options [::Gapic::CallOptions, ::Hash]
619
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
620
+ #
621
+ # @overload purge_completion_suggestions(parent: nil)
622
+ # Pass arguments to `purge_completion_suggestions` via keyword arguments. Note that at
623
+ # least one keyword argument is required. To specify no parameters, or to keep all
624
+ # the default parameter values, pass an empty Hash as a request object (see above).
625
+ #
626
+ # @param parent [::String]
627
+ # Required. The parent data store resource name for which to purge completion
628
+ # suggestions. Follows pattern
629
+ # projects/*/locations/*/collections/*/dataStores/*.
630
+ # @yield [result, operation] Access the result along with the TransportOperation object
631
+ # @yieldparam result [::Gapic::Operation]
632
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
633
+ #
634
+ # @return [::Gapic::Operation]
635
+ #
636
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
637
+ #
638
+ # @example Basic example
639
+ # require "google/cloud/discovery_engine/v1beta"
640
+ #
641
+ # # Create a client object. The client can be reused for multiple calls.
642
+ # client = Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Rest::Client.new
643
+ #
644
+ # # Create a request. To set request fields, pass in keyword arguments.
645
+ # request = Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest.new
646
+ #
647
+ # # Call the purge_completion_suggestions method.
648
+ # result = client.purge_completion_suggestions request
649
+ #
650
+ # # The returned object is of type Gapic::Operation. You can use it to
651
+ # # check the status of an operation, cancel it, or wait for results.
652
+ # # Here is how to wait for a response.
653
+ # result.wait_until_done! timeout: 60
654
+ # if result.response?
655
+ # p result.response
656
+ # else
657
+ # puts "No response received."
658
+ # end
659
+ #
660
+ def purge_completion_suggestions request, options = nil
661
+ raise ::ArgumentError, "request must be provided" if request.nil?
662
+
663
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest
664
+
665
+ # Converts hash and nil to an options object
666
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
667
+
668
+ # Customize the options with defaults
669
+ call_metadata = @config.rpcs.purge_completion_suggestions.metadata.to_h
670
+
671
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
672
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
673
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
674
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
675
+ transports_version_send: [:rest]
676
+
677
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
678
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
679
+
680
+ options.apply_defaults timeout: @config.rpcs.purge_completion_suggestions.timeout,
681
+ metadata: call_metadata,
682
+ retry_policy: @config.rpcs.purge_completion_suggestions.retry_policy
683
+
684
+ options.apply_defaults timeout: @config.timeout,
685
+ metadata: @config.metadata,
686
+ retry_policy: @config.retry_policy
687
+
688
+ @completion_service_stub.purge_completion_suggestions request, options do |result, operation|
689
+ result = ::Gapic::Operation.new result, @operations_client, options: options
690
+ yield result, operation if block_given?
691
+ return result
692
+ end
693
+ rescue ::Gapic::Rest::Error => e
694
+ raise ::Google::Cloud::Error.from_error(e)
695
+ end
696
+
506
697
  ##
507
698
  # Configuration class for the CompletionService REST API.
508
699
  #
@@ -651,6 +842,16 @@ module Google
651
842
  # @return [::Gapic::Config::Method]
652
843
  #
653
844
  attr_reader :purge_suggestion_deny_list_entries
845
+ ##
846
+ # RPC-specific configuration for `import_completion_suggestions`
847
+ # @return [::Gapic::Config::Method]
848
+ #
849
+ attr_reader :import_completion_suggestions
850
+ ##
851
+ # RPC-specific configuration for `purge_completion_suggestions`
852
+ # @return [::Gapic::Config::Method]
853
+ #
854
+ attr_reader :purge_completion_suggestions
654
855
 
655
856
  # @private
656
857
  def initialize parent_rpcs = nil
@@ -660,6 +861,10 @@ module Google
660
861
  @import_suggestion_deny_list_entries = ::Gapic::Config::Method.new import_suggestion_deny_list_entries_config
661
862
  purge_suggestion_deny_list_entries_config = parent_rpcs.purge_suggestion_deny_list_entries if parent_rpcs.respond_to? :purge_suggestion_deny_list_entries
662
863
  @purge_suggestion_deny_list_entries = ::Gapic::Config::Method.new purge_suggestion_deny_list_entries_config
864
+ import_completion_suggestions_config = parent_rpcs.import_completion_suggestions if parent_rpcs.respond_to? :import_completion_suggestions
865
+ @import_completion_suggestions = ::Gapic::Config::Method.new import_completion_suggestions_config
866
+ purge_completion_suggestions_config = parent_rpcs.purge_completion_suggestions if parent_rpcs.respond_to? :purge_completion_suggestions
867
+ @purge_completion_suggestions = ::Gapic::Config::Method.new purge_completion_suggestions_config
663
868
 
664
869
  yield self if block_given?
665
870
  end
@@ -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}",
@@ -175,6 +175,82 @@ module Google
175
175
  result
176
176
  end
177
177
 
178
+ ##
179
+ # Baseline implementation for the import_completion_suggestions REST call
180
+ #
181
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest]
182
+ # A request object representing the call parameters. Required.
183
+ # @param options [::Gapic::CallOptions]
184
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
185
+ #
186
+ # @yield [result, operation] Access the result along with the TransportOperation object
187
+ # @yieldparam result [::Google::Longrunning::Operation]
188
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
189
+ #
190
+ # @return [::Google::Longrunning::Operation]
191
+ # A result object deserialized from the server's reply
192
+ def import_completion_suggestions request_pb, options = nil
193
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
194
+
195
+ verb, uri, query_string_params, body = ServiceStub.transcode_import_completion_suggestions_request request_pb
196
+ query_string_params = if query_string_params.any?
197
+ query_string_params.to_h { |p| p.split "=", 2 }
198
+ else
199
+ {}
200
+ end
201
+
202
+ response = @client_stub.make_http_request(
203
+ verb,
204
+ uri: uri,
205
+ body: body || "",
206
+ params: query_string_params,
207
+ options: options
208
+ )
209
+ operation = ::Gapic::Rest::TransportOperation.new response
210
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
211
+
212
+ yield result, operation if block_given?
213
+ result
214
+ end
215
+
216
+ ##
217
+ # Baseline implementation for the purge_completion_suggestions REST call
218
+ #
219
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest]
220
+ # A request object representing the call parameters. Required.
221
+ # @param options [::Gapic::CallOptions]
222
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
223
+ #
224
+ # @yield [result, operation] Access the result along with the TransportOperation object
225
+ # @yieldparam result [::Google::Longrunning::Operation]
226
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
227
+ #
228
+ # @return [::Google::Longrunning::Operation]
229
+ # A result object deserialized from the server's reply
230
+ def purge_completion_suggestions request_pb, options = nil
231
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
232
+
233
+ verb, uri, query_string_params, body = ServiceStub.transcode_purge_completion_suggestions_request request_pb
234
+ query_string_params = if query_string_params.any?
235
+ query_string_params.to_h { |p| p.split "=", 2 }
236
+ else
237
+ {}
238
+ end
239
+
240
+ response = @client_stub.make_http_request(
241
+ verb,
242
+ uri: uri,
243
+ body: body || "",
244
+ params: query_string_params,
245
+ options: options
246
+ )
247
+ operation = ::Gapic::Rest::TransportOperation.new response
248
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
249
+
250
+ yield result, operation if block_given?
251
+ result
252
+ end
253
+
178
254
  ##
179
255
  # @private
180
256
  #
@@ -262,6 +338,66 @@ module Google
262
338
  )
263
339
  transcoder.transcode request_pb
264
340
  end
341
+
342
+ ##
343
+ # @private
344
+ #
345
+ # GRPC transcoding helper method for the import_completion_suggestions REST call
346
+ #
347
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::ImportCompletionSuggestionsRequest]
348
+ # A request object representing the call parameters. Required.
349
+ # @return [Array(String, [String, nil], Hash{String => String})]
350
+ # Uri, Body, Query string parameters
351
+ def self.transcode_import_completion_suggestions_request request_pb
352
+ transcoder = Gapic::Rest::GrpcTranscoder.new
353
+ .with_bindings(
354
+ uri_method: :post,
355
+ uri_template: "/v1beta/{parent}/completionSuggestions:import",
356
+ body: "*",
357
+ matches: [
358
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
359
+ ]
360
+ )
361
+ .with_bindings(
362
+ uri_method: :post,
363
+ uri_template: "/v1beta/{parent}/completionSuggestions:import",
364
+ body: "*",
365
+ matches: [
366
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false]
367
+ ]
368
+ )
369
+ transcoder.transcode request_pb
370
+ end
371
+
372
+ ##
373
+ # @private
374
+ #
375
+ # GRPC transcoding helper method for the purge_completion_suggestions REST call
376
+ #
377
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::PurgeCompletionSuggestionsRequest]
378
+ # A request object representing the call parameters. Required.
379
+ # @return [Array(String, [String, nil], Hash{String => String})]
380
+ # Uri, Body, Query string parameters
381
+ def self.transcode_purge_completion_suggestions_request request_pb
382
+ transcoder = Gapic::Rest::GrpcTranscoder.new
383
+ .with_bindings(
384
+ uri_method: :post,
385
+ uri_template: "/v1beta/{parent}/completionSuggestions:purge",
386
+ body: "*",
387
+ matches: [
388
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
389
+ ]
390
+ )
391
+ .with_bindings(
392
+ uri_method: :post,
393
+ uri_template: "/v1beta/{parent}/completionSuggestions:purge",
394
+ body: "*",
395
+ matches: [
396
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false]
397
+ ]
398
+ )
399
+ transcoder.transcode request_pb
400
+ end
265
401
  end
266
402
  end
267
403
  end