google-cloud-discovery_engine-v1beta 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +742 -0
  3. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +199 -0
  4. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +693 -0
  5. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +520 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +48 -23
  7. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +21 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +48 -23
  9. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +296 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +275 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +180 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +449 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/credentials.rb +47 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +52 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +416 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +129 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest.rb +52 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service.rb +55 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +459 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/rank_service/credentials.rb +47 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/rank_service/paths.rb +52 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +426 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +129 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest.rb +52 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/rank_service.rb +55 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +2 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +11 -6
  28. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +11 -6
  29. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  30. data/lib/google/cloud/discovery_engine/v1beta.rb +2 -0
  31. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +67 -0
  32. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  33. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +32 -1
  34. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_services_pb.rb +25 -0
  35. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +1 -1
  36. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +3 -1
  37. data/lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb +6 -1
  38. data/lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb +12 -0
  39. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +52 -0
  40. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +45 -0
  41. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +46 -0
  42. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +13 -1
  43. data/lib/google/cloud/discoveryengine/v1beta/rank_service_pb.rb +49 -0
  44. data/lib/google/cloud/discoveryengine/v1beta/rank_service_services_pb.rb +45 -0
  45. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +7 -1
  46. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +1 -1
  47. data/lib/google/cloud/discoveryengine/v1beta/session_pb.rb +50 -0
  48. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +354 -0
  49. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +9 -1
  50. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +475 -0
  51. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +3 -5
  52. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +4 -0
  53. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +2 -2
  54. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +51 -0
  55. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +106 -0
  56. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +76 -0
  57. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +310 -24
  58. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +99 -0
  59. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +154 -22
  60. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +16 -1
  61. data/proto_docs/google/cloud/discoveryengine/v1beta/session.rb +85 -0
  62. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +1 -1
  63. metadata +28 -2
@@ -641,6 +641,260 @@ module Google
641
641
  raise ::Google::Cloud::Error.from_error(e)
642
642
  end
643
643
 
