google-cloud-discovery_engine-v1 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +219 -0
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +205 -0
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +136 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +19 -1
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +19 -1
- data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +3 -1
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +3 -1
- data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +42 -1
- data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +68 -0
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +42 -1
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +7 -0
- data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/chunk_pb.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1/common_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/completion_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +8 -0
- data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +4 -1
- data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +6 -1
- data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +4 -1
- data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +9 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +13 -0
- data/proto_docs/google/cloud/discoveryengine/v1/chunk.rb +119 -0
- data/proto_docs/google/cloud/discoveryengine/v1/completion.rb +31 -0
- data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +44 -0
- data/proto_docs/google/cloud/discoveryengine/v1/document.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +43 -2
- data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +114 -0
- data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +42 -0
- data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +209 -4
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 448631eb28d5312300d509ce45e44f11c08c4d406c108b8803a3b73a6c879290
|
4
|
+
data.tar.gz: 0d4b3d58de4a26c4ed220e7d8aced2ab84762790c73c074f1f2ecc86c0e0cc58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0811d2b26e428ac43ef56ad25636b42491d0ad721210d45d159fb275719146e2b5b28581fa1dcc0297c20a52ccadf67c17bbb60e154a211c242259236f9c4b8
|
7
|
+
data.tar.gz: 035c7a6b9253cb9ceb63e58748f86ad4b05e9c04bdecb9636fc666e6a4816557b5c56a28e7fb16c7af7e4c281b95736f078f640740850fa389b8d8ee2cc802d9
|
@@ -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::V1::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::V1::ImportCompletionSuggestionsRequest} or an equivalent Hash.
|
542
|
+
#
|
543
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::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::V1::ImportCompletionSuggestionsRequest::InlineSource, ::Hash]
|
555
|
+
# The Inline source for suggestion entries.
|
556
|
+
# @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash]
|
557
|
+
# Cloud Storage location for the input content.
|
558
|
+
# @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::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::V1::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/v1"
|
578
|
+
#
|
579
|
+
# # Create a client object. The client can be reused for multiple calls.
|
580
|
+
# client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new
|
581
|
+
#
|
582
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
583
|
+
# request = Google::Cloud::DiscoveryEngine::V1::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::V1::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::V1::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::V1::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::V1::PurgeCompletionSuggestionsRequest} or an equivalent Hash.
|
649
|
+
#
|
650
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::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/v1"
|
676
|
+
#
|
677
|
+
# # Create a client object. The client can be reused for multiple calls.
|
678
|
+
# client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new
|
679
|
+
#
|
680
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
681
|
+
# request = Google::Cloud::DiscoveryEngine::V1::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::V1::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::V1::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::V1::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::V1::ImportCompletionSuggestionsRequest} or an equivalent Hash.
|
514
|
+
#
|
515
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::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::V1::ImportCompletionSuggestionsRequest::InlineSource, ::Hash]
|
527
|
+
# The Inline source for suggestion entries.
|
528
|
+
# @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash]
|
529
|
+
# Cloud Storage location for the input content.
|
530
|
+
# @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::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::V1::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/v1"
|
549
|
+
#
|
550
|
+
# # Create a client object. The client can be reused for multiple calls.
|
551
|
+
# client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new
|
552
|
+
#
|
553
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
554
|
+
# request = Google::Cloud::DiscoveryEngine::V1::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::V1::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::V1::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::V1::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::V1::PurgeCompletionSuggestionsRequest} or an equivalent Hash.
|
614
|
+
#
|
615
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::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/v1"
|
640
|
+
#
|
641
|
+
# # Create a client object. The client can be reused for multiple calls.
|
642
|
+
# client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new
|
643
|
+
#
|
644
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
645
|
+
# request = Google::Cloud::DiscoveryEngine::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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: "/v1/{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: "/v1/{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::V1::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: "/v1/{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: "/v1/{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
|
@@ -824,7 +824,7 @@ module Google
|
|
824
824
|
# @param options [::Gapic::CallOptions, ::Hash]
|
825
825
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
826
826
|
#
|
827
|
-
# @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil)
|
827
|
+
# @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil)
|
828
828
|
# Pass arguments to `answer_query` via keyword arguments. Note that at
|
829
829
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
830
830
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -875,6 +875,24 @@ module Google
|
|
875
875
|
#
|
876
876
|
# The field must be a UTF-8 encoded string with a length limit of 128
|
877
877
|
# characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
878
|
+
# @param user_labels [::Hash{::String => ::String}]
|
879
|
+
# The user labels applied to a resource must meet the following requirements:
|
880
|
+
#
|
881
|
+
# * Each resource can have multiple labels, up to a maximum of 64.
|
882
|
+
# * Each label must be a key-value pair.
|
883
|
+
# * Keys have a minimum length of 1 character and a maximum length of 63
|
884
|
+
# characters and cannot be empty. Values can be empty and have a maximum
|
885
|
+
# length of 63 characters.
|
886
|
+
# * Keys and values can contain only lowercase letters, numeric characters,
|
887
|
+
# underscores, and dashes. All characters must use UTF-8 encoding, and
|
888
|
+
# international characters are allowed.
|
889
|
+
# * The key portion of a label must be unique. However, you can use the same
|
890
|
+
# key with multiple resources.
|
891
|
+
# * Keys must start with a lowercase letter or international character.
|
892
|
+
#
|
893
|
+
# See [Google Cloud
|
894
|
+
# Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
895
|
+
# for more details.
|
878
896
|
#
|
879
897
|
# @yield [response, operation] Access the result along with the RPC operation
|
880
898
|
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse]
|