google-cloud-discovery_engine-v1beta 0.13.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- 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/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/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/evaluation_service/paths.rb +68 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +50 -1
- 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 +50 -1
- 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/service_stub.rb +75 -0
- data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/answer_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/import_config_pb.rb +6 -1
- data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +7 -1
- data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +16 -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/cloud/discoveryengine/v1beta/answer.rb +14 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +31 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +28 -0
- 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/import_config.rb +114 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +119 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +332 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df13c5e62e9b7d9f38a8ffccd33506fa76f78d8ff039bf4ee98af81bf57fee19
|
4
|
+
data.tar.gz: 7a7ce40c60b821ce09ac80fa1445d0f0454d66b219bb58bdc45b800f9cca3dbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a8805abc319b2f1fb38507c034d708f97c18f5d6d575d9e3a8001d1476357967e07b9a2549d21bf6f448181b9b2a5c0b2b8b93c15cb611ab3fd8e1771757c4a
|
7
|
+
data.tar.gz: 19a5c28238beaed407fa9481d9d0469e23f69d2b65b31857105a144edf2536686e5a0db6446a982cec875c3b4e71a46269f2adab5ec7e48ad6938ba85e50a90c
|
data/README.md
CHANGED
@@ -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
|
@@ -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
|