644
+ ##
645
+ # Pauses the training of an existing engine. Only applicable if
646
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType SolutionType} is
647
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}.
648
+ #
649
+ # @overload pause_engine(request, options = nil)
650
+ # Pass arguments to `pause_engine` via a request object, either of type
651
+ # {::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest} or an equivalent Hash.
652
+ #
653
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest, ::Hash]
654
+ # A request object representing the call parameters. Required. To specify no
655
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
656
+ # @param options [::Gapic::CallOptions, ::Hash]
657
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
658
+ #
659
+ # @overload pause_engine(name: nil)
660
+ # Pass arguments to `pause_engine` via keyword arguments. Note that at
661
+ # least one keyword argument is required. To specify no parameters, or to keep all
662
+ # the default parameter values, pass an empty Hash as a request object (see above).
663
+ #
664
+ # @param name [::String]
665
+ # Required. The name of the engine to pause.
666
+ # Format:
667
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
668
+ # @yield [result, operation] Access the result along with the TransportOperation object
669
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
670
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
671
+ #
672
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
673
+ #
674
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
675
+ #
676
+ # @example Basic example
677
+ # require "google/cloud/discovery_engine/v1beta"
678
+ #
679
+ # # Create a client object. The client can be reused for multiple calls.
680
+ # client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Rest::Client.new
681
+ #
682
+ # # Create a request. To set request fields, pass in keyword arguments.
683
+ # request = Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest.new
684
+ #
685
+ # # Call the pause_engine method.
686
+ # result = client.pause_engine request
687
+ #
688
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Engine.
689
+ # p result
690
+ #
691
+ def pause_engine request, options = nil
692
+ raise ::ArgumentError, "request must be provided" if request.nil?
693
+
694
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest
695
+
696
+ # Converts hash and nil to an options object
697
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
698
+
699
+ # Customize the options with defaults
700
+ call_metadata = @config.rpcs.pause_engine.metadata.to_h
701
+
702
+ # Set x-goog-api-client and x-goog-user-project headers
703
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
704
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
705
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
706
+ transports_version_send: [:rest]
707
+
708
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
709
+
710
+ options.apply_defaults timeout: @config.rpcs.pause_engine.timeout,
711
+ metadata: call_metadata,
712
+ retry_policy: @config.rpcs.pause_engine.retry_policy
713
+
714
+ options.apply_defaults timeout: @config.timeout,
715
+ metadata: @config.metadata,
716
+ retry_policy: @config.retry_policy
717
+
718
+ @engine_service_stub.pause_engine request, options do |result, operation|
719
+ yield result, operation if block_given?
720
+ return result
721
+ end
722
+ rescue ::Gapic::Rest::Error => e
723
+ raise ::Google::Cloud::Error.from_error(e)
724
+ end
725
+
726
+ ##
727
+ # Resumes the training of an existing engine. Only applicable if
728
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType SolutionType} is
729
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}.
730
+ #
731
+ # @overload resume_engine(request, options = nil)
732
+ # Pass arguments to `resume_engine` via a request object, either of type
733
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest} or an equivalent Hash.
734
+ #
735
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest, ::Hash]
736
+ # A request object representing the call parameters. Required. To specify no
737
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
738
+ # @param options [::Gapic::CallOptions, ::Hash]
739
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
740
+ #
741
+ # @overload resume_engine(name: nil)
742
+ # Pass arguments to `resume_engine` via keyword arguments. Note that at
743
+ # least one keyword argument is required. To specify no parameters, or to keep all
744
+ # the default parameter values, pass an empty Hash as a request object (see above).
745
+ #
746
+ # @param name [::String]
747
+ # Required. The name of the engine to resume.
748
+ # Format:
749
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
750
+ # @yield [result, operation] Access the result along with the TransportOperation object
751
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
752
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
753
+ #
754
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
755
+ #
756
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
757
+ #
758
+ # @example Basic example
759
+ # require "google/cloud/discovery_engine/v1beta"
760
+ #
761
+ # # Create a client object. The client can be reused for multiple calls.
762
+ # client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Rest::Client.new
763
+ #
764
+ # # Create a request. To set request fields, pass in keyword arguments.
765
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest.new
766
+ #
767
+ # # Call the resume_engine method.
768
+ # result = client.resume_engine request
769
+ #
770
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Engine.
771
+ # p result
772
+ #
773
+ def resume_engine request, options = nil
774
+ raise ::ArgumentError, "request must be provided" if request.nil?
775
+
776
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest
777
+
778
+ # Converts hash and nil to an options object
779
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
780
+
781
+ # Customize the options with defaults
782
+ call_metadata = @config.rpcs.resume_engine.metadata.to_h
783
+
784
+ # Set x-goog-api-client and x-goog-user-project headers
785
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
786
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
787
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
788
+ transports_version_send: [:rest]
789
+
790
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
791
+
792
+ options.apply_defaults timeout: @config.rpcs.resume_engine.timeout,
793
+ metadata: call_metadata,
794
+ retry_policy: @config.rpcs.resume_engine.retry_policy
795
+
796
+ options.apply_defaults timeout: @config.timeout,
797
+ metadata: @config.metadata,
798
+ retry_policy: @config.retry_policy
799
+
800
+ @engine_service_stub.resume_engine request, options do |result, operation|
801
+ yield result, operation if block_given?
802
+ return result
803
+ end
804
+ rescue ::Gapic::Rest::Error => e
805
+ raise ::Google::Cloud::Error.from_error(e)
806
+ end
807
+
808
+ ##
809
+ # Tunes an existing engine. Only applicable if
810
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType SolutionType} is
811
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}.
812
+ #
813
+ # @overload tune_engine(request, options = nil)
814
+ # Pass arguments to `tune_engine` via a request object, either of type
815
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest} or an equivalent Hash.
816
+ #
817
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest, ::Hash]
818
+ # A request object representing the call parameters. Required. To specify no
819
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
820
+ # @param options [::Gapic::CallOptions, ::Hash]
821
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
822
+ #
823
+ # @overload tune_engine(name: nil)
824
+ # Pass arguments to `tune_engine` via keyword arguments. Note that at
825
+ # least one keyword argument is required. To specify no parameters, or to keep all
826
+ # the default parameter values, pass an empty Hash as a request object (see above).
827
+ #
828
+ # @param name [::String]
829
+ # Required. The resource name of the engine to tune.
830
+ # Format:
831
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
832
+ # @yield [result, operation] Access the result along with the TransportOperation object
833
+ # @yieldparam result [::Gapic::Operation]
834
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
835
+ #
836
+ # @return [::Gapic::Operation]
837
+ #
838
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
839
+ #
840
+ # @example Basic example
841
+ # require "google/cloud/discovery_engine/v1beta"
842
+ #
843
+ # # Create a client object. The client can be reused for multiple calls.
844
+ # client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Rest::Client.new
845
+ #
846
+ # # Create a request. To set request fields, pass in keyword arguments.
847
+ # request = Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest.new
848
+ #
849
+ # # Call the tune_engine method.
850
+ # result = client.tune_engine request
851
+ #
852
+ # # The returned object is of type Gapic::Operation. You can use it to
853
+ # # check the status of an operation, cancel it, or wait for results.
854
+ # # Here is how to wait for a response.
855
+ # result.wait_until_done! timeout: 60
856
+ # if result.response?
857
+ # p result.response
858
+ # else
859
+ # puts "No response received."
860
+ # end
861
+ #
862
+ def tune_engine request, options = nil
863
+ raise ::ArgumentError, "request must be provided" if request.nil?
864
+
865
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest
866
+
867
+ # Converts hash and nil to an options object
868
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
869
+
870
+ # Customize the options with defaults
871
+ call_metadata = @config.rpcs.tune_engine.metadata.to_h
872
+
873
+ # Set x-goog-api-client and x-goog-user-project headers
874
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
875
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
876
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
877
+ transports_version_send: [:rest]
878
+
879
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
880
+
881
+ options.apply_defaults timeout: @config.rpcs.tune_engine.timeout,
882
+ metadata: call_metadata,
883
+ retry_policy: @config.rpcs.tune_engine.retry_policy
884
+
885
+ options.apply_defaults timeout: @config.timeout,
886
+ metadata: @config.metadata,
887
+ retry_policy: @config.retry_policy
888
+
889
+ @engine_service_stub.tune_engine request, options do |result, operation|
890
+ result = ::Gapic::Operation.new result, @operations_client, options: options
891
+ yield result, operation if block_given?
892
+ return result
893
+ end
894
+ rescue ::Gapic::Rest::Error => e
895
+ raise ::Google::Cloud::Error.from_error(e)
896
+ end
897
+
644
898
  ##
