google-cloud-discovery_engine-v1 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +228 -3
  3. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +13 -5
  4. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +214 -3
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +28 -5
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +136 -0
  7. data/lib/google/cloud/discovery_engine/v1/control_service/client.rb +875 -0
  8. data/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb +47 -0
  9. data/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +167 -0
  10. data/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +814 -0
  11. data/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb +440 -0
  12. data/lib/google/cloud/discovery_engine/v1/control_service/rest.rb +55 -0
  13. data/lib/google/cloud/discovery_engine/v1/control_service.rb +58 -0
  14. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +911 -135
  15. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +199 -0
  16. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +733 -6
  17. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +520 -0
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +15 -7
  19. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +13 -5
  20. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +45 -0
  21. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +15 -7
  22. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +28 -5
  23. data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +26 -14
  24. data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +13 -5
  25. data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +26 -14
  26. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +28 -5
  27. data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +13 -5
  28. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +13 -5
  29. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +13 -5
  30. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +28 -5
  31. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +471 -0
  32. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb +47 -0
  33. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb +52 -0
  34. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +438 -0
  35. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb +129 -0
  36. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb +52 -0
  37. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb +55 -0
  38. data/lib/google/cloud/discovery_engine/v1/project_service/client.rb +485 -0
  39. data/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +809 -0
  41. data/lib/google/cloud/discovery_engine/v1/project_service/paths.rb +47 -0
  42. data/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb +452 -0
  43. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +1114 -0
  44. data/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb +129 -0
  45. data/lib/google/cloud/discovery_engine/v1/project_service/rest.rb +54 -0
  46. data/lib/google/cloud/discovery_engine/v1/project_service.rb +57 -0
  47. data/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +481 -0
  48. data/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb +47 -0
  49. data/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb +52 -0
  50. data/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +448 -0
  51. data/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb +129 -0
  52. data/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb +52 -0
  53. data/lib/google/cloud/discovery_engine/v1/rank_service.rb +55 -0
  54. data/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +24 -19
  55. data/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb +66 -0
  56. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +24 -19
  57. data/lib/google/cloud/discovery_engine/v1/rest.rb +4 -0
  58. data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +18 -10
  59. data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +13 -5
  60. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +18 -10
  61. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +28 -5
  62. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +57 -9
  63. data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +68 -0
  64. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +57 -9
  65. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +27 -12
  66. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +13 -5
  67. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +27 -12
  68. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +28 -5
  69. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +23 -6
  70. data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +13 -5
  71. data/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb +21 -0
  72. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +23 -6
  73. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +28 -5
  74. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +15 -0
  75. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  76. data/lib/google/cloud/discovery_engine/v1.rb +4 -0
  77. data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +69 -0
  78. data/lib/google/cloud/discoveryengine/v1/chunk_pb.rb +50 -0
  79. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +2 -1
  80. data/lib/google/cloud/discoveryengine/v1/completion_pb.rb +2 -1
  81. data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +1 -1
  82. data/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +8 -0
  83. data/lib/google/cloud/discoveryengine/v1/control_pb.rb +55 -0
  84. data/lib/google/cloud/discoveryengine/v1/control_service_pb.rb +57 -0
  85. data/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb +69 -0
  86. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +32 -1
  87. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb +25 -0
  88. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +3 -1
  89. data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +51 -0
  90. data/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +1 -1
  91. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +1 -1
  92. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +52 -0
  93. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb +45 -0
  94. data/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +46 -0
  95. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +6 -1
  96. data/lib/google/cloud/discoveryengine/v1/project_pb.rb +49 -0
  97. data/lib/google/cloud/discoveryengine/v1/project_service_pb.rb +50 -0
  98. data/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb +51 -0
  99. data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +4 -1
  100. data/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb +49 -0
  101. data/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb +45 -0
  102. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +9 -1
  103. data/lib/google/cloud/discoveryengine/v1/session_pb.rb +50 -0
  104. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +1 -1
  105. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
  106. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
  107. data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +1 -1
  108. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +375 -0
  109. data/proto_docs/google/cloud/discoveryengine/v1/chunk.rb +119 -0
  110. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +16 -0
  111. data/proto_docs/google/cloud/discoveryengine/v1/completion.rb +31 -0
  112. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +207 -0
  113. data/proto_docs/google/cloud/discoveryengine/v1/control_service.rb +126 -0
  114. data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +2 -2
  115. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +529 -0
  116. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +3 -0
  117. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +2 -2
  118. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +1 -1
  119. data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +143 -0
  120. data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +5 -5
  121. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +3 -3
  122. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +144 -0
  123. data/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +79 -0
  124. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +118 -4
  125. data/proto_docs/google/cloud/discoveryengine/v1/project.rb +106 -0
  126. data/proto_docs/google/cloud/discoveryengine/v1/project_service.rb +57 -0
  127. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +42 -0
  128. data/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb +124 -0
  129. data/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb +20 -19
  130. data/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb +5 -5
  131. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +230 -20
  132. data/proto_docs/google/cloud/discoveryengine/v1/session.rb +88 -0
  133. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +3 -0
  134. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +24 -3
  135. data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +13 -1
  136. metadata +58 -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 and x-goog-user-project headers
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 and x-goog-user-project headers
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 and x-goog-user-project headers
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 and x-goog-user-project headers
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 and x-goog-user-project headers
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 and x-goog-user-project headers
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,675 @@ 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, user_labels: 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
+ # @param user_labels [::Hash{::String => ::String}]
830
+ # The user labels applied to a resource must meet the following requirements:
831
+ #
832
+ # * Each resource can have multiple labels, up to a maximum of 64.
833
+ # * Each label must be a key-value pair.
834
+ # * Keys have a minimum length of 1 character and a maximum length of 63
835
+ # characters and cannot be empty. Values can be empty and have a maximum
836
+ # length of 63 characters.
837
+ # * Keys and values can contain only lowercase letters, numeric characters,
838
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
839
+ # international characters are allowed.
840
+ # * The key portion of a label must be unique. However, you can use the same
841
+ # key with multiple resources.
842
+ # * Keys must start with a lowercase letter or international character.
843
+ #
844
+ # See [Google Cloud
845
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
846
+ # for more details.
847
+ # @yield [result, operation] Access the result along with the TransportOperation object
848
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse]
849
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
850
+ #
851
+ # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse]
852
+ #
853
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
854
+ #
855
+ # @example Basic example
856
+ # require "google/cloud/discovery_engine/v1"
857
+ #
858
+ # # Create a client object. The client can be reused for multiple calls.
859
+ # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
860
+ #
861
+ # # Create a request. To set request fields, pass in keyword arguments.
862
+ # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new
863
+ #
864
+ # # Call the answer_query method.
865
+ # result = client.answer_query request
866
+ #
867
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.
868
+ # p result
869
+ #
870
+ def answer_query request, options = nil
871
+ raise ::ArgumentError, "request must be provided" if request.nil?
872
+
873
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest
874
+
875
+ # Converts hash and nil to an options object
876
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
877
+
878
+ # Customize the options with defaults
879
+ call_metadata = @config.rpcs.answer_query.metadata.to_h
880
+
881
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
882
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
883
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
884
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
885
+ transports_version_send: [:rest]
886
+
887
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
888
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
889
+
890
+ options.apply_defaults timeout: @config.rpcs.answer_query.timeout,
891
+ metadata: call_metadata,
892
+ retry_policy: @config.rpcs.answer_query.retry_policy
893
+
894
+ options.apply_defaults timeout: @config.timeout,
895
+ metadata: @config.metadata,
896
+ retry_policy: @config.retry_policy
897
+
898
+ @conversational_search_service_stub.answer_query request, options do |result, operation|
899
+ yield result, operation if block_given?
900
+ return result
901
+ end
902
+ rescue ::Gapic::Rest::Error => e
903
+ raise ::Google::Cloud::Error.from_error(e)
904
+ end
905
+
906
+ ##
907
+ # Gets a Answer.
908
+ #
909
+ # @overload get_answer(request, options = nil)
910
+ # Pass arguments to `get_answer` via a request object, either of type
911
+ # {::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest} or an equivalent Hash.
912
+ #
913
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Hash]
914
+ # A request object representing the call parameters. Required. To specify no
915
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
916
+ # @param options [::Gapic::CallOptions, ::Hash]
917
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
918
+ #
919
+ # @overload get_answer(name: nil)
920
+ # Pass arguments to `get_answer` via keyword arguments. Note that at
921
+ # least one keyword argument is required. To specify no parameters, or to keep all
922
+ # the default parameter values, pass an empty Hash as a request object (see above).
923
+ #
924
+ # @param name [::String]
925
+ # Required. The resource name of the Answer to get. Format:
926
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
927
+ # @yield [result, operation] Access the result along with the TransportOperation object
928
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Answer]
929
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
930
+ #
931
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Answer]
932
+ #
933
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
934
+ #
935
+ # @example Basic example
936
+ # require "google/cloud/discovery_engine/v1"
937
+ #
938
+ # # Create a client object. The client can be reused for multiple calls.
939
+ # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
940
+ #
941
+ # # Create a request. To set request fields, pass in keyword arguments.
942
+ # request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new
943
+ #
944
+ # # Call the get_answer method.
945
+ # result = client.get_answer request
946
+ #
947
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer.
948
+ # p result
949
+ #
950
+ def get_answer request, options = nil
951
+ raise ::ArgumentError, "request must be provided" if request.nil?
952
+
953
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest
954
+
955
+ # Converts hash and nil to an options object
956
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
957
+
958
+ # Customize the options with defaults
959
+ call_metadata = @config.rpcs.get_answer.metadata.to_h
960
+
961
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
962
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
963
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
964
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
965
+ transports_version_send: [:rest]
966
+
967
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
968
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
969
+
970
+ options.apply_defaults timeout: @config.rpcs.get_answer.timeout,
971
+ metadata: call_metadata,
972
+ retry_policy: @config.rpcs.get_answer.retry_policy
973
+
974
+ options.apply_defaults timeout: @config.timeout,
975
+ metadata: @config.metadata,
976
+ retry_policy: @config.retry_policy
977
+
978
+ @conversational_search_service_stub.get_answer request, options do |result, operation|
979
+ yield result, operation if block_given?
980
+ return result
981
+ end
982
+ rescue ::Gapic::Rest::Error => e
983
+ raise ::Google::Cloud::Error.from_error(e)
984
+ end
985
+
986
+ ##
987
+ # Creates a Session.
988
+ #
989
+ # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already
990
+ # exists, an ALREADY_EXISTS error is returned.
991
+ #
992
+ # @overload create_session(request, options = nil)
993
+ # Pass arguments to `create_session` via a request object, either of type
994
+ # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash.
995
+ #
996
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash]
997
+ # A request object representing the call parameters. Required. To specify no
998
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
999
+ # @param options [::Gapic::CallOptions, ::Hash]
1000
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1001
+ #
1002
+ # @overload create_session(parent: nil, session: nil)
1003
+ # Pass arguments to `create_session` via keyword arguments. Note that at
1004
+ # least one keyword argument is required. To specify no parameters, or to keep all
1005
+ # the default parameter values, pass an empty Hash as a request object (see above).
1006
+ #
1007
+ # @param parent [::String]
1008
+ # Required. Full resource name of parent data store. Format:
1009
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
1010
+ # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash]
1011
+ # Required. The session to create.
1012
+ # @yield [result, operation] Access the result along with the TransportOperation object
1013
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session]
1014
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1015
+ #
1016
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Session]
1017
+ #
1018
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1019
+ #
1020
+ # @example Basic example
1021
+ # require "google/cloud/discovery_engine/v1"
1022
+ #
1023
+ # # Create a client object. The client can be reused for multiple calls.
1024
+ # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
1025
+ #
1026
+ # # Create a request. To set request fields, pass in keyword arguments.
1027
+ # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new
1028
+ #
1029
+ # # Call the create_session method.
1030
+ # result = client.create_session request
1031
+ #
1032
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
1033
+ # p result
1034
+ #
1035
+ def create_session request, options = nil
1036
+ raise ::ArgumentError, "request must be provided" if request.nil?
1037
+
1038
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest
1039
+
1040
+ # Converts hash and nil to an options object
1041
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1042
+
1043
+ # Customize the options with defaults
1044
+ call_metadata = @config.rpcs.create_session.metadata.to_h
1045
+
1046
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1047
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1048
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1049
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
1050
+ transports_version_send: [:rest]
1051
+
1052
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1053
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1054
+
1055
+ options.apply_defaults timeout: @config.rpcs.create_session.timeout,
1056
+ metadata: call_metadata,
1057
+ retry_policy: @config.rpcs.create_session.retry_policy
1058
+
1059
+ options.apply_defaults timeout: @config.timeout,
1060
+ metadata: @config.metadata,
1061
+ retry_policy: @config.retry_policy
1062
+
1063
+ @conversational_search_service_stub.create_session request, options do |result, operation|
1064
+ yield result, operation if block_given?
1065
+ return result
1066
+ end
1067
+ rescue ::Gapic::Rest::Error => e
1068
+ raise ::Google::Cloud::Error.from_error(e)
1069
+ end
1070
+
1071
+ ##
1072
+ # Deletes a Session.
1073
+ #
1074
+ # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does
1075
+ # not exist, a NOT_FOUND error is returned.
1076
+ #
1077
+ # @overload delete_session(request, options = nil)
1078
+ # Pass arguments to `delete_session` via a request object, either of type
1079
+ # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash.
1080
+ #
1081
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash]
1082
+ # A request object representing the call parameters. Required. To specify no
1083
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1084
+ # @param options [::Gapic::CallOptions, ::Hash]
1085
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1086
+ #
1087
+ # @overload delete_session(name: nil)
1088
+ # Pass arguments to `delete_session` via keyword arguments. Note that at
1089
+ # least one keyword argument is required. To specify no parameters, or to keep all
1090
+ # the default parameter values, pass an empty Hash as a request object (see above).
1091
+ #
1092
+ # @param name [::String]
1093
+ # Required. The resource name of the Session to delete. Format:
1094
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1095
+ # @yield [result, operation] Access the result along with the TransportOperation object
1096
+ # @yieldparam result [::Google::Protobuf::Empty]
1097
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1098
+ #
1099
+ # @return [::Google::Protobuf::Empty]
1100
+ #
1101
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1102
+ #
1103
+ # @example Basic example
1104
+ # require "google/cloud/discovery_engine/v1"
1105
+ #
1106
+ # # Create a client object. The client can be reused for multiple calls.
1107
+ # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
1108
+ #
1109
+ # # Create a request. To set request fields, pass in keyword arguments.
1110
+ # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new
1111
+ #
1112
+ # # Call the delete_session method.
1113
+ # result = client.delete_session request
1114
+ #
1115
+ # # The returned object is of type Google::Protobuf::Empty.
1116
+ # p result
1117
+ #
1118
+ def delete_session request, options = nil
1119
+ raise ::ArgumentError, "request must be provided" if request.nil?
1120
+
1121
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest
1122
+
1123
+ # Converts hash and nil to an options object
1124
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1125
+
1126
+ # Customize the options with defaults
1127
+ call_metadata = @config.rpcs.delete_session.metadata.to_h
1128
+
1129
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1130
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1131
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1132
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
1133
+ transports_version_send: [:rest]
1134
+
1135
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1136
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1137
+
1138
+ options.apply_defaults timeout: @config.rpcs.delete_session.timeout,
1139
+ metadata: call_metadata,
1140
+ retry_policy: @config.rpcs.delete_session.retry_policy
1141
+
1142
+ options.apply_defaults timeout: @config.timeout,
1143
+ metadata: @config.metadata,
1144
+ retry_policy: @config.retry_policy
1145
+
1146
+ @conversational_search_service_stub.delete_session request, options do |result, operation|
1147
+ yield result, operation if block_given?
1148
+ return result
1149
+ end
1150
+ rescue ::Gapic::Rest::Error => e
1151
+ raise ::Google::Cloud::Error.from_error(e)
1152
+ end
1153
+
1154
+ ##
1155
+ # Updates a Session.
1156
+ #
1157
+ # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be
1158
+ # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to
1159
+ # update does not exist, a NOT_FOUND error is returned.
1160
+ #
1161
+ # @overload update_session(request, options = nil)
1162
+ # Pass arguments to `update_session` via a request object, either of type
1163
+ # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash.
1164
+ #
1165
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash]
1166
+ # A request object representing the call parameters. Required. To specify no
1167
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1168
+ # @param options [::Gapic::CallOptions, ::Hash]
1169
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1170
+ #
1171
+ # @overload update_session(session: nil, update_mask: nil)
1172
+ # Pass arguments to `update_session` via keyword arguments. Note that at
1173
+ # least one keyword argument is required. To specify no parameters, or to keep all
1174
+ # the default parameter values, pass an empty Hash as a request object (see above).
1175
+ #
1176
+ # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash]
1177
+ # Required. The Session to update.
1178
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1179
+ # Indicates which fields in the provided
1180
+ # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following
1181
+ # are NOT supported:
1182
+ #
1183
+ # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name}
1184
+ #
1185
+ # If not set or empty, all supported fields are updated.
1186
+ # @yield [result, operation] Access the result along with the TransportOperation object
1187
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session]
1188
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1189
+ #
1190
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Session]
1191
+ #
1192
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1193
+ #
1194
+ # @example Basic example
1195
+ # require "google/cloud/discovery_engine/v1"
1196
+ #
1197
+ # # Create a client object. The client can be reused for multiple calls.
1198
+ # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
1199
+ #
1200
+ # # Create a request. To set request fields, pass in keyword arguments.
1201
+ # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new
1202
+ #
1203
+ # # Call the update_session method.
1204
+ # result = client.update_session request
1205
+ #
1206
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
1207
+ # p result
1208
+ #
1209
+ def update_session request, options = nil
1210
+ raise ::ArgumentError, "request must be provided" if request.nil?
1211
+
1212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest
1213
+
1214
+ # Converts hash and nil to an options object
1215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1216
+
1217
+ # Customize the options with defaults
1218
+ call_metadata = @config.rpcs.update_session.metadata.to_h
1219
+
1220
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1221
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1223
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
1224
+ transports_version_send: [:rest]
1225
+
1226
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1227
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1228
+
1229
+ options.apply_defaults timeout: @config.rpcs.update_session.timeout,
1230
+ metadata: call_metadata,
1231
+ retry_policy: @config.rpcs.update_session.retry_policy
1232
+
1233
+ options.apply_defaults timeout: @config.timeout,
1234
+ metadata: @config.metadata,
1235
+ retry_policy: @config.retry_policy
1236
+
1237
+ @conversational_search_service_stub.update_session request, options do |result, operation|
1238
+ yield result, operation if block_given?
1239
+ return result
1240
+ end
1241
+ rescue ::Gapic::Rest::Error => e
1242
+ raise ::Google::Cloud::Error.from_error(e)
1243
+ end
1244
+
1245
+ ##
1246
+ # Gets a Session.
1247
+ #
1248
+ # @overload get_session(request, options = nil)
1249
+ # Pass arguments to `get_session` via a request object, either of type
1250
+ # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash.
1251
+ #
1252
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash]
1253
+ # A request object representing the call parameters. Required. To specify no
1254
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1255
+ # @param options [::Gapic::CallOptions, ::Hash]
1256
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1257
+ #
1258
+ # @overload get_session(name: nil)
1259
+ # Pass arguments to `get_session` via keyword arguments. Note that at
1260
+ # least one keyword argument is required. To specify no parameters, or to keep all
1261
+ # the default parameter values, pass an empty Hash as a request object (see above).
1262
+ #
1263
+ # @param name [::String]
1264
+ # Required. The resource name of the Session to get. Format:
1265
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1266
+ # @yield [result, operation] Access the result along with the TransportOperation object
1267
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session]
1268
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1269
+ #
1270
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Session]
1271
+ #
1272
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1273
+ #
1274
+ # @example Basic example
1275
+ # require "google/cloud/discovery_engine/v1"
1276
+ #
1277
+ # # Create a client object. The client can be reused for multiple calls.
1278
+ # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
1279
+ #
1280
+ # # Create a request. To set request fields, pass in keyword arguments.
1281
+ # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new
1282
+ #
1283
+ # # Call the get_session method.
1284
+ # result = client.get_session request
1285
+ #
1286
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
1287
+ # p result
1288
+ #
1289
+ def get_session request, options = nil
1290
+ raise ::ArgumentError, "request must be provided" if request.nil?
1291
+
1292
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest
1293
+
1294
+ # Converts hash and nil to an options object
1295
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1296
+
1297
+ # Customize the options with defaults
1298
+ call_metadata = @config.rpcs.get_session.metadata.to_h
1299
+
1300
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1301
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1302
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1303
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
1304
+ transports_version_send: [:rest]
1305
+
1306
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1307
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1308
+
1309
+ options.apply_defaults timeout: @config.rpcs.get_session.timeout,
1310
+ metadata: call_metadata,
1311
+ retry_policy: @config.rpcs.get_session.retry_policy
1312
+
1313
+ options.apply_defaults timeout: @config.timeout,
1314
+ metadata: @config.metadata,
1315
+ retry_policy: @config.retry_policy
1316
+
1317
+ @conversational_search_service_stub.get_session request, options do |result, operation|
1318
+ yield result, operation if block_given?
1319
+ return result
1320
+ end
1321
+ rescue ::Gapic::Rest::Error => e
1322
+ raise ::Google::Cloud::Error.from_error(e)
1323
+ end
1324
+
1325
+ ##
1326
+ # Lists all Sessions by their parent
1327
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}.
1328
+ #
1329
+ # @overload list_sessions(request, options = nil)
1330
+ # Pass arguments to `list_sessions` via a request object, either of type
1331
+ # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash.
1332
+ #
1333
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash]
1334
+ # A request object representing the call parameters. Required. To specify no
1335
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1336
+ # @param options [::Gapic::CallOptions, ::Hash]
1337
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1338
+ #
1339
+ # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1340
+ # Pass arguments to `list_sessions` via keyword arguments. Note that at
1341
+ # least one keyword argument is required. To specify no parameters, or to keep all
1342
+ # the default parameter values, pass an empty Hash as a request object (see above).
1343
+ #
1344
+ # @param parent [::String]
1345
+ # Required. The data store resource name. Format:
1346
+ # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
1347
+ # @param page_size [::Integer]
1348
+ # Maximum number of results to return. If unspecified, defaults
1349
+ # to 50. Max allowed value is 1000.
1350
+ # @param page_token [::String]
1351
+ # A page token, received from a previous `ListSessions` call.
1352
+ # Provide this to retrieve the subsequent page.
1353
+ # @param filter [::String]
1354
+ # A filter to apply on the list results. The supported features are:
1355
+ # user_pseudo_id, state.
1356
+ #
1357
+ # Example:
1358
+ # "user_pseudo_id = some_id"
1359
+ # @param order_by [::String]
1360
+ # A comma-separated list of fields to order by, sorted in ascending order.
1361
+ # Use "desc" after a field name for descending.
1362
+ # Supported fields:
1363
+ # * `update_time`
1364
+ # * `create_time`
1365
+ # * `session_name`
1366
+ #
1367
+ # Example:
1368
+ # "update_time desc"
1369
+ # "create_time"
1370
+ # @yield [result, operation] Access the result along with the TransportOperation object
1371
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>]
1372
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1373
+ #
1374
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>]
1375
+ #
1376
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1377
+ #
1378
+ # @example Basic example
1379
+ # require "google/cloud/discovery_engine/v1"
1380
+ #
1381
+ # # Create a client object. The client can be reused for multiple calls.
1382
+ # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new
1383
+ #
1384
+ # # Create a request. To set request fields, pass in keyword arguments.
1385
+ # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new
1386
+ #
1387
+ # # Call the list_sessions method.
1388
+ # result = client.list_sessions request
1389
+ #
1390
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1391
+ # # over elements, and API calls will be issued to fetch pages as needed.
1392
+ # result.each do |item|
1393
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session.
1394
+ # p item
1395
+ # end
1396
+ #
1397
+ def list_sessions request, options = nil
1398
+ raise ::ArgumentError, "request must be provided" if request.nil?
1399
+
1400
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest
1401
+
1402
+ # Converts hash and nil to an options object
1403
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1404
+
1405
+ # Customize the options with defaults
1406
+ call_metadata = @config.rpcs.list_sessions.metadata.to_h
1407
+
1408
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1409
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1410
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1411
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
1412
+ transports_version_send: [:rest]
1413
+
1414
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1415
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1416
+
1417
+ options.apply_defaults timeout: @config.rpcs.list_sessions.timeout,
1418
+ metadata: call_metadata,
1419
+ retry_policy: @config.rpcs.list_sessions.retry_policy
1420
+
1421
+ options.apply_defaults timeout: @config.timeout,
1422
+ metadata: @config.metadata,
1423
+ retry_policy: @config.retry_policy
1424
+
1425
+ @conversational_search_service_stub.list_sessions request, options do |result, operation|
1426
+ result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, "sessions", request, result, options
1427
+ yield result, operation if block_given?
1428
+ return result
1429
+ end
1430
+ rescue ::Gapic::Rest::Error => e
1431
+ raise ::Google::Cloud::Error.from_error(e)
1432
+ end
1433
+
756
1434
  ##
