google-cloud-discovery_engine-v1beta 0.10.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +9 -3
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +13 -5
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +9 -3
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +21 -6
  6. data/lib/google/cloud/discovery_engine/v1beta/control_service/client.rb +875 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/control_service/credentials.rb +47 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/control_service/paths.rb +167 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/client.rb +814 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/service_stub.rb +440 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/control_service.rb +58 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +764 -6
  14. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +199 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +715 -6
  16. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +520 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +15 -7
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +13 -5
  19. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +15 -7
  20. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +21 -6
  21. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +71 -37
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +13 -5
  23. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +21 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +71 -37
  25. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +21 -6
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +312 -5
  27. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +13 -5
  28. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +291 -5
  29. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +21 -6
  30. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +180 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +471 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/credentials.rb +47 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +52 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +438 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +129 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest.rb +52 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service.rb +55 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/project_service/client.rb +485 -0
  39. data/lib/google/cloud/discovery_engine/v1beta/project_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1beta/project_service/operations.rb +809 -0
  41. data/lib/google/cloud/discovery_engine/v1beta/project_service/paths.rb +47 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/client.rb +452 -0
  43. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +1092 -0
  44. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/service_stub.rb +129 -0
  45. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest.rb +54 -0
  46. data/lib/google/cloud/discovery_engine/v1beta/project_service.rb +57 -0
  47. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +481 -0
  48. data/lib/google/cloud/discovery_engine/v1beta/rank_service/credentials.rb +47 -0
  49. data/lib/google/cloud/discovery_engine/v1beta/rank_service/paths.rb +52 -0
  50. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +448 -0
  51. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +129 -0
  52. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest.rb +52 -0
  53. data/lib/google/cloud/discovery_engine/v1beta/rank_service.rb +55 -0
  54. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +24 -19
  55. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +66 -0
  56. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +24 -19
  57. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +4 -0
  58. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +18 -10
  59. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +13 -5
  60. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +18 -10
  61. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +21 -6
  62. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +26 -14
  63. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +26 -14
  64. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +104 -2
  65. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +13 -5
  66. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +97 -2
  67. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +21 -6
  68. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +59 -0
  69. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +9 -3
  70. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +9 -3
  71. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +27 -12
  72. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +13 -5
  73. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +27 -12
  74. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +21 -6
  75. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +23 -6
  76. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +13 -5
  77. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/paths.rb +21 -0
  78. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +23 -6
  79. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +21 -6
  80. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +8 -0
  81. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  82. data/lib/google/cloud/discovery_engine/v1beta.rb +4 -0
  83. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +69 -0
  84. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +2 -1
  85. data/lib/google/cloud/discoveryengine/v1beta/control_pb.rb +55 -0
  86. data/lib/google/cloud/discoveryengine/v1beta/control_service_pb.rb +57 -0
  87. data/lib/google/cloud/discoveryengine/v1beta/control_service_services_pb.rb +69 -0
  88. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +32 -1
  89. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_services_pb.rb +25 -0
  90. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +48 -0
  91. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +1 -1
  92. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +3 -1
  93. data/lib/google/cloud/discoveryengine/v1beta/document_service_services_pb.rb +1 -1
  94. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +1 -1
  95. data/lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb +6 -1
  96. data/lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb +12 -0
  97. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +52 -0
  98. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +45 -0
  99. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +46 -0
  100. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +13 -1
  101. data/lib/google/cloud/discoveryengine/v1beta/project_pb.rb +49 -0
  102. data/lib/google/cloud/discoveryengine/v1beta/project_service_pb.rb +50 -0
  103. data/lib/google/cloud/discoveryengine/v1beta/project_service_services_pb.rb +51 -0
  104. data/lib/google/cloud/discoveryengine/v1beta/rank_service_pb.rb +49 -0
  105. data/lib/google/cloud/discoveryengine/v1beta/rank_service_services_pb.rb +45 -0
  106. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +7 -1
  107. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +5 -1
  108. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_services_pb.rb +2 -0
  109. data/lib/google/cloud/discoveryengine/v1beta/session_pb.rb +50 -0
  110. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +1 -1
  111. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  112. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +1 -1
  113. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +1 -1
  114. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +362 -0
  115. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +25 -1
  116. data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +209 -0
  117. data/proto_docs/google/cloud/discoveryengine/v1beta/control_service.rb +126 -0
  118. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +2 -2
  119. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +491 -0
  120. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +75 -0
  121. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +2 -2
  122. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +4 -5
  123. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +9 -6
  124. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +5 -5
  125. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +51 -0
  126. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +144 -0
  127. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +79 -0
  128. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +312 -26
  129. data/proto_docs/google/cloud/discoveryengine/v1beta/project.rb +106 -0
  130. data/proto_docs/google/cloud/discoveryengine/v1beta/project_service.rb +57 -0
  131. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +127 -0
  132. data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +20 -19
  133. data/proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb +5 -5
  134. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +181 -43
  135. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +47 -1
  136. data/proto_docs/google/cloud/discoveryengine/v1beta/session.rb +88 -0
  137. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +3 -0
  138. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +25 -4
  139. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +13 -1
  140. metadata +56 -2