645
899
  # Configuration class for the EngineService REST API.
646
900
  #
@@ -799,6 +1053,21 @@ module Google
799
1053
  # @return [::Gapic::Config::Method]
800
1054
  #
801
1055
  attr_reader :list_engines
1056
+ ##
1057
+ # RPC-specific configuration for `pause_engine`
1058
+ # @return [::Gapic::Config::Method]
1059
+ #
1060
+ attr_reader :pause_engine
1061
+ ##
1062
+ # RPC-specific configuration for `resume_engine`
1063
+ # @return [::Gapic::Config::Method]
1064
+ #
1065
+ attr_reader :resume_engine
1066
+ ##
1067
+ # RPC-specific configuration for `tune_engine`
1068
+ # @return [::Gapic::Config::Method]
1069
+ #
1070
+ attr_reader :tune_engine
802
1071
 
803
1072
  # @private
804
1073
  def initialize parent_rpcs = nil
@@ -812,6 +1081,12 @@ module Google
812
1081
  @get_engine = ::Gapic::Config::Method.new get_engine_config
813
1082
  list_engines_config = parent_rpcs.list_engines if parent_rpcs.respond_to? :list_engines
814
1083
  @list_engines = ::Gapic::Config::Method.new list_engines_config
1084
+ pause_engine_config = parent_rpcs.pause_engine if parent_rpcs.respond_to? :pause_engine
1085
+ @pause_engine = ::Gapic::Config::Method.new pause_engine_config
1086
+ resume_engine_config = parent_rpcs.resume_engine if parent_rpcs.respond_to? :resume_engine
1087
+ @resume_engine = ::Gapic::Config::Method.new resume_engine_config
1088
+ tune_engine_config = parent_rpcs.tune_engine if parent_rpcs.respond_to? :tune_engine
1089
+ @tune_engine = ::Gapic::Config::Method.new tune_engine_config
815
1090
 
816
1091
  yield self if block_given?
817
1092
  end
@@ -251,6 +251,120 @@ module Google
251
251
  result
252
252
  end
253
253
 