757
1435
  # Configuration class for the ConversationalSearchService REST API.
758
1436
  #
@@ -916,6 +1594,41 @@ module Google
916
1594
  # @return [::Gapic::Config::Method]
917
1595
  #
918
1596
  attr_reader :list_conversations
1597
+ ##
1598
+ # RPC-specific configuration for `answer_query`
1599
+ # @return [::Gapic::Config::Method]
1600
+ #
1601
+ attr_reader :answer_query
1602
+ ##
1603
+ # RPC-specific configuration for `get_answer`
1604
+ # @return [::Gapic::Config::Method]
1605
+ #
1606
+ attr_reader :get_answer
1607
+ ##
1608
+ # RPC-specific configuration for `create_session`
1609
+ # @return [::Gapic::Config::Method]
1610
+ #
1611
+ attr_reader :create_session
1612
+ ##
1613
+ # RPC-specific configuration for `delete_session`
1614
+ # @return [::Gapic::Config::Method]
1615
+ #
1616
+ attr_reader :delete_session
1617
+ ##
1618
+ # RPC-specific configuration for `update_session`
1619
+ # @return [::Gapic::Config::Method]
1620
+ #
1621
+ attr_reader :update_session
1622
+ ##
1623
+ # RPC-specific configuration for `get_session`
1624
+ # @return [::Gapic::Config::Method]
1625
+ #
1626
+ attr_reader :get_session
1627
+ ##
1628
+ # RPC-specific configuration for `list_sessions`
1629
+ # @return [::Gapic::Config::Method]
1630
+ #
1631
+ attr_reader :list_sessions
919
1632
 
920
1633
  # @private
921
1634
  def initialize parent_rpcs = nil
@@ -931,6 +1644,20 @@ module Google
931
1644
  @get_conversation = ::Gapic::Config::Method.new get_conversation_config
932
1645
  list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations
933
1646
  @list_conversations = ::Gapic::Config::Method.new list_conversations_config
1647
+ answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query
1648
+ @answer_query = ::Gapic::Config::Method.new answer_query_config
1649
+ get_answer_config = parent_rpcs.get_answer if parent_rpcs.respond_to? :get_answer
1650
+ @get_answer = ::Gapic::Config::Method.new get_answer_config
1651
+ create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session
1652
+ @create_session = ::Gapic::Config::Method.new create_session_config
1653
+ delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session
1654
+ @delete_session = ::Gapic::Config::Method.new delete_session_config
1655
+ update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session
1656
+ @update_session = ::Gapic::Config::Method.new update_session_config
1657
+ get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session
1658
+ @get_session = ::Gapic::Config::Method.new get_session_config
1659
+ list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions
1660
+ @list_sessions = ::Gapic::Config::Method.new list_sessions_config
934
1661
 
935
1662
  yield self if block_given?
936
1663
  end