@@ -32,6 +32,9 @@ module Google
32
32
  # configuration.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
35
38
  # @private
36
39
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
37
40
 
@@ -265,10 +268,11 @@ module Google
265
268
  # Customize the options with defaults
266
269
  metadata = @config.rpcs.create_engine.metadata.to_h
267
270
 
268
- # Set x-goog-api-client and x-goog-user-project headers
271
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
269
272
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
270
273
  lib_name: @config.lib_name, lib_version: @config.lib_version,
271
274
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
275
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
272
276
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
273
277
 
274
278
  header_params = {}
@@ -367,10 +371,11 @@ module Google
367
371
  # Customize the options with defaults
368
372
  metadata = @config.rpcs.delete_engine.metadata.to_h
369
373
 
370
- # Set x-goog-api-client and x-goog-user-project headers
374
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
371
375
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
372
376
  lib_name: @config.lib_name, lib_version: @config.lib_version,
373
377
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
378
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
374
379
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
375
380
 
376
381
  header_params = {}
@@ -467,10 +472,11 @@ module Google
467
472
  # Customize the options with defaults
468
473
  metadata = @config.rpcs.update_engine.metadata.to_h
469
474
 
470
- # Set x-goog-api-client and x-goog-user-project headers
475
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
471
476
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
472
477
  lib_name: @config.lib_name, lib_version: @config.lib_version,
473
478
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
479
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
474
480
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
475
481
 
476
482
  header_params = {}
@@ -554,10 +560,11 @@ module Google
554
560
  # Customize the options with defaults
555
561
  metadata = @config.rpcs.get_engine.metadata.to_h
556
562
 
557
- # Set x-goog-api-client and x-goog-user-project headers
563
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
558
564
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
559
565
  lib_name: @config.lib_name, lib_version: @config.lib_version,
560
566
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
567
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
561
568
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
562
569
 
563
570
  header_params = {}
@@ -652,10 +659,11 @@ module Google
652
659
  # Customize the options with defaults
653
660
  metadata = @config.rpcs.list_engines.metadata.to_h
654
661
 
655
- # Set x-goog-api-client and x-goog-user-project headers
662
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
656
663
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
657
664
  lib_name: @config.lib_name, lib_version: @config.lib_version,
658
665
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
666
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
659
667
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
660
668
 
661
669
  header_params = {}
@@ -683,6 +691,284 @@ module Google
683
691
  raise ::Google::Cloud::Error.from_error(e)
684
692
  end
685
693
 
