google-cloud-discovery_engine-v1 0.7.0 → 0.8.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 +9 -3
- data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +9 -3
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/control_service/client.rb +875 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +167 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +814 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb +440 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/rest.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/control_service.rb +58 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +764 -6
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +199 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +715 -6
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +520 -0
- data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +15 -7
- data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +45 -0
- data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +15 -7
- data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +23 -13
- data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +23 -13
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +471 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +438 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb +129 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/client.rb +485 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +809 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/paths.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb +452 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +1114 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb +129 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1/project_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +481 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +448 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb +129 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +24 -19
- data/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb +66 -0
- data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +24 -19
- data/lib/google/cloud/discovery_engine/v1/rest.rb +4 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +18 -10
- data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +18 -10
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +15 -8
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +15 -8
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +27 -12
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +27 -12
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +23 -6
- data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb +21 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +23 -6
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +8 -0
- data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1.rb +4 -0
- data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +69 -0
- data/lib/google/cloud/discoveryengine/v1/common_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1/control_pb.rb +55 -0
- data/lib/google/cloud/discoveryengine/v1/control_service_pb.rb +57 -0
- data/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb +69 -0
- data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +32 -1
- data/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb +25 -0
- data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +3 -1
- data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +48 -0
- data/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +52 -0
- data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +46 -0
- data/lib/google/cloud/discoveryengine/v1/project_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1/project_service_pb.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb +51 -0
- data/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1/session_pb.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +362 -0
- data/proto_docs/google/cloud/discoveryengine/v1/common.rb +16 -0
- data/proto_docs/google/cloud/discoveryengine/v1/control.rb +207 -0
- data/proto_docs/google/cloud/discoveryengine/v1/control_service.rb +126 -0
- data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +2 -2
- data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +485 -0
- data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +3 -0
- data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +2 -2
- data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +102 -0
- data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +5 -5
- data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +3 -3
- data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +144 -0
- data/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +79 -0
- data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +4 -4
- data/proto_docs/google/cloud/discoveryengine/v1/project.rb +106 -0
- data/proto_docs/google/cloud/discoveryengine/v1/project_service.rb +57 -0
- data/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb +124 -0
- data/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb +20 -19
- data/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb +5 -5
- data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +23 -18
- data/proto_docs/google/cloud/discoveryengine/v1/session.rb +88 -0
- data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +3 -0
- data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +24 -3
- data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +13 -1
- metadata +56 -2
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# Service for conversational search.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
API_VERSION = ""
|
38
|
+
|
36
39
|
# @private
|
37
40
|
DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
|
38
41
|
|
@@ -285,12 +288,13 @@ module Google
|
|
285
288
|
# Customize the options with defaults
|
286
289
|
call_metadata = @config.rpcs.converse_conversation.metadata.to_h
|
287
290
|
|
288
|
-
# Set x-goog-api-client
|
291
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
289
292
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
290
293
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
291
294
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
292
295
|
transports_version_send: [:rest]
|
293
296
|
|
297
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
294
298
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
295
299
|
|
296
300
|
options.apply_defaults timeout: @config.rpcs.converse_conversation.timeout,
|
@@ -369,12 +373,13 @@ module Google
|
|
369
373
|
# Customize the options with defaults
|
370
374
|
call_metadata = @config.rpcs.create_conversation.metadata.to_h
|
371
375
|
|
372
|
-
# Set x-goog-api-client
|
376
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
373
377
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
374
378
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
375
379
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
376
380
|
transports_version_send: [:rest]
|
377
381
|
|
382
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
378
383
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
379
384
|
|
380
385
|
options.apply_defaults timeout: @config.rpcs.create_conversation.timeout,
|
@@ -451,12 +456,13 @@ module Google
|
|
451
456
|
# Customize the options with defaults
|
452
457
|
call_metadata = @config.rpcs.delete_conversation.metadata.to_h
|
453
458
|
|
454
|
-
# Set x-goog-api-client
|
459
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
455
460
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
456
461
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
457
462
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
458
463
|
transports_version_send: [:rest]
|
459
464
|
|
465
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
460
466
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
461
467
|
|
462
468
|
options.apply_defaults timeout: @config.rpcs.delete_conversation.timeout,
|
@@ -542,12 +548,13 @@ module Google
|
|
542
548
|
# Customize the options with defaults
|
543
549
|
call_metadata = @config.rpcs.update_conversation.metadata.to_h
|
544
550
|
|
545
|
-
# Set x-goog-api-client
|
551
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
546
552
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
547
553
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
548
554
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
549
555
|
transports_version_send: [:rest]
|
550
556
|
|
557
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
551
558
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
552
559
|
|
553
560
|
options.apply_defaults timeout: @config.rpcs.update_conversation.timeout,
|
@@ -621,12 +628,13 @@ module Google
|
|
621
628
|
# Customize the options with defaults
|
622
629
|
call_metadata = @config.rpcs.get_conversation.metadata.to_h
|
623
630
|
|
624
|
-
# Set x-goog-api-client
|
631
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
625
632
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
626
633
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
627
634
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
628
635
|
transports_version_send: [:rest]
|
629
636
|
|
637
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
630
638
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
631
639
|
|
632
640
|
options.apply_defaults timeout: @config.rpcs.get_conversation.timeout,
|
@@ -728,12 +736,13 @@ module Google
|
|
728
736
|
# Customize the options with defaults
|
729
737
|
call_metadata = @config.rpcs.list_conversations.metadata.to_h
|
730
738
|
|
731
|
-
# Set x-goog-api-client
|
739
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
732
740
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
733
741
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
734
742
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
735
743
|
transports_version_send: [:rest]
|
736
744
|
|
745
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
737
746
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
738
747
|
|
739
748
|
options.apply_defaults timeout: @config.rpcs.list_conversations.timeout,
|
@@ -753,6 +762,657 @@ module Google
|
|
753
762
|
raise ::Google::Cloud::Error.from_error(e)
|
754
763
|
end
|
755
764
|
|
765
|
+
##
|
766
|
+
# Answer query method.
|
767
|
+
#
|
768
|
+
# @overload answer_query(request, options = nil)
|
769
|
+
# Pass arguments to `answer_query` via a request object, either of type
|
770
|
+
# {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash.
|
771
|
+
#
|
772
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash]
|
773
|
+
# A request object representing the call parameters. Required. To specify no
|
774
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
775
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
776
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
777
|
+
#
|
778
|
+
# @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)
|
779
|
+
# Pass arguments to `answer_query` via keyword arguments. Note that at
|
780
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
781
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
782
|
+
#
|
783
|
+
# @param serving_config [::String]
|
784
|
+
# Required. The resource name of the Search serving config, such as
|
785
|
+
# `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
|
786
|
+
# or
|
787
|
+
# `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`.
|
788
|
+
# This field is used to identify the serving configuration name, set
|
789
|
+
# of models used to make the search.
|
790
|
+
# @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash]
|
791
|
+
# Required. Current user query.
|
792
|
+
# @param session [::String]
|
793
|
+
# The session resource name. Not required.
|
794
|
+
#
|
795
|
+
# When session field is not set, the API is in sessionless mode.
|
796
|
+
#
|
797
|
+
# We support auto session mode: users can use the wildcard symbol `-` as
|
798
|
+
# session ID. A new ID will be automatically generated and assigned.
|
799
|
+
# @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash]
|
800
|
+
# Model specification.
|
801
|
+
# @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash]
|
802
|
+
# Related questions specification.
|
803
|
+
# @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash]
|
804
|
+
# Answer generation specification.
|
805
|
+
# @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash]
|
806
|
+
# Search specification.
|
807
|
+
# @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash]
|
808
|
+
# Query understanding specification.
|
809
|
+
# @param asynchronous_mode [::Boolean]
|
810
|
+
# Asynchronous mode control.
|
811
|
+
#
|
812
|
+
# If enabled, the response will be returned with answer/session resource
|
813
|
+
# name without final answer. The API users need to do the polling to get
|
814
|
+
# the latest status of answer/session by calling
|
815
|
+
# {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_answer ConversationalSearchService.GetAnswer}
|
816
|
+
# or
|
817
|
+
# {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_session ConversationalSearchService.GetSession}
|
818
|
+
# method.
|
819
|
+
# @param user_pseudo_id [::String]
|
820
|
+
# A unique identifier for tracking visitors. For example, this could be
|
821
|
+
# implemented with an HTTP cookie, which should be able to uniquely identify
|
822
|
+
# a visitor on a single device. This unique identifier should not change if
|
823
|
+
# the visitor logs in or out of the website.
|
824
|
+
#
|
825
|
+
# This field should NOT have a fixed value such as `unknown_visitor`.
|
826
|
+
#
|
827
|
+
# The field must be a UTF-8 encoded string with a length limit of 128
|
828
|
+
# characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
829
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
830
|
+
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse]
|
831
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
832
|
+
#
|
833
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse]
|
834
|
+
#
|
835
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
836
|
+
#
|
837
|
+
# @example Basic example
|
838
|
+
# require "google/cloud/discovery_engine/v1"
|
839
|
+
#
|
840
|
+
# # Create a client object. The client can be reused for multiple calls.
|
841
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
|
842
|
+
#
|
843
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
844
|
+
# request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new
|
845
|
+
#
|
846
|
+
# # Call the answer_query method.
|
847
|
+
# result = client.answer_query request
|
848
|
+
#
|
849
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.
|
850
|
+
# p result
|
851
|
+
#
|
852
|
+
def answer_query request, options = nil
|
853
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
854
|
+
|
855
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest
|
856
|
+
|
857
|
+
# Converts hash and nil to an options object
|
858
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
859
|
+
|
860
|
+
# Customize the options with defaults
|
861
|
+
call_metadata = @config.rpcs.answer_query.metadata.to_h
|
862
|
+
|
863
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
864
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
865
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
866
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
867
|
+
transports_version_send: [:rest]
|
868
|
+
|
869
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
870
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
871
|
+
|
872
|
+
options.apply_defaults timeout: @config.rpcs.answer_query.timeout,
|
873
|
+
metadata: call_metadata,
|
874
|
+
retry_policy: @config.rpcs.answer_query.retry_policy
|
875
|
+
|
876
|
+
options.apply_defaults timeout: @config.timeout,
|
877
|
+
metadata: @config.metadata,
|
878
|
+
retry_policy: @config.retry_policy
|
879
|
+
|
880
|
+
@conversational_search_service_stub.answer_query request, options do |result, operation|
|
881
|
+
yield result, operation if block_given?
|
882
|
+
return result
|
883
|
+
end
|
884
|
+
rescue ::Gapic::Rest::Error => e
|
885
|
+
raise ::Google::Cloud::Error.from_error(e)
|
886
|
+
end
|
887
|
+
|
888
|
+
##
|
889
|
+
# Gets a Answer.
|
890
|
+
#
|
891
|
+
# @overload get_answer(request, options = nil)
|
892
|
+
# Pass arguments to `get_answer` via a request object, either of type
|
893
|
+
# {::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest} or an equivalent Hash.
|
894
|
+
#
|
895
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Hash]
|
896
|
+
# A request object representing the call parameters. Required. To specify no
|
897
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
898
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
899
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
900
|
+
#
|
901
|
+
# @overload get_answer(name: nil)
|
902
|
+
# Pass arguments to `get_answer` via keyword arguments. Note that at
|
903
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
904
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
905
|
+
#
|
906
|
+
# @param name [::String]
|
907
|
+
# Required. The resource name of the Answer to get. Format:
|
908
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
|
909
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
910
|
+
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Answer]
|
911
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
912
|
+
#
|
913
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Answer]
|
914
|
+
#
|
915
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
916
|
+
#
|
917
|
+
# @example Basic example
|
918
|
+
# require "google/cloud/discovery_engine/v1"
|
919
|
+
#
|
920
|
+
# # Create a client object. The client can be reused for multiple calls.
|
921
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
|
922
|
+
#
|
923
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
924
|
+
# request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new
|
925
|
+
#
|
926
|
+
# # Call the get_answer method.
|
927
|
+
# result = client.get_answer request
|
928
|
+
#
|
929
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer.
|
930
|
+
# p result
|
931
|
+
#
|
932
|
+
def get_answer request, options = nil
|
933
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
934
|
+
|
935
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest
|
936
|
+
|
937
|
+
# Converts hash and nil to an options object
|
938
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
939
|
+
|
940
|
+
# Customize the options with defaults
|
941
|
+
call_metadata = @config.rpcs.get_answer.metadata.to_h
|
942
|
+
|
943
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
944
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
945
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
946
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
947
|
+
transports_version_send: [:rest]
|
948
|
+
|
949
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
950
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
951
|
+
|
952
|
+
options.apply_defaults timeout: @config.rpcs.get_answer.timeout,
|
953
|
+
metadata: call_metadata,
|
954
|
+
retry_policy: @config.rpcs.get_answer.retry_policy
|
955
|
+
|
956
|
+
options.apply_defaults timeout: @config.timeout,
|
957
|
+
metadata: @config.metadata,
|
958
|
+
retry_policy: @config.retry_policy
|
959
|
+
|
960
|
+
@conversational_search_service_stub.get_answer request, options do |result, operation|
|
961
|
+
yield result, operation if block_given?
|
962
|
+
return result
|
963
|
+
end
|
964
|
+
rescue ::Gapic::Rest::Error => e
|
965
|
+
raise ::Google::Cloud::Error.from_error(e)
|
966
|
+
end
|
967
|
+
|
968
|
+
##
|
969
|
+
# Creates a Session.
|
970
|
+
#
|
971
|
+
# If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already
|
972
|
+
# exists, an ALREADY_EXISTS error is returned.
|
973
|
+
#
|
974
|
+
# @overload create_session(request, options = nil)
|
975
|
+
# Pass arguments to `create_session` via a request object, either of type
|
976
|
+
# {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash.
|
977
|
+
#
|
978
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash]
|
979
|
+
# A request object representing the call parameters. Required. To specify no
|
980
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
981
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
982
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
983
|
+
#
|
984
|
+
# @overload create_session(parent: nil, session: nil)
|
985
|
+
# Pass arguments to `create_session` via keyword arguments. Note that at
|
986
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
987
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
988
|
+
#
|
989
|
+
# @param parent [::String]
|
990
|
+
# Required. Full resource name of parent data store. Format:
|
991
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
|
992
|
+
# @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash]
|
993
|
+
# Required. The session to create.
|
994
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
995
|
+
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session]
|
996
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
997
|
+
#
|
998
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Session]
|
999
|
+
#
|
1000
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1001
|
+
#
|
1002
|
+
# @example Basic example
|
1003
|
+
# require "google/cloud/discovery_engine/v1"
|
1004
|
+
#
|
1005
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1006
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
|
1007
|
+
#
|
1008
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1009
|
+
# request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new
|
1010
|
+
#
|
1011
|
+
# # Call the create_session method.
|
1012
|
+
# result = client.create_session request
|
1013
|
+
#
|
1014
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
|
1015
|
+
# p result
|
1016
|
+
#
|
1017
|
+
def create_session request, options = nil
|
1018
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1019
|
+
|
1020
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest
|
1021
|
+
|
1022
|
+
# Converts hash and nil to an options object
|
1023
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1024
|
+
|
1025
|
+
# Customize the options with defaults
|
1026
|
+
call_metadata = @config.rpcs.create_session.metadata.to_h
|
1027
|
+
|
1028
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1029
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1030
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1031
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
1032
|
+
transports_version_send: [:rest]
|
1033
|
+
|
1034
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1035
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1036
|
+
|
1037
|
+
options.apply_defaults timeout: @config.rpcs.create_session.timeout,
|
1038
|
+
metadata: call_metadata,
|
1039
|
+
retry_policy: @config.rpcs.create_session.retry_policy
|
1040
|
+
|
1041
|
+
options.apply_defaults timeout: @config.timeout,
|
1042
|
+
metadata: @config.metadata,
|
1043
|
+
retry_policy: @config.retry_policy
|
1044
|
+
|
1045
|
+
@conversational_search_service_stub.create_session request, options do |result, operation|
|
1046
|
+
yield result, operation if block_given?
|
1047
|
+
return result
|
1048
|
+
end
|
1049
|
+
rescue ::Gapic::Rest::Error => e
|
1050
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1051
|
+
end
|
1052
|
+
|
1053
|
+
##
|
1054
|
+
# Deletes a Session.
|
1055
|
+
#
|
1056
|
+
# If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does
|
1057
|
+
# not exist, a NOT_FOUND error is returned.
|
1058
|
+
#
|
1059
|
+
# @overload delete_session(request, options = nil)
|
1060
|
+
# Pass arguments to `delete_session` via a request object, either of type
|
1061
|
+
# {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash.
|
1062
|
+
#
|
1063
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash]
|
1064
|
+
# A request object representing the call parameters. Required. To specify no
|
1065
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1066
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1067
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1068
|
+
#
|
1069
|
+
# @overload delete_session(name: nil)
|
1070
|
+
# Pass arguments to `delete_session` via keyword arguments. Note that at
|
1071
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1072
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1073
|
+
#
|
1074
|
+
# @param name [::String]
|
1075
|
+
# Required. The resource name of the Session to delete. Format:
|
1076
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
|
1077
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1078
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
1079
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1080
|
+
#
|
1081
|
+
# @return [::Google::Protobuf::Empty]
|
1082
|
+
#
|
1083
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1084
|
+
#
|
1085
|
+
# @example Basic example
|
1086
|
+
# require "google/cloud/discovery_engine/v1"
|
1087
|
+
#
|
1088
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1089
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
|
1090
|
+
#
|
1091
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1092
|
+
# request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new
|
1093
|
+
#
|
1094
|
+
# # Call the delete_session method.
|
1095
|
+
# result = client.delete_session request
|
1096
|
+
#
|
1097
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1098
|
+
# p result
|
1099
|
+
#
|
1100
|
+
def delete_session request, options = nil
|
1101
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1102
|
+
|
1103
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest
|
1104
|
+
|
1105
|
+
# Converts hash and nil to an options object
|
1106
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1107
|
+
|
1108
|
+
# Customize the options with defaults
|
1109
|
+
call_metadata = @config.rpcs.delete_session.metadata.to_h
|
1110
|
+
|
1111
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1112
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1113
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1114
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
1115
|
+
transports_version_send: [:rest]
|
1116
|
+
|
1117
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1118
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1119
|
+
|
1120
|
+
options.apply_defaults timeout: @config.rpcs.delete_session.timeout,
|
1121
|
+
metadata: call_metadata,
|
1122
|
+
retry_policy: @config.rpcs.delete_session.retry_policy
|
1123
|
+
|
1124
|
+
options.apply_defaults timeout: @config.timeout,
|
1125
|
+
metadata: @config.metadata,
|
1126
|
+
retry_policy: @config.retry_policy
|
1127
|
+
|
1128
|
+
@conversational_search_service_stub.delete_session request, options do |result, operation|
|
1129
|
+
yield result, operation if block_given?
|
1130
|
+
return result
|
1131
|
+
end
|
1132
|
+
rescue ::Gapic::Rest::Error => e
|
1133
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1134
|
+
end
|
1135
|
+
|
1136
|
+
##
|
1137
|
+
# Updates a Session.
|
1138
|
+
#
|
1139
|
+
# {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be
|
1140
|
+
# changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to
|
1141
|
+
# update does not exist, a NOT_FOUND error is returned.
|
1142
|
+
#
|
1143
|
+
# @overload update_session(request, options = nil)
|
1144
|
+
# Pass arguments to `update_session` via a request object, either of type
|
1145
|
+
# {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash.
|
1146
|
+
#
|
1147
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash]
|
1148
|
+
# A request object representing the call parameters. Required. To specify no
|
1149
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1150
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1151
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1152
|
+
#
|
1153
|
+
# @overload update_session(session: nil, update_mask: nil)
|
1154
|
+
# Pass arguments to `update_session` via keyword arguments. Note that at
|
1155
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1156
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1157
|
+
#
|
1158
|
+
# @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash]
|
1159
|
+
# Required. The Session to update.
|
1160
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1161
|
+
# Indicates which fields in the provided
|
1162
|
+
# {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following
|
1163
|
+
# are NOT supported:
|
1164
|
+
#
|
1165
|
+
# * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name}
|
1166
|
+
#
|
1167
|
+
# If not set or empty, all supported fields are updated.
|
1168
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1169
|
+
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1170
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1171
|
+
#
|
1172
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1173
|
+
#
|
1174
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1175
|
+
#
|
1176
|
+
# @example Basic example
|
1177
|
+
# require "google/cloud/discovery_engine/v1"
|
1178
|
+
#
|
1179
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1180
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
|
1181
|
+
#
|
1182
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1183
|
+
# request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new
|
1184
|
+
#
|
1185
|
+
# # Call the update_session method.
|
1186
|
+
# result = client.update_session request
|
1187
|
+
#
|
1188
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
|
1189
|
+
# p result
|
1190
|
+
#
|
1191
|
+
def update_session request, options = nil
|
1192
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1193
|
+
|
1194
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest
|
1195
|
+
|
1196
|
+
# Converts hash and nil to an options object
|
1197
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1198
|
+
|
1199
|
+
# Customize the options with defaults
|
1200
|
+
call_metadata = @config.rpcs.update_session.metadata.to_h
|
1201
|
+
|
1202
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1203
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1204
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1205
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
1206
|
+
transports_version_send: [:rest]
|
1207
|
+
|
1208
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1209
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1210
|
+
|
1211
|
+
options.apply_defaults timeout: @config.rpcs.update_session.timeout,
|
1212
|
+
metadata: call_metadata,
|
1213
|
+
retry_policy: @config.rpcs.update_session.retry_policy
|
1214
|
+
|
1215
|
+
options.apply_defaults timeout: @config.timeout,
|
1216
|
+
metadata: @config.metadata,
|
1217
|
+
retry_policy: @config.retry_policy
|
1218
|
+
|
1219
|
+
@conversational_search_service_stub.update_session request, options do |result, operation|
|
1220
|
+
yield result, operation if block_given?
|
1221
|
+
return result
|
1222
|
+
end
|
1223
|
+
rescue ::Gapic::Rest::Error => e
|
1224
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1225
|
+
end
|
1226
|
+
|
1227
|
+
##
|
1228
|
+
# Gets a Session.
|
1229
|
+
#
|
1230
|
+
# @overload get_session(request, options = nil)
|
1231
|
+
# Pass arguments to `get_session` via a request object, either of type
|
1232
|
+
# {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash.
|
1233
|
+
#
|
1234
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash]
|
1235
|
+
# A request object representing the call parameters. Required. To specify no
|
1236
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1237
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1238
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1239
|
+
#
|
1240
|
+
# @overload get_session(name: nil)
|
1241
|
+
# Pass arguments to `get_session` via keyword arguments. Note that at
|
1242
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1243
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1244
|
+
#
|
1245
|
+
# @param name [::String]
|
1246
|
+
# Required. The resource name of the Session to get. Format:
|
1247
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
|
1248
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1249
|
+
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1250
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1251
|
+
#
|
1252
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1253
|
+
#
|
1254
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1255
|
+
#
|
1256
|
+
# @example Basic example
|
1257
|
+
# require "google/cloud/discovery_engine/v1"
|
1258
|
+
#
|
1259
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1260
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
|
1261
|
+
#
|
1262
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1263
|
+
# request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new
|
1264
|
+
#
|
1265
|
+
# # Call the get_session method.
|
1266
|
+
# result = client.get_session request
|
1267
|
+
#
|
1268
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
|
1269
|
+
# p result
|
1270
|
+
#
|
1271
|
+
def get_session request, options = nil
|
1272
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1273
|
+
|
1274
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest
|
1275
|
+
|
1276
|
+
# Converts hash and nil to an options object
|
1277
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1278
|
+
|
1279
|
+
# Customize the options with defaults
|
1280
|
+
call_metadata = @config.rpcs.get_session.metadata.to_h
|
1281
|
+
|
1282
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1283
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1284
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1285
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
1286
|
+
transports_version_send: [:rest]
|
1287
|
+
|
1288
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1289
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1290
|
+
|
1291
|
+
options.apply_defaults timeout: @config.rpcs.get_session.timeout,
|
1292
|
+
metadata: call_metadata,
|
1293
|
+
retry_policy: @config.rpcs.get_session.retry_policy
|
1294
|
+
|
1295
|
+
options.apply_defaults timeout: @config.timeout,
|
1296
|
+
metadata: @config.metadata,
|
1297
|
+
retry_policy: @config.retry_policy
|
1298
|
+
|
1299
|
+
@conversational_search_service_stub.get_session request, options do |result, operation|
|
1300
|
+
yield result, operation if block_given?
|
1301
|
+
return result
|
1302
|
+
end
|
1303
|
+
rescue ::Gapic::Rest::Error => e
|
1304
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1305
|
+
end
|
1306
|
+
|
1307
|
+
##
|
1308
|
+
# Lists all Sessions by their parent
|
1309
|
+
# {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}.
|
1310
|
+
#
|
1311
|
+
# @overload list_sessions(request, options = nil)
|
1312
|
+
# Pass arguments to `list_sessions` via a request object, either of type
|
1313
|
+
# {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash.
|
1314
|
+
#
|
1315
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash]
|
1316
|
+
# A request object representing the call parameters. Required. To specify no
|
1317
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1318
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1319
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1320
|
+
#
|
1321
|
+
# @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
1322
|
+
# Pass arguments to `list_sessions` via keyword arguments. Note that at
|
1323
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1324
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1325
|
+
#
|
1326
|
+
# @param parent [::String]
|
1327
|
+
# Required. The data store resource name. Format:
|
1328
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
|
1329
|
+
# @param page_size [::Integer]
|
1330
|
+
# Maximum number of results to return. If unspecified, defaults
|
1331
|
+
# to 50. Max allowed value is 1000.
|
1332
|
+
# @param page_token [::String]
|
1333
|
+
# A page token, received from a previous `ListSessions` call.
|
1334
|
+
# Provide this to retrieve the subsequent page.
|
1335
|
+
# @param filter [::String]
|
1336
|
+
# A filter to apply on the list results. The supported features are:
|
1337
|
+
# user_pseudo_id, state.
|
1338
|
+
#
|
1339
|
+
# Example:
|
1340
|
+
# "user_pseudo_id = some_id"
|
1341
|
+
# @param order_by [::String]
|
1342
|
+
# A comma-separated list of fields to order by, sorted in ascending order.
|
1343
|
+
# Use "desc" after a field name for descending.
|
1344
|
+
# Supported fields:
|
1345
|
+
# * `update_time`
|
1346
|
+
# * `create_time`
|
1347
|
+
# * `session_name`
|
1348
|
+
#
|
1349
|
+
# Example:
|
1350
|
+
# "update_time desc"
|
1351
|
+
# "create_time"
|
1352
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1353
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>]
|
1354
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1355
|
+
#
|
1356
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>]
|
1357
|
+
#
|
1358
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1359
|
+
#
|
1360
|
+
# @example Basic example
|
1361
|
+
# require "google/cloud/discovery_engine/v1"
|
1362
|
+
#
|
1363
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1364
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
|
1365
|
+
#
|
1366
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1367
|
+
# request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new
|
1368
|
+
#
|
1369
|
+
# # Call the list_sessions method.
|
1370
|
+
# result = client.list_sessions request
|
1371
|
+
#
|
1372
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1373
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1374
|
+
# result.each do |item|
|
1375
|
+
# # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session.
|
1376
|
+
# p item
|
1377
|
+
# end
|
1378
|
+
#
|
1379
|
+
def list_sessions request, options = nil
|
1380
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1381
|
+
|
1382
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest
|
1383
|
+
|
1384
|
+
# Converts hash and nil to an options object
|
1385
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1386
|
+
|
1387
|
+
# Customize the options with defaults
|
1388
|
+
call_metadata = @config.rpcs.list_sessions.metadata.to_h
|
1389
|
+
|
1390
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1391
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1392
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1393
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
|
1394
|
+
transports_version_send: [:rest]
|
1395
|
+
|
1396
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1397
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1398
|
+
|
1399
|
+
options.apply_defaults timeout: @config.rpcs.list_sessions.timeout,
|
1400
|
+
metadata: call_metadata,
|
1401
|
+
retry_policy: @config.rpcs.list_sessions.retry_policy
|
1402
|
+
|
1403
|
+
options.apply_defaults timeout: @config.timeout,
|
1404
|
+
metadata: @config.metadata,
|
1405
|
+
retry_policy: @config.retry_policy
|
1406
|
+
|
1407
|
+
@conversational_search_service_stub.list_sessions request, options do |result, operation|
|
1408
|
+
result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, "sessions", request, result, options
|
1409
|
+
yield result, operation if block_given?
|
1410
|
+
return result
|
1411
|
+
end
|
1412
|
+
rescue ::Gapic::Rest::Error => e
|
1413
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1414
|
+
end
|
1415
|
+
|
756
1416
|
##
|
757
1417
|
# Configuration class for the ConversationalSearchService REST API.
|
758
1418
|
#
|
@@ -916,6 +1576,41 @@ module Google
|
|
916
1576
|
# @return [::Gapic::Config::Method]
|
917
1577
|
#
|
918
1578
|
attr_reader :list_conversations
|
1579
|
+
##
|
1580
|
+
# RPC-specific configuration for `answer_query`
|
1581
|
+
# @return [::Gapic::Config::Method]
|
1582
|
+
#
|
1583
|
+
attr_reader :answer_query
|
1584
|
+
##
|
1585
|
+
# RPC-specific configuration for `get_answer`
|
1586
|
+
# @return [::Gapic::Config::Method]
|
1587
|
+
#
|
1588
|
+
attr_reader :get_answer
|
1589
|
+
##
|
1590
|
+
# RPC-specific configuration for `create_session`
|
1591
|
+
# @return [::Gapic::Config::Method]
|
1592
|
+
#
|
1593
|
+
attr_reader :create_session
|
1594
|
+
##
|
1595
|
+
# RPC-specific configuration for `delete_session`
|
1596
|
+
# @return [::Gapic::Config::Method]
|
1597
|
+
#
|
1598
|
+
attr_reader :delete_session
|
1599
|
+
##
|
1600
|
+
# RPC-specific configuration for `update_session`
|
1601
|
+
# @return [::Gapic::Config::Method]
|
1602
|
+
#
|
1603
|
+
attr_reader :update_session
|
1604
|
+
##
|
1605
|
+
# RPC-specific configuration for `get_session`
|
1606
|
+
# @return [::Gapic::Config::Method]
|
1607
|
+
#
|
1608
|
+
attr_reader :get_session
|
1609
|
+
##
|
1610
|
+
# RPC-specific configuration for `list_sessions`
|
1611
|
+
# @return [::Gapic::Config::Method]
|
1612
|
+
#
|
1613
|
+
attr_reader :list_sessions
|
919
1614
|
|
920
1615
|
# @private
|
921
1616
|
def initialize parent_rpcs = nil
|
@@ -931,6 +1626,20 @@ module Google
|
|
931
1626
|
@get_conversation = ::Gapic::Config::Method.new get_conversation_config
|
932
1627
|
list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations
|
933
1628
|
@list_conversations = ::Gapic::Config::Method.new list_conversations_config
|
1629
|
+
answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query
|
1630
|
+
@answer_query = ::Gapic::Config::Method.new answer_query_config
|
1631
|
+
get_answer_config = parent_rpcs.get_answer if parent_rpcs.respond_to? :get_answer
|
1632
|
+
@get_answer = ::Gapic::Config::Method.new get_answer_config
|
1633
|
+
create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session
|
1634
|
+
@create_session = ::Gapic::Config::Method.new create_session_config
|
1635
|
+
delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session
|
1636
|
+
@delete_session = ::Gapic::Config::Method.new delete_session_config
|
1637
|
+
update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session
|
1638
|
+
@update_session = ::Gapic::Config::Method.new update_session_config
|
1639
|
+
get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session
|
1640
|
+
@get_session = ::Gapic::Config::Method.new get_session_config
|
1641
|
+
list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions
|
1642
|
+
@list_sessions = ::Gapic::Config::Method.new list_sessions_config
|
934
1643
|
|
935
1644
|
yield self if block_given?
|
936
1645
|
end
|