254
+ ##
255
+ # Baseline implementation for the pause_engine REST call
256
+ #
257
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest]
258
+ # A request object representing the call parameters. Required.
259
+ # @param options [::Gapic::CallOptions]
260
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
261
+ #
262
+ # @yield [result, operation] Access the result along with the TransportOperation object
263
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
264
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
265
+ #
266
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
267
+ # A result object deserialized from the server's reply
268
+ def pause_engine request_pb, options = nil
269
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
270
+
271
+ verb, uri, query_string_params, body = ServiceStub.transcode_pause_engine_request request_pb
272
+ query_string_params = if query_string_params.any?
273
+ query_string_params.to_h { |p| p.split "=", 2 }
274
+ else
275
+ {}
276
+ end
277
+
278
+ response = @client_stub.make_http_request(
279
+ verb,
280
+ uri: uri,
281
+ body: body || "",
282
+ params: query_string_params,
283
+ options: options
284
+ )
285
+ operation = ::Gapic::Rest::TransportOperation.new response
286
+ result = ::Google::Cloud::DiscoveryEngine::V1beta::Engine.decode_json response.body, ignore_unknown_fields: true
287
+
288
+ yield result, operation if block_given?
289
+ result
290
+ end
291
+
292
+ ##
293
+ # Baseline implementation for the resume_engine REST call
294
+ #
295
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest]
296
+ # A request object representing the call parameters. Required.
297
+ # @param options [::Gapic::CallOptions]
298
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
299
+ #
300
+ # @yield [result, operation] Access the result along with the TransportOperation object
301
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
302
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
303
+ #
304
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
305
+ # A result object deserialized from the server's reply
306
+ def resume_engine request_pb, options = nil
307
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
308
+
309
+ verb, uri, query_string_params, body = ServiceStub.transcode_resume_engine_request request_pb
310
+ query_string_params = if query_string_params.any?
311
+ query_string_params.to_h { |p| p.split "=", 2 }
312
+ else
313
+ {}
314
+ end
315
+
316
+ response = @client_stub.make_http_request(
317
+ verb,
318
+ uri: uri,
319
+ body: body || "",
320
+ params: query_string_params,
321
+ options: options
322
+ )
323
+ operation = ::Gapic::Rest::TransportOperation.new response
324
+ result = ::Google::Cloud::DiscoveryEngine::V1beta::Engine.decode_json response.body, ignore_unknown_fields: true
325
+
326
+ yield result, operation if block_given?
327
+ result
328
+ end
329
+
330
+ ##
331
+ # Baseline implementation for the tune_engine REST call
332
+ #
333
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest]
334
+ # A request object representing the call parameters. Required.
335
+ # @param options [::Gapic::CallOptions]
336
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
337
+ #
338
+ # @yield [result, operation] Access the result along with the TransportOperation object
339
+ # @yieldparam result [::Google::Longrunning::Operation]
340
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
341
+ #
342
+ # @return [::Google::Longrunning::Operation]
343
+ # A result object deserialized from the server's reply
344
+ def tune_engine request_pb, options = nil
345
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
346
+
347
+ verb, uri, query_string_params, body = ServiceStub.transcode_tune_engine_request request_pb
348
+ query_string_params = if query_string_params.any?
349
+ query_string_params.to_h { |p| p.split "=", 2 }
350
+ else
351
+ {}
352
+ end
353
+
354
+ response = @client_stub.make_http_request(
355
+ verb,
356
+ uri: uri,
357
+ body: body || "",
358
+ params: query_string_params,
359
+ options: options
360
+ )
361
+ operation = ::Gapic::Rest::TransportOperation.new response
362
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
363
+
364
+ yield result, operation if block_given?
365
+ result
366
+ end
367
+
254
368
  ##
255
369
  # @private
256
370
  #
@@ -357,6 +471,72 @@ module Google
357
471
  )
358
472
  transcoder.transcode request_pb
359
473
  end
474
+
475
+ ##
476
+ # @private
477
+ #
478
+ # GRPC transcoding helper method for the pause_engine REST call
479
+ #
480
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest]
481
+ # A request object representing the call parameters. Required.
482
+ # @return [Array(String, [String, nil], Hash{String => String})]
483
+ # Uri, Body, Query string parameters
484
+ def self.transcode_pause_engine_request request_pb
485
+ transcoder = Gapic::Rest::GrpcTranscoder.new
486
+ .with_bindings(
487
+ uri_method: :post,
488
+ uri_template: "/v1beta/{name}:pause",
489
+ body: "*",
490
+ matches: [
491
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false]
492
+ ]
493
+ )
494
+ transcoder.transcode request_pb
495
+ end
496
+
497
+ ##
498
+ # @private
499
+ #
500
+ # GRPC transcoding helper method for the resume_engine REST call
501
+ #
502
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest]
503
+ # A request object representing the call parameters. Required.
504
+ # @return [Array(String, [String, nil], Hash{String => String})]
505
+ # Uri, Body, Query string parameters
506
+ def self.transcode_resume_engine_request request_pb
507
+ transcoder = Gapic::Rest::GrpcTranscoder.new
508
+ .with_bindings(
509
+ uri_method: :post,
510
+ uri_template: "/v1beta/{name}:resume",
511
+ body: "*",
512
+ matches: [
513
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false]
514
+ ]
515
+ )
516
+ transcoder.transcode request_pb
517
+ end
518
+
519
+ ##
520
+ # @private
521
+ #
522
+ # GRPC transcoding helper method for the tune_engine REST call
523
+ #
524
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest]
525
+ # A request object representing the call parameters. Required.
526
+ # @return [Array(String, [String, nil], Hash{String => String})]
527
+ # Uri, Body, Query string parameters
528
+ def self.transcode_tune_engine_request request_pb
529
+ transcoder = Gapic::Rest::GrpcTranscoder.new
530
+ .with_bindings(
531
+ uri_method: :post,
532
+ uri_template: "/v1beta/{name}:tune",
533
+ body: "*",
534
+ matches: [
535
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false]
536
+ ]
537
+ )
538
+ transcoder.transcode request_pb
539
+ end
360
540
  end
361
541
  end
362
542
  end