694
+ ##
695
+ # Pauses the training of an existing engine. Only applicable if
696
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType SolutionType} is
697
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}.
698
+ #
699
+ # @overload pause_engine(request, options = nil)
700
+ # Pass arguments to `pause_engine` via a request object, either of type
701
+ # {::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest} or an equivalent Hash.
702
+ #
703
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest, ::Hash]
704
+ # A request object representing the call parameters. Required. To specify no
705
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
706
+ # @param options [::Gapic::CallOptions, ::Hash]
707
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
708
+ #
709
+ # @overload pause_engine(name: nil)
710
+ # Pass arguments to `pause_engine` via keyword arguments. Note that at
711
+ # least one keyword argument is required. To specify no parameters, or to keep all
712
+ # the default parameter values, pass an empty Hash as a request object (see above).
713
+ #
714
+ # @param name [::String]
715
+ # Required. The name of the engine to pause.
716
+ # Format:
717
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
718
+ #
719
+ # @yield [response, operation] Access the result along with the RPC operation
720
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
721
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
722
+ #
723
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
724
+ #
725
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
726
+ #
727
+ # @example Basic example
728
+ # require "google/cloud/discovery_engine/v1beta"
729
+ #
730
+ # # Create a client object. The client can be reused for multiple calls.
731
+ # client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new
732
+ #
733
+ # # Create a request. To set request fields, pass in keyword arguments.
734
+ # request = Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest.new
735
+ #
736
+ # # Call the pause_engine method.
737
+ # result = client.pause_engine request
738
+ #
739
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Engine.
740
+ # p result
741
+ #
742
+ def pause_engine request, options = nil
743
+ raise ::ArgumentError, "request must be provided" if request.nil?
744
+
745
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest
746
+
747
+ # Converts hash and nil to an options object
748
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
749
+
750
+ # Customize the options with defaults
751
+ metadata = @config.rpcs.pause_engine.metadata.to_h
752
+
753
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
754
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
755
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
756
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
757
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
758
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
759
+
760
+ header_params = {}
761
+ if request.name
762
+ header_params["name"] = request.name
763
+ end
764
+
765
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
766
+ metadata[:"x-goog-request-params"] ||= request_params_header
767
+
768
+ options.apply_defaults timeout: @config.rpcs.pause_engine.timeout,
769
+ metadata: metadata,
770
+ retry_policy: @config.rpcs.pause_engine.retry_policy
771
+
772
+ options.apply_defaults timeout: @config.timeout,
773
+ metadata: @config.metadata,
774
+ retry_policy: @config.retry_policy
775
+
776
+ @engine_service_stub.call_rpc :pause_engine, request, options: options do |response, operation|
777
+ yield response, operation if block_given?
778
+ return response
779
+ end
780
+ rescue ::GRPC::BadStatus => e
781
+ raise ::Google::Cloud::Error.from_error(e)
782
+ end
783
+
784
+ ##
785
+ # Resumes the training of an existing engine. Only applicable if
786
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType SolutionType} is
787
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}.
788
+ #
789
+ # @overload resume_engine(request, options = nil)
790
+ # Pass arguments to `resume_engine` via a request object, either of type
791
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest} or an equivalent Hash.
792
+ #
793
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest, ::Hash]
794
+ # A request object representing the call parameters. Required. To specify no
795
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
796
+ # @param options [::Gapic::CallOptions, ::Hash]
797
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
798
+ #
799
+ # @overload resume_engine(name: nil)
800
+ # Pass arguments to `resume_engine` via keyword arguments. Note that at
801
+ # least one keyword argument is required. To specify no parameters, or to keep all
802
+ # the default parameter values, pass an empty Hash as a request object (see above).
803
+ #
804
+ # @param name [::String]
805
+ # Required. The name of the engine to resume.
806
+ # Format:
807
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
808
+ #
809
+ # @yield [response, operation] Access the result along with the RPC operation
810
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
811
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
812
+ #
813
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
814
+ #
815
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
816
+ #
817
+ # @example Basic example
818
+ # require "google/cloud/discovery_engine/v1beta"
819
+ #
820
+ # # Create a client object. The client can be reused for multiple calls.
821
+ # client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new
822
+ #
823
+ # # Create a request. To set request fields, pass in keyword arguments.
824
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest.new
825
+ #
826
+ # # Call the resume_engine method.
827
+ # result = client.resume_engine request
828
+ #
829
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Engine.
830
+ # p result
831
+ #
832
+ def resume_engine request, options = nil
833
+ raise ::ArgumentError, "request must be provided" if request.nil?
834
+
835
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest
836
+
837
+ # Converts hash and nil to an options object
838
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
839
+
840
+ # Customize the options with defaults
841
+ metadata = @config.rpcs.resume_engine.metadata.to_h
842
+
843
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
844
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
845
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
846
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
847
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
848
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
849
+
850
+ header_params = {}
851
+ if request.name
852
+ header_params["name"] = request.name
853
+ end
854
+
855
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
856
+ metadata[:"x-goog-request-params"] ||= request_params_header
857
+
858
+ options.apply_defaults timeout: @config.rpcs.resume_engine.timeout,
859
+ metadata: metadata,
860
+ retry_policy: @config.rpcs.resume_engine.retry_policy
861
+
862
+ options.apply_defaults timeout: @config.timeout,
863
+ metadata: @config.metadata,
864
+ retry_policy: @config.retry_policy
865
+
866
+ @engine_service_stub.call_rpc :resume_engine, request, options: options do |response, operation|
867
+ yield response, operation if block_given?
868
+ return response
869
+ end
870
+ rescue ::GRPC::BadStatus => e
871
+ raise ::Google::Cloud::Error.from_error(e)
872
+ end
873
+
874
+ ##
875
+ # Tunes an existing engine. Only applicable if
876
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType SolutionType} is
877
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}.
878
+ #
879
+ # @overload tune_engine(request, options = nil)
880
+ # Pass arguments to `tune_engine` via a request object, either of type
881
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest} or an equivalent Hash.
882
+ #
883
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest, ::Hash]
884
+ # A request object representing the call parameters. Required. To specify no
885
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
886
+ # @param options [::Gapic::CallOptions, ::Hash]
887
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
888
+ #
889
+ # @overload tune_engine(name: nil)
890
+ # Pass arguments to `tune_engine` via keyword arguments. Note that at
891
+ # least one keyword argument is required. To specify no parameters, or to keep all
892
+ # the default parameter values, pass an empty Hash as a request object (see above).
893
+ #
894
+ # @param name [::String]
895
+ # Required. The resource name of the engine to tune.
896
+ # Format:
897
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
898
+ #
899
+ # @yield [response, operation] Access the result along with the RPC operation
900
+ # @yieldparam response [::Gapic::Operation]
901
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
902
+ #
903
+ # @return [::Gapic::Operation]
904
+ #
905
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
906
+ #
907
+ # @example Basic example
908
+ # require "google/cloud/discovery_engine/v1beta"
909
+ #
910
+ # # Create a client object. The client can be reused for multiple calls.
911
+ # client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new
912
+ #
913
+ # # Create a request. To set request fields, pass in keyword arguments.
914
+ # request = Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest.new
915
+ #
916
+ # # Call the tune_engine method.
917
+ # result = client.tune_engine request
918
+ #
919
+ # # The returned object is of type Gapic::Operation. You can use it to
920
+ # # check the status of an operation, cancel it, or wait for results.
921
+ # # Here is how to wait for a response.
922
+ # result.wait_until_done! timeout: 60
923
+ # if result.response?
924
+ # p result.response
925
+ # else
926
+ # puts "No response received."
927
+ # end
928
+ #
929
+ def tune_engine request, options = nil
930
+ raise ::ArgumentError, "request must be provided" if request.nil?
931
+
932
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest
933
+
934
+ # Converts hash and nil to an options object
935
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
936
+
937
+ # Customize the options with defaults
938
+ metadata = @config.rpcs.tune_engine.metadata.to_h
939
+
940
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
941
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
942
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
943
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
944
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
945
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
946
+
947
+ header_params = {}
948
+ if request.name
949
+ header_params["name"] = request.name
950
+ end
951
+
952
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
953
+ metadata[:"x-goog-request-params"] ||= request_params_header
954
+
955
+ options.apply_defaults timeout: @config.rpcs.tune_engine.timeout,
956
+ metadata: metadata,
957
+ retry_policy: @config.rpcs.tune_engine.retry_policy
958
+
959
+ options.apply_defaults timeout: @config.timeout,
960
+ metadata: @config.metadata,
961
+ retry_policy: @config.retry_policy
962
+
963
+ @engine_service_stub.call_rpc :tune_engine, request, options: options do |response, operation|
964
+ response = ::Gapic::Operation.new response, @operations_client, options: options
965
+ yield response, operation if block_given?
966
+ return response
967
+ end
968
+ rescue ::GRPC::BadStatus => e
969
+ raise ::Google::Cloud::Error.from_error(e)
970
+ end
971
+
686
972
  ##
687
973
  # Configuration class for the EngineService API.
688
974
  #
@@ -861,6 +1147,21 @@ module Google
861
1147
  # @return [::Gapic::Config::Method]
862
1148
  #
863
1149
  attr_reader :list_engines
1150
+ ##
1151
+ # RPC-specific configuration for `pause_engine`
1152
+ # @return [::Gapic::Config::Method]
1153
+ #
1154
+ attr_reader :pause_engine
1155
+ ##
1156
+ # RPC-specific configuration for `resume_engine`
1157
+ # @return [::Gapic::Config::Method]
1158
+ #
1159
+ attr_reader :resume_engine
1160
+ ##
1161
+ # RPC-specific configuration for `tune_engine`
1162
+ # @return [::Gapic::Config::Method]
1163
+ #
1164
+ attr_reader :tune_engine
864
1165
 
865
1166
  # @private
866
1167
  def initialize parent_rpcs = nil
@@ -874,6 +1175,12 @@ module Google
874
1175
  @get_engine = ::Gapic::Config::Method.new get_engine_config
875
1176
  list_engines_config = parent_rpcs.list_engines if parent_rpcs.respond_to? :list_engines
876
1177
  @list_engines = ::Gapic::Config::Method.new list_engines_config
1178
+ pause_engine_config = parent_rpcs.pause_engine if parent_rpcs.respond_to? :pause_engine
1179
+ @pause_engine = ::Gapic::Config::Method.new pause_engine_config
1180
+ resume_engine_config = parent_rpcs.resume_engine if parent_rpcs.respond_to? :resume_engine
1181
+ @resume_engine = ::Gapic::Config::Method.new resume_engine_config
1182
+ tune_engine_config = parent_rpcs.tune_engine if parent_rpcs.respond_to? :tune_engine
1183
+ @tune_engine = ::Gapic::Config::Method.new tune_engine_config
877
1184
 
878
1185
  yield self if block_given?
879
1186
  end
@@ -26,6 +26,9 @@ module Google
26
26
  module EngineService
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ API_VERSION = ""
31
+
29
32
  # @private
30
33
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
31
34
 
@@ -191,10 +194,11 @@ module Google
191
194
  # Customize the options with defaults
192
195
  metadata = @config.rpcs.list_operations.metadata.to_h
193
196
 
194
- # Set x-goog-api-client and x-goog-user-project headers
197
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
195
198
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
196
199
  lib_name: @config.lib_name, lib_version: @config.lib_version,
197
200
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
201
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
198
202
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
199
203
 
200
204
  header_params = {}
@@ -287,10 +291,11 @@ module Google
287
291
  # Customize the options with defaults
288
292
  metadata = @config.rpcs.get_operation.metadata.to_h
289
293
 
290
- # Set x-goog-api-client and x-goog-user-project headers
294
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
291
295
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
292
296
  lib_name: @config.lib_name, lib_version: @config.lib_version,
293
297
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
298
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
294
299
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
295
300
 
296
301
  header_params = {}
@@ -376,10 +381,11 @@ module Google
376
381
  # Customize the options with defaults
377
382
  metadata = @config.rpcs.delete_operation.metadata.to_h
378
383
 
379
- # Set x-goog-api-client and x-goog-user-project headers
384
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
380
385
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
381
386
  lib_name: @config.lib_name, lib_version: @config.lib_version,
382
387
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
388
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
383
389
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
384
390
 
385
391
  header_params = {}
@@ -470,10 +476,11 @@ module Google
470
476
  # Customize the options with defaults
471
477
  metadata = @config.rpcs.cancel_operation.metadata.to_h
472
478
 
473
- # Set x-goog-api-client and x-goog-user-project headers
479
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
474
480
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
475
481
  lib_name: @config.lib_name, lib_version: @config.lib_version,
476
482
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
483
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
477
484
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
478
485
 
479
486
  header_params = {}
@@ -574,10 +581,11 @@ module Google
574
581
  # Customize the options with defaults
575
582
  metadata = @config.rpcs.wait_operation.metadata.to_h
576
583
 
577
- # Set x-goog-api-client and x-goog-user-project headers
584
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
578
585
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
579
586
  lib_name: @config.lib_name, lib_version: @config.lib_version,
580
587
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
588
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
581
589
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
582
590
 
583
591
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,